749 Commits

Author SHA1 Message Date
James Valleroy
1498a9ae83
infinoted: Use systemd sandboxing features
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2019-12-29 17:49:07 -08:00
James Valleroy
b4e00d2574
deluge: Use systemd sandboxing features
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
[sunil: Remove directive for unused logs directory]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2019-12-29 17:48:31 -08:00
Veiko Aasa
aa2aa56c46
users: Add tests for the Samba user database
Fix: after renaming a user delete old username from the Samba password database

Signed-off-by: Veiko Aasa <veiko17@disroot.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-12-29 16:59:04 -05:00
Veiko Aasa
83cb305026
samba: private shares
- new share types - group and home shares
- users: when creating, deleting or changing user password, update also Samba
  tdbsam backend database
- users: new managed packages - samba-common-bin, tdb-tools
- module page: show current samba users who are in freedombox-share group
- module page: show users who should re-enter their password in the password change page
- fix: use os.path.ismount() from Python standard library to validate a mount point
- fix: samba share permissions, fixes #1729
- fix: delete a share - do not raise an exception if the share doesn't exist
- storage: show samba share type in the directory selection form

Closes #1727

Signed-off-by: Veiko Aasa <veiko17@disroot.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-12-20 21:01:12 -05:00
Veiko Aasa
ea48f9a74b
storage: Directory selection form and validator
Directory selection allows to:
- select from default directory
- select from available Samba shares
- specify subdirectory
- insert custom directory

- directory validator checks: path exists, is directory, is readable, is writable
- samba: action script: include share path in share list
- create freedombox-share group inside users module  instead of samba module

Closes #1703

Signed-off-by: Veiko Aasa <veiko17@disroot.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-12-15 19:08:10 -05:00
Nektarios Katakis
4ff037a6cc
mumble: Add option to set SuperUser password
Closes: #1680

Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-12-10 21:13:53 -05:00
James Valleroy
f19a5b746f
minidlna: Use single action to set media dir and restart
Style config path as constant.

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2019-12-08 14:50:22 -05:00
Nektarios Katakis
b5fb23e448
run sysctl after installation
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-12-08 14:50:16 -05:00
Nektarios Katakis
3614a977f8
fix: minidlna.conf file permissions after editing
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-12-08 14:50:07 -05:00
Nektarios Katakis
ef5f5a21de
feature: minidlna app
Closes #1679

Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-12-08 14:49:21 -05:00
Veiko Aasa
e1f9dfacaa
samba: recursively set open share directory permissions
Signed-off-by: Veiko Aasa <veiko17@disroot.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-12-08 10:45:39 -05:00
Alice Kile
eb83e00011
fix formatting issues
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-12-07 13:08:35 -05:00
Veiko Aasa
d6961426ab
samba: fixes and improvements
Signed-off-by: Veiko Aasa <veiko17@disroot.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-12-01 11:30:43 -05:00
Veiko Aasa
dbdd482e61
samba: fixes and improvements
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-12-01 11:30:35 -05:00
Veiko Aasa
598bcb6fbb
samba: user can select devices for sharing
- show share also if a device is not available
 - use folder Freedombox/shares/open_share for sharing on every disk
 - backup and restore share definitions
 - fix: do not hide status block
 - fix: add nmbd to the managed services

Signed-off-by: Veiko Aasa <veiko17@disroot.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-12-01 11:30:31 -05:00
Veiko Aasa
eaaa764387
samba: Users can enable a guest share
Related to  #1681

Signed-off-by: Veiko Aasa <veiko17@disroot.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-12-01 11:30:25 -05:00
Joseph Nuthalapati
6d1b0669fb
searx: Set safe_search to Moderate by default
I remember the default being Moderate earlier. Maybe the Debian package
or upstream changed it to None. To be safe, we should set it in our
installation script too.

One problem I observed with default setting being None is that any
queries performed with this setting will be cached and a stricter
setting will not apply on the same search query. For example, if you
searched for "computer" with the default setting of None, there will be
some NSFW images returned by SearX. Setting safe_search to Moderate or
Strict later will have no effect on the search query "computer".

Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-11-18 18:28:05 -05:00
Sunil Mohan Adapa
ebe6a0ed02
tor: Listen on IPv6 for OrPort
- Fix regex for reading OrPort value from command port communication.

- Setup all new configurations for listening on IPv6 for OrPort.

- Upgrade existing configuration for listening on IPv6 for OrPort. Increment app
  version number force run setup again.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-11-15 20:14:49 -05:00
Veiko Aasa
c99b33b40e
gitweb: Allow to import from a remote repository
- Allow to enter either name or URL when creating repository

- Validate a repository URL, allow only http and https schemes

- Set autocomplete off on the name/URL field because URL may contain
  username:password

- Check whether the repository actually exists before cloning

- Show progress info while cloning

- Actions script: new subcommand check-repo-exists and new arguments
  for the create-repo: --url, --prepare-only and --skip-prepare

- Add test for invalid URLs

Closes #1670

Signed-off-by: Veiko Aasa <veiko17@disroot.org>
[sunil: Fix validating repo name in edit form]
[sunil: Don't pipe stdin of clone process, it may lead to a hang]
[sunil: Always run clone process with 'C' locale since we are parsing output]
[sunil: Cosmetic changes]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2019-11-04 21:16:30 -08:00
Joseph Nuthalapati
19d96f30e8
snapshot: Sort snapshot list from newest to oldest
Fixes #1655

Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-11-04 06:15:48 -05:00
Nektarios Katakis
ddb95752a8
ssh: Option for disabling password authentication
Closes: #572

[sunil: Reload instead of restart, fix i18n strings]
[sunil: Load augeas minimally, minor cosmetic fixes]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
2019-10-29 14:50:46 -07:00
Veiko Aasa
caa336babc
gitweb: do not change working directory inside actions script
This is a good practice and maybe related to commit 83337e47

Signed-off-by: Veiko Aasa <veiko17@disroot.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2019-10-28 11:26:32 -07:00
Veiko Aasa
ba9869c030
gitweb: Validate repository name also in actions script
This prevents writing to an arbitrary directory if running actions script
as a root user.

- Included tests for invalid names

Signed-off-by: Veiko Aasa <veiko17@disroot.org>
[sunil@medhas.org Parametrize the test case]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2019-10-28 11:22:20 -07:00
Veiko Aasa
c8eb5bb3ca
gitweb: Add tests for actions script
- add tests for create, edit and delete repository functions
- modify actions script to allow run actions without root privileges:
  - add argument --git-repo-root to overwrite the default root directory
    of repositories
  - add option --keep-ownership to the create-repo command to skip
    changing ownership to www-data
- actions script, repo-info command: instead of returning empty values,
  raise an error if the repository doesn't exist

Closes #1667

Signed-off-by: Veiko Aasa <veiko17@disroot.org>
[sunil@medhas.org Remove unneeded #! directive]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2019-10-26 21:27:28 -07:00
Matthias Dellweg
ebd3af340c
quassel: Add let's encrypt component for certficiates
Signed-off-by: Matthias Dellweg <2500@gmx.de>
[sunil@medhas.org Implement set domain as superuser action to make it succeed]
[sunil@medhas.org Minor cosmetic changes]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2019-10-21 12:09:13 -07:00
Sunil Mohan Adapa
54cf2566d8
searx, app, translation, language-selection: Fix license header
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-10-20 11:54:10 -04:00
Veiko Aasa
b86f3ff675
users: reload Apache2 to flush LDAP cache after user operations
Fixes #1660

Signed-off-by: Veiko Aasa veiko17@disroot.org
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-10-20 11:50:36 -04:00
Veiko Aasa
1b9dea4033
gitweb: New app for simple git hosting
Closes: #1658

Signed-off-by: Veiko Aasa veiko17@disroot.org
[sunil@medhas.org Minor styling and cosmetic changes]
[sunil@medhas.org Write comments for Apache configurations]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2019-10-19 19:13:54 -07:00
Sunil Mohan Adapa
a6fc4bfea3
ejabberd: Removed unused letsencrypt action
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-10-15 06:54:16 -04:00
Sunil Mohan Adapa
42b923c04e
matrixsynapse: Remove unused letsencrypt action
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-10-15 06:54:13 -04:00
Veiko Aasa
ed646d84a5
actions: Check with flake8
Also fix flake8 warnings.

Closes: #1613

Signed-off-by: Veiko Aasa <veiko17@disroot.org>
[sunil@medhas.org split multi strings differently to avoid spaces]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2019-10-10 19:08:45 -07:00
Veiko Aasa
6cd6742d8f
ikiwiki: Allow full Unicode text in wiki/blog title names
Closes: #1523

Signed-off-by: Veiko Aasa <veiko17@disroot.org>
[sunil@medhas.org Fix issue with enabling shortcuts on daemon start]
[sunil@medhas.org Run isort and yapf]
[sunil@medhas.org Prevent change in i18n string]
[sunil@medhas.org Fix flake8 warning about uniform return values]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2019-10-08 14:33:36 -07:00
Sunil Mohan Adapa
b72021782e
deluge: Support deluge 2 by starting it properly
deluge-web 1.x runs in the foreground by default and provides an option -f to
fork in the background where as deluge-web 2.x by default forks into the
background and provides option --do-no-daemonize for running in foreground.
Update systemd service to ensure that option is passed appropriately based on
the version of daemon running.

Update functional tests to accommodate UI changes in deluge-web 2.x.

Closes: #1652.

Tests:

- Install deluge 1.x by having testing in apt sources.list. Ensure that the
  daemon is working. Run functional tests.

- Upgrade deluge to 2.x by changing the sources.list and upgrading. Ensure that
  daemon is working after disable/enable. Run functional tests.

- Install deluge 2.x by having unstable in apt sources.list. Ensure that daemon
  is working. Run functional tests.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-10-05 13:36:06 -04:00
Sunil Mohan Adapa
29ae2edcd1
ejabberd: Prevent restart on freedombox startup
Closes: #1641

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-09-07 15:43:46 -04:00
Sunil Mohan Adapa
b87930406e
cockpit: Prevent restart on freedombox startup
- Add a domain only if it is not already present.

- Remove a domain only if it is already present.

- Refactor utility methods in separate module for reuse.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-09-07 15:43:43 -04:00
Sunil Mohan Adapa
7571c45184
ejabberd: Fix listen port configuration for ejabberd 19.x
Debian has a patch to configuration to change port 5443 to 5280 in ejabberd
package version 18.12. However, 5443 is the correct port to host BOSH. So,
change it back. In 19.x, this behavior has changed to use both ports 5443 (for
BOSH) and 5280 (for web administration).

Closes: #1640.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-09-07 15:35:01 -04:00
Sunil Mohan Adapa
ca8ea9427c
action_utils: Introduce utility for setting debconf answers
Tests:

mldonkey
 - Installs
 - /etc/default/mldonkey-server has LAUNCH_AT_STARTUP=true
 - systemctl status mldonkey-server shows daemon running

ejabberd
 - Installs
 - /etc/ejabberd/ejabberd.yml has domainname properly configured

privoxy
 - Installs
 - /etc/privoxy/config has listen-address set to '[::]:8118'

roundcube
 - Installs and works
 - /etc/roundcube/debian-db.php contains dbtype sqlite3

ttrss
 - Installs and works
 - /etc/ttrss/database.php has dbtype 'pgsql'.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-08-31 08:24:59 -04:00
Sunil Mohan Adapa
68bc333842
updates: Allow matrix-synapse 1.3 to be installed for buster users
- matrix-synapse 1.2 is already unavailable in buster-backports, testing and
  unstable. It is replaced by matrix-synapse 1.3. Allow matrix-synapse 1.3 to
  become available for Buster users.

- Allow upgrades to all future versions of matrix-synapse from buster-backports.
  Since buster-backports does not have security updates except that provided
  by the maintainer, it is best to let users be on the latest version provided
  by the maintainer in buster-backports.

- We don't pick and choose among the versions uploaded to backports. Once we
  allow a package to upgrade to backports version, we should continue to do that
  without any further restriction. Update descriptions accordingly.

- Simplify updating the apt preferences file by providing a simple configuration
  instead of creating the file on the fly.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-08-25 17:41:58 -04:00
Sunil Mohan Adapa
caa266e348
users: Don't fail badly when admin group does not exist
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-08-25 15:52:08 -04:00
Sunil Mohan Adapa
7499b687c8
users: yapf cosmetic changes
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-08-25 15:52:00 -04:00
Joseph Nuthalpati
9b46d1a661
matrix-synapse: Allow installation of version 1.2 from backports
Used version pinning instead of release pinning to avoid unexpected upgrades for
users running FreedomBox stable.

Explanation for backports:
This fixes incompatibility issues with newly created rooms on Matrix Synapse
versions 0.99.5 and above. Users on stable using 0.99.2 might not be able to
join those rooms, especially direct chats.

Fixes #1600

Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-08-20 20:14:36 -04:00
Sunil Mohan Adapa
0dba497383
ejabberd: Use domain added signal for listening to domain changes
In the action, the new domain is always extended to the list of domain names
accepted by ejabberd. To simplify domain handling simply use the domain_added
signal.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-08-11 18:40:06 -04:00
Sunil Mohan Adapa
0d0ee32a87
ejabberd: Ensure that hosts are not duplicated in configuration
This is non-essential as there seems to be no problem for ejabberd with
duplicated host names.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-08-11 18:40:04 -04:00
Sunil Mohan Adapa
76725a0068
cockpit: Don't error out when removing an unknown domain
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-08-11 18:40:02 -04:00
Sunil Mohan Adapa
8ece36893c
letsencrypt: Revoke certificate only if it exists
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-08-11 18:39:58 -04:00
Sunil Mohan Adapa
c3a3d80ea5
storage: yapf changes
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-08-07 05:40:07 -04:00
Sunil Mohan Adapa
8b96ea0698
storage: Fix incorrect i18n when throwing and error
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-08-07 05:40:00 -04:00
Joseph Nuthalapati
654d69a389
sharing: Simplify --is-public option
Use store_true with default=False to toggle public status based on whether
'--is-public' argument is passed or not.

Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-07-22 17:56:50 -04:00
Joseph Nuthalapati
1eec1cf9ce
sharing: Allow directories to be publicly shared
Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-07-22 17:56:35 -04:00
Sunil Mohan Adapa
49b543599a
ejabberd: Add let's encrypt component for managing certificates
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
2019-07-16 15:13:44 +05:30