diff --git a/deploy/panel_installer/engine.py b/deploy/panel_installer/engine.py index 81e1a35..6e0e803 100644 --- a/deploy/panel_installer/engine.py +++ b/deploy/panel_installer/engine.py @@ -856,6 +856,12 @@ class Installer: HEALTH_TIMER, ): install_unit(unit) + if not REMOTE_MODES.intersection( + (self.plan.dns.mode, self.plan.mail.mode) + ): + install_unit("coulobre-update.socket") + install_unit("coulobre-update@.service") + workers.append("coulobre-update.socket") systemctl("daemon-reload") systemctl( "enable", "--now", *PANEL_UNITS, *workers, "apache2.service" diff --git a/deploy/systemd/coulobre-update.socket b/deploy/systemd/coulobre-update.socket new file mode 100644 index 0000000..7ad4714 --- /dev/null +++ b/deploy/systemd/coulobre-update.socket @@ -0,0 +1,14 @@ +[Unit] +Description=Coulobre single-server release updater socket + +[Socket] +ListenStream=/run/coulobre-update.sock +SocketUser=coulobre-panel +SocketGroup=root +SocketMode=0600 +Accept=yes +MaxConnections=3 +RemoveOnStop=true + +[Install] +WantedBy=sockets.target diff --git a/deploy/systemd/coulobre-update@.service b/deploy/systemd/coulobre-update@.service new file mode 100644 index 0000000..f7bb4a2 --- /dev/null +++ b/deploy/systemd/coulobre-update@.service @@ -0,0 +1,22 @@ +[Unit] +Description=Coulobre single-server release update +After=mariadb.service network-online.target +CollectMode=inactive-or-failed + +[Service] +Type=exec +User=root +WorkingDirectory=/opt/coulobre +EnvironmentFile=/etc/coulobre/panel.env +StateDirectory=coulobre-update +StateDirectoryMode=0755 +UMask=0077 +ExecStart=/opt/coulobre/bin/coulobre-update +StandardInput=socket +StandardOutput=journal +StandardError=journal +RuntimeMaxSec=60min +NoNewPrivileges=true +ProtectHome=true +ProtectSystem=strict +ReadWritePaths=/opt/coulobre diff --git a/pyproject.toml b/pyproject.toml index 979dae7..017b1a4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -30,6 +30,7 @@ coulobre-mail-node = "coulobre.mail_node:main" coulobre-node-setup = "coulobre.node_setup:main" coulobre-service-credentials = "coulobre.service_credentials:main" coulobre-service-health = "coulobre.service_health:main" +coulobre-update = "coulobre.local_update:main" coulobre-web-node = "coulobre.web_node:main" [project.optional-dependencies] diff --git a/src/coulobre/hosting/templates/hosting/base.html b/src/coulobre/hosting/templates/hosting/base.html index 80c01ab..663bc66 100644 --- a/src/coulobre/hosting/templates/hosting/base.html +++ b/src/coulobre/hosting/templates/hosting/base.html @@ -53,7 +53,7 @@ {% endif %} {% if group_customer_navigation %}{% endif %} {% if is_operator and perms.hosting.view_servicehealth %} -