@ossy/deployment-tools 0.0.15 → 0.0.17
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/dist/index.js +132 -27
- package/package.json +1 -1
- package/src/caddy-client.js +5 -3
- package/src/caddy.service.js +68 -0
- package/src/container-manager-server.js +4 -4
- package/src/deployment-tools.service.js +41 -0
- package/src/docker-client.js +5 -3
- package/src/index.js +10 -22
- package/Caddfyle +0 -9
- package/caddyfile.json +0 -114
package/dist/index.js
CHANGED
|
@@ -26272,8 +26272,6 @@ var __webpack_exports__ = {};
|
|
|
26272
26272
|
|
|
26273
26273
|
;// CONCATENATED MODULE: external "os"
|
|
26274
26274
|
const external_os_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("os");
|
|
26275
|
-
// EXTERNAL MODULE: external "fs"
|
|
26276
|
-
var external_fs_ = __nccwpck_require__(7147);
|
|
26277
26275
|
;// CONCATENATED MODULE: external "child_process"
|
|
26278
26276
|
const external_child_process_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("child_process");
|
|
26279
26277
|
// EXTERNAL MODULE: ./node_modules/arg/index.js
|
|
@@ -28421,6 +28419,10 @@ const Handlers = {
|
|
|
28421
28419
|
|
|
28422
28420
|
class CaddyClient {
|
|
28423
28421
|
|
|
28422
|
+
static new(serverName) {
|
|
28423
|
+
return new CaddyClient(serverName)
|
|
28424
|
+
}
|
|
28425
|
+
|
|
28424
28426
|
constructor(serverName = 'ci-client') {
|
|
28425
28427
|
this.serverName = serverName
|
|
28426
28428
|
}
|
|
@@ -28498,8 +28500,8 @@ class CaddyClient {
|
|
|
28498
28500
|
|
|
28499
28501
|
}
|
|
28500
28502
|
|
|
28501
|
-
|
|
28502
|
-
|
|
28503
|
+
// EXTERNAL MODULE: external "fs"
|
|
28504
|
+
var external_fs_ = __nccwpck_require__(7147);
|
|
28503
28505
|
// EXTERNAL MODULE: external "crypto"
|
|
28504
28506
|
var external_crypto_ = __nccwpck_require__(6113);
|
|
28505
28507
|
;// CONCATENATED MODULE: ./node_modules/nanoid/url-alphabet/index.js
|
|
@@ -28569,6 +28571,10 @@ const docker_client_dirname = external_path_.dirname(docker_client_filename)
|
|
|
28569
28571
|
|
|
28570
28572
|
class DockerClient {
|
|
28571
28573
|
|
|
28574
|
+
static new() {
|
|
28575
|
+
return new DockerClient()
|
|
28576
|
+
}
|
|
28577
|
+
|
|
28572
28578
|
constructor() {
|
|
28573
28579
|
this.networkName = 'deployment-tools'
|
|
28574
28580
|
;(0,external_child_process_namespaceObject.exec)(`sudo docker network create ${this.networkName}`)
|
|
@@ -28635,8 +28641,6 @@ ${this.startContainer({ image, containerPort, hostPort, registry, env })}`
|
|
|
28635
28641
|
|
|
28636
28642
|
}
|
|
28637
28643
|
|
|
28638
|
-
const createDockerClient = () => new DockerClient()
|
|
28639
|
-
|
|
28640
28644
|
;// CONCATENATED MODULE: ./src/container-manager-server.js
|
|
28641
28645
|
|
|
28642
28646
|
|
|
@@ -28650,8 +28654,8 @@ class ContainerManagerServer {
|
|
|
28650
28654
|
}
|
|
28651
28655
|
|
|
28652
28656
|
constructor() {
|
|
28653
|
-
this.dockerClient =
|
|
28654
|
-
this.caddyClient =
|
|
28657
|
+
this.dockerClient = DockerClient["new"]()
|
|
28658
|
+
this.caddyClient = CaddyClient["new"]()
|
|
28655
28659
|
this.server = express()
|
|
28656
28660
|
|
|
28657
28661
|
this.server.use(express.json())
|
|
@@ -28832,6 +28836,119 @@ class ContainerManagerCommands {
|
|
|
28832
28836
|
|
|
28833
28837
|
}
|
|
28834
28838
|
|
|
28839
|
+
;// CONCATENATED MODULE: ./src/deployment-tools.service.js
|
|
28840
|
+
|
|
28841
|
+
|
|
28842
|
+
|
|
28843
|
+
|
|
28844
|
+
|
|
28845
|
+
const systemdServiceFile = `
|
|
28846
|
+
[Unit]
|
|
28847
|
+
Description=D
|
|
28848
|
+
After=network.target caddy-route53.service
|
|
28849
|
+
|
|
28850
|
+
[Service]
|
|
28851
|
+
Environment=DEPLOYMENT_TOOLS_DOMAIN=${domain}
|
|
28852
|
+
Environment=DEPLOYMENT_TOOLS_ENVIRONMENT_NAME=${environmentName}
|
|
28853
|
+
Environment=DEPLOYMENT_TOOLS_CI_SUB_DOMAIN=${ciSubDomain}
|
|
28854
|
+
Environment=DEPLOYMENT_TOOLS_PORT=${port}
|
|
28855
|
+
User=caddy
|
|
28856
|
+
Group=caddy
|
|
28857
|
+
AmbientCapabilities=CAP_NET_BIND_SERVICE
|
|
28858
|
+
CapabilityBoundingSet=CAP_NET_BIND_SERVICE
|
|
28859
|
+
ExecStart=/usr/bin/npx @ossy/deployment-tools start-container-manager
|
|
28860
|
+
Restart=on-failure
|
|
28861
|
+
|
|
28862
|
+
[Install]
|
|
28863
|
+
WantedBy=multi-user.target
|
|
28864
|
+
`
|
|
28865
|
+
|
|
28866
|
+
class DeploymentToolsService {
|
|
28867
|
+
|
|
28868
|
+
static install() {
|
|
28869
|
+
;(0,external_fs_.writeFileSync)('/etc/systemd/system/deployment-tools.service', systemdServiceFile)
|
|
28870
|
+
}
|
|
28871
|
+
|
|
28872
|
+
static enable() {
|
|
28873
|
+
(0,external_child_process_namespaceObject.exec)('systemctl enable deployment-tools.service')
|
|
28874
|
+
}
|
|
28875
|
+
|
|
28876
|
+
static start() {
|
|
28877
|
+
(0,external_child_process_namespaceObject.exec)('systemctl start deployment-tools.service')
|
|
28878
|
+
}
|
|
28879
|
+
|
|
28880
|
+
}
|
|
28881
|
+
|
|
28882
|
+
;// CONCATENATED MODULE: ./src/caddy.service.js
|
|
28883
|
+
|
|
28884
|
+
|
|
28885
|
+
|
|
28886
|
+
const caddy_service_systemdServiceFile = `
|
|
28887
|
+
# caddy-api.service
|
|
28888
|
+
#
|
|
28889
|
+
# For using Caddy with its API.
|
|
28890
|
+
#
|
|
28891
|
+
# This unit is "durable" in that it will automatically resume
|
|
28892
|
+
# the last active configuration if the service is restarted.
|
|
28893
|
+
#
|
|
28894
|
+
# See https://caddyserver.com/docs/install for instructions.
|
|
28895
|
+
|
|
28896
|
+
[Unit]
|
|
28897
|
+
Description=Caddy
|
|
28898
|
+
Documentation=https://caddyserver.com/docs/
|
|
28899
|
+
After=network.target network-online.target
|
|
28900
|
+
Requires=network-online.target
|
|
28901
|
+
|
|
28902
|
+
[Service]
|
|
28903
|
+
Type=notify
|
|
28904
|
+
User=caddy
|
|
28905
|
+
Group=caddy
|
|
28906
|
+
ExecStart=/usr/bin/caddy.route53 run --environ --resume
|
|
28907
|
+
TimeoutStopSec=5s
|
|
28908
|
+
LimitNOFILE=1048576
|
|
28909
|
+
LimitNPROC=512
|
|
28910
|
+
PrivateTmp=true
|
|
28911
|
+
ProtectSystem=full
|
|
28912
|
+
AmbientCapabilities=CAP_NET_BIND_SERVICE
|
|
28913
|
+
|
|
28914
|
+
[Install]
|
|
28915
|
+
WantedBy=multi-user.target
|
|
28916
|
+
`
|
|
28917
|
+
|
|
28918
|
+
class CaddyService {
|
|
28919
|
+
|
|
28920
|
+
static install() {
|
|
28921
|
+
;(0,external_fs_.writeFileSync)('/etc/systemd/system/caddy-route53.service', caddy_service_systemdServiceFile)
|
|
28922
|
+
|
|
28923
|
+
[
|
|
28924
|
+
'apt install -y debian-keyring debian-archive-keyring apt-transport-https',
|
|
28925
|
+
'curl -1sLf \'https://dl.cloudsmith.io/public/caddy/stable/gpg.key\' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg',
|
|
28926
|
+
'curl -1sLf \'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt\' | sudo tee /etc/apt/sources.list.d/caddy-stable.list',
|
|
28927
|
+
'curl -1sLf \'https://dl.cloudsmith.io/public/caddy/xcaddy/gpg.key\' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-xcaddy-archive-keyring.gpg',
|
|
28928
|
+
'curl -1sLf \'https://dl.cloudsmith.io/public/caddy/xcaddy/debian.deb.txt\' | sudo tee /etc/apt/sources.list.d/caddy-xcaddy.list',
|
|
28929
|
+
'add-apt-repository ppa:longsleep/golang-backports -y',
|
|
28930
|
+
'apt update',
|
|
28931
|
+
'apt install caddy xcaddy golang-go -y',
|
|
28932
|
+
|
|
28933
|
+
// xcaddy custom build with route53 integration
|
|
28934
|
+
'xcaddy build --with github.com/caddy-dns/route53',
|
|
28935
|
+
// 'sudo dpkg-divert --divert /usr/bin/caddy.default --rename /usr/bin/caddy',
|
|
28936
|
+
'mv ./caddy /usr/bin/caddy.route53'
|
|
28937
|
+
// 'update-alternatives --install /usr/bin/caddy caddy /usr/bin/caddy.default 10',
|
|
28938
|
+
// 'update-alternatives --install /usr/bin/caddy caddy /usr/bin/caddy.custom 50',
|
|
28939
|
+
].forEach(command => (0,external_child_process_namespaceObject.exec)(command))
|
|
28940
|
+
}
|
|
28941
|
+
|
|
28942
|
+
static enable() {
|
|
28943
|
+
(0,external_child_process_namespaceObject.exec)('systemctl enable caddy-route53.service')
|
|
28944
|
+
}
|
|
28945
|
+
|
|
28946
|
+
static start() {
|
|
28947
|
+
(0,external_child_process_namespaceObject.exec)('systemctl start caddy-route53.service')
|
|
28948
|
+
}
|
|
28949
|
+
|
|
28950
|
+
}
|
|
28951
|
+
|
|
28835
28952
|
;// CONCATENATED MODULE: ./src/index.js
|
|
28836
28953
|
|
|
28837
28954
|
|
|
@@ -28855,28 +28972,16 @@ const startHandler = () => {
|
|
|
28855
28972
|
return console.error('Deployment tools do not support this os')
|
|
28856
28973
|
}
|
|
28857
28974
|
|
|
28858
|
-
(
|
|
28859
|
-
|
|
28860
|
-
Description=D
|
|
28861
|
-
After=network.target
|
|
28975
|
+
CaddyService.install()
|
|
28976
|
+
DeploymentToolsService.install()
|
|
28862
28977
|
|
|
28863
|
-
|
|
28864
|
-
Environment=DEPLOYMENT_TOOLS_DOMAIN=${domain}
|
|
28865
|
-
Environment=DEPLOYMENT_TOOLS_ENVIRONMENT_NAME=${environmentName}
|
|
28866
|
-
Environment=DEPLOYMENT_TOOLS_CI_SUB_DOMAIN=${ciSubDomain}
|
|
28867
|
-
Environment=DEPLOYMENT_TOOLS_PORT=${port}
|
|
28868
|
-
User=caddy
|
|
28869
|
-
AmbientCapabilities=CAP_NET_BIND_SERVICE
|
|
28870
|
-
CapabilityBoundingSet=CAP_NET_BIND_SERVICE
|
|
28871
|
-
ExecStart=/usr/bin/npx @ossy/deployment-tools start-container-manager
|
|
28872
|
-
Restart=on-failure
|
|
28978
|
+
;(0,external_child_process_namespaceObject.exec)('systemctl daemon-reload')
|
|
28873
28979
|
|
|
28874
|
-
|
|
28875
|
-
|
|
28876
|
-
`)
|
|
28980
|
+
CaddyService.enable()
|
|
28981
|
+
DeploymentToolsService.enable()
|
|
28877
28982
|
|
|
28878
|
-
|
|
28879
|
-
|
|
28983
|
+
CaddyService.start()
|
|
28984
|
+
DeploymentToolsService.start()
|
|
28880
28985
|
|
|
28881
28986
|
}
|
|
28882
28987
|
|
package/package.json
CHANGED
package/src/caddy-client.js
CHANGED
|
@@ -17,7 +17,11 @@ const Handlers = {
|
|
|
17
17
|
})
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
class CaddyClient {
|
|
20
|
+
export class CaddyClient {
|
|
21
|
+
|
|
22
|
+
static new(serverName) {
|
|
23
|
+
return new CaddyClient(serverName)
|
|
24
|
+
}
|
|
21
25
|
|
|
22
26
|
constructor(serverName = 'ci-client') {
|
|
23
27
|
this.serverName = serverName
|
|
@@ -95,5 +99,3 @@ class CaddyClient {
|
|
|
95
99
|
}
|
|
96
100
|
|
|
97
101
|
}
|
|
98
|
-
|
|
99
|
-
export const createCaddyClient = serverName => new CaddyClient(serverName)
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { exec } from 'child_process'
|
|
2
|
+
import { writeFileSync } from 'fs'
|
|
3
|
+
|
|
4
|
+
export const systemdServiceFile = `
|
|
5
|
+
# caddy-api.service
|
|
6
|
+
#
|
|
7
|
+
# For using Caddy with its API.
|
|
8
|
+
#
|
|
9
|
+
# This unit is "durable" in that it will automatically resume
|
|
10
|
+
# the last active configuration if the service is restarted.
|
|
11
|
+
#
|
|
12
|
+
# See https://caddyserver.com/docs/install for instructions.
|
|
13
|
+
|
|
14
|
+
[Unit]
|
|
15
|
+
Description=Caddy
|
|
16
|
+
Documentation=https://caddyserver.com/docs/
|
|
17
|
+
After=network.target network-online.target
|
|
18
|
+
Requires=network-online.target
|
|
19
|
+
|
|
20
|
+
[Service]
|
|
21
|
+
Type=notify
|
|
22
|
+
User=caddy
|
|
23
|
+
Group=caddy
|
|
24
|
+
ExecStart=/usr/bin/caddy.route53 run --environ --resume
|
|
25
|
+
TimeoutStopSec=5s
|
|
26
|
+
LimitNOFILE=1048576
|
|
27
|
+
LimitNPROC=512
|
|
28
|
+
PrivateTmp=true
|
|
29
|
+
ProtectSystem=full
|
|
30
|
+
AmbientCapabilities=CAP_NET_BIND_SERVICE
|
|
31
|
+
|
|
32
|
+
[Install]
|
|
33
|
+
WantedBy=multi-user.target
|
|
34
|
+
`
|
|
35
|
+
|
|
36
|
+
export class CaddyService {
|
|
37
|
+
|
|
38
|
+
static install() {
|
|
39
|
+
writeFileSync('/etc/systemd/system/caddy-route53.service', systemdServiceFile)
|
|
40
|
+
|
|
41
|
+
[
|
|
42
|
+
'apt install -y debian-keyring debian-archive-keyring apt-transport-https',
|
|
43
|
+
'curl -1sLf \'https://dl.cloudsmith.io/public/caddy/stable/gpg.key\' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg',
|
|
44
|
+
'curl -1sLf \'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt\' | sudo tee /etc/apt/sources.list.d/caddy-stable.list',
|
|
45
|
+
'curl -1sLf \'https://dl.cloudsmith.io/public/caddy/xcaddy/gpg.key\' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-xcaddy-archive-keyring.gpg',
|
|
46
|
+
'curl -1sLf \'https://dl.cloudsmith.io/public/caddy/xcaddy/debian.deb.txt\' | sudo tee /etc/apt/sources.list.d/caddy-xcaddy.list',
|
|
47
|
+
'add-apt-repository ppa:longsleep/golang-backports -y',
|
|
48
|
+
'apt update',
|
|
49
|
+
'apt install caddy xcaddy golang-go -y',
|
|
50
|
+
|
|
51
|
+
// xcaddy custom build with route53 integration
|
|
52
|
+
'xcaddy build --with github.com/caddy-dns/route53',
|
|
53
|
+
// 'sudo dpkg-divert --divert /usr/bin/caddy.default --rename /usr/bin/caddy',
|
|
54
|
+
'mv ./caddy /usr/bin/caddy.route53'
|
|
55
|
+
// 'update-alternatives --install /usr/bin/caddy caddy /usr/bin/caddy.default 10',
|
|
56
|
+
// 'update-alternatives --install /usr/bin/caddy caddy /usr/bin/caddy.custom 50',
|
|
57
|
+
].forEach(command => exec(command))
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
static enable() {
|
|
61
|
+
exec('systemctl enable caddy-route53.service')
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
static start() {
|
|
65
|
+
exec('systemctl start caddy-route53.service')
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import express from 'express'
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { CaddyClient } from './caddy-client.js'
|
|
3
|
+
import { DockerClient } from './docker-client.js'
|
|
4
4
|
import * as config from './config.js'
|
|
5
5
|
|
|
6
6
|
export class ContainerManagerServer {
|
|
@@ -10,8 +10,8 @@ export class ContainerManagerServer {
|
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
constructor() {
|
|
13
|
-
this.dockerClient =
|
|
14
|
-
this.caddyClient =
|
|
13
|
+
this.dockerClient = DockerClient.new()
|
|
14
|
+
this.caddyClient = CaddyClient.new()
|
|
15
15
|
this.server = express()
|
|
16
16
|
|
|
17
17
|
this.server.use(express.json())
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { exec } from 'child_process'
|
|
2
|
+
import { writeFileSync } from 'fs'
|
|
3
|
+
|
|
4
|
+
import * as config from './config.js'
|
|
5
|
+
|
|
6
|
+
export const systemdServiceFile = `
|
|
7
|
+
[Unit]
|
|
8
|
+
Description=D
|
|
9
|
+
After=network.target caddy-route53.service
|
|
10
|
+
|
|
11
|
+
[Service]
|
|
12
|
+
Environment=DEPLOYMENT_TOOLS_DOMAIN=${config.domain}
|
|
13
|
+
Environment=DEPLOYMENT_TOOLS_ENVIRONMENT_NAME=${config.environmentName}
|
|
14
|
+
Environment=DEPLOYMENT_TOOLS_CI_SUB_DOMAIN=${config.ciSubDomain}
|
|
15
|
+
Environment=DEPLOYMENT_TOOLS_PORT=${config.port}
|
|
16
|
+
User=caddy
|
|
17
|
+
Group=caddy
|
|
18
|
+
AmbientCapabilities=CAP_NET_BIND_SERVICE
|
|
19
|
+
CapabilityBoundingSet=CAP_NET_BIND_SERVICE
|
|
20
|
+
ExecStart=/usr/bin/npx @ossy/deployment-tools start-container-manager
|
|
21
|
+
Restart=on-failure
|
|
22
|
+
|
|
23
|
+
[Install]
|
|
24
|
+
WantedBy=multi-user.target
|
|
25
|
+
`
|
|
26
|
+
|
|
27
|
+
export class DeploymentToolsService {
|
|
28
|
+
|
|
29
|
+
static install() {
|
|
30
|
+
writeFileSync('/etc/systemd/system/deployment-tools.service', systemdServiceFile)
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
static enable() {
|
|
34
|
+
exec('systemctl enable deployment-tools.service')
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
static start() {
|
|
38
|
+
exec('systemctl start deployment-tools.service')
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
}
|
package/src/docker-client.js
CHANGED
|
@@ -7,7 +7,11 @@ import { fileURLToPath } from 'url'
|
|
|
7
7
|
const __filename = fileURLToPath(import.meta.url)
|
|
8
8
|
const __dirname = path.dirname(__filename)
|
|
9
9
|
|
|
10
|
-
class DockerClient {
|
|
10
|
+
export class DockerClient {
|
|
11
|
+
|
|
12
|
+
static new() {
|
|
13
|
+
return new DockerClient()
|
|
14
|
+
}
|
|
11
15
|
|
|
12
16
|
constructor() {
|
|
13
17
|
this.networkName = 'deployment-tools'
|
|
@@ -74,5 +78,3 @@ ${this.startContainer({ image, containerPort, hostPort, registry, env })}`
|
|
|
74
78
|
}
|
|
75
79
|
|
|
76
80
|
}
|
|
77
|
-
|
|
78
|
-
export const createDockerClient = () => new DockerClient()
|
package/src/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { platform } from 'os'
|
|
3
|
-
import { writeFileSync } from 'fs'
|
|
4
3
|
import { exec } from 'child_process'
|
|
5
4
|
import arg from 'arg'
|
|
6
5
|
import { ContainerManagerServer } from './container-manager-server.js'
|
|
7
6
|
import { ContainerManagerCommands } from './container-manager-commands.js'
|
|
8
|
-
import
|
|
7
|
+
import { DeploymentToolsService } from './deployment-tools.service.js'
|
|
8
|
+
import { CaddyService } from './caddy.service.js'
|
|
9
9
|
|
|
10
10
|
const [_, __, command, ...restArgs] = process.argv
|
|
11
11
|
|
|
@@ -21,28 +21,16 @@ const startHandler = () => {
|
|
|
21
21
|
return console.error('Deployment tools do not support this os')
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
Description=D
|
|
27
|
-
After=network.target
|
|
28
|
-
|
|
29
|
-
[Service]
|
|
30
|
-
Environment=DEPLOYMENT_TOOLS_DOMAIN=${config.domain}
|
|
31
|
-
Environment=DEPLOYMENT_TOOLS_ENVIRONMENT_NAME=${config.environmentName}
|
|
32
|
-
Environment=DEPLOYMENT_TOOLS_CI_SUB_DOMAIN=${config.ciSubDomain}
|
|
33
|
-
Environment=DEPLOYMENT_TOOLS_PORT=${config.port}
|
|
34
|
-
User=caddy
|
|
35
|
-
AmbientCapabilities=CAP_NET_BIND_SERVICE
|
|
36
|
-
CapabilityBoundingSet=CAP_NET_BIND_SERVICE
|
|
37
|
-
ExecStart=/usr/bin/npx @ossy/deployment-tools start-container-manager
|
|
38
|
-
Restart=on-failure
|
|
39
|
-
|
|
40
|
-
[Install]
|
|
41
|
-
WantedBy=multi-user.target
|
|
42
|
-
`)
|
|
24
|
+
CaddyService.install()
|
|
25
|
+
DeploymentToolsService.install()
|
|
43
26
|
|
|
44
27
|
exec('systemctl daemon-reload')
|
|
45
|
-
|
|
28
|
+
|
|
29
|
+
CaddyService.enable()
|
|
30
|
+
DeploymentToolsService.enable()
|
|
31
|
+
|
|
32
|
+
CaddyService.start()
|
|
33
|
+
DeploymentToolsService.start()
|
|
46
34
|
|
|
47
35
|
}
|
|
48
36
|
|
package/Caddfyle
DELETED
package/caddyfile.json
DELETED
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"apps":{
|
|
3
|
-
"http":{
|
|
4
|
-
"servers":{
|
|
5
|
-
"srv0":{
|
|
6
|
-
"listen":[
|
|
7
|
-
":443"
|
|
8
|
-
],
|
|
9
|
-
"routes":[
|
|
10
|
-
{
|
|
11
|
-
"match":[
|
|
12
|
-
{
|
|
13
|
-
"host":[
|
|
14
|
-
"*.qa.ossy.com"
|
|
15
|
-
]
|
|
16
|
-
}
|
|
17
|
-
],
|
|
18
|
-
"handle":[
|
|
19
|
-
{
|
|
20
|
-
"handler":"subroute",
|
|
21
|
-
"routes":[
|
|
22
|
-
{
|
|
23
|
-
"group":"group2",
|
|
24
|
-
"handle":[
|
|
25
|
-
{
|
|
26
|
-
"handler":"subroute",
|
|
27
|
-
"routes":[
|
|
28
|
-
{
|
|
29
|
-
"handle":[
|
|
30
|
-
{
|
|
31
|
-
"handler":"reverse_proxy",
|
|
32
|
-
"upstreams":[
|
|
33
|
-
{
|
|
34
|
-
"dial":"localhost:3005"
|
|
35
|
-
}
|
|
36
|
-
]
|
|
37
|
-
}
|
|
38
|
-
]
|
|
39
|
-
}
|
|
40
|
-
]
|
|
41
|
-
}
|
|
42
|
-
],
|
|
43
|
-
"match":[
|
|
44
|
-
{
|
|
45
|
-
"host":[
|
|
46
|
-
"ci.qa.example.com"
|
|
47
|
-
]
|
|
48
|
-
}
|
|
49
|
-
]
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
"group":"group2",
|
|
53
|
-
"handle":[
|
|
54
|
-
{
|
|
55
|
-
"handler":"subroute",
|
|
56
|
-
"routes":[
|
|
57
|
-
{
|
|
58
|
-
"handle":[
|
|
59
|
-
{
|
|
60
|
-
"body":"Wrong turn!",
|
|
61
|
-
"handler":"static_response"
|
|
62
|
-
}
|
|
63
|
-
]
|
|
64
|
-
}
|
|
65
|
-
]
|
|
66
|
-
}
|
|
67
|
-
]
|
|
68
|
-
}
|
|
69
|
-
]
|
|
70
|
-
}
|
|
71
|
-
],
|
|
72
|
-
"terminal":true
|
|
73
|
-
}
|
|
74
|
-
]
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
},
|
|
78
|
-
"tls":{
|
|
79
|
-
"automation":{
|
|
80
|
-
"policies":[
|
|
81
|
-
{
|
|
82
|
-
"subjects":[
|
|
83
|
-
"*.qa.ossy.com"
|
|
84
|
-
],
|
|
85
|
-
"issuers":[
|
|
86
|
-
{
|
|
87
|
-
"challenges":{
|
|
88
|
-
"dns":{
|
|
89
|
-
"provider":{
|
|
90
|
-
"max_retries":10,
|
|
91
|
-
"name":"route53"
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
},
|
|
95
|
-
"module":"acme"
|
|
96
|
-
},
|
|
97
|
-
{
|
|
98
|
-
"challenges":{
|
|
99
|
-
"dns":{
|
|
100
|
-
"provider":{
|
|
101
|
-
"max_retries":10,
|
|
102
|
-
"name":"route53"
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
},
|
|
106
|
-
"module":"zerossl"
|
|
107
|
-
}
|
|
108
|
-
]
|
|
109
|
-
}
|
|
110
|
-
]
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
}
|