mirror of
https://github.com/digitalocean/nginxconfig.io
synced 2024-11-10 12:34:12 +00:00
Provide an option for LE cert dir (fixes #156)
This commit is contained in:
parent
0f4c53b5ac
commit
97ccb98ef8
4 changed files with 25 additions and 3 deletions
|
@ -48,7 +48,7 @@ const sslConfig = (domain, global) => {
|
|||
// Let's encrypt
|
||||
if (domain.https.certType.computed === 'letsEncrypt')
|
||||
config.push(['ssl_trusted_certificate',
|
||||
`/etc/letsencrypt/live/${domain.server.domain.computed}/chain.pem`]);
|
||||
`${global.https.letsEncryptCertRoot.computed.replace(/\/+$/, '')}/${domain.server.domain.computed}/chain.pem`]);
|
||||
}
|
||||
return config;
|
||||
};
|
||||
|
|
|
@ -40,6 +40,7 @@ export default {
|
|||
quad9: 'Quad9',
|
||||
verisign: 'Verisign',
|
||||
letsEncryptWebroot: `${common.letsEncrypt} webroot`,
|
||||
letsEncryptCertRoot: `${common.letsEncrypt} certificate directory`,
|
||||
mozillaModern: `${mozilla} Modern`,
|
||||
mozillaIntermediate: `${mozilla} Intermediate`,
|
||||
mozillaOld: `${mozilla} Old`,
|
||||
|
|
|
@ -194,6 +194,23 @@ THE SOFTWARE.
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="letsEncryptCertRootEnabled" class="field is-horizontal">
|
||||
<div class="field-label">
|
||||
<label class="label">{{ i18n.templates.globalSections.https.letsEncryptCertRoot }}</label>
|
||||
</div>
|
||||
<div class="field-body">
|
||||
<div class="field">
|
||||
<div :class="`control${letsEncryptCertRootChanged ? ' is-changed' : ''}`">
|
||||
<input v-model="letsEncryptCertRoot"
|
||||
class="input"
|
||||
type="text"
|
||||
:placeholder="$props.data.letsEncryptCertRoot.default"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
|
@ -261,6 +278,10 @@ THE SOFTWARE.
|
|||
default: '/var/www/_letsencrypt/',
|
||||
enabled: true,
|
||||
},
|
||||
letsEncryptCertRoot: {
|
||||
default: '/etc/letsencrypt/live/',
|
||||
enabled: true,
|
||||
},
|
||||
};
|
||||
|
||||
export default {
|
||||
|
|
|
@ -26,7 +26,7 @@ THE SOFTWARE.
|
|||
|
||||
export const getSslCertificate = (domain, global) => {
|
||||
if (domain.https.certType.computed === 'letsEncrypt')
|
||||
`/etc/letsencrypt/live/${domain.server.domain.computed}/fullchain.pem`;
|
||||
return `${global.https.letsEncryptCertRoot.computed.replace(/\/+$/, '')}/${domain.server.domain.computed}/fullchain.pem`;
|
||||
|
||||
if (domain.https.sslCertificate.computed)
|
||||
return domain.https.sslCertificate.computed;
|
||||
|
@ -36,7 +36,7 @@ export const getSslCertificate = (domain, global) => {
|
|||
|
||||
export const getSslCertificateKey = (domain, global) => {
|
||||
if (domain.https.certType.computed === 'letsEncrypt')
|
||||
`/etc/letsencrypt/live/${domain.server.domain.computed}/privkey.pem`;
|
||||
return `${global.https.letsEncryptCertRoot.computed.replace(/\/+$/, '')}/${domain.server.domain.computed}/privkey.pem`;
|
||||
|
||||
if (domain.https.sslCertificateKey.computed)
|
||||
return domain.https.sslCertificateKey.computed;
|
||||
|
|
Loading…
Reference in a new issue