All the files!
parent
88d66f415c
commit
7c12dfc0c2
|
@ -171,7 +171,7 @@ export default (domain, domains, global) => {
|
|||
|
||||
if (global.tools.modularizedStructure.computed) {
|
||||
// Modularized
|
||||
locConf.push(['include', 'nginxconfig.io/python_uwsgi.conf']);
|
||||
locConf.push(['include', 'nginxconfig.io/proxy.conf']);
|
||||
} else {
|
||||
// Unified
|
||||
locConf.push(...Object.entries(proxyConf()));
|
||||
|
|
|
@ -4,6 +4,12 @@ import websiteConf from './conf/website.conf';
|
|||
import letsEncryptConf from './conf/letsencrypt.conf';
|
||||
import securityConf from './conf/security.conf';
|
||||
import generalConf from './conf/general.conf';
|
||||
import phpConf from './conf/php_fastcgi.conf';
|
||||
import pythonConf from './conf/python_uwsgi.conf';
|
||||
import proxyConf from './conf/proxy.conf';
|
||||
import wordPressConf from './conf/wordpress.conf';
|
||||
import drupalConf from './conf/drupal.conf';
|
||||
import magentoConf from './conf/magento.conf';
|
||||
|
||||
export default (domains, global) => {
|
||||
const files = [];
|
||||
|
@ -30,6 +36,31 @@ export default (domains, global) => {
|
|||
|
||||
// General
|
||||
files.push(['nginxconfig.io/general.conf', toConf(generalConf(domains, global))]);
|
||||
|
||||
// PHP
|
||||
if (domains.some(d => d.php.php.computed))
|
||||
files.push(['nginxconfig.io/php_fastcgi.conf', toConf(phpConf(domains, global))]);
|
||||
|
||||
// Python
|
||||
if (domains.some(d => d.python.python.computed))
|
||||
files.push(['nginxconfig.io/python_uwsgi.conf', toConf(pythonConf(global))]);
|
||||
|
||||
// Reverse proxy
|
||||
if (domains.some(d => d.reverseProxy.reverseProxy.computed))
|
||||
files.push(['nginxconfig.io/proxy.conf', toConf(proxyConf())]);
|
||||
|
||||
// WordPress
|
||||
if (domains.some(d => d.php.wordPressRules.computed))
|
||||
files.push(['nginxconfig.io/wordpress.conf', toConf(wordPressConf(global))]);
|
||||
|
||||
// Drupal
|
||||
if (domains.some(d => d.php.drupalRules.computed))
|
||||
files.push(['nginxconfig.io/drupal.conf', toConf(drupalConf(global))]);
|
||||
|
||||
// Drupal
|
||||
if (domains.some(d => d.php.magentoRules.computed))
|
||||
files.push(['nginxconfig.io/magento.conf', toConf(magentoConf())]);
|
||||
|
||||
}
|
||||
|
||||
return files;
|
||||
|
|
|
@ -75,12 +75,19 @@ const recurse = (entriesOrObject, depth) => {
|
|||
});
|
||||
}
|
||||
|
||||
return retVal
|
||||
.replace(/\n\n\n/g, '\n\n') // Cleanup triple linebreaks
|
||||
.replace(/^([^\S\r\n]*})(?:\n[^\S\r\n]*)+\n([^\S\r\n]*})/gm, '$1\n$2') // Cleanup extra linebreaks between multiple close blocks
|
||||
.replace(/^([^\S\r\n]*[^#\s].*[^\n])\n([^\S\r\n]*)#/gm, '$1\n\n$2#') // Double linebreak before comment
|
||||
.replace(/^([^\S\r\n]*#.*)(?:\n[^\S\r\n]*)+\n([^\S\r\n]*.*{)/gm, '$1\n$2') // Single linebreak between comment and block
|
||||
.replace(/^([^\S\r\n]*#.*\n[^\S\r\n]*#.*\n)([^\S\r\n]*[^#\s])/gm, '$1\n$2'); // Double linebreak after double comment
|
||||
return retVal;
|
||||
};
|
||||
|
||||
export default entriesOrObject => recurse(entriesOrObject, 0);
|
||||
export default entriesOrObject => recurse(entriesOrObject, 0)
|
||||
// Cleanup triple linebreaks
|
||||
.replace(/\n\n\n/g, '\n\n')
|
||||
// Cleanup extra linebreaks between multiple close blocks
|
||||
.replace(/^([^\S\r\n]*})(?:\n[^\S\r\n]*)+\n([^\S\r\n]*})/gm, '$1\n$2')
|
||||
// Double linebreak before comment
|
||||
.replace(/^([^\S\r\n]*[^#\s].*[^\n])\n([^\S\r\n]*)#/gm, '$1\n\n$2#')
|
||||
// Single linebreak between comment and block
|
||||
.replace(/^([^\S\r\n]*#.*)(?:\n[^\S\r\n]*)+\n([^\S\r\n]*.*{)/gm, '$1\n$2')
|
||||
// Double linebreak after double comment
|
||||
.replace(/^([^\S\r\n]*#.*\n[^\S\r\n]*#.*\n)([^\S\r\n]*[^#\s])/gm, '$1\n$2')
|
||||
// Remove initial & trailing whitespace
|
||||
.trim();
|
||||
|
|
|
@ -63,10 +63,14 @@ limitations under the License.
|
|||
|
||||
<div :class="`column ${splitColumn ? 'is-half' : 'is-full'} is-full-mobile is-full-tablet`">
|
||||
<h2>Config files</h2>
|
||||
<template v-for="(conf, i) in confFiles">
|
||||
<h3>{{ nginxDir }}/{{ conf[0] }}</h3>
|
||||
<Prism :key="`${conf[0]}${i}`" language="nginx" :code="conf[1]"></Prism>
|
||||
</template>
|
||||
<div class="columns is-multiline">
|
||||
<div v-for="(conf, i) in confFiles"
|
||||
:class="`column ${confFiles.length > 1 && !splitColumn ? 'is-half' : 'is-full'} is-full-mobile is-full-tablet`"
|
||||
>
|
||||
<h3>{{ nginxDir }}/{{ conf[0] }}</h3>
|
||||
<Prism :key="`${conf[0]}${i}`" language="nginx" :code="conf[1]"></Prism>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue