#!/bin/sh set -e # Source debconf library. . /usr/share/debconf/confmodule # Due to a change in sudo, now it runs PAM modules even on password-less # invocations. This leads to plinth not being able to run root privileges. This # is because of our own restrictions in /etc/security/access.conf. Since Plinth # is locked out after upgrade, we need to do this in postinst. sed -i 's+-:ALL EXCEPT root fbx (admin) (sudo):ALL+-:ALL EXCEPT root fbx plinth (admin) (sudo):ALL+' /etc/security/access.conf case "$1" in configure) if ! getent group plinth >/dev/null; then addgroup --system --quiet plinth fi if ! getent passwd plinth >/dev/null; then adduser --system --quiet --ingroup plinth --no-create-home --home /var/lib/plinth plinth fi chown plinth: /var/lib/plinth chown plinth: /var/lib/plinth/sessions if [ ! -e '/var/lib/freedombox/is-freedombox-disk-image' ]; then umask 377 base64 < /dev/urandom | head -c 16 | sed -e 's+$+\n+' > /var/lib/plinth/firstboot-wizard-secret chown plinth:plinth /var/lib/plinth/firstboot-wizard-secret db_subst plinth/firstboot_wizard_secret secret $(cat /var/lib/plinth/firstboot-wizard-secret) db_input high plinth/firstboot_wizard_secret || true db_go fi ;; esac # Automatically added by dh_python3 if command -v py3compile >/dev/null 2>&1; then py3compile -p freedombox fi if command -v pypy3compile >/dev/null 2>&1; then pypy3compile -p freedombox || true fi # End automatically added section # Automatically added by dh_installdeb/13.11.4 dpkg-maintscript-helper rm_conffile /etc/plinth/modules-enabled/lib 0.4.3-1\~ -- "$@" dpkg-maintscript-helper rm_conffile /etc/plinth/modules-enabled/expert_mode 0.4.3-1\~ -- "$@" dpkg-maintscript-helper rm_conffile /etc/plinth/modules-enabled/packages 0.5-1\~ -- "$@" dpkg-maintscript-helper rm_conffile /etc/plinth/modules-enabled/xmpp 0.13.0\+ds-1\~ -- "$@" dpkg-maintscript-helper rm_conffile /etc/plinth/modules-enabled/apps 0.15.1\+ds-2\~ -- "$@" dpkg-maintscript-helper rm_conffile /etc/plinth/modules-enabled/owncloud 0.15.1\+ds-2\~ -- "$@" dpkg-maintscript-helper rm_conffile /etc/plinth/modules-enabled/system 0.15.1\+ds-2\~ -- "$@" dpkg-maintscript-helper rm_conffile /etc/plinth/modules-enabled/disks 0.15.3\+ds-1\~ -- "$@" dpkg-maintscript-helper rm_conffile /etc/plinth/modules-enabled/udiskie 0.39.0\~ -- "$@" dpkg-maintscript-helper rm_conffile /etc/plinth/modules-enabled/restore 20.1\~ -- "$@" dpkg-maintscript-helper rm_conffile /etc/plinth/modules-enabled/repro 20.1\~ -- "$@" dpkg-maintscript-helper rm_conffile /etc/apt/preferences.d/50freedombox3.pref 20.5\~ -- "$@" dpkg-maintscript-helper rm_conffile /etc/plinth/plinth.config 20.12\~ -- "$@" dpkg-maintscript-helper rm_conffile /etc/plinth/custom-shortcuts.json 20.12\~ -- "$@" dpkg-maintscript-helper rm_conffile /etc/plinth/modules-enabled/coquelicot 20.14\~ -- "$@" dpkg-maintscript-helper rm_conffile /etc/plinth/modules-enabled/diaspora 21.16\~ -- "$@" dpkg-maintscript-helper rm_conffile /etc/plinth/modules-enabled/monkeysphere 21.16\~ -- "$@" dpkg-maintscript-helper rm_conffile /etc/plinth/modules-enabled/tahoe 21.16\~ -- "$@" dpkg-maintscript-helper rm_conffile /etc/apache2/conf-available/tahoe-plinth.conf 21.16\~ -- "$@" dpkg-maintscript-helper rm_conffile /etc/plinth/modules-enabled/mldonkey 22.4\~ -- "$@" dpkg-maintscript-helper rm_conffile /etc/apache2/conf-available/mldonkey-freedombox.conf 22.4\~ -- "$@" dpkg-maintscript-helper rm_conffile /etc/apache2/sites-available/plinth.conf 22.16\~ -- "$@" dpkg-maintscript-helper rm_conffile /etc/apache2/sites-available/plinth-ssl.conf 22.16\~ -- "$@" dpkg-maintscript-helper rm_conffile /etc/fail2ban/jail.d/wordpress-auth-freedombox.conf 22.22\~ -- "$@" dpkg-maintscript-helper rm_conffile /etc/fail2ban/filter.d/wordpress-auth-freedombox.conf 22.22\~ -- "$@" dpkg-maintscript-helper rm_conffile /etc/security/access.d/10freedombox-performance.conf 22.25\~ -- "$@" dpkg-maintscript-helper rm_conffile /etc/security/access.d/10freedombox-security.conf 22.25\~ -- "$@" # End automatically added section # Automatically added by dh_installsystemd/13.11.4 if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then # The following line should be removed in trixie or trixie+1 deb-systemd-helper unmask 'plinth.service' >/dev/null || true # was-enabled defaults to true, so new installations run enable. if deb-systemd-helper --quiet was-enabled 'plinth.service'; then # Enables the unit on first installation, creates new # symlinks on upgrades if the unit file has changed. deb-systemd-helper enable 'plinth.service' >/dev/null || true else # Update the statefile to add new symlinks (if any), which need to be # cleaned up on purge. Also remove old symlinks. deb-systemd-helper update-state 'plinth.service' >/dev/null || true fi fi # End automatically added section # Automatically added by dh_installsystemd/13.11.4 if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then if [ -d /run/systemd/system ]; then systemctl --system daemon-reload >/dev/null || true if [ -n "$2" ]; then _dh_action=restart else _dh_action=start fi deb-systemd-invoke $_dh_action 'plinth.service' >/dev/null || true fi fi # End automatically added section exit 0