From 9c717246ee8450a466bc6e482505e87f48afdaf4 Mon Sep 17 00:00:00 2001 From: James Valleroy Date: Sun, 7 Jun 2015 12:56:39 -0400 Subject: [PATCH] deluge: Install apache conf file during Plinth install. --- actions/deluge | 24 ++++--------------- .../apache2/conf-available/deluge-plinth.conf | 6 +++++ 2 files changed, 10 insertions(+), 20 deletions(-) create mode 100644 data/etc/apache2/conf-available/deluge-plinth.conf diff --git a/actions/deluge b/actions/deluge index 9cf391291..46dc4b248 100755 --- a/actions/deluge +++ b/actions/deluge @@ -26,19 +26,7 @@ import os import subprocess -APACHE_CONF_PATH = '/etc/apache2/conf-available/deluge-web.conf' -APACHE_CONF_ENABLED_PATH = '/etc/apache2/conf-enabled/deluge-web.conf' -APACHE_CONF = ''' -## -## On all sites, provide Deluge on a default path: /deluge -## -## This file is managed and overwritten by Plinth. If you wish to edit -## it, disable Deluge in Plinth, remove this file and manage it manually. -## - - ProxyPass http://localhost:8112 - -''' +APACHE_CONF_ENABLED_PATH = '/etc/apache2/conf-enabled/deluge-plinth.conf' SYSTEMD_SERVICE_PATH = '/etc/systemd/system/deluge-web.service' SYSTEMD_SERVICE = ''' @@ -98,13 +86,13 @@ def subcommand_enable(_): setup() start() - subprocess.check_call(['a2enconf', 'deluge-web']) + subprocess.check_call(['a2enconf', 'deluge-plinth']) subprocess.check_call(['service', 'apache2', 'reload']) def subcommand_disable(_): """Disable deluge-web site and stop deluge-web.""" - subprocess.check_call(['a2disconf', 'deluge-web']) + subprocess.check_call(['a2disconf', 'deluge-plinth']) subprocess.check_call(['service', 'apache2', 'reload']) stop() @@ -140,11 +128,7 @@ def stop(): def setup(): - """Perform initial setup for deluge-web site.""" - if not os.path.isfile(APACHE_CONF_PATH): - with open(APACHE_CONF_PATH, 'w') as conffile: - conffile.write(APACHE_CONF) - + """Perform initial setup for deluge-web.""" if not os.path.isfile(SYSTEMD_SERVICE_PATH): with open(SYSTEMD_SERVICE_PATH, 'w') as file_handle: file_handle.write(SYSTEMD_SERVICE) diff --git a/data/etc/apache2/conf-available/deluge-plinth.conf b/data/etc/apache2/conf-available/deluge-plinth.conf new file mode 100644 index 000000000..76c92049e --- /dev/null +++ b/data/etc/apache2/conf-available/deluge-plinth.conf @@ -0,0 +1,6 @@ +## +## On all sites, provide Deluge on a default path: /deluge +## + + ProxyPass http://localhost:8112 +