mf-hosting 2.1.0 → 2.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +16 -9
- package/pkg/hooks.sh +23 -0
- package/pkg/nginx.conf +15 -0
- package/pkg/service.backup +17 -0
- package/pkg/systemd.service +55 -0
- package/pkg/systemd.socket +9 -0
- package/pkg/sysusers.conf +1 -0
- package/pkg/tmpfiles.conf +3 -0
package/package.json
CHANGED
|
@@ -1,21 +1,28 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mf-hosting",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.2",
|
|
4
|
+
"files": [
|
|
5
|
+
".releaserc.json",
|
|
6
|
+
"pkg/hooks.sh",
|
|
7
|
+
"pkg/nginx.conf",
|
|
8
|
+
"pkg/service.backup",
|
|
9
|
+
"pkg/systemd.service",
|
|
10
|
+
"pkg/systemd.socket",
|
|
11
|
+
"pkg/sysusers.conf",
|
|
12
|
+
"pkg/tmpfiles.conf"
|
|
13
|
+
],
|
|
14
|
+
"main": ".releaserc.json",
|
|
4
15
|
"description": "hosting definitions @MF",
|
|
5
16
|
"keywords": [
|
|
6
17
|
"npm-pkgbuild",
|
|
7
18
|
"semantic-release-config"
|
|
8
19
|
],
|
|
9
|
-
"files": [
|
|
10
|
-
".releaserc.json"
|
|
11
|
-
],
|
|
12
|
-
"main": ".releaserc.json",
|
|
13
20
|
"devDependencies": {
|
|
14
|
-
"semantic-release": "^23.1.1",
|
|
15
21
|
"@semantic-release/commit-analyzer": "^12.0.0",
|
|
16
22
|
"@semantic-release/exec": "^6.0.3",
|
|
17
|
-
"@semantic-release/github": "^10.0.
|
|
18
|
-
"@semantic-release/release-notes-generator": "^13.0.0"
|
|
23
|
+
"@semantic-release/github": "^10.0.5",
|
|
24
|
+
"@semantic-release/release-notes-generator": "^13.0.0",
|
|
25
|
+
"semantic-release": "^23.1.1"
|
|
19
26
|
},
|
|
20
27
|
"repository": {
|
|
21
28
|
"type": "git",
|
|
@@ -37,7 +44,7 @@
|
|
|
37
44
|
"aarch64"
|
|
38
45
|
],
|
|
39
46
|
"dependencies": {
|
|
40
|
-
"systemd": ">=255.
|
|
47
|
+
"systemd": ">=255.7",
|
|
41
48
|
"nginx-mainline": ">=1.25.5"
|
|
42
49
|
},
|
|
43
50
|
"content": {
|
package/pkg/hooks.sh
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
|
|
2
|
+
post_install() {
|
|
3
|
+
systemctl daemon-reload
|
|
4
|
+
systemctl enable {{name}}
|
|
5
|
+
systemctl enable {{name}}.socket
|
|
6
|
+
systemctl start {{name}}.socket
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
pre_upgrade() {
|
|
10
|
+
systemctl stop {{name}}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
post_upgrade() {
|
|
14
|
+
systemctl daemon-reload
|
|
15
|
+
systemctl restart {{name}}.socket
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
pre_remove() {
|
|
19
|
+
systemctl stop {{name}}.socket
|
|
20
|
+
systemctl disable {{name}}.socket
|
|
21
|
+
systemctl stop {{name}}
|
|
22
|
+
systemctl disable {{name}}
|
|
23
|
+
}
|
package/pkg/nginx.conf
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
location {{http.path}} {
|
|
2
|
+
rewrite {{http.path}}(.*) $1 break;
|
|
3
|
+
proxy_set_header X-Real-IP $remote_addr;
|
|
4
|
+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
5
|
+
proxy_set_header Host $http_host;
|
|
6
|
+
proxy_set_header X-NginX-Proxy true;
|
|
7
|
+
proxy_set_header Upgrade $http_upgrade;
|
|
8
|
+
proxy_set_header Connection "upgrade";
|
|
9
|
+
proxy_pass http://unix:{{socket.http}};
|
|
10
|
+
|
|
11
|
+
add_header X-Content-Type-Options nosniff;
|
|
12
|
+
add_header Content-Security-Policy "{{csp.header}}" always;
|
|
13
|
+
add_header Cache-Control "private,no-store";
|
|
14
|
+
add_header alt-svc 'h3=":443";ma=7776000;persist=1';
|
|
15
|
+
{{nginx.location.trailer}}}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
backup()
|
|
2
|
+
{
|
|
3
|
+
mkdir -p $1/{{name}}
|
|
4
|
+
cp -ra /etc/{{name}}/* $1/{{name}}
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
restore()
|
|
8
|
+
{
|
|
9
|
+
mkdir -p /etc/{{name}}
|
|
10
|
+
cp -ra $1/{{name}}/* /etc/{{name}}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
sync()
|
|
14
|
+
{
|
|
15
|
+
mkdir -p /etc/{{name}}
|
|
16
|
+
rsync -e "ssh -i /root/.ssh/rsync" -ra -X -A -S --stats root@$SOURCE_HOST:/etc/{{name}} /etc/|grep -E -v '(data|time):'
|
|
17
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
[Unit]
|
|
2
|
+
Description={{description}}
|
|
3
|
+
Wants=network-online.target
|
|
4
|
+
After=network-online.target
|
|
5
|
+
StopWhenUnneeded=true
|
|
6
|
+
|
|
7
|
+
[Service]
|
|
8
|
+
Type=notify
|
|
9
|
+
ExecStart={{node.exe}} --unhandled-rejections=strict --trace-uncaught --trace-warnings --title {{name}} {{install.dir}}src/{{name}}-cli.mjs
|
|
10
|
+
ExecReload=/bin/kill -HUP $MAINPID
|
|
11
|
+
ExecStop=sleep 20
|
|
12
|
+
RestartSec=40
|
|
13
|
+
TimeoutStartSec=25
|
|
14
|
+
TimeoutStopSec=30
|
|
15
|
+
Restart=on-failure
|
|
16
|
+
NotifyAccess=all
|
|
17
|
+
FileDescriptorStoreMax=5
|
|
18
|
+
OOMPolicy=stop
|
|
19
|
+
User={{os.user}}
|
|
20
|
+
Group={{os.user}}
|
|
21
|
+
DynamicUser=false
|
|
22
|
+
SupplementaryGroups=http
|
|
23
|
+
CapabilityBoundingSet=~CAP_SYS_BOOT CAP_SYS_ADMIN CAP_NET_ADMIN CAP_SYS_NICE CAP_SYS_RESOURCE CAP_KILLC AP_IPC_LOCK CAP_CHOWN CAP_FSETID CAP_SETFCAP CAP_SETUID CAP_SETGID CAP_SETPCAP CAP_WAKE_ALARM CAP_NET_BIND_SERVICE CAP_NET_BROADCAST CAP_NET_RAW CAP_KILL
|
|
24
|
+
NoNewPrivileges=true
|
|
25
|
+
UMask=0077
|
|
26
|
+
ProtectSystem=full
|
|
27
|
+
ProtectHome=true
|
|
28
|
+
RuntimeDirectory={{name}}
|
|
29
|
+
StateDirectory={{name}}
|
|
30
|
+
CacheDirectory={{name}}
|
|
31
|
+
ConfigurationDirectory={{name}}
|
|
32
|
+
RuntimeDirectoryMode=755
|
|
33
|
+
RuntimeDirectoryPreserve=yes
|
|
34
|
+
PrivateTmp=true
|
|
35
|
+
PrivateDevices=true
|
|
36
|
+
PrivateUsers=true
|
|
37
|
+
ProtectHostname=true
|
|
38
|
+
ProtectClock=true
|
|
39
|
+
ProtectKernelTunables=true
|
|
40
|
+
ProtectKernelModules=true
|
|
41
|
+
ProtectKernelLogs=true
|
|
42
|
+
ProtectControlGroups=true
|
|
43
|
+
LockPersonality=true
|
|
44
|
+
RestrictRealtime=true
|
|
45
|
+
RestrictSUIDSGID=true
|
|
46
|
+
CPUWeight=10
|
|
47
|
+
IOWeight=10
|
|
48
|
+
MemoryAccounting=true
|
|
49
|
+
MemoryHigh=30M
|
|
50
|
+
MemoryMax=60M
|
|
51
|
+
ProtectProc=noaccess
|
|
52
|
+
SystemCallErrorNumber=EPERM
|
|
53
|
+
|
|
54
|
+
[Install]
|
|
55
|
+
WantedBy=multi-user.target
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
u {{os.user}} - "{{description}}" {{var.dir}} /usr/bin/nologin
|