vhost symlink option
parent
d92020de12
commit
0c348f2951
|
@ -54,6 +54,7 @@
|
|||
drupal: false,
|
||||
|
||||
file_structure: 'modularized',
|
||||
symlink: true,
|
||||
|
||||
referrer_policy: 'no-referrer-when-downgrade',
|
||||
content_security_policy: 'default-src * data: \'unsafe-eval\' \'unsafe-inline\'',
|
||||
|
@ -311,6 +312,10 @@
|
|||
var name = sourceCode.dataset.filename;
|
||||
var content = sourceCode.children[0].children[0].innerText;
|
||||
|
||||
if (!$scope.isSymlink() && name.match(/^sites-available\//)) {
|
||||
name = name.replace(/^sites-available\//, 'sites-enabled/');
|
||||
}
|
||||
|
||||
zip.file(name, content);
|
||||
|
||||
if (name.match(/^sites-available\//)) {
|
||||
|
@ -573,6 +578,10 @@
|
|||
return $scope.data.proxy;
|
||||
};
|
||||
|
||||
$scope.isSymlink = function() {
|
||||
return $scope.isModularized() && $scope.data.symlink;
|
||||
};
|
||||
|
||||
|
||||
|
||||
//////////////////
|
||||
|
|
|
@ -712,6 +712,17 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row" ng-if="isModularized()">
|
||||
<label class="col-sm-3 col-form-label col-form-label-sm">
|
||||
<span tooltips tooltip-template="Symbolic link from sites-available/{{ domain() }}.conf to sites-enabled/{{ domain() }}.conf">Symlink vhost</span>
|
||||
</label>
|
||||
<div class="col-sm-9">
|
||||
<div class="form-check" ng-class="{ 'input-changed': data.symlink !== defaultData.symlink }">
|
||||
<input class="form-check-input" type="checkbox" id="symlink" ng-model="data.symlink">
|
||||
<label class="form-check-label" for="symlink">enabled</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-3 col-form-label col-form-label-sm">Share settings</label>
|
||||
<div class="col-sm-9">
|
||||
|
@ -757,7 +768,7 @@
|
|||
<div class="container">
|
||||
<div class="row grid">
|
||||
<div class="grid-sizer col-xl-6"></div>
|
||||
<div ng-if="isModularized() || (isHTTPS() && (isCertLetsEncrypt() || !isSSLProfileModern()))" class="grid-item col-xl-10 offset-xl-1" ng-cloak>
|
||||
<div ng-if="isSymlink() || (isHTTPS() && (isCertLetsEncrypt() || !isSSLProfileModern()))" class="grid-item col-xl-10 offset-xl-1" ng-cloak>
|
||||
<div class="commands">
|
||||
<pre><code class="hljs bash" ng-include="'templates/commands.html?v=COMMIT_HASH'"></code></pre>
|
||||
</div>
|
||||
|
@ -773,12 +784,12 @@
|
|||
</div><div id="file-nginx" class="code highlighted"></div>
|
||||
</section>
|
||||
<section class="col-xl-6 grid-item file" ng-if="isModularized()" ng-cloak>
|
||||
<strong>/etc/nginx/sites-available/{{ domain() }}.conf</strong>
|
||||
<strong>/etc/nginx/sites-{{ isSymlink() ? 'available' : 'enabled' }}/{{ domain() }}.conf</strong>
|
||||
<button class="btn btn-light btn-clipboard" ngclipboard data-clipboard-target="#file-domain" ngclipboard-success="clipboardSuccess('example.com')">
|
||||
<img src="assets/img/clipboard-dark.svg" alt="Copy to clipboard">
|
||||
</button>
|
||||
<span class="clipboard-success" ng-if="clipboardCopy === 'example.com'">Copied!</span>
|
||||
<div class="code source" data-filename="sites-available/{{ domain() }}.conf">
|
||||
<div class="code source" data-filename="sites-{{ isSymlink() ? 'available' : 'enabled' }}/{{ domain() }}.conf">
|
||||
<pre><code class="nginx" ng-include="'templates/conf/sites-available/example.com.conf.html?v=COMMIT_HASH?v=COMMIT_HASH'" onload="refreshHighlighting()"></code></pre>
|
||||
</div><div id="file-domain" class="code highlighted"></div>
|
||||
</section>
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
<!-- ✔ modularized --><span ng-if="isModularized()"><!--
|
||||
<!-- ✔ symlink --><span ng-if="isSymlink()"><!--
|
||||
|
||||
--><span class="hljs-comment"># <strong>Virtual host</strong>: create symbolic link</span>
|
||||
<span class="hljs-section">ln</span> <span class="hljs-attribute">-s</span> /etc/nginx/sites-available/{{ domain() }}.conf /etc/nginx/sites-enabled/{{ domain() }}.conf</span><!--
|
||||
|
||||
|
||||
✔ modularized || ✔ HTTPS --><span ng-if="isModularized() && ((isHTTPS() && !isSSLProfileModern()) || isCertLetsEncrypt())">
|
||||
✔ symlink || ✔ HTTPS --><span ng-if="isSymlink() && ((isHTTPS() && !isSSLProfileModern()) || isCertLetsEncrypt())">
|
||||
|
||||
</span><!--
|
||||
|
||||
|
|
Loading…
Reference in New Issue