Skip to content

Initial freedombox docker container

Raden Muhammad Mu'az requested to merge RadZaeem:master into master

My initial freedombox container. This Dockerfile installs Plinth and configures apache. *I will update the README.md later.

What I did

To build

# edit first .ds/config.sh, GITHUB='https://github.com/RadZaeem'
ds pull freedombox
ds init freedombox @freedombox
ds build
ds make

To run

cd  /var/ds/freedombox
ds shell
plinth #inside container
# Ctrl-C to quit

Problems I found:

(freedombox1-example-org)root@freedombox1-example-org:/usr/local/lib/python3.6/dist-packages/plinth# plinth
[2018-04-24 01:52:32,499] plinth.__main__ INFO     Configuration loaded from file - /etc/plinth/plinth.config
[2018-04-24 01:52:32,499] plinth.__main__ INFO     Script prefix - /plinth
[2018-04-24 01:52:32,509] axes.watch_login INFO     AXES: BEGIN LOG
[2018-04-24 01:52:32,510] axes.watch_login INFO     AXES: Using django-axes 4.1.0
[2018-04-24 01:52:32,510] axes.watch_login INFO     AXES: blocking by IP only.
[2018-04-24 01:52:32,659] plinth.module_loader INFO     Module load order - ['roundcube', 'deluge', 'ttrss', 'quassel', 'ssh', 'names', 'pagekite', 'api', 'help', 'ikiwiki', 'openvpn', 'searx', 'tahoe', 'mumble', 'mediawiki', 'first_boot', 'tor', 'infinoted', 'firewall', 'config', 'security', 'apache', 'dynamicdns', 'bind', 'snapshot', 'minetest', 'ejabberd', 'datetime', 'monkeysphere', 'sharing', 'coquelicot', 'storage', 'sso', 'repro', 'diagnostics', 'jsxc', 'users', 'power', 'networks', 'privoxy', 'shadowsocks', 'transmission', 'matrixsynapse', 'letsencrypt', 'upgrades', 'cockpit', 'syncthing', 'radicale', 'avahi']
[2018-04-24 01:52:36,252] plinth.actions INFO     Executing command - ['sudo', '-n', '/usr/share/plinth/actions/pagekite', 'is-disabled']
Unit pagekite.service could not be found.
[2018-04-24 01:52:36,623] plinth.actions INFO     Executing command - ['sudo', '-n', '/usr/share/plinth/actions/pagekite', 'get-kite']
[2018-04-24 01:52:43,775] plinth.actions INFO     Executing command - ['sudo', '-n', '/usr/share/plinth/actions/dynamicdns', 'status']
[2018-04-24 01:52:55,753] plinth.setup   INFO     Running first setup.
[2018-04-24 01:52:55,753] plinth.__main__ INFO     Setting up CherryPy server
[2018-04-24 01:52:55,754] plinth.setup   INFO     Running setup for modules, essential - True, selected modules - None
[2018-04-24 01:52:55,773] plinth.setup   INFO     Running module setup - users
[2018-04-24 01:52:56,645] plinth.setup   INFO     Running step for module - users, step - post
[2018-04-24 01:52:56,646] plinth.actions INFO     Executing command - ['sudo', '-n', '/usr/share/plinth/actions/users', 'first-setup']
[24/Apr/2018:01:52:56] ENGINE Listening for SIGTERM.
[24/Apr/2018:01:52:56] ENGINE Listening for SIGHUP.
[24/Apr/2018:01:52:56] ENGINE Listening for SIGUSR1.
[24/Apr/2018:01:52:56] ENGINE Bus STARTING
[24/Apr/2018:01:52:56] ENGINE Started monitor thread '_TimeoutMonitor'.
[24/Apr/2018:01:52:56] ENGINE Serving on http://127.0.0.1:8000
[24/Apr/2018:01:52:56] ENGINE Bus STARTED
[2018-04-24 01:52:57,048] plinth.setup   INFO     Running step for module - users, step - post
[2018-04-24 01:52:57,049] plinth.actions INFO     Executing command - ['sudo', '-n', '/usr/share/plinth/actions/users', 'setup']
[2018-04-24 01:52:59,172] plinth.actions ERROR    Error executing command - ['sudo', '-n', '/usr/share/plinth/actions/users', 'setup'], , Use of uninitialized value $item in hash element at /usr/share/perl5/Debconf/DbDriver/File.pm line 85, <__ANONIO__> chunk 1.
Use of uninitialized value $item in hash element at /usr/share/perl5/Debconf/DbDriver/File.pm line 85, <__ANONIO__> chunk 1.
invoke-rc.d: policy-rc.d denied execution of restart.
Use of uninitialized value $item in hash element at /usr/share/perl5/Debconf/DbDriver/File.pm line 85, <__ANONIO__> chunk 1.
debconf: DbDriver "_ENV_stack": unable to save changes to: libnss-ldapd/nsswitch
slapd.service is not a native service, redirecting to systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable slapd
nslcd.service is not a native service, redirecting to systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable nslcd
ldap_add: Server is unwilling to perform (53)
	additional info: no global superior knowledge
Traceback (most recent call last):
  File "/usr/share/plinth/actions/users", line 153, in create_organizational_unit
    ], stdout=subprocess.DEVNULL, check=True)
  File "/usr/lib/python3.6/subprocess.py", line 418, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['ldapsearch', '-Q', '-Y', 'EXTERNAL', '-H', 'ldapi:///', '-s', 'base', '-b', 'ou=users,dc=thisbox', '(objectclass=*)']' returned non-zero exit status 32.

During handling of the above exception, another exception occurred:
  • I edited manually inside ds shell the said file, by disabling its main() function, so that plinth skips LDAP user setup, and the errors can be avoided temporarily
vi /usr/share/actions/users
#edit line 363, add return the line below `def main():`
# then re-run plinth
plinth &
  • I still haven't tested and configured properly with wsproxy, I just configured my /etc/hosts to redirect localhost to plinth.example.org.

When I try to access with my web browser, django throw security error:


(freedombox1-example-org)root@freedombox1-example-org:~# [2018-04-24 02:09:41,564] django.security.DisallowedHost ERROR    Invalid HTTP_HOST header: 'plinth.example.org, plinth.example.org'. The domain name provided is not valid according to RFC 1034/1035.
  • But I can access and continue setup normally if I use w3m text-based web browser inside container
# inside container
apt install -y w3m
w3m localhost

Merge request reports