1060 Commits

Author SHA1 Message Date
James Valleroy
75d6b667ba
radicale: Create collections folder before starting uwsgi
Workaround for https://bugs.debian.org/919339

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2019-01-14 20:32:44 -05:00
Sunil Mohan Adapa
3e98930f94
radicale: Don't keep radicale service running
- uwsgi service is sufficient to handle radicale2. Disable radicale service for
  radicale2.

- Use action utils to deal with uwsgi configuration management.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-01-14 19:51:34 -05:00
Sunil Mohan Adapa
bed43564c3
searx: Use action utils for uwsgi configuration management
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-01-14 19:51:30 -05:00
James Valleroy
72b59c0190
radicale: Switch to uwsgi for radicale 2.x
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2019-01-14 19:51:21 -05:00
Sunil Mohan Adapa
2c51165f99
firewalld: Flush iptables rules before restarting firewall
This is a workaround for the problem that when restarting firewalld with
iptables backend, flushing fails and starting with nftables also fails requiring
a restart to recover the problem.

Fixes #1440.

Reviewed-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
2019-01-11 23:16:15 +05:30
Sunil Mohan Adapa
12ea72eb0a
snapshot: Refactor configuration migration
- Only do the configuration based on version run the remaining setup code
  without considering version.

- Don't force upgrade/setup configuration when doing from version 4 and above.

- Force set cleanup=yes values during migration too.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
2019-01-08 14:01:34 -08:00
Joseph Nuthalapati
4fdd68cb3b
snapshot: Merge the functionality of the migrate command into setup
- Added a command-line argument called --old-version to the setup command based
  on which it can decide whether to do a new setup or a migration.
- Removed the migrate command.

Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2019-01-08 13:59:56 -08:00
Joseph Nuthalapati
ad049af276
snapshot: Enable TIMELINE_CLEANUP and NUMBER_CLEANUP by default
Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2019-01-08 13:59:30 -08:00
Joseph Nuthalapati
f68070c758
snapshot: ui: Remove NUMBER_MIN_AGE setting and add FREE_LIMIT
The free space limit value is allowed to a maximum of 60%, since setting the
it to a value higher than possible will effectively disable snapshotting.

Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org
2019-01-08 13:59:15 -08:00
Joseph Nuthalapati
8ba0bda869
snapshot: Fix snapshots filling up the disk
- Snapper's cleanup algorithms don't apply limits unless they are specified in
the form of ranges. Changed all limit values in the configuration to ranges.
- Also, all MIN_AGE values have been set to 0 to avoid the disk space filling up
in case of a large number of snapshots generated in a very short amount of time.
- FREE_LIMIT has been increased to 30% from the default 20% since backup
archives also take up disk space on the root partition.

Fixes #1435

Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2019-01-08 13:57:46 -08:00
Sunil Mohan Adapa
7cf279ccd0
radicale: Redirect to well-known URLs according to version
- Radicale 1 needs to have /radicale/.well-known/*dav to the URLs where as
  Radicale 2 needs to have /radicale to be the URLs. Hence have two separate
  apache configuration files.

- Use expr= when setting X-REMOTE-USER header to set the authenticated user name
  properly. Without this all users are using a single user '(null)' data.

Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-01-06 17:58:00 -05:00
James Valleroy
49acfa5ad1
radicale: Add support for radicale 2.x
- Remove obsolete base_prefix and well-known configs.
- Use http_x_remote_user auth type.
- Rewrite /radicale to /radicale/.
- Add ProxyPassReverse.
- Set X-Script-Name and X-Remote-User request headers.

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2019-01-06 17:57:56 -05:00
James Valleroy
1b4d42cd53
radicale: Don't modify default file for radicale >= 2.1.10
/etc/default/radicale is not used in radicale 2.1.10-1 and later.

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2019-01-06 17:57:50 -05:00
Sunil Mohan Adapa
91ba56e3ce
letsencrypt: Use macros for configuring sites
Makes it trivial to alter site configuration for all domains at once. Also
possible to easily switch to TLS modules other than mod_gnutls.

Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2018-12-26 09:20:05 -05:00
Michael Pimmer
bb95229a91
Backups: unittests for accessing repository with borg directly
- adapt action and write tests for accessing a borg repo directly
  via borg+ssh, without mounting it
- some docstring updates

Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2018-12-13 18:28:51 -05:00
Michael Pimmer
fc9e406bf8
Backups: allow using keyfile as credentials for sshfs mounts
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2018-12-13 18:28:44 -05:00
Michael Pimmer
3724dac9e6
Backups: Cleanup and improved error handling
- fixes issues as supposed by jvalleroy
- new repositories always get a UUID so they can immediately be fully
  used (mounted, queried etc) also before saving them
- remove test connection page -- errors are shown on form submission
- improved error handling when creating remote repositories

Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2018-12-13 18:28:24 -05:00
Michael Pimmer
eab8991b54
Backups: support for encrypted repositories
- implement download, restore, delete archives of encrypted
  repositories
- change how BorgRepository and SshBorgRepository handle path
- when/before creating remote repositories, check whether the
  connection works
- updated tests

Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2018-12-13 18:28:17 -05:00
Michael Pimmer
c223250569
Backups: remove unittests to backups test directory
And add one bugfix to reset cfg.actions_dir after changing it

Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2018-12-13 18:28:00 -05:00
Michael Pimmer
15e26caa23
Backups, remote repositories: create/delete/restore of remote repos
- updated unittests
- implemented create/delete/restore remote archives

Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2018-12-13 18:27:48 -05:00
Michael Pimmer
cf6bbd6bba
Backups, remote repositories: use object-oriented repositories
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2018-12-13 18:27:42 -05:00
Michael Pimmer
3a8b69fc82
Backups, remote repositories: start using sshfs
- actions to mount/umount via sshfs
- tests

Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2018-12-13 18:27:31 -05:00
Michael Pimmer
4be1b0be76
Backups, remote repositories: uniform parameter handling
- introduce env_vars in backups script and access_params for more
  uniform handling of access parameters
- added tests for creating and deleting an archive

Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2018-12-13 18:27:27 -05:00
Michael Pimmer
0e2489ec23
Backups, remote repositories: implement init, info and some test
- added functionality to use remote repositories
- added some tests

Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2018-12-13 18:27:22 -05:00
Michael Pimmer
4eeceaa695
Backups: allow testing the connection of ssh locations
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2018-12-13 18:27:17 -05:00
Joseph Nuthalapati
9e4fb5eb59
apache: Switch to php-fpm from mod_php
Also try to automatically work for future versions of PHP.

Fixes #1413
Fixes #1258

Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2018-12-13 18:24:47 -05:00
Joseph Nuthalapati
3c68a52056
firewalld: Use nftables instead of iptables
restart service after setting the firewall backend

Fixes #1400
Fixes #1430

Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2018-12-03 18:22:11 -05:00
Joseph Nuthalapati
055e40820c
snapshots: Fix default snapshot listing
The latest snapper returns the currently active snapshot like "4*", which
interferes with both the urls and the templates. Stripping off the unnecessary
asterisk since we have better ways of detecting what the currently active
snapshot is.

Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2018-12-02 11:08:01 -05:00
James Valleroy
13646d58d5
ejabberd: Change BOSH port from 5280 to 5443
This is the default for new installs of ejabberd, starting with
version 18.09-1. For existing installs from previous versions, the
config must be upgraded to use the new port.

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
2018-11-24 17:48:13 +05:30
Joseph Nuthalapati
43e7633868
openvpn: Always write the latest server configuration on setup
This takes care of the case where a user has tried the "setup" step and
failed. The new configuration will overwrite the old one.

Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2018-11-19 07:46:38 -05:00
Joseph Nuthalapati
3a579e2d72
openvpn: is-setup checks for non-empty dh.pem file
Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2018-11-19 07:46:31 -05:00
Joseph Nuthalapati
d5a73aaac4
openvpn: Migration from easy-rsa 2 to 3
Fixes #1318
Fixes #1327

Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2018-11-19 07:46:27 -05:00
Michael Pimmer
e2584be45d
Backups: Make Manifest a dict instead of a list
So it's possible to add more information like metadata etc.

Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2018-11-18 13:58:41 -05:00
Joseph Nuthalapati
187d10592c
sso: Make auth-pubtkt tickets valid for 12 hours
Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2018-11-18 11:49:24 -05:00
Michael Pimmer
8cc74bd203
Backups: minor cleanups
- some variable names, indentation and documentation changes
- removed unused backups action
- changed name of upload session variable to 'fbx-backups-upload-path'

Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2018-11-17 09:00:26 -05:00
Michael Pimmer
1f9bb624e8
Backups: Stream archive downloads/exports
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2018-11-17 09:00:13 -05:00
Michael Pimmer
b92b66b7e9
Backups: clean up forms, names and templates
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2018-11-17 08:59:59 -05:00
Michael Pimmer
50e0bae67c
Backups: relative paths for borg extract in action script
'borg extract' expects relative paths as patterns for PATH(s)

Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2018-11-17 08:59:46 -05:00
Michael Pimmer
35305d5e37
Backups: clean up exporting archives functionality
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2018-11-17 08:59:40 -05:00
Michael Pimmer
a350ab200e
Backups: Dont fail when borg doesn't find files to extract
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2018-11-17 08:59:35 -05:00
Michael Pimmer
c770a7adfb
Backups: Restore directly from archive
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2018-11-17 08:59:29 -05:00
Michael Pimmer
ff673b0d73
Backups: export and download archives in one step
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2018-11-17 08:59:03 -05:00
Joseph Nuthalapati
ed09028fcd
udiskie: unmount drive as superuser
Since storage devices are auto-mounted as root, they also need to be unmounted
as root.

The assumption here is that this wouldn't have any impact on being able to
write to the devices.

Fixes #1411

Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2018-11-05 18:07:29 -08:00
Michael Pimmer
525638357f
Actions: use local plinth in development mode
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2018-10-31 20:24:30 -04:00
Joseph Nuthalapati
f132b2ada9
monkeysphere: yapf reformatting
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2018-10-29 23:22:24 -04:00
Joseph Nuthalapati
23110df2dd
monkeysphere: Handle importing new OpenSSH format keys
OpenSSH 7.8 and above use OpenSSH key format instead of the earlier PEM format
by default for RSA keys. This format is not understood by openssl/monkeysphere
yet. Convert it to PEM before importing into monkeysphere.

Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2018-10-29 23:22:18 -04:00
Joseph Nuthalapati
37d84c0f50
upgrades: Add functional tests
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2018-10-29 23:22:05 -04:00
James Valleroy
30fd4015b7
snapshot: Handle snapper list output change
Fixes #1408.

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
2018-10-25 15:11:32 +05:30
James Valleroy
edcf4a5619
backups: Handle permission error during chown
This happens on FAT file systems, where chown operation is not
possible.

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2018-10-22 18:19:02 -04:00
Joseph Nuthalapati
6be6b847fd
backups: Make plinth the owner of the backup archives
Changing the ownership of the backup archives from "root" to "plinth" fixes the
permission errors when downloading backup archives.

Fixes #1402

Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2018-10-22 18:17:01 -04:00