chore: use new flag names to allow backward compatability
parent
550e36d461
commit
7cd2d1804b
|
@ -33,13 +33,13 @@ export default (domains, global) => {
|
|||
config['location = /favicon.ico'] = {
|
||||
log_not_found: 'off',
|
||||
};
|
||||
if (global.logging.accessLog.computed) config['location = /favicon.ico'].access_log = 'off';
|
||||
if (global.logging.accessLogEnabled.computed) config['location = /favicon.ico'].access_log = 'off';
|
||||
|
||||
config['# robots.txt'] = '';
|
||||
config['location = /robots.txt'] = {
|
||||
log_not_found: 'off',
|
||||
};
|
||||
if (global.logging.accessLog.computed) config['location = /robots.txt'].access_log = 'off';
|
||||
if (global.logging.accessLogEnabled.computed) config['location = /robots.txt'].access_log = 'off';
|
||||
|
||||
if (global.performance.disableHtmlCaching.computed) {
|
||||
// Disable HTML caching for changes take effect in time
|
||||
|
@ -48,7 +48,7 @@ export default (domains, global) => {
|
|||
config[loc] = {
|
||||
add_header: 'Cache-Control "no-cache"',
|
||||
};
|
||||
if (global.logging.accessLog.computed) config[loc].access_log = 'off';
|
||||
if (global.logging.accessLogEnabled.computed) config[loc].access_log = 'off';
|
||||
}
|
||||
|
||||
|
||||
|
@ -61,7 +61,7 @@ export default (domains, global) => {
|
|||
config[loc] = {
|
||||
expires: global.performance.assetsExpiration.computed,
|
||||
};
|
||||
if (global.logging.accessLog.computed) config[loc].access_log = 'off';
|
||||
if (global.logging.accessLogEnabled.computed) config[loc].access_log = 'off';
|
||||
}
|
||||
} else {
|
||||
// Assets & media separately
|
||||
|
@ -71,7 +71,7 @@ export default (domains, global) => {
|
|||
config[loc] = {
|
||||
expires: global.performance.assetsExpiration.computed,
|
||||
};
|
||||
if (global.logging.accessLog.computed) config[loc].access_log = 'off';
|
||||
if (global.logging.accessLogEnabled.computed) config[loc].access_log = 'off';
|
||||
}
|
||||
|
||||
if (global.performance.mediaExpiration.computed) {
|
||||
|
@ -80,7 +80,7 @@ export default (domains, global) => {
|
|||
config[loc] = {
|
||||
expires: global.performance.mediaExpiration.computed,
|
||||
};
|
||||
if (global.logging.accessLog.computed) config[loc].access_log = 'off';
|
||||
if (global.logging.accessLogEnabled.computed) config[loc].access_log = 'off';
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -93,7 +93,7 @@ export default (domains, global) => {
|
|||
add_header: 'Access-Control-Allow-Origin "*"',
|
||||
expires: global.performance.svgExpiration.computed,
|
||||
};
|
||||
if (global.logging.accessLog.computed) config[loc].access_log = 'off';
|
||||
if (global.logging.accessLogEnabled.computed) config[loc].access_log = 'off';
|
||||
}
|
||||
} else {
|
||||
// SVG & fonts separately
|
||||
|
@ -104,7 +104,7 @@ export default (domains, global) => {
|
|||
add_header: 'Access-Control-Allow-Origin "*"',
|
||||
expires: global.performance.svgExpiration.computed,
|
||||
};
|
||||
if (global.logging.accessLog.computed) config[loc].access_log = 'off';
|
||||
if (global.logging.accessLogEnabled.computed) config[loc].access_log = 'off';
|
||||
}
|
||||
|
||||
if (global.performance.fontsExpiration.computed) {
|
||||
|
@ -114,7 +114,7 @@ export default (domains, global) => {
|
|||
add_header: 'Access-Control-Allow-Origin "*"',
|
||||
expires: global.performance.fontsExpiration.computed,
|
||||
};
|
||||
if (global.logging.accessLog.computed) config[loc].access_log = 'off';
|
||||
if (global.logging.accessLogEnabled.computed) config[loc].access_log = 'off';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -107,7 +107,7 @@ export default (domains, global) => {
|
|||
}
|
||||
|
||||
config.http.push(['# Logging', '']);
|
||||
if (global.logging.accessLog.computed) {
|
||||
if (global.logging.accessLogEnabled.computed) {
|
||||
config.http.push(['access_log', global.logging.accessLogPath.computed.trim() +
|
||||
(global.logging.cloudflare.computed ? ' cloudflare' : '') +
|
||||
(global.logging.accessLogParameters.computed ? ` ${global.logging.accessLogParameters.computed.trim()}` : ''),
|
||||
|
@ -115,7 +115,7 @@ export default (domains, global) => {
|
|||
} else {
|
||||
config.http.push(['access_log', 'off']);
|
||||
}
|
||||
if (global.logging.errorLog.computed) {
|
||||
if (global.logging.errorLogEnabled.computed) {
|
||||
config.http.push(['error_log', global.logging.errorLogPath.computed.trim() +
|
||||
` ${global.logging.errorLogLevel.computed}`]);
|
||||
} else {
|
||||
|
|
|
@ -221,13 +221,13 @@ export default (domain, domains, global, ipPortPairs) => {
|
|||
}
|
||||
|
||||
// Access log or error log for domain
|
||||
if (domain.logging.accessLog.computed || domain.logging.errorLog.computed) {
|
||||
if (domain.logging.accessLogEnabled.computed || domain.logging.errorLogEnabled.computed) {
|
||||
serverConfig.push(['# logging', '']);
|
||||
|
||||
if (domain.logging.accessLog.computed)
|
||||
if (domain.logging.accessLogEnabled.computed)
|
||||
serverConfig.push(['access_log', getDomainAccessLog(domain, global)]);
|
||||
|
||||
if (domain.logging.errorLog.computed)
|
||||
if (domain.logging.errorLogEnabled.computed)
|
||||
serverConfig.push(['error_log', getDomainErrorLog(domain)]);
|
||||
}
|
||||
|
||||
|
|
|
@ -32,14 +32,14 @@ THE SOFTWARE.
|
|||
</div>
|
||||
<div class="field-body">
|
||||
<div class="field">
|
||||
<div :class="`control${accessLogChanged ? ' is-changed' : ''}`">
|
||||
<div :class="`control${accessLogEnabledChanged ? ' is-changed' : ''}`">
|
||||
<div class="checkbox">
|
||||
<PrettyCheck v-model="accessLog" class="p-default p-curve p-fill p-icon">
|
||||
<PrettyCheck v-model="accessLogEnabled" class="p-default p-curve p-fill p-icon">
|
||||
{{ $t('templates.domainSections.logging.enableForThisDomain') }}
|
||||
</PrettyCheck>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="$props.data.accessLog.computed" :class="`control field is-horizontal is-expanded${accessLogPathChanged ? ' is-changed' : ''}`">
|
||||
<div v-if="$props.data.accessLogEnabled.computed" :class="`control field is-horizontal is-expanded${accessLogPathChanged ? ' is-changed' : ''}`">
|
||||
<input
|
||||
v-model="accessLogPath"
|
||||
class="input"
|
||||
|
@ -51,7 +51,7 @@ THE SOFTWARE.
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="$props.data.accessLog.computed" class="field is-horizontal">
|
||||
<div v-if="$props.data.accessLogEnabled.computed" class="field is-horizontal">
|
||||
<div class="field-label">
|
||||
<label class="label">access_log {{ $t('templates.domainSections.logging.arguments') }}</label>
|
||||
</div>
|
||||
|
@ -75,13 +75,13 @@ THE SOFTWARE.
|
|||
</div>
|
||||
<div class="field-body">
|
||||
<div class="field">
|
||||
<div :class="`control${errorLogChanged ? ' is-changed' : ''}`">
|
||||
<div :class="`control${errorLogEnabledChanged ? ' is-changed' : ''}`">
|
||||
<div class="checkbox">
|
||||
<PrettyCheck v-model="errorLog" class="p-default p-curve p-fill p-icon">
|
||||
<PrettyCheck v-model="errorLogEnabled" class="p-default p-curve p-fill p-icon">
|
||||
{{ $t('templates.domainSections.logging.enableForThisDomain') }}
|
||||
</PrettyCheck>
|
||||
</div>
|
||||
<div v-if="$props.data.errorLog.computed" :class="`control field is-horizontal is-expanded${errorLogPathChanged ? ' is-changed' : ''}`">
|
||||
<div v-if="$props.data.errorLogEnabled.computed" :class="`control field is-horizontal is-expanded${errorLogPathChanged ? ' is-changed' : ''}`">
|
||||
<input
|
||||
v-model="errorLogPath"
|
||||
class="input"
|
||||
|
@ -94,7 +94,7 @@ THE SOFTWARE.
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="$props.data.errorLog.computed" class="field is-horizontal">
|
||||
<div v-if="$props.data.errorLogEnabled.computed" class="field is-horizontal">
|
||||
<div class="field-label">
|
||||
<label class="label">error_log {{ $t('templates.domainSections.logging.level') }}</label>
|
||||
</div>
|
||||
|
@ -124,7 +124,7 @@ THE SOFTWARE.
|
|||
import PrettyRadio from '../inputs/radio';
|
||||
|
||||
const defaults = {
|
||||
accessLog: {
|
||||
accessLogEnabled: {
|
||||
default: true,
|
||||
enabled: true,
|
||||
},
|
||||
|
@ -136,7 +136,7 @@ THE SOFTWARE.
|
|||
default: accessLogParamsDefault,
|
||||
enabled: true,
|
||||
},
|
||||
errorLog: {
|
||||
errorLogEnabled: {
|
||||
default: true,
|
||||
enabled: true,
|
||||
},
|
||||
|
|
|
@ -32,14 +32,14 @@ THE SOFTWARE.
|
|||
</div>
|
||||
<div class="field-body">
|
||||
<div class="field">
|
||||
<div :class="`control${accessLogChanged ? ' is-changed' : ''}`">
|
||||
<div :class="`control${accessLogEnabledChanged ? ' is-changed' : ''}`">
|
||||
<div class="checkbox">
|
||||
<PrettyCheck v-model="accessLog" class="p-default p-curve p-fill p-icon">
|
||||
<PrettyCheck v-model="accessLogEnabled" class="p-default p-curve p-fill p-icon">
|
||||
{{ $t('common.enable') }}
|
||||
</PrettyCheck>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="$props.data.accessLog.computed" :class="`control field is-horizontal is-expanded${accessLogPathChanged ? ' is-changed' : ''}`">
|
||||
<div v-if="$props.data.accessLogEnabled.computed" :class="`control field is-horizontal is-expanded${accessLogPathChanged ? ' is-changed' : ''}`">
|
||||
<input
|
||||
v-model="accessLogPath"
|
||||
class="input"
|
||||
|
@ -51,7 +51,7 @@ THE SOFTWARE.
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="$props.data.accessLog.computed" class="field is-horizontal">
|
||||
<div v-if="$props.data.accessLogEnabled.computed" class="field is-horizontal">
|
||||
<div class="field-label">
|
||||
<label class="label">access_log {{ $t('templates.globalSections.logging.arguments') }}</label>
|
||||
</div>
|
||||
|
@ -75,14 +75,14 @@ THE SOFTWARE.
|
|||
</div>
|
||||
<div class="field-body">
|
||||
<div class="field">
|
||||
<div :class="`control${errorLogChanged ? ' is-changed' : ''}`">
|
||||
<div :class="`control${errorLogEnabledChanged ? ' is-changed' : ''}`">
|
||||
<div class="checkbox">
|
||||
<PrettyCheck v-model="errorLog" class="p-default p-curve p-fill p-icon">
|
||||
<PrettyCheck v-model="errorLogEnabled" class="p-default p-curve p-fill p-icon">
|
||||
{{ $t('common.enable') }}
|
||||
</PrettyCheck>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="$props.data.errorLog.computed" :class="`control field is-horizontal is-expanded${errorLogPathChanged ? ' is-changed' : ''}`">
|
||||
<div v-if="$props.data.errorLogEnabled.computed" :class="`control field is-horizontal is-expanded${errorLogPathChanged ? ' is-changed' : ''}`">
|
||||
<input
|
||||
v-model="errorLogPath"
|
||||
class="input"
|
||||
|
@ -94,7 +94,7 @@ THE SOFTWARE.
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="$props.data.errorLog.computed" class="field is-horizontal">
|
||||
<div v-if="$props.data.errorLogEnabled.computed" class="field is-horizontal">
|
||||
<div class="field-label">
|
||||
<label class="label">error_log {{ $t('templates.globalSections.logging.level') }}</label>
|
||||
</div>
|
||||
|
@ -214,7 +214,7 @@ THE SOFTWARE.
|
|||
import PrettyRadio from '../inputs/radio';
|
||||
|
||||
const defaults = {
|
||||
accessLog: {
|
||||
accessLogEnabled: {
|
||||
default: false,
|
||||
enabled: true,
|
||||
},
|
||||
|
@ -226,7 +226,7 @@ THE SOFTWARE.
|
|||
default: accessLogParamsDefault,
|
||||
enabled: true,
|
||||
},
|
||||
errorLog: {
|
||||
errorLogEnabled: {
|
||||
default: false,
|
||||
enabled: true,
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue