odac 0.9.0
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/.editorconfig +21 -0
- package/.github/workflows/auto-pr-description.yml +49 -0
- package/.github/workflows/release.yml +32 -0
- package/.github/workflows/test-coverage.yml +58 -0
- package/.husky/pre-commit +2 -0
- package/.kiro/steering/code-style.md +56 -0
- package/.kiro/steering/product.md +20 -0
- package/.kiro/steering/structure.md +77 -0
- package/.kiro/steering/tech.md +87 -0
- package/.prettierrc +10 -0
- package/.releaserc.js +134 -0
- package/AGENTS.md +84 -0
- package/CHANGELOG.md +181 -0
- package/CODE_OF_CONDUCT.md +83 -0
- package/CONTRIBUTING.md +63 -0
- package/LICENSE +661 -0
- package/README.md +57 -0
- package/SECURITY.md +26 -0
- package/bin/candy +10 -0
- package/bin/candypack +10 -0
- package/cli/index.js +3 -0
- package/cli/src/Cli.js +348 -0
- package/cli/src/Connector.js +93 -0
- package/cli/src/Monitor.js +416 -0
- package/core/Candy.js +87 -0
- package/core/Commands.js +239 -0
- package/core/Config.js +1094 -0
- package/core/Lang.js +52 -0
- package/core/Log.js +43 -0
- package/core/Process.js +26 -0
- package/docs/backend/01-overview/01-whats-in-the-candy-box.md +9 -0
- package/docs/backend/01-overview/02-super-handy-helper-functions.md +9 -0
- package/docs/backend/01-overview/03-development-server.md +79 -0
- package/docs/backend/02-structure/01-typical-project-layout.md +39 -0
- package/docs/backend/03-config/00-configuration-overview.md +214 -0
- package/docs/backend/03-config/01-database-connection.md +60 -0
- package/docs/backend/03-config/02-static-route-mapping-optional.md +20 -0
- package/docs/backend/03-config/03-request-timeout.md +11 -0
- package/docs/backend/03-config/04-environment-variables.md +227 -0
- package/docs/backend/03-config/05-early-hints.md +352 -0
- package/docs/backend/04-routing/01-basic-page-routes.md +28 -0
- package/docs/backend/04-routing/02-controller-less-view-routes.md +43 -0
- package/docs/backend/04-routing/03-api-and-data-routes.md +20 -0
- package/docs/backend/04-routing/04-authentication-aware-routes.md +48 -0
- package/docs/backend/04-routing/05-advanced-routing.md +14 -0
- package/docs/backend/04-routing/06-error-pages.md +101 -0
- package/docs/backend/04-routing/07-cron-jobs.md +149 -0
- package/docs/backend/05-controllers/01-how-to-build-a-controller.md +17 -0
- package/docs/backend/05-controllers/02-your-trusty-candy-assistant.md +20 -0
- package/docs/backend/05-controllers/03-controller-classes.md +93 -0
- package/docs/backend/05-forms/01-custom-forms.md +395 -0
- package/docs/backend/05-forms/02-automatic-database-insert.md +297 -0
- package/docs/backend/06-request-and-response/01-the-request-object-what-is-the-user-asking-for.md +96 -0
- package/docs/backend/06-request-and-response/02-sending-a-response-replying-to-the-user.md +40 -0
- package/docs/backend/07-views/01-the-view-directory.md +73 -0
- package/docs/backend/07-views/02-rendering-a-view.md +179 -0
- package/docs/backend/07-views/03-template-syntax.md +181 -0
- package/docs/backend/07-views/03-variables.md +328 -0
- package/docs/backend/07-views/04-request-data.md +231 -0
- package/docs/backend/07-views/05-conditionals.md +290 -0
- package/docs/backend/07-views/06-loops.md +353 -0
- package/docs/backend/07-views/07-translations.md +358 -0
- package/docs/backend/07-views/08-backend-javascript.md +398 -0
- package/docs/backend/07-views/09-comments.md +297 -0
- package/docs/backend/08-database/01-database-connection.md +99 -0
- package/docs/backend/08-database/02-using-mysql.md +322 -0
- package/docs/backend/09-validation/01-the-validator-service.md +424 -0
- package/docs/backend/10-authentication/01-user-logins-with-authjs.md +53 -0
- package/docs/backend/10-authentication/02-foiling-villains-with-csrf-protection.md +55 -0
- package/docs/backend/10-authentication/03-register.md +134 -0
- package/docs/backend/10-authentication/04-candy-register-forms.md +676 -0
- package/docs/backend/10-authentication/05-session-management.md +159 -0
- package/docs/backend/10-authentication/06-candy-login-forms.md +596 -0
- package/docs/backend/11-mail/01-the-mail-service.md +42 -0
- package/docs/backend/12-streaming/01-streaming-overview.md +300 -0
- package/docs/backend/13-utilities/01-candy-var.md +504 -0
- package/docs/frontend/01-overview/01-introduction.md +146 -0
- package/docs/frontend/02-ajax-navigation/01-quick-start.md +608 -0
- package/docs/frontend/02-ajax-navigation/02-configuration.md +370 -0
- package/docs/frontend/02-ajax-navigation/03-advanced-usage.md +519 -0
- package/docs/frontend/03-forms/01-form-handling.md +420 -0
- package/docs/frontend/04-api-requests/01-get-post.md +443 -0
- package/docs/frontend/05-streaming/01-client-streaming.md +163 -0
- package/docs/index.json +452 -0
- package/docs/server/01-installation/01-quick-install.md +19 -0
- package/docs/server/01-installation/02-manual-installation-via-npm.md +9 -0
- package/docs/server/02-get-started/01-core-concepts.md +7 -0
- package/docs/server/02-get-started/02-basic-commands.md +57 -0
- package/docs/server/02-get-started/03-cli-reference.md +276 -0
- package/docs/server/02-get-started/04-cli-quick-reference.md +102 -0
- package/docs/server/03-service/01-start-a-new-service.md +57 -0
- package/docs/server/03-service/02-delete-a-service.md +48 -0
- package/docs/server/04-web/01-create-a-website.md +36 -0
- package/docs/server/04-web/02-list-websites.md +9 -0
- package/docs/server/04-web/03-delete-a-website.md +29 -0
- package/docs/server/05-subdomain/01-create-a-subdomain.md +32 -0
- package/docs/server/05-subdomain/02-list-subdomains.md +33 -0
- package/docs/server/05-subdomain/03-delete-a-subdomain.md +41 -0
- package/docs/server/06-ssl/01-renew-an-ssl-certificate.md +34 -0
- package/docs/server/07-mail/01-create-a-mail-account.md +23 -0
- package/docs/server/07-mail/02-delete-a-mail-account.md +20 -0
- package/docs/server/07-mail/03-list-mail-accounts.md +20 -0
- package/docs/server/07-mail/04-change-account-password.md +23 -0
- package/eslint.config.mjs +120 -0
- package/framework/index.js +4 -0
- package/framework/src/Auth.js +309 -0
- package/framework/src/Candy.js +81 -0
- package/framework/src/Config.js +79 -0
- package/framework/src/Env.js +60 -0
- package/framework/src/Lang.js +57 -0
- package/framework/src/Mail.js +83 -0
- package/framework/src/Mysql.js +575 -0
- package/framework/src/Request.js +301 -0
- package/framework/src/Route/Cron.js +128 -0
- package/framework/src/Route/Internal.js +439 -0
- package/framework/src/Route.js +455 -0
- package/framework/src/Server.js +15 -0
- package/framework/src/Stream.js +163 -0
- package/framework/src/Token.js +37 -0
- package/framework/src/Validator.js +271 -0
- package/framework/src/Var.js +211 -0
- package/framework/src/View/EarlyHints.js +190 -0
- package/framework/src/View/Form.js +600 -0
- package/framework/src/View.js +513 -0
- package/framework/web/candy.js +838 -0
- package/jest.config.js +22 -0
- package/locale/de-DE.json +80 -0
- package/locale/en-US.json +79 -0
- package/locale/es-ES.json +80 -0
- package/locale/fr-FR.json +80 -0
- package/locale/pt-BR.json +80 -0
- package/locale/ru-RU.json +80 -0
- package/locale/tr-TR.json +85 -0
- package/locale/zh-CN.json +80 -0
- package/package.json +86 -0
- package/server/index.js +5 -0
- package/server/src/Api.js +88 -0
- package/server/src/DNS.js +940 -0
- package/server/src/Hub.js +535 -0
- package/server/src/Mail.js +571 -0
- package/server/src/SSL.js +180 -0
- package/server/src/Server.js +27 -0
- package/server/src/Service.js +248 -0
- package/server/src/Subdomain.js +64 -0
- package/server/src/Web/Firewall.js +170 -0
- package/server/src/Web/Proxy.js +134 -0
- package/server/src/Web.js +451 -0
- package/server/src/mail/imap.js +1091 -0
- package/server/src/mail/server.js +32 -0
- package/server/src/mail/smtp.js +786 -0
- package/test/cli/Cli.test.js +36 -0
- package/test/core/Candy.test.js +234 -0
- package/test/core/Commands.test.js +538 -0
- package/test/core/Config.test.js +1435 -0
- package/test/core/Lang.test.js +250 -0
- package/test/core/Process.test.js +156 -0
- package/test/framework/Route.test.js +239 -0
- package/test/framework/View/EarlyHints.test.js +282 -0
- package/test/scripts/check-coverage.js +132 -0
- package/test/server/Api.test.js +647 -0
- package/test/server/Client.test.js +338 -0
- package/test/server/DNS.test.js +2050 -0
- package/test/server/DNS.test.js.bak +2084 -0
- package/test/server/Log.test.js +73 -0
- package/test/server/Mail.account.test_.js +460 -0
- package/test/server/Mail.init.test_.js +411 -0
- package/test/server/Mail.test_.js +1340 -0
- package/test/server/SSL.test_.js +1491 -0
- package/test/server/Server.test.js +765 -0
- package/test/server/Service.test_.js +1127 -0
- package/test/server/Subdomain.test.js +440 -0
- package/test/server/Web/Firewall.test.js +175 -0
- package/test/server/Web.test_.js +1562 -0
- package/test/server/__mocks__/acme-client.js +17 -0
- package/test/server/__mocks__/bcrypt.js +50 -0
- package/test/server/__mocks__/child_process.js +389 -0
- package/test/server/__mocks__/crypto.js +432 -0
- package/test/server/__mocks__/fs.js +450 -0
- package/test/server/__mocks__/globalCandy.js +227 -0
- package/test/server/__mocks__/http-proxy.js +105 -0
- package/test/server/__mocks__/http.js +575 -0
- package/test/server/__mocks__/https.js +272 -0
- package/test/server/__mocks__/index.js +249 -0
- package/test/server/__mocks__/mail/server.js +100 -0
- package/test/server/__mocks__/mail/smtp.js +31 -0
- package/test/server/__mocks__/mailparser.js +81 -0
- package/test/server/__mocks__/net.js +369 -0
- package/test/server/__mocks__/node-forge.js +328 -0
- package/test/server/__mocks__/os.js +320 -0
- package/test/server/__mocks__/path.js +291 -0
- package/test/server/__mocks__/selfsigned.js +8 -0
- package/test/server/__mocks__/server/src/mail/server.js +100 -0
- package/test/server/__mocks__/server/src/mail/smtp.js +31 -0
- package/test/server/__mocks__/smtp-server.js +106 -0
- package/test/server/__mocks__/sqlite3.js +394 -0
- package/test/server/__mocks__/testFactories.js +299 -0
- package/test/server/__mocks__/testHelpers.js +363 -0
- package/test/server/__mocks__/tls.js +229 -0
- package/watchdog/index.js +3 -0
- package/watchdog/src/Watchdog.js +156 -0
- package/web/config.json +5 -0
- package/web/controller/page/about.js +27 -0
- package/web/controller/page/index.js +34 -0
- package/web/package.json +18 -0
- package/web/public/assets/css/style.css +1835 -0
- package/web/public/assets/js/app.js +96 -0
- package/web/route/www.js +19 -0
- package/web/skeleton/main.html +22 -0
- package/web/view/content/about.html +65 -0
- package/web/view/content/home.html +205 -0
- package/web/view/footer/main.html +11 -0
- package/web/view/head/main.html +5 -0
- package/web/view/header/main.html +14 -0
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
## 📖 CLI Reference
|
|
2
|
+
|
|
3
|
+
This comprehensive reference covers all CandyPack CLI commands and their usage patterns, including both interactive and single-line modes with prefix arguments.
|
|
4
|
+
|
|
5
|
+
### Command Structure
|
|
6
|
+
|
|
7
|
+
CandyPack CLI follows a hierarchical command structure:
|
|
8
|
+
```bash
|
|
9
|
+
candy [command] [subcommand] [prefixes] [arguments]
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
### Prefix Arguments
|
|
13
|
+
|
|
14
|
+
Most commands support prefix arguments that allow you to provide values directly in the command line, avoiding interactive prompts. This is especially useful for automation, scripting, and quick operations.
|
|
15
|
+
|
|
16
|
+
#### Common Prefixes
|
|
17
|
+
- `-d`, `--domain`: Domain name
|
|
18
|
+
- `-e`, `--email`: Email address
|
|
19
|
+
- `-p`, `--password`: Password
|
|
20
|
+
- `-s`, `--subdomain`: Subdomain name
|
|
21
|
+
- `-i`, `--id`: Service ID or name
|
|
22
|
+
- `-k`, `--key`: Authentication key
|
|
23
|
+
|
|
24
|
+
### Authentication Commands
|
|
25
|
+
|
|
26
|
+
#### `candy auth`
|
|
27
|
+
Define your server to your CandyPack account.
|
|
28
|
+
|
|
29
|
+
**Interactive:**
|
|
30
|
+
```bash
|
|
31
|
+
candy auth
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
**Single-line:**
|
|
35
|
+
```bash
|
|
36
|
+
candy auth -k your-auth-key
|
|
37
|
+
candy auth --key your-auth-key
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Basic Server Commands
|
|
41
|
+
|
|
42
|
+
#### `candy` (no arguments)
|
|
43
|
+
Display server status, uptime, and statistics.
|
|
44
|
+
|
|
45
|
+
#### `candy restart`
|
|
46
|
+
Restart the CandyPack server.
|
|
47
|
+
|
|
48
|
+
#### `candy monit`
|
|
49
|
+
Monitor websites and services in real-time.
|
|
50
|
+
|
|
51
|
+
#### `candy debug`
|
|
52
|
+
View live server and application logs.
|
|
53
|
+
|
|
54
|
+
#### `candy help`
|
|
55
|
+
Display help information for all commands.
|
|
56
|
+
|
|
57
|
+
### Service Management
|
|
58
|
+
|
|
59
|
+
#### `candy run <file>`
|
|
60
|
+
Add a new service by specifying the entry file path.
|
|
61
|
+
|
|
62
|
+
**Example:**
|
|
63
|
+
```bash
|
|
64
|
+
candy run /path/to/your/app.js
|
|
65
|
+
candy run ./index.js
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
#### `candy service delete`
|
|
69
|
+
Delete a running service.
|
|
70
|
+
|
|
71
|
+
**Interactive:**
|
|
72
|
+
```bash
|
|
73
|
+
candy service delete
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
**Single-line:**
|
|
77
|
+
```bash
|
|
78
|
+
candy service delete -i service-name
|
|
79
|
+
candy service delete --id service-name
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Website Management
|
|
83
|
+
|
|
84
|
+
#### `candy web create`
|
|
85
|
+
Create a new website configuration.
|
|
86
|
+
|
|
87
|
+
**Interactive:**
|
|
88
|
+
```bash
|
|
89
|
+
candy web create
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
**Single-line:**
|
|
93
|
+
```bash
|
|
94
|
+
candy web create -d example.com
|
|
95
|
+
candy web create --domain example.com
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
#### `candy web delete`
|
|
99
|
+
Delete a website configuration.
|
|
100
|
+
|
|
101
|
+
**Interactive:**
|
|
102
|
+
```bash
|
|
103
|
+
candy web delete
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
**Single-line:**
|
|
107
|
+
```bash
|
|
108
|
+
candy web delete -d example.com
|
|
109
|
+
candy web delete --domain example.com
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
#### `candy web list`
|
|
113
|
+
List all configured websites.
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
candy web list
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### Subdomain Management
|
|
120
|
+
|
|
121
|
+
#### `candy subdomain create`
|
|
122
|
+
Create a new subdomain.
|
|
123
|
+
|
|
124
|
+
**Interactive:**
|
|
125
|
+
```bash
|
|
126
|
+
candy subdomain create
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
**Single-line:**
|
|
130
|
+
```bash
|
|
131
|
+
candy subdomain create -s blog.example.com
|
|
132
|
+
candy subdomain create --subdomain blog.example.com
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
#### `candy subdomain delete`
|
|
136
|
+
Delete a subdomain.
|
|
137
|
+
|
|
138
|
+
**Interactive:**
|
|
139
|
+
```bash
|
|
140
|
+
candy subdomain delete
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
**Single-line:**
|
|
144
|
+
```bash
|
|
145
|
+
candy subdomain delete -s blog.example.com
|
|
146
|
+
candy subdomain delete --subdomain blog.example.com
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
#### `candy subdomain list`
|
|
150
|
+
List all subdomains for a domain.
|
|
151
|
+
|
|
152
|
+
**Interactive:**
|
|
153
|
+
```bash
|
|
154
|
+
candy subdomain list
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
**Single-line:**
|
|
158
|
+
```bash
|
|
159
|
+
candy subdomain list -d example.com
|
|
160
|
+
candy subdomain list --domain example.com
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
### SSL Certificate Management
|
|
164
|
+
|
|
165
|
+
#### `candy ssl renew`
|
|
166
|
+
Renew SSL certificate for a domain.
|
|
167
|
+
|
|
168
|
+
**Interactive:**
|
|
169
|
+
```bash
|
|
170
|
+
candy ssl renew
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
**Single-line:**
|
|
174
|
+
```bash
|
|
175
|
+
candy ssl renew -d example.com
|
|
176
|
+
candy ssl renew --domain example.com
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
### Mail Account Management
|
|
180
|
+
|
|
181
|
+
#### `candy mail create`
|
|
182
|
+
Create a new email account.
|
|
183
|
+
|
|
184
|
+
**Interactive:**
|
|
185
|
+
```bash
|
|
186
|
+
candy mail create
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
**Single-line:**
|
|
190
|
+
```bash
|
|
191
|
+
candy mail create -e user@example.com -p password123
|
|
192
|
+
candy mail create --email user@example.com --password password123
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
#### `candy mail delete`
|
|
196
|
+
Delete an email account.
|
|
197
|
+
|
|
198
|
+
**Interactive:**
|
|
199
|
+
```bash
|
|
200
|
+
candy mail delete
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
**Single-line:**
|
|
204
|
+
```bash
|
|
205
|
+
candy mail delete -e user@example.com
|
|
206
|
+
candy mail delete --email user@example.com
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
#### `candy mail list`
|
|
210
|
+
List all email accounts for a domain.
|
|
211
|
+
|
|
212
|
+
**Interactive:**
|
|
213
|
+
```bash
|
|
214
|
+
candy mail list
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
**Single-line:**
|
|
218
|
+
```bash
|
|
219
|
+
candy mail list -d example.com
|
|
220
|
+
candy mail list --domain example.com
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
#### `candy mail password`
|
|
224
|
+
Change password for an email account.
|
|
225
|
+
|
|
226
|
+
**Interactive:**
|
|
227
|
+
```bash
|
|
228
|
+
candy mail password
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
**Single-line:**
|
|
232
|
+
```bash
|
|
233
|
+
candy mail password -e user@example.com -p newpassword
|
|
234
|
+
candy mail password --email user@example.com --password newpassword
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
### Usage Tips
|
|
238
|
+
|
|
239
|
+
#### Automation and Scripting
|
|
240
|
+
Single-line commands with prefixes are perfect for automation:
|
|
241
|
+
|
|
242
|
+
```bash
|
|
243
|
+
#!/bin/bash
|
|
244
|
+
# Create multiple email accounts
|
|
245
|
+
candy mail create -e admin@example.com -p admin123
|
|
246
|
+
candy mail create -e support@example.com -p support123
|
|
247
|
+
candy mail create -e sales@example.com -p sales123
|
|
248
|
+
|
|
249
|
+
# Set up subdomains
|
|
250
|
+
candy subdomain create -s blog.example.com
|
|
251
|
+
candy subdomain create -s shop.example.com
|
|
252
|
+
candy subdomain create -s api.example.com
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
#### Mixed Usage
|
|
256
|
+
You can mix interactive and single-line modes as needed:
|
|
257
|
+
|
|
258
|
+
```bash
|
|
259
|
+
# Specify domain, but let the system prompt for other details
|
|
260
|
+
candy web create -d example.com
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
#### Password Security
|
|
264
|
+
When using password prefixes (`-p`, `--password`):
|
|
265
|
+
- Interactive mode requires password confirmation
|
|
266
|
+
- Single-line mode skips confirmation for automation
|
|
267
|
+
- Consider using environment variables for sensitive data in scripts
|
|
268
|
+
|
|
269
|
+
```bash
|
|
270
|
+
# Using environment variable
|
|
271
|
+
candy mail create -e user@example.com -p "$MAIL_PASSWORD"
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
### Error Handling
|
|
275
|
+
|
|
276
|
+
If a command fails or you provide invalid arguments, CandyPack will display helpful error messages and suggest corrections. Use `candy help [command]` to get specific help for any command.
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
## ⚡ CLI Quick Reference
|
|
2
|
+
|
|
3
|
+
A compact reference for all CandyPack CLI commands with their prefix arguments.
|
|
4
|
+
|
|
5
|
+
### Basic Commands
|
|
6
|
+
```bash
|
|
7
|
+
candy # Show server status
|
|
8
|
+
candy restart # Restart server
|
|
9
|
+
candy monit # Monitor services
|
|
10
|
+
candy debug # View live logs
|
|
11
|
+
candy help # Show help
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
### Authentication
|
|
15
|
+
```bash
|
|
16
|
+
candy auth [-k|--key] <key>
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
### Services
|
|
20
|
+
```bash
|
|
21
|
+
candy run <file> # Start new service
|
|
22
|
+
candy service delete [-i|--id] <service> # Delete service
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### Websites
|
|
26
|
+
```bash
|
|
27
|
+
candy web create [-d|--domain] <domain> # Create website
|
|
28
|
+
candy web delete [-d|--domain] <domain> # Delete website
|
|
29
|
+
candy web list # List websites
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### Subdomains
|
|
33
|
+
```bash
|
|
34
|
+
candy subdomain create [-s|--subdomain] <subdomain> # Create subdomain
|
|
35
|
+
candy subdomain delete [-s|--subdomain] <subdomain> # Delete subdomain
|
|
36
|
+
candy subdomain list [-d|--domain] <domain> # List subdomains
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### SSL Certificates
|
|
40
|
+
```bash
|
|
41
|
+
candy ssl renew [-d|--domain] <domain> # Renew SSL certificate
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Mail Accounts
|
|
45
|
+
```bash
|
|
46
|
+
candy mail create [-e|--email] <email> [-p|--password] <password> # Create account
|
|
47
|
+
candy mail delete [-e|--email] <email> # Delete account
|
|
48
|
+
candy mail list [-d|--domain] <domain> # List accounts
|
|
49
|
+
candy mail password [-e|--email] <email> [-p|--password] <password> # Change password
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Common Prefixes
|
|
53
|
+
| Prefix | Long Form | Description |
|
|
54
|
+
|--------|-----------|-------------|
|
|
55
|
+
| `-d` | `--domain` | Domain name |
|
|
56
|
+
| `-e` | `--email` | Email address |
|
|
57
|
+
| `-p` | `--password` | Password |
|
|
58
|
+
| `-s` | `--subdomain` | Subdomain name |
|
|
59
|
+
| `-i` | `--id` | Service ID/name |
|
|
60
|
+
| `-k` | `--key` | Authentication key |
|
|
61
|
+
|
|
62
|
+
### Usage Patterns
|
|
63
|
+
|
|
64
|
+
**Interactive Mode:**
|
|
65
|
+
```bash
|
|
66
|
+
candy web create
|
|
67
|
+
# Prompts for domain name
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
**Single-Line Mode:**
|
|
71
|
+
```bash
|
|
72
|
+
candy web create -d example.com
|
|
73
|
+
# No prompts, immediate execution
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
**Mixed Mode:**
|
|
77
|
+
```bash
|
|
78
|
+
candy mail create -e user@example.com
|
|
79
|
+
# Prompts only for password
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Automation Examples
|
|
83
|
+
```bash
|
|
84
|
+
# Batch create email accounts
|
|
85
|
+
candy mail create -e admin@example.com -p admin123
|
|
86
|
+
candy mail create -e support@example.com -p support456
|
|
87
|
+
|
|
88
|
+
# Set up multiple subdomains
|
|
89
|
+
candy subdomain create -s blog.example.com
|
|
90
|
+
candy subdomain create -s api.example.com
|
|
91
|
+
candy subdomain create -s shop.example.com
|
|
92
|
+
|
|
93
|
+
# Renew multiple SSL certificates
|
|
94
|
+
candy ssl renew -d example.com
|
|
95
|
+
candy ssl renew -d api.example.com
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### Tips
|
|
99
|
+
- Use single-line mode for scripts and automation
|
|
100
|
+
- Use interactive mode for one-off operations
|
|
101
|
+
- Combine both modes as needed
|
|
102
|
+
- All commands support `--help` for detailed information
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
## ⚙️ Start a New Service
|
|
2
|
+
|
|
3
|
+
To start a new service, use the `run` command followed by the path to your application's entry file.
|
|
4
|
+
|
|
5
|
+
### Usage
|
|
6
|
+
```bash
|
|
7
|
+
candy run <file>
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
### Arguments
|
|
11
|
+
- `<file>`: The path to the script or application entry point you want to run. This can be an absolute path or a relative path from your current directory.
|
|
12
|
+
|
|
13
|
+
### Examples
|
|
14
|
+
|
|
15
|
+
**Absolute path:**
|
|
16
|
+
```bash
|
|
17
|
+
candy run /path/to/your/app/index.js
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
**Relative path from current directory:**
|
|
21
|
+
```bash
|
|
22
|
+
candy run index.js
|
|
23
|
+
candy run ./src/server.js
|
|
24
|
+
candy run ../other-project/app.js
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
**Multiple services:**
|
|
28
|
+
```bash
|
|
29
|
+
# Start multiple services in sequence
|
|
30
|
+
candy run ./api/index.js
|
|
31
|
+
candy run ./worker/processor.js
|
|
32
|
+
candy run ./scheduler/cron.js
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### Path Resolution
|
|
36
|
+
- **Absolute paths**: Start with `/` (Linux/macOS) or drive letter (Windows)
|
|
37
|
+
- **Relative paths**: Resolved from your current working directory
|
|
38
|
+
- **Automatic conversion**: Relative paths are automatically converted to absolute paths internally
|
|
39
|
+
|
|
40
|
+
### Service Management
|
|
41
|
+
Once started, CandyPack will:
|
|
42
|
+
- Monitor the service continuously
|
|
43
|
+
- Automatically restart it if it crashes
|
|
44
|
+
- Assign it a unique service ID for management
|
|
45
|
+
- Log all output for debugging
|
|
46
|
+
|
|
47
|
+
You can view service status using:
|
|
48
|
+
```bash
|
|
49
|
+
candy monit # Real-time monitoring
|
|
50
|
+
candy # Quick status overview
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### Service Deletion
|
|
54
|
+
To remove a running service, use:
|
|
55
|
+
```bash
|
|
56
|
+
candy service delete -i <service-name-or-id>
|
|
57
|
+
```
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
## 🗑️ Delete a Service
|
|
2
|
+
|
|
3
|
+
This command removes a running service from CandyPack's monitoring and stops its execution.
|
|
4
|
+
|
|
5
|
+
### Interactive Usage
|
|
6
|
+
```bash
|
|
7
|
+
candy service delete
|
|
8
|
+
```
|
|
9
|
+
You will be prompted to enter the service ID or name that you want to delete.
|
|
10
|
+
|
|
11
|
+
### Single-Line Usage with Prefixes
|
|
12
|
+
```bash
|
|
13
|
+
# Specify service ID or name directly
|
|
14
|
+
candy service delete -i my-service
|
|
15
|
+
candy service delete -i /path/to/app/index.js
|
|
16
|
+
|
|
17
|
+
# Or use long form prefix
|
|
18
|
+
candy service delete --id my-service
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
### Available Prefixes
|
|
22
|
+
- `-i`, `--id`: Service ID or name to delete
|
|
23
|
+
|
|
24
|
+
### Finding Service Information
|
|
25
|
+
To find the service ID or name, use:
|
|
26
|
+
```bash
|
|
27
|
+
candy monit # Interactive monitoring view
|
|
28
|
+
candy # Quick status with service count
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### Interactive Example
|
|
32
|
+
```bash
|
|
33
|
+
$ candy service delete
|
|
34
|
+
> Enter the Service ID or Name: my-api-service
|
|
35
|
+
✓ Service 'my-api-service' deleted successfully
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Single-Line Example
|
|
39
|
+
```bash
|
|
40
|
+
$ candy service delete -i my-api-service
|
|
41
|
+
✓ Service 'my-api-service' deleted successfully
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Important Notes
|
|
45
|
+
- Deleting a service stops its execution immediately
|
|
46
|
+
- The service will no longer be monitored or automatically restarted
|
|
47
|
+
- This does not delete the source code files, only removes the service from CandyPack
|
|
48
|
+
- You can restart the same service later using `candy run <file>`
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
## 🌐 Create a Website
|
|
2
|
+
This command helps you set up a new website on your server. CandyPack will ask for the domain name and the path to the website's files.
|
|
3
|
+
|
|
4
|
+
### Interactive Usage
|
|
5
|
+
```bash
|
|
6
|
+
candy web create
|
|
7
|
+
```
|
|
8
|
+
After running the command, you will be prompted to enter the following information:
|
|
9
|
+
- **Domain Name:** The primary domain for your website (e.g., `example.com`).
|
|
10
|
+
- **Path:** The absolute path to your website's root directory (e.g., `/var/www/example.com`). If you leave this blank, CandyPack will suggest a default path based on the domain name.
|
|
11
|
+
|
|
12
|
+
### Single-Line Usage with Prefixes
|
|
13
|
+
```bash
|
|
14
|
+
# Specify domain directly
|
|
15
|
+
candy web create -d example.com
|
|
16
|
+
|
|
17
|
+
# Or use long form prefix
|
|
18
|
+
candy web create --domain example.com
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
### Available Prefixes
|
|
22
|
+
- `-d`, `--domain`: Domain name for the new website
|
|
23
|
+
|
|
24
|
+
### Interactive Example
|
|
25
|
+
```bash
|
|
26
|
+
$ candy web create
|
|
27
|
+
> Enter the domain name: example.com
|
|
28
|
+
> Enter the path to the website (/home/user/example.com/):
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### Single-Line Example
|
|
32
|
+
```bash
|
|
33
|
+
$ candy web create -d example.com
|
|
34
|
+
✓ Website created successfully for example.com
|
|
35
|
+
```
|
|
36
|
+
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
## 📋 List Websites
|
|
2
|
+
To see a list of all websites currently configured on your server, use the `list` command.
|
|
3
|
+
|
|
4
|
+
### Usage
|
|
5
|
+
```bash
|
|
6
|
+
candy web list
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
This command will output a table of your websites, showing their status and other relevant details. You can also monitor your websites in real-time with the `candy monit` command.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
## 🗑️ Delete a Website
|
|
2
|
+
|
|
3
|
+
You can delete a website using the `web delete` command. This command will prompt you for the domain name of the website you want to delete.
|
|
4
|
+
|
|
5
|
+
### Interactive Usage
|
|
6
|
+
```bash
|
|
7
|
+
candy web delete
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
The command will then ask for the domain name:
|
|
11
|
+
```
|
|
12
|
+
Enter the domain name: my-website.com
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
### Single-Line Usage with Prefixes
|
|
16
|
+
```bash
|
|
17
|
+
# Specify domain directly
|
|
18
|
+
candy web delete -d my-website.com
|
|
19
|
+
|
|
20
|
+
# Or use long form prefix
|
|
21
|
+
candy web delete --domain my-website.com
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
### Available Prefixes
|
|
25
|
+
- `-d`, `--domain`: Domain name of the website to delete
|
|
26
|
+
|
|
27
|
+
### Important Note
|
|
28
|
+
|
|
29
|
+
This command only removes the server configuration for the website. It **does not** delete the website's source code directory. If you want to remove the source code as well, you must delete the directory manually.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
## 🔗 Create a Subdomain
|
|
2
|
+
This command allows you to create a new subdomain. CandyPack will automatically configure it to point to a directory with the same name inside your main domain's root directory.
|
|
3
|
+
|
|
4
|
+
### Interactive Usage
|
|
5
|
+
```bash
|
|
6
|
+
candy subdomain create
|
|
7
|
+
```
|
|
8
|
+
After running the command, you will be prompted to enter the new subdomain name, including the main domain (e.g., `blog.example.com`).
|
|
9
|
+
|
|
10
|
+
### Single-Line Usage with Prefixes
|
|
11
|
+
```bash
|
|
12
|
+
# Specify subdomain directly
|
|
13
|
+
candy subdomain create -s blog.example.com
|
|
14
|
+
|
|
15
|
+
# Or use long form prefix
|
|
16
|
+
candy subdomain create --subdomain blog.example.com
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
### Available Prefixes
|
|
20
|
+
- `-s`, `--subdomain`: Full subdomain name (e.g., blog.example.com)
|
|
21
|
+
|
|
22
|
+
### Interactive Example
|
|
23
|
+
```bash
|
|
24
|
+
$ candy subdomain create
|
|
25
|
+
> Enter the subdomain name (subdomain.example.com): blog.example.com
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### Single-Line Example
|
|
29
|
+
```bash
|
|
30
|
+
$ candy subdomain create -s blog.example.com
|
|
31
|
+
✓ Subdomain blog.example.com created successfully
|
|
32
|
+
```
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
## 📋 List Subdomains
|
|
2
|
+
To see a list of all subdomains configured for a specific domain, use the `list` command.
|
|
3
|
+
|
|
4
|
+
### Interactive Usage
|
|
5
|
+
```bash
|
|
6
|
+
candy subdomain list
|
|
7
|
+
```
|
|
8
|
+
This command will prompt you to enter the main domain name for which you want to list the subdomains.
|
|
9
|
+
|
|
10
|
+
### Single-Line Usage with Prefixes
|
|
11
|
+
```bash
|
|
12
|
+
# Specify domain directly
|
|
13
|
+
candy subdomain list -d example.com
|
|
14
|
+
|
|
15
|
+
# Or use long form prefix
|
|
16
|
+
candy subdomain list --domain example.com
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
### Available Prefixes
|
|
20
|
+
- `-d`, `--domain`: Domain name to list subdomains for
|
|
21
|
+
|
|
22
|
+
### Interactive Example
|
|
23
|
+
```bash
|
|
24
|
+
$ candy subdomain list
|
|
25
|
+
> Enter the domain name: example.com
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### Single-Line Example
|
|
29
|
+
```bash
|
|
30
|
+
$ candy subdomain list -d example.com
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
This will display a list of all subdomains associated with `example.com`.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
## 🗑️ Delete a Subdomain
|
|
2
|
+
|
|
3
|
+
This command removes a subdomain configuration from your server.
|
|
4
|
+
|
|
5
|
+
### Interactive Usage
|
|
6
|
+
```bash
|
|
7
|
+
candy subdomain delete
|
|
8
|
+
```
|
|
9
|
+
You will be prompted to enter the full subdomain name (including the main domain) that you want to delete.
|
|
10
|
+
|
|
11
|
+
### Single-Line Usage with Prefixes
|
|
12
|
+
```bash
|
|
13
|
+
# Specify subdomain directly
|
|
14
|
+
candy subdomain delete -s blog.example.com
|
|
15
|
+
|
|
16
|
+
# Or use long form prefix
|
|
17
|
+
candy subdomain delete --subdomain blog.example.com
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
### Available Prefixes
|
|
21
|
+
- `-s`, `--subdomain`: Full subdomain name to delete (e.g., blog.example.com)
|
|
22
|
+
|
|
23
|
+
### Interactive Example
|
|
24
|
+
```bash
|
|
25
|
+
$ candy subdomain delete
|
|
26
|
+
> Enter the subdomain name (subdomain.example.com): blog.example.com
|
|
27
|
+
✓ Subdomain 'blog.example.com' deleted successfully
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### Single-Line Example
|
|
31
|
+
```bash
|
|
32
|
+
$ candy subdomain delete -s blog.example.com
|
|
33
|
+
✓ Subdomain 'blog.example.com' deleted successfully
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Important Notes
|
|
37
|
+
- This command only removes the server configuration for the subdomain
|
|
38
|
+
- It **does not** delete the subdomain's directory or files
|
|
39
|
+
- If you want to remove the files as well, you must delete the directory manually
|
|
40
|
+
- The subdomain will no longer be accessible after deletion
|
|
41
|
+
- SSL certificates associated with the subdomain may need to be renewed for the main domain
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
## 🔒 Renew an SSL Certificate
|
|
2
|
+
This command attempts to renew the SSL certificate for a given domain. This can be useful if a certificate is close to expiring and you want to force an early renewal.
|
|
3
|
+
|
|
4
|
+
### Interactive Usage
|
|
5
|
+
```bash
|
|
6
|
+
candy ssl renew
|
|
7
|
+
```
|
|
8
|
+
After running the command, you will be prompted to enter the domain name for which you want to renew the SSL certificate.
|
|
9
|
+
|
|
10
|
+
### Single-Line Usage with Prefixes
|
|
11
|
+
```bash
|
|
12
|
+
# Specify domain directly
|
|
13
|
+
candy ssl renew -d example.com
|
|
14
|
+
|
|
15
|
+
# Or use long form prefix
|
|
16
|
+
candy ssl renew --domain example.com
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
### Available Prefixes
|
|
20
|
+
- `-d`, `--domain`: Domain name to renew SSL certificate for
|
|
21
|
+
|
|
22
|
+
### Interactive Example
|
|
23
|
+
```bash
|
|
24
|
+
$ candy ssl renew
|
|
25
|
+
> Enter the domain name: example.com
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### Single-Line Example
|
|
29
|
+
```bash
|
|
30
|
+
$ candy ssl renew -d example.com
|
|
31
|
+
✓ SSL certificate renewal initiated for example.com
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
CandyPack will then handle the process of validating your domain and renewing the certificate.
|