diff --git a/.editorconfig b/.editorconfig
index 20e523d..492423d 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -11,4 +11,4 @@ trim_trailing_whitespace = true
[*.yml]
indent_style = space
-indent_size = 2
+indent_size = 2
\ No newline at end of file
diff --git a/src/nginxconfig/generators/conf/nginx.conf.js b/src/nginxconfig/generators/conf/nginx.conf.js
index cb250b7..b0b08b9 100644
--- a/src/nginxconfig/generators/conf/nginx.conf.js
+++ b/src/nginxconfig/generators/conf/nginx.conf.js
@@ -111,9 +111,24 @@ export default (domains, global) => {
|| global.https.ocspGoogle.computed
|| global.https.ocspOpenDns.computed) {
const ips = [];
- if (global.https.ocspCloudflare.computed) ips.push('1.1.1.1', '1.0.0.1');
- if (global.https.ocspGoogle.computed) ips.push('8.8.8.8', '8.8.4.4');
- if (global.https.ocspOpenDns.computed) ips.push('208.67.222.222', '208.67.220.220');
+ if (global.https.ocspCloudflare.computed) {
+ if (['ipv4', 'both'].includes(global.https.ocspCloudflareType.computed))
+ ips.push('1.1.1.1', '1.0.0.1');
+ if (['ipv6', 'both'].includes(global.https.ocspCloudflareType.computed))
+ ips.push('[2606:4700:4700::1111]', '[2606:4700:4700::1001]');
+ }
+ if (global.https.ocspGoogle.computed) {
+ if (['ipv4', 'both'].includes(global.https.ocspGoogleType.computed))
+ ips.push('8.8.8.8', '8.8.4.4');
+ if (['ipv6', 'both'].includes(global.https.ocspGoogleType.computed))
+ ips.push('[2001:4860:4860::8888]', '[2001:4860:4860::8844]');
+ }
+ if (global.https.ocspOpenDns.computed) {
+ if (['ipv4', 'both'].includes(global.https.ocspOpenDnsType.computed))
+ ips.push('208.67.222.222', '208.67.220.220');
+ if (['ipv6', 'both'].includes(global.https.ocspOpenDnsType.computed))
+ ips.push('[2620:119:35::35]', '[2620:119:53::53]');
+ }
config.http.push(['resolver', `${ips.join(' ')} valid=60s`]);
config.http.push(['resolver_timeout', '2s']);
diff --git a/src/nginxconfig/generators/conf/website.conf.js b/src/nginxconfig/generators/conf/website.conf.js
index 43a7b05..ea01f58 100644
--- a/src/nginxconfig/generators/conf/website.conf.js
+++ b/src/nginxconfig/generators/conf/website.conf.js
@@ -202,7 +202,7 @@ export default (domain, domains, global) => {
serverConfig.push(['# handle .php', '']);
const loc = `location ~ ${domain.routing.legacyPhpRouting.computed ? '[^/]\\.php(/|$)' : '\\.php$'}`;
- if (global.tools.modularizedStructure.computed) {
+ if (global.tools.modularizedStructure.computed || domain.php.wordPressRules.computed) {
// Modularized
serverConfig.push([loc, { include: 'nginxconfig.io/php_fastcgi.conf' }]);
} else {
diff --git a/src/nginxconfig/generators/conf/wordpress.conf.js b/src/nginxconfig/generators/conf/wordpress.conf.js
index 3e3ab5b..5aabb4a 100644
--- a/src/nginxconfig/generators/conf/wordpress.conf.js
+++ b/src/nginxconfig/generators/conf/wordpress.conf.js
@@ -32,6 +32,9 @@ export default global => {
deny: 'all',
};
+ config['# WordPress: SEO plugin'] = '';
+ config['location ~* ^/wp-content/plugins/wordpress-seo(?:-premium)?/css/main-sitemap\\.xsl$'] = {};
+
config['# WordPress: deny wp-content/plugins (except earlier rules)'] = '';
config['location ~ ^/wp-content/plugins'] = {
deny: 'all',
diff --git a/src/nginxconfig/generators/index.js b/src/nginxconfig/generators/index.js
index 38636f0..d6d61ca 100644
--- a/src/nginxconfig/generators/index.js
+++ b/src/nginxconfig/generators/index.js
@@ -77,6 +77,10 @@ export default (domains, global) => {
if (domains.some(d => d.php.magentoRules.computed))
files.push(['nginxconfig.io/magento.conf', toConf(magentoConf())]);
+ } else {
+ // PHP
+ if (domains.some(d => d.php.wordPressRules.computed))
+ files.push(['nginxconfig.io/php_fastcgi.conf', toConf(phpConf(domains, global))]);
}
return files;
diff --git a/src/nginxconfig/generators/to_conf.js b/src/nginxconfig/generators/to_conf.js
index d2c1bb9..3a3dcc8 100644
--- a/src/nginxconfig/generators/to_conf.js
+++ b/src/nginxconfig/generators/to_conf.js
@@ -107,7 +107,9 @@ export default entriesOrObject => {
// Single linebreak between comment and block
.replace(/^([^\S\r\n]*#.*)(?:\n[^\S\r\n]*)+\n([^\S\r\n]*.*{)/gm, '$1\n$2')
// Double linebreak after double comment
- .replace(/^([^\S\r\n]*#.*\n[^\S\r\n]*#.*\n)([^\S\r\n]*[^#\s])/gm, '$1\n$2');
+ .replace(/^([^\S\r\n]*#.*\n[^\S\r\n]*#.*\n)([^\S\r\n]*[^#\s])/gm, '$1\n$2')
+ // No newline for empty blocks
+ .replace(/^([^\S\r\n]*.*{)\n[^\S\r\n]*(})/gm, '$1$2');
// Cleanup extra linebreaks between multiple close blocks
// Use a loop as this has overlapping matches
diff --git a/src/nginxconfig/i18n/en/common.js b/src/nginxconfig/i18n/en/common.js
new file mode 100644
index 0000000..a651d42
--- /dev/null
+++ b/src/nginxconfig/i18n/en/common.js
@@ -0,0 +1,33 @@
+/*
+Copyright 2020 DigitalOcean
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+export default {
+ back: 'Back',
+ next: 'Next',
+ enable: 'enable',
+ php: 'PHP',
+ ssl: 'SSL',
+ nginx: 'NGINX',
+ http: 'HTTP',
+ https: 'HTTPS',
+ letsEncrypt: 'Let\'s Encrypt',
+ python: 'Python',
+ wordPress: 'WordPress',
+ drupal: 'Drupal',
+ magento: 'Magento',
+ django: 'Django',
+ logging: 'Logging',
+};
diff --git a/src/nginxconfig/i18n/en/index.js b/src/nginxconfig/i18n/en/index.js
index 0e9cbe0..e7ef6e9 100644
--- a/src/nginxconfig/i18n/en/index.js
+++ b/src/nginxconfig/i18n/en/index.js
@@ -14,8 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
+import common from './common';
import templates from './templates';
-// TODO: centralised shared strings
-
-export default { templates };
+export default { common, templates };
diff --git a/src/nginxconfig/i18n/en/templates/app.js b/src/nginxconfig/i18n/en/templates/app.js
index 13090ea..2338222 100644
--- a/src/nginxconfig/i18n/en/templates/app.js
+++ b/src/nginxconfig/i18n/en/templates/app.js
@@ -14,8 +14,17 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
+import common from '../common';
+
export default {
- title: 'NGINXConfig',
- description: 'The easiest way to configure a performant, secure, and stable NGINX server.',
- oss: 'This tool is {link|open-source on GitHub|https://github.com/do-community/nginxconfig-vue} under the {link|Apache-2.0|https://github.com/do-community/nginxconfig-vue/blob/master/LICENSE} license! We welcome feedback and contributions.',
+ title: `${common.nginx}Config`,
+ description: `The easiest way to configure a performant, secure, and stable ${common.nginx} server.`,
+ singleColumnMode: 'Single column mode',
+ splitColumnMode: 'Split column mode',
+ perWebsiteConfig: 'Per-website config',
+ addSite: 'Add site',
+ globalConfig: 'Global config',
+ setup: 'Setup',
+ configFiles: 'Config files',
+ oss: 'This tool is {link|open-source on GitHub|https://github.com/digitalocean/nginxconfig.io} under the {link|Apache-2.0|https://github.com/digitalocean/nginxconfig.io/blob/master/LICENSE} license! We welcome feedback and contributions.',
};
diff --git a/src/nginxconfig/i18n/en/templates/domain_sections/https.js b/src/nginxconfig/i18n/en/templates/domain_sections/https.js
index 943b911..80b43f6 100644
--- a/src/nginxconfig/i18n/en/templates/domain_sections/https.js
+++ b/src/nginxconfig/i18n/en/templates/domain_sections/https.js
@@ -14,16 +14,16 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
+import common from '../../common';
+
export default {
- https: 'HTTPS',
- enableEncryptedSslConnection: 'enable encrypted SSL connections',
- http2: 'HTTP/2',
- enableHttp2Connections: 'enable HTTP/2 connections',
- forceHttps: 'Force HTTPS',
+ enableEncryptedSslConnection: `${common.enable} encrypted ${common.ssl} connections`,
+ http2: `${common.http}/2`,
+ enableHttp2Connections: `${common.enable} ${common.http}/2 connections`,
+ forceHttps: `Force ${common.https}`,
hsts: 'HSTS',
- enableStrictTransportSecurity: 'enable Strict Transport Security',
+ enableStrictTransportSecurity: `${common.enable} Strict Transport Security`,
certificationType: 'Certification type',
- letsEncrypt: 'Let\'s Encrypt',
customCertificate: 'Custom certificate',
- letsEncryptEmail: 'Let\'s Encrypt email',
+ letsEncryptEmail: `${common.letsEncrypt} email`,
};
diff --git a/src/nginxconfig/i18n/en/templates/domain_sections/logging.js b/src/nginxconfig/i18n/en/templates/domain_sections/logging.js
index 86355a2..9d664dc 100644
--- a/src/nginxconfig/i18n/en/templates/domain_sections/logging.js
+++ b/src/nginxconfig/i18n/en/templates/domain_sections/logging.js
@@ -14,8 +14,9 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
+import common from '../../common';
+
export default {
byDomain: 'by domain',
- enableForThisDomain: 'enable for this domain',
- logging: 'Logging',
+ enableForThisDomain: `${common.enable} for this domain`,
};
diff --git a/src/nginxconfig/i18n/en/templates/domain_sections/php.js b/src/nginxconfig/i18n/en/templates/domain_sections/php.js
index 2b44364..5d9ca0a 100644
--- a/src/nginxconfig/i18n/en/templates/domain_sections/php.js
+++ b/src/nginxconfig/i18n/en/templates/domain_sections/php.js
@@ -14,16 +14,17 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
+import common from '../../common';
+
export default {
- php: 'PHP',
- phpIsDisabled: 'PHP is disabled.',
- phpCannotBeEnabledWithReverseProxy: 'PHP cannot be enabled whilst the reverse proxy is enabled.',
- phpCannotBeEnabledWithPython: 'PHP cannot be enabled whilst Python is enabled.',
- enablePhp: 'enable PHP',
- wordPressRules: 'WordPress rules',
- enableWordPressRules: 'enable WordPress-specific rules',
- drupalRules: 'Drupal rules',
- enableDrupalRules: 'enable Drupal-specific rules',
- magentoRules: 'Magento rules',
- enableMagentoRules: 'enable Magento-specific rules',
+ phpIsDisabled: `${common.php} is disabled.`,
+ phpCannotBeEnabledWithReverseProxy: `${common.php} cannot be enabled whilst the reverse proxy is enabled.`,
+ phpCannotBeEnabledWithPython: `${common.php} cannot be enabled whilst ${common.python} is enabled.`,
+ enablePhp: `${common.enable} ${common.php}`,
+ wordPressRules: `${common.wordPress} rules`,
+ enableWordPressRules: `${common.enable} ${common.wordPress}-specific rules`,
+ drupalRules: `${common.drupal} rules`,
+ enableDrupalRules: `${common.enable} ${common.drupal}-specific rules`,
+ magentoRules: `${common.magento} rules`,
+ enableMagentoRules: `${common.enable} ${common.magento}-specific rules`,
};
diff --git a/src/nginxconfig/i18n/en/templates/domain_sections/presets.js b/src/nginxconfig/i18n/en/templates/domain_sections/presets.js
index 2bbfb3a..cfea4d8 100644
--- a/src/nginxconfig/i18n/en/templates/domain_sections/presets.js
+++ b/src/nginxconfig/i18n/en/templates/domain_sections/presets.js
@@ -18,11 +18,6 @@ export default {
presets: 'Presets',
itLooksLikeYouCustomisedTheConfig: 'It looks like you\'ve customised the configuration for this domain. Choosing a new preset may reset or change some of the settings that you\'ve customised.',
frontend: 'Frontend',
- php: 'PHP',
- django: 'Django',
nodeJs: 'Node.js',
singlePageApplication: 'Single-page application',
- wordPress: 'WordPress',
- drupal: 'Drupal',
- magento: 'Magento',
};
diff --git a/src/nginxconfig/i18n/en/templates/domain_sections/python.js b/src/nginxconfig/i18n/en/templates/domain_sections/python.js
index c6c5e6a..bbf4294 100644
--- a/src/nginxconfig/i18n/en/templates/domain_sections/python.js
+++ b/src/nginxconfig/i18n/en/templates/domain_sections/python.js
@@ -14,12 +14,13 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
+import common from '../../common';
+
export default {
- python: 'Python',
- pythonIsDisabled: 'Python is disabled.',
- pythonCannotBeEnabledWithReverseProxy: 'Python cannot be enabled whilst the reverse proxy is enabled.',
- pythonCannotBeEnabledWithPhp: 'Python cannot be enabled whilst PHP is enabled.',
- enablePython: 'enable Python',
- djangoRules: 'Django rules',
- enableDjangoRules: 'enable Django-specific rules',
+ pythonIsDisabled: `${common.python} is disabled.`,
+ pythonCannotBeEnabledWithReverseProxy: `${common.python} cannot be enabled whilst the reverse proxy is enabled.`,
+ pythonCannotBeEnabledWithPhp: `${common.python} cannot be enabled whilst ${common.php} is enabled.`,
+ enablePython: `${common.enable} ${common.python}`,
+ djangoRules: `${common.django} rules`,
+ enableDjangoRules: `${common.enable} ${common.django}-specific rules`,
};
diff --git a/src/nginxconfig/i18n/en/templates/domain_sections/reverse_proxy.js b/src/nginxconfig/i18n/en/templates/domain_sections/reverse_proxy.js
index b10c514..133b199 100644
--- a/src/nginxconfig/i18n/en/templates/domain_sections/reverse_proxy.js
+++ b/src/nginxconfig/i18n/en/templates/domain_sections/reverse_proxy.js
@@ -14,11 +14,13 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
+import common from '../../common';
+
export default {
reverseProxy: 'Reverse proxy',
reverseProxyIsDisabled: 'Reverse proxy is disabled.',
- reverseProxyCannotBeEnabledWithPhp: 'Reverse proxy cannot be enabled whilst PHP is enabled.',
- reverseProxyCannotBeEnabledWithPython: 'Reverse proxy cannot be enabled whilst Python is enabled.',
- enableReverseProxy: 'enable reverse proxy',
+ reverseProxyCannotBeEnabledWithPhp: `Reverse proxy cannot be enabled whilst ${common.php} is enabled.`,
+ reverseProxyCannotBeEnabledWithPython: `Reverse proxy cannot be enabled whilst ${common.python} is enabled.`,
+ enableReverseProxy: `${common.enable} reverse proxy`,
path: 'Path',
};
diff --git a/src/nginxconfig/i18n/en/templates/domain_sections/routing.js b/src/nginxconfig/i18n/en/templates/domain_sections/routing.js
index f68cd04..d6b54c7 100644
--- a/src/nginxconfig/i18n/en/templates/domain_sections/routing.js
+++ b/src/nginxconfig/i18n/en/templates/domain_sections/routing.js
@@ -14,12 +14,13 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
+import common from '../../common';
+
export default {
- enable: 'enable',
fallbackRouting: 'Fallback routing',
- fallbackRoutingPhpPath: 'Fallback routing PHP path',
- legacyPhpRouting: 'Legacy PHP routing',
- enableLegacyRouting: 'enable legacy routing',
+ fallbackRoutingPhpPath: `Fallback routing ${common.php} path`,
+ legacyPhpRouting: `Legacy ${common.php} routing`,
+ enableLegacyRouting: `${common.enable} legacy routing`,
path: 'Path',
routing: 'Routing',
};
diff --git a/src/nginxconfig/i18n/en/templates/global_sections/https.js b/src/nginxconfig/i18n/en/templates/global_sections/https.js
index 8b9181c..6b3f483 100644
--- a/src/nginxconfig/i18n/en/templates/global_sections/https.js
+++ b/src/nginxconfig/i18n/en/templates/global_sections/https.js
@@ -14,16 +14,24 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
+import common from '../../common';
+
+const mozilla = 'Mozilla';
+const ipv4 = 'IPv4';
+const ipv6 = 'IPv6';
+
export default {
- sslProfile: 'SSL Profile',
- httpsMustBeEnabledOnOneSite: 'HTTPS must be enabled on at least one site to configure global HTTPS settings.',
+ sslProfile: `${common.ssl} Profile`,
+ httpsMustBeEnabledOnOneSite: `${common.https} must be enabled on at least one site to configure global ${common.https} settings.`,
ocspDnsResolvers: 'OCSP DNS Resolvers',
cloudflareResolver: 'Cloudflare Resolver',
googlePublicDns: 'Google Public DNS',
openDns: 'OpenDNS',
- letsEncryptWebroot: 'Let\'s Encrypt webroot',
- mozillaModern: 'Mozilla Modern',
- mozillaIntermediate: 'Mozilla Intermediate',
- mozillaOld: 'Mozilla Old',
- https: 'HTTPS',
+ letsEncryptWebroot: `${common.letsEncrypt} webroot`,
+ mozillaModern: `${mozilla} Modern`,
+ mozillaIntermediate: `${mozilla} Intermediate`,
+ mozillaOld: `${mozilla} Old`,
+ ipv4Only: `${ipv4} only`,
+ ipv6Only: `${ipv6} only`,
+ ipv4AndIpv6: `${ipv4} & ${ipv6}`,
};
diff --git a/src/nginxconfig/i18n/en/templates/global_sections/logging.js b/src/nginxconfig/i18n/en/templates/global_sections/logging.js
index e3ddd52..dcefc45 100644
--- a/src/nginxconfig/i18n/en/templates/global_sections/logging.js
+++ b/src/nginxconfig/i18n/en/templates/global_sections/logging.js
@@ -14,7 +14,8 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
+import common from '../../common';
+
export default {
- enableFileNotFoundErrorLogging: 'enable file not found error logging in',
- logging: 'Logging',
+ enableFileNotFoundErrorLogging: `${common.enable} file not found error logging in`,
};
diff --git a/src/nginxconfig/i18n/en/templates/global_sections/nginx.js b/src/nginxconfig/i18n/en/templates/global_sections/nginx.js
index 07b4ea5..3934a74 100644
--- a/src/nginxconfig/i18n/en/templates/global_sections/nginx.js
+++ b/src/nginxconfig/i18n/en/templates/global_sections/nginx.js
@@ -14,8 +14,9 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
+import common from '../../common';
+
export default {
- nginxConfigDirectory: 'NGINX config directory',
+ nginxConfigDirectory: `${common.nginx} config directory`,
mb: 'MB',
- nginx: 'NGINX',
};
diff --git a/src/nginxconfig/i18n/en/templates/global_sections/performance.js b/src/nginxconfig/i18n/en/templates/global_sections/performance.js
index 51e875c..94ba8f0 100644
--- a/src/nginxconfig/i18n/en/templates/global_sections/performance.js
+++ b/src/nginxconfig/i18n/en/templates/global_sections/performance.js
@@ -14,11 +14,13 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
+import common from '../../common';
+
export default {
gzipCompression: 'Gzip compression',
- enableGzipCompression: 'enable gzip compression',
+ enableGzipCompression: `${common.enable} gzip compression`,
brotliCompression: 'Brotli compression',
- enableBrotliCompression: 'enable brotli compression',
+ enableBrotliCompression: `${common.enable} brotli compression`,
expirationForAssets: 'Expiration for assets',
expirationForMedia: 'Expiration for media',
expirationForSvgs: 'Expiration for SVGs',
diff --git a/src/nginxconfig/i18n/en/templates/global_sections/php.js b/src/nginxconfig/i18n/en/templates/global_sections/php.js
index ba7a5b3..4131b51 100644
--- a/src/nginxconfig/i18n/en/templates/global_sections/php.js
+++ b/src/nginxconfig/i18n/en/templates/global_sections/php.js
@@ -14,10 +14,12 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
+import common from '../../common';
+
export default {
- phpServer: 'PHP server',
- phpMustBeEnabledOnOneSite: 'PHP must be enabled on at least one site to configure global PHP settings.',
- phpBackupServer: 'PHP backup server',
+ phpServer: `${common.php} server`,
+ phpMustBeEnabledOnOneSite: `${common.php} must be enabled on at least one site to configure global ${common.php} settings.`,
+ phpBackupServer: `${common.php} backup server`,
tcp: 'TCP',
hhvmSocket: 'HHVM socket',
php5Socket: '5.x socket',
@@ -26,5 +28,4 @@ export default {
php72Socket: '7.2 socket',
php73Socket: '7.3 socket',
disabled: 'Disabled',
- php: 'PHP',
};
diff --git a/src/nginxconfig/i18n/en/templates/global_sections/python.js b/src/nginxconfig/i18n/en/templates/global_sections/python.js
index 5b33d15..03f2750 100644
--- a/src/nginxconfig/i18n/en/templates/global_sections/python.js
+++ b/src/nginxconfig/i18n/en/templates/global_sections/python.js
@@ -14,8 +14,9 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
+import common from '../../common';
+
export default {
- pythonServer: 'Python server',
- pythonMustBeEnabledOnOneSite: 'Python must be enabled on at least one site to configure global Python settings.',
- python: 'Python',
+ pythonServer: `${common.python} server`,
+ pythonMustBeEnabledOnOneSite: `${common.python} must be enabled on at least one site to configure global ${common.python} settings.`,
};
diff --git a/src/nginxconfig/i18n/en/templates/global_sections/security.js b/src/nginxconfig/i18n/en/templates/global_sections/security.js
index df0e66f..a2ad58d 100644
--- a/src/nginxconfig/i18n/en/templates/global_sections/security.js
+++ b/src/nginxconfig/i18n/en/templates/global_sections/security.js
@@ -14,7 +14,9 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
+import common from '../../common';
+
export default {
- enable: 'enable',
+ whenUsingWordPressUnsafeEvalIsOftenRequiredToAllowFunctionality: `When using ${common.wordPress}, 'unsafe-eval'
is often required in the Content Security Policy to allow the admin panel to function correctly.`,
security: 'Security',
};
diff --git a/src/nginxconfig/i18n/en/templates/global_sections/tools.js b/src/nginxconfig/i18n/en/templates/global_sections/tools.js
index ed7327e..e368399 100644
--- a/src/nginxconfig/i18n/en/templates/global_sections/tools.js
+++ b/src/nginxconfig/i18n/en/templates/global_sections/tools.js
@@ -14,11 +14,13 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
+import common from '../../common';
+
export default {
modularizedStructure: 'Modularized structure',
- enableModularizedConfigFiles: 'enable modularized config files',
+ enableModularizedConfigFiles: `${common.enable} modularized config files`,
symlinkVhost: 'Symlink vhost',
- enableSymLinksFrom: 'enable symlinks from',
+ enableSymLinksFrom: `${common.enable} symlinks from`,
to: 'to',
shareConfiguration: 'Share configuration',
resetConfiguration: 'Reset configuration',
diff --git a/src/nginxconfig/i18n/en/templates/index.js b/src/nginxconfig/i18n/en/templates/index.js
index 3b8ce2d..d9c1982 100644
--- a/src/nginxconfig/i18n/en/templates/index.js
+++ b/src/nginxconfig/i18n/en/templates/index.js
@@ -15,7 +15,9 @@ limitations under the License.
*/
import app from './app';
+import setup from './setup';
import domainSections from './domain_sections';
import globalSections from './global_sections';
+import setupSections from './setup_sections';
-export default { app, domainSections, globalSections };
+export default { app, setup, domainSections, globalSections, setupSections };
diff --git a/src/nginxconfig/i18n/en/templates/setup.js b/src/nginxconfig/i18n/en/templates/setup.js
new file mode 100644
index 0000000..f025229
--- /dev/null
+++ b/src/nginxconfig/i18n/en/templates/setup.js
@@ -0,0 +1,20 @@
+/*
+Copyright 2020 DigitalOcean
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+export default {
+ downloadConfig: 'Download Config',
+ copyBase64: 'Copy Base64',
+};
diff --git a/src/nginxconfig/i18n/en/templates/setup_sections/certbot.js b/src/nginxconfig/i18n/en/templates/setup_sections/certbot.js
new file mode 100644
index 0000000..a572be7
--- /dev/null
+++ b/src/nginxconfig/i18n/en/templates/setup_sections/certbot.js
@@ -0,0 +1,29 @@
+/*
+Copyright 2020 DigitalOcean
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+import common from '../../common';
+
+const certbot = 'Certbot';
+
+export default {
+ commentOutSslDirectivesInConfiguration: `Comment out ${common.ssl} related directives in the configuration:`,
+ reloadYourNginxServer: `Reload your ${common.nginx} server:`,
+ obtainSslCertificatesFromLetsEncrypt: `Obtain ${common.ssl} certificates from ${common.letsEncrypt} using ${certbot}:`,
+ uncommentSslDirectivesInConfiguration: `Uncomment ${common.ssl} related directives in the configuration:`,
+ configureCertbotToReloadNginxOnCertificateRenewal: `Configure ${certbot} to reload ${common.nginx} when it successfully renews certificates:`,
+ certbotDoesNotNeedToBeSetupForYourConfiguration: `${certbot} does not need to be set up for your ${common.nginx} configuration.`,
+ certbot,
+};
diff --git a/src/nginxconfig/i18n/en/templates/setup_sections/download.js b/src/nginxconfig/i18n/en/templates/setup_sections/download.js
new file mode 100644
index 0000000..04200e3
--- /dev/null
+++ b/src/nginxconfig/i18n/en/templates/setup_sections/download.js
@@ -0,0 +1,30 @@
+/*
+Copyright 2020 DigitalOcean
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+import common from '../../common';
+
+export default {
+ downloadTheGeneratedConfig: 'Download the generated config:',
+ andUploadItToYourServers: 'and upload it to your server\'s',
+ directory: 'directory.',
+ or: 'or, ',
+ copyBase64StringOfCompressedConfig: 'Copy a base64 string of the compressed config',
+ pasteItInYourServersCommandLineAndExecute: ', paste it in your server\'s command line and execute it.',
+ navigateToYourNginxConfigurationDirectoryOnYourServer: `Navigate to your ${common.nginx} configuration directory on your server:`,
+ createABackupOfYourCurrentNginxConfiguration: `Create a backup of your current ${common.nginx} configuration:`,
+ extractTheNewCompressedConfigurationArchiveUsingTar: 'Extract the new compressed configuration archive using tar:',
+ download: 'Download',
+};
diff --git a/src/nginxconfig/i18n/en/templates/setup_sections/go_live.js b/src/nginxconfig/i18n/en/templates/setup_sections/go_live.js
new file mode 100644
index 0000000..ced4c70
--- /dev/null
+++ b/src/nginxconfig/i18n/en/templates/setup_sections/go_live.js
@@ -0,0 +1,23 @@
+/*
+Copyright 2020 DigitalOcean
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+import common from '../../common';
+
+export default {
+ letsGoLive: 'Let\'s go live!',
+ reloadNginxToLoadInYourNewConfiguration: `Reload ${common.nginx} to load in your new configuration:`,
+ goLive: 'Go live!',
+};
diff --git a/src/nginxconfig/i18n/en/templates/setup_sections/index.js b/src/nginxconfig/i18n/en/templates/setup_sections/index.js
new file mode 100644
index 0000000..783faff
--- /dev/null
+++ b/src/nginxconfig/i18n/en/templates/setup_sections/index.js
@@ -0,0 +1,22 @@
+/*
+Copyright 2020 DigitalOcean
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+import certbot from './certbot';
+import download from './download';
+import goLive from './go_live';
+import ssl from './ssl';
+
+export default { certbot, download, goLive, ssl };
diff --git a/src/nginxconfig/i18n/en/templates/setup_sections/ssl.js b/src/nginxconfig/i18n/en/templates/setup_sections/ssl.js
new file mode 100644
index 0000000..ad159f2
--- /dev/null
+++ b/src/nginxconfig/i18n/en/templates/setup_sections/ssl.js
@@ -0,0 +1,24 @@
+/*
+Copyright 2020 DigitalOcean
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+import common from '../../common';
+
+export default {
+ generateDiffieHellmanKeysByRunningThisCommandOnYourServer: 'Generate Diffie-Hellman keys by running this command on your server:',
+ createACommonAcmeChallengeDirectoryForLetsEncrypt: `Create a common ACME-challenge directory (for ${common.letsEncrypt}):`,
+ noAdditionalStepsAreNeededToSetUpSslForNginx: `No additional steps are needed to set up ${common.ssl} for your ${common.nginx} configuration.`,
+ sslInit: `${common.ssl} init`,
+};
diff --git a/src/nginxconfig/scss/_fields.scss b/src/nginxconfig/scss/_fields.scss
index 49c4d52..e102daa 100644
--- a/src/nginxconfig/scss/_fields.scss
+++ b/src/nginxconfig/scss/_fields.scss
@@ -39,6 +39,10 @@ limitations under the License.
&.is-aligned-top {
align-items: flex-start;
}
+
+ + .control {
+ margin-top: .5rem;
+ }
}
&.is-grouped {
diff --git a/src/nginxconfig/templates/app.vue b/src/nginxconfig/templates/app.vue
index edd9256..6ee0349 100644
--- a/src/nginxconfig/templates/app.vue
+++ b/src/nginxconfig/templates/app.vue
@@ -24,10 +24,10 @@ limitations under the License.
- Single column mode
+ {{ i18n.templates.app.singleColumnMode }}
- Split column mode
+ {{ i18n.templates.app.splitColumnMode }}
@@ -35,7 +35,7 @@ limitations under the License.
-
Per-website config
+
{{ i18n.templates.app.perWebsiteConfig }}
@@ -60,15 +60,15 @@ limitations under the License.
>
-
Global config
+
{{ i18n.templates.app.globalConfig }}
-
Setup
+
{{ i18n.templates.app.setup }}
-
Config files
+
{{ i18n.templates.app.configFiles }}
@@ -50,6 +50,7 @@ limitations under the License.