From 0c348f2951301ae9f86c450678a9ad32b1a2b0bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Szekeres=20Ba=CC=81lint?= Date: Sat, 1 Dec 2018 19:47:16 +0100 Subject: [PATCH] vhost symlink option --- public/assets/js/app.js | 9 +++++++++ public/index.html | 17 ++++++++++++++--- public/templates/commands.html | 4 ++-- 3 files changed, 25 insertions(+), 5 deletions(-) diff --git a/public/assets/js/app.js b/public/assets/js/app.js index fba56d9..9c3b847 100644 --- a/public/assets/js/app.js +++ b/public/assets/js/app.js @@ -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; + }; + ////////////////// diff --git a/public/index.html b/public/index.html index d430d3b..5ec8e63 100644 --- a/public/index.html +++ b/public/index.html @@ -712,6 +712,17 @@ +
+ +
+
+ + +
+
+
@@ -757,7 +768,7 @@
-
+
@@ -773,12 +784,12 @@
- /etc/nginx/sites-available/{{ domain() }}.conf + /etc/nginx/sites-{{ isSymlink() ? 'available' : 'enabled' }}/{{ domain() }}.conf Copied! -
+
diff --git a/public/templates/commands.html b/public/templates/commands.html index c275369..4f4a2b3 100644 --- a/public/templates/commands.html +++ b/public/templates/commands.html @@ -1,10 +1,10 @@ -# Virtual host: create symbolic link ln -s /etc/nginx/sites-available/{{ domain() }}.conf /etc/nginx/sites-enabled/{{ domain() }}.conf +✔ symlink || ✔ HTTPS -->