* Joomla! conf * fix bug escape character & ; * remove global and fix presets } * change requestspull/189/head
parent
8bc06372a3
commit
ae322cf2c5
|
@ -48,7 +48,7 @@ use-case** (and in parallel you can still use the docs).
|
||||||
|
|
||||||
**Features:**
|
**Features:**
|
||||||
HTTPS, HTTP/2, IPv6, certbot, HSTS, security headers, SSL profiles, OCSP resolvers, caching, gzip, brotli, fallback
|
HTTPS, HTTP/2, IPv6, certbot, HSTS, security headers, SSL profiles, OCSP resolvers, caching, gzip, brotli, fallback
|
||||||
routing, reverse proxy, www/non-www redirect, CDN, PHP (TCP/socket, WordPress, Drupal, Magento), Node.js support, Python
|
routing, reverse proxy, www/non-www redirect, CDN, PHP (TCP/socket, WordPress, Drupal, Magento, Joomla), Node.js support, Python
|
||||||
(Django) server, etc.
|
(Django) server, etc.
|
||||||
|
|
||||||
## 👨💻 Author
|
## 👨💻 Author
|
||||||
|
|
|
@ -0,0 +1,49 @@
|
||||||
|
/*
|
||||||
|
Copyright 2020 DigitalOcean
|
||||||
|
|
||||||
|
This code is licensed under the MIT License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
https://github.com/digitalocean/nginxconfig.io/blob/master/LICENSE or https://mit-license.org/
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions :
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in
|
||||||
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
export default () => {
|
||||||
|
const config = {};
|
||||||
|
|
||||||
|
config['# Joomla: deny running scripts inside writable directories'] = '';
|
||||||
|
config['location ~* /(images|cache|media|logs|tmp)/.*\\.(php|pl|py|jsp|asp|sh|cgi)$'] = {
|
||||||
|
return: '403',
|
||||||
|
error_page: '403 /403_error.html',
|
||||||
|
};
|
||||||
|
|
||||||
|
config['# Joomla: caching of files'] = '';
|
||||||
|
config['location ~* \\.(ico|pdf|flv)$'] = {
|
||||||
|
expires: '1y',
|
||||||
|
};
|
||||||
|
|
||||||
|
config['# Joomla: caching of files'] = '';
|
||||||
|
config['location ~* \\.(js|css|png|jpg|jpeg|gif|swf|xml|txt)$'] = {
|
||||||
|
expires: '14d',
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// Done!
|
||||||
|
return config;
|
||||||
|
};
|
|
@ -36,6 +36,7 @@ import generalConf from './general.conf';
|
||||||
import wordPressConf from './wordpress.conf';
|
import wordPressConf from './wordpress.conf';
|
||||||
import drupalConf from './drupal.conf';
|
import drupalConf from './drupal.conf';
|
||||||
import magentoConf from './magento.conf';
|
import magentoConf from './magento.conf';
|
||||||
|
import joomlaConf from './joomla.conf';
|
||||||
import letsEncryptConf from './letsencrypt.conf';
|
import letsEncryptConf from './letsencrypt.conf';
|
||||||
|
|
||||||
const sslConfig = (domain, global) => {
|
const sslConfig = (domain, global) => {
|
||||||
|
@ -261,6 +262,7 @@ export default (domain, domains, global) => {
|
||||||
if (domain.php.wordPressRules.computed) serverConfig.push(['include', 'nginxconfig.io/wordpress.conf']);
|
if (domain.php.wordPressRules.computed) serverConfig.push(['include', 'nginxconfig.io/wordpress.conf']);
|
||||||
if (domain.php.drupalRules.computed) serverConfig.push(['include', 'nginxconfig.io/drupal.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.magentoRules.computed) serverConfig.push(['include', 'nginxconfig.io/magento.conf']);
|
||||||
|
if (domain.php.joomlaRules.computed) serverConfig.push(['include', 'nginxconfig.io/joomla.conf']);
|
||||||
} else {
|
} else {
|
||||||
// Unified
|
// Unified
|
||||||
serverConfig.push(...Object.entries(generalConf(domains, global)));
|
serverConfig.push(...Object.entries(generalConf(domains, global)));
|
||||||
|
@ -271,6 +273,7 @@ export default (domain, domains, global) => {
|
||||||
if (domain.php.wordPressRules.computed) serverConfig.push(...Object.entries(wordPressConf(global)));
|
if (domain.php.wordPressRules.computed) serverConfig.push(...Object.entries(wordPressConf(global)));
|
||||||
if (domain.php.drupalRules.computed) serverConfig.push(...Object.entries(drupalConf(global)));
|
if (domain.php.drupalRules.computed) serverConfig.push(...Object.entries(drupalConf(global)));
|
||||||
if (domain.php.magentoRules.computed) serverConfig.push(...Object.entries(magentoConf()));
|
if (domain.php.magentoRules.computed) serverConfig.push(...Object.entries(magentoConf()));
|
||||||
|
if (domain.php.joomlaRules.computed) serverConfig.push(...Object.entries(joomlaConf()));
|
||||||
}
|
}
|
||||||
|
|
||||||
// PHP
|
// PHP
|
||||||
|
|
|
@ -37,6 +37,7 @@ import proxyConf from './conf/proxy.conf';
|
||||||
import wordPressConf from './conf/wordpress.conf';
|
import wordPressConf from './conf/wordpress.conf';
|
||||||
import drupalConf from './conf/drupal.conf';
|
import drupalConf from './conf/drupal.conf';
|
||||||
import magentoConf from './conf/magento.conf';
|
import magentoConf from './conf/magento.conf';
|
||||||
|
import joomlaConf from './conf/joomla.conf';
|
||||||
import dockerComposeYaml from './yaml/dockerCompose.yaml';
|
import dockerComposeYaml from './yaml/dockerCompose.yaml';
|
||||||
import dockerConf from './ext/docker';
|
import dockerConf from './ext/docker';
|
||||||
|
|
||||||
|
@ -94,6 +95,10 @@ export default (domains, global) => {
|
||||||
if (domains.some(d => d.php.magentoRules.computed))
|
if (domains.some(d => d.php.magentoRules.computed))
|
||||||
files['nginxconfig.io/magento.conf'] = toConf(magentoConf());
|
files['nginxconfig.io/magento.conf'] = toConf(magentoConf());
|
||||||
|
|
||||||
|
// Joomla
|
||||||
|
if (domains.some(d => d.php.joomlaRules.computed))
|
||||||
|
files['nginxconfig.io/joomla.conf'] = toConf(joomlaConf());
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// PHP
|
// PHP
|
||||||
if (domains.some(d => d.php.wordPressRules.computed))
|
if (domains.some(d => d.php.wordPressRules.computed))
|
||||||
|
|
|
@ -40,6 +40,7 @@ export default {
|
||||||
wordPress: 'WordPress',
|
wordPress: 'WordPress',
|
||||||
drupal: 'Drupal',
|
drupal: 'Drupal',
|
||||||
magento: 'Magento',
|
magento: 'Magento',
|
||||||
|
joomla: 'Joomla',
|
||||||
django: 'Django',
|
django: 'Django',
|
||||||
logging: 'Logging',
|
logging: 'Logging',
|
||||||
reverseProxy: 'Reverse proxy',
|
reverseProxy: 'Reverse proxy',
|
||||||
|
|
|
@ -37,4 +37,6 @@ export default {
|
||||||
enableDrupalRules: `${common.enable} ${common.drupal}-specific rules`,
|
enableDrupalRules: `${common.enable} ${common.drupal}-specific rules`,
|
||||||
magentoRules: `${common.magento} rules`,
|
magentoRules: `${common.magento} rules`,
|
||||||
enableMagentoRules: `${common.enable} ${common.magento}-specific rules`,
|
enableMagentoRules: `${common.enable} ${common.magento}-specific rules`,
|
||||||
|
joomlaRules: `${common.joomla} rules`,
|
||||||
|
enableJoomlaRules: `${common.enable} ${common.joomla}-specific rules`,
|
||||||
};
|
};
|
||||||
|
|
|
@ -118,6 +118,24 @@ THE SOFTWARE.
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div v-if="joomlaRulesEnabled" class="field is-horizontal">
|
||||||
|
<div class="field-label">
|
||||||
|
<label class="label">{{ i18n.templates.domainSections.php.joomlaRules }}</label>
|
||||||
|
</div>
|
||||||
|
<div class="field-body">
|
||||||
|
<div class="field">
|
||||||
|
<div :class="`control${joomlaRulesChanged ? ' is-changed' : ''}`">
|
||||||
|
<div class="checkbox">
|
||||||
|
<PrettyCheck v-model="joomlaRules" class="p-default p-curve p-fill p-icon">
|
||||||
|
<i slot="extra" class="icon fas fa-check"></i>
|
||||||
|
{{ i18n.templates.domainSections.php.enableJoomlaRules }}
|
||||||
|
</PrettyCheck>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -144,6 +162,10 @@ THE SOFTWARE.
|
||||||
default: false,
|
default: false,
|
||||||
enabled: true,
|
enabled: true,
|
||||||
},
|
},
|
||||||
|
joomlaRules: {
|
||||||
|
default: false,
|
||||||
|
enabled: true,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
@ -188,6 +210,8 @@ THE SOFTWARE.
|
||||||
this.$props.data.drupalRules.computed = this.$props.data.drupalRules.value;
|
this.$props.data.drupalRules.computed = this.$props.data.drupalRules.value;
|
||||||
this.$props.data.magentoRules.enabled = true;
|
this.$props.data.magentoRules.enabled = true;
|
||||||
this.$props.data.magentoRules.computed = this.$props.data.magentoRules.value;
|
this.$props.data.magentoRules.computed = this.$props.data.magentoRules.value;
|
||||||
|
this.$props.data.joomlaRules.enabled = true;
|
||||||
|
this.$props.data.joomlaRules.computed = this.$props.data.joomlaRules.value;
|
||||||
} else {
|
} else {
|
||||||
this.$props.data.wordPressRules.enabled = false;
|
this.$props.data.wordPressRules.enabled = false;
|
||||||
this.$props.data.wordPressRules.computed = false;
|
this.$props.data.wordPressRules.computed = false;
|
||||||
|
@ -195,6 +219,8 @@ THE SOFTWARE.
|
||||||
this.$props.data.drupalRules.computed = false;
|
this.$props.data.drupalRules.computed = false;
|
||||||
this.$props.data.magentoRules.enabled = false;
|
this.$props.data.magentoRules.enabled = false;
|
||||||
this.$props.data.magentoRules.computed = false;
|
this.$props.data.magentoRules.computed = false;
|
||||||
|
this.$props.data.joomlaRules.enabled = false;
|
||||||
|
this.$props.data.joomlaRules.computed = false;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
deep: true,
|
deep: true,
|
||||||
|
|
|
@ -83,7 +83,8 @@ THE SOFTWARE.
|
||||||
&& !data.routing.fallbackHtml.computed
|
&& !data.routing.fallbackHtml.computed
|
||||||
&& !data.php.wordPressRules.computed
|
&& !data.php.wordPressRules.computed
|
||||||
&& !data.php.drupalRules.computed
|
&& !data.php.drupalRules.computed
|
||||||
&& !data.php.magentoRules.computed;
|
&& !data.php.magentoRules.computed
|
||||||
|
&& !data.php.joomlaRules.computed;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
django: {
|
django: {
|
||||||
|
@ -125,7 +126,8 @@ THE SOFTWARE.
|
||||||
&& !data.routing.fallbackHtml.computed
|
&& !data.routing.fallbackHtml.computed
|
||||||
&& data.php.wordPressRules.computed
|
&& data.php.wordPressRules.computed
|
||||||
&& !data.php.drupalRules.computed
|
&& !data.php.drupalRules.computed
|
||||||
&& !data.php.magentoRules.computed;
|
&& !data.php.magentoRules.computed
|
||||||
|
&& !data.php.joomlaRules.computed;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
drupal: {
|
drupal: {
|
||||||
|
@ -138,7 +140,8 @@ THE SOFTWARE.
|
||||||
&& !data.routing.fallbackHtml.computed
|
&& !data.routing.fallbackHtml.computed
|
||||||
&& !data.php.wordPressRules.computed
|
&& !data.php.wordPressRules.computed
|
||||||
&& data.php.drupalRules.computed
|
&& data.php.drupalRules.computed
|
||||||
&& !data.php.magentoRules.computed;
|
&& !data.php.magentoRules.computed
|
||||||
|
&& !data.php.joomlaRules.computed;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
magento: {
|
magento: {
|
||||||
|
@ -151,7 +154,22 @@ THE SOFTWARE.
|
||||||
&& !data.routing.fallbackHtml.computed
|
&& !data.routing.fallbackHtml.computed
|
||||||
&& !data.php.wordPressRules.computed
|
&& !data.php.wordPressRules.computed
|
||||||
&& !data.php.drupalRules.computed
|
&& !data.php.drupalRules.computed
|
||||||
&& data.php.magentoRules.computed;
|
&& data.php.magentoRules.computed
|
||||||
|
&& !data.php.joomlaRules.computed;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
joomla: {
|
||||||
|
default: false,
|
||||||
|
display: i18n.common.joomla,
|
||||||
|
enabled: true,
|
||||||
|
computedCheck(data) {
|
||||||
|
return data.routing.index.computed === 'index.php'
|
||||||
|
&& data.routing.fallbackPhp.computed
|
||||||
|
&& !data.routing.fallbackHtml.computed
|
||||||
|
&& !data.php.wordPressRules.computed
|
||||||
|
&& !data.php.drupalRules.computed
|
||||||
|
&& !data.php.magentoRules.computed
|
||||||
|
&& data.php.joomlaRules.computed;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
@ -200,6 +218,7 @@ THE SOFTWARE.
|
||||||
this.$parent.resetValue('php', 'wordPressRules');
|
this.$parent.resetValue('php', 'wordPressRules');
|
||||||
this.$parent.resetValue('php', 'drupalRules');
|
this.$parent.resetValue('php', 'drupalRules');
|
||||||
this.$parent.resetValue('php', 'magentoRules');
|
this.$parent.resetValue('php', 'magentoRules');
|
||||||
|
this.$parent.resetValue('php', 'joomlaRules');
|
||||||
this.$parent.resetValue('python', 'python');
|
this.$parent.resetValue('python', 'python');
|
||||||
this.$parent.resetValue('python', 'djangoRules');
|
this.$parent.resetValue('python', 'djangoRules');
|
||||||
this.$parent.resetValue('reverseProxy', 'reverseProxy');
|
this.$parent.resetValue('reverseProxy', 'reverseProxy');
|
||||||
|
@ -248,6 +267,10 @@ THE SOFTWARE.
|
||||||
case 'magento':
|
case 'magento':
|
||||||
this.$parent.setValue('php', 'magentoRules', true);
|
this.$parent.setValue('php', 'magentoRules', true);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'joomla':
|
||||||
|
this.$parent.setValue('php', 'joomlaRules', true);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
toggleCollapse() {
|
toggleCollapse() {
|
||||||
|
|
Loading…
Reference in New Issue