underpost 3.2.30 → 3.2.80

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.
Files changed (46) hide show
  1. package/.github/workflows/ghpkg.ci.yml +87 -0
  2. package/.github/workflows/npmpkg.ci.yml +9 -6
  3. package/.github/workflows/publish.ci.yml +3 -3
  4. package/.github/workflows/pwa-microservices-template-page.cd.yml +0 -7
  5. package/.github/workflows/release.cd.yml +1 -1
  6. package/CHANGELOG.md +1230 -971
  7. package/CLI-HELP.md +14 -6
  8. package/README.md +3 -3
  9. package/bin/build.js +40 -4
  10. package/bin/deploy.js +2 -2
  11. package/bump.config.js +1 -0
  12. package/docker-compose.yml +26 -26
  13. package/manifests/cronjobs/dd-cron/dd-cron-backup.yaml +1 -1
  14. package/manifests/cronjobs/dd-cron/dd-cron-dns.yaml +1 -1
  15. package/manifests/deployment/dd-default-development/deployment.yaml +2 -2
  16. package/package.json +15 -15
  17. package/scripts/disk-clean.sh +85 -60
  18. package/scripts/test-monitor.sh +1 -1
  19. package/src/api/core/core.controller.js +4 -65
  20. package/src/api/core/core.router.js +8 -14
  21. package/src/api/default/default.controller.js +2 -70
  22. package/src/api/default/default.router.js +7 -17
  23. package/src/api/document/document.controller.js +5 -77
  24. package/src/api/document/document.router.js +9 -13
  25. package/src/api/file/file.controller.js +9 -53
  26. package/src/api/file/file.router.js +14 -6
  27. package/src/api/test/test.controller.js +8 -53
  28. package/src/api/test/test.router.js +1 -4
  29. package/src/cli/cluster.js +104 -11
  30. package/src/cli/db.js +4 -2
  31. package/src/cli/deploy.js +60 -11
  32. package/src/cli/docker-compose.js +212 -1
  33. package/src/cli/fs.js +45 -25
  34. package/src/cli/image.js +147 -51
  35. package/src/cli/index.js +26 -6
  36. package/src/cli/release.js +50 -4
  37. package/src/cli/repository.js +98 -24
  38. package/src/cli/run.js +380 -178
  39. package/src/cli/secrets.js +75 -46
  40. package/src/cli/ssh.js +30 -11
  41. package/src/client/components/core/Modal.js +38 -4
  42. package/src/index.js +1 -1
  43. package/src/server/catalog.js +2 -0
  44. package/src/server/conf.js +163 -3
  45. package/src/server/downloader.js +3 -3
  46. package/src/server/middlewares.js +152 -0
@@ -4,6 +4,16 @@ on:
4
4
  branches: ['master']
5
5
  pull_request:
6
6
  branches: ['master']
7
+ workflow_dispatch:
8
+ inputs:
9
+ conf_id:
10
+ description: 'Conf id of the canonical engine github package repo (engine-ghpkg-<conf_id>)'
11
+ required: false
12
+ default: 'cyberia'
13
+ message:
14
+ description: 'Commit message for the canonical package build'
15
+ required: false
16
+ default: ''
7
17
  permissions:
8
18
  contents: write
9
19
  packages: write
@@ -71,3 +81,80 @@ jobs:
71
81
  git status
72
82
  git commit -m "$LAST_COMMIT_MESSAGE"
73
83
  node bin push . underpostnet/pwa-microservices-template-ghpkg
84
+
85
+ engine-ghpkg:
86
+ if: github.repository == 'underpostnet/engine' && github.event_name == 'workflow_dispatch'
87
+ name: Build engine ${{ github.event.inputs.conf_id || 'cyberia' }} ghpkg repository
88
+ runs-on: ubuntu-latest
89
+ container:
90
+ image: quay.io/rockylinux/rockylinux:9
91
+ permissions:
92
+ contents: write
93
+ packages: write
94
+ id-token: write
95
+ steps:
96
+ - uses: actions/checkout@v7
97
+
98
+ - name: Install required packages
99
+ run: |
100
+ dnf install -y sudo tar gzip bzip2 git
101
+ dnf install -y curl --allowerasing
102
+
103
+ - name: Install Node.js
104
+ run: |
105
+ curl -fsSL https://rpm.nodesource.com/setup_24.x | bash -
106
+ dnf install nodejs -y
107
+
108
+ - name: Install dependencies
109
+ run: npm install
110
+
111
+ - name: Resolve canonical github package repo
112
+ run: |
113
+ CONF_ID="${{ github.event.inputs.conf_id }}"
114
+ CONF_ID="${CONF_ID:-cyberia}"
115
+ echo "CONF_ID=$CONF_ID" >> $GITHUB_ENV
116
+ echo "GHPKG_REPO=engine-ghpkg-$CONF_ID" >> $GITHUB_ENV
117
+ echo "PACKAGE_NAME=@underpostnet/$CONF_ID" >> $GITHUB_ENV
118
+ echo "[INFO] Canonical github package repo: underpostnet/engine-ghpkg-$CONF_ID"
119
+
120
+ - name: Capture commit message
121
+ run: |
122
+ FULL_MSG="${{ github.event.inputs.message }}"
123
+ if [ -z "$FULL_MSG" ]; then
124
+ FULL_MSG=$(node bin cmt --changelog-msg --from-n-commit 1 --changelog-no-hash 2>/dev/null || echo "")
125
+ fi
126
+ LAST_COMMIT_MESSAGE="${FULL_MSG:-Update canonical github package repo}"
127
+ echo "LAST_COMMIT_MESSAGE<<EOF" >> $GITHUB_ENV
128
+ echo "$LAST_COMMIT_MESSAGE" >> $GITHUB_ENV
129
+ echo "EOF" >> $GITHUB_ENV
130
+ echo "[INFO] Commit message: $LAST_COMMIT_MESSAGE"
131
+
132
+ - name: Set git global credentials
133
+ run: |
134
+ git config --global --add safe.directory '*'
135
+ git config --global credential.helper ""
136
+ git config --global user.name 'underpostnet'
137
+ git config --global user.email 'development@underpost.net'
138
+
139
+ - name: Mirror engine-$CONF_ID and Push to canonical github package repository
140
+ env:
141
+ GITHUB_TOKEN: ${{ secrets.GIT_AUTH_TOKEN }}
142
+ GITHUB_USERNAME: ${{ github.repository_owner }}
143
+ run: |
144
+ cd .. && node engine/bin clone underpostnet/engine-$CONF_ID
145
+ node engine/bin clone --bare underpostnet/$GHPKG_REPO
146
+ cd engine-$CONF_ID
147
+ rm -rf ./.git
148
+ mv ../$GHPKG_REPO.git ./.git
149
+ node ../engine/bin/deploy rename-package "$PACKAGE_NAME"
150
+ node ../engine/bin/deploy set-repo underpostnet/$GHPKG_REPO
151
+ git init
152
+ git config user.name 'underpostnet'
153
+ git config user.email 'development@underpost.net'
154
+ git add .
155
+ if git diff --cached --quiet; then
156
+ echo "[INFO] No changes to publish; skipping commit and push."
157
+ else
158
+ git commit -m "$LAST_COMMIT_MESSAGE"
159
+ node ../engine/bin push . underpostnet/$GHPKG_REPO
160
+ fi
@@ -110,14 +110,17 @@ jobs:
110
110
  DT="$DEPLOY_TYPE"
111
111
  fi
112
112
  echo "[INFO] Dispatching ${ENGINE}.ci.yml (sync=$SYNC, deploy_type=$DT)"
113
- INPUTS="{\"sync\":\"${SYNC}\""
114
- if [ -n "$DT" ]; then
115
- INPUTS="${INPUTS},\"deploy_type\":\"${DT}\""
116
- fi
117
- INPUTS="${INPUTS}}"
113
+ # Build the payload with node so the propagated message (may contain quotes/newlines)
114
+ # is JSON-escaped safely, and forward it so every engine-* repo shares one message.
115
+ PAYLOAD=$(SYNC="$SYNC" DT="$DT" MSG="$LAST_COMMIT_MESSAGE" node -e '
116
+ const i = { sync: process.env.SYNC };
117
+ if (process.env.DT) i.deploy_type = process.env.DT;
118
+ if (process.env.MSG) i.message = process.env.MSG;
119
+ process.stdout.write(JSON.stringify({ ref: "master", inputs: i }));
120
+ ')
118
121
  curl -s -X POST \
119
122
  -H "Accept: application/vnd.github.v3+json" \
120
123
  -H "Authorization: token ${{ secrets.GIT_AUTH_TOKEN }}" \
121
124
  "https://api.github.com/repos/underpostnet/engine/actions/workflows/${ENGINE}.ci.yml/dispatches" \
122
- -d "{\"ref\":\"master\",\"inputs\":${INPUTS}}"
125
+ -d "$PAYLOAD"
123
126
  done
@@ -24,7 +24,7 @@ jobs:
24
24
  sudo apt-get update -y
25
25
  sudo apt-get install -y sudo tar gzip bzip2 git curl
26
26
 
27
- - uses: actions/setup-node@v6
27
+ - uses: actions/setup-node@v7
28
28
  with:
29
29
  node-version: '24.x'
30
30
  registry-url: 'https://registry.npmjs.org'
@@ -56,7 +56,7 @@ jobs:
56
56
  steps:
57
57
  - uses: actions/checkout@v7
58
58
 
59
- - uses: actions/setup-node@v6
59
+ - uses: actions/setup-node@v7
60
60
  with:
61
61
  node-version: '24.x'
62
62
  registry-url: 'https://registry.npmjs.org'
@@ -71,7 +71,7 @@ jobs:
71
71
  run: npm publish --provenance --access public
72
72
 
73
73
  - name: Setup node to publish to GitHub Packages
74
- uses: actions/setup-node@v6
74
+ uses: actions/setup-node@v7
75
75
  with:
76
76
  node-version: '24.x'
77
77
  registry-url: 'https://npm.pkg.github.com'
@@ -1,28 +1,21 @@
1
- # Simple workflow for deploying static content to GitHub Pages
2
1
  name: CD | Gihub page | PWA Microservices Template
3
2
 
4
3
  on:
5
- # Runs on pushes targeting the default branch
6
4
  push:
7
5
  branches: ['main']
8
6
 
9
- # Allows you to run this workflow manually from the Actions tab
10
7
  workflow_dispatch:
11
8
 
12
- # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
13
9
  permissions:
14
10
  contents: read
15
11
  pages: write
16
12
  id-token: write
17
13
 
18
- # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
19
- # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
20
14
  concurrency:
21
15
  group: 'pages'
22
16
  cancel-in-progress: false
23
17
 
24
18
  jobs:
25
- # Single deploy job since we're just deploying
26
19
  deploy:
27
20
  if: github.repository == 'underpostnet/pwa-microservices-template-ghpkg'
28
21
  environment:
@@ -43,4 +43,4 @@ jobs:
43
43
  sudo -n -- /bin/bash -lc "npm install -g underpost"
44
44
  sudo -n -- /bin/bash -lc "node bin run secret"
45
45
  sudo -n -- /bin/bash -lc "node bin run --dev git-conf"
46
- sudo -n -- /bin/bash -lc "node bin run --dev docker-image"
46
+ sudo -n -- /bin/bash -lc "node bin run docker-image"