1060 Commits

Author SHA1 Message Date
mridulnagpal
e0be8094aa
minetest update 2016-12-23 10:49:11 -05:00
Sunil Mohan Adapa
6bacd6bb04
config: Minor indentation fixes 2016-11-15 19:47:21 -05:00
James Valleroy
d220fa946a
Reverse logic for clearing domain name 2016-11-06 14:05:32 -05:00
mridulnagpal
4def7dfa7f
Handle clearing of domain name 2016-11-06 13:59:26 -05:00
Sunil Mohan Adapa
4db5a35ce0
repro: Open up RTP ports
- RTP ports used for voice and video communication can span a wide range
  of ports.  Some servers seem to restrict the range.  However, repro
  does not seem to do that.  So, open up the full range.
2016-10-01 08:19:57 -04:00
Sunil Mohan Adapa
305cc3218d
xmpp: Replace jwchat with jsxc
- Update action to not configure jwchat anymore.

- Update action to not disable jwchat apache configuration.  Since the
  package is no longer installed, this could cause failures.

- Update action to no refer to jwchat in comments.

- Update jwchat-plinth Apache configuration to not include jwchat
  anymore.  Keep this file name for now instead of renaming it to
  jsxc-plinth as this would introduce additional complexity with little
  benefit.

- Install package libjs-jsxc instead of jwchat during xmpp setup.

- Create jsxc front page shortcut instead of for jwchat.

- Perform diagnostics on /http-bind/ URL needed for jwchat instead of
  /jwchat.

- Update links that launch XMPP web client.
2016-09-19 19:51:26 -04:00
Daniel Steglich
8608bf6f07
dynamicdns: Fix permissions for all /etc files
The file which contains the credentials should not be readable for
"others".
2016-09-18 16:51:31 +05:30
Daniel Steglich
367b29c50f
dynamicdns: Fix file creation with update URL
The wget command to push the current IP via update URL will download the
update URL document without deleting the HTML document afterwards. This
will cause the script to flood "/root/" folder.
2016-09-07 22:14:57 +05:30
James Valleroy
ae0bd62b1e
monkeysphere: Use raw string for re match
Update changelog.
2016-09-02 14:40:28 -04:00
Sunil Mohan Adapa
3454abdc43
monkeysphere: Allow non-root cancel of publishing
Implement killing the publish process from within the action.  Don't let
the killing be too generic to avoid potential security issues.  Kill
process only if it appears as expected.
2016-09-02 12:00:08 -04:00
Sunil Mohan Adapa
4f9b271824
monkeysphere: Make sure show keys output is robust 2016-09-02 11:59:58 -04:00
Sunil Mohan Adapa
9b89fac9e1
monkeysphere: Handle new format of uids in output
Older format was:
uid ssh://host

Newer format is:
uid [ something] ssh://host

I believe this change happened due to migration from gpg to gpg2. Adopt
our code to handle both cases.
2016-09-02 11:59:55 -04:00
Sunil Mohan Adapa
b49a03f70b
monkeysphere: Adopt to using SHA256 fingerprints
Monkeysphere was using MD5 fingerprints (without the 'MD5:' prefix).
They seem to have switched to 'SHA256' recently and started prepending
the hash with the string 'SHA256:'.  Make the module work with this
change and hopefully for future hash algorithm fixes.
2016-09-02 11:59:30 -04:00
James Valleroy
dace07cdcb
xmpp: Don't disable starttls
Fix error introduced in edecd74ccf6cc98ec0962165e20f24ba0201ee91.
2016-09-02 20:27:12 +05:30
Sunil Mohan Adapa
d2800ab6ce
xmpp: Fix hacky quoted strings in ejabberd config
- Use a parser generated data type exposed by ruamel.yaml library to get
  the necessary double-quoted strings that we want in the output file.

- Simplify reading and writing to a YAML file.

- Fix incorrect dependency of ruamel.yaml Debian package.  The correct
  one is python3-ruamel.yaml.
2016-08-28 15:07:00 +05:30
James Valleroy
edecd74ccf
xmpp: Use ruamel.yaml to modify ejabberd config 2016-08-28 09:24:03 +05:30
Sunil Mohan Adapa
d9197111d8
users: Flush nscd cache after user operations
nscd monitors files in /etc and invalidates the cache automatically when
they change.  However, for other mechanisms it recommends issuing a
manual flush in its manual page.  Flush nscd passwd and group database
caches after all user operations (not just rename operation, just to be
sure).
2016-08-27 18:02:46 -04:00
Sunil Mohan Adapa
7025cf099e
letsencrypt: Fix spelling (Dietmar) 2016-08-26 21:52:01 -04:00
Sunil Mohan Adapa
7b68dd55f2
upgrades: Run status operations as non-root
Current check whether the package manager is busy and getting the
unattended upgrades log requires root.  This will not allow Plinth to
run as non-root.  Fix this by moving the operations to actions script.
2016-08-16 18:51:37 -04:00
Sunil Mohan Adapa
afdea208ec
transmission: Read configuration as super user
Due to permission restrictions on the configuration file (due to stored
password), it is not possible to read it as plinth user.  Read it using
sudo instead.
2016-08-16 18:39:38 -04:00
Sunil Mohan Adapa
395155d306
snapshot: Use augeas for modifying fstab 2016-08-08 22:22:04 +05:30
Sunil Mohan Adapa
d615709b8a
snapshot: Improved messages and minor refactoring
- Make the default snapshot detection slightly more robust and refactor.

- Expand description to explain automatic snapshotting, etc.

- Show description even after setup.

- Show default snapshot as a bootstrap label.

- Message explaing how rollback can be undone.

- Minor updates to delete/rollback confirmation messages.

- Minor style refactoring
2016-08-08 22:21:31 +05:30
James Valleroy
5e18a648e1
snapshot: New module for disk snapshots
- Create and list filesystem snapshots. Hide "current" snapshot.

- Allow deleting snapshots, except for default subvolume.

- Allow rollback to a snapshot.
2016-08-08 22:21:21 +05:30
Sunil Mohan Adapa
8e28afe160
users: Move dpkg reconfigure to action utils
In the hope that it will be useful to other actions.  Also delete the
named temporary file after configuration.
2016-07-31 10:58:07 +05:30
James Valleroy
6c3d3888c1
Use NamedTemporaryFile for debconf override db 2016-07-30 08:49:37 +05:30
James Valleroy
956416ef37
Configure users module packages after installation
Preseeding settings with debconf won't have any effect if the packages
are already installed. Instead, provide an override database to
dpkg-reconfigure.
2016-07-30 08:49:22 +05:30
Sunil Mohan Adapa
942b23c3c3
dynamicdns: Change 'lookup' to 'look up'
The original patch Nikhil Rayaprolu had this correct.  I have
incorrectly changed it.  Fixing it.
2016-07-28 22:58:00 +05:30
Nikhil Rayaprolu
777dbbe2a7
dynamicdns: Improve label for IP Check URL 2016-07-28 22:51:29 +05:30
James Valleroy
8a6b09381f
radicale: Minor fixes for access rights config
- Fix code style.

- Keep description and util functions at module level.

- Add license notice to forms file.

- Internationalize and make choice descriptions more informative.
2016-07-24 18:54:32 -04:00
Hemanth Kumar Veeranki
c050967c92
Created an action to set argument file
regrouped forms and views into forms.py and views.py
removed code from __init__ and added them as actions
2016-07-24 18:51:23 -04:00
Sunil Mohan Adapa
038fec97a6
tor: Ability to run regular relays
- Allow users to run regular relays.  In addition to that users will be
  able to turn them into bridge relays.  Like before, by default,
  relaying is enabled and the relay type bridge relay.

- Show obfs3/4 transport ports as needing firewall port forwarding only
  if bridge relay is enabled.

- Remove pluggable transports configuration from configuration when
  bridge rely is disabled.

- Improve description message for relays and bridge relays.
2016-07-16 13:43:29 -04:00
Sunil Mohan Adapa
70001c841f
tor: Minor improvements
- Minimize loading of Augeas since it takes time.

- Make some methods private

- PEP8 fixes
2016-07-16 13:43:23 -04:00
Sunil Mohan Adapa
2afae80dd8
security: Recommend/notify about restricted logins
- Do stricter matches when editing configuration file.  Earlier
  mechanism would match comments etc.

- Move action methods to module core from views.

- During first boot, notify users that console login is restricted and
  that they can changed that from security settings.

- Recommend enabling conosle login restrictions.  Add message about why
  console restrictions are important.

- Show title in security module.
2016-07-09 22:42:20 +05:30
James Valleroy
8e96e828d9
security: New module to control login restrictions 2016-07-09 22:41:21 +05:30
James Valleroy
38382ec09c
tor: Add option to toggle bridge relay 2016-07-08 23:19:16 +05:30
James Valleroy
1c98d1272f
tor: Use single command to get status
Merge get_ports and get_hs into get_status.
2016-07-08 23:19:09 +05:30
Sunil Mohan Adapa
9ac37465dd
disks: New module to manage disks
- Show free space of currently mounted partitions.  Should help with
  people running out of free space and ending up with non-working
  system.  In future, this module could emit more visible messages.

- Show and allow expanding root partition to help people who have
  written FreedomBox images to higher capacity SD cards.  Very selective
  and restrictive checks to minimize problems.

- Automated tests to ensure expansion works in non-trivial senarious.
2016-06-19 16:20:01 -04:00
Daniel Steglich
ddc049734d
dynamicdns: Status message improvement
Closes #496.  If no update is done because no update needs to be done,
the success status needs to be written.  Because maybe the DNS record is
up to date when the action script is executed for the first time.  In
this case no success message was written and it looks like DynDNS is not
executed.
2016-06-15 22:47:23 +05:30
James Valleroy
ef40941c7c
Fix quoted values in nslcd config 2016-06-14 06:57:28 -04:00
Sunil Mohan Adapa
7a9a4cd861
packages: Switch to installing with apt-get
- Use action helper so that Plinth can run unprivilaged and action
  script can run as root.

- Use Status-Fd feature of apt-get to report progress.  Don't report
  much detail.

- Capture all stderr of the apt-get process and present it only in case
  of failure.

- Remove package installation using PackageKit.  Remove dependency on
  PackageKit.

- Merge --setup package installation with regular package installation.

This should fix the following problems:

- PackageKit throws errors when APT encounters an error and later
  corrects them and proceeds well.  This is reported upstream but not
  fixed.

- PackageKit does not install recommends by default and there is no easy
  way to tell it to do so.

- In some rare cases, PackageKit could get stuck for interactive input
  even though interactive flag is set to false.

- PackageKit does not work without network manager connections. (Could
  have been mitigated by altering packagekit configuration).

- PackageKit glib library leaks file descriptors after each operation.
  This leads to running out of fds during long running refresh
  operations such as OpenVPN setup.  (This should have subsided by not
  checking package install with the new setup mechanism.)]

Known issues:

- In development mode, inside action scripts the python modules are
  always loaded from system path and not development directory.

- With PackageKit it is possible to run multiple operations
  simultaneously.  Others would wait while the first is being
  installed.  With new implementation, the others error out unable to
  obtain lock.
2016-06-11 12:11:40 -04:00
James Valleroy
7470f64d06
Clean up ldapscript workarounds
These were for issues that have now been fixed:
https://github.com/martymac/ldapscripts/issues/3
https://github.com/martymac/ldapscripts/issues/5
2016-06-06 19:04:13 -04:00
Sunil Mohan Adapa
580522125f
users: Fix checking username in retrieving SSH key
When using username containing malicious the following method should be
safe:

- pwd.getpwnam()
- shutil.chown()
- mkhomedir_helper()
2016-06-04 12:57:56 -04:00
James Valleroy
f6884a18fa
Set privoxy listen-address by debconf preseed before install. 2016-05-25 19:23:54 -04:00
Sunil Mohan Adapa
f68a757741
users: Reorganize and make idempotent ldap setup
- Break down setup process into methods.

- Make sure that LDAP entity setup is idempotent.

- Peform all entry updates while slapd is running instead of using
  slapadd.

- Start slapd only when necessary.  Shutdown (only) if we have started
  slapd.
2016-05-21 16:06:33 -04:00
James Valleroy
401d3870f6
Move ldapscript setup to users module setup. 2016-05-21 16:06:26 -04:00
James Valleroy
f01575e2ea
Move ldap setup from freedombox-setup to plinth. 2016-05-21 16:06:18 -04:00
fonfon
bc2cba0cbf
tor: remove circular import 2016-05-11 18:19:49 -04:00
fonfon
f419c28596
Services: Explicitly use ServiceForm and ServiceView
- adapted all modules to not use views.ConfigurationView anymore
- removed templates that are not needed anymore
- no more implicit 'enabled' and 'get_status' functions in __init__.py files
- (more coherent/explicit use of Django functionality)
2016-05-11 18:19:31 -04:00
fonfon
a9528c56d9
Service object to handle services on a system-level
The Service object now offers handling services on a system level,
and gathering information whether it's enabled or running.
New methods: enable, disable, is_enabled, is_running;

For this it needs the correct (system-level) service name.
All of the methods can be overridden/customized.

This changes all modules to the new Service object and deletes
action scripts that are not required anymore.
2016-05-11 18:19:27 -04:00
fonfon
9fe49f881f
Services-Action to handle and list services managed by plinth
- API: start, stop, enable, disable, reload, is-running, is-enabled, list
- only allows access to a service if the service name is listed in a
  'managed_services' variable of any plinth module.
2016-05-11 18:19:14 -04:00