Release v20.3 to unstable

-----BEGIN PGP SIGNATURE-----
 
 iQJKBAABCgA0FiEEfWrbdQ+RCFWJSEvmd8DHXntlCAgFAl5UeIoWHGp2YWxsZXJv
 eUBtYWlsYm94Lm9yZwAKCRB3wMdee2UICG+wD/4lWl8fkzNVrcDafEUa+3+ZD4zj
 ejY6rNIuTJS8yV3SZmHcq4zrIv3RI5xskhgTTPPM8tUsohujsmMw5yeLuk+GM6XU
 2qkJaY+F3z7LaT470Gm8Bi7cyxaKEAPt7MH2ot/8Z6yeCqtr7dSqKk6cp/elzKtc
 K6hx8IEvV4rSKIQyPRJZhwFawzY+EKU2vs32G7sBzWzUfEXGRFNt0OwWqFejq0yL
 4KBZ2ar0KNBjBg4DfikBLVMgOfAzM9aNSkA25RAu5F2ixLHI/lkXCJRb3oalHNpk
 Lq0eeGMgJ7bGNW1Qkf/ZnjnHr7YPOGWf9l1xNlLnsSGOzhnO36aI7FnpoxSV9SnN
 f3NDm+ncFZFE1I/62tXYa+HC5CLYTVf4bhYr+QshS4eM+IiyEWG/q0mhpuU9sFcb
 aQQXa3rFQL2MDqtqDAFlIF398s6DRyCQzO4x7lYVQiAZGcYbtRwiBggQ8sbXfmFM
 bHI4wN7Mr6+GTK9mXCjPcZBbLWpGxzG2dIThlYIE4E5Dnw2JN7lh6FKsJ9CBFYPm
 rBucNB+Zq8csxXhxVyzgZ3fwUInapi+hatPD6w8XAATbUhPxmuvEy3dXSIq2bevJ
 Kz5xVZHgz5SCxXrIj/PMl58YJ0g8jmqQNbaAK7jGfnOQ6okvC81tw6UwcNPn+3bp
 MEYvi87qu9nGG8U7XA==
 =fxs8
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQJKBAABCgA0FiEEfWrbdQ+RCFWJSEvmd8DHXntlCAgFAl5YUn4WHGp2YWxsZXJv
 eUBtYWlsYm94Lm9yZwAKCRB3wMdee2UICM+VD/0VIbV59v3vpj9DmgQT8TXdw1YG
 hzU65bdd47++Ovz7ujzix+SFNboZkbe+s1N/F9gVqnu3foEW3uV9bz6UBLiOE+vh
 ktyWYRiRY5f+Cc2iTLoYk43rv6qrx9jAQUCLo+f6bD2hqkTBDxmEJXfrWt0JCF/Y
 ovjL6G11r1SSMr4rhM1KRhAv6kPWIoxFr3xBRPGlfxfbgvVKP67myictbuOebY86
 BqL56ktr4/RV+Zvv+pAoKCYr6uWRkI//o+rfqAq/9pYAULkL+IEFeAP+YPze/idk
 b7xaUjI5Ul3hHARttety8C6VmVjMwIe2QsoaZrKGSE93zmZxb9QerW6xzK8UBoAA
 5v306hn1WZFc1wJawBr2FrLq8jhKfgOahVc81B3ufJwxo+tExHGmk4/iKAqGU3Ht
 yymYPGCTjtNBCoiFS6OFWUJ4d0LLA+4LVTOxQ+R12vOJMX5zOYZ+4I5U4SmLUdU2
 kVrN7+CUra2cgTdwLmbRelB2Ls1c6HAH0Kx4MeVtb6stcJJ6/YFB70mfW8CbhUqi
 JFjI4/hr/g0qnh/43REsbXvNVrOkSWqDOHqcGQ1RDmkbqZzJTOWFM8SO4cLsAkm6
 Dy0W/edrq3YTlQTDEExEoC5mRcUsmNZLgGoZskisRGj3yquQmwJ65HwAcCxFCNVP
 73vHEqfnWyvL7EzpWg==
 =ZTly
 -----END PGP SIGNATURE-----

Merge tag 'v20.3' into debian/buster-backports

Release v20.3 to unstable

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
James Valleroy 2020-02-27 18:36:24 -05:00
commit 1949b162ba
786 changed files with 63103 additions and 67096 deletions

10
.gitignore vendored
View File

@ -1,8 +1,8 @@
*.pyc
*.py.bak
*.swp
*.tiny.css
data/var/log/plinth/*.log
data/var/lib/plinth/django-secret.key
data/var/lib/plinth/*.sqlite3
data/var/lib/plinth/sessions/*
data/var/lib/plinth/.ssh/
@ -18,7 +18,6 @@ doc/dev/_build
*~
predepend
build/
.emacs.desktop*
*.egg-info/
dist/
.coverage
@ -29,7 +28,6 @@ functional_tests/test_plinth/
geckodriver.log
*.mo
.vagrant/
.idea/
.DS_Store
*.box
.eggs
@ -48,3 +46,9 @@ debian/plinth.debhelper.log
debian/plinth.substvars
debian/plinth/
*.pytest_cache/
# Editor settings
.vscode/
.idea/
*.swp
.emacs.desktop*

17
Vagrantfile vendored
View File

@ -1,21 +1,6 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :
#
# This file is part of FreedomBox.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# SPDX-License-Identifier: AGPL-3.0-or-later
require 'etc'

View File

@ -1,21 +1,6 @@
#!/usr/bin/python3
# -*- mode: python -*-
#
# This file is part of FreedomBox.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# SPDX-License-Identifier: AGPL-3.0-or-later
"""
Configuration helper for Apache web server.
"""

View File

@ -1,20 +1,5 @@
#!/usr/bin/python3
#
# This file is part of FreedomBox.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# SPDX-License-Identifier: AGPL-3.0-or-later
"""
Module with utilities to generate a auth_pubtkt ticket and
sign it with the FreedomBox server's private key.

View File

@ -1,21 +1,6 @@
#!/usr/bin/python3
# -*- mode: python -*-
#
# This file is part of FreedomBox.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# SPDX-License-Identifier: AGPL-3.0-or-later
"""
Wrapper to handle backups using borg-backups.
"""

View File

@ -1,28 +1,14 @@
#!/usr/bin/python3
#
# This file is part of FreedomBox.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# SPDX-License-Identifier: AGPL-3.0-or-later
"""
Configuration helper for BIND server.
"""
import argparse
from pathlib import Path
from plinth import action_utils
from plinth.modules.bind import CONFIG_FILE, DEFAULT_CONFIG
from plinth.modules.bind import CONFIG_FILE, DEFAULT_CONFIG, ZONES_DIR
from plinth.modules.bind import set_forwarders, set_dnssec
@ -30,7 +16,10 @@ def parse_arguments():
"""Return parsed command line arguments as dictionary"""
parser = argparse.ArgumentParser()
subparsers = parser.add_subparsers(dest='subcommand', help='Sub command')
subparsers.add_parser('setup', help='Setup for BIND')
setup = subparsers.add_parser('setup', help='Setup for BIND')
setup.add_argument(
'--old-version', type=int, required=True,
help='Earlier version of the app that is already setup.')
configure = subparsers.add_parser('configure', help='Configure BIND')
configure.add_argument('--forwarders',
@ -42,11 +31,14 @@ def parse_arguments():
return parser.parse_args()
def subcommand_setup(_):
def subcommand_setup(arguments):
"""Setup BIND configuration."""
conf_file = open(CONFIG_FILE, "w")
if arguments.old_version == 0:
with open(CONFIG_FILE, "w") as conf_file:
conf_file.write(DEFAULT_CONFIG)
conf_file.close()
Path(ZONES_DIR).mkdir(exist_ok=True, parents=True)
action_utils.service_restart('bind9')

View File

@ -1,20 +1,5 @@
#!/usr/bin/python3
#
# This file is part of FreedomBox.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# SPDX-License-Identifier: AGPL-3.0-or-later
"""
Configuration helper for Cockpit.
"""

View File

@ -1,21 +1,6 @@
#!/usr/bin/python3
# -*- mode: python -*-
#
# This file is part of FreedomBox.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# SPDX-License-Identifier: AGPL-3.0-or-later
"""
Configuration helper for FreedomBox general configuration.
"""

View File

@ -1,21 +1,6 @@
#!/usr/bin/python3
# -*- mode: python -*-
#
# This file is part of FreedomBox.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# SPDX-License-Identifier: AGPL-3.0-or-later
"""
Configuration helper for coquelicot.
"""

View File

@ -1,42 +1,22 @@
#!/usr/bin/python3
#
# This file is part of FreedomBox.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# SPDX-License-Identifier: AGPL-3.0-or-later
"""
Configuration helper for BitTorrent web client.
"""
import argparse
import json
import os
import shutil
import pathlib
import subprocess
import time
import augeas
from plinth import action_utils
try:
from deluge import config
except ImportError:
# deluge is not installed or is python2 version
config = None
from plinth import action_utils
from plinth.modules.deluge.utils import Config
DELUGED_DEFAULT_FILE = '/etc/default/deluged'
DELUGE_CONF_DIR = '/var/lib/deluged/.config/deluge/'
DELUGE_CONF_DIR = pathlib.Path('/var/lib/deluged/.config/deluge/')
DELUGE_WEB_SYSTEMD_SERVICE_PATH = '/etc/systemd/system/deluge-web.service'
DELUGE_WEB_SYSTEMD_SERVICE = '''
@ -103,18 +83,8 @@ def _set_configuration(filename, parameter, value):
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')
with Config(DELUGE_CONF_DIR / filename) as config:
config.content[parameter] = value
if deluged_is_running:
action_utils.service_start('deluged')
@ -124,23 +94,18 @@ def _set_configuration(filename, parameter, value):
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]
try:
with Config(DELUGE_CONF_DIR / 'hostlist.conf') as config:
return config.content['hosts'][0][0]
except FileNotFoundError:
with Config(DELUGE_CONF_DIR / 'hostlist.conf.1.2') as config:
return config.content['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 = 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()
@ -153,16 +118,8 @@ def _set_deluged_daemon_options():
def subcommand_get_configuration(_):
"""Return the current deluged configuration in JSON format."""
deluged_conf_file = os.path.join(DELUGE_CONF_DIR, 'core.conf')
if config is None:
script = 'from deluge import config;\
conf = config.Config(filename="{0}");\
print(conf["download_location"])'.format(deluged_conf_file)
output = subprocess.check_output(['python2', '-c', script]).decode()
download_location = output.strip()
else:
conf = config.Config(filename=deluged_conf_file)
download_location = conf["download_location"]
with Config(DELUGE_CONF_DIR / 'core.conf') as config:
download_location = config.content['download_location']
print(json.dumps({'download_location': download_location}))
@ -171,6 +128,7 @@ def subcommand_set_configuration(arguments):
"""Set the deluged configuration."""
if arguments.parameter != 'download_location':
return
_set_configuration('core.conf', arguments.parameter, arguments.value)
@ -183,19 +141,46 @@ def subcommand_setup(_):
_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(10)
# configure deluge-web to autoconnect to the default deluged daemon, also
# restarts deluged and deluge-web services again to create config files
# Restarting an old deluge-web service stops also possible deluged process
# that was started from the web interface.
action_utils.service_try_restart('deluge-web')
# Wait until core configuration is available so that status of the app can
# be shown properly.
_wait_for_configuration('deluged', 'core.conf')
# Configure deluge-web to autoconnect to the default deluged daemon.
_wait_for_configuration('deluge-web', 'web.conf')
host_id = _get_host_id()
_set_configuration('web.conf', 'default_daemon', host_id)
def _wait_for_configuration(service, file_name):
"""Wait until configuration file has been created."""
conf_file = DELUGE_CONF_DIR / file_name
if conf_file.exists():
return
# deluge-web creates files on first run. deluged on the other than differs
# in version. Older version in Debian Buster creates the files after a
# restart while newer versions create the files on first run. The following
# approach is slightly better for create-on-exit case.
is_running = action_utils.service_is_running(service)
for interval in range(7):
action_utils.service_restart(service)
if conf_file.exists():
break
print('Waiting for {service} configuration')
time.sleep(2**interval) # Exponentially increase the time waited
else:
raise Exception(f'Unable to setup {service}.')
if not is_running:
action_utils.service_stop(service)
def main():
"""Parse arguments and perform all duties."""
arguments = parse_arguments()

View File

@ -1,20 +1,5 @@
#!/usr/bin/python3
#
# This file is part of FreedomBox.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# SPDX-License-Identifier: AGPL-3.0-or-later
"""
Configuration helper for diaspora* pod.
"""

View File

@ -1,20 +1,5 @@
#!/bin/sh
#
# This file is part of FreedomBox.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# SPDX-License-Identifier: AGPL-3.0-or-later
domainname="$1"
hostname=$(hostname)

View File

@ -1,20 +1,5 @@
#!/bin/bash
#
# This file is part of FreedomBox.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# SPDX-License-Identifier: AGPL-3.0-or-later
############################################################################
# #

View File

@ -1,20 +1,5 @@
#!/usr/bin/python3
#
# This file is part of FreedomBox.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# SPDX-License-Identifier: AGPL-3.0-or-later
"""
Configuration helper for the ejabberd service
"""

View File

@ -1,20 +1,5 @@
#!/usr/bin/python3
#
# This file is part of FreedomBox.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# SPDX-License-Identifier: AGPL-3.0-or-later
"""
Configuration helper for FreedomBox firewall interface.
"""
@ -39,42 +24,6 @@ def parse_arguments():
subparsers.add_parser('get-status',
help='Get whether firewalld is running')
# Get service status
get_enabled_services = subparsers.add_parser(
'get-enabled-services', help='Get list of enabled services')
get_enabled_services.add_argument(
'--zone', help='Zone from which the list is to be retrieved',
required=True)
# Get service ports
get_service_ports = subparsers.add_parser(
'get-service-ports', help='Get list of ports for service')
get_service_ports.add_argument('--service', help='Name of service',
required=True)
# Get interface status
get_interfaces = subparsers.add_parser(
'get-interfaces', help='Get list of interfaces in a zone')
get_interfaces.add_argument(
'--zone', help='Zone from which the list is to be retrieved',
required=True)
# Add a service
add_service = subparsers.add_parser('add-service', help='Add a service')
add_service.add_argument('service', help='Name of the service to add')
add_service.add_argument('--zone',
help='Zone to which service is to be added',
required=True)
# Remove a service status
remove_service = subparsers.add_parser('remove-service',
help='Remove a service')
remove_service.add_argument('service',
help='Name of the service to remove')
remove_service.add_argument(
'--zone', help='Zone from which service is to be removed',
required=True)
subparsers.required = True
return parser.parse_args()
@ -138,64 +87,12 @@ def subcommand_setup(_):
subprocess.call(['firewall-cmd', '--set-default-zone=external'])
set_firewall_backend('nftables')
add_service('external', 'http')
add_service('internal', 'http')
add_service('external', 'https')
add_service('internal', 'https')
add_service('internal', 'dns')
add_service('internal', 'dhcp')
def subcommand_get_status(_):
"""Print status of the firewalld service"""
subprocess.call(['firewall-cmd', '--state'])
def subcommand_get_enabled_services(arguments):
"""Print the status of variours services"""
subprocess.call(
['firewall-cmd', '--zone', arguments.zone, '--list-services'])
def subcommand_get_service_ports(arguments):
"""Print list of ports for service"""
subprocess.call([
'firewall-cmd', '--permanent', '--service', arguments.service,
'--get-ports'
])
def subcommand_get_interfaces(arguments):
"""Print the list of interfaces in a zone."""
subprocess.call(
['firewall-cmd', '--zone', arguments.zone, '--list-interfaces'])
def subcommand_add_service(arguments):
"""Permit a service in the firewall."""
add_service(arguments.zone, arguments.service)
def add_service(zone, service):
"""Permit a service in the firewall."""
subprocess.call(['firewall-cmd', '--zone', zone, '--add-service', service])
subprocess.call([
'firewall-cmd', '--zone', zone, '--permanent', '--add-service', service
])
def subcommand_remove_service(arguments):
"""Block a service in the firewall"""
subprocess.call([
'firewall-cmd', '--zone', arguments.zone, '--remove-service',
arguments.service
])
subprocess.call([
'firewall-cmd', '--zone', arguments.zone, '--permanent',
'--remove-service', arguments.service
])
def main():
"""Parse arguments and perform all duties"""
arguments = parse_arguments()

View File

@ -1,20 +1,5 @@
#!/usr/bin/python3
#
# This file is part of FreedomBox.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# SPDX-License-Identifier: AGPL-3.0-or-later
"""
Configuration helper for Gitweb.
"""

View File

@ -1,20 +1,5 @@
#!/usr/bin/python3
#
# This file is part of FreedomBox.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# SPDX-License-Identifier: AGPL-3.0-or-later
"""
Actions for help module.
"""

View File

@ -1,20 +1,5 @@
#!/bin/sh
#
# This file is part of FreedomBox.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# SPDX-License-Identifier: AGPL-3.0-or-later
hostname="$1"

View File

@ -1,20 +1,5 @@
#!/usr/bin/python3
#
# This file is part of FreedomBox.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# SPDX-License-Identifier: AGPL-3.0-or-later
"""
Wrapper to list and handle system services
"""

View File

@ -1,20 +1,5 @@
#!/usr/bin/python3
#
# This file is part of FreedomBox.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# SPDX-License-Identifier: AGPL-3.0-or-later
"""
Configuration helper for ikiwiki
"""

View File

@ -1,20 +1,5 @@
#!/usr/bin/python3
#
# This file is part of FreedomBox.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# SPDX-License-Identifier: AGPL-3.0-or-later
"""
Configuration helper for infinoted.
"""

View File

@ -1,20 +1,5 @@
#!/usr/bin/python3
#
# This file is part of FreedomBox.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# SPDX-License-Identifier: AGPL-3.0-or-later
"""
Configuration helper for Let's Encrypt.
"""

View File

@ -1,20 +1,5 @@
#!/usr/bin/python3
#
# This file is part of FreedomBox.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# SPDX-License-Identifier: AGPL-3.0-or-later
"""
Configuration helper for Matrix-Synapse server.
"""

View File

@ -1,20 +1,5 @@
#!/usr/bin/python3
#
# This file is part of FreedomBox.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# SPDX-License-Identifier: AGPL-3.0-or-later
"""
Configuration helper for MediaWiki.
"""

View File

@ -1,20 +1,5 @@
#!/usr/bin/python3
#
# This file is part of FreedomBox.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# SPDX-License-Identifier: AGPL-3.0-or-later
"""
Configuration helper for Minetest server.
"""

View File

@ -1,20 +1,5 @@
#!/usr/bin/python3
#
# This file is part of FreedomBox.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# SPDX-License-Identifier: AGPL-3.0-or-later
"""
Configuration actions for the minidlna server.
"""

View File

@ -1,21 +1,6 @@
#!/usr/bin/python3
# -*- mode: python -*-
#
# This file is part of FreedomBox.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# SPDX-License-Identifier: AGPL-3.0-or-later
"""
Configuration helper for mldonkey.
"""

View File

@ -1,20 +1,5 @@
#!/usr/bin/python3
#
# This file is part of FreedomBox.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# SPDX-License-Identifier: AGPL-3.0-or-later
"""
Configuration helper for monkeysphere.
"""
@ -129,7 +114,7 @@ def get_https_keys(fingerprint_hash):
# Read from FreedomBox configured domains with proper SSL certs.
path = "/files/etc/apache2/sites-available//" \
"directive[. = 'Use'][arg[1] = 'FreedomBoxTLSSiteMacro']"
key_file = ("/files/etc/apache2//Macro[arg[1] = 'FreedomBoxTLSSiteMacro'])"
key_file = ("/files/etc/apache2//Macro[arg[1] = 'FreedomBoxTLSSiteMacro']"
"//VirtualHost/directive[. = 'GnuTLSKeyFile']/arg")
key_file = aug.get(key_file)
for match in aug.match(path):

View File

@ -1,21 +1,6 @@
#!/usr/bin/python3
#
# This file is part of FreedomBox.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# SPDX-License-Identifier: AGPL-3.0-or-later
"""
Configure Mumble server.

View File

@ -1,20 +1,5 @@
#!/usr/bin/python3
#
# This file is part of FreedomBox.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# SPDX-License-Identifier: AGPL-3.0-or-later
"""
Configuration helper for OpenVPN server.
"""

View File

@ -1,20 +1,5 @@
#!/usr/bin/python3
#
# This file is part of FreedomBox.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# SPDX-License-Identifier: AGPL-3.0-or-later
"""
Wrapper to handle package installation with apt-get.
"""

View File

@ -1,20 +1,5 @@
#!/usr/bin/python3
#
# This file is part of FreedomBox.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# SPDX-License-Identifier: AGPL-3.0-or-later
"""
Configuration helper for PageKite interface.
"""

View File

@ -1,20 +1,5 @@
#!/usr/bin/python3
#
# This file is part of FreedomBox.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# SPDX-License-Identifier: AGPL-3.0-or-later
"""
Configuration helper for power controls.
"""

View File

@ -1,20 +1,5 @@
#!/usr/bin/python3
#
# This file is part of FreedomBox.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# SPDX-License-Identifier: AGPL-3.0-or-later
"""
Configuration helper for Privoxy server.
"""

View File

@ -1,20 +1,5 @@
#!/usr/bin/python3
#
# This file is part of FreedomBox.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# SPDX-License-Identifier: AGPL-3.0-or-later
"""
Configuration helper for Quassel.
"""

View File

@ -1,20 +1,5 @@
#!/usr/bin/python3
#
# This file is part of FreedomBox.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# SPDX-License-Identifier: AGPL-3.0-or-later
"""
Configuration helper for Radicale.
"""

View File

@ -1,20 +1,5 @@
#!/usr/bin/python3
#
# This file is part of FreedomBox.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# SPDX-License-Identifier: AGPL-3.0-or-later
"""
Configuration helper for Roundcube server.
"""

View File

@ -1,20 +1,5 @@
#!/usr/bin/python3
#
# This file is part of FreedomBox.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# SPDX-License-Identifier: AGPL-3.0-or-later
"""
Configuration helper for samba.
"""

View File

@ -1,25 +1,11 @@
#!/usr/bin/python3
#
# This file is part of FreedomBox.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# SPDX-License-Identifier: AGPL-3.0-or-later
"""
Configuration helper for searx.
"""
import argparse
import gzip
import os
import pathlib
import secrets
@ -134,7 +120,7 @@ def subcommand_get_safe_search(_):
def read_settings():
"""Load settings as dictionary from YAML config file."""
with open(SETTINGS_FILE, 'rb') as settings_file:
return yaml.load(settings_file)
return yaml.safe_load(settings_file)
def write_settings(settings):
@ -151,6 +137,14 @@ def _get_example_settings_file():
return searx_doc_dir / 'settings.yml.gz'
def _update_search_engines(settings):
"""Updates settings with the latest supported search engines."""
example_settings_file = _get_example_settings_file()
open_func = gzip.open if example_settings_file.suffix == '.gz' else open
with open_func(example_settings_file, 'rb') as example_settings:
settings['engines'] = yaml.safe_load(example_settings)['engines']
def subcommand_setup(_):
"""Post installation actions for Searx"""
_copy_uwsgi_configuration()
@ -169,6 +163,7 @@ def subcommand_setup(_):
_set_title(settings)
_set_timeout(settings)
_set_safe_search(settings)
_update_search_engines(settings)
write_settings(settings)
action_utils.service_restart('uwsgi')

View File

@ -1,20 +1,5 @@
#!/usr/bin/python3
#
# This file is part of FreedomBox.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# SPDX-License-Identifier: AGPL-3.0-or-later
"""
Helper for security configuration
"""

View File

@ -1,20 +1,5 @@
#!/usr/bin/python3
#
# This file is part of FreedomBox.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# SPDX-License-Identifier: AGPL-3.0-or-later
"""
Wrapper to list and handle system services
"""

View File

@ -1,20 +1,5 @@
#!/usr/bin/python3
#
# This file is part of FreedomBox.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# SPDX-License-Identifier: AGPL-3.0-or-later
"""
Helper script for configuring Shadowsocks.
"""
@ -75,7 +60,10 @@ def subcommand_merge_config(arguments):
new_config.update(config)
new_config = json.dumps(new_config, indent=4, sort_keys=True)
old_umask = os.umask(0o027)
# XXX: Config file with password is world-readable. This is the
# same as the default config file, but find a way to avoid this.
# See https://salsa.debian.org/freedombox-team/plinth/-/merge_requests/1724
old_umask = os.umask(0o022)
try:
open(SHADOWSOCKS_CONFIG, 'w').write(new_config)
finally:

View File

@ -1,20 +1,5 @@
#!/usr/bin/python3
#
# This file is part of FreedomBox.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# SPDX-License-Identifier: AGPL-3.0-or-later
"""
Configuration helper for the sharing app.
"""

View File

@ -1,20 +1,5 @@
#!/usr/bin/python3
#
# This file is part of FreedomBox.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# SPDX-License-Identifier: AGPL-3.0-or-later
"""
Configuration helper for filesystem snapshots.
"""

View File

@ -1,20 +1,5 @@
#!/usr/bin/python3
#
# This file is part of FreedomBox.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# SPDX-License-Identifier: AGPL-3.0-or-later
"""
Configuration helper for SSH server.
"""

View File

@ -1,21 +1,6 @@
#!/usr/bin/python3
# -*- mode: python -*-
#
# This file is part of FreedomBox.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# SPDX-License-Identifier: AGPL-3.0-or-later
"""
Actions for sshfs.
"""

View File

@ -1,20 +1,5 @@
#!/usr/bin/python3
#
# This file is part of FreedomBox.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# SPDX-License-Identifier: AGPL-3.0-or-later
"""
Configuration helper for disks manager.
"""

View File

@ -1,20 +1,5 @@
#!/usr/bin/python3
#
# This file is part of FreedomBox.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# SPDX-License-Identifier: AGPL-3.0-or-later
"""
Configuration helper for Syncthing.
"""

View File

@ -1,20 +1,5 @@
#!/usr/bin/python3
#
# This file is part of FreedomBox.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# SPDX-License-Identifier: AGPL-3.0-or-later
"""
Configuration helper for Tahoe-LAFS.
"""

View File

@ -1,21 +1,6 @@
#!/usr/bin/python3
# -*- mode: python -*-
#
# This file is part of FreedomBox.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# SPDX-License-Identifier: AGPL-3.0-or-later
"""
Helper to test whether action scripts use the correct PYTHONPATH.
"""

View File

@ -1,20 +1,5 @@
#!/usr/bin/python3
#
# This file is part of FreedomBox.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# SPDX-License-Identifier: AGPL-3.0-or-later
"""
Set time zones with timedatectl (requires root permission).
"""

View File

@ -1,20 +1,5 @@
#!/usr/bin/python3
#
# This file is part of FreedomBox.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# SPDX-License-Identifier: AGPL-3.0-or-later
"""
Configuration helper for the Tor service
"""

View File

@ -1,20 +1,5 @@
#!/usr/bin/python3
#
# This file is part of FreedomBox.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# SPDX-License-Identifier: AGPL-3.0-or-later
"""
Configuration helper for Transmission daemon.
"""

View File

@ -1,20 +1,5 @@
#!/usr/bin/python3
#
# This file is part of FreedomBox.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# SPDX-License-Identifier: AGPL-3.0-or-later
"""
Configuration helper for Tiny Tiny RSS.
"""

View File

@ -1,20 +1,5 @@
#!/usr/bin/python3
#
# This file is part of FreedomBox.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# SPDX-License-Identifier: AGPL-3.0-or-later
"""
Configures or runs unattended-upgrades
"""

View File

@ -1,20 +1,5 @@
#!/usr/bin/python3
#
# This file is part of FreedomBox.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# SPDX-License-Identifier: AGPL-3.0-or-later
"""
Configuration helper for the LDAP user directory
"""

View File

@ -1,20 +1,5 @@
#!/usr/bin/python3
#
# This file is part of FreedomBox.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# SPDX-License-Identifier: AGPL-3.0-or-later
"""
Configuration helper for WireGuard.
"""

View File

@ -1,20 +1,5 @@
#!/usr/bin/python3
#
# This file is part of FreedomBox.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# SPDX-License-Identifier: AGPL-3.0-or-later
import plinth.__main__

View File

@ -1,19 +1,4 @@
#
# This file is part of FreedomBox.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# SPDX-License-Identifier: AGPL-3.0-or-later
"""
pytest configuration for all tests.
"""

View File

@ -1,19 +1,4 @@
#
# This file is part of FreedomBox.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# SPDX-License-Identifier: AGPL-3.0-or-later
[Unit]
Description=FreedomBox Service (Plinth)

View File

@ -3,7 +3,8 @@
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
<!--
This file is part of FreedomBox.
SPDX-License-Identifier: AGPL-3.0-or-later
Allow only root and plinth users to send any notifications to FreedomBox Service
or to own the FreedomBox Service.

136
debian/changelog vendored
View File

@ -1,3 +1,139 @@
plinth (20.3) unstable; urgency=medium
[ Sunil Mohan Adapa ]
* web_framework: Separate out Django settings into module
* doc/dev: Allow all modules to be imported by Sphinx
* notification: Add developer documentation
* doc/dev: Update copyright year
* app: Update style for toggle button
* app: Drop border shadow for app icon in mobile view
* app: cosmetic: Minor refactoring of header styling
* app: Simplify some header styling
* app: cosmetic: Rename a CSS style class in app header
* app: cosmetic: Rename header.html to app-header.html
* app: Show short description as secondary title
* networks: Fix i18n for wizard forms
* networks: Minor changes to router/internet configuration forms
* web_framework: Generate and retain a secret key
* web_framework: Cleanup expired sessions every week
[ Nektarios Katakis ]
* networks: Add form for internet connection type
* networks: Add network view and url for internet connection help page
* networks: Link internet connection help page with networks page.
* networks: All first step wizard form for internet connection type
* networks: Add first boot step for internet connection type
* networks: Save to kvstore internet connectivity type
* networks: Refactor connections list template
* networks: Show internet connectivity string in main page
[ Michael Breidenbach ]
* Translated using Weblate (German)
* Translated using Weblate (Swedish)
[ Dietmar ]
* Translated using Weblate (Italian)
[ Jaime Marquínez Ferrándiz ]
* Translated using Weblate (Spanish)
[ Luis A. Arizmendi ]
* Translated using Weblate (Spanish)
[ Joseph Nuthalapati ]
* shadowsocks: Fix shadowsocks not able to start
[ James Valleroy ]
* locale: Update translation strings
* doc: Fetch latest manual
-- James Valleroy <jvalleroy@mailbox.org> Mon, 24 Feb 2020 20:16:12 -0500
plinth (20.2.1) unstable; urgency=high
[ Veiko Aasa ]
* apps: remove css filters and glow from app icons
* config: Depends also on apache module
[ Dietmar ]
* Translated using Weblate (German)
* Translated using Weblate (Italian)
* Translated using Weblate (Italian)
[ Petter Reinholdtsen ]
* Translated using Weblate (Norwegian Bokmål)
[ Sunil Mohan Adapa ]
* cards: Remove the transition delay on hover effect
* system: Implement new style for cards
* jsxc: Bypass issue with stronghold to get the app working again
* jsxc: Fix functional test case failure
* functional_tests: cosmetic: Minor yapf change
* app: Introduce Info component to store basic app information
* app: Add info property as shortcut to access basic information
* app: Refactor all apps to use the Info component
* app: Document the app_id property for App class
* doc/dev: Include information on how to edit dev documentation
* views: Document the AppView class properties
* monkeysphere: Fix regression with reading Apache configuration
* Translated using Weblate (Italian)
* firewall: Use firewalld DBus API for most operations
* *.py: Use SPDX license identifier
* *.html: Use SPDX license identifier
* actions/*: Use SPDX license identifier
* functional_tests: Use SPDX license identifier
* *.css: Use SPDX license identifier
* *: Update misc build related files to use SPDX license identifier
* doc/dev: Update tutorial to use SPDX license indentifier
* *: Update remaining misc files to use SPDX license identifier
* *.js: Use SPDX license identifier
* help: Fix attribute on download manual button
* css: Add missing license identifier on some CSS files
* firewalld: Ignore errors with DBus API when firewalld is not running
* deluge: Don't use code execution for editing configuration
* deluge: More reliable initial configuration setup
[ Joseph Nuthalapati ]
* l10n: Fix gettext not detecting no-python-format
* samba: Add link to manual page
* searx: Update search engines for 0.16.0
[ Allan Nordhøy ]
* openvpn: Fix spelling for Tunnelblick
* Translated using Weblate (Norwegian Bokmål)
[ Nektarios Katakis ]
* bind: parse zones files
* bind: test for parsing zones file with specific format
* bind: views show served domains in main view
* bind: create zones directory on setup action
[ James Valleroy ]
* bind: Bump version and handle upgrade
[ Ralf Barkow ]
* Translated using Weblate (German)
[ nautilusx ]
* Translated using Weblate (German)
[ Doma Gergő ]
* Translated using Weblate (Hungarian)
[ Lev Lamberov ]
* debian: Update Russian translation for debconf (Closes: #951440)
[ Radek Pasiok ]
* Translated using Weblate (Polish)
[ Alice Kile ]
* gitignore: Add .vscode & segregate editor settings
[ Thomas Vincent ]
* Translated using Weblate (French)
-- James Valleroy <jvalleroy@mailbox.org> Fri, 21 Feb 2020 22:38:12 -0500
plinth (20.2~bpo10+1) buster-backports; urgency=medium
* Rebuild for buster-backports.

17
debian/po/ru.po vendored
View File

@ -1,21 +1,21 @@
# Russian translation of plinth debconf template.
# Copyright (C) 2019 FreedomBox packaging team <freedombox-pkg-team@lists.alioth.debian.org>
# This file is distributed under the same license as the plinth package.
# Lev Lamberov <dogsleg@debian.org>.
# Lev Lamberov <dogsleg@debian.org>, 2020.
#
msgid ""
msgstr ""
"Project-Id-Version: plinth\n"
"Report-Msgid-Bugs-To: plinth@packages.debian.org\n"
"POT-Creation-Date: 2019-11-18 18:11-0500\n"
"PO-Revision-Date: 2018-10-07 11:19+0500\n"
"PO-Revision-Date: 2020-02-10 10:17+0500\n"
"Last-Translator: Lev Lamberov <dogsleg@debian.org>\n"
"Language-Team: Debian L10n Russian <debian-l10n-russian@lists.debian.org>\n"
"Language: ru\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 2.1.1\n"
"X-Generator: Poedit 2.2.4\n"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
"%10<=4 && (n%100<12 || n%100>14) ? 1 : 2);\n"
@ -28,16 +28,11 @@ msgstr "Секретная строка мастера настройки Freedo
#. Type: note
#. Description
#: ../templates:1001
#, fuzzy
#| msgid ""
#| "Please save this string. You will be asked to enter this in the first "
#| "screen after you launch the FreedomBox interface. In case you lose it, "
#| "you can find it in the file /var/lib/plinth/firstboot-wizard-secret."
msgid ""
"Please note down the above secret. You will be asked to enter this in the "
"first screen after you launch the FreedomBox web interface. In case you lose "
"it, you can retrieve it by running the following command:"
msgstr ""
"Сохраните эту строку. Вам будет необходимо ввести её на самом первом экране "
"после запуска интерфейса FreedomBox. Если вы потеряете эту строку, то вы "
"сможете найти её в файле /var/lib/plinth/firstboot-wizard-secret."
"Запишите эту секретную строку. Вам будет необходимо ввести её на самом "
"первом экране после запуска веб-интерфейса FreedomBox. Если вы потеряете эту "
"строку, то вы сможете получить её, выполнив следующую команду:"

View File

@ -1,20 +1,5 @@
#!/usr/bin/make -f
#
# This file is part of FreedomBox.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# SPDX-License-Identifier: AGPL-3.0-or-later
OUTPUTS=freedombox-manual.pdf plinth.1 manual-pages

View File

@ -1,19 +1,4 @@
#
# This file is part of FreedomBox.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# SPDX-License-Identifier: AGPL-3.0-or-later
#
# Minimal makefile for Sphinx documentation

View File

@ -1,17 +1,17 @@
.. SPDX-License-Identifier: CC-BY-SA-4.0
About
=====
This directory contains the FreedomBox Developer Manual. Specifically the
tutorial for writing new applications and API reference for writing apps for
FreedomBox. It is kept as part of the main FreedomBox source code with the
expectation that when the API changes the developer documentation is also
updated in the same patch set.
Editing the Developer Documentation
===================================
About
*****
The doc/dev directory in FreedomBox repository contains the FreedomBox Developer
Manual. Specifically the tutorial for writing new applications and API reference
for writing apps for FreedomBox. It is kept as part of the main FreedomBox
source code with the expectation that when the API changes the developer
documentation is also updated in the same patch set.
Setup on Debian
***************

View File

@ -1,20 +1,5 @@
# -*- coding: utf-8 -*-
#
# This file is part of FreedomBox.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# SPDX-License-Identifier: AGPL-3.0-or-later
"""
Configuration file for the Sphinx documentation builder.
@ -31,13 +16,29 @@ list see the documentation: http://www.sphinx-doc.org/en/master/config
import os
import sys
import django
import django.conf
sys.path.insert(0, os.path.abspath('../../'))
# -- Django setup ------------------------------------------------------------
# Ensure that Django models can be imported by Sphinx
import plinth.settings # noqa pylint: disable=E402 isort:skip
kwargs = {}
for setting in dir(plinth.settings):
if setting.isupper():
kwargs[setting] = getattr(plinth.settings, setting)
django.conf.settings.configure(**kwargs)
django.setup(set_prefix=True)
# -- Project information -----------------------------------------------------
# pylint: disable=invalid-name
project = 'FreedomBox'
copyright = '2019, FreedomBox Authors'
copyright = '2020, FreedomBox Authors'
author = 'FreedomBox Authors'
# The short X.Y version

View File

@ -30,6 +30,13 @@ External References
#. `FreedomBox User Manual <https://wiki.debian.org/FreedomBox/Manual>`_
Contributing to this Documentation
**********************************
.. toctree::
README
Indices and tables
******************

View File

@ -6,6 +6,7 @@ Components
.. toctree::
:caption: Available components:
info
menu
daemon
firewall

View File

@ -0,0 +1,7 @@
.. SPDX-License-Identifier: CC-BY-SA-4.0
Info
^^^^
.. autoclass:: plinth.app.Info
:members:

View File

@ -19,5 +19,6 @@ and are updated when the API is updated.
action_utils
views
forms
notifications
.. automodule:: plinth.modules.ttrss

View File

@ -0,0 +1,7 @@
.. SPDX-License-Identifier: CC-BY-SA-4.0
Notification
^^^^^^^^^^^^
.. autoclass:: plinth.notification.Notification
:members:

View File

@ -3,6 +3,41 @@
Part 4: Components
------------------
Each :class:`~plinth.app.App` contains various :class:`~plinth.app.Component`
components that each provide one small functionality needed by the app. Each of
these components are instantiated and added to the app as children.
Providing basic information about the app
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
We need to provide some basic information about the application for the app to
function normally.
.. code-block:: python3
from plinth import app as app_module
class TransmissionApp(app_module.App):
...
def __init__(self):
...
info = app_module.Info(app_id=self.app_id, version=1,
name=_('Transmission'),
icon_filename='transmission',
short_description=_('BitTorrent Web Client'),
description=description,
manual_page='Transmission', clients=clients)
self.add(info)
The first argument is app_id that is same as the ID for the app. The version is
the version number for this app that must be incremented whenever setup() method
needs to be called again. name, icon_filename, short_description, description,
manual_page and clients provide information that is shown on the app's main
page. More information the parameters is available in :class:`~plinth.app.Info`
class documentation.
Managing a daemon
^^^^^^^^^^^^^^^^^

View File

@ -14,22 +14,7 @@ developers. Let us add license headers to our application.
.. code-block:: python3
#
# This file is part of FreedomBox.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# SPDX-License-Identifier: AGPL-3.0-or-later
The above header needs to be present in every file of the application. It is
suitable for Python files. However, in template files, we need to modify it
@ -39,22 +24,7 @@ slightly.
{% extends "base.html" %}
{% comment %}
#
# This file is part of FreedomBox.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# SPDX-License-Identifier: AGPL-3.0-or-later
{% endcomment %}
Coding standards

View File

@ -100,8 +100,6 @@ view to show the app page for our app. In ``views.py``, let us add a view.
class TransmissionAppView(views.AppView):
"""Serve configuration page."""
name = transmission.name
description = transmission.description
app_id = 'transmission'
The base view :class:`~plinth.views.AppView` takes care of a lot of details for

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