Browse Source

Add prettier and run prettier command via lint-staged (#448)

pull/449/head
Nihal Maskey 1 year ago committed by GitHub
parent
commit
dbc954e7f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 81
      .eslintrc.cjs
  2. 19
      .github/workflows/test-workflow.yml
  3. 9
      .lintstagedrc.json
  4. 2
      .prettierignore
  5. 9
      .prettierrc.json
  6. 1064
      package-lock.json
  7. 17
      package.json
  8. 10
      src/nginxconfig/build/prism.js
  9. 5
      src/nginxconfig/build/template.js
  10. 6
      src/nginxconfig/generators/conf/drupal.conf.js
  11. 15
      src/nginxconfig/generators/conf/general.conf.js
  12. 1
      src/nginxconfig/generators/conf/joomla.conf.js
  13. 2
      src/nginxconfig/generators/conf/letsencrypt.conf.js
  14. 127
      src/nginxconfig/generators/conf/nginx.conf.js
  15. 2
      src/nginxconfig/generators/conf/php_fastcgi.conf.js
  16. 3
      src/nginxconfig/generators/conf/proxy.conf.js
  17. 7
      src/nginxconfig/generators/conf/python_uwsgi.conf.js
  18. 51
      src/nginxconfig/generators/conf/security.conf.js
  19. 303
      src/nginxconfig/generators/conf/website.conf.js
  20. 11
      src/nginxconfig/generators/conf/wordpress.conf.js
  21. 1
      src/nginxconfig/generators/ext/docker.js
  22. 39
      src/nginxconfig/generators/index.js
  23. 41
      src/nginxconfig/generators/to_conf.js
  24. 2
      src/nginxconfig/generators/to_yaml.js
  25. 2
      src/nginxconfig/i18n/de/common.js
  26. 3
      src/nginxconfig/i18n/de/templates/callouts/contribute.js
  27. 2
      src/nginxconfig/i18n/de/templates/callouts/droplet.js
  28. 13
      src/nginxconfig/i18n/de/templates/domain_sections/index.js
  29. 6
      src/nginxconfig/i18n/de/templates/domain_sections/onion.js
  30. 3
      src/nginxconfig/i18n/de/templates/domain_sections/presets.js
  31. 3
      src/nginxconfig/i18n/de/templates/domain_sections/server.js
  32. 12
      src/nginxconfig/i18n/de/templates/global_sections/index.js
  33. 9
      src/nginxconfig/i18n/de/templates/global_sections/tools.js
  34. 9
      src/nginxconfig/i18n/de/templates/setup_sections/download.js
  35. 3
      src/nginxconfig/i18n/de/templates/setup_sections/ssl.js
  36. 32
      src/nginxconfig/i18n/en/common.js
  37. 3
      src/nginxconfig/i18n/en/templates/callouts/contribute.js
  38. 2
      src/nginxconfig/i18n/en/templates/callouts/droplet.js
  39. 2
      src/nginxconfig/i18n/en/templates/domain_sections/https.js
  40. 13
      src/nginxconfig/i18n/en/templates/domain_sections/index.js
  41. 6
      src/nginxconfig/i18n/en/templates/domain_sections/onion.js
  42. 3
      src/nginxconfig/i18n/en/templates/domain_sections/presets.js
  43. 12
      src/nginxconfig/i18n/en/templates/global_sections/index.js
  44. 2
      src/nginxconfig/i18n/en/templates/global_sections/performance.js
  45. 8
      src/nginxconfig/i18n/en/templates/global_sections/tools.js
  46. 8
      src/nginxconfig/i18n/en/templates/setup_sections/download.js
  47. 2
      src/nginxconfig/i18n/en/templates/setup_sections/go_live.js
  48. 3
      src/nginxconfig/i18n/en/templates/setup_sections/ssl.js
  49. 2
      src/nginxconfig/i18n/es/common.js
  50. 3
      src/nginxconfig/i18n/es/templates/callouts/contribute.js
  51. 13
      src/nginxconfig/i18n/es/templates/domain_sections/index.js
  52. 9
      src/nginxconfig/i18n/es/templates/domain_sections/onion.js
  53. 3
      src/nginxconfig/i18n/es/templates/domain_sections/presets.js
  54. 3
      src/nginxconfig/i18n/es/templates/domain_sections/server.js
  55. 1
      src/nginxconfig/i18n/es/templates/global_sections/https.js
  56. 12
      src/nginxconfig/i18n/es/templates/global_sections/index.js
  57. 3
      src/nginxconfig/i18n/es/templates/global_sections/logging.js
  58. 2
      src/nginxconfig/i18n/es/templates/global_sections/performance.js
  59. 9
      src/nginxconfig/i18n/es/templates/global_sections/tools.js
  60. 6
      src/nginxconfig/i18n/es/templates/setup_sections/download.js
  61. 3
      src/nginxconfig/i18n/es/templates/setup_sections/ssl.js
  62. 2
      src/nginxconfig/i18n/fr/common.js
  63. 3
      src/nginxconfig/i18n/fr/templates/callouts/contribute.js
  64. 2
      src/nginxconfig/i18n/fr/templates/domain_sections/https.js
  65. 13
      src/nginxconfig/i18n/fr/templates/domain_sections/index.js
  66. 6
      src/nginxconfig/i18n/fr/templates/domain_sections/onion.js
  67. 3
      src/nginxconfig/i18n/fr/templates/domain_sections/presets.js
  68. 3
      src/nginxconfig/i18n/fr/templates/domain_sections/server.js
  69. 12
      src/nginxconfig/i18n/fr/templates/global_sections/index.js
  70. 2
      src/nginxconfig/i18n/fr/templates/global_sections/performance.js
  71. 9
      src/nginxconfig/i18n/fr/templates/global_sections/tools.js
  72. 6
      src/nginxconfig/i18n/fr/templates/setup_sections/download.js
  73. 4
      src/nginxconfig/i18n/fr/templates/setup_sections/go_live.js
  74. 3
      src/nginxconfig/i18n/fr/templates/setup_sections/ssl.js
  75. 2
      src/nginxconfig/i18n/ja/common.js
  76. 13
      src/nginxconfig/i18n/ja/templates/domain_sections/index.js
  77. 6
      src/nginxconfig/i18n/ja/templates/domain_sections/onion.js
  78. 3
      src/nginxconfig/i18n/ja/templates/domain_sections/presets.js
  79. 12
      src/nginxconfig/i18n/ja/templates/global_sections/index.js
  80. 3
      src/nginxconfig/i18n/ja/templates/global_sections/tools.js
  81. 6
      src/nginxconfig/i18n/ja/templates/setup_sections/download.js
  82. 3
      src/nginxconfig/i18n/ja/templates/setup_sections/ssl.js
  83. 2
      src/nginxconfig/i18n/pl/common.js
  84. 3
      src/nginxconfig/i18n/pl/templates/callouts/contribute.js
  85. 13
      src/nginxconfig/i18n/pl/templates/domain_sections/index.js
  86. 6
      src/nginxconfig/i18n/pl/templates/domain_sections/onion.js
  87. 3
      src/nginxconfig/i18n/pl/templates/domain_sections/presets.js
  88. 3
      src/nginxconfig/i18n/pl/templates/domain_sections/server.js
  89. 2
      src/nginxconfig/i18n/pl/templates/footer.js
  90. 12
      src/nginxconfig/i18n/pl/templates/global_sections/index.js
  91. 6
      src/nginxconfig/i18n/pl/templates/global_sections/tools.js
  92. 3
      src/nginxconfig/i18n/pl/templates/setup_sections/download.js
  93. 3
      src/nginxconfig/i18n/pl/templates/setup_sections/ssl.js
  94. 2
      src/nginxconfig/i18n/pt-br/common.js
  95. 3
      src/nginxconfig/i18n/pt-br/templates/callouts/contribute.js
  96. 2
      src/nginxconfig/i18n/pt-br/templates/callouts/droplet.js
  97. 2
      src/nginxconfig/i18n/pt-br/templates/domain_sections/https.js
  98. 13
      src/nginxconfig/i18n/pt-br/templates/domain_sections/index.js
  99. 6
      src/nginxconfig/i18n/pt-br/templates/domain_sections/onion.js
  100. 3
      src/nginxconfig/i18n/pt-br/templates/domain_sections/presets.js
  101. Some files were not shown because too many files have changed in this diff Show More

81
.eslintrc.cjs

@ -1,41 +1,44 @@
module.exports = {
env: {
'browser': true,
'node': true,
},
extends: [
'eslint:recommended',
'plugin:vue/recommended',
],
parserOptions: {
parser: '@babel/eslint-parser',
ecmaVersion: 2018,
sourceType: 'module',
requireConfigFile: false,
},
rules: {
'linebreak-style': ['error', 'unix'],
semi: ['error', 'always'],
quotes: ['error', 'single'],
'comma-dangle': ['error', 'always-multiline'],
'vue/require-v-for-key': 0,
'vue/require-default-prop': 0,
'vue/no-v-html': 0,
'vue/max-attributes-per-line': 0,
'vue/html-indent': ['error', 4],
'vue/script-indent': ['error', 4, {
baseIndent: 1,
}],
'vue/no-unused-vars': 0,
'vue/html-self-closing': 0,
'vue/multi-word-component-names': 0,
'vue/no-reserved-component-names': 0,
'eol-last': ['error', 'always'],
},
globals: {
'describe': true,
'expect': true,
'it': true,
'test': true,
},
env: {
browser: true,
node: true,
},
extends: ['eslint:recommended', 'plugin:vue/recommended', 'prettier'],
parserOptions: {
parser: '@babel/eslint-parser',
ecmaVersion: 2018,
sourceType: 'module',
requireConfigFile: false,
},
rules: {
'linebreak-style': ['error', 'unix'],
semi: ['error', 'always'],
'comma-dangle': ['error', 'always-multiline'],
'vue/require-v-for-key': 0,
'vue/require-default-prop': 0,
'vue/no-v-html': 0,
'vue/max-attributes-per-line': 0,
'vue/html-indent': ['error', 4],
'vue/script-indent': [
'error',
4,
{
baseIndent: 1,
switchCase: 1,
},
],
'vue/no-unused-vars': 'warn',
'vue/html-self-closing': 0,
'vue/multi-word-component-names': 0,
'vue/no-reserved-component-names': 0,
'eol-last': ['error', 'always'],
'prettier/prettier': 'error',
},
globals: {
describe: true,
expect: true,
it: true,
test: true,
},
plugins: ['prettier'],
};

19
.github/workflows/test-workflow.yml

@ -59,3 +59,22 @@ jobs:
- name: Test i18n packs integrity
run: npm run test:i18n-packs
prettier:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version-file: .nvmrc
cache: npm
- name: Install dependencies
run: npm ci
- name: Test with prettier
run: npm run test:prettier

9
.lintstagedrc.json

@ -0,0 +1,9 @@
{
"*.{js,vue}": [
"prettier --write",
"eslint --quiet --cache --fix"
],
"*.scss": [
"stylelint --config node_modules/do-bulma/.stylelintrc.json --fix"
]
}

2
.prettierignore

@ -0,0 +1,2 @@
package.json
package-lock.json

9
.prettierrc.json

@ -0,0 +1,9 @@
{
"singleQuote": true,
"trailingComma": "all",
"vueIndentScriptAndStyle": true,
"htmlWhitespaceSensitivity": "ignore",
"printWidth": 100,
"tabWidth": 4,
"singleAttributePerLine": true
}

1064
package-lock.json generated

File diff suppressed because it is too large Load Diff

17
package.json

@ -16,13 +16,15 @@
"dev": "npm run build:template && npm run build:prism && npm run dev:tool",
"dev:tool": "vue-cli-service serve src/nginxconfig/mount.js",
"deploy:spaces:comment": "do-vue comment nginxconfig",
"test": "npm run test:eslint && npm run test:stylelint && npm run test:i18n-packs && npm run test:jest",
"test": "npm run test:prettier:fix && npm run test:eslint && npm run test:stylelint && npm run test:i18n-packs && npm run test:jest",
"test:jest": "jest --env=jsdom /test/.*.js?$",
"test:fix": "npm run test:eslint:fix",
"test:fix": "npm run test:prettier:fix && npm run test:eslint:fix",
"test:eslint": "eslint 'src/**/*.{js,vue}' --cache",
"test:eslint:fix": "npm run test:eslint -- --fix",
"test:stylelint": "stylelint 'src/**/*.scss' --config node_modules/do-bulma/.stylelintrc.json",
"test:i18n-packs": "node --es-module-specifier-resolution=node src/nginxconfig/i18n/verify.js",
"test:prettier": "prettier 'src/**/*.{js,vue}' --check",
"test:prettier:fix": "prettier --write 'src/**/*.{js,vue}'",
"prepare": "husky install"
},
"jest": {
@ -71,6 +73,8 @@
"core-js": "^3.32.0",
"duplicate-package-checker-webpack-plugin": "^3.0.0",
"eslint": "^8.46.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-prettier": "^5.0.1",
"eslint-plugin-vue": "^9.16.1",
"esm": "^3.2.25",
"husky": "^8.0.3",
@ -79,6 +83,7 @@
"lint-staged": "^13.2.3",
"node-fetch": "^3.3.2",
"postcss": "^8.4.31",
"prettier": "3.0.3",
"sass": "^1.64.2",
"sass-loader": "^13.3.2",
"stylelint": "^15.10.2",
@ -88,14 +93,6 @@
"webpack": "^5.88.2",
"webpack-bundle-analyzer": "^4.9.0"
},
"lint-staged": {
"*.{js,vue}": [
"eslint --quiet --cache --fix"
],
"*.scss": [
"stylelint --config node_modules/do-bulma/.stylelintrc.json --fix"
]
},
"overrides": {
"@vue/cli-service": {
"mini-css-extract-plugin": "^1.6.2"

10
src/nginxconfig/build/prism.js

@ -39,7 +39,9 @@ const main = async () => {
await fs.writeFile(new URL(`${buildDir}/prism.css`, import.meta.url), fixed);
};
main().then(() => {}).catch(err => {
console.error(err);
process.exit(1);
});
main()
.then(() => {})
.catch((err) => {
console.error(err);
process.exit(1);
});

5
src/nginxconfig/build/template.js

@ -33,7 +33,10 @@ const main = () => {
let template = fs.readFileSync(new URL(`${buildDir}/base.html`, import.meta.url), 'utf8');
// Inject our title now
template = template.replace('<block name="title"><title>DigitalOcean</title></block>', '<title>NGINXConfig | DigitalOcean</title>');
template = template.replace(
'<block name="title"><title>DigitalOcean</title></block>',
'<title>NGINXConfig | DigitalOcean</title>',
);
// Inject our app mounting point
template = template.replace('<block name="content"></block>', '<div id="app"></div>');

6
src/nginxconfig/generators/conf/drupal.conf.js

@ -24,11 +24,13 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
export default global => {
export default (global) => {
const config = {};
config['# Drupal: deny private files'] = '';
config['location ~ ((^|/)\\.|^.*\\.yml$|^/sites/.*/private/|^/sites/[^/]+/[^/]*settings.*\\.php$)'] = {
config[
'location ~ ((^|/)\\.|^.*\\.yml$|^/sites/.*/private/|^/sites/[^/]+/[^/]*settings.*\\.php$)'
] = {
deny: 'all',
return: '404',
};

15
src/nginxconfig/generators/conf/general.conf.js

@ -46,11 +46,13 @@ export default (domains, global) => {
config[loc] = {
add_header: 'Cache-Control "no-cache"',
};
}
}
if (domains.every(d => d.routing.root.computed)) {
if (global.performance.assetsExpiration.computed === global.performance.mediaExpiration.computed) {
if (domains.every((d) => d.routing.root.computed)) {
if (
global.performance.assetsExpiration.computed ===
global.performance.mediaExpiration.computed
) {
if (global.performance.assetsExpiration.computed) {
// Assets & media combined
config['# assets, media'] = '';
@ -78,7 +80,10 @@ export default (domains, global) => {
}
}
if (global.performance.svgExpiration.computed === global.performance.fontsExpiration.computed) {
if (
global.performance.svgExpiration.computed ===
global.performance.fontsExpiration.computed
) {
if (global.performance.svgExpiration.computed) {
// SVG & fonts combined
config['# svg, fonts'] = '';

1
src/nginxconfig/generators/conf/joomla.conf.js

@ -43,7 +43,6 @@ export default () => {
expires: '14d',
};
// Done!
return config;
};

2
src/nginxconfig/generators/conf/letsencrypt.conf.js

@ -24,7 +24,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
export default global => {
export default (global) => {
const config = {};
config['# ACME-challenge'] = '';

127
src/nginxconfig/generators/conf/nginx.conf.js

@ -37,14 +37,16 @@ export default (domains, global) => {
// Basic nginx conf
config.user = global.nginx.user.computed;
if (global.nginx.pid.computed)
config.pid = global.nginx.pid.computed;
if (global.nginx.pid.computed) config.pid = global.nginx.pid.computed;
config.worker_processes = global.nginx.workerProcesses.computed;
config.worker_rlimit_nofile = 65535;
// Modules
config['# Load modules'] = '';
config.include = `${global.nginx.nginxConfigDirectory.computed.replace(/\/+$/, '')}/modules-enabled/*.conf`;
config.include = `${global.nginx.nginxConfigDirectory.computed.replace(
/\/+$/,
'',
)}/modules-enabled/*.conf`;
// Events
config.events = {
@ -59,10 +61,8 @@ export default (domains, global) => {
config.http.push(['sendfile', 'on']);
config.http.push(['tcp_nopush', 'on']);
config.http.push(['tcp_nodelay', 'on']);
if (!global.security.serverTokens.computed)
config.http.push(['server_tokens', 'off']);
if (!global.logging.logNotFound.computed)
config.http.push(['log_not_found', 'off']);
if (!global.security.serverTokens.computed) config.http.push(['server_tokens', 'off']);
if (!global.logging.logNotFound.computed) config.http.push(['log_not_found', 'off']);
config.http.push(['types_hash_max_size', global.nginx.typesHashMaxSize.computed]);
config.http.push(['types_hash_bucket_size', global.nginx.typesHashBucketSize.computed]);
config.http.push(['client_max_body_size', `${global.nginx.clientMaxBodySize.computed}M`]);
@ -76,33 +76,33 @@ export default (domains, global) => {
config.http.push(['# Log Format', '']);
// Define default log format as an array
let logging = ['$remote_addr', '-', '$remote_user', '[$time_local]',
'"$request"', '$status', '$body_bytes_sent',
'"$http_referer"', '"$http_user_agent"'];
let logging = [
'$remote_addr',
'-',
'$remote_user',
'[$time_local]',
'"$request"',
'$status',
'$body_bytes_sent',
'"$http_referer"',
'"$http_user_agent"',
];
if (global.logging.cfRay.computed)
logging.push('$http_cf_ray');
if (global.logging.cfRay.computed) logging.push('$http_cf_ray');
if (global.logging.cfConnectingIp.computed)
logging.push('$http_cf_connecting_ip');
if (global.logging.cfConnectingIp.computed) logging.push('$http_cf_connecting_ip');
if (global.logging.xForwardedFor.computed)
logging.push('$http_x_forwarded_for');
if (global.logging.xForwardedFor.computed) logging.push('$http_x_forwarded_for');
if (global.logging.xForwardedProto.computed)
logging.push('$http_x_forwarded_proto');
if (global.logging.xForwardedProto.computed) logging.push('$http_x_forwarded_proto');
if (global.logging.trueClientIp.computed)
logging.push('$http_true_client_ip');
if (global.logging.trueClientIp.computed) logging.push('$http_true_client_ip');
if (global.logging.cfIpCountry.computed)
logging.push('$http_cf_ipcountry');
if (global.logging.cfIpCountry.computed) logging.push('$http_cf_ipcountry');
if (global.logging.cfVisitor.computed)
logging.push('$http_cf_visitor');
if (global.logging.cfVisitor.computed) logging.push('$http_cf_visitor');
if (global.logging.cdnLoop.computed)
logging.push('$http_cdn_loop');
if (global.logging.cdnLoop.computed) logging.push('$http_cdn_loop');
config.http.push(['log_format', `cloudflare '${logging.join(' ')}'`]);
}
@ -110,8 +110,11 @@ export default (domains, global) => {
config.http.push(['# Logging', '']);
config.http.push(['access_log', 'off']);
if (global.logging.errorLogEnabled.computed) {
config.http.push(['error_log', global.logging.errorLogPath.computed.trim() +
` ${global.logging.errorLogLevel.computed}`]);
config.http.push([
'error_log',
global.logging.errorLogPath.computed.trim() +
` ${global.logging.errorLogLevel.computed}`,
]);
} else {
config.http.push(['error_log', errorLogPathDisabled]);
}
@ -140,7 +143,10 @@ export default (domains, global) => {
if (sslProfile) {
if (sslProfile.dh_param_size) {
config.http.push(['# Diffie-Hellman parameter for DHE ciphersuites', '']);
config.http.push(['ssl_dhparam', `${global.nginx.nginxConfigDirectory.computed.replace(/\/+$/, '')}/dhparam.pem`]);
config.http.push([
'ssl_dhparam',
`${global.nginx.nginxConfigDirectory.computed.replace(/\/+$/, '')}/dhparam.pem`,
]);
}
config.http.push([`# ${sslProfile.name} configuration`, '']);
@ -194,35 +200,52 @@ export default (domains, global) => {
}
// Connection header for WebSocket reverse proxy
if (domains.some(d => d.reverseProxy.reverseProxy.computed)) {
if (domains.some((d) => d.reverseProxy.reverseProxy.computed)) {
config.http.push(['# Connection header for WebSocket reverse proxy', '']);
config.http.push(['map $http_upgrade $connection_upgrade', {
'default': 'upgrade',
'""': 'close',
}]);
config.http.push([
'map $http_upgrade $connection_upgrade',
{
default: 'upgrade',
'""': 'close',
},
]);
// See https://www.nginx.com/resources/wiki/start/topics/examples/forwarded/
config.http.push(['map $remote_addr $proxy_forwarded_elem', {
'# IPv4 addresses can be sent as-is': '',
'~^[0-9.]+$': '"for=$remote_addr"',
'# IPv6 addresses need to be bracketed and quoted': '',
'~^[0-9A-Fa-f:.]+$': '"for=\\"[$remote_addr]\\""',
'# Unix domain socket names cannot be represented in RFC 7239 syntax': '',
'default': '"for=unknown"',
}]);
config.http.push(['map $http_forwarded $proxy_add_forwarded', {
'# If the incoming Forwarded header is syntactically valid, append to it': '',
'': '"~^(,[ \\\\t]*)*([!#$%&\'*+.^_`|~0-9A-Za-z-]+=([!#$%&\'*+.^_`|~0-9A-Za-z-]+|\\"([\\\\t \\\\x21\\\\x23-\\\\x5B\\\\x5D-\\\\x7E\\\\x80-\\\\xFF]|\\\\\\\\[\\\\t \\\\x21-\\\\x7E\\\\x80-\\\\xFF])*\\"))?(;([!#$%&\'*+.^_`|~0-9A-Za-z-]+=([!#$%&\'*+.^_`|~0-9A-Za-z-]+|\\"([\\\\t \\\\x21\\\\x23-\\\\x5B\\\\x5D-\\\\x7E\\\\x80-\\\\xFF]|\\\\\\\\[\\\\t \\\\x21-\\\\x7E\\\\x80-\\\\xFF])*\\"))?)*([ \\\\t]*,([ \\\\t]*([!#$%&\'*+.^_`|~0-9A-Za-z-]+=([!#$%&\'*+.^_`|~0-9A-Za-z-]+|\\"([\\\\t \\\\x21\\\\x23-\\\\x5B\\\\x5D-\\\\x7E\\\\x80-\\\\xFF]|\\\\\\\\[\\\\t \\\\x21-\\\\x7E\\\\x80-\\\\xFF])*\\"))?(;([!#$%&\'*+.^_`|~0-9A-Za-z-]+=([!#$%&\'*+.^_`|~0-9A-Za-z-]+|\\"([\\\\t \\\\x21\\\\x23-\\\\x5B\\\\x5D-\\\\x7E\\\\x80-\\\\xFF]|\\\\\\\\[\\\\t \\\\x21-\\\\x7E\\\\x80-\\\\xFF])*\\"))?)*)?)*$" "$http_forwarded, $proxy_forwarded_elem"',
'# Otherwise, replace it': '',
'default': '"$proxy_forwarded_elem"',
}]);
config.http.push([
'map $remote_addr $proxy_forwarded_elem',
{
'# IPv4 addresses can be sent as-is': '',
'~^[0-9.]+$': '"for=$remote_addr"',
'# IPv6 addresses need to be bracketed and quoted': '',
'~^[0-9A-Fa-f:.]+$': '"for=\\"[$remote_addr]\\""',
'# Unix domain socket names cannot be represented in RFC 7239 syntax': '',
default: '"for=unknown"',
},
]);
config.http.push([
'map $http_forwarded $proxy_add_forwarded',
{
'# If the incoming Forwarded header is syntactically valid, append to it': '',
'': '"~^(,[ \\\\t]*)*([!#$%&\'*+.^_`|~0-9A-Za-z-]+=([!#$%&\'*+.^_`|~0-9A-Za-z-]+|\\"([\\\\t \\\\x21\\\\x23-\\\\x5B\\\\x5D-\\\\x7E\\\\x80-\\\\xFF]|\\\\\\\\[\\\\t \\\\x21-\\\\x7E\\\\x80-\\\\xFF])*\\"))?(;([!#$%&\'*+.^_`|~0-9A-Za-z-]+=([!#$%&\'*+.^_`|~0-9A-Za-z-]+|\\"([\\\\t \\\\x21\\\\x23-\\\\x5B\\\\x5D-\\\\x7E\\\\x80-\\\\xFF]|\\\\\\\\[\\\\t \\\\x21-\\\\x7E\\\\x80-\\\\xFF])*\\"))?)*([ \\\\t]*,([ \\\\t]*([!#$%&\'*+.^_`|~0-9A-Za-z-]+=([!#$%&\'*+.^_`|~0-9A-Za-z-]+|\\"([\\\\t \\\\x21\\\\x23-\\\\x5B\\\\x5D-\\\\x7E\\\\x80-\\\\xFF]|\\\\\\\\[\\\\t \\\\x21-\\\\x7E\\\\x80-\\\\xFF])*\\"))?(;([!#$%&\'*+.^_`|~0-9A-Za-z-]+=([!#$%&\'*+.^_`|~0-9A-Za-z-]+|\\"([\\\\t \\\\x21\\\\x23-\\\\x5B\\\\x5D-\\\\x7E\\\\x80-\\\\xFF]|\\\\\\\\[\\\\t \\\\x21-\\\\x7E\\\\x80-\\\\xFF])*\\"))?)*)?)*$" "$http_forwarded, $proxy_forwarded_elem"',
'# Otherwise, replace it': '',
default: '"$proxy_forwarded_elem"',
},
]);
}
// Configs!
config.http.push(['# Load configs', '']);
config.http.push(['include', [
`${global.nginx.nginxConfigDirectory.computed.replace(/\/+$/, '')}/conf.d/*.conf`,
global.tools.modularizedStructure.computed ? `${global.nginx.nginxConfigDirectory.computed.replace(/\/+$/, '')}/sites-enabled/*` : '',
].filter(x => x.length)]);
config.http.push([
'include',
[
`${global.nginx.nginxConfigDirectory.computed.replace(/\/+$/, '')}/conf.d/*.conf`,
global.tools.modularizedStructure.computed
? `${global.nginx.nginxConfigDirectory.computed.replace(
/\/+$/,
'',
)}/sites-enabled/*`
: '',
].filter((x) => x.length),
]);
// Single file configs
if (!global.tools.modularizedStructure.computed) {

2
src/nginxconfig/generators/conf/php_fastcgi.conf.js

@ -25,7 +25,7 @@ THE SOFTWARE.
*/
export default (domains) => {
const legacyRouting = domains.some(d => d.routing.legacyPhpRouting.computed);
const legacyRouting = domains.some((d) => d.routing.legacyPhpRouting.computed);
const config = {};
if (legacyRouting) {

3
src/nginxconfig/generators/conf/proxy.conf.js

@ -24,7 +24,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
export default global => {
export default (global) => {
const config = {};
config.proxy_http_version = '1.1';
@ -49,7 +49,6 @@ export default global => {
config['proxy_set_header X-Forwarded-Host'] = '""';
config['proxy_set_header X-Forwarded-Port'] = '""';
}
config['# Proxy timeouts'] = '';
config['proxy_connect_timeout'] = global.reverseProxy.proxyConnectTimeout.computed;

7
src/nginxconfig/generators/conf/python_uwsgi.conf.js

@ -24,15 +24,16 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
export default global => {
export default (global) => {
const config = {};
config['# default uwsgi_params'] = '';
config.include = 'uwsgi_params';
config['# uwsgi settings'] = '';
config.uwsgi_pass = (global.python.pythonServer.computed[0] === '/' ? 'unix:' : '')
+ global.python.pythonServer.computed;
config.uwsgi_pass =
(global.python.pythonServer.computed[0] === '/' ? 'unix:' : '') +
global.python.pythonServer.computed;
config['uwsgi_param Host'] = '$host';
config['uwsgi_param X-Real-IP'] = '$remote_addr';
config['uwsgi_param X-Forwarded-For'] = '$proxy_add_x_forwarded_for';

51
src/nginxconfig/generators/conf/security.conf.js

@ -32,37 +32,60 @@ export default (domains, global) => {
config.push(['# security headers', '']);
config.push(['add_header X-XSS-Protection', '"1; mode=block" always']);
config.push(['add_header X-Content-Type-Options', '"nosniff" always']);
config.push(['add_header Referrer-Policy', `"${global.security.referrerPolicy.computed}" always`]);
config.push([
'add_header Referrer-Policy',
`"${global.security.referrerPolicy.computed}" always`,
]);
if (global.security.contentSecurityPolicy.computed)
config.push(['add_header Content-Security-Policy', `"${global.security.contentSecurityPolicy.computed}" always`]);
config.push([
'add_header Content-Security-Policy',
`"${global.security.contentSecurityPolicy.computed}" always`,
]);
if (global.security.permissionsPolicy.computed)
config.push(['add_header Permissions-Policy', `"${global.security.permissionsPolicy.computed}" always`]);
config.push([
'add_header Permissions-Policy',
`"${global.security.permissionsPolicy.computed}" always`,
]);
// Every domain has HSTS enabled, and they all have same hstsSubdomains/hstsPreload settings
if (commonHsts(domains)) {
const commonHSTSSubdomains = domains.length && domains[0].https.hstsSubdomains.computed;
const commonHSTSPreload = domains.length && domains[0].https.hstsPreload.computed;
config.push(['add_header Strict-Transport-Security', `"max-age=31536000${commonHSTSSubdomains ? '; includeSubDomains' : ''}${commonHSTSPreload ? '; preload' : ''}" always`]);
config.push([
'add_header Strict-Transport-Security',
`"max-age=31536000${commonHSTSSubdomains ? '; includeSubDomains' : ''}${
commonHSTSPreload ? '; preload' : ''
}" always`,
]);
}
config.push(['# . files', '']);
config.push(['location ~ /\\.(?!well-known)', {
deny: 'all',
}]);
config.push([
'location ~ /\\.(?!well-known)',
{
deny: 'all',
},
]);
// Security.txt
if (global.security.securityTxt.computed) {
config.push(['# security.txt', '']);
config.push(['location /security.txt', {
return: '301 /.well-known/security.txt',
}]);
config.push([
'location /security.txt',
{
return: '301 /.well-known/security.txt',
},
]);
// Custom security.txt path
config.push(['location = /.well-known/security.txt', {
alias: `${global.security.securityTxtPath.value}`,
}]);
config.push([
'location = /.well-known/security.txt',
{
alias: `${global.security.securityTxtPath.value}`,
},
]);
}
// Done!

303
src/nginxconfig/generators/conf/website.conf.js

@ -50,8 +50,12 @@ const sslConfig = (domain, global) => {
// Let's encrypt
if (domain.https.certType.computed === 'letsEncrypt')
config.push(['ssl_trusted_certificate',
`${global.https.letsEncryptCertRoot.computed.replace(/\/+$/, '')}/${domain.server.domain.computed}/chain.pem`]);
config.push([
'ssl_trusted_certificate',
`${global.https.letsEncryptCertRoot.computed.replace(/\/+$/, '')}/${
domain.server.domain.computed
}/chain.pem`,
]);
}
return config;
};
@ -60,17 +64,22 @@ const httpsListen = (domain, global, ipPortPairs) => {
const config = [];
// Check if reuseport needs to be set
const ipPortV4 = `${domain.server.listenIpv4.computed === '*' ? '' : `${domain.server.listenIpv4.computed}:`}443`;
const ipPortV4 = `${
domain.server.listenIpv4.computed === '*' ? '' : `${domain.server.listenIpv4.computed}:`
}443`;
const reusePortV4 = global.https.portReuse.computed && !ipPortPairs.has(ipPortV4);
if (reusePortV4) ipPortPairs.add(ipPortV4);
// HTTPS
config.push(['listen',
`${ipPortV4} ssl${domain.https.http2.computed ? ' http2' : ''}${reusePortV4 ? ' reuseport' : ''}`]);
config.push([
'listen',
`${ipPortV4} ssl${domain.https.http2.computed ? ' http2' : ''}${
reusePortV4 ? ' reuseport' : ''
}`,
]);
// HTTP/3
if (domain.https.http3.computed)
config.push(['listen', `${ipPortV4} http3`]);
if (domain.https.http3.computed) config.push(['listen', `${ipPortV4} http3`]);
// v6
if (domain.server.listenIpv6.computed) {
@ -80,12 +89,15 @@ const httpsListen = (domain, global, ipPortPairs) => {
if (reusePortV6) ipPortPairs.add(ipPortV6);
// HTTPS
config.push(['listen',
`${ipPortV6} ssl${domain.https.http2.computed ? ' http2' : ''}${reusePortV6 ? ' reuseport' : ''}`]);
config.push([
'listen',
`${ipPortV6} ssl${domain.https.http2.computed ? ' http2' : ''}${
reusePortV6 ? ' reuseport' : ''
}`,
]);
// HTTP/3
if (domain.https.http3.computed)
config.push(['listen', `${ipPortV6} http3`]);
if (domain.https.http3.computed) config.push(['listen', `${ipPortV6} http3`]);
}
return config;
@ -95,7 +107,9 @@ const httpListen = (domain, global, ipPortPairs) => {
const config = [];
// Check if reuseport needs to be set
const ipPortV4 = `${domain.server.listenIpv4.computed === '*' ? '' : `${domain.server.listenIpv4.computed}:`}80`;
const ipPortV4 = `${
domain.server.listenIpv4.computed === '*' ? '' : `${domain.server.listenIpv4.computed}:`
}80`;
const reusePortV4 = global.https.portReuse.computed && !ipPortPairs.has(ipPortV4);
if (reusePortV4) ipPortPairs.add(ipPortV4);
@ -151,12 +165,18 @@ const httpRedirectConfig = (domain, global, ipPortPairs, domainName, redirectDom
config.push(...Object.entries(letsEncryptConf(global)));
}
config.push(['location /', {
return: `301 https://${redirectDomain ? redirectDomain : domainName}$request_uri`,
}]);
config.push([
'location /',
{
return: `301 https://${redirectDomain ? redirectDomain : domainName}$request_uri`,
},
]);
} else {
// Custom cert
config.push(['return', `301 https://${redirectDomain ? redirectDomain : domainName}$request_uri`]);
config.push([
'return',
`301 https://${redirectDomain ? redirectDomain : domainName}$request_uri`,
]);
}
return config;
@ -174,14 +194,18 @@ export default (domain, domains, global, ipPortPairs) => {
serverConfig.push(...httpListen(domain, global, ipPortPairs));
// HTTPS
if (domain.https.https.computed)
serverConfig.push(...httpsListen(domain, global, ipPortPairs));
if (domain.https.https.computed) serverConfig.push(...httpsListen(domain, global, ipPortPairs));
serverConfig.push(['server_name',
`${domain.server.wwwSubdomain.computed ? 'www.' : ''}${domain.server.domain.computed}`]);
serverConfig.push([
'server_name',
`${domain.server.wwwSubdomain.computed ? 'www.' : ''}${domain.server.domain.computed}`,
]);
// PHP or Django
if (domain.php.php.computed || (domain.python.python.computed && domain.python.djangoRules.computed)) {
if (
domain.php.php.computed ||
(domain.python.python.computed && domain.python.djangoRules.computed)
) {
serverConfig.push(['set', `$base ${domain.server.path.computed}`]);
// root
@ -190,10 +214,15 @@ export default (domain, domains, global, ipPortPairs) => {
}
// Not PHP and not Django and root
if (!domain.php.php.computed
&& (!domain.python.python.computed || !domain.python.djangoRules.computed)
&& domain.routing.root.computed)
serverConfig.push(['root', `${domain.server.path.computed}${domain.server.documentRoot.computed}`]);
if (
!domain.php.php.computed &&
(!domain.python.python.computed || !domain.python.djangoRules.computed) &&
domain.routing.root.computed
)
serverConfig.push([
'root',
`${domain.server.path.computed}${domain.server.documentRoot.computed}`,
]);
// HTTPS
serverConfig.push(...sslConfig(domain, global));
@ -201,14 +230,21 @@ export default (domain, domains, global, ipPortPairs) => {
// Onion location
if (domain.onion.onionLocation.computed) {
serverConfig.push(['# Onion services', '']);
serverConfig.push(['add_header Onion-Location', `http://${domain.onion.onionLocation.computed}$request_uri`]);
serverConfig.push([
'add_header Onion-Location',
`http://${domain.onion.onionLocation.computed}$request_uri`,
]);
}
// HSTS
if (!commonHsts(domains) && domain.https.hsts.computed) {
serverConfig.push(['# HSTS', '']);
serverConfig.push(['add_header Strict-Transport-Security',
`"max-age=31536000${domain.https.hstsSubdomains.computed ? '; includeSubDomains' : ''}${domain.https.hstsPreload.computed ? '; preload' : ''}" always`]);
serverConfig.push([
'add_header Strict-Transport-Security',
`"max-age=31536000${domain.https.hstsSubdomains.computed ? '; includeSubDomains' : ''}${
domain.https.hstsPreload.computed ? '; preload' : ''
}" always`,
]);
}
// Security
@ -222,15 +258,22 @@ export default (domain, domains, global, ipPortPairs) => {
}
// Restrict Methods
if (Object.keys(domain.restrict).find(k => domain.restrict[k].computed && k !== 'responseCode')) {
if (
Object.keys(domain.restrict).find(
(k) => domain.restrict[k].computed && k !== 'responseCode',
)
) {
const allowedKeys = Object.keys(domain.restrict)
.filter(k => !domain.restrict[k].computed && k !== 'responseCode')
.map(e => e.replace('Method', '').toUpperCase());
.filter((k) => !domain.restrict[k].computed && k !== 'responseCode')
.map((e) => e.replace('Method', '').toUpperCase());
serverConfig.push(['# restrict methods', '']);
serverConfig.push([`if ($request_method !~ ^(${allowedKeys.join('|')})$)`, {
'return': `'${domain.restrict.responseCode.computed}'`,
}]);
serverConfig.push([
`if ($request_method !~ ^(${allowedKeys.join('|')})$)`,
{
return: `'${domain.restrict.responseCode.computed}'`,
},
]);
}
// Access log or error log for domain
@ -251,20 +294,43 @@ export default (domain, domains, global, ipPortPairs) => {
}
// Fallback index.html or index.php
if ((domain.routing.fallbackHtml.computed || domain.routing.fallbackPhp.computed)
&& (!domain.reverseProxy.reverseProxy.computed || domain.reverseProxy.path.computed !== '/')) {
serverConfig.push([`# index.${domain.routing.fallbackHtml.computed ? 'html' : (domain.routing.fallbackPhp.computed ? 'php' : '')} fallback`, '']);
serverConfig.push(['location /', {
try_files: `$uri $uri/ /index.${domain.routing.fallbackHtml.computed ? 'html' : (domain.routing.fallbackPhp.computed ? 'php?$query_string' : '')}`,
}]);
if (
(domain.routing.fallbackHtml.computed || domain.routing.fallbackPhp.computed) &&
(!domain.reverseProxy.reverseProxy.computed || domain.reverseProxy.path.computed !== '/')
) {
serverConfig.push([
`# index.${
domain.routing.fallbackHtml.computed
? 'html'
: domain.routing.fallbackPhp.computed
? 'php'
: ''
} fallback`,
'',
]);
serverConfig.push([
'location /',
{
try_files: `$uri $uri/ /index.${
domain.routing.fallbackHtml.computed
? 'html'
: domain.routing.fallbackPhp.computed
? 'php?$query_string'
: ''
}`,
},
]);
}
// Fallback index.html and index.php
if (domain.routing.fallbackHtml.computed && domain.routing.fallbackPhp.computed) {
serverConfig.push(['# index.php fallback', '']);
serverConfig.push([`location ~ ^${domain.routing.fallbackPhpPath.computed}`, {
try_files: '$uri $uri/ /index.php?$query_string',
}]);
serverConfig.push([
`location ~ ^${domain.routing.fallbackPhpPath.computed}`,
{
try_files: '$uri $uri/ /index.php?$query_string',
},
]);
}
// Python
@ -314,10 +380,17 @@ export default (domain, domains, global, ipPortPairs) => {
if (!domain.https.forceHttps.computed && domain.https.certType.computed === 'letsEncrypt')
serverConfig.push(['include', 'nginxconfig.io/letsencrypt.conf']);
if (domain.php.wordPressRules.computed) serverConfig.push(['include', `nginxconfig.io/${domain.server.domain.computed}.wordpress.conf`]);
if (domain.php.drupalRules.computed) serverConfig.push(['include', 'nginxconfig.io/drupal.conf']);
if (domain.php.magentoRules.computed) serverConfig.push(['include', 'nginxconfig.io/magento.conf']);
if (domain.php.joomlaRules.computed) serverConfig.push(['include', 'nginxconfig.io/joomla.conf']);
if (domain.php.wordPressRules.computed)
serverConfig.push([
'include',
`nginxconfig.io/${domain.server.domain.computed}.wordpress.conf`,
]);
if (domain.php.drupalRules.computed)
serverConfig.push(['include', 'nginxconfig.io/drupal.conf']);
if (domain.php.magentoRules.computed)
serverConfig.push(['include', 'nginxconfig.io/magento.conf']);
if (domain.php.joomlaRules.computed)
serverConfig.push(['include', 'nginxconfig.io/joomla.conf']);
} else {
// Unified
serverConfig.push(...Object.entries(generalConf(domains, global)));
@ -325,8 +398,10 @@ export default (domain, domains, global, ipPortPairs) => {
if (!domain.https.forceHttps.computed && domain.https.certType.computed === 'letsEncrypt')
serverConfig.push(...Object.entries(letsEncryptConf(global)));
if (domain.php.wordPressRules.computed) serverConfig.push(...Object.entries(wordPressConf(global, domain)));
if (domain.php.drupalRules.computed) serverConfig.push(...Object.entries(drupalConf(global)));
if (domain.php.wordPressRules.computed)
serverConfig.push(...Object.entries(wordPressConf(global, domain)));
if (domain.php.drupalRules.computed)
serverConfig.push(...Object.entries(drupalConf(global)));
if (domain.php.magentoRules.computed) serverConfig.push(...Object.entries(magentoConf()));
if (domain.php.joomlaRules.computed) serverConfig.push(...Object.entries(joomlaConf()));
}
@ -334,35 +409,43 @@ export default (domain, domains, global, ipPortPairs) => {
// PHP
if (domain.php.php.computed) {
if (domain.php.phpBackupServer.computed) {
config.push([`upstream ${phpUpstream(domain)}`, {
server: [
phpPath(domain),
`${phpPath(domain, true)} backup`,
],
}]);
config.push([
`upstream ${phpUpstream(domain)}`,
{
server: [phpPath(domain), `${phpPath(domain, true)} backup`],
},
]);
}
serverConfig.push(['# handle .php', '']);
const loc = `location ~ ${domain.routing.legacyPhpRouting.computed ? '[^/]\\.php(/|$)' : '\\.php$'}`;
const loc = `location ~ ${
domain.routing.legacyPhpRouting.computed ? '[^/]\\.php(/|$)' : '\\.php$'
}`;
const fastcgiPass = {
fastcgi_pass: domain.php.phpBackupServer.computed !== ''
? phpUpstream(domain) : phpPath(domain),
fastcgi_pass:
domain.php.phpBackupServer.computed !== '' ? phpUpstream(domain) : phpPath(domain),
};
if (global.tools.modularizedStructure.computed || domain.php.wordPressRules.computed) {
// Modularized
serverConfig.push([loc, {
...fastcgiPass,
include: 'nginxconfig.io/php_fastcgi.conf',
}]);
serverConfig.push([
loc,
{
...fastcgiPass,
include: 'nginxconfig.io/php_fastcgi.conf',
},
]);
} else {
// Unified
serverConfig.push([loc, {
...fastcgiPass,
...phpConf(domains),
}]);
serverConfig.push([
loc,
{
...fastcgiPass,
...phpConf(domains),
},
]);
}
}
@ -376,7 +459,10 @@ export default (domain, domains, global, ipPortPairs) => {
cdnConfig.push(...listenConfig(domain, global, ipPortPairs));
cdnConfig.push(['server_name', `cdn.${domain.server.domain.computed}`]);
cdnConfig.push(['root', `${domain.server.path.computed}${domain.server.documentRoot.computed}`]);
cdnConfig.push([
'root',
`${domain.server.path.computed}${domain.server.documentRoot.computed}`,
]);
// HTTPS
cdnConfig.push(...sslConfig(domain, global));
@ -418,12 +504,14 @@ export default (domain, domains, global, ipPortPairs) => {
const redirectConfig = [];
redirectConfig.push(...listenConfig(domain, global, ipPortPairs));
redirectConfig.push(['server_name',
`${domain.server.wwwSubdomain.computed ? '' : '*'}.${domain.server.domain.computed}`]);
redirectConfig.push([
'server_name',
`${domain.server.wwwSubdomain.computed ? '' : '*'}.${domain.server.domain.computed}`,
]);
// HTTPS
redirectConfig.push(...sslConfig(domain, global));
// Logging
if (domain.logging.redirectAccessLog.computed || domain.logging.redirectErrorLog.computed) {
redirectConfig.push(['# logging', '']);
@ -435,12 +523,19 @@ export default (domain, domains, global, ipPortPairs) => {
redirectConfig.push(['error_log', getDomainErrorLog(domain)]);
}
}
redirectConfig.push(['return',
`301 http${domain.https.https.computed ? 's' : ''}://${domain.server.wwwSubdomain.computed ? 'www.' : ''}${domain.server.domain.computed}$request_uri`]);
redirectConfig.push([
'return',
`301 http${domain.https.https.computed ? 's' : ''}://${
domain.server.wwwSubdomain.computed ? 'www.' : ''
}${domain.server.domain.computed}$request_uri`,
]);
// Add the redirect config to the parent config now its built
config.push([`# ${domain.server.wwwSubdomain.computed ? 'non-www, ' : ''}subdomains redirect`, '']);
config.push([
`# ${domain.server.wwwSubdomain.computed ? 'non-www, ' : ''}subdomains redirect`,
'',
]);
config.push(['server', redirectConfig]);
}
@ -449,22 +544,58 @@ export default (domain, domains, global, ipPortPairs) => {
// Add the redirect config to the parent config now its built
config.push(['# HTTP redirect', '']);
if (domain.server.wwwSubdomain.computed && !domain.server.redirectSubdomains.computed) {
config.push(['server', httpRedirectConfig(domain, global, ipPortPairs,
domain.server.domain.computed, `www.${domain.server.domain.computed}`)]);
config.push(['server', httpRedirectConfig(domain, global, ipPortPairs,
`www.${domain.server.domain.computed}`)]);
} else if (!domain.server.wwwSubdomain.computed && !domain.server.redirectSubdomains.computed) {
config.push(['server', httpRedirectConfig(domain, global, ipPortPairs,
domain.server.domain.computed)]);
config.push([
'server',
httpRedirectConfig(
domain,
global,
ipPortPairs,
domain.server.domain.computed,
`www.${domain.server.domain.computed}`,
),
]);
config.push([
'server',
httpRedirectConfig(
domain,
global,
ipPortPairs,
`www.${domain.server.domain.computed}`,
),
]);
} else if (
!domain.server.wwwSubdomain.computed &&
!domain.server.redirectSubdomains.computed
) {
config.push([
'server',
httpRedirectConfig(domain, global, ipPortPairs, domain.server.domain.computed),
]);
}
if (domain.server.cdnSubdomain.computed) {
config.push(['server', httpRedirectConfig(domain, global, ipPortPairs,
`cdn.${domain.server.domain.computed}`)]);
config.push([
'server',
httpRedirectConfig(
domain,
global,
ipPortPairs,
`cdn.${domain.server.domain.computed}`,
),
]);
}
if (domain.server.redirectSubdomains.computed) {
config.push(['server', httpRedirectConfig(domain, global, ipPortPairs,
`.${domain.server.domain.computed}`,
`${domain.server.wwwSubdomain.computed ? 'www.' : '' }${domain.server.domain.computed}`)]);
config.push([
'server',
httpRedirectConfig(
domain,
global,
ipPortPairs,
`.${domain.server.domain.computed}`,
`${domain.server.wwwSubdomain.computed ? 'www.' : ''}${
domain.server.domain.computed
}`,
),
]);
}
}

11
src/nginxconfig/generators/conf/wordpress.conf.js

@ -46,7 +46,8 @@ export default (global, domain) => {
};
config['# WordPress: SEO plugin'] = '';
config['location ~* ^/wp-content/plugins/wordpress-seo(?:-premium)?/css/main-sitemap\\.xsl$'] = {};
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'] = {
@ -54,7 +55,9 @@ export default (global, domain) => {
};
config['# WordPress: deny general stuff'] = '';
config['location ~* ^/(?:xmlrpc\\.php|wp-links-opml\\.php|wp-config\\.php|wp-config-sample\\.php|readme\\.html|license\\.txt)$'] = {
config[
'location ~* ^/(?:xmlrpc\\.php|wp-links-opml\\.php|wp-config\\.php|wp-config-sample\\.php|readme\\.html|license\\.txt)$'
] = {
deny: 'all',
};
@ -65,8 +68,8 @@ export default (global, domain) => {
include: 'nginxconfig.io/php_fastcgi.conf',
};
if (domain.php.wordPressRules.computed) {
config['location = /wp-login.php'].fastcgi_pass = domain.php.phpBackupServer.computed !== ''
? phpUpstream(domain) : phpPath(domain);
config['location = /wp-login.php'].fastcgi_pass =
domain.php.phpBackupServer.computed !== '' ? phpUpstream(domain) : phpPath(domain);
}
}

1
src/nginxconfig/generators/ext/docker.js

@ -27,4 +27,3 @@ THE SOFTWARE.
export default () => {
return 'FROM nginx:latest\nCOPY . /etc/nginx/';
};

39
src/nginxconfig/generators/index.js

@ -49,8 +49,7 @@ export default (domains, global) => {
files['nginx.conf'] = toConf(nginxConf(domains, global));
// Dockerfile
if (global.docker.dockerfile.computed)
files['Dockerfile'] = dockerConf();
if (global.docker.dockerfile.computed) files['Dockerfile'] = dockerConf();
if (global.docker.dockerCompose.computed)
files['docker-compose.yaml'] = toYaml(dockerComposeYaml());
@ -61,14 +60,18 @@ export default (domains, global) => {
const sitesDir = `sites-${global.tools.symlinkVhost.computed ? 'available' : 'enabled'}`;
const ipPortPairs = new Set();
for (const domain of domains) {
files[`${sitesDir}/${domain.server.domain.computed}.conf`] = toConf(websiteConf(domain, domains, global, ipPortPairs));
files[`${sitesDir}/${domain.server.domain.computed}.conf`] = toConf(
websiteConf(domain, domains, global, ipPortPairs),
);
// WordPress
if (domains.some(d => d.php.wordPressRules.computed))
files[`nginxconfig.io/${domain.server.domain.computed}.wordpress.conf`] = toConf(wordPressConf(global, domain));
if (domains.some((d) => d.php.wordPressRules.computed))
files[`nginxconfig.io/${domain.server.domain.computed}.wordpress.conf`] = toConf(
wordPressConf(global, domain),
);
}
// Let's encrypt
if (domains.some(d => d.https.certType.computed === 'letsEncrypt'))
if (domains.some((d) => d.https.certType.computed === 'letsEncrypt'))
files['nginxconfig.io/letsencrypt.conf'] = toConf(letsEncryptConf(global));
// Security
@ -78,37 +81,41 @@ export default (domains, global) => {
files['nginxconfig.io/general.conf'] = toConf(generalConf(domains, global));
// PHP
if (domains.some(d => d.php.php.computed))
if (domains.some((d) => d.php.php.computed))
files['nginxconfig.io/php_fastcgi.conf'] = toConf(phpConf(domains));
// Python
if (domains.some(d => d.python.python.computed))
if (domains.some((d) => d.python.python.computed))
files['nginxconfig.io/python_uwsgi.conf'] = toConf(pythonConf(global));
// Reverse proxy
if (domains.some(d => d.reverseProxy.reverseProxy.computed))
if (domains.some((d) => d.reverseProxy.reverseProxy.computed))
files['nginxconfig.io/proxy.conf'] = toConf(proxyConf(global));
// Drupal
if (domains.some(d => d.php.drupalRules.computed))
if (domains.some((d) => d.php.drupalRules.computed))
files['nginxconfig.io/drupal.conf'] = toConf(drupalConf(global));
// Magento
if (domains.some(d => d.php.magentoRules.computed))
if (domains.some((d) => d.php.magentoRules.computed))
files['nginxconfig.io/magento.conf'] = toConf(magentoConf());
// Joomla
if (domains.some(d => d.php.joomlaRules.computed))
if (domains.some((d) => d.php.joomlaRules.computed))
files['nginxconfig.io/joomla.conf'] = toConf(joomlaConf());
} else {
// PHP
if (domains.some(d => d.php.wordPressRules.computed))
if (domains.some((d) => d.php.wordPressRules.computed))
files['nginxconfig.io/php_fastcgi.conf'] = toConf(phpConf(domains));
}
const query = shareQuery(domains.map((domain, index) => [domain, index]).filter(d => d[0] !== null), global);
files['nginxconfig.txt'] = `${window.location.protocol}//${window.location.host}${window.location.pathname}${query}`;
const query = shareQuery(
domains.map((domain, index) => [domain, index]).filter((d) => d[0] !== null),
global,
);
files[
'nginxconfig.txt'
] = `${window.location.protocol}//${window.location.host}${window.location.pathname}${query}`;
return files;
};

41
src/nginxconfig/generators/to_conf.js

@ -26,22 +26,23 @@ THE SOFTWARE.
import isObject from '../util/is_object';
const isBlock = item => {
const isBlock = (item) => {
// If an object, or kv entries, this is considered a block
return isObject(item) || (Array.isArray(item) && item.every(i => Array.isArray(i) && i.length === 2));
return (
isObject(item) ||
(Array.isArray(item) && item.every((i) => Array.isArray(i) && i.length === 2))
);
};
const longestKey = items => {
const longestKey = (items) => {
let longest = 0;
for (const item of items) {
// Only consider up to the first block
if (isBlock(item[1]))
return longest;
if (isBlock(item[1])) return longest;
// If this is the new longest, and not a comment, use this
if (item[0].length > longest && !item[0].startsWith('#'))
longest = item[0].length;
if (item[0].length > longest && !item[0].startsWith('#')) longest = item[0].length;
}
// Done!
@ -54,12 +55,13 @@ const recurse = (entriesOrObject, depth) => {
const entries = isObject(entriesOrObject) ? Object.entries(entriesOrObject) : entriesOrObject;
// If not a valid kv entries array, return
if (!Array.isArray(entries) || !entries.every(i => Array.isArray(i) && i.length === 2)) return '';
if (!Array.isArray(entries) || !entries.every((i) => Array.isArray(i) && i.length === 2))
return '';
// Initial values
let retVal = '';
let longestKeyLen = longestKey(entries);
const indent = (' ').repeat(depth);
const indent = ' '.repeat(depth);
// Track whether the previous was a block, for indentation
let previousBlock = false;
@ -91,20 +93,24 @@ const recurse = (entriesOrObject, depth) => {
const val = Array.isArray(item[1]) ? item[1] : [item[1]];
// Calculate spacing
const keyValSpacing = (longestKeyLen - item[0].length) + 1;
const keyValIndent = (' ').repeat(Math.max(keyValSpacing, 0));
const keyValSpacing = longestKeyLen - item[0].length + 1;
const keyValIndent = ' '.repeat(Math.max(keyValSpacing, 0));
// Work through each item in the array
val.forEach(subVal => {
val.forEach((subVal) => {
const val = subVal.toString();
retVal += indent + (item[0] + keyValIndent + val).trim() + (item[0].startsWith('#') ? '' : ';') + '\n';
retVal +=
indent +
(item[0] + keyValIndent + val).trim() +
(item[0].startsWith('#') ? '' : ';') +
'\n';
});
}
return retVal;
};
export default entriesOrObject => {
export default (entriesOrObject) => {
// Generate the conf
let conf = recurse(entriesOrObject, 0);
@ -127,7 +133,12 @@ export default entriesOrObject => {
do {
match = /^([^\S\r\n]*})(?:\n[^\S\r\n]*)+\n([^\S\r\n]*})/m.exec(conf);
if (match)
conf = conf.slice(0, match.index) + match[1] + '\n' + match[2] + conf.slice(match.index + match[0].length);
conf =
conf.slice(0, match.index) +
match[1] +
'\n' +
match[2] +
conf.slice(match.index + match[0].length);
} while (match);
// Remove initial & trailing whitespace

2
src/nginxconfig/generators/to_yaml.js

@ -26,6 +26,6 @@ THE SOFTWARE.
import yaml from 'json-to-pretty-yaml';
export default yamlConf => {
export default (yamlConf) => {
return yaml.stringify(yamlConf);
};

2
src/nginxconfig/i18n/de/common.js

@ -33,7 +33,7 @@ export default {
nginx: 'NGINX',
http: 'HTTP',
https: 'HTTPS',
letsEncrypt: 'Let\'s Encrypt',
letsEncrypt: "Let's Encrypt",
python: 'Python',
wordPress: 'WordPress',
drupal: 'Drupal',

3
src/nginxconfig/i18n/de/templates/callouts/contribute.js

@ -25,6 +25,7 @@ THE SOFTWARE.
*/
export default {
wantToContributeChanges: '👋 Willst du neue Features vorschlagen, Änderungen beitragen oder das Tool in eine andere Sprache übersetzen?',
wantToContributeChanges:
'👋 Willst du neue Features vorschlagen, Änderungen beitragen oder das Tool in eine andere Sprache übersetzen?',
getInvolvedOnGitHub: 'Beteilige dich auf GitHub',
};

2
src/nginxconfig/i18n/de/templates/callouts/droplet.js

@ -26,5 +26,5 @@ THE SOFTWARE.
export default {
lookingForAPlaceToDeploy: '👋 Suchst du nach einem Ort, deine neue Konfiguration zu deployen?',
tryOutDigitalOceansDroplet: 'Teste DigitalOcean\'s LEMP Droplet mit NGINX',
tryOutDigitalOceansDroplet: "Teste DigitalOcean's LEMP Droplet mit NGINX",
};

13
src/nginxconfig/i18n/de/templates/domain_sections/index.js

@ -35,4 +35,15 @@ import reverseProxy from './reverse_proxy';
import routing from './routing';
import server from './server';
export default { https, logging, php, presets, python, reverseProxy, routing, server, restrict, onion };
export default {
https,
logging,
php,
presets,
python,
reverseProxy,
routing,
server,
restrict,
onion,
};

6
src/nginxconfig/i18n/de/templates/domain_sections/onion.js

@ -29,8 +29,10 @@ const onion = 'Onion';
export default {
onion,
onionLocation: `${onion} Location`,
provideAnOnionLocationToSetOnionLocationHeader: 'Gib eine Onion Adresse an, um den Onion-Location Header für deine Seite zu setzen.',
letsVisitorsKnownOnionServicesIsAvailable: 'Dies teilt deinen Besuchern mit, dass eine Onion-Version deiner Webseite für Tor-Browser verfügbar ist.',
provideAnOnionLocationToSetOnionLocationHeader:
'Gib eine Onion Adresse an, um den Onion-Location Header für deine Seite zu setzen.',
letsVisitorsKnownOnionServicesIsAvailable:
'Dies teilt deinen Besuchern mit, dass eine Onion-Version deiner Webseite für Tor-Browser verfügbar ist.',
learnMoreAboutOnionServices: 'Lerne mehr über Onion-Dienste',
onionLocationExpectedToEndWithOnion: 'Onion Adressen enden normalerweise mit `.onion`.',
};

3
src/nginxconfig/i18n/de/templates/domain_sections/presets.js

@ -26,7 +26,8 @@ THE SOFTWARE.
export default {
presets: 'Voreinstellungen',
itLooksLikeYouCustomisedTheConfig: 'Es sieht so aus, als hättest du die Konfiguration für diese Webseite angepasst. Eine neue Voreinstellung zu laden könnte manche deiner Anpassungen zurücksetzen oder ändern.',
itLooksLikeYouCustomisedTheConfig:
'Es sieht so aus, als hättest du die Konfiguration für diese Webseite angepasst. Eine neue Voreinstellung zu laden könnte manche deiner Anpassungen zurücksetzen oder ändern.',
frontend: 'Frontend',
nodeJs: 'Node.js',
singlePageApplication: 'Single-Page-Webanwendung',

3
src/nginxconfig/i18n/de/templates/domain_sections/server.js

@ -28,7 +28,8 @@ export default {
domain: 'Domain',
documentRoot: 'Document Root',
oneOrMoreOtherDomainsAreAlsoNamed: 'Eine oder mehrere Domains lauten ebenfalls',
thisWillCauseIssuesWithConfigGeneration: 'Dies sorgt für Probleme beim Generieren der Konfigurationsdateien.',
thisWillCauseIssuesWithConfigGeneration:
'Dies sorgt für Probleme beim Generieren der Konfigurationsdateien.',
wwwSubdomain: 'WWW Subdomain',
cdnSubdomain: 'CDN Subdomain',
redirectSubdomains: 'Subdomains weiterleiten',

12
src/nginxconfig/i18n/de/templates/global_sections/index.js

@ -34,4 +34,14 @@ import security from './security';
import tools from './tools';
import docker from './docker';
export default { https, logging, nginx, performance, python, reverseProxy, security, tools, docker };
export default {
https,
logging,
nginx,
performance,
python,
reverseProxy,
security,
tools,
docker,
};

9
src/nginxconfig/i18n/de/templates/global_sections/tools.js

@ -43,10 +43,13 @@ export default {
yesImSure: 'Ja, ich bin sicher',
noCancel: 'Nein, abbrechen',
tools: 'Tools',
resetGlobalConfigBody: 'Bist du dir sicher, dass du alle Optionen im Bereich "Globale Konfiguration" zurücksetzen möchtest?',
resetAllDomainsConfigBody: 'Bist du dir sicher, dass du die Konfiguration ALLER Domains zurücksetzen möchtest?',
resetGlobalConfigBody:
'Bist du dir sicher, dass du alle Optionen im Bereich "Globale Konfiguration" zurücksetzen möchtest?',
resetAllDomainsConfigBody:
'Bist du dir sicher, dass du die Konfiguration ALLER Domains zurücksetzen möchtest?',
removeAllDomainsBody: 'Bist du dir sicher, dass du ALLE Domains entfernen möchtest?',
areYouSureYouWantToResetAllConfigurationOptionsForThe: 'Bist du dir sicher, dass du die Konfiguration von',
areYouSureYouWantToResetAllConfigurationOptionsForThe:
'Bist du dir sicher, dass du die Konfiguration von',
domain: 'zurücksetzen möchtest?',
areYouSureYouWantToRemoveThe: 'Bist du dir sicher, dass du die Domain ',
domainConfiguration: 'entfernen möchtest?',

9
src/nginxconfig/i18n/de/templates/setup_sections/download.js

@ -31,10 +31,13 @@ export default {
andUploadItToYourServers: 'Auf deinen Server <b>hochladen</b> und ins Verzeichnis ',
directory: 'verschieben.',
or: 'Oder ',
copyBase64StringOfCompressedConfig: 'kopiere einen Base64 String der komprimierten Konfiguration',
pasteItInYourServersCommandLineAndExecute: ', füge ihn auf der Kommandozeile deines Servers ein und führe ihn aus.',
copyBase64StringOfCompressedConfig:
'kopiere einen Base64 String der komprimierten Konfiguration',
pasteItInYourServersCommandLineAndExecute:
', füge ihn auf der Kommandozeile deines Servers ein und führe ihn aus.',
navigateToYourNginxConfigurationDirectoryOnYourServer: `Wechsle in das ${common.nginx} <b>Konfigurationsverzeichnis</b> deines Servers:`,
createABackupOfYourCurrentNginxConfiguration: `Erstelle ein <b>Backup</b> deiner aktuellen ${common.nginx} Konfiguration:`,
extractTheNewCompressedConfigurationArchiveUsingTar: '<b>Entpacke</b> das komprimierte Konfigurationsverzeichnis mittels tar:',
extractTheNewCompressedConfigurationArchiveUsingTar:
'<b>Entpacke</b> das komprimierte Konfigurationsverzeichnis mittels tar:',
download: 'Download',
};

3
src/nginxconfig/i18n/de/templates/setup_sections/ssl.js

@ -27,7 +27,8 @@ THE SOFTWARE.
import common from '../../common';
export default {
generateDiffieHellmanKeysByRunningThisCommandOnYourServer: 'Erzeuge <b>Diffie-Hellman Schlüssel</b> indem du diesen Befehl auf deinem Server ausführst:',
generateDiffieHellmanKeysByRunningThisCommandOnYourServer:
'Erzeuge <b>Diffie-Hellman Schlüssel</b> indem du diesen Befehl auf deinem Server ausführst:',
createACommonAcmeChallengeDirectoryForLetsEncrypt: `Erstelle ein <b>ACME-Challenge</b> Verzeichnis (für <b>${common.letsEncrypt}</b>):`,
noAdditionalStepsAreNeededToSetUpSslForNginx: `Es sind keine weiteren Schritte nötig, um ${common.ssl} für deine ${common.nginx} Konfiguration einzurichten.`,
sslInit: `${common.ssl} initialisieren`,

32
src/nginxconfig/i18n/en/common.js

@ -25,22 +25,22 @@ THE SOFTWARE.
*/
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',
joomla: 'Joomla',
django: 'Django',
logging: 'Logging',
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',
joomla: 'Joomla',
django: 'Django',
logging: 'Logging',
reverseProxy: 'Reverse proxy',
reverseProxyLower: 'reverse proxy',
restrict: 'Restrict',

3
src/nginxconfig/i18n/en/templates/callouts/contribute.js

@ -25,6 +25,7 @@ THE SOFTWARE.
*/
export default {
wantToContributeChanges: '👋 Want to request new features, contribute changes, or translate the tool into a new language?',
wantToContributeChanges:
'👋 Want to request new features, contribute changes, or translate the tool into a new language?',
getInvolvedOnGitHub: 'Get involved on GitHub',
};

2
src/nginxconfig/i18n/en/templates/callouts/droplet.js

@ -26,5 +26,5 @@ THE SOFTWARE.
export default {
lookingForAPlaceToDeploy: '👋 Looking for a place to deploy your new configuration?',
tryOutDigitalOceansDroplet: 'Try out DigitalOcean\'s LEMP Droplet with NGINX',
tryOutDigitalOceansDroplet: "Try out DigitalOcean's LEMP Droplet with NGINX",
};

2
src/nginxconfig/i18n/en/templates/domain_sections/https.js

@ -40,7 +40,7 @@ export default {
certificationType: 'Certification type',
customCertificate: 'Custom certificate',
letsEncryptEmail: `${common.letsEncrypt} email`,
http3IsANonStandardModule: 'HTTP/3 isn\'t a standard NGINX module, check the ',
http3IsANonStandardModule: "HTTP/3 isn't a standard NGINX module, check the ",
http3NginxQuicReadme: 'NGINX QUIC readme',
http3OrThe: ' or the ',
http3CloudflareQuicheProject: 'Cloudflare quiche project',

13
src/nginxconfig/i18n/en/templates/domain_sections/index.js

@ -35,4 +35,15 @@ import server from './server';
import restrict from './restrict';
import onion from './onion';
export default { https, logging, php, presets, python, reverseProxy, routing, server, restrict, onion };
export default {
https,
logging,
php,
presets,
python,
reverseProxy,
routing,
server,
restrict,
onion,
};

6
src/nginxconfig/i18n/en/templates/domain_sections/onion.js

@ -29,8 +29,10 @@ const onion = 'Onion';
export default {
onion,
onionLocation: `${onion} location`,
provideAnOnionLocationToSetOnionLocationHeader: 'Provide an onion location address to set the Onion-Location header for your site.',
letsVisitorsKnownOnionServicesIsAvailable: 'This lets visitors know that an onion services version of your site is available for Tor browsers.',
provideAnOnionLocationToSetOnionLocationHeader:
'Provide an onion location address to set the Onion-Location header for your site.',
letsVisitorsKnownOnionServicesIsAvailable:
'This lets visitors know that an onion services version of your site is available for Tor browsers.',
learnMoreAboutOnionServices: 'Learn more about Onion services',
onionLocationExpectedToEndWithOnion: 'Onion location addresses normally end with `.onion`.',
};

3
src/nginxconfig/i18n/en/templates/domain_sections/presets.js

@ -26,7 +26,8 @@ THE SOFTWARE.
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.',
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',
nodeJs: 'Node.js',
singlePageApplication: 'Single-page application',

12
src/nginxconfig/i18n/en/templates/global_sections/index.js

@ -34,4 +34,14 @@ import security from './security';
import tools from './tools';
import docker from './docker';
export default { https, logging, nginx, performance, python, reverseProxy, security, tools, docker };
export default {
https,
logging,
nginx,
performance,
python,
reverseProxy,
security,
tools,
docker,
};

2
src/nginxconfig/i18n/en/templates/global_sections/performance.js

@ -33,7 +33,7 @@ export default {
enableGzipCompression: `${common.enable} gzip compression`,
brotliCompression: 'Brotli compression',
enableBrotliCompression: `${common.enable} brotli compression`,
brotliIsANonStandardModule: 'Brotli isn\'t a standard NGINX module, check the ',
brotliIsANonStandardModule: "Brotli isn't a standard NGINX module, check the ",
brotliGoogleNgxBrotliProject: 'Google ngx_brotli project',
brotliForBuildingNginxWithBrotli: ' for how to build NGINX with Brotli!',
expirationForAssets: 'Expiration for assets',

8
src/nginxconfig/i18n/en/templates/global_sections/tools.js

@ -40,13 +40,15 @@ export default {
resetAllDomainsConfig: 'Reset all domain configs',
resetDomainConfig: 'Reset domain config',
removeDomain: 'Remove domain',
yesImSure: 'Yes, I\'m sure',
yesImSure: "Yes, I'm sure",
noCancel: 'No, cancel',
tools: 'Tools',
resetGlobalConfigBody: 'Are you sure you want to reset all configuration options in the global config section?',
resetGlobalConfigBody:
'Are you sure you want to reset all configuration options in the global config section?',
resetAllDomainsConfigBody: 'Are you sure you want to reset the configuration of ALL domains?',
removeAllDomainsBody: 'Are you sure you want to remove ALL domain configurations?',
areYouSureYouWantToResetAllConfigurationOptionsForThe: 'Are you sure you want to reset all configuration options for the',
areYouSureYouWantToResetAllConfigurationOptionsForThe:
'Are you sure you want to reset all configuration options for the',
domain: 'domain?',
areYouSureYouWantToRemoveThe: 'Are you sure you want to remove the ',
domainConfiguration: 'domain configuration?',

8
src/nginxconfig/i18n/en/templates/setup_sections/download.js

@ -28,13 +28,15 @@ import common from '../../common';
export default {
downloadTheGeneratedConfig: '<b>Download</b> the generated config:',
andUploadItToYourServers: 'and <b>upload</b> it to your server\'s',
andUploadItToYourServers: "and <b>upload</b> 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.',
pasteItInYourServersCommandLineAndExecute:
", paste it in your server's command line and execute it.",
navigateToYourNginxConfigurationDirectoryOnYourServer: `Navigate to your ${common.nginx} <b>configuration directory</b> on your server:`,
createABackupOfYourCurrentNginxConfiguration: `Create a <b>backup</b> of your current ${common.nginx} configuration:`,
extractTheNewCompressedConfigurationArchiveUsingTar: '<b>Extract</b> the new compressed configuration archive using tar:',
extractTheNewCompressedConfigurationArchiveUsingTar:
'<b>Extract</b> the new compressed configuration archive using tar:',
download: 'Download',
};

2
src/nginxconfig/i18n/en/templates/setup_sections/go_live.js

@ -27,7 +27,7 @@ THE SOFTWARE.
import common from '../../common';
export default {
letsGoLive: 'Let\'s go live!',
letsGoLive: "Let's go live!",
reloadNginxToLoadInYourNewConfiguration: `Reload ${common.nginx} to load in your new configuration:`,
goLive: 'Go live!',
};

3
src/nginxconfig/i18n/en/templates/setup_sections/ssl.js

@ -27,7 +27,8 @@ THE SOFTWARE.
import common from '../../common';
export default {
generateDiffieHellmanKeysByRunningThisCommandOnYourServer: 'Generate <b>Diffie-Hellman keys</b> by running this command on your server:',
generateDiffieHellmanKeysByRunningThisCommandOnYourServer:
'Generate <b>Diffie-Hellman keys</b> by running this command on your server:',
createACommonAcmeChallengeDirectoryForLetsEncrypt: `Create a common <b>ACME-challenge</b> directory (for <b>${common.letsEncrypt}</b>):`,
noAdditionalStepsAreNeededToSetUpSslForNginx: `No additional steps are needed to set up ${common.ssl} for your ${common.nginx} configuration.`,
sslInit: `${common.ssl} init`,

2
src/nginxconfig/i18n/es/common.js

@ -33,7 +33,7 @@ export default {
nginx: 'NGINX',
http: 'HTTP',
https: 'HTTPS',
letsEncrypt: 'Let\'s Encrypt',
letsEncrypt: "Let's Encrypt",
python: 'Python',
wordPress: 'WordPress',
drupal: 'Drupal',

3
src/nginxconfig/i18n/es/templates/callouts/contribute.js

@ -25,6 +25,7 @@ THE SOFTWARE.
*/
export default {
wantToContributeChanges: '👋 ¿Quiere solicitar nuevas funciones, contribuir con cambios o traducir la herramienta a un nuevo idioma?',
wantToContributeChanges:
'👋 ¿Quiere solicitar nuevas funciones, contribuir con cambios o traducir la herramienta a un nuevo idioma?',
getInvolvedOnGitHub: 'Involúcrate en GitHub',
};

13
src/nginxconfig/i18n/es/templates/domain_sections/index.js

@ -35,4 +35,15 @@ import server from './server';
import restrict from './restrict';
import onion from './onion';
export default { https, logging, php, presets, python, reverseProxy, routing, server, restrict, onion };
export default {
https,
logging,
php,
presets,
python,
reverseProxy,
routing,
server,
restrict,
onion,
};

9
src/nginxconfig/i18n/es/templates/domain_sections/onion.js

@ -29,8 +29,11 @@ const onion = 'Onion';
export default {
onion,
onionLocation: `Ubicación ${onion}`,
provideAnOnionLocationToSetOnionLocationHeader: 'Proporcione una dirección de ubicación Onion para configurar el encabezado de Onion-Location en su sitio.',
letsVisitorsKnownOnionServicesIsAvailable: 'Esto les permite a los visitantes saber que una versión de servicios Onion de su sitio está disponible para los navegadores Tor.',
provideAnOnionLocationToSetOnionLocationHeader:
'Proporcione una dirección de ubicación Onion para configurar el encabezado de Onion-Location en su sitio.',
letsVisitorsKnownOnionServicesIsAvailable:
'Esto les permite a los visitantes saber que una versión de servicios Onion de su sitio está disponible para los navegadores Tor.',
learnMoreAboutOnionServices: 'Más información sobre los servicios Onion',
onionLocationExpectedToEndWithOnion: 'Las direcciones de ubicación Onion normalmente terminan con `.onion`.',
onionLocationExpectedToEndWithOnion:
'Las direcciones de ubicación Onion normalmente terminan con `.onion`.',
};

3
src/nginxconfig/i18n/es/templates/domain_sections/presets.js

@ -28,7 +28,8 @@ THE SOFTWARE.
export default {
presets: 'Preajustes',
itLooksLikeYouCustomisedTheConfig: 'Parece que ha personalizado la configuración para este dominio. La elección de un nuevo ajuste preestablecido puede restablecer o cambiar algunas de las configuraciones que ha personalizado.',
itLooksLikeYouCustomisedTheConfig:
'Parece que ha personalizado la configuración para este dominio. La elección de un nuevo ajuste preestablecido puede restablecer o cambiar algunas de las configuraciones que ha personalizado.',
frontend: 'Frontend',
nodeJs: 'Node.js',
singlePageApplication: 'Single-page application',

3
src/nginxconfig/i18n/es/templates/domain_sections/server.js

@ -30,7 +30,8 @@ export default {
domain: 'Dominio',
documentRoot: 'Raiz del documento',
oneOrMoreOtherDomainsAreAlsoNamed: 'Uno o más dominios tienen también ese mismo nombre',
thisWillCauseIssuesWithConfigGeneration: 'Esto va a causar problemas en la generación de la configuracion.',
thisWillCauseIssuesWithConfigGeneration:
'Esto va a causar problemas en la generación de la configuracion.',
wwwSubdomain: 'subdominio www',
cdnSubdomain: 'subdominio CDN',
redirectSubdomains: 'redirección de subdominio',

1
src/nginxconfig/i18n/es/templates/global_sections/https.js

@ -30,7 +30,6 @@ const mozilla = 'Mozilla';
const ipv4 = 'IPv4';
const ipv6 = 'IPv6';
// 'Resolvers', 'webroot', 'listening socket' and 'worker' don't have a good translation in Spanish
export default {

12
src/nginxconfig/i18n/es/templates/global_sections/index.js

@ -34,4 +34,14 @@ import security from './security';
import tools from './tools';
import docker from './docker';
export default { https, logging, nginx, performance, python, reverseProxy, security, tools, docker };
export default {
https,
logging,
nginx,
performance,
python,
reverseProxy,
security,
tools,
docker,
};

3
src/nginxconfig/i18n/es/templates/global_sections/logging.js

@ -30,7 +30,8 @@ export default {
enableFileNotFoundErrorLogging: `${common.enable} el registro de error de archivo no encontrado`,
logformat: 'log_format',
level: 'logging level', // TODO: translate
enableCloudflare: 'agregar cabecera de petición de Cloudflare en el formato por defecto del registro',
enableCloudflare:
'agregar cabecera de petición de Cloudflare en el formato por defecto del registro',
cfRay: 'CF-Ray',
cfConnectingIp: 'CF-Connecting-IP',
xForwardedFor: 'X-Forwarded-For',

2
src/nginxconfig/i18n/es/templates/global_sections/performance.js

@ -26,7 +26,7 @@ THE SOFTWARE.
import common from '../../common';
export default {
export default {
disableHtmlCaching: 'Disable HTML caching', // TODO: translate
enableDisableHtmlCaching: 'disable HTML caching', // TODO: translate
gzipCompression: 'Compresión Gzip',

9
src/nginxconfig/i18n/es/templates/global_sections/tools.js

@ -43,10 +43,13 @@ export default {
yesImSure: 'Si, Estoy seguro',
noCancel: 'No, cancelar',
tools: 'Herramientas',
resetGlobalConfigBody: '¿Estás seguro de que desea reiniciar todas las opciones de configuración en la sección de configuración global?',
resetAllDomainsConfigBody: '¿Estás seguro de que desea reiniciar la configuración de TODOS los dominios?',
resetGlobalConfigBody:
'¿Estás seguro de que desea reiniciar todas las opciones de configuración en la sección de configuración global?',
resetAllDomainsConfigBody:
'¿Estás seguro de que desea reiniciar la configuración de TODOS los dominios?',
removeAllDomainsBody: '¿Estás seguro de que desea quitar TODAS las configuraciones de dominio?',
areYouSureYouWantToResetAllConfigurationOptionsForThe: '¿Estás seguro de que desea reiniciar todas las opciones de configuración del',
areYouSureYouWantToResetAllConfigurationOptionsForThe:
'¿Estás seguro de que desea reiniciar todas las opciones de configuración del',
domain: 'dominio?',
areYouSureYouWantToRemoveThe: '¿Estás seguro de que quieres quitar la ',
domainConfiguration: 'configuración de dominio?',

6
src/nginxconfig/i18n/es/templates/setup_sections/download.js

@ -35,9 +35,11 @@ export default {
directory: '.',
or: 'o, ',
copyBase64StringOfCompressedConfig: 'Copiar el texto comprimido en base64 de la configuracion',
pasteItInYourServersCommandLineAndExecute: ', péguelo en la línea de comando de su servidor y ejecútelo.',
pasteItInYourServersCommandLineAndExecute:
', péguelo en la línea de comando de su servidor y ejecútelo.',
navigateToYourNginxConfigurationDirectoryOnYourServer: `Navega en <b>la carpeta de configuracion</b> de ${common.nginx} de tu servidor:`,
createABackupOfYourCurrentNginxConfiguration: `Crea un <b>respaldo</b> de tu configuracion actual de ${common.nginx}:`,
extractTheNewCompressedConfigurationArchiveUsingTar: '<b>Extraer</b> el nuevo archivo de configuracion comprimido usando tar:',
extractTheNewCompressedConfigurationArchiveUsingTar:
'<b>Extraer</b> el nuevo archivo de configuracion comprimido usando tar:',
download: 'Descargar',
};

3
src/nginxconfig/i18n/es/templates/setup_sections/ssl.js

@ -27,7 +27,8 @@ THE SOFTWARE.
import common from '../../common';
export default {
generateDiffieHellmanKeysByRunningThisCommandOnYourServer: 'Genera <b> llaves Diffie-Hellman</b> ejecutando este comando en su servidor:',
generateDiffieHellmanKeysByRunningThisCommandOnYourServer:
'Genera <b> llaves Diffie-Hellman</b> ejecutando este comando en su servidor:',
createACommonAcmeChallengeDirectoryForLetsEncrypt: `Crear una simple carpeta <b>ACME-challenge</b> (para <b>${common.letsEncrypt}</b>):`,
noAdditionalStepsAreNeededToSetUpSslForNginx: `No se necesitan pasos adicionales para configurar ${common.ssl} en tu configuracion de ${common.nginx}.`,
sslInit: `Preparar el ${common.ssl}`,

2
src/nginxconfig/i18n/fr/common.js

@ -33,7 +33,7 @@ export default {
nginx: 'NGINX',
http: 'HTTP',
https: 'HTTPS',
letsEncrypt: 'Let\'s Encrypt',
letsEncrypt: "Let's Encrypt",
python: 'Python',
wordPress: 'WordPress',
drupal: 'Drupal',

3
src/nginxconfig/i18n/fr/templates/callouts/contribute.js

@ -25,6 +25,7 @@ THE SOFTWARE.
*/
export default {
wantToContributeChanges: '👋 Vous souhaitez demander de nouvelles fonctionnalités, apporter des modifications, ou traduire l\'outil dans une nouvelle langue?',
wantToContributeChanges:
"👋 Vous souhaitez demander de nouvelles fonctionnalités, apporter des modifications, ou traduire l'outil dans une nouvelle langue?",
getInvolvedOnGitHub: 'Participez sur GitHub',
};

2
src/nginxconfig/i18n/fr/templates/domain_sections/https.js

@ -40,7 +40,7 @@ export default {
certificationType: 'Type de certification',
customCertificate: 'Certificat personnalisé',
letsEncryptEmail: `E-mail ${common.letsEncrypt}`,
http3IsANonStandardModule: 'HTTP/3 n\'est pas un module standard de NGINX, veuillez lire ',
http3IsANonStandardModule: "HTTP/3 n'est pas un module standard de NGINX, veuillez lire ",
http3NginxQuicReadme: 'le Readme de NGINX QUIC',
http3OrThe: ' ou le ',
http3CloudflareQuicheProject: 'projet Cloudflare quiche',

13
src/nginxconfig/i18n/fr/templates/domain_sections/index.js

@ -35,4 +35,15 @@ import server from './server';
import restrict from './restrict';
import onion from './onion';
export default { https, logging, php, presets, python, reverseProxy, routing, server, restrict, onion };
export default {
https,
logging,
php,
presets,
python,
reverseProxy,
routing,
server,
restrict,
onion,
};

6
src/nginxconfig/i18n/fr/templates/domain_sections/onion.js

@ -29,8 +29,10 @@ const onion = 'Onion';
export default {
onion,
onionLocation: `Adresse ${onion}`,
provideAnOnionLocationToSetOnionLocationHeader: 'Fournir une adresse Onion pour définir le header Onion-Location pour votre site.',
letsVisitorsKnownOnionServicesIsAvailable: 'Indique aux visiteurs qu\'une version onion du site est disponible pour les navigateurs Tor.',
provideAnOnionLocationToSetOnionLocationHeader:
'Fournir une adresse Onion pour définir le header Onion-Location pour votre site.',
letsVisitorsKnownOnionServicesIsAvailable:
"Indique aux visiteurs qu'une version onion du site est disponible pour les navigateurs Tor.",
learnMoreAboutOnionServices: 'En apprendre plus sur les services Onion',
onionLocationExpectedToEndWithOnion: 'Une adresse onion se termine normalement avec `.onion`.',
};

3
src/nginxconfig/i18n/fr/templates/domain_sections/presets.js

@ -26,7 +26,8 @@ THE SOFTWARE.
export default {
presets: 'Préconfigurations',
itLooksLikeYouCustomisedTheConfig: 'Il semblerait que vous ayez customisé la configuration de ce domaine. Utiliser une nouvelle préconfiguration peut réinitialiser ou changer certains paramètres que vous avez définis.',
itLooksLikeYouCustomisedTheConfig:
'Il semblerait que vous ayez customisé la configuration de ce domaine. Utiliser une nouvelle préconfiguration peut réinitialiser ou changer certains paramètres que vous avez définis.',
frontend: 'Frontend',
nodeJs: 'Node.js',
singlePageApplication: 'Application monopage',

3
src/nginxconfig/i18n/fr/templates/domain_sections/server.js

@ -28,7 +28,8 @@ export default {
domain: 'Domaine',
documentRoot: 'Dossier racine',
oneOrMoreOtherDomainsAreAlsoNamed: 'Un ou plusieurs autres domaines sont aussi nommés',
thisWillCauseIssuesWithConfigGeneration: 'Cela causera des problèmes lors de la génération de la configuration.',
thisWillCauseIssuesWithConfigGeneration:
'Cela causera des problèmes lors de la génération de la configuration.',
wwwSubdomain: 'Sous-domaine www',
cdnSubdomain: 'Sous-domaine CDN',
redirectSubdomains: 'Rediriger les sous-domaines',

12
src/nginxconfig/i18n/fr/templates/global_sections/index.js

@ -34,4 +34,14 @@ import security from './security';
import tools from './tools';
import docker from './docker';
export default { https, logging, nginx, performance, python, reverseProxy, security, tools, docker };
export default {
https,
logging,
nginx,
performance,
python,
reverseProxy,
security,
tools,
docker,
};

2
src/nginxconfig/i18n/fr/templates/global_sections/performance.js

@ -33,7 +33,7 @@ export default {
enableGzipCompression: `${common.enable} la compression gzip`,
brotliCompression: 'Compression Brotli',
enableBrotliCompression: `${common.enable} la compression brotli`,
brotliIsANonStandardModule: 'Brotli n\'est pas un module standard de NGINX, veuillez lire le ',
brotliIsANonStandardModule: "Brotli n'est pas un module standard de NGINX, veuillez lire le ",
brotliGoogleNgxBrotliProject: 'projet Google ngx_brotli',
brotliForBuildingNginxWithBrotli: ' pour compiler NGINX avec le support Brotli!',
expirationForAssets: 'Expiration des assets',

9
src/nginxconfig/i18n/fr/templates/global_sections/tools.js

@ -43,10 +43,13 @@ export default {
yesImSure: 'Oui, je suis sûr(e)',
noCancel: 'Non, annuler',
tools: 'Outils',
resetGlobalConfigBody: 'Voulez-vous vraiment réinitialiser toutes les options de configuration globales?',
resetAllDomainsConfigBody: 'Voulez-vous vraiment réinitialiser les configurations de TOUS les domaines?',
resetGlobalConfigBody:
'Voulez-vous vraiment réinitialiser toutes les options de configuration globales?',
resetAllDomainsConfigBody:
'Voulez-vous vraiment réinitialiser les configurations de TOUS les domaines?',
removeAllDomainsBody: 'Voulez-vous vraiment supprimer les configurations de TOUS les domaines?',
areYouSureYouWantToResetAllConfigurationOptionsForThe: 'Voulez-vous vraiment réinitialiser toutes les options de configuration pour',
areYouSureYouWantToResetAllConfigurationOptionsForThe:
'Voulez-vous vraiment réinitialiser toutes les options de configuration pour',
domain: '?',
areYouSureYouWantToRemoveThe: 'Voulez-vous vraiment supprimer',
domainConfiguration: '?',

6
src/nginxconfig/i18n/fr/templates/setup_sections/download.js

@ -32,9 +32,11 @@ export default {
directory: 'de votre serveur.',
or: 'ou, ',
copyBase64StringOfCompressedConfig: 'copiez la configuration compressée et encodée en base64',
pasteItInYourServersCommandLineAndExecute: ', puis collez-la et exécutez-la en ligne de commande sur votre serveur.',
pasteItInYourServersCommandLineAndExecute:
', puis collez-la et exécutez-la en ligne de commande sur votre serveur.',
navigateToYourNginxConfigurationDirectoryOnYourServer: `Sur votre serveur, naviguez vers le <b>dossier de configuration</b> de ${common.nginx}:`,
createABackupOfYourCurrentNginxConfiguration: `Créez un <b>backup</b> de votre configuration ${common.nginx} actuelle:`,
extractTheNewCompressedConfigurationArchiveUsingTar: '<b>Décompressez</b> la nouvelle configuration en utilisant Tar:',
extractTheNewCompressedConfigurationArchiveUsingTar:
'<b>Décompressez</b> la nouvelle configuration en utilisant Tar:',
download: 'Téléchargement',
};

4
src/nginxconfig/i18n/fr/templates/setup_sections/go_live.js

@ -27,7 +27,7 @@ THE SOFTWARE.
import common from '../../common';
export default {
letsGoLive: 'C\'est en ligne!',
letsGoLive: "C'est en ligne!",
reloadNginxToLoadInYourNewConfiguration: `Relancez ${common.nginx} pour charger la nouvelle configuration:`,
goLive: 'C\'est en ligne!',
goLive: "C'est en ligne!",
};

3
src/nginxconfig/i18n/fr/templates/setup_sections/ssl.js

@ -27,7 +27,8 @@ THE SOFTWARE.
import common from '../../common';
export default {
generateDiffieHellmanKeysByRunningThisCommandOnYourServer: 'Générez des <b>clefs de Diffie-Hellman</b> en exécutant cette commande sur votre serveur:',
generateDiffieHellmanKeysByRunningThisCommandOnYourServer:
'Générez des <b>clefs de Diffie-Hellman</b> en exécutant cette commande sur votre serveur:',
createACommonAcmeChallengeDirectoryForLetsEncrypt: `Créez un répertoire commun <b>ACME-challenge</b> (pour <b>${common.letsEncrypt}</b>):`,
noAdditionalStepsAreNeededToSetUpSslForNginx: `Aucune étape additionnelle n'est nécessaire pour configurer ${common.ssl} pour ${common.nginx}.`,
sslInit: `${common.ssl} init`,

2
src/nginxconfig/i18n/ja/common.js

@ -33,7 +33,7 @@ export default {
nginx: 'NGINX',
http: 'HTTP',
https: 'HTTPS',
letsEncrypt: 'Let\'s Encrypt',
letsEncrypt: "Let's Encrypt",
python: 'Python',
wordPress: 'WordPress',
drupal: 'Drupal',

13
src/nginxconfig/i18n/ja/templates/domain_sections/index.js

@ -35,4 +35,15 @@ import server from './server';
import restrict from './restrict';
import onion from './onion';
export default { https, logging, php, presets, python, reverseProxy, routing, server, restrict, onion };
export default {
https,
logging,
php,
presets,
python,
reverseProxy,
routing,
server,
restrict,
onion,
};

6
src/nginxconfig/i18n/ja/templates/domain_sections/onion.js

@ -29,8 +29,10 @@ const onion = 'Onion';
export default {
onion,
onionLocation: `${onion} location`,
provideAnOnionLocationToSetOnionLocationHeader: 'サイトのOnion-Locationヘッダを設定するために、Onion locationアドレスを提供する。',
letsVisitorsKnownOnionServicesIsAvailable: 'これにより、あなたのサイトのオニオンサービス版がTorブラウザで利用可能であることをサイト訪問者に知らせます。',
provideAnOnionLocationToSetOnionLocationHeader:
'サイトのOnion-Locationヘッダを設定するために、Onion locationアドレスを提供する。',
letsVisitorsKnownOnionServicesIsAvailable:
'これにより、あなたのサイトのオニオンサービス版がTorブラウザで利用可能であることをサイト訪問者に知らせます。',
learnMoreAboutOnionServices: 'Onion サービスについて詳しくはこちら',
onionLocationExpectedToEndWithOnion: 'Onion location アドレスは通常 `.onion` で終わります。',
};

3
src/nginxconfig/i18n/ja/templates/domain_sections/presets.js

@ -26,7 +26,8 @@ THE SOFTWARE.
export default {
presets: 'プリセット',
itLooksLikeYouCustomisedTheConfig: 'このドメインの設定をカスタマイズしているようです。新しいプリセットを選択すると、カスタマイズした設定の一部がリセットまたは変更される場合があります。',
itLooksLikeYouCustomisedTheConfig:
'このドメインの設定をカスタマイズしているようです。新しいプリセットを選択すると、カスタマイズした設定の一部がリセットまたは変更される場合があります。',
frontend: 'フロントエンド',
nodeJs: 'Node.js',
singlePageApplication: 'シングルページアプリケーション(SPA)',

12
src/nginxconfig/i18n/ja/templates/global_sections/index.js

@ -34,4 +34,14 @@ import security from './security';
import tools from './tools';
import docker from './docker';
export default { https, logging, nginx, performance, python, reverseProxy, security, tools, docker };
export default {
https,
logging,
nginx,
performance,
python,
reverseProxy,
security,
tools,
docker,
};

3
src/nginxconfig/i18n/ja/templates/global_sections/tools.js

@ -46,7 +46,8 @@ export default {
resetGlobalConfigBody: 'グローバル設定の全ての設定をリセットします、よろしいですか?',
resetAllDomainsConfigBody: '全てのドメインの設定をリセットします、よろしいですか?',
removeAllDomainsBody: '全てのドメインを削除します、よろしいですか?',
areYouSureYouWantToResetAllConfigurationOptionsForThe: '次のドメインの設定をリセットします、よろしいですか?',
areYouSureYouWantToResetAllConfigurationOptionsForThe:
'次のドメインの設定をリセットします、よろしいですか?',
domain: '',
areYouSureYouWantToRemoveThe: '次のドメインの設定を削除します、よろしいですか?',
domainConfiguration: '',

6
src/nginxconfig/i18n/ja/templates/setup_sections/download.js

@ -28,13 +28,15 @@ import common from '../../common';
export default {
downloadTheGeneratedConfig: '生成された設定ファイルを<b>ダウンロードします</b>:',
andUploadItToYourServers: 'そして、ご利用のサーバの以下のディレクトリに設定ファイルを <b>アップロードします</b>',
andUploadItToYourServers:
'そして、ご利用のサーバの以下のディレクトリに設定ファイルを <b>アップロードします</b>',
directory: '。',
or: 'もしくは、',
copyBase64StringOfCompressedConfig: '設定が圧縮されたbase64文字列をコピーし',
pasteItInYourServersCommandLineAndExecute: '、 サーバのコマンドラインにペーストして実行します',
navigateToYourNginxConfigurationDirectoryOnYourServer: `サーバの ${common.nginx} の<b>設定ディレクトリ</b>へ移動します:`,
createABackupOfYourCurrentNginxConfiguration: `現在の ${common.nginx} の設定を<b>バックアップします</b>:`,
extractTheNewCompressedConfigurationArchiveUsingTar: 'tar を使って、新しい設定の入った圧縮ファイルを<b>展開します</b>:',
extractTheNewCompressedConfigurationArchiveUsingTar:
'tar を使って、新しい設定の入った圧縮ファイルを<b>展開します</b>:',
download: 'ダウンロード',
};

3
src/nginxconfig/i18n/ja/templates/setup_sections/ssl.js

@ -27,7 +27,8 @@ THE SOFTWARE.
import common from '../../common';
export default {
generateDiffieHellmanKeysByRunningThisCommandOnYourServer: 'サーバでこのコマンドを実行して <b>Diffie-Hellman keys</b> を生成します:',
generateDiffieHellmanKeysByRunningThisCommandOnYourServer:
'サーバでこのコマンドを実行して <b>Diffie-Hellman keys</b> を生成します:',
createACommonAcmeChallengeDirectoryForLetsEncrypt: `共通の <b>ACME-challenge</b> ディレクトリを作成します (<b>${common.letsEncrypt}</b> の場合):`,
noAdditionalStepsAreNeededToSetUpSslForNginx: `${common.ssl}${common.nginx} の構成に設定するための追加の手順は必要ありません。`,
sslInit: `${common.ssl} 初期設定`,

2
src/nginxconfig/i18n/pl/common.js

@ -33,7 +33,7 @@ export default {
nginx: 'NGINX',
http: 'HTTP',
https: 'HTTPS',
letsEncrypt: 'Let\'s Encrypt',
letsEncrypt: "Let's Encrypt",
python: 'Python',
wordPress: 'WordPress',
drupal: 'Drupal',

3
src/nginxconfig/i18n/pl/templates/callouts/contribute.js

@ -25,6 +25,7 @@ THE SOFTWARE.
*/
export default {
wantToContributeChanges: '👋 Chcesz zapropnować nowe funkcje, wprowadzić zmiany lub przetłumaczyć narzędzie na inny język?',
wantToContributeChanges:
'👋 Chcesz zapropnować nowe funkcje, wprowadzić zmiany lub przetłumaczyć narzędzie na inny język?',
getInvolvedOnGitHub: 'Zaangażuj się na GitHub',
};

13
src/nginxconfig/i18n/pl/templates/domain_sections/index.js

@ -35,4 +35,15 @@ import server from './server';
import restrict from './restrict';
import onion from './onion';
export default { https, logging, php, presets, python, reverseProxy, routing, server, restrict, onion };
export default {
https,
logging,
php,
presets,
python,
reverseProxy,
routing,
server,
restrict,
onion,
};

6
src/nginxconfig/i18n/pl/templates/domain_sections/onion.js

@ -29,8 +29,10 @@ const onion = 'Onion';
export default {
onion,
onionLocation: `lokalizacja ${onion}`,
provideAnOnionLocationToSetOnionLocationHeader: 'Podaj adres lokalizacji onion aby ustawić nagłówek Onion-Location dla Twojej strony.',
letsVisitorsKnownOnionServicesIsAvailable: 'Inforuje Twoich odiwedzających, że dostępna jest wersja onion Twojego serwisu dla przeglądarek Tor.',
provideAnOnionLocationToSetOnionLocationHeader:
'Podaj adres lokalizacji onion aby ustawić nagłówek Onion-Location dla Twojej strony.',
letsVisitorsKnownOnionServicesIsAvailable:
'Inforuje Twoich odiwedzających, że dostępna jest wersja onion Twojego serwisu dla przeglądarek Tor.',
learnMoreAboutOnionServices: 'Dowiedz się więcej o serwisach Onion',
onionLocationExpectedToEndWithOnion: 'Adres lokalizacji Onion zwykle kończy się na `.onion`.',
};

3
src/nginxconfig/i18n/pl/templates/domain_sections/presets.js

@ -26,7 +26,8 @@ THE SOFTWARE.
export default {
presets: 'Ustawienia wstępne',
itLooksLikeYouCustomisedTheConfig: 'Wygląda na to, że dostosowałeś konfigurację dla tej domeny. Wybranie nowego ustawienia wstępnego może spowodować zresetowanie lub zmianę niektórych dostosowanych ustawień.',
itLooksLikeYouCustomisedTheConfig:
'Wygląda na to, że dostosowałeś konfigurację dla tej domeny. Wybranie nowego ustawienia wstępnego może spowodować zresetowanie lub zmianę niektórych dostosowanych ustawień.',
frontend: 'Frontend',
nodeJs: 'Node.js',
singlePageApplication: 'Aplikacja Single-page (SPA)',

3
src/nginxconfig/i18n/pl/templates/domain_sections/server.js

@ -28,7 +28,8 @@ export default {
domain: 'Domena',
documentRoot: 'Document root',
oneOrMoreOtherDomainsAreAlsoNamed: 'Jedna lub więej domen ma również nazwę',
thisWillCauseIssuesWithConfigGeneration: 'Spowoduje to problem z generowaniem pliku konfiguracyjnego.',
thisWillCauseIssuesWithConfigGeneration:
'Spowoduje to problem z generowaniem pliku konfiguracyjnego.',
wwwSubdomain: 'subdomena dla www',
cdnSubdomain: 'subdomena dla CDN',
redirectSubdomains: 'Przekieruj subdomeny',

2
src/nginxconfig/i18n/pl/templates/footer.js

@ -27,7 +27,7 @@ THE SOFTWARE.
export default {
backToTop: 'Wróć na górę',
thisToolIs: 'To narzędzie jest',
openSourceOnGitHub: 'open-source\'owane na GitHub',
openSourceOnGitHub: "open-source'owane na GitHub",
underThe: 'na',
mit: 'licencji MIT',
license: '!',

12
src/nginxconfig/i18n/pl/templates/global_sections/index.js

@ -34,4 +34,14 @@ import security from './security';
import tools from './tools';
import docker from './docker';
export default { https, logging, nginx, performance, python, reverseProxy, security, tools, docker };
export default {
https,
logging,
nginx,
performance,
python,
reverseProxy,
security,
tools,
docker,
};

6
src/nginxconfig/i18n/pl/templates/global_sections/tools.js

@ -43,10 +43,12 @@ export default {
yesImSure: 'Tak, jestem pewien',
noCancel: 'Nie, poniechaj',
tools: 'Narzędzia',
resetGlobalConfigBody: 'Czy na pewno chcesz zresetować wszystkie opcje konfiguracji w sekcji konfiguracji globalnej?',
resetGlobalConfigBody:
'Czy na pewno chcesz zresetować wszystkie opcje konfiguracji w sekcji konfiguracji globalnej?',
resetAllDomainsConfigBody: 'Czy na pewno chcesz zresetować konfigurację WSZYSTKICH domen?',
removeAllDomainsBody: 'Czy na pewno chcesz usunąć WSZYSTKIE konfiguracje domeny?',
areYouSureYouWantToResetAllConfigurationOptionsForThe: 'Czy na pewno chcesz zresetować wszystkie opcje konfiguracji domeny',
areYouSureYouWantToResetAllConfigurationOptionsForThe:
'Czy na pewno chcesz zresetować wszystkie opcje konfiguracji domeny',
domain: '?',
areYouSureYouWantToRemoveThe: 'Czy napewno chcesz usunąć konfigurację dla domeny ',
domainConfiguration: '?',

3
src/nginxconfig/i18n/pl/templates/setup_sections/download.js

@ -35,6 +35,7 @@ export default {
pasteItInYourServersCommandLineAndExecute: ', wklej go w terminalu na serwerze i uruchom go.',
navigateToYourNginxConfigurationDirectoryOnYourServer: `Nawiguj do <b>ścieżki konfiguracyjnej</b> ${common.nginx} na swoim serwerze:`,
createABackupOfYourCurrentNginxConfiguration: `Utrwórz <b>kopię zapasową</b> swojego obecnego pliku konfiguracyjnego ${common.nginx}:`,
extractTheNewCompressedConfigurationArchiveUsingTar: '<b>Wypakuj</b> skompresowane archiwum z konfiguracją, korzystając z tar:',
extractTheNewCompressedConfigurationArchiveUsingTar:
'<b>Wypakuj</b> skompresowane archiwum z konfiguracją, korzystając z tar:',
download: 'Pobierz',
};

3
src/nginxconfig/i18n/pl/templates/setup_sections/ssl.js

@ -27,7 +27,8 @@ THE SOFTWARE.
import common from '../../common';
export default {
generateDiffieHellmanKeysByRunningThisCommandOnYourServer: 'Wygeneruj <b>klucze Diffie-Hellman</b> uruchamiając te komendę na swoim serwerze:',
generateDiffieHellmanKeysByRunningThisCommandOnYourServer:
'Wygeneruj <b>klucze Diffie-Hellman</b> uruchamiając te komendę na swoim serwerze:',
createACommonAcmeChallengeDirectoryForLetsEncrypt: `Utwórz powszechny katalog <b>ACME-challenge</b> (dla <b>${common.letsEncrypt}</b>):`,
noAdditionalStepsAreNeededToSetUpSslForNginx: `Nie potrzeba żadnych dodatkowych kroków dla ${common.ssl} w Twojej konfiguracji ${common.nginx}.`,
sslInit: `${common.ssl} init`,

2
src/nginxconfig/i18n/pt-br/common.js

@ -33,7 +33,7 @@ export default {
nginx: 'NGINX',
http: 'HTTP',
https: 'HTTPS',
letsEncrypt: 'Let\'s Encrypt',
letsEncrypt: "Let's Encrypt",
python: 'Python',
wordPress: 'WordPress',
drupal: 'Drupal',

3
src/nginxconfig/i18n/pt-br/templates/callouts/contribute.js

@ -25,6 +25,7 @@ THE SOFTWARE.
*/
export default {
wantToContributeChanges: '👋 Want to request new features, contribute changes, or translate the tool into a new language?', // TODO: translate
wantToContributeChanges:
'👋 Want to request new features, contribute changes, or translate the tool into a new language?', // TODO: translate
getInvolvedOnGitHub: 'Get involved on GitHub', // TODO: translate
};

2
src/nginxconfig/i18n/pt-br/templates/callouts/droplet.js

@ -26,5 +26,5 @@ THE SOFTWARE.
export default {
lookingForAPlaceToDeploy: '👋 Looking for a place to deploy your new configuration?', // TODO: translate
tryOutDigitalOceansDroplet: 'Try out DigitalOcean\'s LEMP Droplet with NGINX', // TODO: translate
tryOutDigitalOceansDroplet: "Try out DigitalOcean's LEMP Droplet with NGINX", // TODO: translate
};

2
src/nginxconfig/i18n/pt-br/templates/domain_sections/https.js

@ -40,7 +40,7 @@ export default {
certificationType: 'Tipo de certificação',
customCertificate: 'Certificado personalizado',
letsEncryptEmail: `E-mail do ${common.letsEncrypt}`,
http3IsANonStandardModule: 'HTTP/3 isn\'t a standard NGINX module, check the ', // TODO: translate
http3IsANonStandardModule: "HTTP/3 isn't a standard NGINX module, check the ", // TODO: translate
http3NginxQuicReadme: 'NGINX QUIC readme', // TODO: translate
http3OrThe: ' or the ', // TODO: translate
http3CloudflareQuicheProject: 'Cloudflare quiche project', // TODO: translate

13
src/nginxconfig/i18n/pt-br/templates/domain_sections/index.js

@ -35,4 +35,15 @@ import server from './server';
import restrict from './restrict';
import onion from './onion';
export default { https, logging, php, presets, python, reverseProxy, routing, server, restrict, onion };
export default {
https,
logging,
php,
presets,
python,
reverseProxy,
routing,
server,
restrict,
onion,
};

6
src/nginxconfig/i18n/pt-br/templates/domain_sections/onion.js

@ -29,8 +29,10 @@ const onion = 'Onion';
export default {
onion,
onionLocation: `${onion} location`, // TODO: translate
provideAnOnionLocationToSetOnionLocationHeader: 'Provide an onion location address to set the Onion-Location header for your site.', // TODO: translate
letsVisitorsKnownOnionServicesIsAvailable: 'This lets visitors know that an onion services version of your site is available for Tor browsers.', // TODO: translate
provideAnOnionLocationToSetOnionLocationHeader:
'Provide an onion location address to set the Onion-Location header for your site.', // TODO: translate
letsVisitorsKnownOnionServicesIsAvailable:
'This lets visitors know that an onion services version of your site is available for Tor browsers.', // TODO: translate
learnMoreAboutOnionServices: 'Learn more about Onion services', // TODO: translate
onionLocationExpectedToEndWithOnion: 'Onion location addresses normally end with `.onion`.', // TODO: translate
};

3
src/nginxconfig/i18n/pt-br/templates/domain_sections/presets.js

@ -26,7 +26,8 @@ THE SOFTWARE.
export default {
presets: 'Predefinições',
itLooksLikeYouCustomisedTheConfig: 'Parece que você personalizou a configuração para este domínio. A escolha de uma nova predefinição pode redefinir ou alterar algumas das configurações que você personalizou.',
itLooksLikeYouCustomisedTheConfig:
'Parece que você personalizou a configuração para este domínio. A escolha de uma nova predefinição pode redefinir ou alterar algumas das configurações que você personalizou.',
frontend: 'Frontend',
nodeJs: 'Node.js',
singlePageApplication: 'Aplicação de página única',

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save