mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-05-20 10:34:30 +00:00
deluge: Install apache conf file during Plinth install.
This commit is contained in:
parent
9d6ceaa0ff
commit
9c717246ee
@ -26,19 +26,7 @@ import os
|
|||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
|
|
||||||
APACHE_CONF_PATH = '/etc/apache2/conf-available/deluge-web.conf'
|
APACHE_CONF_ENABLED_PATH = '/etc/apache2/conf-enabled/deluge-plinth.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.
|
|
||||||
##
|
|
||||||
<Location /deluge>
|
|
||||||
ProxyPass http://localhost:8112
|
|
||||||
</Location>
|
|
||||||
'''
|
|
||||||
|
|
||||||
SYSTEMD_SERVICE_PATH = '/etc/systemd/system/deluge-web.service'
|
SYSTEMD_SERVICE_PATH = '/etc/systemd/system/deluge-web.service'
|
||||||
SYSTEMD_SERVICE = '''
|
SYSTEMD_SERVICE = '''
|
||||||
@ -98,13 +86,13 @@ def subcommand_enable(_):
|
|||||||
setup()
|
setup()
|
||||||
|
|
||||||
start()
|
start()
|
||||||
subprocess.check_call(['a2enconf', 'deluge-web'])
|
subprocess.check_call(['a2enconf', 'deluge-plinth'])
|
||||||
subprocess.check_call(['service', 'apache2', 'reload'])
|
subprocess.check_call(['service', 'apache2', 'reload'])
|
||||||
|
|
||||||
|
|
||||||
def subcommand_disable(_):
|
def subcommand_disable(_):
|
||||||
"""Disable deluge-web site and stop deluge-web."""
|
"""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'])
|
subprocess.check_call(['service', 'apache2', 'reload'])
|
||||||
stop()
|
stop()
|
||||||
|
|
||||||
@ -140,11 +128,7 @@ def stop():
|
|||||||
|
|
||||||
|
|
||||||
def setup():
|
def setup():
|
||||||
"""Perform initial setup for deluge-web site."""
|
"""Perform initial setup for deluge-web."""
|
||||||
if not os.path.isfile(APACHE_CONF_PATH):
|
|
||||||
with open(APACHE_CONF_PATH, 'w') as conffile:
|
|
||||||
conffile.write(APACHE_CONF)
|
|
||||||
|
|
||||||
if not os.path.isfile(SYSTEMD_SERVICE_PATH):
|
if not os.path.isfile(SYSTEMD_SERVICE_PATH):
|
||||||
with open(SYSTEMD_SERVICE_PATH, 'w') as file_handle:
|
with open(SYSTEMD_SERVICE_PATH, 'w') as file_handle:
|
||||||
file_handle.write(SYSTEMD_SERVICE)
|
file_handle.write(SYSTEMD_SERVICE)
|
||||||
|
|||||||
6
data/etc/apache2/conf-available/deluge-plinth.conf
Normal file
6
data/etc/apache2/conf-available/deluge-plinth.conf
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
##
|
||||||
|
## On all sites, provide Deluge on a default path: /deluge
|
||||||
|
##
|
||||||
|
<Location /deluge>
|
||||||
|
ProxyPass http://localhost:8112
|
||||||
|
</Location>
|
||||||
Loading…
x
Reference in New Issue
Block a user