Skip to content

Commit 7854c83

Browse files
Merge branch 'main' into feat/apps-deploy-flow
2 parents ff265e9 + b74b125 commit 7854c83

72 files changed

Lines changed: 1200 additions & 105 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.changeset/chubby-hornets-tease.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
"@bunny.net/database-studio": patch
3+
"@bunny.net/database-rest": patch
4+
"@bunny.net/cli": patch
5+
"@bunny.net/database-shell": patch
6+
---
7+
8+
Harden URL handling in the embedded database studio with thanks to @jedisct1

.changeset/db-size-bytes.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/fair-planets-wonder.md

Lines changed: 0 additions & 6 deletions
This file was deleted.

.changeset/lazy-rivers-update.md

Lines changed: 0 additions & 11 deletions
This file was deleted.

.changeset/silly-worlds-think.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/social-webs-enter.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/stale-cats-chew.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@bunny.net/database-studio": patch
3+
---
4+
5+
validate URL filters/sort and encode lookup column with thanks to @jedisct1
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: Upload templates
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- "templates/**"
8+
workflow_dispatch:
9+
10+
jobs:
11+
upload:
12+
name: Upload to Bunny Storage
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v5
16+
- name: Upload templates
17+
env:
18+
BUNNYNET_STORAGE_ENDPOINT: ${{ vars.BUNNYNET_STORAGE_ENDPOINT }}
19+
BUNNYNET_STORAGE_ZONE: ${{ vars.BUNNYNET_STORAGE_ZONE }}
20+
BUNNYNET_STORAGE_PASSWORD: ${{ secrets.BUNNYNET_STORAGE_PASSWORD }}
21+
run: |
22+
content_type_for() {
23+
case "$1" in
24+
*.json) echo "application/json" ;;
25+
*.svg) echo "image/svg+xml" ;;
26+
*.png) echo "image/png" ;;
27+
*.md) echo "text/markdown" ;;
28+
*) echo "application/octet-stream" ;;
29+
esac
30+
}
31+
32+
find templates -type f ! -name '.gitkeep' -print0 | while IFS= read -r -d '' file; do
33+
remote="$file"
34+
upload_file="$file"
35+
tmp=""
36+
37+
if [[ "$file" == *.jsonc ]]; then
38+
tmp=$(mktemp)
39+
if ! jq . "$file" > "$tmp"; then
40+
echo "::error file=$file::Invalid JSON (or JSONC with comments — switch the workflow to a JSONC stripper)"
41+
rm -f "$tmp"
42+
exit 1
43+
fi
44+
upload_file="$tmp"
45+
remote="${file%.jsonc}.json"
46+
fi
47+
48+
CHECKSUM=$(sha256sum "$upload_file" | awk '{print toupper($1)}')
49+
CONTENT_TYPE=$(content_type_for "$remote")
50+
echo "Uploading $file -> $remote ($CONTENT_TYPE)"
51+
curl --fail --show-error --silent \
52+
-X PUT \
53+
-H "AccessKey: ${BUNNYNET_STORAGE_PASSWORD}" \
54+
-H "Content-Type: ${CONTENT_TYPE}" \
55+
-H "Checksum: ${CHECKSUM}" \
56+
--upload-file "$upload_file" \
57+
"https://${BUNNYNET_STORAGE_ENDPOINT}/${BUNNYNET_STORAGE_ZONE}/${remote}"
58+
59+
if [ -n "$tmp" ]; then rm -f "$tmp"; fi
60+
done
61+
- name: Purge CDN cache
62+
env:
63+
BUNNYNET_API_KEY: ${{ secrets.BUNNYNET_API_KEY }}
64+
BUNNYNET_TEMPLATES_URL: ${{ vars.BUNNYNET_TEMPLATES_URL }}
65+
run: |
66+
ENCODED_URL=$(jq -rn --arg u "${BUNNYNET_TEMPLATES_URL}*" '$u|@uri')
67+
curl --fail --show-error --silent \
68+
-X POST \
69+
-H "AccessKey: ${BUNNYNET_API_KEY}" \
70+
"https://api.bunny.net/purge?url=${ENCODED_URL}&async=false"

packages/app-config/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# @bunny.net/app-config
2+
3+
## 0.0.1
4+
5+
### Patch Changes
6+
7+
- Updated dependencies [[`4be3c3d`](https://github.com/BunnyWay/cli/commit/4be3c3d6841a9e4679fb216e8ee083df873c9224), [`aa2f707`](https://github.com/BunnyWay/cli/commit/aa2f70729b1aba5dc781d762a160c52adbac4628)]:
8+
- @bunny.net/openapi-client@0.0.1

packages/app-config/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@bunny.net/app-config",
3-
"version": "0.0.0",
3+
"version": "0.0.1",
44
"private": true,
55
"type": "module",
66
"module": "src/index.ts",

0 commit comments

Comments
 (0)