@stacksjs/ts-cloud 0.9.2 → 0.9.3
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/bin/chunk-09nwf2gy.js +34 -0
- package/dist/bin/chunk-14cwr6eh.js +70 -0
- package/dist/bin/chunk-271gk1n2.js +6 -0
- package/dist/bin/chunk-38pq971s.js +2 -0
- package/dist/bin/chunk-3gykfyq4.js +37 -0
- package/dist/bin/chunk-3r4fb59r.js +3 -0
- package/dist/bin/chunk-41x17hw1.js +1 -0
- package/dist/bin/chunk-4vrqm9h0.js +2 -0
- package/dist/bin/chunk-57y1zxbf.js +3 -0
- package/dist/bin/chunk-598yf4bs.js +1 -0
- package/dist/bin/chunk-8v7ddyvf.js +1 -0
- package/dist/bin/chunk-92mea34a.js +1 -0
- package/dist/bin/chunk-9pvsff8g.js +1 -0
- package/dist/bin/chunk-9v39615t.js +1 -0
- package/dist/bin/chunk-avm7tnwe.js +1 -0
- package/dist/bin/chunk-ax9mr6wm.js +44 -0
- package/dist/bin/chunk-axhnkn5g.js +2 -0
- package/dist/bin/chunk-b5gd39s8.js +512 -0
- package/dist/bin/chunk-b9qbp8j1.js +1 -0
- package/dist/bin/chunk-bz828v8q.js +3 -0
- package/dist/bin/chunk-c1vcdgvr.js +1 -0
- package/dist/bin/chunk-ctd2vg9w.js +2 -0
- package/dist/bin/chunk-dbgffky8.js +1 -0
- package/dist/bin/chunk-dwr30vbv.js +1 -0
- package/dist/bin/chunk-e3xrwh9z.js +1 -0
- package/dist/bin/chunk-fhc6ntvd.js +2 -0
- package/dist/bin/chunk-fpm59y25.js +6 -0
- package/dist/bin/chunk-fvbxvq6b.js +1 -0
- package/dist/bin/chunk-fy8j3y8p.js +92 -0
- package/dist/bin/chunk-fz21b57w.js +1 -0
- package/dist/bin/chunk-gavvf0pg.js +141 -0
- package/dist/bin/chunk-ggn7ax8p.js +4 -0
- package/dist/bin/chunk-gpe2prkm.js +1 -0
- package/dist/bin/chunk-gqf6jsmy.js +1 -0
- package/dist/bin/chunk-h5pa5men.js +2 -0
- package/dist/bin/chunk-hm08xdxf.js +2 -0
- package/dist/bin/chunk-hzgz13nf.js +1 -0
- package/dist/bin/chunk-hzqw8xm5.js +111 -0
- package/dist/bin/chunk-j703btc5.js +50 -0
- package/dist/bin/chunk-jpjamjey.js +6935 -0
- package/dist/bin/chunk-m2zwtapr.js +1 -0
- package/dist/bin/chunk-m669wtgr.js +1 -0
- package/dist/bin/chunk-mh0kdzqp.js +2 -0
- package/dist/bin/chunk-mr0atd2s.js +2 -0
- package/dist/bin/chunk-ngcyftm2.js +1 -0
- package/dist/bin/chunk-p66ptpmr.js +2 -0
- package/dist/bin/chunk-p8q9bq9g.js +1 -0
- package/dist/bin/chunk-r3kv0vm9.js +6 -0
- package/dist/bin/chunk-r9hjwcj9.js +6 -0
- package/dist/bin/chunk-rtczra13.js +1 -0
- package/dist/bin/chunk-ry030a6b.js +1507 -0
- package/dist/bin/chunk-rytk89az.js +60 -0
- package/dist/bin/chunk-sgyffpgm.js +581 -0
- package/dist/bin/chunk-vek8a0w6.js +1 -0
- package/dist/bin/chunk-waayf9ay.js +2 -0
- package/dist/bin/chunk-ynjvbphf.js +8 -0
- package/dist/bin/chunk-yv9sth30.js +1 -0
- package/dist/bin/cli.js +417 -10597
- package/dist/bin/dashboard-server.js +1 -6998
- package/dist/{chunk-hg7rhrgd.js → chunk-1c8dbv57.js} +5 -1
- package/dist/{chunk-rxgchb08.js → chunk-q0st3se8.js} +1 -1
- package/dist/deploy/attach-credentials.d.ts +57 -0
- package/dist/deploy/index.js +2 -2
- package/dist/deploy/site-ports.d.ts +151 -0
- package/dist/deploy/site-target.d.ts +24 -1
- package/dist/drivers/index.js +1 -1
- package/dist/index.js +2 -2
- package/dist/ui/404.html +16 -548
- package/dist/ui/_stx/chunk.5ddb5087.js +90 -0
- package/dist/ui/_stx/chunk.9fd39d5b.js +86 -0
- package/dist/ui/_stx/chunk.d5301f79.js +119 -0
- package/dist/ui/_stx/crosswind.222ed683.css +1 -0
- package/dist/ui/_stx/crosswind.616c25f3.css +1 -0
- package/dist/ui/_stx/crosswind.80baa894.css +320 -0
- package/dist/ui/_stx/crosswind.906ee17c.css +1 -0
- package/dist/ui/_stx/crosswind.996ed49e.css +1 -0
- package/dist/ui/_stx/crosswind.b7a99a5c.css +1 -0
- package/dist/ui/_stx/router.fa5bc4dc.js +4 -0
- package/dist/ui/_stx/runtime.c696d17a.js +1 -0
- package/dist/ui/_stx/style.448ab192.css +1 -0
- package/dist/ui/accept-invitation.html +2 -1133
- package/dist/ui/access-denied.html +7 -1130
- package/dist/ui/account/automation.html +12 -1134
- package/dist/ui/account/security.html +13 -1136
- package/dist/ui/applications/compose.html +12 -1134
- package/dist/ui/applications/new.html +13 -1137
- package/dist/ui/data/backups.html +91 -1136
- package/dist/ui/data/services.html +89 -1136
- package/dist/ui/data/volumes.html +61 -1136
- package/dist/ui/index.html +60 -1136
- package/dist/ui/infrastructure/topology.html +128 -1135
- package/dist/ui/integrations.html +13 -1138
- package/dist/ui/operations/alerts.html +59 -1136
- package/dist/ui/operations/configuration.html +13 -1135
- package/dist/ui/operations/jobs.html +87 -1136
- package/dist/ui/operations/maintenance.html +12 -1134
- package/dist/ui/operations/observability.html +93 -1136
- package/dist/ui/operations/previews.html +12 -1134
- package/dist/ui/operations/queue.html +12 -1134
- package/dist/ui/operations/regions.html +12 -1134
- package/dist/ui/operations/releases.html +12 -1134
- package/dist/ui/operations/spend.html +65 -1136
- package/dist/ui/operations/workloads.html +115 -1136
- package/dist/ui/robots.txt +2 -0
- package/dist/ui/security.html +24 -1136
- package/dist/ui/server/actions.html +67 -1138
- package/dist/ui/server/activity.html +7 -1130
- package/dist/ui/server/capacity.html +12 -1134
- package/dist/ui/server/database.html +166 -1135
- package/dist/ui/server/deployments.html +60 -1136
- package/dist/ui/server/diagnostics.html +7 -1130
- package/dist/ui/server/firewall.html +286 -1212
- package/dist/ui/server/fleet.html +45 -1136
- package/dist/ui/server/logs.html +34 -1135
- package/dist/ui/server/metrics.html +124 -1140
- package/dist/ui/server/security.html +7 -1130
- package/dist/ui/server/services.html +46 -1133
- package/dist/ui/server/sites.html +287 -1137
- package/dist/ui/server/ssh-keys.html +62 -1135
- package/dist/ui/server/team.html +155 -1136
- package/dist/ui/server/terminal.html +97 -1183
- package/dist/ui/serverless/alarms.html +62 -1135
- package/dist/ui/serverless/assets.html +47 -1132
- package/dist/ui/serverless/cost.html +7 -1130
- package/dist/ui/serverless/data.html +46 -1135
- package/dist/ui/serverless/deployments.html +47 -1132
- package/dist/ui/serverless/firewall.html +7 -1130
- package/dist/ui/serverless/functions.html +50 -1136
- package/dist/ui/serverless/logs.html +34 -1135
- package/dist/ui/serverless/metrics.html +7 -1130
- package/dist/ui/serverless/queues.html +58 -1135
- package/dist/ui/serverless/secrets.html +62 -1136
- package/dist/ui/serverless/traces.html +12 -1134
- package/dist/ui/serverless.html +64 -1137
- package/dist/ui-src/pages/server/firewall.stx +14 -14
- package/package.json +3 -3
|
@@ -20,7 +20,7 @@ const messageKind = state('')
|
|
|
20
20
|
const reserved = [22, 80, 443]
|
|
21
21
|
const posture = state(null)
|
|
22
22
|
const ipRules = state({ allow: [], block: [] })
|
|
23
|
-
const
|
|
23
|
+
const working = state(false)
|
|
24
24
|
function setMessage(text, kind) { message.set(text); messageKind.set(kind || '') }
|
|
25
25
|
function applyLine(apply) {
|
|
26
26
|
if (!apply) return ''
|
|
@@ -35,13 +35,13 @@ async function loadProtection() {
|
|
|
35
35
|
} catch { posture.set(null) }
|
|
36
36
|
}
|
|
37
37
|
async function protect(path, body, note) {
|
|
38
|
-
|
|
38
|
+
working.set(true)
|
|
39
39
|
try {
|
|
40
40
|
await requestJson(path, { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify(body) })
|
|
41
41
|
setMessage(note, 'ok')
|
|
42
42
|
await loadProtection()
|
|
43
43
|
} catch (e) { setMessage((e && e.message) || 'Request failed.', 'bad') }
|
|
44
|
-
finally {
|
|
44
|
+
finally { working.set(false) }
|
|
45
45
|
}
|
|
46
46
|
async function toggleAttackMode(on) {
|
|
47
47
|
if (on && !confirm('Attack mode challenges every visitor, including legitimate ones. Continue?')) return
|
|
@@ -61,13 +61,13 @@ async function addIpRule(list, cidr) {
|
|
|
61
61
|
await protect('/api/protection/ip-rules', { list, cidr }, `Added ${cidr} to the ${list} list.`)
|
|
62
62
|
}
|
|
63
63
|
async function removeIpRule(list, cidr) {
|
|
64
|
-
|
|
64
|
+
working.set(true)
|
|
65
65
|
try {
|
|
66
66
|
await requestJson('/api/protection/ip-rules', { method: 'DELETE', headers: { 'content-type': 'application/json' }, body: JSON.stringify({ list, cidr }) })
|
|
67
67
|
setMessage(`Removed ${cidr} from the ${list} list.`, 'ok')
|
|
68
68
|
await loadProtection()
|
|
69
69
|
} catch (e) { setMessage((e && e.message) || 'Request failed.', 'bad') }
|
|
70
|
-
finally {
|
|
70
|
+
finally { working.set(false) }
|
|
71
71
|
}
|
|
72
72
|
function submitIpRule(event) {
|
|
73
73
|
event.preventDefault()
|
|
@@ -86,17 +86,17 @@ async function load() {
|
|
|
86
86
|
} catch (e) { setMessage((e && e.message) || 'Could not read firewall config.', 'bad') }
|
|
87
87
|
}
|
|
88
88
|
async function allowPort() {
|
|
89
|
-
if (
|
|
89
|
+
if (working()) return
|
|
90
90
|
const port = Number(newPort())
|
|
91
91
|
if (!Number.isInteger(port) || port < 1 || port > 65535) { setMessage('Port must be a whole number between 1 and 65535.', 'bad'); return }
|
|
92
92
|
if (reserved.includes(port)) { setMessage('Ports 22, 80, and 443 are always open, so there is nothing to add.', 'bad'); return }
|
|
93
|
-
|
|
93
|
+
working.set(true); setMessage('Allowing port ' + port + '...', '')
|
|
94
94
|
try {
|
|
95
95
|
const data = await requestJson('/api/firewall', { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify({ port }) })
|
|
96
96
|
ports.set(data.ports || []); newPort.set('')
|
|
97
97
|
setMessage('Allowed port ' + port + ' in cloud config.' + applyLine(data.apply), 'ok')
|
|
98
98
|
} catch (error) { setMessage(error?.message || 'Could not allow port.', 'bad') }
|
|
99
|
-
finally {
|
|
99
|
+
finally { working.set(false) }
|
|
100
100
|
}
|
|
101
101
|
async function removePort(port) {
|
|
102
102
|
setMessage('Removing port ' + port + '...', '')
|
|
@@ -133,8 +133,8 @@ onMount(() => { load() })
|
|
|
133
133
|
<p class="notice" :class="posture()?.attackMode || posture()?.mitigationPaused ? 'warn' : ''" @show="!!posture()">{{ posture()?.summary }}</p>
|
|
134
134
|
<p class="note" @show="!posture()">Protection controls are unavailable for this account.</p>
|
|
135
135
|
<div class="actions" @show="!!posture()">
|
|
136
|
-
<button class="btn ghost sm" :disabled="
|
|
137
|
-
<button class="btn danger ghost sm" :disabled="
|
|
136
|
+
<button class="btn ghost sm" :disabled="working()" @click="toggleAttackMode(!posture()?.attackMode)">{{ posture()?.attackMode ? 'Turn attack mode off' : 'Turn attack mode on' }}</button>
|
|
137
|
+
<button class="btn danger ghost sm" :disabled="working()" @click="togglePause(!posture()?.mitigationPaused)">{{ posture()?.mitigationPaused ? 'Resume mitigation' : 'Pause mitigation' }}</button>
|
|
138
138
|
</div>
|
|
139
139
|
<p class="note">Attack mode challenges every visitor, so it is time-boxed and lifts itself. Pausing mitigation serves and bills all traffic, including attacks, and is capped at 24 hours.</p>
|
|
140
140
|
</div>
|
|
@@ -146,16 +146,16 @@ onMount(() => { load() })
|
|
|
146
146
|
<form class="inline-form" @submit="submitIpRule($event)">
|
|
147
147
|
<select name="list" aria-label="List"><option value="block">Block</option><option value="allow">Allow</option></select>
|
|
148
148
|
<input name="cidr" placeholder="203.0.113.0/24" aria-label="IP or CIDR" required>
|
|
149
|
-
<button class="btn sm" type="submit" :disabled="
|
|
149
|
+
<button class="btn sm" type="submit" :disabled="working()">Add</button>
|
|
150
150
|
</form>
|
|
151
151
|
<table>
|
|
152
152
|
<thead><tr><th scope="col">List</th><th scope="col">CIDR</th><th scope="col"></th></tr></thead>
|
|
153
153
|
<tbody>
|
|
154
154
|
<template :for="cidr in ipRules().allow">
|
|
155
|
-
<tr><td><span class="ok pill">allow</span></td><td class="mono">{{ cidr }}</td><td><button class="btn ghost sm" :disabled="
|
|
155
|
+
<tr><td><span class="ok pill">allow</span></td><td class="mono">{{ cidr }}</td><td><button class="btn ghost sm" :disabled="working()" @click="removeIpRule('allow', cidr)">Remove</button></td></tr>
|
|
156
156
|
</template>
|
|
157
157
|
<template :for="cidr in ipRules().block">
|
|
158
|
-
<tr><td><span class="bad pill">block</span></td><td class="mono">{{ cidr }}</td><td><button class="btn ghost sm" :disabled="
|
|
158
|
+
<tr><td><span class="bad pill">block</span></td><td class="mono">{{ cidr }}</td><td><button class="btn ghost sm" :disabled="working()" @click="removeIpRule('block', cidr)">Remove</button></td></tr>
|
|
159
159
|
</template>
|
|
160
160
|
</tbody>
|
|
161
161
|
</table>
|
|
@@ -189,7 +189,7 @@ onMount(() => { load() })
|
|
|
189
189
|
<input id="fw-port" type="number" min="1" max="65535" autocomplete="off" placeholder="8080" :value="newPort()" @input="newPort.set($event.target.value)" required>
|
|
190
190
|
</div>
|
|
191
191
|
<div class="form-actions">
|
|
192
|
-
<button class="btn" type="submit" :disabled="
|
|
192
|
+
<button class="btn" type="submit" :disabled="working()">Allow</button>
|
|
193
193
|
<span class="msg" :class="messageKind()" role="status">{{ message() }}</span>
|
|
194
194
|
</div>
|
|
195
195
|
</form>
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/ts-cloud",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.9.
|
|
4
|
+
"version": "0.9.3",
|
|
5
5
|
"description": "A lightweight, performant infrastructure-as-code library and CLI for deploying both server-based (EC2) and serverless applications.",
|
|
6
6
|
"author": "Chris Breuer <chris@stacksjs.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -98,8 +98,8 @@
|
|
|
98
98
|
},
|
|
99
99
|
"dependencies": {
|
|
100
100
|
"@stacksjs/ts-xml": "^0.1.0",
|
|
101
|
-
"@ts-cloud/aws-types": "0.9.
|
|
102
|
-
"@ts-cloud/core": "0.9.
|
|
101
|
+
"@ts-cloud/aws-types": "0.9.3",
|
|
102
|
+
"@ts-cloud/core": "0.9.3"
|
|
103
103
|
},
|
|
104
104
|
"devDependencies": {
|
|
105
105
|
"better-dx": "^0.2.16",
|