When private mode is turned on and off, a setting to allow anonymous editing is
being written. This turns on anonymous editing on the wiki. To fix, drop the
code that adds anonymous editing line and implement migration from older
settings to newer settings.
Closes: #1783.
Tests performed:
- Install mediawiki with current master. Private mode is disabled by default.
Anonymous users can't edit. There is a line for editing set to false in
FreedomBoxSettings.php configuration file. Switch to latest code. The line
should be removed. private mode is still disabled. Anonymous users should not be
able to edit the wiki.
- Install mediawiki with current master. Enable private mode. Anonymous users
can't edit, login is required to view wiki. There is a line for editing set to
false in FreedomBoxSettings.php configuration file. Switch to latest code. The
line should be removed. private mode is still enabled. Anonymous users should
not be able to edit the wiki. Login is required to view the wiki.
- Install mediawiki with current master. Enable private mode and disable it.
Anonymous users can edit the wiki. There is a line for editing set to true in
FreedomBoxSettings.php configuration file. Switch to latest code. The line
should be removed. private mode is still disabled. Anonymous users should not be
able to edit the wiki but they can read the wiki.
- Install mediawiki with the changes in the branch. Line for editing the wiki is
not present in FreedomBoxSettings.php configuration file. Enabling/disabling the
private mode does not introduce the line either. When private mode is enabled,
login is required to read/edit the wiki. When it is disabled, anonymous users
can read the wiki but not edit it.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
If the app is disabled and configuration is edited, don't start the daemon.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Nektarios Katakis <iam@nektarioskatakis.xyz>
Commit 50e5608331330b37c0b9cce846e34ccc193d1b0d incorrectly sets the
StateDirectory without setting DynamicUser. Buster's shadowsocks will then
create directory /var/lib/shadowsocks-libev/freedombox/ and refuse to delete it
in later versions when DynamicUser=yes needs it to be a symlink.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Nektarios Katakis <iam@nektarioskatakis.xyz>
- Reduce password length to encourage users to use the auto-generated one
instead of setting a new one.
- Don't set mode to tcp_and_udp: 1) upstream default to TCP only, leave the
decision to upstream. 2) firewalld service file only allows TCP. Without editing
the firewalld configuration, this change is incorrect.
- Don't set timeout. This values matches with the upstream default.. Leave this
to upstream.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Nektarios Katakis <iam@nektarioskatakis.xyz>
- Ensure that /var/lib/private/shadowsocks-libev/freedombox always exists. This
fixes not being able to save configuration after setup on fresh Buster installs.
- Merge migration path from version 1 to 2 into setup process in an idempotent
way.
- Always creating an initial configuration file so that daemon starts soon after
install. Set a default random password. Localhost as default server.
Closes: #1792
Signed-off-by: Nektarios Katakis <iam@nektarioskatakis.xyz>
[sunil: Minor indentation, update commit message]
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
- For setting up backports repositories. Using an internal scheduler is easy to
maintain in the long run.
- Run it more frequently when in developer mode.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- This only effects development environments where ./setup.py is run but not the
shipped product.
- Write log messages about removing the files only when actually removing the
file. This is so that the log output is quiet when no action is taken (typical).
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- Don't ship the file preferences file as this is a violation of the Debian
policy. Lintian throws a hard error that can't be overridden. Remove the lintian
override. Remove this file using maintainer scripts when upgrading from all
version below 20.5.
- The preferences file is now renamed to 50freedombox4.pref.
- Instead write the file when the app is getting setup (on each new version).
- Don't run the setup code on daily timer, instead run the code when the app
upgrades. This ensures that as soon as freedombox package is upgraded and run,
the new preferences file is created instead of waiting for the daily timer to
run.
- From now on when the preferences change, we will increment the version number
of the upgrades app. Change the setup() for the app so that it does not
re-enable automatic upgrades every time setup() is run.
Closes: #1673.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Tests performed:
- Pick an app like Infonoted that does not have web client. Visit the front page
click on Infinoted. Clients button should show up. Clicking on it should expand
the clients information table.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- So that it can be reused in frontpage.
Tests performed:
- Go to an app like Gitweb. Both launch web client button and clients apps
button should be visible. Similarly, Deluge should only show launch button.
Infinoted should only show clients button.
- Go to an app like Gitweb where launch web client button is available. Enabling
the app should enable the launch web client button and disabling the app should
disable the launch web client button.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- Change in any of the following is treated as unique: protocol, frontend port,
subdomains.
- Change in any of the following is not treated as unique: backend port.
Issue reported in
https://salsa.debian.org/freedombox-team/plinth/-/merge_requests/1742#note_147960
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- python3-signedjson >= 1.1.0 is needed by matrix-synapse-1.11.
- Force upgrade to version 1.11 is needed.
Closes: #1791.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Nektarios Katakis <iam@nektarioskatakis.xyz>
When app is disabled with older code, 'abort_not_configured' is present in the
configuration file. Wipe it when re-enabling with newer code.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- Place the add button in a paragraph to remove unnecessary styling.
- De-emphasize the add button by making it default style instead of primary.
- Re-add a missing class on the custom services list to apply the intended style
properly.
- Drop horizontal rule.
- Remove the unnecessary title "Existing custom services". Emphasize the custom
services section by making it <h3> instead of <h4>. Also for consistency across
the interface.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- Turn some methods in action script to private to improve abstraction.
- Always enable the predefined services when setting the configuration for the
first time.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- Simplifies the form submission code.
- When service is disabled, don't add the abort_not_configured configuration
flag. There is not need to change the configuration as disabling the daemon from
running is reliable enough.
- When the configuration is set for the first time, drop the
abort_not_configured flag and don't ever add it back.
- Set default values properly for frontend fields when no value is supplied.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- Merge actions is-disabled, get-frontend, get-kite and get-services into
get-config. This improves the initial startup time for FreedomBox service and
also the page load time for pagekite app. This also significantly simplifies the
code.
- Only use the pagekite service enabled status determine if pagekite is enabled.
Don't use the configuration setting.
- For custom services, provide additional data such as display URL from
get-config action. This removes the need for additional processing
prepare_service_for_display() and template tag create_pagekite_service_url.
- Also reduce the number of times configuration is retrieved to 1 when loading
the app view page and during startup of FreedomBox service.
- Ensure that all keys of the configuration always present and use that to
simplify some code.
- Remove ContextMixin from view DeleteServiceView that does not need it. Use
AppView and drop ContextMixin.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
The base template simply tries to override the description and formats its
differently. However, since the introduction of app-header.html, this was
ineffective and did nothing because blocks from included templates can't be
overridden, apparently.
Also, the base template is being used only in template as all other templates
either don't use it or have been removed since.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
If a derived view simply sets self.initial instead of overriding get_initial(),
honor it just like Django's FormView does.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
During the Info component changes, this change was accidentally made.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>