86 Commits

Author SHA1 Message Date
Sunil Mohan Adapa
2df02b059c
dbus: Add new module for D-Bus services
- Implement listening for CacheUpdated notification.

- Configuration to allow only root to trigger the notification.

- Trigger the notification from an apt update hook.

- Retrieve the list of packages available for upgrade and print them to log.

- Add dependency on libglib2.0-bin for the gdbus command line tool.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-02-26 06:24:05 -05:00
Sunil Mohan Adapa
2b45a8cff9
mldonkey: Add systemd service file with security options
- This solves the problem with init that causes the daemon not to stop.

- The file is installed with same name as init script so as to make sure init
  script become overridden.

- It is installed in /lib/systemd/system/mldonkey-server.service.d/ so
  that this service file can one day be upstreamed and at that time it
  does not conflict with freedombox package carrying the same file.

- Add strict security options.

- Tested by watching mldonkey logs, doing some searching and downloading from
  the UI.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-02-09 13:31:51 -05:00
Sunil Mohan Adapa
5a159f7d39
upgrades: Improve handling of backports
- Merge backports functionality into upgrades module.

- No need to enable systemd timer as dh_installsystemd automatically enables
  this during package installation and upgrade.

- Use https:// and deb.debian.org for repository checking. When using Tor for
  package installations request the URL via Tor.

- Make daily checking service more generic for all kind of future apt repository
  updates.

- Force removal of repository file during purge to avoid failures.

- Don't add contrib/non-free as backports is intended to be enabled for just the
  freedombox package and it is free. When the need arises, we can introduce
  contrib/non-free. This also eliminates an issue that adding these components
  doesn't work without the usage of tor.

- Allow generate apt preferences file to avoid lintian complaining about its
  presence. Remove on purge.

- Add unattended upgrades origin pattern to allow it to upgrade from backports
  repositories.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
2019-02-05 14:58:55 -08:00
Joseph Nuthalapati
3d38b8a686
backports: Add buster-backports to apt sources list
Fixes freedombox-team/freedom-maker#149

Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2019-02-05 14:58:27 -08:00
Sunil Mohan Adapa
f113a3bfc9
fail2ban: Split and update configuration files
- Easy to configure for separate services.

- Unique names ensure that system administrator FreedomBox configuration files
  don't conflict with system administrator created ones.

- Set maximum attempts to 10 globally instead of 5.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
2019-01-24 14:20:27 -08:00
Prachi Srivastava
760fa77b70
fail2ban: Enable bans for apache auth failures
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2019-01-24 13:41:09 -08:00
Sunil Mohan Adapa
5f8965df25
debian: Rename plinth package to freedombox
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2018-12-31 15:59:08 -05:00
Sunil Mohan Adapa
2e8d28c7f8
Move update-motd script from freedombox-setup
Significant re-indentation due to yapf.

Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2018-12-31 15:58:22 -05:00
Sunil Mohan Adapa
35c70861dc
logging: Remove references to old log files
- Remove access/error log references in configuration files and tests.

- Ensure that /var/log/plinth directory is not created anymore.

Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2018-12-30 13:45:23 -05:00
Joseph Nuthalapati
faf5f5bc6c
customization: Don't install files in /var/www
- Use the directory for service custom static files only if it exists.
- This fixes issue with lintian complaining of installing files in /var/www.

Closes #1399

Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
2018-10-09 11:30:30 +05:30
Joseph Nuthalapati
5e06017e5c
customization: Serve custom shortcuts through the REST API
Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2018-10-08 20:30:24 -04:00
Joseph Nuthalapati
e1d3497886
customization: Create customization path in /var/www
Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2018-10-08 20:30:20 -04:00
James Valleroy
32727e23d5
Cleanup udiskie module
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2018-09-24 19:39:19 -04:00
Joseph Nuthalapati
0583787a68
upgrades: Clean up old kernel packages during automatic upgrades
The unattended-upgrades package removes older kernel packages before
starting the upgrade process, so that the current kernel and the newly
installed kernel will be retained and all older kernel packages will
be removed.

The removal of older kernel packages requires "apt autoremove" to list
them. So, a setting to enable autoremoval of packages has been turned
on as well.

When tested on a vagrant box, the current kernel 4.17.0.1 and the new
kernel 4.17.0.3 have been retained. Older kernels were removed
preemptively before the installation of 4.17.0.3

Fixes #1372

Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2018-09-08 08:58:20 -04:00
Joseph Nuthalapati
e30364a510
mediawiki: Override Debian settings in FreedomBoxSettings.php
Avoiding manual edits to LocalSettings.php by overriding the configuration in
another file called FreedomBoxSettings.php and including it in
LocalSettings.php. This avoids bugs and makes configuration changes trivial.

Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
2018-07-23 17:35:05 +05:30
James Valleroy
08eeace30f
udiskie: New module for automatic mounting of removable media
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2018-07-02 19:00:32 -04:00
Sunil Mohan Adapa
1da594c32d
Support Django 2.0
This is the final change required for Django 2.0 support. Instead of using
MIDDLEWARE_CLASSES use MIDDLEWARE setting. Support for new style middleware was
provided in version 0.3.0, so depend on that version. Django built-in middleware
already supports new style and plinth middleware will now support new style.

The actual semantics of the middleware don't need changes. See:
https://docs.djangoproject.com/en/2.0/topics/http/middleware/#upgrading-pre-django-1-10-style-middleware

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2018-03-12 17:27:26 -04:00
Sunil Mohan Adapa
67d6a0508c
setup.py: Update website to freedombox.org
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2018-02-16 20:11:30 -05:00
Sunil Mohan Adapa
375592de7b
setup.py: Update Plinth Authors -> FreedomBox Authors
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2018-02-16 20:11:23 -05:00
Sunil Mohan Adapa
8f4811b350
Rename Plinth to FreedomBox in more module doc strings
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2018-02-16 20:10:31 -05:00
Sunil Mohan Adapa
dea4af17fb
Rename Plinth to FreedomBox in license headers
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2018-02-16 20:10:09 -05:00
Joseph Nuthalapati
d30ba771c3
Complete some of the pending changing in renaming some files to .md
In commit d4b4791, four files were renamed by adding a file extension .md
The files are CONTRIBUTING, COPYING, HACKING and INSTALL
This commit fixes the pending tasks and especially the bug where HACKING.md is
wrongly listed as HACKING in debian/plinth.docs and cause build failure for the
Debian package of Plinth

Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2018-01-05 13:06:31 +05:30
Sunil Mohan Adapa
1fe9bb317a
avahi: Remove duplicate service installation code
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
2017-12-01 15:59:58 +05:30
Prachi Srivastava
bf9af37d17
avahi: Add service for freedombox discovery
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2017-12-01 15:44:29 +05:30
Joseph Nuthalpati
62f26433e8
Add django-simple-captcha in the login page
User will be shown captcha in the second attempt to login if login
fails in the first attempt.

Signed-off-by: Joseph Nuthalpati <njoseph@thoughtworks.com>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2017-10-17 22:07:12 -04:00
Sunil Mohan Adapa
24b1ab47ce
Update Django version to 1.11 in Travis and setup files
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
2017-10-11 10:01:24 +05:30
Sunil Mohan Adapa
e8e8fe0bd9
setup: Remove freedombox-setup related scripts
From freedombox-setup all the setup mechanisms and first-run mechanisms have
been removed. This script no longer does anything and is not needed. Ensuring
that the directories have proper permissions is now the duty of Plinth Debian
packaging.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Signed-off-by: Joseph Nuthalpati <njoseph@thoughtworks.com>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2017-10-07 07:14:02 -04:00
Sunil Mohan Adapa
d6f79b96be
Move Avahi files from freedombox-setup
Avahi daemon is being managed in Plinth, so it makes sense for Plinth to be
providing the service files. Service files can be managed so that when service
is not available, it is not advertised using Avahi.

Install service files.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
Signed-off-by: Prachi Srivastava <prachi@swecha.net>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2017-10-04 19:19:11 -04:00
Todd Turner
8ff47adb38
Remove creation of first-run.d directory
Reviewed-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
2017-09-29 14:23:11 +05:30
abilashr
81fde34254
Rename Disks and Snapshots in Configuration tab
- Rename Disks to Storage
- Rename Snapshot to Storage Snapshots

Reviewed-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
2017-09-27 09:39:34 +05:30
Joseph Nuthalpati
08e84001a8
Diaspora: Disable for release 0.15.2
diaspora* is no longer installable from Debian
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=872305

Signed-off-by: Joseph Nuthalpati <njoseph@thoughtworks.com>

Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2017-08-16 19:38:18 -04:00
James Valleroy
bf7bde18c2
Sync requirements.txt with setup.py
Reviewed-by: Joseph Nuthalpati <njoseph@thoughtworks.com>
2017-08-10 10:16:36 +05:30
nsaikiran
09f3f23e10
[#846] Remove disabled apps as part of install 2017-07-26 21:36:27 -04:00
Sunil Mohan Adapa
3f57863a69
syncthing: Update Apache configuration
- Redirect /syncthing to /syncthing/ as the daemon does not work
  without a slash at the end.

- Create a separate include file for LDAP authentication
  configuration that can be included on other app configurations.
2017-03-23 15:09:37 +05:30
James Valleroy
413256569d
Style changes
Update changelog.
2017-01-26 12:33:32 -05:00
Marko Mackic
6f455d6afc
Remove dir_util copy_tree 2017-01-26 12:33:26 -05:00
Marko Mackic
bb6e164d2a
Add line brake to infinoted title 2017-01-26 12:33:23 -05:00
Marko Mackic
8ba763bf5a
Folders overwrite, shaarli.png added to static files 2017-01-26 12:33:04 -05:00
James Valleroy
d639990894
setup.py: Install all first-run scripts for freedombox-setup 2017-01-20 16:51:48 +05:30
James Valleroy
c8cfcd03d9
Include module static files in build
"./setup.py install" already handles this correctly, but needs to be
explicity listed for git-buildpackage to include the files in the
debian package.
2016-10-01 08:59:51 +05:30
Sunil Mohan Adapa
5a04d8057e
networks: Add polkit rules for network management
Allow Plinth to manage network connections even when running as 'plinth'
user and not root user.  This is done by adding polkit rules that
Network Manager checks

- Add new style Javascript based rules file for newer versions of
  polkit (>105). This is not fuly tested.

- Add old style .pkla file for older versions of polkit (<=105).
2016-09-09 19:47:41 -04:00
James Valleroy
548e0ebd60
Add --setup-no-install command
Acts the same as --setup, but does not install any packages. Will
raise an error if any required package is not already installed.
2016-09-03 10:02:54 +05:30
James Valleroy
edecd74ccf
xmpp: Use ruamel.yaml to modify ejabberd config 2016-08-28 09:24:03 +05:30
Sunil Mohan Adapa
f19ad2b2cb
Bump required version of Django to 1.10
Since Debian testing now has Django 1.10.  There is no necessity to
support older versions of Django.  The fix for showing menu items does
depend on a small feature that is introduced in Django 1.10:
django.setup(set_prefix=True) and FORCE_SCRIPT_NAME.
2016-08-11 18:02:41 -04:00
Sunil Mohan Adapa
6cf1cc72b9
networks: Ability to configure for BATMAN
Add a dispatcher script to NetworkManager to configure
B.A.T.M.A.N. Advanced interfaces.  This quite a bit hacky at it is
triggered for network connections that have the keyword "BATMAN" in
them.  The proper way to implement this is as a core change in
NetworkManager itself (as it lacks plugins).  It is done is the hope
that it will garner some more interest in FreedomBox for mesh networks.

Currently, it is possible to create a BATMAN mesh network and shared
existing internet connections on it.  Other boxes can then join this
mesh network and use that internet connection.

Known issues:

- Very unintuitive setup process.  First create a connection with device
  a Wi-Fi device, mode as ad-hoc, with a known frequency and BSSID.  The
  name of the connection should have contain BATMAN in it.  It should
  also have IPv4 method as disabled.  Second connection should be
  created for 'bat0' interface after the first on is successful.  It can
  be with method 'shared' for sharing internet connection and doing DHCP
  requests or 'auto' for aqcuiring IP address from another node in the
  mesh network.

- Untested for joining existing mesh networks.

- Requires configuring two network connections and the second one needs
  to be manually enabled after the first one is successfully activated.
2016-07-21 19:23:34 -04:00
Sunil Mohan Adapa
1f53321b51
Don't use init.d file, don't daemonize
We pretty much only run in systemd environment and I don't see that
changing any time soon.  By relying on it, we can reduce some burden.
Remove init script.

Daemonizing is not needed for systemd.  Remove code related
daemonization.
2016-05-29 20:32:12 +05:30
Sunil Mohan Adapa
7b8b12dc20
users: Move PAM configs over from freedombox-setup
Since we are running PAM update script from users action file, it is
appropriate for the PAM configurations that are effected by it to stay
here in Plinth as well.
2016-05-21 16:06:36 -04:00
James Valleroy
a6417c59a7
tor: Use augeas to modify configuration.
- Use json to get info from action script.
- Add SSH port to hidden service.
- Enable hidden service during setup.
2016-03-15 18:50:51 -04:00
Sunil Mohan Adapa
c3c44ab379
firstboot: Minor Danube PageKite fixes
- Fix message internationalization with formatting and laziness.

- Styling fixes.

- Simplify Subdomain widget.

- Update messages for grammer and consistency.
2016-03-13 23:32:26 +05:30
fonfon
435f980c6f
firstboot: freedombox.me pagekite vouchers
- Show PageKite voucher only if cfg.danube_edition is enabled
2016-03-13 23:32:20 +05:30