mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-05-20 10:34:30 +00:00
Merge tag 'v20.0' into debian/buster-backports
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
commit
4abd23c66c
@ -20,10 +20,25 @@ Configuration helper for BitTorrent web client.
|
||||
"""
|
||||
|
||||
import argparse
|
||||
import os
|
||||
import shutil
|
||||
import subprocess
|
||||
import time
|
||||
|
||||
SYSTEMD_SERVICE_PATH = '/etc/systemd/system/deluge-web.service'
|
||||
SYSTEMD_SERVICE = '''
|
||||
import augeas
|
||||
from plinth import action_utils
|
||||
|
||||
try:
|
||||
from deluge import config
|
||||
except ImportError:
|
||||
# deluge is not installed or is python2 version
|
||||
config = None
|
||||
|
||||
DELUGED_DEFAULT_FILE = '/etc/default/deluged'
|
||||
DELUGE_CONF_DIR = '/var/lib/deluged/.config/deluge/'
|
||||
|
||||
DELUGE_WEB_SYSTEMD_SERVICE_PATH = '/etc/systemd/system/deluge-web.service'
|
||||
DELUGE_WEB_SYSTEMD_SERVICE = '''
|
||||
#
|
||||
# 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.
|
||||
@ -69,12 +84,83 @@ def parse_arguments():
|
||||
return parser.parse_args()
|
||||
|
||||
|
||||
def _set_configuration(filename, parameter, value):
|
||||
"""Set the configuration parameter."""
|
||||
deluged_is_running = action_utils.service_is_running('deluged')
|
||||
if deluged_is_running:
|
||||
action_utils.service_stop('deluged')
|
||||
deluge_web_is_running = action_utils.service_is_running('deluge-web')
|
||||
if deluge_web_is_running:
|
||||
action_utils.service_stop('deluge-web')
|
||||
|
||||
filepath = os.path.join(DELUGE_CONF_DIR, filename)
|
||||
if config is None:
|
||||
script = 'from deluge import config;\
|
||||
conf = config.Config(filename="{0}");\
|
||||
conf["{1}"] = "{2}";\
|
||||
conf.save()'.format(filepath, parameter, value)
|
||||
subprocess.check_call(['python2', '-c', script])
|
||||
else:
|
||||
conf = config.Config(filename=filepath)
|
||||
conf[parameter] = value
|
||||
conf.save()
|
||||
shutil.chown(filepath, 'debian-deluged', 'debian-deluged')
|
||||
|
||||
if deluged_is_running:
|
||||
action_utils.service_start('deluged')
|
||||
if deluge_web_is_running:
|
||||
action_utils.service_start('deluge-web')
|
||||
|
||||
|
||||
def _get_host_id():
|
||||
"""Get default host id."""
|
||||
if config is None:
|
||||
hosts_conf_file = os.path.join(DELUGE_CONF_DIR, 'hostlist.conf.1.2')
|
||||
script = 'from deluge import config;\
|
||||
conf = config.Config(filename="{0}");\
|
||||
print(conf["hosts"][0][0])'.format(hosts_conf_file)
|
||||
output = subprocess.check_output(['python2', '-c', script]).decode()
|
||||
return output.strip()
|
||||
else:
|
||||
hosts_conf_file = os.path.join(DELUGE_CONF_DIR, 'hostlist.conf')
|
||||
conf = config.Config(filename=hosts_conf_file)
|
||||
return conf["hosts"][0][0]
|
||||
|
||||
|
||||
def _set_deluged_daemon_options():
|
||||
"""Set deluged daemon options."""
|
||||
aug = augeas.Augeas(
|
||||
flags=augeas.Augeas.NO_LOAD + augeas.Augeas.NO_MODL_AUTOLOAD)
|
||||
aug.set('/augeas/load/Shellvars/lens', 'Shellvars.lns')
|
||||
aug.set('/augeas/load/Shellvars/incl[last() + 1]', DELUGED_DEFAULT_FILE)
|
||||
aug.load()
|
||||
aug.set('/files' + DELUGED_DEFAULT_FILE + '/ENABLE_DELUGED', '1')
|
||||
# overwrite daemon args, use default config directory (same as deluge-web)
|
||||
aug.set('/files' + DELUGED_DEFAULT_FILE + '/DAEMON_ARGS',
|
||||
'"-d -l /var/log/deluged/daemon.log -L info"')
|
||||
aug.save()
|
||||
|
||||
|
||||
def subcommand_setup(_):
|
||||
"""Perform initial setup for deluge-web."""
|
||||
with open(SYSTEMD_SERVICE_PATH, 'w') as file_handle:
|
||||
file_handle.write(SYSTEMD_SERVICE)
|
||||
"""Perform initial setup for deluge."""
|
||||
|
||||
with open(DELUGE_WEB_SYSTEMD_SERVICE_PATH, 'w') as file_handle:
|
||||
file_handle.write(DELUGE_WEB_SYSTEMD_SERVICE)
|
||||
|
||||
_set_deluged_daemon_options()
|
||||
|
||||
subprocess.check_call(['systemctl', 'daemon-reload'])
|
||||
# restarting deluge-web service stops also possible deluged process
|
||||
# that was started from the web interface
|
||||
action_utils.service_restart('deluge-web')
|
||||
action_utils.service_restart('deluged')
|
||||
# wait processes to start
|
||||
time.sleep(5)
|
||||
|
||||
# configure deluge-web to autoconnect to the default deluged daemon, also
|
||||
# restarts deluged and deluge-web services again to create config files
|
||||
host_id = _get_host_id()
|
||||
_set_configuration('web.conf', 'default_daemon', host_id)
|
||||
|
||||
|
||||
def main():
|
||||
|
||||
@ -59,6 +59,10 @@ def parse_arguments():
|
||||
change_password.add_argument('--password',
|
||||
help='new password for the MediaWiki user')
|
||||
|
||||
default_skin = subparsers.add_parser('set-default-skin',
|
||||
help='Set the default skin')
|
||||
default_skin.add_argument('skin', help='name of the skin')
|
||||
|
||||
subparsers.required = True
|
||||
return parser.parse_args()
|
||||
|
||||
@ -198,6 +202,28 @@ def subcommand_private_mode(arguments):
|
||||
conf_value + '\n')
|
||||
|
||||
|
||||
def subcommand_set_default_skin(arguments):
|
||||
"""Set a default skin"""
|
||||
skin = arguments.skin
|
||||
skin_setting = f'$wgDefaultSkin = "{skin}";\n'
|
||||
|
||||
with open(CONF_FILE, 'r') as conf_file:
|
||||
lines = conf_file.readlines()
|
||||
|
||||
inserted = False
|
||||
for i, line in enumerate(lines):
|
||||
if line.strip().startswith('$wgDefaultSkin'):
|
||||
lines[i] = skin_setting
|
||||
inserted = True
|
||||
break
|
||||
|
||||
if not inserted:
|
||||
lines.append(skin_setting)
|
||||
|
||||
with open(CONF_FILE, 'w') as conf_file:
|
||||
conf_file.writelines(lines)
|
||||
|
||||
|
||||
def main():
|
||||
"""Parse arguments and perform all duties."""
|
||||
arguments = parse_arguments()
|
||||
|
||||
@ -50,7 +50,9 @@ ATTR_FILE = os.path.join(KEYS_DIRECTORY, 'pki', 'index.txt.attr')
|
||||
SERVER_CONFIGURATION = '''
|
||||
port 1194
|
||||
proto udp
|
||||
proto udp6
|
||||
dev tun
|
||||
client-to-client
|
||||
ca /etc/openvpn/freedombox-keys/pki/ca.crt
|
||||
cert /etc/openvpn/freedombox-keys/pki/issued/server.crt
|
||||
key /etc/openvpn/freedombox-keys/pki/private/server.key
|
||||
@ -66,6 +68,7 @@ CLIENT_CONFIGURATION = '''
|
||||
client
|
||||
remote {remote} 1194
|
||||
proto udp
|
||||
proto udp6
|
||||
dev tun
|
||||
nobind
|
||||
remote-cert-tls server
|
||||
@ -208,6 +211,8 @@ def subcommand_upgrade(_):
|
||||
action_utils.service_disable(OLD_SERVICE_NAME)
|
||||
action_utils.service_enable(SERVICE_NAME)
|
||||
|
||||
action_utils.service_try_restart(SERVICE_NAME)
|
||||
|
||||
|
||||
def _write_server_config():
|
||||
"""Write server configuration."""
|
||||
|
||||
@ -27,10 +27,7 @@ import shutil
|
||||
import stat
|
||||
import subprocess
|
||||
|
||||
import augeas
|
||||
from plinth import action_utils
|
||||
from plinth.modules.samba.manifest import SHARES_CONF_BACKUP_FILE
|
||||
|
||||
SHARES_CONF_BACKUP_FILE = '/var/lib/plinth/backups-data/samba-shares-dump.conf'
|
||||
DEFAULT_FILE = '/etc/default/samba'
|
||||
|
||||
CONF_PATH = '/etc/samba/smb-freedombox.conf'
|
||||
@ -264,6 +261,7 @@ def _set_open_share_permissions(directory):
|
||||
|
||||
def _use_config_file(conf_file):
|
||||
"""Set samba configuration file location."""
|
||||
import augeas
|
||||
aug = augeas.Augeas(
|
||||
flags=augeas.Augeas.NO_LOAD + augeas.Augeas.NO_MODL_AUTOLOAD)
|
||||
aug.set('/augeas/load/Shellvars/lens', 'Shellvars.lns')
|
||||
@ -327,6 +325,7 @@ def subcommand_get_users(_):
|
||||
|
||||
def subcommand_setup(_):
|
||||
"""Configure samba, use custom samba config file."""
|
||||
from plinth import action_utils
|
||||
with open(CONF_PATH, 'w') as file_handle:
|
||||
file_handle.write(CONF)
|
||||
_use_config_file(CONF_PATH)
|
||||
|
||||
@ -96,14 +96,15 @@ def _resize_partition(device, requested_partition, free_space):
|
||||
# https://debbugs.gnu.org/cgi/bugreport.cgi?bug=24215
|
||||
fallback_command = [
|
||||
'parted', '--align=optimal', device, '---pretend-input-tty', 'unit',
|
||||
'B', 'resizepart', requested_partition['number'], 'yes',
|
||||
str(free_space['end'])
|
||||
'B', 'resizepart', requested_partition['number']
|
||||
]
|
||||
try:
|
||||
subprocess.run(command, check=True)
|
||||
except subprocess.CalledProcessError:
|
||||
try:
|
||||
subprocess.run(fallback_command, check=True)
|
||||
input_text = 'yes\n' + str(free_space['end'])
|
||||
subprocess.run(fallback_command, check=True,
|
||||
input=input_text.encode())
|
||||
except subprocess.CalledProcessError as exception:
|
||||
print('Error expanding partition:', exception, file=sys.stderr)
|
||||
sys.exit(5)
|
||||
|
||||
60
debian/changelog
vendored
60
debian/changelog
vendored
@ -1,3 +1,63 @@
|
||||
plinth (20.0) unstable; urgency=medium
|
||||
|
||||
[ Veiko Aasa ]
|
||||
* users: Fix test fixture that disables console login restrictions
|
||||
* gitweb: Add tests for views
|
||||
* samba: Improve actions script startup time
|
||||
* deluge: Manage starting/stoping deluged
|
||||
* deluge: Fix set default daemon
|
||||
|
||||
[ Nektarios Katakis ]
|
||||
* openvpn: Enable support for communication among all clients
|
||||
* Translated using Weblate (Greek)
|
||||
* Translated using Weblate (Greek)
|
||||
* Translated using Weblate (Greek)
|
||||
* Translated using Weblate (Greek)
|
||||
|
||||
[ Sunil Mohan Adapa ]
|
||||
* gitweb: Fix flake8 error that is causing pipeline failures
|
||||
* storage: Ignore errors resizing partition during initial setup
|
||||
* storage: Make partition resizing work with parted 3.3
|
||||
* debian: Add powermgmt-base to recommends list
|
||||
* openvpn: Enable IPv6 for server and client outside the tunnel
|
||||
* networks: Refactor creating a network manager client
|
||||
* networks: Remove unused method
|
||||
* networks: Fix crashing when accessing network manager D-Bus API
|
||||
|
||||
[ Michael Breidenbach ]
|
||||
* Translated using Weblate (German)
|
||||
* Translated using Weblate (Swedish)
|
||||
* Translated using Weblate (German)
|
||||
* Translated using Weblate (German)
|
||||
|
||||
[ Doma Gergő ]
|
||||
* Translated using Weblate (Hungarian)
|
||||
|
||||
[ Joseph Nuthalapati ]
|
||||
* mediawiki: Use a mobile-friendly skin by default
|
||||
* mediawiki: Allow admin to set default skin
|
||||
* mediawiki: Fix functional tests depending on skin
|
||||
|
||||
[ James Valleroy ]
|
||||
* Translated using Weblate (Greek)
|
||||
* Translated using Weblate (Greek)
|
||||
* openvpn: Add diagnostic for ipv6 port
|
||||
* matrixsynapse: Allow upgrade to 1.8.*
|
||||
* security: Add explanation of sandboxing
|
||||
* locale: Update translation strings
|
||||
* doc: Fetch latest manual
|
||||
|
||||
[ Allan Nordhøy ]
|
||||
* Translated using Weblate (Norwegian Bokmål)
|
||||
|
||||
[ Thomas Vincent ]
|
||||
* Translated using Weblate (French)
|
||||
|
||||
[ Ralf Barkow ]
|
||||
* Translated using Weblate (German)
|
||||
|
||||
-- James Valleroy <jvalleroy@mailbox.org> Mon, 13 Jan 2020 19:11:44 -0500
|
||||
|
||||
plinth (19.24~bpo10+1) buster-backports; urgency=medium
|
||||
|
||||
* Rebuild for buster-backports.
|
||||
|
||||
2
debian/control
vendored
2
debian/control
vendored
@ -145,6 +145,8 @@ Recommends:
|
||||
openssh-client,
|
||||
# Priority: standard
|
||||
pciutils,
|
||||
# Used by unattended-upgrades to check if running on AC power
|
||||
powermgmt-base,
|
||||
# fuser, pstree and other utilities
|
||||
psmisc,
|
||||
# Optional FreedomBox dependency
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1824,7 +1824,7 @@ echo 'select name from users' | sqlite3 /var/lib/matrix-synapse/homeserver.db ]
|
||||
</itemizedlist>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>If you wish to create a community in Matrix Synapse, a Matrix user with server admin privileges is needed. Run the following commands: </para>
|
||||
<para>If you wish to create a community in Matrix Synapse, a Matrix user with server admin privileges is needed. In order to grant such privileges to <code>username</code> run the following commands as root user: </para>
|
||||
<itemizedlist>
|
||||
<listitem override="none">
|
||||
<screen><![CDATA[sudo apt install sqlite3
|
||||
@ -10036,6 +10036,50 @@ wget https://www.thinkpenguin.com/files/ath9k_firmware_free-version/htc_7010.fw]
|
||||
<section>
|
||||
<title>Release Notes</title>
|
||||
<para>The following are the release notes for each FreedomBox version. </para>
|
||||
<section>
|
||||
<title>FreedomBox 20.0 (2020-01-13)</title>
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>samba: Improve speed of actions </para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>deluge: Manage deluged service and connect automatically from web interface </para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>openvpn: Enable support for communication among all clients </para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>storage: Ignore errors resizing partition during initial setup </para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>storage: Make partition resizing work with parted 3.3 </para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>debian: Add powermgmt-base as recommended package </para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>openvpn: Enable IPv6 for server and client outside the tunnel </para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>networks: Fix crashing when accessing network manager D-Bus API </para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>mediawiki: Use a mobile-friendly skin by default </para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>mediawiki: Allow admin to set default skin </para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>matrixsynapse: Allow upgrade to 1.8.* </para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>security: Add explanation of sandboxing </para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>Update translations for Greek, German, Swedish, Hungarian, Norwegian Bokmål, and French </para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</section>
|
||||
<section>
|
||||
<title>FreedomBox 19.24 (2019-12-30)</title>
|
||||
<itemizedlist>
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 35 KiB After Width: | Height: | Size: 34 KiB |
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user