1516 Commits

Author SHA1 Message Date
Joseph Nuthalapati
884b1c67fb
sharing: Indicate public shares in listing of shares
Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-07-22 17:56:52 -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
9fc8c3604c
sharing: Add JavaScript to hide user groups for public shares
- User groups will only be shown when the shares are not public.
- Checking the checkbox for public shares hides the user groups.
- Unchecking the checkbox for public shares shows the user groups.

Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-07-22 17:56:47 -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
b0d797a84a
Minor yapf and isort changes
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-07-21 09:06:04 -04:00
Sunil Mohan Adapa
0f807bcd48
sso: Use new features of axes, log axes messages
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-07-21 09:05:58 -04:00
Sunil Mohan Adapa
de146b9678
ejabberd: Backup and restore TLS certificates
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
2019-07-16 15:13:50 +05:30
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
Sunil Mohan Adapa
9fd1b95244
matrixsynapse: Add let's encrypt component for certficiates
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
2019-07-16 15:13:35 +05:30
Sunil Mohan Adapa
c47a99b25e
apache: Add let's encrypt certificate component
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
2019-07-16 15:13:28 +05:30
Sunil Mohan Adapa
254b8a98a9
letsencrypt: Handling certificate renewals when daemon is offline
During boot or in other situations when FreedomBox Service is offline, Let's
Encrypt certificate renewals might happen. When FreedomBox Service starts, check
on such certificates and run certificate setup mechanism in each app to use the
latest renewed certificate.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
2019-07-16 15:13:21 +05:30
Sunil Mohan Adapa
9c6efad55d
letsencrypt: Implement re-obtain separately
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
2019-07-16 15:13:13 +05:30
Sunil Mohan Adapa
8cae72c441
letsencrypt: Trigger events for obtain, revoke and delete
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
2019-07-16 15:12:52 +05:30
Sunil Mohan Adapa
c33c44eea0
letsencrypt: Trigger renewal certificate events in component
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
2019-07-16 15:12:44 +05:30
Sunil Mohan Adapa
c54a75f85c
letsencrypt: Add permanent hook to receive renewal notifications
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
2019-07-16 15:12:34 +05:30
Sunil Mohan Adapa
e24a76e1b7
letsencrypt: Introduce component for handling certificates
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
2019-07-16 15:12:25 +05:30
Sunil Mohan Adapa
965f7101f6
letsencrypt: Implement DBus service for renewal notifications
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
2019-07-16 15:11:41 +05:30
Sunil Mohan Adapa
50c0858d53
letsencrypt: Remove special treatment for domain added from 'config'
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
2019-07-16 15:11:23 +05:30
Sunil Mohan Adapa
39e250fb8e
letsencrypt: Remove deprecated logger.warn
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
2019-07-16 15:11:12 +05:30
Sunil Mohan Adapa
486f91d129
letsencrypt: Remove old style hooks from all configuration files
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
2019-07-16 15:10:56 +05:30
Sunil Mohan Adapa
d8647aaf18
letsencrypt: Remove renewal hooks implementation
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
2019-07-16 15:10:38 +05:30
Sunil Mohan Adapa
a126414a42
dynamicdns: Send domain added signal properly during init
Due a missing dependency on 'names' app, 'dynamicdns' app could be initialized
before 'names' app. This will lead to domain_added signal by dynamicdns being
ignored. Dynamic DNS domain name will not be make it into the list of global
domains.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
2019-07-16 15:10:07 +05:30
Sunil Mohan Adapa
4ea2fa499c
cockpit: Don't handle domains if app is not installed
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
2019-07-16 15:09:59 +05:30
Joseph Nuthalapati
c952dc7a99
backups: Change "select all" to a pure JavaScript implementation
- Remove Python code to handle the extra item in the submitted form
- The select-all checkbox is never submitted in the form since it is missing the
  "name" attribute
- Replace selector ':checkbox' with the faster selector '[type=checkbox]'

Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-07-13 06:37:43 -04:00
Joseph Nuthalapati
061c308e35
backups: Add option to select/deselect all apps for backup or restore
This is less tiresome for users and also improves the speed of functional tests.

Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-07-13 06:37:39 -04:00
Sunil Mohan Adapa
2c721659f4
backups: Un-mount SSH repositories before deleting them
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
2019-07-03 12:45:28 +05:30
Sunil Mohan Adapa
6821d73025
backups: Minor cleanup
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
2019-07-03 12:45:20 +05:30
Sunil Mohan Adapa
dd5d93637f
backups: Don't send passphrase on the command line
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
2019-07-03 12:44:54 +05:30
Sunil Mohan Adapa
fa3e2ea86b
backups: Fix issue with verifying SSH host keys
Ensure that the fingerprint accepted is the one verified by user. If they
fingerprints and public keys are retrieved separately, there is chance that what
was verified by the user is not what is added to the known hosts file.

- Avoid creating a temporary file when fetching keys

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
2019-07-03 12:44:43 +05:30
Sunil Mohan Adapa
463c620c65
backups: Remove known_hosts file from config file
- There is no compelling reason to make the file configurable. Simplifies
  configuration file if we make it relative to FreedomBox data directory.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
2019-07-03 12:44:34 +05:30
Sunil Mohan Adapa
76efccce37
backups: Fix and refactor adding a new remote repository
- Fix encrypted repositories getting created without encryption.

- Set verified=False by during save operation for safety.

- Handle common error scenarios and show proper messages. Such as authentication
  failure.

- Use pathlib to simplify file handling code.

- Split nested code for readability and do better function splits.

- Expand ~ only if it is at the beginning of the path.

- Allow empty repository path as allowed by SSH.

- Don't internationalize log messages.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
2019-07-03 12:44:18 +05:30
Sunil Mohan Adapa
f2ea0b9065
backups: Require passphrase for encryption in add repository form
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
2019-07-03 12:44:09 +05:30
Sunil Mohan Adapa
2a2cc41f1d
backups: Handle SSH keys for old stored repositories
- Assume that their SSH public keys are not unverified.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
2019-07-03 12:44:01 +05:30
Sunil Mohan Adapa
661a00198e
backups: Minor styling changes
- Add docstrings.

- Add blank lines for extra readability.

- Use <span> instead of <i> tag for icon in template.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
2019-07-03 12:43:49 +05:30
Sunil Mohan Adapa
984b7dca88
backups: Cleanup auto-mounting SSH repositories
Remove auto-mounting of repositories during instantiation entirely. It is better
to explicitly mount later.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
2019-07-03 12:43:40 +05:30
Sunil Mohan Adapa
9c8674baa3
backup: Allow SSH directory paths with : in them
- From SSH manual, a path may contain : if it is presented as absolute path.
  Update regular expression for splitting accordingly.

- Allow Null paths similar to SSH.

- Perform a full regular expression match when splitting path.

- Simplify regular expression.

- Update tests.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
2019-07-03 12:43:28 +05:30
Sunil Mohan Adapa
c8a292d308
backups: Minor fixes to host verification view template
- Remove <br> tags. They have no semantics and should be replaced with uniform
  styling.

- Minor changes to messages.

- Remove <p> tags from internationalized messages.

- Rename button label from ' Verify ' to 'Verify Host'. Extra spaces are
  incorrect.

- Fix indentation.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
2019-07-03 12:43:12 +05:30
Joseph Nuthalapati
bd1874d774
backups: Add regex validation for ssh_repository field
Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
2019-07-03 12:43:08 +05:30
Joseph Nuthalapati
2c97e1e02e
backups: Read file path of known_hosts directly from plinth.config
Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
2019-07-03 12:43:02 +05:30
Joseph Nuthalapati
795ed9d735
backups: Remove unnecessary context manager for paramiko SFTPClient
Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
2019-07-03 12:42:56 +05:30
Joseph Nuthalapati
9f71c5867e
ui: Create reusable CSS class for collapsible-button
.collapsible-button is used by both "Client Apps" and the "How to verify?"
button in backups:verify-ssh-hostkey page.

Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
2019-07-03 12:42:48 +05:30
Joseph Nuthalapati
3a6dcbe7a7
Verify SSH hostkey before mounting
Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
2019-07-03 12:42:41 +05:30
Joseph Nuthalapati
de7275d4a5
backups: ssh remotes: Refactoring
- Make url scheme consistent
- Add an FA icon to the drop-down button in VerifySshHostkeyView
- Refactoring to reduce code duplication

Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
2019-07-03 12:42:31 +05:30
Joseph Nuthalapati
0b43caf81d
Add SSH hostkey verification
Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
2019-07-03 12:42:25 +05:30
Joseph Nuthalapati
f85e7829b9
backups: tests: Fix issue with usage of fixture 'needs_root'
Fixtures cannot be currently included into other fixtures by using
@pytest.mark.fixtures('fixture_name')
They have to be included as parameters instead.
See bug: https://github.com/pytest-dev/pytest/issues/3664

Also increase the scope of needs_root to the highest, i.e. session, so that it
can be used by any kind of fixture.

Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
2019-07-03 12:42:20 +05:30
Joseph Nuthalapati
f4f9e2c465
backups: Skipping tests temporarily
Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
2019-07-03 12:42:14 +05:30
Joseph Nuthalapati
ee21dcfbb8
backups: Avoid using sudo in tests
Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
2019-07-03 12:42:10 +05:30
Joseph Nuthalapati
d451b54286
backups: Add test for adding ssh remotes
Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
2019-07-03 12:42:02 +05:30
Joseph Nuthalapati
95f9f5c712
backups: Minor refactoring in forms.py
Break up clean() into multiple private methods

Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
2019-07-03 12:41:56 +05:30
Joseph Nuthalapati
56babf5cb4
backups: Fix issue with repository not being initialized
Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
2019-07-03 12:41:48 +05:30