...
 
Commits (19)
......@@ -23,6 +23,7 @@ import argparse
import os
from plinth import action_utils, cfg
from plinth.modules.i2p.helpers import RouterEditor, TunnelEditor
cfg.read()
module_config_path = os.path.join(cfg.config_dir, 'modules-enabled')
......@@ -42,6 +43,16 @@ def parse_arguments():
'add-favorite', help='Add an eepsite to the list of favorites')
subparser.add_argument('--name', help='Name of the entry', required=True)
subparser.add_argument('--url', help='URL of the entry', required=True)
subparser.add_argument('--description', help='Short description',
required=False)
subparser.add_argument('--icon', help='URL to icon', required=False)
subparser = subparsers.add_parser('set-tunnel-property',
help='Modify configuration of a tunnel')
subparser.add_argument('--name', help='Name of the tunnel', required=True)
subparser.add_argument('--property', help='Property to modify',
required=True)
subparser.add_argument('--value', help='Value to assign', required=True)
subparsers.required = True
return parser.parse_args()
......@@ -59,6 +70,19 @@ def subcommand_disable(_):
action_utils.webserver_disable('i2p-freedombox')
def subcommand_set_tunnel_property(arguments):
"""Modify the configuration file for a certain tunnel."""
editor = TunnelEditor()
editor \
.read_conf() \
.set_tunnel_idx(arguments.name) \
.set_tunnel_prop(arguments.property, arguments.value) \
.write_conf()
print('Updated "{property}" of {filename} to {value}'.format(
property=editor.calc_prop_path(arguments.property),
filename=editor.conf_filename, value=arguments.value))
def subcommand_add_favorite(arguments):
"""
Adds a favorite to the router.config
......@@ -66,36 +90,11 @@ def subcommand_add_favorite(arguments):
:param arguments:
:type arguments:
"""
router_config_path = os.path.join(I2P_CONF_DIR, 'router.config')
# Read config
with open(router_config_path) as config_file:
config_lines = config_file.readlines()
found_favorites = False
url = arguments.url
new_favorite = '{name},{description},{url},{icon},'.format(
name=arguments.name, description='', url=arguments.url,
icon='/themes/console/images/eepsite.png')
for i in range(len(config_lines)):
line = config_lines[i]
# Find favorites line
if line.startswith('routerconsole.favorites'):
found_favorites = True
if url in line:
print('URL already in favorites')
exit(0)
# Append favorite
config_lines[i] = line.strip() + new_favorite + '\n'
break
if not found_favorites:
config_lines.append('routerconsole.favorites=' + new_favorite + '\n')
# Update config
with open(router_config_path, mode='w') as config_file:
config_file.writelines(config_lines)
editor = RouterEditor()
editor.read_conf().add_favorite(arguments.name, url, arguments.description,
arguments.icon).write_conf()
print('Added {} to favorites'.format(url))
......
plinth (19.6) experimental; urgency=medium
[ Pavel Borecki ]
* Translated using Weblate (Czech)
[ CurlingTongs ]
* Translated using Weblate (German)
[ nautilusx ]
* Translated using Weblate (German)
[ Allan Nordhøy ]
* Translated using Weblate (Norwegian Bokmål)
[ Mesut Akcan ]
* Translated using Weblate (Turkish)
[ narendrakumar.b ]
* letsencrypt: Provide link to configure domain if not configured
[ James Valleroy ]
* firewall: Get service ports details
* firewall: Show ports details
* locale: Update translation strings
* doc: Fetch latest manual
[ LoveIsGrief ]
* i2p: Add helper to modify the tunnel config
* i2p: Open HTTP(S) and IRC ports on all interfaces on install
* i2p: Add HTTP(S) and IRC ports to firewall
* i2p: Enable application
[ Sunil Mohan Adapa ]
* i2p: flake8 and yapf fixes
* i2p: Convert unit tests to pytest style
* i2p: Update firewalld service descriptions
* i2p: Disable the daemon before editing configuration
* i2p: Don't enable proxies on external zone
-- James Valleroy <jvalleroy@mailbox.org> Mon, 29 Apr 2019 19:18:01 -0400
plinth (19.5) experimental; urgency=medium
[ LoveIsGrief ]
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -18,4 +18,4 @@
Package init file.
"""
__version__ = '19.5'
__version__ = '19.6'
......@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-04-15 18:31-0400\n"
"POT-Creation-Date: 2019-04-29 19:02-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
......@@ -1480,8 +1480,8 @@ msgstr ""
#: plinth/modules/i2p/views.py:91
msgid ""
"By default HTTP, HTTPS and SOCKS5 proxies are available. Additional proxies "
"and tunnels may be configured using the tunnel configuration interface."
"By default HTTP, HTTPS and IRC proxies are available. Additional proxies and "
"tunnels may be configured using the tunnel configuration interface."
msgstr ""
#: plinth/modules/i2p/views.py:100
......@@ -1886,10 +1886,11 @@ msgid ""
"management of its certificates."
msgstr ""
#: plinth/modules/letsencrypt/templates/letsencrypt.html:324
#: plinth/modules/letsencrypt/templates/letsencrypt.html:325
#, python-format
msgid ""
"No domains have been configured. Configure domains to be able to obtain "
"certificates for them."
"No domains have been configured. <a href=\"%(config_url)s\">Configure "
"domains</a> to be able to obtain certificates for them."
msgstr ""
#: plinth/modules/letsencrypt/views.py:57
......@@ -2292,7 +2293,7 @@ msgstr ""
#: plinth/modules/monkeysphere/templates/monkeysphere.html:88
#: plinth/modules/monkeysphere/templates/monkeysphere_details.html:60
#: plinth/service.py:125
#: plinth/service.py:138
msgid "Web Server"
msgstr ""
......@@ -4963,11 +4964,11 @@ msgstr ""
msgid "configuration file: {file}"
msgstr ""
#: plinth/service.py:127
#: plinth/service.py:140
msgid "Web Server over Secure Socket Layer"
msgstr ""
#: plinth/service.py:129
#: plinth/service.py:145
#, python-brace-format
msgid "{box_name} Web Interface (Plinth)"
msgstr ""
......
......@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-04-15 18:31-0400\n"
"POT-Creation-Date: 2019-04-29 19:02-0400\n"
"PO-Revision-Date: 2019-04-17 21:04+0000\n"
"Last-Translator: Pavel Borecki <pavel.borecki@gmail.com>\n"
"Language-Team: Czech <https://hosted.weblate.org/projects/freedombox/plinth/"
......@@ -1651,8 +1651,8 @@ msgid ""
"Find more information about I2P on their project <a href=\"https://geti2p.net"
"\" target=\"_blank\">homepage</a>."
msgstr ""
"Více informací I2P naleznete na <a href=\"https://geti2p.net\" target=\""
"_blank\">domovské stránce projektu</a>."
"Více informací I2P naleznete na <a href=\"https://geti2p.net\" target="
"\"_blank\">domovské stránce projektu</a>."
#: plinth/modules/i2p/__init__.py:49
msgid ""
......@@ -1703,9 +1703,14 @@ msgstr ""
"nastaven pro proxy."
#: plinth/modules/i2p/views.py:91
#, fuzzy
#| msgid ""
#| "By default HTTP, HTTPS and SOCKS5 proxies are available. Additional "
#| "proxies and tunnels may be configured using the tunnel configuration "
#| "interface."
msgid ""
"By default HTTP, HTTPS and SOCKS5 proxies are available. Additional proxies "
"and tunnels may be configured using the tunnel configuration interface."
"By default HTTP, HTTPS and IRC proxies are available. Additional proxies and "
"tunnels may be configured using the tunnel configuration interface."
msgstr ""
"Ve výchozím stavu jsou k dispozici proxy pro HTTP, HTTPS a SOCKS5. Další "
"proxy a tunely je možné nastavit pomocí rozhraní pro nastavení tunelů."
......@@ -2175,10 +2180,14 @@ msgstr ""
"<b>Nyní není nastavena žádná doména.</b> Nejprve nějakou nastavte a až pak "
"pro ní bude možné spravovat certifikáty."
#: plinth/modules/letsencrypt/templates/letsencrypt.html:324
#: plinth/modules/letsencrypt/templates/letsencrypt.html:325
#, fuzzy, python-format
#| msgid ""
#| "No domains have been configured. Configure domains to be able to obtain "
#| "certificates for them."
msgid ""
"No domains have been configured. Configure domains to be able to obtain "
"certificates for them."
"No domains have been configured. <a href=\"%(config_url)s\">Configure "
"domains</a> to be able to obtain certificates for them."
msgstr ""
"Nejsou nastavené žádné domény. Nastavte je, aby bylo možné pro ně získat "
"certifikát."
......@@ -2673,7 +2682,7 @@ msgstr "Zabezpečený shell"
#: plinth/modules/monkeysphere/templates/monkeysphere.html:88
#: plinth/modules/monkeysphere/templates/monkeysphere_details.html:60
#: plinth/service.py:125
#: plinth/service.py:138
msgid "Web Server"
msgstr "Webový server"
......@@ -5691,11 +5700,11 @@ msgstr "změna média"
msgid "configuration file: {file}"
msgstr "soubor s nastaveními: {file}"
#: plinth/service.py:127
#: plinth/service.py:140
msgid "Web Server over Secure Socket Layer"
msgstr "Webový server přes vrstvu zabezpečeného soketu (SSL)"
#: plinth/service.py:129
#: plinth/service.py:145
#, python-brace-format
msgid "{box_name} Web Interface (Plinth)"
msgstr "Webové rozhraní {box_name} (Plinth)"
......
......@@ -9,7 +9,7 @@ msgid ""
msgstr ""
"Project-Id-Version: FreedomBox UI\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-04-15 18:31-0400\n"
"POT-Creation-Date: 2019-04-29 19:02-0400\n"
"PO-Revision-Date: 2016-07-03 21:44+0000\n"
"Last-Translator: Mikkel Kirkgaard Nielsen <memb_weblate@mikini.dk>\n"
"Language-Team: Danish <https://hosted.weblate.org/projects/freedombox/plinth/"
......@@ -1728,8 +1728,8 @@ msgstr ""
#: plinth/modules/i2p/views.py:91
msgid ""
"By default HTTP, HTTPS and SOCKS5 proxies are available. Additional proxies "
"and tunnels may be configured using the tunnel configuration interface."
"By default HTTP, HTTPS and IRC proxies are available. Additional proxies and "
"tunnels may be configured using the tunnel configuration interface."
msgstr ""
#: plinth/modules/i2p/views.py:100
......@@ -2197,10 +2197,11 @@ msgid ""
"management of its certificates."
msgstr ""
#: plinth/modules/letsencrypt/templates/letsencrypt.html:324
#: plinth/modules/letsencrypt/templates/letsencrypt.html:325
#, python-format
msgid ""
"No domains have been configured. Configure domains to be able to obtain "
"certificates for them."
"No domains have been configured. <a href=\"%(config_url)s\">Configure "
"domains</a> to be able to obtain certificates for them."
msgstr ""
#: plinth/modules/letsencrypt/views.py:57
......@@ -2689,7 +2690,7 @@ msgstr "Secure Shell"
#: plinth/modules/monkeysphere/templates/monkeysphere.html:88
#: plinth/modules/monkeysphere/templates/monkeysphere_details.html:60
#: plinth/service.py:125
#: plinth/service.py:138
msgid "Web Server"
msgstr "Webserver"
......@@ -5768,11 +5769,11 @@ msgstr "medie-ændring"
msgid "configuration file: {file}"
msgstr "konfigurationsfil: {file}"
#: plinth/service.py:127
#: plinth/service.py:140
msgid "Web Server over Secure Socket Layer"
msgstr "Sikker Webserver (via SSL)"
#: plinth/service.py:129
#: plinth/service.py:145
#, python-brace-format
msgid "{box_name} Web Interface (Plinth)"
msgstr "{box_name} Web-brugerflade (Plinth)"
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-04-15 18:31-0400\n"
"POT-Creation-Date: 2019-04-29 19:02-0400\n"
"PO-Revision-Date: 2018-02-05 18:37+0000\n"
"Last-Translator: drashti kaushik <drashtipandya37@gmail.com>\n"
"Language-Team: Gujarati <https://hosted.weblate.org/projects/freedombox/"
......@@ -1609,8 +1609,8 @@ msgstr ""
#: plinth/modules/i2p/views.py:91
msgid ""
"By default HTTP, HTTPS and SOCKS5 proxies are available. Additional proxies "
"and tunnels may be configured using the tunnel configuration interface."
"By default HTTP, HTTPS and IRC proxies are available. Additional proxies and "
"tunnels may be configured using the tunnel configuration interface."
msgstr ""
#: plinth/modules/i2p/views.py:100
......@@ -2015,10 +2015,11 @@ msgid ""
"management of its certificates."
msgstr ""
#: plinth/modules/letsencrypt/templates/letsencrypt.html:324
#: plinth/modules/letsencrypt/templates/letsencrypt.html:325
#, python-format
msgid ""
"No domains have been configured. Configure domains to be able to obtain "
"certificates for them."
"No domains have been configured. <a href=\"%(config_url)s\">Configure "
"domains</a> to be able to obtain certificates for them."
msgstr ""
#: plinth/modules/letsencrypt/views.py:57
......@@ -2439,7 +2440,7 @@ msgstr ""
#: plinth/modules/monkeysphere/templates/monkeysphere.html:88
#: plinth/modules/monkeysphere/templates/monkeysphere_details.html:60
#: plinth/service.py:125
#: plinth/service.py:138
msgid "Web Server"
msgstr ""
......@@ -5123,11 +5124,11 @@ msgstr ""
msgid "configuration file: {file}"
msgstr ""
#: plinth/service.py:127
#: plinth/service.py:140
msgid "Web Server over Secure Socket Layer"
msgstr ""
#: plinth/service.py:129
#: plinth/service.py:145
#, python-brace-format
msgid "{box_name} Web Interface (Plinth)"
msgstr ""
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-04-15 18:31-0400\n"
"POT-Creation-Date: 2019-04-29 19:02-0400\n"
"PO-Revision-Date: 2018-12-01 13:01+0000\n"
"Last-Translator: ssantos <ssantos@web.de>\n"
"Language-Team: Portuguese <https://hosted.weblate.org/projects/freedombox/"
......@@ -1567,8 +1567,8 @@ msgstr ""
#: plinth/modules/i2p/views.py:91
msgid ""
"By default HTTP, HTTPS and SOCKS5 proxies are available. Additional proxies "
"and tunnels may be configured using the tunnel configuration interface."
"By default HTTP, HTTPS and IRC proxies are available. Additional proxies and "
"tunnels may be configured using the tunnel configuration interface."
msgstr ""
#: plinth/modules/i2p/views.py:100
......@@ -1983,10 +1983,11 @@ msgid ""
"management of its certificates."
msgstr ""
#: plinth/modules/letsencrypt/templates/letsencrypt.html:324
#: plinth/modules/letsencrypt/templates/letsencrypt.html:325
#, python-format
msgid ""
"No domains have been configured. Configure domains to be able to obtain "
"certificates for them."
"No domains have been configured. <a href=\"%(config_url)s\">Configure "
"domains</a> to be able to obtain certificates for them."
msgstr ""
#: plinth/modules/letsencrypt/views.py:57
......@@ -2419,7 +2420,7 @@ msgstr ""
#: plinth/modules/monkeysphere/templates/monkeysphere.html:88
#: plinth/modules/monkeysphere/templates/monkeysphere_details.html:60
#: plinth/service.py:125
#: plinth/service.py:138
msgid "Web Server"
msgstr ""
......@@ -5121,11 +5122,11 @@ msgstr "Definição inalterada"
msgid "configuration file: {file}"
msgstr "Configuração"
#: plinth/service.py:127
#: plinth/service.py:140
msgid "Web Server over Secure Socket Layer"
msgstr ""
#: plinth/service.py:129
#: plinth/service.py:145
#, python-brace-format
msgid "{box_name} Web Interface (Plinth)"
msgstr ""
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -27,14 +27,14 @@ from django.templatetags.static import static
from plinth import frontpage, module_loader
from plinth.modules import names
from plinth.modules.names import api
def access_info(request, **kwargs):
"""API view to return a list of domains and types."""
domains = [{
'domain': domain,
'type': domain_type
} for domain_type, domains in names.domains.items() for domain in domains]
} for domain_type, domains in api.get_domain_type_and_domains_as_list_of_tupple() for domain in domains]
response = {'domains': domains}
return HttpResponse(json.dumps(response), content_type='application/json')
......
......@@ -25,6 +25,7 @@ from plinth import action_utils, actions, cfg, frontpage
from plinth import service as service_module
from plinth.menu import main_menu
from plinth.modules import names
from plinth.modules.names import api
from plinth.signals import domain_added, domain_removed, domainname_change
from plinth.utils import format_lazy
......@@ -85,10 +86,7 @@ def init():
def setup(helper, old_version=None):
"""Install and configure the module."""
helper.install(managed_packages)
domains = [
domain for domains_of_a_type in names.domains.values()
for domain in domains_of_a_type
]
domains = api.get_domain_names_list()
helper.call('post', actions.superuser_run, 'cockpit', ['setup'] + domains)
global service
if service is None:
......
This diff is collapsed.
This diff is collapsed.
......@@ -14,6 +14,9 @@
# 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/>.
#
"""
Application manifest for I2P.
"""
from django.utils.translation import ugettext_lazy as _
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.