sillydev 1.0.0 → 1.2.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9102635d2e7ac06f66d36dd44ea361de787e1d8d7357a3cdb677327ecb26974c
4
- data.tar.gz: 22131ee43b2a56dcaca660c0d7e45883055da548e5a5acd432c6c547770154e1
3
+ metadata.gz: 1d04b02882b0e2ba9317f55117c42fe35f0649604163ddc010a4ec43d2b880da
4
+ data.tar.gz: 858245e32676793f9e0191b2cd2ffed5053494e30fd28b15db0af8c08dc7e4a3
5
5
  SHA512:
6
- metadata.gz: 3df262ecb504008664795fc8780140886fea64729e4ebd6c29675c1c663db2b490188498a1eabb72def712654644cf3fa0047d011f586a5f22b45bbc5effc5ae
7
- data.tar.gz: 22d8573315748b14286eb5af88c0d7930ff6ea24f332211b1070408f188dc0f25d689688387d679236c1150d8bb7cc7700bd79d3c5876b2184c8349401901456
6
+ metadata.gz: eb649ec9a0871a70808ecdc9dfe9ec09a7685032b33b156fb1f65116574a125700c07dd09cb5cb8259cea76954713869ef667b4c7597bb2c3a3621c291e78b09
7
+ data.tar.gz: e2684ff26f7d78d7cef9f8c6af738732d39c3e71671ff1be068870dde86b2d58d84a0ed25a0b0fd6c79a848ca1e74da99875ab37884f52c3d20fcdf93f1df740
data/README.md CHANGED
@@ -54,10 +54,10 @@ Every endpoint of the client API, grouped as in the docs:
54
54
  | `schedules` | `list`, `create`, `update`, `run`, `create_task`, `update_task` |
55
55
  | `network` | `list`, `create`, `set_notes`, `set_primary`, `delete` |
56
56
  | `subusers` | `list`, `create`, `get`, `update`, `delete` |
57
- | `git` | `get`, `link`, `deploy`, `cancel_deployment`, `sync_config` |
58
- | `account` | `get`, `activity` |
57
+ | `git` | `get`, `link`, `deploy`, `deployment`, `redeploy`, `resume`, `cancel_deployment`, `sync_config` |
58
+ | `account` | `get`, `activity`, `get_status_subscription`, `update_status_subscription`, `add_status_discord_webhook`, `remove_status_discord_webhook` |
59
59
  | `server_creation` | `options`, `create` |
60
- | `databases` | `list`, `create`, `rotate_password`, `move`, `delete` |
60
+ | `databases` | `list`, `create`, `rotate_password`, `move`, `delete`, `backups`, `back_up`, `download_backup`, `restore_backup`, `undo_restore`, `deleted` |
61
61
  | `billing` | `get`, `checkout`, `database_checkout`, `credit`, `cancel_subscription` |
62
62
  | `monitoring` | `list_projects`, `create_key`, `list_issues`, `list_events`, `usage` |
63
63
 
@@ -90,6 +90,19 @@ client.panel.files.write("1a7ce997", "/config.json", JSON.generate(debug: false)
90
90
  client.panel.files.write("1a7ce997", "/logo.png", File.binread("logo.png")) # sent as binary
91
91
  ```
92
92
 
93
+ ### Status page notifications
94
+
95
+ The account can be emailed when staff post, update or resolve a status page incident, and can send
96
+ them to up to five Discord webhooks. Reading needs `account.read`; changing needs a key with the
97
+ `status.write` scope. A webhook's URL is never returned, only its last characters.
98
+
99
+ ```ruby
100
+ sub = client.panel.account.get_status_subscription
101
+ client.panel.account.update_status_subscription(subscribed: true, preset: "major") # everything, new_resolved or major
102
+ client.panel.account.add_status_discord_webhook(url: "https://discord.com/api/webhooks/…", label: "Ops")
103
+ client.panel.account.remove_status_discord_webhook(sub["discord"].first["id"])
104
+ ```
105
+
93
106
  ### Deploying from Git
94
107
 
95
108
  ```ruby
@@ -142,6 +155,21 @@ SillyDev::Client.new(
142
155
  `transport:` takes any object with a `call(request)` that returns a `SillyDev::Response`, which is
143
156
  useful for tests.
144
157
 
158
+ ## Folders and bulk actions
159
+
160
+ `client.panel.folders` manages the dashboard folders of the account and runs one action on several
161
+ servers at once. It is only available while an administrator has switched server folders on
162
+ (otherwise it raises `SillyDev::NotFoundError`). Changing folders needs an API key with the
163
+ `folders.write` scope.
164
+
165
+ ```ruby
166
+ folders = client.panel.folders.create(name: "Bots", colour: "blue")
167
+ client.panel.folders.assign(folders["data"].first["id"], [server_uuid])
168
+ client.panel.folders.bulk("restart", [server_uuid, other_uuid])["data"].each do |r|
169
+ puts [r["name"], r["status"], r["reason"]].join(" ") # done, skipped or failed
170
+ end
171
+ ```
172
+
145
173
  ## Live console
146
174
 
147
175
  `client.panel.console` follows a server's console live and sends commands to it. It connects over
@@ -184,9 +212,26 @@ sillydev command 1a7ce997 "say hi"
184
212
  sillydev logs 1a7ce997
185
213
  sillydev console 1a7ce997 # follow live; lines you type are sent as commands
186
214
  sillydev deploy 1a7ce997
215
+ sillydev deploy 1a7ce997 --resume # resume auto deploy after a rollback
216
+ sillydev rollback 1a7ce997 # deploy the previous commit again
217
+ sillydev deploy-log 1a7ce997 # what the last deploy's build and release printed
187
218
  sillydev files ls 1a7ce997 /src
188
219
  sillydev files cat 1a7ce997 /config.json
189
220
  sillydev backups create 1a7ce997 --name before-update
221
+ sillydev status subscription # status page emails and Discord webhooks
222
+ sillydev status subscribe --preset major # everything, new_resolved or major
223
+ sillydev status unsubscribe
224
+ sillydev status discord add https://discord.com/api/webhooks/… --label Ops
225
+ sillydev status discord remove 7
226
+ sillydev databases create "Bot cache" --engine valkey
227
+ sillydev keys get 12 user:1
228
+ sillydev folders list # dashboard folders, when switched on
229
+ sillydev bulk restart <uuid> <uuid> # up to 25 servers at once
230
+ sillydev passkeys
231
+ sillydev sessions
232
+ sillydev db backups list 3
233
+ sillydev db backups download 3 <backup> --output db.sql.gz
234
+ sillydev db backups restore 3 <backup> --yes
190
235
  ```
191
236
 
192
237
  `sillydev --help` lists every command.
@@ -195,9 +240,13 @@ sillydev backups create 1a7ce997 --name before-update
195
240
 
196
241
  `sillydev mcp` runs an [MCP](https://modelcontextprotocol.io) server on stdio, so an AI assistant can
197
242
  look after your servers. Its tools list servers, read a server's status, send power actions and
198
- console commands, read the recent console output, list and read files, deploy from Git and list
199
- backups. Nothing in it spends money, deletes anything or changes who can reach a server. Give it a key
200
- limited to the servers you want the assistant to reach.
243
+ console commands, read the recent console output, list and read files, deploy from Git, roll back to an earlier commit, read why a deploy failed and list
244
+ backups. It can also read the account's status page notification settings and change them
245
+ (`set_status_email_subscription`, `add_status_discord_webhook`, `remove_status_discord_webhook`);
246
+ those tools need a key with the `status.write` scope. Nothing in it spends money, deletes a server or a
247
+ backup, or changes who can reach a server. Power actions, console commands and deploys change a live
248
+ server without asking first, and the status tools change where the account's notifications go, so give
249
+ it a key limited to the servers and permissions you want the assistant to have.
201
250
 
202
251
  ```json
203
252
  {
@@ -239,6 +288,7 @@ Data is sent in the background every 10 seconds and at exit, along with CPU, mem
239
288
  counts (`runtime_metrics: false` turns those off). Exceptions that end the program are reported.
240
289
  Values of keys that look secret (`password`, `token`, `api_key`, ...) are replaced with `[redacted]`.
241
290
  `sample_rate:` and `before_send: ->(type, item) { item }` (return `nil` to drop) let you send less.
291
+ An `endpoint:` (or `SILLYDEV_MONITORING_URL`) must be `https://`, or `http://` to this machine; the key is never sent over any other `http://` address unless `SILLYDEV_ALLOW_INSECURE_HTTP=1` is set.
242
292
  `SILLYDEV_MONITORING_DISABLED=1` turns it off. Forked workers (Puma, Unicorn) start their own sender.
243
293
 
244
294
  ### Rack, Rails and Sinatra