suthep 0.1.0-beta.1 → 0.2.0-beta.1
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/README.md +167 -69
- package/dist/commands/down.js +179 -0
- package/dist/commands/down.js.map +1 -0
- package/dist/commands/redeploy.js +59 -0
- package/dist/commands/redeploy.js.map +1 -0
- package/dist/commands/up.js +213 -0
- package/dist/commands/up.js.map +1 -0
- package/dist/index.js +28 -0
- package/dist/index.js.map +1 -1
- package/dist/utils/deployment.js +10 -1
- package/dist/utils/deployment.js.map +1 -1
- package/dist/utils/docker.js +35 -0
- package/dist/utils/docker.js.map +1 -1
- package/dist/utils/nginx.js +10 -0
- package/dist/utils/nginx.js.map +1 -1
- package/docs/README.md +25 -82
- package/docs/english/01-introduction.md +84 -0
- package/docs/english/02-installation.md +200 -0
- package/docs/english/03-quick-start.md +256 -0
- package/docs/english/04-configuration.md +358 -0
- package/docs/english/05-commands.md +363 -0
- package/docs/english/06-examples.md +456 -0
- package/docs/english/07-troubleshooting.md +417 -0
- package/docs/english/08-advanced.md +411 -0
- package/docs/english/README.md +48 -0
- package/docs/thai/01-introduction.md +84 -0
- package/docs/thai/02-installation.md +200 -0
- package/docs/thai/03-quick-start.md +256 -0
- package/docs/thai/04-configuration.md +358 -0
- package/docs/thai/05-commands.md +363 -0
- package/docs/thai/06-examples.md +456 -0
- package/docs/thai/07-troubleshooting.md +417 -0
- package/docs/thai/08-advanced.md +411 -0
- package/docs/thai/README.md +48 -0
- package/example/README.md +282 -53
- package/example/suthep-complete.yml +103 -0
- package/example/suthep-docker-only.yml +71 -0
- package/example/suthep-no-docker.yml +51 -0
- package/example/{muacle.yml → suthep-path-routing.yml} +20 -5
- package/example/suthep.example.yml +89 -0
- package/package.json +1 -1
- package/src/commands/down.ts +240 -0
- package/src/commands/redeploy.ts +78 -0
- package/src/commands/up.ts +271 -0
- package/src/index.ts +53 -0
- package/suthep-0.1.0-beta.1.tgz +0 -0
- package/suthep.example.yml +5 -0
- package/suthep.yml +39 -0
- package/docs/TRANSLATIONS.md +0 -211
- package/docs/en/README.md +0 -76
- package/docs/en/api-reference.md +0 -545
- package/docs/en/architecture.md +0 -369
- package/docs/en/commands.md +0 -273
- package/docs/en/configuration.md +0 -347
- package/docs/en/developer-guide.md +0 -588
- package/docs/en/docker-ports-config.md +0 -333
- package/docs/en/examples.md +0 -537
- package/docs/en/getting-started.md +0 -202
- package/docs/en/port-binding.md +0 -268
- package/docs/en/troubleshooting.md +0 -441
- package/docs/th/README.md +0 -64
- package/docs/th/commands.md +0 -202
- package/docs/th/configuration.md +0 -325
- package/docs/th/getting-started.md +0 -203
- package/example/docker-compose.yml +0 -76
- package/example/docker-ports-example.yml +0 -81
- package/example/port-binding-example.yml +0 -45
- package/example/suthep.yml +0 -46
- package/example/suthep=1.yml +0 -46
|
@@ -0,0 +1,363 @@
|
|
|
1
|
+
# Commands Reference
|
|
2
|
+
|
|
3
|
+
This guide covers all available Suthep commands and their options.
|
|
4
|
+
|
|
5
|
+
## Command Overview
|
|
6
|
+
|
|
7
|
+
Suthep provides the following commands:
|
|
8
|
+
|
|
9
|
+
- `suthep init` - Initialize configuration file
|
|
10
|
+
- `suthep setup` - Setup prerequisites
|
|
11
|
+
- `suthep deploy` - Deploy services
|
|
12
|
+
- `suthep down` - Stop services
|
|
13
|
+
- `suthep up` - Start services
|
|
14
|
+
- `suthep redeploy` - Redeploy services
|
|
15
|
+
|
|
16
|
+
## suthep init
|
|
17
|
+
|
|
18
|
+
Initialize a new deployment configuration file with interactive prompts.
|
|
19
|
+
|
|
20
|
+
### Usage
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
suthep init [options]
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### Options
|
|
27
|
+
|
|
28
|
+
| Option | Short | Description | Default |
|
|
29
|
+
|--------|-------|-------------|---------|
|
|
30
|
+
| `--file` | `-f` | Configuration file path | `suthep.yml` |
|
|
31
|
+
|
|
32
|
+
### Examples
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
# Create default configuration file
|
|
36
|
+
suthep init
|
|
37
|
+
|
|
38
|
+
# Create custom configuration file
|
|
39
|
+
suthep init -f my-config.yml
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### Interactive Prompts
|
|
43
|
+
|
|
44
|
+
The `init` command will prompt you for:
|
|
45
|
+
|
|
46
|
+
1. **Project Information**
|
|
47
|
+
- Project name
|
|
48
|
+
- Project version
|
|
49
|
+
|
|
50
|
+
2. **Service Configuration** (for each service)
|
|
51
|
+
- Service name
|
|
52
|
+
- Service port
|
|
53
|
+
- Domain names (comma-separated)
|
|
54
|
+
- Docker usage
|
|
55
|
+
- Docker image (if using Docker)
|
|
56
|
+
- Container name
|
|
57
|
+
- Container port
|
|
58
|
+
- Health check configuration
|
|
59
|
+
- Health check path
|
|
60
|
+
- Health check interval
|
|
61
|
+
|
|
62
|
+
3. **SSL Certificate**
|
|
63
|
+
- Email for Let's Encrypt
|
|
64
|
+
- Staging environment (for testing)
|
|
65
|
+
|
|
66
|
+
## suthep setup
|
|
67
|
+
|
|
68
|
+
Install and configure Nginx and Certbot on your system.
|
|
69
|
+
|
|
70
|
+
### Usage
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
suthep setup [options]
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### Options
|
|
77
|
+
|
|
78
|
+
| Option | Description |
|
|
79
|
+
|--------|-------------|
|
|
80
|
+
| `--nginx-only` | Only install and configure Nginx |
|
|
81
|
+
| `--certbot-only` | Only install and configure Certbot |
|
|
82
|
+
|
|
83
|
+
### Examples
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
# Setup both Nginx and Certbot
|
|
87
|
+
suthep setup
|
|
88
|
+
|
|
89
|
+
# Setup only Nginx
|
|
90
|
+
suthep setup --nginx-only
|
|
91
|
+
|
|
92
|
+
# Setup only Certbot
|
|
93
|
+
suthep setup --certbot-only
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### What It Does
|
|
97
|
+
|
|
98
|
+
1. **Checks for existing installations**
|
|
99
|
+
2. **Installs missing components:**
|
|
100
|
+
- Nginx (via apt-get, yum, or Homebrew)
|
|
101
|
+
- Certbot (via apt-get, yum, or Homebrew)
|
|
102
|
+
3. **Starts and enables services**
|
|
103
|
+
|
|
104
|
+
**Note:** Requires sudo privileges.
|
|
105
|
+
|
|
106
|
+
## suthep deploy
|
|
107
|
+
|
|
108
|
+
Deploy your project using the configuration file.
|
|
109
|
+
|
|
110
|
+
### Usage
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
suthep deploy [options]
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### Options
|
|
117
|
+
|
|
118
|
+
| Option | Short | Description | Default |
|
|
119
|
+
|--------|-------|-------------|---------|
|
|
120
|
+
| `--file` | `-f` | Configuration file path | `suthep.yml` |
|
|
121
|
+
| `--no-https` | - | Skip HTTPS/SSL certificate setup | `false` |
|
|
122
|
+
| `--no-nginx` | - | Skip Nginx configuration | `false` |
|
|
123
|
+
|
|
124
|
+
### Examples
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
# Deploy with default configuration
|
|
128
|
+
suthep deploy
|
|
129
|
+
|
|
130
|
+
# Deploy with custom config file
|
|
131
|
+
suthep deploy -f production.yml
|
|
132
|
+
|
|
133
|
+
# Deploy without HTTPS (for testing)
|
|
134
|
+
suthep deploy --no-https
|
|
135
|
+
|
|
136
|
+
# Deploy without Nginx (for testing)
|
|
137
|
+
suthep deploy --no-nginx
|
|
138
|
+
|
|
139
|
+
# Deploy without both
|
|
140
|
+
suthep deploy --no-https --no-nginx
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### What It Does
|
|
144
|
+
|
|
145
|
+
1. **Loads configuration** from `suthep.yml`
|
|
146
|
+
2. **Starts Docker containers** (if configured)
|
|
147
|
+
3. **Configures Nginx** reverse proxy
|
|
148
|
+
4. **Obtains SSL certificates** (if enabled)
|
|
149
|
+
5. **Updates Nginx** with HTTPS configuration
|
|
150
|
+
6. **Reloads Nginx** to apply changes
|
|
151
|
+
7. **Performs health checks** (if configured)
|
|
152
|
+
|
|
153
|
+
## suthep down
|
|
154
|
+
|
|
155
|
+
Bring down services (stop containers and disable Nginx configs).
|
|
156
|
+
|
|
157
|
+
### Usage
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
suthep down [service-name] [options]
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
### Arguments
|
|
164
|
+
|
|
165
|
+
| Argument | Description |
|
|
166
|
+
|----------|-------------|
|
|
167
|
+
| `service-name` | Name of the service to bring down (optional) |
|
|
168
|
+
|
|
169
|
+
### Options
|
|
170
|
+
|
|
171
|
+
| Option | Short | Description | Default |
|
|
172
|
+
|--------|-------|-------------|---------|
|
|
173
|
+
| `--file` | `-f` | Configuration file path | `suthep.yml` |
|
|
174
|
+
| `--all` | - | Bring down all services | `false` |
|
|
175
|
+
|
|
176
|
+
### Examples
|
|
177
|
+
|
|
178
|
+
```bash
|
|
179
|
+
# Bring down a specific service
|
|
180
|
+
suthep down api
|
|
181
|
+
|
|
182
|
+
# Bring down all services
|
|
183
|
+
suthep down --all
|
|
184
|
+
|
|
185
|
+
# Bring down with custom config
|
|
186
|
+
suthep down api -f production.yml
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
### What It Does
|
|
190
|
+
|
|
191
|
+
1. **Stops Docker containers** (if configured)
|
|
192
|
+
2. **Disables Nginx configurations**
|
|
193
|
+
3. **Reloads Nginx** to apply changes
|
|
194
|
+
|
|
195
|
+
## suthep up
|
|
196
|
+
|
|
197
|
+
Bring up services (start containers and enable Nginx configs).
|
|
198
|
+
|
|
199
|
+
### Usage
|
|
200
|
+
|
|
201
|
+
```bash
|
|
202
|
+
suthep up [service-name] [options]
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
### Arguments
|
|
206
|
+
|
|
207
|
+
| Argument | Description |
|
|
208
|
+
|----------|-------------|
|
|
209
|
+
| `service-name` | Name of the service to bring up (optional) |
|
|
210
|
+
|
|
211
|
+
### Options
|
|
212
|
+
|
|
213
|
+
| Option | Short | Description | Default |
|
|
214
|
+
|--------|-------|-------------|---------|
|
|
215
|
+
| `--file` | `-f` | Configuration file path | `suthep.yml` |
|
|
216
|
+
| `--all` | - | Bring up all services | `false` |
|
|
217
|
+
| `--no-https` | - | Skip HTTPS setup | `false` |
|
|
218
|
+
| `--no-nginx` | - | Skip Nginx configuration | `false` |
|
|
219
|
+
|
|
220
|
+
### Examples
|
|
221
|
+
|
|
222
|
+
```bash
|
|
223
|
+
# Bring up a specific service
|
|
224
|
+
suthep up api
|
|
225
|
+
|
|
226
|
+
# Bring up all services
|
|
227
|
+
suthep up --all
|
|
228
|
+
|
|
229
|
+
# Bring up without HTTPS
|
|
230
|
+
suthep up api --no-https
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
### What It Does
|
|
234
|
+
|
|
235
|
+
1. **Starts Docker containers** (if configured)
|
|
236
|
+
2. **Enables Nginx configurations**
|
|
237
|
+
3. **Sets up HTTPS** (if enabled)
|
|
238
|
+
4. **Reloads Nginx** to apply changes
|
|
239
|
+
|
|
240
|
+
## suthep redeploy
|
|
241
|
+
|
|
242
|
+
Redeploy services (bring down and deploy again).
|
|
243
|
+
|
|
244
|
+
### Usage
|
|
245
|
+
|
|
246
|
+
```bash
|
|
247
|
+
suthep redeploy [service-name] [options]
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
### Arguments
|
|
251
|
+
|
|
252
|
+
| Argument | Description |
|
|
253
|
+
|----------|-------------|
|
|
254
|
+
| `service-name` | Name of the service to redeploy (optional) |
|
|
255
|
+
|
|
256
|
+
### Options
|
|
257
|
+
|
|
258
|
+
| Option | Short | Description | Default |
|
|
259
|
+
|--------|-------|-------------|---------|
|
|
260
|
+
| `--file` | `-f` | Configuration file path | `suthep.yml` |
|
|
261
|
+
| `--all` | - | Redeploy all services | `false` |
|
|
262
|
+
| `--no-https` | - | Skip HTTPS setup | `false` |
|
|
263
|
+
| `--no-nginx` | - | Skip Nginx configuration | `false` |
|
|
264
|
+
|
|
265
|
+
### Examples
|
|
266
|
+
|
|
267
|
+
```bash
|
|
268
|
+
# Redeploy a specific service
|
|
269
|
+
suthep redeploy api
|
|
270
|
+
|
|
271
|
+
# Redeploy all services
|
|
272
|
+
suthep redeploy --all
|
|
273
|
+
|
|
274
|
+
# Redeploy without HTTPS
|
|
275
|
+
suthep redeploy api --no-https
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
### What It Does
|
|
279
|
+
|
|
280
|
+
1. **Brings down the service** (stops containers, disables Nginx)
|
|
281
|
+
2. **Deploys the service** (starts containers, enables Nginx, sets up HTTPS)
|
|
282
|
+
|
|
283
|
+
This is equivalent to running `suthep down` followed by `suthep deploy`.
|
|
284
|
+
|
|
285
|
+
## Global Options
|
|
286
|
+
|
|
287
|
+
All commands support:
|
|
288
|
+
|
|
289
|
+
- `--help` or `-h` - Show help message
|
|
290
|
+
- `--version` or `-V` - Show version number
|
|
291
|
+
|
|
292
|
+
### Examples
|
|
293
|
+
|
|
294
|
+
```bash
|
|
295
|
+
# Show help for deploy command
|
|
296
|
+
suthep deploy --help
|
|
297
|
+
|
|
298
|
+
# Show version
|
|
299
|
+
suthep --version
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
## Command Workflow
|
|
303
|
+
|
|
304
|
+
### Typical Deployment Workflow
|
|
305
|
+
|
|
306
|
+
```bash
|
|
307
|
+
# 1. Initialize configuration
|
|
308
|
+
suthep init
|
|
309
|
+
|
|
310
|
+
# 2. Setup prerequisites (first time only)
|
|
311
|
+
suthep setup
|
|
312
|
+
|
|
313
|
+
# 3. Deploy services
|
|
314
|
+
suthep deploy
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
### Update Workflow
|
|
318
|
+
|
|
319
|
+
```bash
|
|
320
|
+
# 1. Edit suthep.yml
|
|
321
|
+
nano suthep.yml
|
|
322
|
+
|
|
323
|
+
# 2. Redeploy
|
|
324
|
+
suthep redeploy
|
|
325
|
+
```
|
|
326
|
+
|
|
327
|
+
### Maintenance Workflow
|
|
328
|
+
|
|
329
|
+
```bash
|
|
330
|
+
# Stop services for maintenance
|
|
331
|
+
suthep down --all
|
|
332
|
+
|
|
333
|
+
# ... perform maintenance ...
|
|
334
|
+
|
|
335
|
+
# Start services again
|
|
336
|
+
suthep up --all
|
|
337
|
+
```
|
|
338
|
+
|
|
339
|
+
## Exit Codes
|
|
340
|
+
|
|
341
|
+
Suthep uses the following exit codes:
|
|
342
|
+
|
|
343
|
+
- `0` - Success
|
|
344
|
+
- `1` - Error (configuration error, deployment failure, etc.)
|
|
345
|
+
|
|
346
|
+
## Error Handling
|
|
347
|
+
|
|
348
|
+
If a command fails:
|
|
349
|
+
|
|
350
|
+
1. **Check the error message** - It usually indicates what went wrong
|
|
351
|
+
2. **Verify configuration** - Ensure `suthep.yml` is valid
|
|
352
|
+
3. **Check prerequisites** - Ensure Nginx and Certbot are installed
|
|
353
|
+
4. **Review logs** - Check Nginx and Docker logs for details
|
|
354
|
+
|
|
355
|
+
## Next Steps
|
|
356
|
+
|
|
357
|
+
- [Examples](./06-examples.md) - See commands in action
|
|
358
|
+
- [Troubleshooting](./07-troubleshooting.md) - Common issues and solutions
|
|
359
|
+
|
|
360
|
+
---
|
|
361
|
+
|
|
362
|
+
**Previous:** [Configuration Guide](./04-configuration.md) | **Next:** [Examples →](./06-examples.md)
|
|
363
|
+
|