@factiii/stack 0.1.189 → 0.1.191
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/LICENSE +21 -21
- package/README.md +403 -441
- package/bin/stack +333 -300
- package/dist/cli/dev-sync.js +16 -16
- package/dist/cli/secrets.d.ts +6 -1
- package/dist/cli/secrets.d.ts.map +1 -1
- package/dist/cli/secrets.js +228 -0
- package/dist/cli/secrets.js.map +1 -1
- package/dist/plugins/addons/auth/index.js +7 -7
- package/dist/plugins/addons/dns/index.d.ts +47 -0
- package/dist/plugins/addons/dns/index.d.ts.map +1 -0
- package/dist/plugins/addons/dns/index.js +104 -0
- package/dist/plugins/addons/dns/index.js.map +1 -0
- package/dist/plugins/addons/dns/scanfix/dev.d.ts +13 -0
- package/dist/plugins/addons/dns/scanfix/dev.d.ts.map +1 -0
- package/dist/plugins/addons/dns/scanfix/dev.js +235 -0
- package/dist/plugins/addons/dns/scanfix/dev.js.map +1 -0
- package/dist/plugins/addons/server-mode/index.d.ts.map +1 -1
- package/dist/plugins/addons/server-mode/index.js +6 -0
- package/dist/plugins/addons/server-mode/index.js.map +1 -1
- package/dist/plugins/addons/server-mode/scanfix/env-marker.d.ts +17 -0
- package/dist/plugins/addons/server-mode/scanfix/env-marker.d.ts.map +1 -0
- package/dist/plugins/addons/server-mode/scanfix/env-marker.js +195 -0
- package/dist/plugins/addons/server-mode/scanfix/env-marker.js.map +1 -0
- package/dist/plugins/addons/server-mode/scanfix/tailscale.d.ts +16 -0
- package/dist/plugins/addons/server-mode/scanfix/tailscale.d.ts.map +1 -0
- package/dist/plugins/addons/server-mode/scanfix/tailscale.js +211 -0
- package/dist/plugins/addons/server-mode/scanfix/tailscale.js.map +1 -0
- package/dist/plugins/addons/vercel/index.js +9 -9
- package/dist/plugins/addons/vercel/scanfix/config.js +10 -10
- package/dist/plugins/addons/vercel/scanfix/token.js +15 -15
- package/dist/plugins/approved.json +13 -13
- package/dist/plugins/index.d.ts.map +1 -1
- package/dist/plugins/index.js +8 -0
- package/dist/plugins/index.js.map +1 -1
- package/dist/plugins/pipelines/aws/index.js +12 -12
- package/dist/plugins/pipelines/aws/policies/bootstrap-policy.json +135 -135
- package/dist/plugins/pipelines/aws/prod.js +1 -1
- package/dist/plugins/pipelines/factiii/prod.d.ts +1 -1
- package/dist/plugins/pipelines/factiii/prod.d.ts.map +1 -1
- package/dist/plugins/pipelines/factiii/prod.js +66 -25
- package/dist/plugins/pipelines/factiii/prod.js.map +1 -1
- package/dist/plugins/pipelines/factiii/scanfix/start-sh.d.ts.map +1 -1
- package/dist/plugins/pipelines/factiii/scanfix/start-sh.js +3 -11
- package/dist/plugins/pipelines/factiii/scanfix/start-sh.js.map +1 -1
- package/dist/plugins/pipelines/factiii/staging.js +23 -23
- package/dist/plugins/pipelines/factiii/workflows/stack-ci.yml +75 -75
- package/dist/plugins/pipelines/factiii/workflows/stack-cicd-prod.yml +73 -73
- package/dist/plugins/servers/amazon-linux/index.js +16 -16
- package/dist/plugins/servers/mac/index.js +12 -12
- package/dist/plugins/servers/mac/staging.js +2 -2
- package/dist/plugins/servers/ubuntu/index.js +23 -23
- package/dist/plugins/servers/windows/index.js +15 -15
- package/dist/scripts/generate-all.js +73 -73
- package/dist/utils/ansible-vault-secrets.d.ts +8 -0
- package/dist/utils/ansible-vault-secrets.d.ts.map +1 -1
- package/dist/utils/ansible-vault-secrets.js +54 -0
- package/dist/utils/ansible-vault-secrets.js.map +1 -1
- package/dist/utils/deployment-report.js +2 -2
- package/dist/utils/secret-prompts.js +34 -34
- package/dist/utils/ssh-helper.d.ts.map +1 -1
- package/dist/utils/ssh-helper.js +25 -5
- package/dist/utils/ssh-helper.js.map +1 -1
- package/dist/utils/template-generator.js +74 -74
- package/package.json +100 -100
|
@@ -1,75 +1,75 @@
|
|
|
1
|
-
name: Stack CI
|
|
2
|
-
|
|
3
|
-
# Generated by @factiii/stack v{VERSION}
|
|
4
|
-
# Runs builds and tests on push/PR to main.
|
|
5
|
-
# No deployment - deploy via SSH from dev machine.
|
|
6
|
-
|
|
7
|
-
on:
|
|
8
|
-
push:
|
|
9
|
-
branches: [main]
|
|
10
|
-
pull_request:
|
|
11
|
-
branches: [main]
|
|
12
|
-
|
|
13
|
-
jobs:
|
|
14
|
-
ci:
|
|
15
|
-
runs-on: ubuntu-latest
|
|
16
|
-
env:
|
|
17
|
-
CI: true
|
|
18
|
-
ENV: test
|
|
19
|
-
NODE_ENV: test
|
|
20
|
-
DATABASE_URL: "postgresql://postgres:password@localhost:5440/factiii-test?connect_timeout=300"
|
|
21
|
-
TEST_DATABASE_URL: "postgresql://postgres:password@localhost:5440/factiii-test?connect_timeout=300"
|
|
22
|
-
TEST_ADMIN_IP: "::ffff:127.0.0.1"
|
|
23
|
-
SITE_URL: http://localhost:3000
|
|
24
|
-
ALLOWED_ORIGINS: http://localhost:3000,http://localhost:5001
|
|
25
|
-
ACCESS_TOKEN_SECRET: test-secret-key
|
|
26
|
-
GOOGLE_CLIENT_ID: test-google-id
|
|
27
|
-
APPLE_CLIENT_ID: com.factiii.test
|
|
28
|
-
NEXT_PUBLIC_SITE_URL: http://localhost:3000
|
|
29
|
-
NEXT_PUBLIC_API_URL: http://localhost:5001
|
|
30
|
-
|
|
31
|
-
steps:
|
|
32
|
-
- name: Checkout
|
|
33
|
-
uses: actions/checkout@v4
|
|
34
|
-
|
|
35
|
-
- name: Setup pnpm
|
|
36
|
-
uses: pnpm/action-setup@v4
|
|
37
|
-
|
|
38
|
-
- name: Setup Node.js
|
|
39
|
-
uses: actions/setup-node@v4
|
|
40
|
-
with:
|
|
41
|
-
node-version: '24'
|
|
42
|
-
cache: 'pnpm'
|
|
43
|
-
|
|
44
|
-
- name: Install dependencies
|
|
45
|
-
run: pnpm install
|
|
46
|
-
|
|
47
|
-
- name: Build server
|
|
48
|
-
run: pnpm build
|
|
49
|
-
working-directory: apps/server
|
|
50
|
-
|
|
51
|
-
- name: Build client
|
|
52
|
-
run: pnpm build
|
|
53
|
-
working-directory: client
|
|
54
|
-
if: hashFiles('client/package.json') != ''
|
|
55
|
-
|
|
56
|
-
- name: Setup Java (for Android)
|
|
57
|
-
uses: actions/setup-java@v4
|
|
58
|
-
with:
|
|
59
|
-
distribution: 'temurin'
|
|
60
|
-
java-version: '17'
|
|
61
|
-
if: hashFiles('apps/mobile/android/build.gradle') != ''
|
|
62
|
-
|
|
63
|
-
- name: Build Android
|
|
64
|
-
run: |
|
|
65
|
-
cd apps/mobile/android
|
|
66
|
-
./gradlew assembleRelease
|
|
67
|
-
if: hashFiles('apps/mobile/android/build.gradle') != ''
|
|
68
|
-
|
|
69
|
-
- name: Start Docker containers
|
|
70
|
-
run: |
|
|
71
|
-
chmod +x ./start.sh
|
|
72
|
-
./start.sh
|
|
73
|
-
|
|
74
|
-
- name: Run tests
|
|
75
|
-
run: pnpm test:server
|
|
1
|
+
name: Stack CI
|
|
2
|
+
|
|
3
|
+
# Generated by @factiii/stack v{VERSION}
|
|
4
|
+
# Runs builds and tests on push/PR to main.
|
|
5
|
+
# No deployment - deploy via SSH from dev machine.
|
|
6
|
+
|
|
7
|
+
on:
|
|
8
|
+
push:
|
|
9
|
+
branches: [main]
|
|
10
|
+
pull_request:
|
|
11
|
+
branches: [main]
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
ci:
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
env:
|
|
17
|
+
CI: true
|
|
18
|
+
ENV: test
|
|
19
|
+
NODE_ENV: test
|
|
20
|
+
DATABASE_URL: "postgresql://postgres:password@localhost:5440/factiii-test?connect_timeout=300"
|
|
21
|
+
TEST_DATABASE_URL: "postgresql://postgres:password@localhost:5440/factiii-test?connect_timeout=300"
|
|
22
|
+
TEST_ADMIN_IP: "::ffff:127.0.0.1"
|
|
23
|
+
SITE_URL: http://localhost:3000
|
|
24
|
+
ALLOWED_ORIGINS: http://localhost:3000,http://localhost:5001
|
|
25
|
+
ACCESS_TOKEN_SECRET: test-secret-key
|
|
26
|
+
GOOGLE_CLIENT_ID: test-google-id
|
|
27
|
+
APPLE_CLIENT_ID: com.factiii.test
|
|
28
|
+
NEXT_PUBLIC_SITE_URL: http://localhost:3000
|
|
29
|
+
NEXT_PUBLIC_API_URL: http://localhost:5001
|
|
30
|
+
|
|
31
|
+
steps:
|
|
32
|
+
- name: Checkout
|
|
33
|
+
uses: actions/checkout@v4
|
|
34
|
+
|
|
35
|
+
- name: Setup pnpm
|
|
36
|
+
uses: pnpm/action-setup@v4
|
|
37
|
+
|
|
38
|
+
- name: Setup Node.js
|
|
39
|
+
uses: actions/setup-node@v4
|
|
40
|
+
with:
|
|
41
|
+
node-version: '24'
|
|
42
|
+
cache: 'pnpm'
|
|
43
|
+
|
|
44
|
+
- name: Install dependencies
|
|
45
|
+
run: pnpm install
|
|
46
|
+
|
|
47
|
+
- name: Build server
|
|
48
|
+
run: pnpm build
|
|
49
|
+
working-directory: apps/server
|
|
50
|
+
|
|
51
|
+
- name: Build client
|
|
52
|
+
run: pnpm build
|
|
53
|
+
working-directory: client
|
|
54
|
+
if: hashFiles('client/package.json') != ''
|
|
55
|
+
|
|
56
|
+
- name: Setup Java (for Android)
|
|
57
|
+
uses: actions/setup-java@v4
|
|
58
|
+
with:
|
|
59
|
+
distribution: 'temurin'
|
|
60
|
+
java-version: '17'
|
|
61
|
+
if: hashFiles('apps/mobile/android/build.gradle') != ''
|
|
62
|
+
|
|
63
|
+
- name: Build Android
|
|
64
|
+
run: |
|
|
65
|
+
cd apps/mobile/android
|
|
66
|
+
./gradlew assembleRelease
|
|
67
|
+
if: hashFiles('apps/mobile/android/build.gradle') != ''
|
|
68
|
+
|
|
69
|
+
- name: Start Docker containers
|
|
70
|
+
run: |
|
|
71
|
+
chmod +x ./start.sh
|
|
72
|
+
./start.sh
|
|
73
|
+
|
|
74
|
+
- name: Run tests
|
|
75
|
+
run: pnpm test:server
|
|
@@ -1,73 +1,73 @@
|
|
|
1
|
-
name: Stack CI Prod
|
|
2
|
-
|
|
3
|
-
# Generated by @factiii/stack v{VERSION}
|
|
4
|
-
# Runs builds and tests on push to prod branch.
|
|
5
|
-
# No deployment - deploy via SSH from dev machine.
|
|
6
|
-
|
|
7
|
-
on:
|
|
8
|
-
push:
|
|
9
|
-
branches: [prod]
|
|
10
|
-
|
|
11
|
-
jobs:
|
|
12
|
-
ci:
|
|
13
|
-
runs-on: ubuntu-latest
|
|
14
|
-
env:
|
|
15
|
-
CI: true
|
|
16
|
-
ENV: test
|
|
17
|
-
NODE_ENV: test
|
|
18
|
-
DATABASE_URL: "postgresql://postgres:password@localhost:5440/factiii-test?connect_timeout=300"
|
|
19
|
-
TEST_DATABASE_URL: "postgresql://postgres:password@localhost:5440/factiii-test?connect_timeout=300"
|
|
20
|
-
TEST_ADMIN_IP: "::ffff:127.0.0.1"
|
|
21
|
-
SITE_URL: http://localhost:3000
|
|
22
|
-
ALLOWED_ORIGINS: http://localhost:3000,http://localhost:5001
|
|
23
|
-
ACCESS_TOKEN_SECRET: test-secret-key
|
|
24
|
-
GOOGLE_CLIENT_ID: test-google-id
|
|
25
|
-
APPLE_CLIENT_ID: com.factiii.test
|
|
26
|
-
NEXT_PUBLIC_SITE_URL: http://localhost:3000
|
|
27
|
-
NEXT_PUBLIC_API_URL: http://localhost:5001
|
|
28
|
-
|
|
29
|
-
steps:
|
|
30
|
-
- name: Checkout
|
|
31
|
-
uses: actions/checkout@v4
|
|
32
|
-
|
|
33
|
-
- name: Setup pnpm
|
|
34
|
-
uses: pnpm/action-setup@v4
|
|
35
|
-
|
|
36
|
-
- name: Setup Node.js
|
|
37
|
-
uses: actions/setup-node@v4
|
|
38
|
-
with:
|
|
39
|
-
node-version: '24'
|
|
40
|
-
cache: 'pnpm'
|
|
41
|
-
|
|
42
|
-
- name: Install dependencies
|
|
43
|
-
run: pnpm install
|
|
44
|
-
|
|
45
|
-
- name: Build server
|
|
46
|
-
run: pnpm build
|
|
47
|
-
working-directory: apps/server
|
|
48
|
-
|
|
49
|
-
- name: Build client
|
|
50
|
-
run: pnpm build
|
|
51
|
-
working-directory: client
|
|
52
|
-
if: hashFiles('client/package.json') != ''
|
|
53
|
-
|
|
54
|
-
- name: Setup Java (for Android)
|
|
55
|
-
uses: actions/setup-java@v4
|
|
56
|
-
with:
|
|
57
|
-
distribution: 'temurin'
|
|
58
|
-
java-version: '17'
|
|
59
|
-
if: hashFiles('apps/mobile/android/build.gradle') != ''
|
|
60
|
-
|
|
61
|
-
- name: Build Android
|
|
62
|
-
run: |
|
|
63
|
-
cd apps/mobile/android
|
|
64
|
-
./gradlew assembleRelease
|
|
65
|
-
if: hashFiles('apps/mobile/android/build.gradle') != ''
|
|
66
|
-
|
|
67
|
-
- name: Start Docker containers
|
|
68
|
-
run: |
|
|
69
|
-
chmod +x ./start.sh
|
|
70
|
-
./start.sh
|
|
71
|
-
|
|
72
|
-
- name: Run tests
|
|
73
|
-
run: pnpm test:server
|
|
1
|
+
name: Stack CI Prod
|
|
2
|
+
|
|
3
|
+
# Generated by @factiii/stack v{VERSION}
|
|
4
|
+
# Runs builds and tests on push to prod branch.
|
|
5
|
+
# No deployment - deploy via SSH from dev machine.
|
|
6
|
+
|
|
7
|
+
on:
|
|
8
|
+
push:
|
|
9
|
+
branches: [prod]
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
ci:
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
env:
|
|
15
|
+
CI: true
|
|
16
|
+
ENV: test
|
|
17
|
+
NODE_ENV: test
|
|
18
|
+
DATABASE_URL: "postgresql://postgres:password@localhost:5440/factiii-test?connect_timeout=300"
|
|
19
|
+
TEST_DATABASE_URL: "postgresql://postgres:password@localhost:5440/factiii-test?connect_timeout=300"
|
|
20
|
+
TEST_ADMIN_IP: "::ffff:127.0.0.1"
|
|
21
|
+
SITE_URL: http://localhost:3000
|
|
22
|
+
ALLOWED_ORIGINS: http://localhost:3000,http://localhost:5001
|
|
23
|
+
ACCESS_TOKEN_SECRET: test-secret-key
|
|
24
|
+
GOOGLE_CLIENT_ID: test-google-id
|
|
25
|
+
APPLE_CLIENT_ID: com.factiii.test
|
|
26
|
+
NEXT_PUBLIC_SITE_URL: http://localhost:3000
|
|
27
|
+
NEXT_PUBLIC_API_URL: http://localhost:5001
|
|
28
|
+
|
|
29
|
+
steps:
|
|
30
|
+
- name: Checkout
|
|
31
|
+
uses: actions/checkout@v4
|
|
32
|
+
|
|
33
|
+
- name: Setup pnpm
|
|
34
|
+
uses: pnpm/action-setup@v4
|
|
35
|
+
|
|
36
|
+
- name: Setup Node.js
|
|
37
|
+
uses: actions/setup-node@v4
|
|
38
|
+
with:
|
|
39
|
+
node-version: '24'
|
|
40
|
+
cache: 'pnpm'
|
|
41
|
+
|
|
42
|
+
- name: Install dependencies
|
|
43
|
+
run: pnpm install
|
|
44
|
+
|
|
45
|
+
- name: Build server
|
|
46
|
+
run: pnpm build
|
|
47
|
+
working-directory: apps/server
|
|
48
|
+
|
|
49
|
+
- name: Build client
|
|
50
|
+
run: pnpm build
|
|
51
|
+
working-directory: client
|
|
52
|
+
if: hashFiles('client/package.json') != ''
|
|
53
|
+
|
|
54
|
+
- name: Setup Java (for Android)
|
|
55
|
+
uses: actions/setup-java@v4
|
|
56
|
+
with:
|
|
57
|
+
distribution: 'temurin'
|
|
58
|
+
java-version: '17'
|
|
59
|
+
if: hashFiles('apps/mobile/android/build.gradle') != ''
|
|
60
|
+
|
|
61
|
+
- name: Build Android
|
|
62
|
+
run: |
|
|
63
|
+
cd apps/mobile/android
|
|
64
|
+
./gradlew assembleRelease
|
|
65
|
+
if: hashFiles('apps/mobile/android/build.gradle') != ''
|
|
66
|
+
|
|
67
|
+
- name: Start Docker containers
|
|
68
|
+
run: |
|
|
69
|
+
chmod +x ./start.sh
|
|
70
|
+
./start.sh
|
|
71
|
+
|
|
72
|
+
- name: Run tests
|
|
73
|
+
run: pnpm test:server
|
|
@@ -99,13 +99,13 @@ class AmazonLinuxPlugin {
|
|
|
99
99
|
return false;
|
|
100
100
|
}
|
|
101
101
|
static helpText = {
|
|
102
|
-
SSH: `
|
|
103
|
-
SSH private key for accessing the Amazon Linux server.
|
|
104
|
-
|
|
105
|
-
For AWS EC2:
|
|
106
|
-
- Use the key pair you created when launching the instance
|
|
107
|
-
- Download the .pem file from AWS Console
|
|
108
|
-
|
|
102
|
+
SSH: `
|
|
103
|
+
SSH private key for accessing the Amazon Linux server.
|
|
104
|
+
|
|
105
|
+
For AWS EC2:
|
|
106
|
+
- Use the key pair you created when launching the instance
|
|
107
|
+
- Download the .pem file from AWS Console
|
|
108
|
+
|
|
109
109
|
Default user for Amazon Linux: ec2-user`,
|
|
110
110
|
};
|
|
111
111
|
// ============================================================
|
|
@@ -152,21 +152,21 @@ class AmazonLinuxPlugin {
|
|
|
152
152
|
* Get the command to install Docker on Amazon Linux 2023
|
|
153
153
|
*/
|
|
154
154
|
static getDockerInstallCommand() {
|
|
155
|
-
return `
|
|
156
|
-
sudo dnf update -y && \
|
|
157
|
-
sudo dnf install -y docker && \
|
|
158
|
-
sudo systemctl start docker && \
|
|
159
|
-
sudo systemctl enable docker && \
|
|
160
|
-
sudo usermod -aG docker $USER
|
|
155
|
+
return `
|
|
156
|
+
sudo dnf update -y && \
|
|
157
|
+
sudo dnf install -y docker && \
|
|
158
|
+
sudo systemctl start docker && \
|
|
159
|
+
sudo systemctl enable docker && \
|
|
160
|
+
sudo usermod -aG docker $USER
|
|
161
161
|
`;
|
|
162
162
|
}
|
|
163
163
|
/**
|
|
164
164
|
* Get the command to install Node.js on Amazon Linux
|
|
165
165
|
*/
|
|
166
166
|
static getNodeInstallCommand() {
|
|
167
|
-
return `
|
|
168
|
-
curl -fsSL https://rpm.nodesource.com/setup_20.x | sudo bash - && \
|
|
169
|
-
sudo dnf install -y nodejs
|
|
167
|
+
return `
|
|
168
|
+
curl -fsSL https://rpm.nodesource.com/setup_20.x | sudo bash - && \
|
|
169
|
+
sudo dnf install -y nodejs
|
|
170
170
|
`;
|
|
171
171
|
}
|
|
172
172
|
/**
|
|
@@ -138,16 +138,16 @@ class MacPlugin {
|
|
|
138
138
|
return Object.keys(config).length === 0;
|
|
139
139
|
}
|
|
140
140
|
static helpText = {
|
|
141
|
-
SSH: `
|
|
142
|
-
SSH private key for accessing the server.
|
|
143
|
-
|
|
144
|
-
Step 1: Generate a new SSH key pair (if needed):
|
|
145
|
-
ssh-keygen -t ed25519 -C "deploy-key" -f ~/.ssh/deploy_key
|
|
146
|
-
|
|
147
|
-
Step 2: Add PUBLIC key to server:
|
|
148
|
-
ssh-copy-id -i ~/.ssh/deploy_key.pub ubuntu@YOUR_HOST
|
|
149
|
-
|
|
150
|
-
Step 3: Paste the PRIVATE key below (multi-line, end with blank line):
|
|
141
|
+
SSH: `
|
|
142
|
+
SSH private key for accessing the server.
|
|
143
|
+
|
|
144
|
+
Step 1: Generate a new SSH key pair (if needed):
|
|
145
|
+
ssh-keygen -t ed25519 -C "deploy-key" -f ~/.ssh/deploy_key
|
|
146
|
+
|
|
147
|
+
Step 2: Add PUBLIC key to server:
|
|
148
|
+
ssh-copy-id -i ~/.ssh/deploy_key.pub ubuntu@YOUR_HOST
|
|
149
|
+
|
|
150
|
+
Step 3: Paste the PRIVATE key below (multi-line, end with blank line):
|
|
151
151
|
cat ~/.ssh/deploy_key`,
|
|
152
152
|
};
|
|
153
153
|
// ============================================================
|
|
@@ -238,8 +238,8 @@ class MacPlugin {
|
|
|
238
238
|
}
|
|
239
239
|
try {
|
|
240
240
|
const repoName = config.name ?? 'app';
|
|
241
|
-
await MacPlugin.sshExec(envConfig, `
|
|
242
|
-
cd ~/.factiii && docker compose stop ${repoName}-staging
|
|
241
|
+
await MacPlugin.sshExec(envConfig, `
|
|
242
|
+
cd ~/.factiii && docker compose stop ${repoName}-staging
|
|
243
243
|
`);
|
|
244
244
|
return { success: true, message: 'Staging containers stopped' };
|
|
245
245
|
}
|
|
@@ -291,7 +291,7 @@ async function writeEnvFile(envConfig, repoDir, environment, envVarsString) {
|
|
|
291
291
|
const escapedContent = envFileContent
|
|
292
292
|
.replace(/'/g, "'\\''")
|
|
293
293
|
.replace(/\n/g, '\\n');
|
|
294
|
-
await sshExecCommand(envConfig, `cat > ${repoDir}/${envFileName} << 'ENVEOF'
|
|
294
|
+
await sshExecCommand(envConfig, `cat > ${repoDir}/${envFileName} << 'ENVEOF'
|
|
295
295
|
${envFileContent}ENVEOF`);
|
|
296
296
|
}
|
|
297
297
|
}
|
|
@@ -347,7 +347,7 @@ async function createEnvFromStaging(envConfig, repoDir) {
|
|
|
347
347
|
console.log(' 📝 Created .env from .env.staging (with host port replacement)');
|
|
348
348
|
}
|
|
349
349
|
else {
|
|
350
|
-
await sshExecCommand(envConfig, `cat > ${envPath} << 'ENVEOF'
|
|
350
|
+
await sshExecCommand(envConfig, `cat > ${envPath} << 'ENVEOF'
|
|
351
351
|
${updatedContent}ENVEOF`);
|
|
352
352
|
console.log(' 📝 Created .env from .env.staging on remote server (with host port replacement)');
|
|
353
353
|
}
|
|
@@ -99,16 +99,16 @@ class UbuntuPlugin {
|
|
|
99
99
|
return false;
|
|
100
100
|
}
|
|
101
101
|
static helpText = {
|
|
102
|
-
SSH: `
|
|
103
|
-
SSH private key for accessing the Ubuntu server.
|
|
104
|
-
|
|
105
|
-
Step 1: Generate a new SSH key pair (if needed):
|
|
106
|
-
ssh-keygen -t ed25519 -C "deploy-key" -f ~/.ssh/deploy_key
|
|
107
|
-
|
|
108
|
-
Step 2: Add PUBLIC key to server:
|
|
109
|
-
ssh-copy-id -i ~/.ssh/deploy_key.pub ubuntu@YOUR_HOST
|
|
110
|
-
|
|
111
|
-
Step 3: Paste the PRIVATE key below (multi-line, end with blank line):
|
|
102
|
+
SSH: `
|
|
103
|
+
SSH private key for accessing the Ubuntu server.
|
|
104
|
+
|
|
105
|
+
Step 1: Generate a new SSH key pair (if needed):
|
|
106
|
+
ssh-keygen -t ed25519 -C "deploy-key" -f ~/.ssh/deploy_key
|
|
107
|
+
|
|
108
|
+
Step 2: Add PUBLIC key to server:
|
|
109
|
+
ssh-copy-id -i ~/.ssh/deploy_key.pub ubuntu@YOUR_HOST
|
|
110
|
+
|
|
111
|
+
Step 3: Paste the PRIVATE key below (multi-line, end with blank line):
|
|
112
112
|
cat ~/.ssh/deploy_key`,
|
|
113
113
|
};
|
|
114
114
|
// ============================================================
|
|
@@ -155,25 +155,25 @@ class UbuntuPlugin {
|
|
|
155
155
|
* Get the command to install Docker on Ubuntu
|
|
156
156
|
*/
|
|
157
157
|
static getDockerInstallCommand() {
|
|
158
|
-
return `
|
|
159
|
-
sudo apt-get update && \
|
|
160
|
-
sudo apt-get install -y ca-certificates curl gnupg && \
|
|
161
|
-
sudo install -m 0755 -d /etc/apt/keyrings && \
|
|
162
|
-
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg && \
|
|
163
|
-
sudo chmod a+r /etc/apt/keyrings/docker.gpg && \
|
|
164
|
-
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null && \
|
|
165
|
-
sudo apt-get update && \
|
|
166
|
-
sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin && \
|
|
167
|
-
sudo usermod -aG docker $USER
|
|
158
|
+
return `
|
|
159
|
+
sudo apt-get update && \
|
|
160
|
+
sudo apt-get install -y ca-certificates curl gnupg && \
|
|
161
|
+
sudo install -m 0755 -d /etc/apt/keyrings && \
|
|
162
|
+
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg && \
|
|
163
|
+
sudo chmod a+r /etc/apt/keyrings/docker.gpg && \
|
|
164
|
+
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null && \
|
|
165
|
+
sudo apt-get update && \
|
|
166
|
+
sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin && \
|
|
167
|
+
sudo usermod -aG docker $USER
|
|
168
168
|
`;
|
|
169
169
|
}
|
|
170
170
|
/**
|
|
171
171
|
* Get the command to install Node.js on Ubuntu
|
|
172
172
|
*/
|
|
173
173
|
static getNodeInstallCommand() {
|
|
174
|
-
return `
|
|
175
|
-
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash - && \
|
|
176
|
-
sudo apt-get install -y nodejs
|
|
174
|
+
return `
|
|
175
|
+
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash - && \
|
|
176
|
+
sudo apt-get install -y nodejs
|
|
177
177
|
`;
|
|
178
178
|
}
|
|
179
179
|
/**
|
|
@@ -99,12 +99,12 @@ class WindowsPlugin {
|
|
|
99
99
|
return false;
|
|
100
100
|
}
|
|
101
101
|
static helpText = {
|
|
102
|
-
SSH: `
|
|
103
|
-
SSH/RDP credentials for accessing the Windows server.
|
|
104
|
-
|
|
105
|
-
For SSH access, ensure OpenSSH Server is installed on Windows:
|
|
106
|
-
- Settings > Apps > Optional Features > Add a feature > OpenSSH Server
|
|
107
|
-
|
|
102
|
+
SSH: `
|
|
103
|
+
SSH/RDP credentials for accessing the Windows server.
|
|
104
|
+
|
|
105
|
+
For SSH access, ensure OpenSSH Server is installed on Windows:
|
|
106
|
+
- Settings > Apps > Optional Features > Add a feature > OpenSSH Server
|
|
107
|
+
|
|
108
108
|
For RDP access, use Remote Desktop Connection.`,
|
|
109
109
|
};
|
|
110
110
|
// ============================================================
|
|
@@ -182,11 +182,11 @@ class WindowsPlugin {
|
|
|
182
182
|
* Requires Docker Desktop or WSL2 with Docker
|
|
183
183
|
*/
|
|
184
184
|
static getDockerInstallCommand() {
|
|
185
|
-
return `
|
|
186
|
-
# Install Docker Desktop via Chocolatey
|
|
187
|
-
choco install docker-desktop -y
|
|
188
|
-
# Or install via winget
|
|
189
|
-
# winget install Docker.DockerDesktop
|
|
185
|
+
return `
|
|
186
|
+
# Install Docker Desktop via Chocolatey
|
|
187
|
+
choco install docker-desktop -y
|
|
188
|
+
# Or install via winget
|
|
189
|
+
# winget install Docker.DockerDesktop
|
|
190
190
|
`;
|
|
191
191
|
}
|
|
192
192
|
/**
|
|
@@ -205,10 +205,10 @@ class WindowsPlugin {
|
|
|
205
205
|
* Get the command to install Chocolatey (package manager)
|
|
206
206
|
*/
|
|
207
207
|
static getChocoInstallCommand() {
|
|
208
|
-
return `
|
|
209
|
-
Set-ExecutionPolicy Bypass -Scope Process -Force
|
|
210
|
-
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072
|
|
211
|
-
iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
|
|
208
|
+
return `
|
|
209
|
+
Set-ExecutionPolicy Bypass -Scope Process -Force
|
|
210
|
+
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072
|
|
211
|
+
iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
|
|
212
212
|
`;
|
|
213
213
|
}
|
|
214
214
|
// ============================================================
|