feat: import Sea vHost single-server testing release

This commit is contained in:
canglan committed 2026-10-30 08:39:10 +08:00
commit 248badd33e
441 files changed
+63221

No files matched your search

+61
View File
@@ -0,0 +1,61 @@
[Unit]
Description=Sea vHost privileged isolation agent
After=local-fs.target mysqld.service mysql.service mariadb.service
Before=sea-vhost-api.service
[Service]
Type=simple
User=root
Group=sea-vhost-agent-control
EnvironmentFile=/etc/sea-vhost/sea-vhost.env
ExecStart=/opt/sea-vhost/bin/sea-vhost-agent
Restart=on-failure
RestartSec=3
RuntimeDirectory=sea-vhost sea-vhost-php
RuntimeDirectoryMode=0755
StateDirectory=sea-vhost-agent
StateDirectoryMode=0711
UMask=0007
NoNewPrivileges=true
PrivateTmp=true
# A root-only directory view follows socket recreation after MySQL restarts.
# Tenant PHP processes cannot traverse this 0700 configuration directory.
ConfigurationDirectory=sea-vhost-mysql
ConfigurationDirectoryMode=0700
BindReadOnlyPaths=/tmp:/etc/sea-vhost-mysql/host-tmp
PrivateDevices=true
# PHP-FPM masters are launched by this service after dropping to each host
# UID/GID. They must retain host networking so ordinary PHP applications can
# reach the local MySQL listener and outbound APIs. The agent itself exposes
# only a token-authenticated Unix socket and does not listen on TCP.
# The privileged quota agent must enumerate processes owned by each isolated
# host UID. The unprivileged API keeps ProtectProc=invisible; this root-only,
# token-authenticated agent therefore retains the default /proc visibility.
ProcSubset=pid
ProtectClock=true
ProtectHostname=true
ProtectHome=true
ProtectSystem=strict
ReadOnlyPaths=/usr /boot /opt /var/lib/sea-vhost /var/lib/sea-vhost-panel /www/server
ReadWritePaths=/etc /www/wwwroot/seavHost/vHost /www/backup/sea-vhost /www/wwwlogs /www/server/panel/vhost/nginx /www/server/pure-ftpd/etc /www/server/nginx/logs/error.log /www/server/nginx/logs/nginx.pid -/www/server/nodejs/vhost/pids -/www/server/python_manager/versions -/www/server/php /var/lib/sea-vhost-agent /run/sea-vhost-php
ProtectKernelTunables=true
ProtectKernelModules=true
ProtectKernelLogs=true
ProtectControlGroups=true
# The agent creates locked per-host identities, applies ACLs and starts each
# PHP-FPM master after changing the forked child's UID/GID. The kernel clears
# ambient capabilities on that root-to-tenant UID transition, so tenant PHP
# processes do not inherit agent privileges. /etc remains writable because fixed useradd/usermod
# operations must update the host account databases; all other system paths
# stay read-only unless explicitly listed.
RestrictRealtime=true
LockPersonality=true
MemoryDenyWriteExecute=true
RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6
CapabilityBoundingSet=CAP_CHOWN CAP_DAC_OVERRIDE CAP_FOWNER CAP_FSETID CAP_KILL CAP_LINUX_IMMUTABLE CAP_NET_BIND_SERVICE CAP_SETGID CAP_SETUID
AmbientCapabilities=CAP_SETGID CAP_SETUID
LimitCORE=0
SystemCallArchitectures=native
[Install]
WantedBy=multi-user.target
+45
View File
@@ -0,0 +1,45 @@
[Unit]
Description=Sea vHost API
After=network-online.target mysql.service sea-vhost-agent.service sea-vhost-panel-broker.service
Requires=sea-vhost-agent.service sea-vhost-panel-broker.service
Wants=network-online.target
[Service]
Type=simple
User=sea-vhost
Group=sea-vhost-control
SupplementaryGroups=sea-vhost-agent-control sea-vhost-panel-control
EnvironmentFile=/etc/sea-vhost/sea-vhost.env
ExecStart=/opt/sea-vhost/bin/sea-vhost-api
WorkingDirectory=/opt/sea-vhost
Restart=on-failure
RestartSec=3
UMask=0007
StateDirectory=sea-vhost
StateDirectoryMode=0700
NoNewPrivileges=true
PrivateTmp=true
PrivateDevices=true
ProtectProc=invisible
ProcSubset=pid
ProtectClock=true
ProtectHostname=true
ProtectSystem=strict
ProtectHome=true
ReadWritePaths=/www/wwwroot/seavHost/vHost /run/sea-vhost /var/lib/sea-vhost
ProtectKernelTunables=true
ProtectKernelModules=true
ProtectKernelLogs=true
ProtectControlGroups=true
RestrictSUIDSGID=true
RestrictRealtime=true
LockPersonality=true
MemoryDenyWriteExecute=true
RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6
CapabilityBoundingSet=
AmbientCapabilities=
LimitCORE=0
SystemCallArchitectures=native
[Install]
WantedBy=multi-user.target
@@ -0,0 +1,34 @@
[Unit]
Description=Sea vHost controller
After=network-online.target
Wants=network-online.target
[Service]
User=sea-vhost
Group=sea-vhost-control
EnvironmentFile=/etc/sea-vhost/sea-vhost.env
ExecStart=/opt/sea-vhost/bin/sea-vhost-api
WorkingDirectory=/opt/sea-vhost
Restart=on-failure
RestartSec=3
StateDirectory=sea-vhost
StateDirectoryMode=0700
UMask=0077
NoNewPrivileges=true
PrivateTmp=true
PrivateDevices=true
ProtectSystem=strict
ProtectHome=true
ProtectProc=invisible
ProcSubset=pid
ProtectKernelTunables=true
ProtectKernelModules=true
ProtectControlGroups=true
RestrictSUIDSGID=true
RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6
CapabilityBoundingSet=
AmbientCapabilities=
LimitCORE=0
[Install]
WantedBy=multi-user.target
+32
View File
@@ -0,0 +1,32 @@
[Unit]
Description=Sea vHost stateless execution node
After=network-online.target sea-vhost-agent.service sea-vhost-panel-broker.service
Requires=sea-vhost-agent.service sea-vhost-panel-broker.service
[Service]
User=sea-vhost
Group=sea-vhost-control
SupplementaryGroups=sea-vhost-agent-control sea-vhost-panel-control
EnvironmentFile=/etc/sea-vhost/sea-vhost.env
ExecStart=/opt/sea-vhost/bin/sea-vhost-node
Restart=on-failure
RestartSec=3
UMask=0007
NoNewPrivileges=true
PrivateTmp=true
PrivateDevices=true
ProtectSystem=strict
ProtectHome=true
ProtectProc=invisible
ProcSubset=pid
ProtectKernelTunables=true
ProtectKernelModules=true
ProtectControlGroups=true
RestrictSUIDSGID=true
RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6
CapabilityBoundingSet=
AmbientCapabilities=
LimitCORE=0
[Install]
WantedBy=multi-user.target
@@ -0,0 +1,47 @@
[Unit]
Description=Sea vHost aaPanel capability broker
After=network-online.target
Before=sea-vhost-api.service
Wants=network-online.target
[Service]
Type=simple
User=sea-vhost-panel
Group=sea-vhost-panel-control
SupplementaryGroups=sea-vhost-control
EnvironmentFile=/etc/sea-vhost/sea-vhost.env
ExecStart=/opt/sea-vhost/bin/sea-vhost-panel-broker
Restart=on-failure
RestartSec=3
RuntimeDirectory=sea-vhost-panel
RuntimeDirectoryMode=0750
StateDirectory=sea-vhost-panel
StateDirectoryMode=0700
UMask=0077
NoNewPrivileges=true
PrivateTmp=true
PrivateDevices=true
ProtectProc=invisible
ProcSubset=pid
ProtectClock=true
ProtectHostname=true
ProtectSystem=strict
ProtectHome=true
ProtectKernelTunables=true
ProtectKernelModules=true
ProtectKernelLogs=true
ProtectControlGroups=true
RestrictSUIDSGID=true
RestrictRealtime=true
LockPersonality=true
MemoryDenyWriteExecute=true
RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6
IPAddressDeny=any
IPAddressAllow=localhost
CapabilityBoundingSet=
AmbientCapabilities=
LimitCORE=0
SystemCallArchitectures=native
[Install]
WantedBy=multi-user.target