From fe0ade1dd9269ba42fc6a094697604143a68003f Mon Sep 17 00:00:00 2001 From: ReachableCEO Date: Thu, 2 Oct 2025 13:39:36 -0500 Subject: [PATCH] Scaffold Cloudron packaging workspace --- .gitea/workflows/ci.yml | 22 +- .gitignore | 1 + AGENTS.md | 37 +++ GEMINI/AUDIT-SNAPSHOT2.md | 51 ++++ GEMINI/FIX-1.md | 16 + Makefile | 16 - README.md | 67 +++-- apps/apache-apisix/CloudronManifest.json | 9 +- apps/apache-apisix/Dockerfile | 37 ++- apps/apache-apisix/README.md | 20 +- apps/apache-apisix/metadata.json | 4 +- apps/apache-apisix/start.sh | 11 +- apps/apache-apisix/test/smoke.sh | 14 +- apps/autobom/CloudronManifest.json | 9 +- apps/autobom/Dockerfile | 37 ++- apps/autobom/README.md | 20 +- apps/autobom/metadata.json | 4 +- apps/autobom/start.sh | 11 +- apps/autobom/test/smoke.sh | 14 +- apps/chirpstack/CloudronManifest.json | 9 +- apps/chirpstack/Dockerfile | 37 ++- apps/chirpstack/README.md | 20 +- apps/chirpstack/metadata.json | 4 +- apps/chirpstack/start.sh | 11 +- apps/chirpstack/test/smoke.sh | 14 +- apps/consuldemocracy/CloudronManifest.json | 9 +- apps/consuldemocracy/Dockerfile | 37 ++- apps/consuldemocracy/README.md | 20 +- apps/consuldemocracy/metadata.json | 4 +- apps/consuldemocracy/start.sh | 11 +- apps/consuldemocracy/test/smoke.sh | 14 +- apps/craig/CloudronManifest.json | 9 +- apps/craig/Dockerfile | 37 ++- apps/craig/README.md | 20 +- apps/craig/metadata.json | 4 +- apps/craig/start.sh | 11 +- apps/craig/test/smoke.sh | 14 +- apps/database-gateway/CloudronManifest.json | 9 +- apps/database-gateway/Dockerfile | 37 ++- apps/database-gateway/README.md | 20 +- apps/database-gateway/metadata.json | 4 +- apps/database-gateway/start.sh | 11 +- apps/database-gateway/test/smoke.sh | 14 +- apps/datahub/CloudronManifest.json | 9 +- apps/datahub/Dockerfile | 37 ++- apps/datahub/README.md | 20 +- apps/datahub/metadata.json | 4 +- apps/datahub/start.sh | 11 +- apps/datahub/test/smoke.sh | 14 +- apps/docassemble/CloudronManifest.json | 9 +- apps/docassemble/Dockerfile | 37 ++- apps/docassemble/README.md | 20 +- apps/docassemble/metadata.json | 4 +- apps/docassemble/start.sh | 11 +- apps/docassemble/test/smoke.sh | 14 +- apps/docker-webhook/CloudronManifest.json | 9 +- apps/docker-webhook/Dockerfile | 37 ++- apps/docker-webhook/README.md | 20 +- apps/docker-webhook/metadata.json | 4 +- apps/docker-webhook/start.sh | 11 +- apps/docker-webhook/test/smoke.sh | 14 +- apps/drawio/CloudronManifest.json | 9 +- apps/drawio/Dockerfile | 37 ++- apps/drawio/README.md | 20 +- apps/drawio/metadata.json | 4 +- apps/drawio/start.sh | 11 +- apps/drawio/test/smoke.sh | 14 +- apps/easy-gate/CloudronManifest.json | 9 +- apps/easy-gate/Dockerfile | 37 ++- apps/easy-gate/README.md | 20 +- apps/easy-gate/metadata.json | 4 +- apps/easy-gate/start.sh | 11 +- apps/easy-gate/test/smoke.sh | 14 +- apps/elabftw/CloudronManifest.json | 9 +- apps/elabftw/Dockerfile | 37 ++- apps/elabftw/README.md | 20 +- apps/elabftw/metadata.json | 4 +- apps/elabftw/start.sh | 11 +- apps/elabftw/test/smoke.sh | 14 +- apps/fleetdm-fleet/CloudronManifest.json | 9 +- apps/fleetdm-fleet/Dockerfile | 37 ++- apps/fleetdm-fleet/README.md | 20 +- apps/fleetdm-fleet/metadata.json | 4 +- apps/fleetdm-fleet/start.sh | 11 +- apps/fleetdm-fleet/test/smoke.sh | 14 +- apps/fonoster/CloudronManifest.json | 9 +- apps/fonoster/Dockerfile | 37 ++- apps/fonoster/README.md | 20 +- apps/fonoster/metadata.json | 4 +- apps/fonoster/start.sh | 11 +- apps/fonoster/test/smoke.sh | 14 +- apps/grist/CloudronManifest.json | 9 +- apps/grist/Dockerfile | 37 ++- apps/grist/README.md | 20 +- apps/grist/metadata.json | 4 +- apps/grist/start.sh | 11 +- apps/grist/test/smoke.sh | 14 +- apps/healthchecks/CloudronManifest.json | 9 +- apps/healthchecks/Dockerfile | 37 ++- apps/healthchecks/README.md | 20 +- apps/healthchecks/metadata.json | 4 +- apps/healthchecks/start.sh | 11 +- apps/healthchecks/test/smoke.sh | 14 +- apps/huginn/CloudronManifest.json | 9 +- apps/huginn/Dockerfile | 37 ++- apps/huginn/README.md | 20 +- apps/huginn/metadata.json | 4 +- apps/huginn/start.sh | 11 +- apps/huginn/test/smoke.sh | 14 +- apps/hyperswitch/CloudronManifest.json | 9 +- apps/hyperswitch/Dockerfile | 37 ++- apps/hyperswitch/README.md | 20 +- apps/hyperswitch/metadata.json | 4 +- apps/hyperswitch/start.sh | 11 +- apps/hyperswitch/test/smoke.sh | 14 +- apps/inventree/CloudronManifest.json | 9 +- apps/inventree/Dockerfile | 37 ++- apps/inventree/README.md | 20 +- apps/inventree/metadata.json | 4 +- apps/inventree/start.sh | 11 +- apps/inventree/test/smoke.sh | 14 +- apps/jamovi/CloudronManifest.json | 9 +- apps/jamovi/Dockerfile | 37 ++- apps/jamovi/README.md | 20 +- apps/jamovi/metadata.json | 4 +- apps/jamovi/start.sh | 11 +- apps/jamovi/test/smoke.sh | 14 +- apps/jenkins/CloudronManifest.json | 9 +- apps/jenkins/Dockerfile | 37 ++- apps/jenkins/README.md | 20 +- apps/jenkins/metadata.json | 4 +- apps/jenkins/start.sh | 11 +- apps/jenkins/test/smoke.sh | 14 +- apps/kibot/CloudronManifest.json | 9 +- apps/kibot/Dockerfile | 37 ++- apps/kibot/README.md | 20 +- apps/kibot/metadata.json | 4 +- apps/kibot/start.sh | 11 +- apps/kibot/test/smoke.sh | 14 +- apps/killbill/CloudronManifest.json | 9 +- apps/killbill/Dockerfile | 37 ++- apps/killbill/README.md | 20 +- apps/killbill/metadata.json | 4 +- apps/killbill/start.sh | 11 +- apps/killbill/test/smoke.sh | 14 +- apps/langfuse/CloudronManifest.json | 9 +- apps/langfuse/Dockerfile | 37 ++- apps/langfuse/README.md | 20 +- apps/langfuse/metadata.json | 4 +- apps/langfuse/start.sh | 11 +- apps/langfuse/test/smoke.sh | 14 +- apps/manyfold/CloudronManifest.json | 9 +- apps/manyfold/Dockerfile | 37 ++- apps/manyfold/README.md | 20 +- apps/manyfold/metadata.json | 4 +- apps/manyfold/start.sh | 11 +- apps/manyfold/test/smoke.sh | 14 +- apps/mender-server/CloudronManifest.json | 9 +- apps/mender-server/Dockerfile | 37 ++- apps/mender-server/README.md | 20 +- apps/mender-server/metadata.json | 4 +- apps/mender-server/start.sh | 11 +- apps/mender-server/test/smoke.sh | 14 +- apps/midday/CloudronManifest.json | 9 +- apps/midday/Dockerfile | 37 ++- apps/midday/README.md | 20 +- apps/midday/metadata.json | 4 +- apps/midday/start.sh | 11 +- apps/midday/test/smoke.sh | 14 +- apps/mirlo/CloudronManifest.json | 9 +- apps/mirlo/Dockerfile | 37 ++- apps/mirlo/README.md | 20 +- apps/mirlo/metadata.json | 4 +- apps/mirlo/start.sh | 11 +- apps/mirlo/test/smoke.sh | 14 +- apps/nautilus-trader/CloudronManifest.json | 9 +- apps/nautilus-trader/Dockerfile | 37 ++- apps/nautilus-trader/README.md | 20 +- apps/nautilus-trader/metadata.json | 4 +- apps/nautilus-trader/start.sh | 11 +- apps/nautilus-trader/test/smoke.sh | 14 +- apps/netbox-docker/CloudronManifest.json | 9 +- apps/netbox-docker/Dockerfile | 37 ++- apps/netbox-docker/README.md | 20 +- apps/netbox-docker/metadata.json | 4 +- apps/netbox-docker/start.sh | 11 +- apps/netbox-docker/test/smoke.sh | 14 +- apps/openblocks/CloudronManifest.json | 9 +- apps/openblocks/Dockerfile | 37 ++- apps/openblocks/README.md | 20 +- apps/openblocks/metadata.json | 4 +- apps/openblocks/start.sh | 11 +- apps/openblocks/test/smoke.sh | 14 +- apps/openboxes-docker/CloudronManifest.json | 9 +- apps/openboxes-docker/Dockerfile | 37 ++- apps/openboxes-docker/README.md | 20 +- apps/openboxes-docker/metadata.json | 4 +- apps/openboxes-docker/start.sh | 11 +- apps/openboxes-docker/test/smoke.sh | 14 +- apps/openfile/CloudronManifest.json | 9 +- apps/openfile/Dockerfile | 37 ++- apps/openfile/README.md | 20 +- apps/openfile/metadata.json | 4 +- apps/openfile/start.sh | 11 +- apps/openfile/test/smoke.sh | 14 +- apps/payroll-engine/CloudronManifest.json | 9 +- apps/payroll-engine/Dockerfile | 37 ++- apps/payroll-engine/README.md | 20 +- apps/payroll-engine/metadata.json | 4 +- apps/payroll-engine/start.sh | 11 +- apps/payroll-engine/test/smoke.sh | 14 +- apps/plmore/CloudronManifest.json | 9 +- apps/plmore/Dockerfile | 37 ++- apps/plmore/README.md | 20 +- apps/plmore/metadata.json | 4 +- apps/plmore/start.sh | 11 +- apps/plmore/test/smoke.sh | 14 +- apps/puter/CloudronManifest.json | 9 +- apps/puter/Dockerfile | 37 ++- apps/puter/README.md | 20 +- apps/puter/metadata.json | 4 +- apps/puter/start.sh | 11 +- apps/puter/test/smoke.sh | 14 +- apps/rathole/CloudronManifest.json | 9 +- apps/rathole/Dockerfile | 37 ++- apps/rathole/README.md | 20 +- apps/rathole/metadata.json | 4 +- apps/rathole/start.sh | 11 +- apps/rathole/test/smoke.sh | 14 +- apps/resgrid/CloudronManifest.json | 9 +- apps/resgrid/Dockerfile | 37 ++- apps/resgrid/README.md | 20 +- apps/resgrid/metadata.json | 4 +- apps/resgrid/start.sh | 11 +- apps/resgrid/test/smoke.sh | 14 +- apps/reviewboard/CloudronManifest.json | 9 +- apps/reviewboard/Dockerfile | 37 ++- apps/reviewboard/README.md | 20 +- apps/reviewboard/metadata.json | 4 +- apps/reviewboard/start.sh | 11 +- apps/reviewboard/test/smoke.sh | 14 +- apps/rundeck/CloudronManifest.json | 9 +- apps/rundeck/Dockerfile | 37 ++- apps/rundeck/README.md | 20 +- apps/rundeck/metadata.json | 4 +- apps/rundeck/start.sh | 11 +- apps/rundeck/test/smoke.sh | 14 +- apps/runme/CloudronManifest.json | 9 +- apps/runme/Dockerfile | 37 ++- apps/runme/README.md | 20 +- apps/runme/metadata.json | 4 +- apps/runme/start.sh | 11 +- apps/runme/test/smoke.sh | 14 +- apps/satnogs-kaitai/CloudronManifest.json | 9 +- apps/satnogs-kaitai/Dockerfile | 37 ++- apps/satnogs-kaitai/README.md | 20 +- apps/satnogs-kaitai/metadata.json | 4 +- apps/satnogs-kaitai/start.sh | 11 +- apps/satnogs-kaitai/test/smoke.sh | 14 +- apps/satnogs-webgui/CloudronManifest.json | 9 +- apps/satnogs-webgui/Dockerfile | 37 ++- apps/satnogs-webgui/README.md | 20 +- apps/satnogs-webgui/metadata.json | 4 +- apps/satnogs-webgui/start.sh | 11 +- apps/satnogs-webgui/test/smoke.sh | 14 +- apps/sdrangel/CloudronManifest.json | 9 +- apps/sdrangel/Dockerfile | 37 ++- apps/sdrangel/README.md | 20 +- apps/sdrangel/metadata.json | 4 +- apps/sdrangel/start.sh | 11 +- apps/sdrangel/test/smoke.sh | 14 +- apps/seatunnel/CloudronManifest.json | 9 +- apps/seatunnel/Dockerfile | 37 ++- apps/seatunnel/README.md | 20 +- apps/seatunnel/metadata.json | 4 +- apps/seatunnel/start.sh | 11 +- apps/seatunnel/test/smoke.sh | 14 +- apps/signoz/CloudronManifest.json | 9 +- apps/signoz/Dockerfile | 37 ++- apps/signoz/README.md | 20 +- apps/signoz/metadata.json | 4 +- apps/signoz/start.sh | 11 +- apps/signoz/test/smoke.sh | 14 +- apps/slurm/CloudronManifest.json | 9 +- apps/slurm/Dockerfile | 37 ++- apps/slurm/README.md | 20 +- apps/slurm/metadata.json | 6 +- apps/slurm/start.sh | 11 +- apps/slurm/test/smoke.sh | 14 +- apps/sniperphish/CloudronManifest.json | 9 +- apps/sniperphish/Dockerfile | 37 ++- apps/sniperphish/README.md | 20 +- apps/sniperphish/metadata.json | 4 +- apps/sniperphish/start.sh | 11 +- apps/sniperphish/test/smoke.sh | 14 +- apps/swupdate/CloudronManifest.json | 9 +- apps/swupdate/Dockerfile | 37 ++- apps/swupdate/README.md | 20 +- apps/swupdate/metadata.json | 4 +- apps/swupdate/start.sh | 11 +- apps/swupdate/test/smoke.sh | 14 +- apps/tak-server/CloudronManifest.json | 9 +- apps/tak-server/Dockerfile | 37 ++- apps/tak-server/README.md | 20 +- apps/tak-server/metadata.json | 4 +- apps/tak-server/start.sh | 11 +- apps/tak-server/test/smoke.sh | 14 +- apps/target-goalert/CloudronManifest.json | 9 +- apps/target-goalert/Dockerfile | 37 ++- apps/target-goalert/README.md | 20 +- apps/target-goalert/metadata.json | 4 +- apps/target-goalert/start.sh | 11 +- apps/target-goalert/test/smoke.sh | 14 +- apps/warp/CloudronManifest.json | 9 +- apps/warp/Dockerfile | 37 ++- apps/warp/README.md | 20 +- apps/warp/metadata.json | 4 +- apps/warp/start.sh | 11 +- apps/warp/test/smoke.sh | 14 +- apps/windmill/CloudronManifest.json | 9 +- apps/windmill/Dockerfile | 37 ++- apps/windmill/README.md | 20 +- apps/windmill/metadata.json | 4 +- apps/windmill/start.sh | 11 +- apps/windmill/test/smoke.sh | 14 +- apps/wireflow/CloudronManifest.json | 9 +- apps/wireflow/Dockerfile | 37 ++- apps/wireflow/README.md | 20 +- apps/wireflow/metadata.json | 4 +- apps/wireflow/start.sh | 11 +- apps/wireflow/test/smoke.sh | 14 +- apps/wireviz-web/CloudronManifest.json | 9 +- apps/wireviz-web/Dockerfile | 37 ++- apps/wireviz-web/README.md | 20 +- apps/wireviz-web/metadata.json | 4 +- apps/wireviz-web/start.sh | 11 +- apps/wireviz-web/test/smoke.sh | 14 +- docker/devtools/Dockerfile | 22 ++ docker/devtools/requirements.txt | 2 + docs/APP_STATUS.md | 2 +- docs/CI_CD_GITEA.md | 18 +- docs/LOCAL_TESTING.md | 31 +- docs/PACKAGING_GUIDE.md | 81 ++--- run/dev.sh | 8 + run/packager.sh | 8 + schema/cloudron-manifest.schema.json | 62 ++++ scripts/ci_local.sh | 83 ------ scripts/generate_status.py | 32 +- scripts/hooks/install_hooks.sh | 16 - scripts/hooks/post-commit | 11 - scripts/hooks/pre-commit | 11 - scripts/hooks/pre-push | 11 - scripts/lint_repo.py | 276 +++++++++++++----- scripts/new_app.py | 197 +++++++------ scripts/run_packager.sh | 16 - templates/cloudron-app/CloudronManifest.json | 20 -- .../cloudron-app/CloudronManifest.json.j2 | 27 ++ templates/cloudron-app/Dockerfile | 22 -- templates/cloudron-app/Dockerfile.j2 | 39 +++ templates/cloudron-app/README.md | 20 -- templates/cloudron-app/README.md.j2 | 20 ++ templates/cloudron-app/metadata.json.j2 | 9 + templates/cloudron-app/start.sh | 8 - templates/cloudron-app/start.sh.j2 | 9 + templates/cloudron-app/test/smoke.sh | 16 - templates/cloudron-app/test/smoke.sh.j2 | 14 + 366 files changed, 4035 insertions(+), 2493 deletions(-) create mode 100644 AGENTS.md create mode 100644 GEMINI/AUDIT-SNAPSHOT2.md create mode 100644 GEMINI/FIX-1.md delete mode 100644 Makefile create mode 100644 docker/devtools/Dockerfile create mode 100644 docker/devtools/requirements.txt create mode 100755 run/dev.sh create mode 100755 run/packager.sh create mode 100644 schema/cloudron-manifest.schema.json delete mode 100755 scripts/ci_local.sh delete mode 100755 scripts/hooks/install_hooks.sh delete mode 100755 scripts/hooks/post-commit delete mode 100755 scripts/hooks/pre-commit delete mode 100755 scripts/hooks/pre-push delete mode 100755 scripts/run_packager.sh delete mode 100644 templates/cloudron-app/CloudronManifest.json create mode 100644 templates/cloudron-app/CloudronManifest.json.j2 delete mode 100644 templates/cloudron-app/Dockerfile create mode 100644 templates/cloudron-app/Dockerfile.j2 delete mode 100644 templates/cloudron-app/README.md create mode 100644 templates/cloudron-app/README.md.j2 create mode 100644 templates/cloudron-app/metadata.json.j2 delete mode 100644 templates/cloudron-app/start.sh create mode 100644 templates/cloudron-app/start.sh.j2 delete mode 100644 templates/cloudron-app/test/smoke.sh create mode 100644 templates/cloudron-app/test/smoke.sh.j2 diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 4432785..4870322 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -2,25 +2,19 @@ name: cloudron-packages-ci on: workflow_dispatch: - inputs: - tasks: - description: "Space-separated list of tasks to run via scripts/ci_local.sh" - required: false - default: "all" jobs: - lint-and-smoke: + lint-and-status: runs-on: ubuntu-22.04 steps: - name: Checkout repository uses: https://gitea.com/actions/checkout@v4 - - name: Build CI harness image - run: docker build -t knel/cloudron-ci docker/ci-runner + - name: Build devtools image if needed + run: ./run/dev.sh python --version - - name: Run requested tasks - env: - TASKS: ${{ github.event.inputs.tasks }} - run: | - export CI_IMAGE=knel/cloudron-ci - ./scripts/ci_local.sh ${TASKS:-all} + - name: Lint repository (strict mode) + run: ./run/dev.sh python scripts/lint_repo.py --strict + + - name: Regenerate status dashboard + run: ./run/dev.sh python scripts/generate_status.py --preserve-timestamp diff --git a/.gitignore b/.gitignore index 81b6d00..e5c3f1a 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ __pycache__/ *.pyc *.swp .DS_Store +.venv/ diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..a8d9237 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,37 @@ +# Agent Operations Guide + +## Non-negotiable rules + +- Host commands are limited to `git`, `docker`, and `curl`. Everything else runs inside the provided wrapper scripts. +- Use `./run/dev.sh` for all development automation (scaffolding, linting, status updates). +- Use `./run/packager.sh` for packaging tasks that require the Cloudron CLI. +- Containers mount the repo at `/workspace`; do not write outside it. + +## Images + +- `knel/cloudron-devtools` – built automatically by `./run/dev.sh`; contains Python tooling. +- `knel/cloudron-packager` – built automatically by `./run/packager.sh`; contains the Cloudron CLI. + +## Common workflows + +```bash +# Generate/refresh a scaffold +./run/dev.sh python scripts/new_app.py --slug apache-apisix + +# Regenerate the full catalog (overwrites existing scaffolds) +./run/dev.sh python scripts/new_app.py --force + +# Lint an app (fails on TODO placeholders) +./run/dev.sh python scripts/lint_repo.py --slug apache-apisix --strict + +# Refresh docs/APP_STATUS.md without changing the timestamp +./run/dev.sh python scripts/generate_status.py --preserve-timestamp + +# Open the Cloudron packaging shell (add BUILD=1 to rebuild the image first) +./run/packager.sh +``` + +## Notes + +- The first invocation of either wrapper builds the corresponding Docker image if it is missing. +- Update documentation whenever command sequences change so future agents stay aligned. diff --git a/GEMINI/AUDIT-SNAPSHOT2.md b/GEMINI/AUDIT-SNAPSHOT2.md new file mode 100644 index 0000000..645a735 --- /dev/null +++ b/GEMINI/AUDIT-SNAPSHOT2.md @@ -0,0 +1,51 @@ +# Gemini Audit Report: KNELCloudronPackages (Final Verification) + +**Date:** 2025-10-02 +**Auditor:** Gemini +**Scope:** Final verification of repository state after mandatory cleanup. + +--- + +## 1. Executive Summary + +This audit confirms that the mandatory cleanup instructions outlined in the previous report (`GEMINI/FIX-1.md`) have been executed successfully and precisely. The repository's foundational workflow, which was previously broken and contradictory, is now **clean, consistent, and robust.** + +All non-compliant orchestration files have been removed and replaced with a set of simple, effective wrapper scripts in the `run/` directory. The documentation has been updated to reflect this single, unified workflow. Critical technical debt, most notably the missing `memoryLimit` placeholder, has been resolved. + +The project is no longer blocked. The foundation is sound and adheres to the specified architectural principles. The repository is now in an excellent state to begin the primary work of packaging applications. + +**This report concludes the foundational audit phase. The project is approved to move forward.** + +**Overall Grade: A+ (Excellent)** + +--- + +## 2. Verification of Mandatory Cleanup + +A point-by-point confirmation of the tasks from the `FIX-1.md` prompt. + +| Task | Status | Verification Notes | +|---|---|---| +| **1a. Clean Repository Files** | **PASS** | The `Makefile` and all old, complex host scripts (`scripts/run_dev.sh`, `scripts/ci_local.sh`, etc.) have been successfully deleted. | +| **1b. Move `requirements.txt`** | **PASS** | The file was correctly moved to `docker/devtools/requirements.txt`. | +| **2. Fix `devtools` Dockerfile** | **PASS** | The `Dockerfile` now correctly copies the `requirements.txt` file from its new location, making the `devtools` image buildable. | +| **3. Create Orchestration Scripts** | **PASS** | The `run/` directory and its scripts (`dev.sh`, `packager.sh`) were created with the exact content specified. The orchestration layer is now compliant and functional. | +| **4. Fix Manifest Template** | **PASS** | The `memoryLimit` placeholder was added back to the `CloudronManifest.json.j2` template with the required guiding comment. This resolves a critical packaging risk. | +| **5. Rewrite Documentation** | **PASS** | The main `README.md` has been updated to exclusively feature the new, correct workflow using the `run/*.sh` scripts. | + +--- + +## 3. Remaining Minor Recommendations + +With the major foundational issues resolved, only minor points remain. These can be addressed as part of ongoing work. + +* **Dockerfile Template:** The `Dockerfile.j2` template could be slightly improved by removing the `COPY ./app /app/code` line entirely. This would force the developer to write a proper `COPY --from=builder ...` command, reinforcing the multi-stage build pattern. +* **Full Documentation Sync:** While the main `README.md` is correct, a pass should be taken through the `docs/` directory at a later date to ensure all deeper documentation also reflects the new `run/*.sh` workflow. + +--- + +## 4. Conclusion + +The repository is now in an exemplary state. The combination of a robust, containerized toolchain and a simple, clear orchestration layer provides a solid foundation for the complex task of packaging dozens of applications. + +The project is ready to proceed with its primary mission. \ No newline at end of file diff --git a/GEMINI/FIX-1.md b/GEMINI/FIX-1.md new file mode 100644 index 0000000..c9e5db5 --- /dev/null +++ b/GEMINI/FIX-1.md @@ -0,0 +1,16 @@ +You will now perform a mandatory cleanup of this repository. Your sole focus is to implement the **exact** instructions outlined in the "Final Actionable Mandate" section of `GEMINI/AUDIT-SNAPSHOT2.md`. + +**Your task is to:** + +1. **Execute every command** listed in "Step 1: Clean the Repository" to remove the incorrect files. +2. **Execute the command** in "Step 1" to move `requirements.txt` to the correct location. +3. **Execute the command** in "Step 2" to fix the `docker/devtools/Dockerfile`. +4. **Create the `run/` directory and the two shell scripts** (`run/dev.sh`, `run/packager.sh`) using the **exact code** provided in "Step 3: Create the Correct Orchestration Scripts". +5. **Fix the manifest template** (`templates/cloudron-app/CloudronManifest.json.j2`) by adding the `memoryLimit` placeholder exactly as shown in "Step 4: Fix the Manifest Template". +6. **Rewrite the `README.md`** as described in "Step 5: Rewrite All Documentation", replacing the "Quick start" section with instructions that exclusively use the new `run/dev.sh` and `run/packager.sh` scripts for all development tasks. + +**DO NOT** deviate from this plan. +**DO NOT** introduce any new files or scripts other than those specified. +**DO NOT** leave any of the old, incorrect files (`Makefile`, etc.) in the repository. + +Your goal is not to be creative; your goal is to follow the provided recovery plan precisely. diff --git a/Makefile b/Makefile deleted file mode 100644 index 533e5cc..0000000 --- a/Makefile +++ /dev/null @@ -1,16 +0,0 @@ -.PHONY: scaffold lint status packager-shell - -scaffold: - python3 scripts/new_app.py --force - -lint: - python3 scripts/lint_repo.py - -status: - python3 scripts/generate_status.py - -packager-shell: - BUILD=1 scripts/run_packager.sh - -ci-local: - ./scripts/ci_local.sh all diff --git a/README.md b/README.md index 3bee43d..3f3f29f 100644 --- a/README.md +++ b/README.md @@ -10,47 +10,41 @@ This repository scaffolds Cloudron packages for Known Element's portfolio. It pr ## Quick start ```bash -# Generate all app scaffolds from the catalog -python3 scripts/new_app.py +# Build or refresh the devtools image (first run builds automatically) +./run/dev.sh python --version -# Or regenerate scaffolds via Makefile -make scaffold +# Generate or refresh a single app scaffold +./run/dev.sh python scripts/new_app.py --slug apache-apisix -# Work on a single app skeleton -python3 scripts/new_app.py --slug apache-apisix +# Regenerate every scaffold (overwrites existing directories) +./run/dev.sh python scripts/new_app.py --force -# Update the status table -make status +# Lint an app and fail on placeholders +./run/dev.sh python scripts/lint_repo.py --slug apache-apisix --strict -# Lint generated apps -make lint - -# Run the full CI harness locally -make ci-local - -# Build and enter the Cloudron packager container -BUILD=1 scripts/run_packager.sh -scripts/run_packager.sh +# Update the status dashboard +./run/dev.sh python scripts/generate_status.py --preserve-timestamp ``` -Within the container, use the Cloudron CLI to build, test, and publish packages without touching the host environment: +### Packaging shell ```bash -cloudron login my.example.cloudron -cloudron build -cloudron install --app my-example -cloudron push +# Build the Cloudron packager image (run when Dockerfile changes) +BUILD=1 ./run/packager.sh + +# Launch an interactive Cloudron packaging shell +./run/packager.sh ``` -Refer to `docs/PACKAGING_GUIDE.md` for detailed guidance. +All other development tasks should also use `./run/dev.sh` (pass the desired command after the script). The wrapper will build the devtools image if needed and ensure every command executes inside Docker. -See `docs/APP_STATUS.md` for the automatically generated status table. ## Repository layout - `apps/` – generated app scaffolds and metadata - `docs/` – playbooks and architecture notes - `docs/CI_CD_GITEA.md` – instructions for running CI/CD and publishing images via the Gitea instance +- `docker/devtools/` – Docker image that runs scaffolding, linting, and status tooling - `docker/packager/` – Docker image for Cloudron packaging workflows - `scripts/` – helper scripts (scaffolding, tooling entrypoints) - `templates/` – base Cloudron app template @@ -118,11 +112,30 @@ See `docs/APP_STATUS.md` for the automatically generated status table. All entries are initially marked as `todo`; update individual READMEs as progress is made. -## Local Harness +## Local Verification -Run `./scripts/ci_local.sh` (or `make ci-local`) to execute the same lint and smoke tests that the future Gitea runner will use. Install git hooks via `./scripts/hooks/install_hooks.sh` so pre-commit, post-commit, and pre-push events invoke the harness automatically. Export `SKIP_CI_HOOKS=1` to bypass them when necessary. See `docs/LOCAL_TESTING.md` for full details. +Run quality checks via the devtools wrapper: + +```bash +# Fail if placeholders remain in the target manifest/start script +./run/dev.sh python scripts/lint_repo.py --slug apache-apisix --strict + +# Refresh docs/APP_STATUS.md without changing the existing timestamp +./run/dev.sh python scripts/generate_status.py --preserve-timestamp +``` + +Use `./run/packager.sh` whenever you need the Cloudron CLI to build, install, or push packages—it drops you into the dedicated packaging container. ## CI/CD -Once a runner is provisioned, enable `.gitea/workflows/ci.yml` to call the same harness remotely (it currently requires manual `workflow_dispatch`). Mirror `actions/checkout@v4` and label the runner `ubuntu-22.04`. See `docs/CI_CD_GITEA.md` for setup details. +The workflow `.gitea/workflows/ci.yml` mirrors the same commands by invoking the devtools container inside the runner. To reproduce the pipeline locally, run: +```bash +./run/dev.sh python scripts/lint_repo.py --strict --slug apache-apisix +./run/dev.sh python scripts/generate_status.py --preserve-timestamp +BUILD=1 ./run/packager.sh # optional: rebuild packager image before smoke tests +``` + +Once a Gitea Actions runner is available, enable the workflow and it will build `knel/cloudron-devtools`/`knel/cloudron-ci` automatically. + +Refer to `docs/PACKAGING_GUIDE.md` and `AGENTS.md` for detailed operating procedures. diff --git a/apps/apache-apisix/CloudronManifest.json b/apps/apache-apisix/CloudronManifest.json index 8770844..6c167bf 100644 --- a/apps/apache-apisix/CloudronManifest.json +++ b/apps/apache-apisix/CloudronManifest.json @@ -12,9 +12,16 @@ "version": "0.1.0", "tags": ["custom", "known-element"], "healthCheckPath": "/", - "memoryLimit": 536870912, "httpPort": 3000, + "memoryLimit": "512M", "addons": { "localstorage": {} + }, + "optionalAddons": { + "postgresql": {}, + "redis": {}, + "mysql": {}, + "mongodb": {}, + "sendmail": {} } } diff --git a/apps/apache-apisix/Dockerfile b/apps/apache-apisix/Dockerfile index c6930a7..88c5c8a 100644 --- a/apps/apache-apisix/Dockerfile +++ b/apps/apache-apisix/Dockerfile @@ -1,21 +1,38 @@ -# syntax=docker/dockerfile:1 -FROM cloudron/base:5.0.0 +# syntax=docker/dockerfile:1.6 +ARG APP_VERSION=latest + +FROM cloudron/base:5.0.0 AS builder +WORKDIR /build + +# ----------------------------------------------------------------------------- +# TODO: Fetch and build Apache APISIX +# Example: +# RUN git clone --depth 1 --branch "${APP_VERSION}" https://github.com/apache/apisix.git source \ +# && cd source \ +# && npm ci \ +# && npm run build +# ----------------------------------------------------------------------------- + +FROM cloudron/base:5.0.0 LABEL org.opencontainers.image.source="https://github.com/apache/apisix.git" LABEL org.opencontainers.image.description="Cloudron package for Apache APISIX" -ARG APP_VERSION -ENV APP_VERSION=${APP_VERSION:-latest} +ENV APP_VERSION=${APP_VERSION} + +# ----------------------------------------------------------------------------- +# TODO: Copy build artefacts from the builder stage +# COPY --from=builder /build/source/dist /app/code +# ----------------------------------------------------------------------------- -# Copy application source into image at build time -# Replace this with a multi-stage build if upstream provides Docker images. COPY ./app /app/code - -# Copy start script and make it executable COPY ./start.sh /app/pkg/start.sh -RUN chmod +x /app/pkg/start.sh +COPY ./test /app/pkg/test + +RUN chmod +x /app/pkg/start.sh /app/pkg/test/smoke.sh \ + && mkdir -p /app/data \ + && chown -R cloudron:cloudron /app -# Cloudron expects all processes to run as cloudron user USER cloudron WORKDIR /app/code diff --git a/apps/apache-apisix/README.md b/apps/apache-apisix/README.md index 22c4888..f47e797 100644 --- a/apps/apache-apisix/README.md +++ b/apps/apache-apisix/README.md @@ -2,19 +2,19 @@ - **Upstream repository**: https://github.com/apache/apisix.git - **Implementation issue**: https://projects.knownelement.com/issues/179 -- **Status**: Draft scaffolding generated on $(date -u +"%Y-%m-%dT%H:%M:%SZ") +- **Generated**: 2025-10-02T17:19:00Z UTC ## Packaging Checklist -1. Review upstream deployment requirements and map them to Cloudron services (database, cache, object storage, workers). -2. Update `Dockerfile` with the correct build steps and runtime dependencies. -3. Implement `start.sh` to configure the app from Cloudron-provided environment variables and launch the primary process. -4. Edit `CloudronManifest.json` with accurate metadata, permissions, ports, addons, and health checks. -5. Add integration and smoke tests under `test/` to validate the package. -6. Document manual configuration steps, migration requirements, and known gaps in this README. +1. Map upstream services (databases, caches, workers) to Cloudron addons; remove unused entries from `optionalAddons` and enable required ones under `addons`. +2. Implement the multi-stage build in `Dockerfile` to fetch/compile the correct release of Apache APISIX. +3. Update `start.sh` to configure the app from Cloudron environment variables and launch the primary process. +4. Replace the placeholder health checks and smoke test with real coverage. +5. Complete `CloudronManifest.json` (tagline, description, versioning, resource limits, ingress, TCP ports, etc.). +6. Document manual configuration steps, migrations, and known gaps below. ## Notes -- Replace the placeholder long-running process in `start.sh`. -- Populate the `app/` directory with the application build artefacts or git submodules. -- Use the shared packaging container (`docker/packager`) to run `cloudron build` and `cloudron install` so the host remains clean. +- Populate the `app/` directory with runtime overlays or artifacts generated during the build stage. +- Use the shared packaging container (`docker/packager`) for `cloudron build/install` to keep the host clean. +- Record decisions and operational requirements under `docs/apps/apache-apisix/` as work progresses. diff --git a/apps/apache-apisix/metadata.json b/apps/apache-apisix/metadata.json index 51557f6..79ddc12 100644 --- a/apps/apache-apisix/metadata.json +++ b/apps/apache-apisix/metadata.json @@ -4,6 +4,6 @@ "issue": "https://projects.knownelement.com/issues/179", "repo": "https://github.com/apache/apisix.git", "additionalRepos": [], - "created": "2025-10-02T16:46:49Z", + "created": "2025-10-02T17:19:00Z", "notes": "TODO: capture packaging notes" -} \ No newline at end of file +} diff --git a/apps/apache-apisix/start.sh b/apps/apache-apisix/start.sh index 4b919bb..53c7a56 100755 --- a/apps/apache-apisix/start.sh +++ b/apps/apache-apisix/start.sh @@ -1,8 +1,9 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Cloudron injects configuration via environment variables and files under /run -# Use this script to render config files and launch the upstream service. +# TODO: render configuration files from CLOUDRON_* environment variables +# Example: +# envsubst < /app/pkg/config.tmpl > /run/config.yaml -# TODO: Replace the command below with the correct process supervisor. -exec /bin/sh -c "echo 'Replace start.sh with application startup logic for Apache APISIX' && sleep infinity" +>&2 echo "start.sh for Apache APISIX is not implemented yet." +exit 1 diff --git a/apps/apache-apisix/test/smoke.sh b/apps/apache-apisix/test/smoke.sh index ebd1134..f07c99c 100755 --- a/apps/apache-apisix/test/smoke.sh +++ b/apps/apache-apisix/test/smoke.sh @@ -1,16 +1,14 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Basic container reachability check executed inside the packaging container. -# Replace curl target with an endpoint exposed by the app once the package is functional. -cloudron_app_url=${CLOUDRON_APP_ORIGIN:-"http://localhost"} +cloudron_app_origin=${CLOUDRON_APP_ORIGIN:-http://localhost} -http_code=$(curl -s -o /tmp/smoke.log -w "%{http_code}" "${cloudron_app_url}") +http_code=$(curl --silent --show-error --output /tmp/smoke.log --write-out "%{http_code}" "${cloudron_app_origin}/") if [[ "${http_code}" != "200" ]]; then - echo "Unexpected HTTP status: ${http_code}" >&2 - cat /tmp/smoke.log >&2 + >&2 echo "Smoke test failed for Apache APISIX: expected HTTP 200 from ${cloudron_app_origin}/, got ${http_code}" + >&2 cat /tmp/smoke.log exit 1 fi -echo "Smoke test passed" +echo "Smoke test placeholder passed for Apache APISIX" diff --git a/apps/autobom/CloudronManifest.json b/apps/autobom/CloudronManifest.json index 19dc2c6..a84fa69 100644 --- a/apps/autobom/CloudronManifest.json +++ b/apps/autobom/CloudronManifest.json @@ -12,9 +12,16 @@ "version": "0.1.0", "tags": ["custom", "known-element"], "healthCheckPath": "/", - "memoryLimit": 536870912, "httpPort": 3000, + "memoryLimit": "512M", "addons": { "localstorage": {} + }, + "optionalAddons": { + "postgresql": {}, + "redis": {}, + "mysql": {}, + "mongodb": {}, + "sendmail": {} } } diff --git a/apps/autobom/Dockerfile b/apps/autobom/Dockerfile index 375a8cf..f12e5c3 100644 --- a/apps/autobom/Dockerfile +++ b/apps/autobom/Dockerfile @@ -1,21 +1,38 @@ -# syntax=docker/dockerfile:1 -FROM cloudron/base:5.0.0 +# syntax=docker/dockerfile:1.6 +ARG APP_VERSION=latest + +FROM cloudron/base:5.0.0 AS builder +WORKDIR /build + +# ----------------------------------------------------------------------------- +# TODO: Fetch and build Autobom +# Example: +# RUN git clone --depth 1 --branch "${APP_VERSION}" https://github.com/opulo-inc/autobom.git source \ +# && cd source \ +# && npm ci \ +# && npm run build +# ----------------------------------------------------------------------------- + +FROM cloudron/base:5.0.0 LABEL org.opencontainers.image.source="https://github.com/opulo-inc/autobom.git" LABEL org.opencontainers.image.description="Cloudron package for Autobom" -ARG APP_VERSION -ENV APP_VERSION=${APP_VERSION:-latest} +ENV APP_VERSION=${APP_VERSION} + +# ----------------------------------------------------------------------------- +# TODO: Copy build artefacts from the builder stage +# COPY --from=builder /build/source/dist /app/code +# ----------------------------------------------------------------------------- -# Copy application source into image at build time -# Replace this with a multi-stage build if upstream provides Docker images. COPY ./app /app/code - -# Copy start script and make it executable COPY ./start.sh /app/pkg/start.sh -RUN chmod +x /app/pkg/start.sh +COPY ./test /app/pkg/test + +RUN chmod +x /app/pkg/start.sh /app/pkg/test/smoke.sh \ + && mkdir -p /app/data \ + && chown -R cloudron:cloudron /app -# Cloudron expects all processes to run as cloudron user USER cloudron WORKDIR /app/code diff --git a/apps/autobom/README.md b/apps/autobom/README.md index 12603d5..22053bc 100644 --- a/apps/autobom/README.md +++ b/apps/autobom/README.md @@ -2,19 +2,19 @@ - **Upstream repository**: https://github.com/opulo-inc/autobom.git - **Implementation issue**: https://projects.knownelement.com/issues/278 -- **Status**: Draft scaffolding generated on $(date -u +"%Y-%m-%dT%H:%M:%SZ") +- **Generated**: 2025-10-02T17:19:01Z UTC ## Packaging Checklist -1. Review upstream deployment requirements and map them to Cloudron services (database, cache, object storage, workers). -2. Update `Dockerfile` with the correct build steps and runtime dependencies. -3. Implement `start.sh` to configure the app from Cloudron-provided environment variables and launch the primary process. -4. Edit `CloudronManifest.json` with accurate metadata, permissions, ports, addons, and health checks. -5. Add integration and smoke tests under `test/` to validate the package. -6. Document manual configuration steps, migration requirements, and known gaps in this README. +1. Map upstream services (databases, caches, workers) to Cloudron addons; remove unused entries from `optionalAddons` and enable required ones under `addons`. +2. Implement the multi-stage build in `Dockerfile` to fetch/compile the correct release of Autobom. +3. Update `start.sh` to configure the app from Cloudron environment variables and launch the primary process. +4. Replace the placeholder health checks and smoke test with real coverage. +5. Complete `CloudronManifest.json` (tagline, description, versioning, resource limits, ingress, TCP ports, etc.). +6. Document manual configuration steps, migrations, and known gaps below. ## Notes -- Replace the placeholder long-running process in `start.sh`. -- Populate the `app/` directory with the application build artefacts or git submodules. -- Use the shared packaging container (`docker/packager`) to run `cloudron build` and `cloudron install` so the host remains clean. +- Populate the `app/` directory with runtime overlays or artifacts generated during the build stage. +- Use the shared packaging container (`docker/packager`) for `cloudron build/install` to keep the host clean. +- Record decisions and operational requirements under `docs/apps/autobom/` as work progresses. diff --git a/apps/autobom/metadata.json b/apps/autobom/metadata.json index 5a03fa2..c98a953 100644 --- a/apps/autobom/metadata.json +++ b/apps/autobom/metadata.json @@ -4,6 +4,6 @@ "issue": "https://projects.knownelement.com/issues/278", "repo": "https://github.com/opulo-inc/autobom.git", "additionalRepos": [], - "created": "2025-10-02T16:46:49Z", + "created": "2025-10-02T17:19:01Z", "notes": "TODO: capture packaging notes" -} \ No newline at end of file +} diff --git a/apps/autobom/start.sh b/apps/autobom/start.sh index c577586..eac0484 100755 --- a/apps/autobom/start.sh +++ b/apps/autobom/start.sh @@ -1,8 +1,9 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Cloudron injects configuration via environment variables and files under /run -# Use this script to render config files and launch the upstream service. +# TODO: render configuration files from CLOUDRON_* environment variables +# Example: +# envsubst < /app/pkg/config.tmpl > /run/config.yaml -# TODO: Replace the command below with the correct process supervisor. -exec /bin/sh -c "echo 'Replace start.sh with application startup logic for Autobom' && sleep infinity" +>&2 echo "start.sh for Autobom is not implemented yet." +exit 1 diff --git a/apps/autobom/test/smoke.sh b/apps/autobom/test/smoke.sh index ebd1134..a7f5a36 100755 --- a/apps/autobom/test/smoke.sh +++ b/apps/autobom/test/smoke.sh @@ -1,16 +1,14 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Basic container reachability check executed inside the packaging container. -# Replace curl target with an endpoint exposed by the app once the package is functional. -cloudron_app_url=${CLOUDRON_APP_ORIGIN:-"http://localhost"} +cloudron_app_origin=${CLOUDRON_APP_ORIGIN:-http://localhost} -http_code=$(curl -s -o /tmp/smoke.log -w "%{http_code}" "${cloudron_app_url}") +http_code=$(curl --silent --show-error --output /tmp/smoke.log --write-out "%{http_code}" "${cloudron_app_origin}/") if [[ "${http_code}" != "200" ]]; then - echo "Unexpected HTTP status: ${http_code}" >&2 - cat /tmp/smoke.log >&2 + >&2 echo "Smoke test failed for Autobom: expected HTTP 200 from ${cloudron_app_origin}/, got ${http_code}" + >&2 cat /tmp/smoke.log exit 1 fi -echo "Smoke test passed" +echo "Smoke test placeholder passed for Autobom" diff --git a/apps/chirpstack/CloudronManifest.json b/apps/chirpstack/CloudronManifest.json index 8065bbb..5fba915 100644 --- a/apps/chirpstack/CloudronManifest.json +++ b/apps/chirpstack/CloudronManifest.json @@ -12,9 +12,16 @@ "version": "0.1.0", "tags": ["custom", "known-element"], "healthCheckPath": "/", - "memoryLimit": 536870912, "httpPort": 3000, + "memoryLimit": "512M", "addons": { "localstorage": {} + }, + "optionalAddons": { + "postgresql": {}, + "redis": {}, + "mysql": {}, + "mongodb": {}, + "sendmail": {} } } diff --git a/apps/chirpstack/Dockerfile b/apps/chirpstack/Dockerfile index 884ac7c..b58c20f 100644 --- a/apps/chirpstack/Dockerfile +++ b/apps/chirpstack/Dockerfile @@ -1,21 +1,38 @@ -# syntax=docker/dockerfile:1 -FROM cloudron/base:5.0.0 +# syntax=docker/dockerfile:1.6 +ARG APP_VERSION=latest + +FROM cloudron/base:5.0.0 AS builder +WORKDIR /build + +# ----------------------------------------------------------------------------- +# TODO: Fetch and build ChirpStack +# Example: +# RUN git clone --depth 1 --branch "${APP_VERSION}" https://github.com/chirpstack/chirpstack.git source \ +# && cd source \ +# && npm ci \ +# && npm run build +# ----------------------------------------------------------------------------- + +FROM cloudron/base:5.0.0 LABEL org.opencontainers.image.source="https://github.com/chirpstack/chirpstack.git" LABEL org.opencontainers.image.description="Cloudron package for ChirpStack" -ARG APP_VERSION -ENV APP_VERSION=${APP_VERSION:-latest} +ENV APP_VERSION=${APP_VERSION} + +# ----------------------------------------------------------------------------- +# TODO: Copy build artefacts from the builder stage +# COPY --from=builder /build/source/dist /app/code +# ----------------------------------------------------------------------------- -# Copy application source into image at build time -# Replace this with a multi-stage build if upstream provides Docker images. COPY ./app /app/code - -# Copy start script and make it executable COPY ./start.sh /app/pkg/start.sh -RUN chmod +x /app/pkg/start.sh +COPY ./test /app/pkg/test + +RUN chmod +x /app/pkg/start.sh /app/pkg/test/smoke.sh \ + && mkdir -p /app/data \ + && chown -R cloudron:cloudron /app -# Cloudron expects all processes to run as cloudron user USER cloudron WORKDIR /app/code diff --git a/apps/chirpstack/README.md b/apps/chirpstack/README.md index 2791195..f0e8248 100644 --- a/apps/chirpstack/README.md +++ b/apps/chirpstack/README.md @@ -2,19 +2,19 @@ - **Upstream repository**: https://github.com/chirpstack/chirpstack.git - **Implementation issue**: https://projects.knownelement.com/issues/184 -- **Status**: Draft scaffolding generated on $(date -u +"%Y-%m-%dT%H:%M:%SZ") +- **Generated**: 2025-10-02T17:19:00Z UTC ## Packaging Checklist -1. Review upstream deployment requirements and map them to Cloudron services (database, cache, object storage, workers). -2. Update `Dockerfile` with the correct build steps and runtime dependencies. -3. Implement `start.sh` to configure the app from Cloudron-provided environment variables and launch the primary process. -4. Edit `CloudronManifest.json` with accurate metadata, permissions, ports, addons, and health checks. -5. Add integration and smoke tests under `test/` to validate the package. -6. Document manual configuration steps, migration requirements, and known gaps in this README. +1. Map upstream services (databases, caches, workers) to Cloudron addons; remove unused entries from `optionalAddons` and enable required ones under `addons`. +2. Implement the multi-stage build in `Dockerfile` to fetch/compile the correct release of ChirpStack. +3. Update `start.sh` to configure the app from Cloudron environment variables and launch the primary process. +4. Replace the placeholder health checks and smoke test with real coverage. +5. Complete `CloudronManifest.json` (tagline, description, versioning, resource limits, ingress, TCP ports, etc.). +6. Document manual configuration steps, migrations, and known gaps below. ## Notes -- Replace the placeholder long-running process in `start.sh`. -- Populate the `app/` directory with the application build artefacts or git submodules. -- Use the shared packaging container (`docker/packager`) to run `cloudron build` and `cloudron install` so the host remains clean. +- Populate the `app/` directory with runtime overlays or artifacts generated during the build stage. +- Use the shared packaging container (`docker/packager`) for `cloudron build/install` to keep the host clean. +- Record decisions and operational requirements under `docs/apps/chirpstack/` as work progresses. diff --git a/apps/chirpstack/metadata.json b/apps/chirpstack/metadata.json index fffe1d7..b105e70 100644 --- a/apps/chirpstack/metadata.json +++ b/apps/chirpstack/metadata.json @@ -4,6 +4,6 @@ "issue": "https://projects.knownelement.com/issues/184", "repo": "https://github.com/chirpstack/chirpstack.git", "additionalRepos": [], - "created": "2025-10-02T16:46:49Z", + "created": "2025-10-02T17:19:00Z", "notes": "TODO: capture packaging notes" -} \ No newline at end of file +} diff --git a/apps/chirpstack/start.sh b/apps/chirpstack/start.sh index 2c6b121..f8c684f 100755 --- a/apps/chirpstack/start.sh +++ b/apps/chirpstack/start.sh @@ -1,8 +1,9 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Cloudron injects configuration via environment variables and files under /run -# Use this script to render config files and launch the upstream service. +# TODO: render configuration files from CLOUDRON_* environment variables +# Example: +# envsubst < /app/pkg/config.tmpl > /run/config.yaml -# TODO: Replace the command below with the correct process supervisor. -exec /bin/sh -c "echo 'Replace start.sh with application startup logic for ChirpStack' && sleep infinity" +>&2 echo "start.sh for ChirpStack is not implemented yet." +exit 1 diff --git a/apps/chirpstack/test/smoke.sh b/apps/chirpstack/test/smoke.sh index ebd1134..133b93a 100755 --- a/apps/chirpstack/test/smoke.sh +++ b/apps/chirpstack/test/smoke.sh @@ -1,16 +1,14 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Basic container reachability check executed inside the packaging container. -# Replace curl target with an endpoint exposed by the app once the package is functional. -cloudron_app_url=${CLOUDRON_APP_ORIGIN:-"http://localhost"} +cloudron_app_origin=${CLOUDRON_APP_ORIGIN:-http://localhost} -http_code=$(curl -s -o /tmp/smoke.log -w "%{http_code}" "${cloudron_app_url}") +http_code=$(curl --silent --show-error --output /tmp/smoke.log --write-out "%{http_code}" "${cloudron_app_origin}/") if [[ "${http_code}" != "200" ]]; then - echo "Unexpected HTTP status: ${http_code}" >&2 - cat /tmp/smoke.log >&2 + >&2 echo "Smoke test failed for ChirpStack: expected HTTP 200 from ${cloudron_app_origin}/, got ${http_code}" + >&2 cat /tmp/smoke.log exit 1 fi -echo "Smoke test passed" +echo "Smoke test placeholder passed for ChirpStack" diff --git a/apps/consuldemocracy/CloudronManifest.json b/apps/consuldemocracy/CloudronManifest.json index e9685c4..a3d61e7 100644 --- a/apps/consuldemocracy/CloudronManifest.json +++ b/apps/consuldemocracy/CloudronManifest.json @@ -12,9 +12,16 @@ "version": "0.1.0", "tags": ["custom", "known-element"], "healthCheckPath": "/", - "memoryLimit": 536870912, "httpPort": 3000, + "memoryLimit": "512M", "addons": { "localstorage": {} + }, + "optionalAddons": { + "postgresql": {}, + "redis": {}, + "mysql": {}, + "mongodb": {}, + "sendmail": {} } } diff --git a/apps/consuldemocracy/Dockerfile b/apps/consuldemocracy/Dockerfile index 5065900..81c830d 100644 --- a/apps/consuldemocracy/Dockerfile +++ b/apps/consuldemocracy/Dockerfile @@ -1,21 +1,38 @@ -# syntax=docker/dockerfile:1 -FROM cloudron/base:5.0.0 +# syntax=docker/dockerfile:1.6 +ARG APP_VERSION=latest + +FROM cloudron/base:5.0.0 AS builder +WORKDIR /build + +# ----------------------------------------------------------------------------- +# TODO: Fetch and build CONSUL Democracy +# Example: +# RUN git clone --depth 1 --branch "${APP_VERSION}" https://github.com/consuldemocracy/consuldemocracy.git source \ +# && cd source \ +# && npm ci \ +# && npm run build +# ----------------------------------------------------------------------------- + +FROM cloudron/base:5.0.0 LABEL org.opencontainers.image.source="https://github.com/consuldemocracy/consuldemocracy.git" LABEL org.opencontainers.image.description="Cloudron package for CONSUL Democracy" -ARG APP_VERSION -ENV APP_VERSION=${APP_VERSION:-latest} +ENV APP_VERSION=${APP_VERSION} + +# ----------------------------------------------------------------------------- +# TODO: Copy build artefacts from the builder stage +# COPY --from=builder /build/source/dist /app/code +# ----------------------------------------------------------------------------- -# Copy application source into image at build time -# Replace this with a multi-stage build if upstream provides Docker images. COPY ./app /app/code - -# Copy start script and make it executable COPY ./start.sh /app/pkg/start.sh -RUN chmod +x /app/pkg/start.sh +COPY ./test /app/pkg/test + +RUN chmod +x /app/pkg/start.sh /app/pkg/test/smoke.sh \ + && mkdir -p /app/data \ + && chown -R cloudron:cloudron /app -# Cloudron expects all processes to run as cloudron user USER cloudron WORKDIR /app/code diff --git a/apps/consuldemocracy/README.md b/apps/consuldemocracy/README.md index fa83577..98ec019 100644 --- a/apps/consuldemocracy/README.md +++ b/apps/consuldemocracy/README.md @@ -2,19 +2,19 @@ - **Upstream repository**: https://github.com/consuldemocracy/consuldemocracy.git - **Implementation issue**: https://projects.knownelement.com/issues/189 -- **Status**: Draft scaffolding generated on $(date -u +"%Y-%m-%dT%H:%M:%SZ") +- **Generated**: 2025-10-02T17:19:00Z UTC ## Packaging Checklist -1. Review upstream deployment requirements and map them to Cloudron services (database, cache, object storage, workers). -2. Update `Dockerfile` with the correct build steps and runtime dependencies. -3. Implement `start.sh` to configure the app from Cloudron-provided environment variables and launch the primary process. -4. Edit `CloudronManifest.json` with accurate metadata, permissions, ports, addons, and health checks. -5. Add integration and smoke tests under `test/` to validate the package. -6. Document manual configuration steps, migration requirements, and known gaps in this README. +1. Map upstream services (databases, caches, workers) to Cloudron addons; remove unused entries from `optionalAddons` and enable required ones under `addons`. +2. Implement the multi-stage build in `Dockerfile` to fetch/compile the correct release of CONSUL Democracy. +3. Update `start.sh` to configure the app from Cloudron environment variables and launch the primary process. +4. Replace the placeholder health checks and smoke test with real coverage. +5. Complete `CloudronManifest.json` (tagline, description, versioning, resource limits, ingress, TCP ports, etc.). +6. Document manual configuration steps, migrations, and known gaps below. ## Notes -- Replace the placeholder long-running process in `start.sh`. -- Populate the `app/` directory with the application build artefacts or git submodules. -- Use the shared packaging container (`docker/packager`) to run `cloudron build` and `cloudron install` so the host remains clean. +- Populate the `app/` directory with runtime overlays or artifacts generated during the build stage. +- Use the shared packaging container (`docker/packager`) for `cloudron build/install` to keep the host clean. +- Record decisions and operational requirements under `docs/apps/consuldemocracy/` as work progresses. diff --git a/apps/consuldemocracy/metadata.json b/apps/consuldemocracy/metadata.json index 45bac95..f8493f3 100644 --- a/apps/consuldemocracy/metadata.json +++ b/apps/consuldemocracy/metadata.json @@ -4,6 +4,6 @@ "issue": "https://projects.knownelement.com/issues/189", "repo": "https://github.com/consuldemocracy/consuldemocracy.git", "additionalRepos": [], - "created": "2025-10-02T16:46:49Z", + "created": "2025-10-02T17:19:00Z", "notes": "TODO: capture packaging notes" -} \ No newline at end of file +} diff --git a/apps/consuldemocracy/start.sh b/apps/consuldemocracy/start.sh index 3508d70..e279760 100755 --- a/apps/consuldemocracy/start.sh +++ b/apps/consuldemocracy/start.sh @@ -1,8 +1,9 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Cloudron injects configuration via environment variables and files under /run -# Use this script to render config files and launch the upstream service. +# TODO: render configuration files from CLOUDRON_* environment variables +# Example: +# envsubst < /app/pkg/config.tmpl > /run/config.yaml -# TODO: Replace the command below with the correct process supervisor. -exec /bin/sh -c "echo 'Replace start.sh with application startup logic for CONSUL Democracy' && sleep infinity" +>&2 echo "start.sh for CONSUL Democracy is not implemented yet." +exit 1 diff --git a/apps/consuldemocracy/test/smoke.sh b/apps/consuldemocracy/test/smoke.sh index ebd1134..b61c024 100755 --- a/apps/consuldemocracy/test/smoke.sh +++ b/apps/consuldemocracy/test/smoke.sh @@ -1,16 +1,14 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Basic container reachability check executed inside the packaging container. -# Replace curl target with an endpoint exposed by the app once the package is functional. -cloudron_app_url=${CLOUDRON_APP_ORIGIN:-"http://localhost"} +cloudron_app_origin=${CLOUDRON_APP_ORIGIN:-http://localhost} -http_code=$(curl -s -o /tmp/smoke.log -w "%{http_code}" "${cloudron_app_url}") +http_code=$(curl --silent --show-error --output /tmp/smoke.log --write-out "%{http_code}" "${cloudron_app_origin}/") if [[ "${http_code}" != "200" ]]; then - echo "Unexpected HTTP status: ${http_code}" >&2 - cat /tmp/smoke.log >&2 + >&2 echo "Smoke test failed for CONSUL Democracy: expected HTTP 200 from ${cloudron_app_origin}/, got ${http_code}" + >&2 cat /tmp/smoke.log exit 1 fi -echo "Smoke test passed" +echo "Smoke test placeholder passed for CONSUL Democracy" diff --git a/apps/craig/CloudronManifest.json b/apps/craig/CloudronManifest.json index 60f8d24..56c52ca 100644 --- a/apps/craig/CloudronManifest.json +++ b/apps/craig/CloudronManifest.json @@ -12,9 +12,16 @@ "version": "0.1.0", "tags": ["custom", "known-element"], "healthCheckPath": "/", - "memoryLimit": 536870912, "httpPort": 3000, + "memoryLimit": "512M", "addons": { "localstorage": {} + }, + "optionalAddons": { + "postgresql": {}, + "redis": {}, + "mysql": {}, + "mongodb": {}, + "sendmail": {} } } diff --git a/apps/craig/Dockerfile b/apps/craig/Dockerfile index c45d25d..2296b32 100644 --- a/apps/craig/Dockerfile +++ b/apps/craig/Dockerfile @@ -1,21 +1,38 @@ -# syntax=docker/dockerfile:1 -FROM cloudron/base:5.0.0 +# syntax=docker/dockerfile:1.6 +ARG APP_VERSION=latest + +FROM cloudron/base:5.0.0 AS builder +WORKDIR /build + +# ----------------------------------------------------------------------------- +# TODO: Fetch and build Craig (FOSS Discord Recorder) +# Example: +# RUN git clone --depth 1 --branch "${APP_VERSION}" https://github.com/CraigChat/craig.git source \ +# && cd source \ +# && npm ci \ +# && npm run build +# ----------------------------------------------------------------------------- + +FROM cloudron/base:5.0.0 LABEL org.opencontainers.image.source="https://github.com/CraigChat/craig.git" LABEL org.opencontainers.image.description="Cloudron package for Craig (FOSS Discord Recorder)" -ARG APP_VERSION -ENV APP_VERSION=${APP_VERSION:-latest} +ENV APP_VERSION=${APP_VERSION} + +# ----------------------------------------------------------------------------- +# TODO: Copy build artefacts from the builder stage +# COPY --from=builder /build/source/dist /app/code +# ----------------------------------------------------------------------------- -# Copy application source into image at build time -# Replace this with a multi-stage build if upstream provides Docker images. COPY ./app /app/code - -# Copy start script and make it executable COPY ./start.sh /app/pkg/start.sh -RUN chmod +x /app/pkg/start.sh +COPY ./test /app/pkg/test + +RUN chmod +x /app/pkg/start.sh /app/pkg/test/smoke.sh \ + && mkdir -p /app/data \ + && chown -R cloudron:cloudron /app -# Cloudron expects all processes to run as cloudron user USER cloudron WORKDIR /app/code diff --git a/apps/craig/README.md b/apps/craig/README.md index 81b6dc4..5cb36c5 100644 --- a/apps/craig/README.md +++ b/apps/craig/README.md @@ -2,19 +2,19 @@ - **Upstream repository**: https://github.com/CraigChat/craig.git - **Implementation issue**: https://projects.knownelement.com/issues/185 -- **Status**: Draft scaffolding generated on $(date -u +"%Y-%m-%dT%H:%M:%SZ") +- **Generated**: 2025-10-02T17:19:00Z UTC ## Packaging Checklist -1. Review upstream deployment requirements and map them to Cloudron services (database, cache, object storage, workers). -2. Update `Dockerfile` with the correct build steps and runtime dependencies. -3. Implement `start.sh` to configure the app from Cloudron-provided environment variables and launch the primary process. -4. Edit `CloudronManifest.json` with accurate metadata, permissions, ports, addons, and health checks. -5. Add integration and smoke tests under `test/` to validate the package. -6. Document manual configuration steps, migration requirements, and known gaps in this README. +1. Map upstream services (databases, caches, workers) to Cloudron addons; remove unused entries from `optionalAddons` and enable required ones under `addons`. +2. Implement the multi-stage build in `Dockerfile` to fetch/compile the correct release of Craig (FOSS Discord Recorder). +3. Update `start.sh` to configure the app from Cloudron environment variables and launch the primary process. +4. Replace the placeholder health checks and smoke test with real coverage. +5. Complete `CloudronManifest.json` (tagline, description, versioning, resource limits, ingress, TCP ports, etc.). +6. Document manual configuration steps, migrations, and known gaps below. ## Notes -- Replace the placeholder long-running process in `start.sh`. -- Populate the `app/` directory with the application build artefacts or git submodules. -- Use the shared packaging container (`docker/packager`) to run `cloudron build` and `cloudron install` so the host remains clean. +- Populate the `app/` directory with runtime overlays or artifacts generated during the build stage. +- Use the shared packaging container (`docker/packager`) for `cloudron build/install` to keep the host clean. +- Record decisions and operational requirements under `docs/apps/craig/` as work progresses. diff --git a/apps/craig/metadata.json b/apps/craig/metadata.json index 60c68d1..04af911 100644 --- a/apps/craig/metadata.json +++ b/apps/craig/metadata.json @@ -4,6 +4,6 @@ "issue": "https://projects.knownelement.com/issues/185", "repo": "https://github.com/CraigChat/craig.git", "additionalRepos": [], - "created": "2025-10-02T16:46:49Z", + "created": "2025-10-02T17:19:00Z", "notes": "TODO: capture packaging notes" -} \ No newline at end of file +} diff --git a/apps/craig/start.sh b/apps/craig/start.sh index 2f595aa..dffed08 100755 --- a/apps/craig/start.sh +++ b/apps/craig/start.sh @@ -1,8 +1,9 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Cloudron injects configuration via environment variables and files under /run -# Use this script to render config files and launch the upstream service. +# TODO: render configuration files from CLOUDRON_* environment variables +# Example: +# envsubst < /app/pkg/config.tmpl > /run/config.yaml -# TODO: Replace the command below with the correct process supervisor. -exec /bin/sh -c "echo 'Replace start.sh with application startup logic for Craig (FOSS Discord Recorder)' && sleep infinity" +>&2 echo "start.sh for Craig (FOSS Discord Recorder) is not implemented yet." +exit 1 diff --git a/apps/craig/test/smoke.sh b/apps/craig/test/smoke.sh index ebd1134..5de12ea 100755 --- a/apps/craig/test/smoke.sh +++ b/apps/craig/test/smoke.sh @@ -1,16 +1,14 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Basic container reachability check executed inside the packaging container. -# Replace curl target with an endpoint exposed by the app once the package is functional. -cloudron_app_url=${CLOUDRON_APP_ORIGIN:-"http://localhost"} +cloudron_app_origin=${CLOUDRON_APP_ORIGIN:-http://localhost} -http_code=$(curl -s -o /tmp/smoke.log -w "%{http_code}" "${cloudron_app_url}") +http_code=$(curl --silent --show-error --output /tmp/smoke.log --write-out "%{http_code}" "${cloudron_app_origin}/") if [[ "${http_code}" != "200" ]]; then - echo "Unexpected HTTP status: ${http_code}" >&2 - cat /tmp/smoke.log >&2 + >&2 echo "Smoke test failed for Craig (FOSS Discord Recorder): expected HTTP 200 from ${cloudron_app_origin}/, got ${http_code}" + >&2 cat /tmp/smoke.log exit 1 fi -echo "Smoke test passed" +echo "Smoke test placeholder passed for Craig (FOSS Discord Recorder)" diff --git a/apps/database-gateway/CloudronManifest.json b/apps/database-gateway/CloudronManifest.json index 27af355..a1d3b47 100644 --- a/apps/database-gateway/CloudronManifest.json +++ b/apps/database-gateway/CloudronManifest.json @@ -12,9 +12,16 @@ "version": "0.1.0", "tags": ["custom", "known-element"], "healthCheckPath": "/", - "memoryLimit": 536870912, "httpPort": 3000, + "memoryLimit": "512M", "addons": { "localstorage": {} + }, + "optionalAddons": { + "postgresql": {}, + "redis": {}, + "mysql": {}, + "mongodb": {}, + "sendmail": {} } } diff --git a/apps/database-gateway/Dockerfile b/apps/database-gateway/Dockerfile index a577c80..2af4e06 100644 --- a/apps/database-gateway/Dockerfile +++ b/apps/database-gateway/Dockerfile @@ -1,21 +1,38 @@ -# syntax=docker/dockerfile:1 -FROM cloudron/base:5.0.0 +# syntax=docker/dockerfile:1.6 +ARG APP_VERSION=latest + +FROM cloudron/base:5.0.0 AS builder +WORKDIR /build + +# ----------------------------------------------------------------------------- +# TODO: Fetch and build Database Gateway +# Example: +# RUN git clone --depth 1 --branch "${APP_VERSION}" https://github.com/kazhuravlev/database-gateway.git source \ +# && cd source \ +# && npm ci \ +# && npm run build +# ----------------------------------------------------------------------------- + +FROM cloudron/base:5.0.0 LABEL org.opencontainers.image.source="https://github.com/kazhuravlev/database-gateway.git" LABEL org.opencontainers.image.description="Cloudron package for Database Gateway" -ARG APP_VERSION -ENV APP_VERSION=${APP_VERSION:-latest} +ENV APP_VERSION=${APP_VERSION} + +# ----------------------------------------------------------------------------- +# TODO: Copy build artefacts from the builder stage +# COPY --from=builder /build/source/dist /app/code +# ----------------------------------------------------------------------------- -# Copy application source into image at build time -# Replace this with a multi-stage build if upstream provides Docker images. COPY ./app /app/code - -# Copy start script and make it executable COPY ./start.sh /app/pkg/start.sh -RUN chmod +x /app/pkg/start.sh +COPY ./test /app/pkg/test + +RUN chmod +x /app/pkg/start.sh /app/pkg/test/smoke.sh \ + && mkdir -p /app/data \ + && chown -R cloudron:cloudron /app -# Cloudron expects all processes to run as cloudron user USER cloudron WORKDIR /app/code diff --git a/apps/database-gateway/README.md b/apps/database-gateway/README.md index 75e8cbb..71df717 100644 --- a/apps/database-gateway/README.md +++ b/apps/database-gateway/README.md @@ -2,19 +2,19 @@ - **Upstream repository**: https://github.com/kazhuravlev/database-gateway.git - **Implementation issue**: https://projects.knownelement.com/issues/273 -- **Status**: Draft scaffolding generated on $(date -u +"%Y-%m-%dT%H:%M:%SZ") +- **Generated**: 2025-10-02T17:19:00Z UTC ## Packaging Checklist -1. Review upstream deployment requirements and map them to Cloudron services (database, cache, object storage, workers). -2. Update `Dockerfile` with the correct build steps and runtime dependencies. -3. Implement `start.sh` to configure the app from Cloudron-provided environment variables and launch the primary process. -4. Edit `CloudronManifest.json` with accurate metadata, permissions, ports, addons, and health checks. -5. Add integration and smoke tests under `test/` to validate the package. -6. Document manual configuration steps, migration requirements, and known gaps in this README. +1. Map upstream services (databases, caches, workers) to Cloudron addons; remove unused entries from `optionalAddons` and enable required ones under `addons`. +2. Implement the multi-stage build in `Dockerfile` to fetch/compile the correct release of Database Gateway. +3. Update `start.sh` to configure the app from Cloudron environment variables and launch the primary process. +4. Replace the placeholder health checks and smoke test with real coverage. +5. Complete `CloudronManifest.json` (tagline, description, versioning, resource limits, ingress, TCP ports, etc.). +6. Document manual configuration steps, migrations, and known gaps below. ## Notes -- Replace the placeholder long-running process in `start.sh`. -- Populate the `app/` directory with the application build artefacts or git submodules. -- Use the shared packaging container (`docker/packager`) to run `cloudron build` and `cloudron install` so the host remains clean. +- Populate the `app/` directory with runtime overlays or artifacts generated during the build stage. +- Use the shared packaging container (`docker/packager`) for `cloudron build/install` to keep the host clean. +- Record decisions and operational requirements under `docs/apps/database-gateway/` as work progresses. diff --git a/apps/database-gateway/metadata.json b/apps/database-gateway/metadata.json index 4f83acc..6aee9b7 100644 --- a/apps/database-gateway/metadata.json +++ b/apps/database-gateway/metadata.json @@ -4,6 +4,6 @@ "issue": "https://projects.knownelement.com/issues/273", "repo": "https://github.com/kazhuravlev/database-gateway.git", "additionalRepos": [], - "created": "2025-10-02T16:46:49Z", + "created": "2025-10-02T17:19:00Z", "notes": "TODO: capture packaging notes" -} \ No newline at end of file +} diff --git a/apps/database-gateway/start.sh b/apps/database-gateway/start.sh index 6edb28b..6b2d9a1 100755 --- a/apps/database-gateway/start.sh +++ b/apps/database-gateway/start.sh @@ -1,8 +1,9 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Cloudron injects configuration via environment variables and files under /run -# Use this script to render config files and launch the upstream service. +# TODO: render configuration files from CLOUDRON_* environment variables +# Example: +# envsubst < /app/pkg/config.tmpl > /run/config.yaml -# TODO: Replace the command below with the correct process supervisor. -exec /bin/sh -c "echo 'Replace start.sh with application startup logic for Database Gateway' && sleep infinity" +>&2 echo "start.sh for Database Gateway is not implemented yet." +exit 1 diff --git a/apps/database-gateway/test/smoke.sh b/apps/database-gateway/test/smoke.sh index ebd1134..f117058 100755 --- a/apps/database-gateway/test/smoke.sh +++ b/apps/database-gateway/test/smoke.sh @@ -1,16 +1,14 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Basic container reachability check executed inside the packaging container. -# Replace curl target with an endpoint exposed by the app once the package is functional. -cloudron_app_url=${CLOUDRON_APP_ORIGIN:-"http://localhost"} +cloudron_app_origin=${CLOUDRON_APP_ORIGIN:-http://localhost} -http_code=$(curl -s -o /tmp/smoke.log -w "%{http_code}" "${cloudron_app_url}") +http_code=$(curl --silent --show-error --output /tmp/smoke.log --write-out "%{http_code}" "${cloudron_app_origin}/") if [[ "${http_code}" != "200" ]]; then - echo "Unexpected HTTP status: ${http_code}" >&2 - cat /tmp/smoke.log >&2 + >&2 echo "Smoke test failed for Database Gateway: expected HTTP 200 from ${cloudron_app_origin}/, got ${http_code}" + >&2 cat /tmp/smoke.log exit 1 fi -echo "Smoke test passed" +echo "Smoke test placeholder passed for Database Gateway" diff --git a/apps/datahub/CloudronManifest.json b/apps/datahub/CloudronManifest.json index f7ecc28..6bb04ea 100644 --- a/apps/datahub/CloudronManifest.json +++ b/apps/datahub/CloudronManifest.json @@ -12,9 +12,16 @@ "version": "0.1.0", "tags": ["custom", "known-element"], "healthCheckPath": "/", - "memoryLimit": 536870912, "httpPort": 3000, + "memoryLimit": "512M", "addons": { "localstorage": {} + }, + "optionalAddons": { + "postgresql": {}, + "redis": {}, + "mysql": {}, + "mongodb": {}, + "sendmail": {} } } diff --git a/apps/datahub/Dockerfile b/apps/datahub/Dockerfile index f073227..3a7e196 100644 --- a/apps/datahub/Dockerfile +++ b/apps/datahub/Dockerfile @@ -1,21 +1,38 @@ -# syntax=docker/dockerfile:1 -FROM cloudron/base:5.0.0 +# syntax=docker/dockerfile:1.6 +ARG APP_VERSION=latest + +FROM cloudron/base:5.0.0 AS builder +WORKDIR /build + +# ----------------------------------------------------------------------------- +# TODO: Fetch and build DataHub +# Example: +# RUN git clone --depth 1 --branch "${APP_VERSION}" https://github.com/datahub-project/datahub.git source \ +# && cd source \ +# && npm ci \ +# && npm run build +# ----------------------------------------------------------------------------- + +FROM cloudron/base:5.0.0 LABEL org.opencontainers.image.source="https://github.com/datahub-project/datahub.git" LABEL org.opencontainers.image.description="Cloudron package for DataHub" -ARG APP_VERSION -ENV APP_VERSION=${APP_VERSION:-latest} +ENV APP_VERSION=${APP_VERSION} + +# ----------------------------------------------------------------------------- +# TODO: Copy build artefacts from the builder stage +# COPY --from=builder /build/source/dist /app/code +# ----------------------------------------------------------------------------- -# Copy application source into image at build time -# Replace this with a multi-stage build if upstream provides Docker images. COPY ./app /app/code - -# Copy start script and make it executable COPY ./start.sh /app/pkg/start.sh -RUN chmod +x /app/pkg/start.sh +COPY ./test /app/pkg/test + +RUN chmod +x /app/pkg/start.sh /app/pkg/test/smoke.sh \ + && mkdir -p /app/data \ + && chown -R cloudron:cloudron /app -# Cloudron expects all processes to run as cloudron user USER cloudron WORKDIR /app/code diff --git a/apps/datahub/README.md b/apps/datahub/README.md index 8fb4f2b..86dac7e 100644 --- a/apps/datahub/README.md +++ b/apps/datahub/README.md @@ -2,19 +2,19 @@ - **Upstream repository**: https://github.com/datahub-project/datahub.git - **Implementation issue**: https://projects.knownelement.com/issues/309 -- **Status**: Draft scaffolding generated on $(date -u +"%Y-%m-%dT%H:%M:%SZ") +- **Generated**: 2025-10-02T17:19:00Z UTC ## Packaging Checklist -1. Review upstream deployment requirements and map them to Cloudron services (database, cache, object storage, workers). -2. Update `Dockerfile` with the correct build steps and runtime dependencies. -3. Implement `start.sh` to configure the app from Cloudron-provided environment variables and launch the primary process. -4. Edit `CloudronManifest.json` with accurate metadata, permissions, ports, addons, and health checks. -5. Add integration and smoke tests under `test/` to validate the package. -6. Document manual configuration steps, migration requirements, and known gaps in this README. +1. Map upstream services (databases, caches, workers) to Cloudron addons; remove unused entries from `optionalAddons` and enable required ones under `addons`. +2. Implement the multi-stage build in `Dockerfile` to fetch/compile the correct release of DataHub. +3. Update `start.sh` to configure the app from Cloudron environment variables and launch the primary process. +4. Replace the placeholder health checks and smoke test with real coverage. +5. Complete `CloudronManifest.json` (tagline, description, versioning, resource limits, ingress, TCP ports, etc.). +6. Document manual configuration steps, migrations, and known gaps below. ## Notes -- Replace the placeholder long-running process in `start.sh`. -- Populate the `app/` directory with the application build artefacts or git submodules. -- Use the shared packaging container (`docker/packager`) to run `cloudron build` and `cloudron install` so the host remains clean. +- Populate the `app/` directory with runtime overlays or artifacts generated during the build stage. +- Use the shared packaging container (`docker/packager`) for `cloudron build/install` to keep the host clean. +- Record decisions and operational requirements under `docs/apps/datahub/` as work progresses. diff --git a/apps/datahub/metadata.json b/apps/datahub/metadata.json index 8792248..19f344d 100644 --- a/apps/datahub/metadata.json +++ b/apps/datahub/metadata.json @@ -4,6 +4,6 @@ "issue": "https://projects.knownelement.com/issues/309", "repo": "https://github.com/datahub-project/datahub.git", "additionalRepos": [], - "created": "2025-10-02T16:46:49Z", + "created": "2025-10-02T17:19:00Z", "notes": "TODO: capture packaging notes" -} \ No newline at end of file +} diff --git a/apps/datahub/start.sh b/apps/datahub/start.sh index ce6d986..e6476c8 100755 --- a/apps/datahub/start.sh +++ b/apps/datahub/start.sh @@ -1,8 +1,9 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Cloudron injects configuration via environment variables and files under /run -# Use this script to render config files and launch the upstream service. +# TODO: render configuration files from CLOUDRON_* environment variables +# Example: +# envsubst < /app/pkg/config.tmpl > /run/config.yaml -# TODO: Replace the command below with the correct process supervisor. -exec /bin/sh -c "echo 'Replace start.sh with application startup logic for DataHub' && sleep infinity" +>&2 echo "start.sh for DataHub is not implemented yet." +exit 1 diff --git a/apps/datahub/test/smoke.sh b/apps/datahub/test/smoke.sh index ebd1134..3cf8398 100755 --- a/apps/datahub/test/smoke.sh +++ b/apps/datahub/test/smoke.sh @@ -1,16 +1,14 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Basic container reachability check executed inside the packaging container. -# Replace curl target with an endpoint exposed by the app once the package is functional. -cloudron_app_url=${CLOUDRON_APP_ORIGIN:-"http://localhost"} +cloudron_app_origin=${CLOUDRON_APP_ORIGIN:-http://localhost} -http_code=$(curl -s -o /tmp/smoke.log -w "%{http_code}" "${cloudron_app_url}") +http_code=$(curl --silent --show-error --output /tmp/smoke.log --write-out "%{http_code}" "${cloudron_app_origin}/") if [[ "${http_code}" != "200" ]]; then - echo "Unexpected HTTP status: ${http_code}" >&2 - cat /tmp/smoke.log >&2 + >&2 echo "Smoke test failed for DataHub: expected HTTP 200 from ${cloudron_app_origin}/, got ${http_code}" + >&2 cat /tmp/smoke.log exit 1 fi -echo "Smoke test passed" +echo "Smoke test placeholder passed for DataHub" diff --git a/apps/docassemble/CloudronManifest.json b/apps/docassemble/CloudronManifest.json index 2ecf43a..4e45e15 100644 --- a/apps/docassemble/CloudronManifest.json +++ b/apps/docassemble/CloudronManifest.json @@ -12,9 +12,16 @@ "version": "0.1.0", "tags": ["custom", "known-element"], "healthCheckPath": "/", - "memoryLimit": 536870912, "httpPort": 3000, + "memoryLimit": "512M", "addons": { "localstorage": {} + }, + "optionalAddons": { + "postgresql": {}, + "redis": {}, + "mysql": {}, + "mongodb": {}, + "sendmail": {} } } diff --git a/apps/docassemble/Dockerfile b/apps/docassemble/Dockerfile index 4947c40..7850a59 100644 --- a/apps/docassemble/Dockerfile +++ b/apps/docassemble/Dockerfile @@ -1,21 +1,38 @@ -# syntax=docker/dockerfile:1 -FROM cloudron/base:5.0.0 +# syntax=docker/dockerfile:1.6 +ARG APP_VERSION=latest + +FROM cloudron/base:5.0.0 AS builder +WORKDIR /build + +# ----------------------------------------------------------------------------- +# TODO: Fetch and build Docassemble +# Example: +# RUN git clone --depth 1 --branch "${APP_VERSION}" https://github.com/jhpyle/docassemble.git source \ +# && cd source \ +# && npm ci \ +# && npm run build +# ----------------------------------------------------------------------------- + +FROM cloudron/base:5.0.0 LABEL org.opencontainers.image.source="https://github.com/jhpyle/docassemble.git" LABEL org.opencontainers.image.description="Cloudron package for Docassemble" -ARG APP_VERSION -ENV APP_VERSION=${APP_VERSION:-latest} +ENV APP_VERSION=${APP_VERSION} + +# ----------------------------------------------------------------------------- +# TODO: Copy build artefacts from the builder stage +# COPY --from=builder /build/source/dist /app/code +# ----------------------------------------------------------------------------- -# Copy application source into image at build time -# Replace this with a multi-stage build if upstream provides Docker images. COPY ./app /app/code - -# Copy start script and make it executable COPY ./start.sh /app/pkg/start.sh -RUN chmod +x /app/pkg/start.sh +COPY ./test /app/pkg/test + +RUN chmod +x /app/pkg/start.sh /app/pkg/test/smoke.sh \ + && mkdir -p /app/data \ + && chown -R cloudron:cloudron /app -# Cloudron expects all processes to run as cloudron user USER cloudron WORKDIR /app/code diff --git a/apps/docassemble/README.md b/apps/docassemble/README.md index f689344..dedce2d 100644 --- a/apps/docassemble/README.md +++ b/apps/docassemble/README.md @@ -2,19 +2,19 @@ - **Upstream repository**: https://github.com/jhpyle/docassemble.git - **Implementation issue**: https://projects.knownelement.com/issues/277 -- **Status**: Draft scaffolding generated on $(date -u +"%Y-%m-%dT%H:%M:%SZ") +- **Generated**: 2025-10-02T17:19:00Z UTC ## Packaging Checklist -1. Review upstream deployment requirements and map them to Cloudron services (database, cache, object storage, workers). -2. Update `Dockerfile` with the correct build steps and runtime dependencies. -3. Implement `start.sh` to configure the app from Cloudron-provided environment variables and launch the primary process. -4. Edit `CloudronManifest.json` with accurate metadata, permissions, ports, addons, and health checks. -5. Add integration and smoke tests under `test/` to validate the package. -6. Document manual configuration steps, migration requirements, and known gaps in this README. +1. Map upstream services (databases, caches, workers) to Cloudron addons; remove unused entries from `optionalAddons` and enable required ones under `addons`. +2. Implement the multi-stage build in `Dockerfile` to fetch/compile the correct release of Docassemble. +3. Update `start.sh` to configure the app from Cloudron environment variables and launch the primary process. +4. Replace the placeholder health checks and smoke test with real coverage. +5. Complete `CloudronManifest.json` (tagline, description, versioning, resource limits, ingress, TCP ports, etc.). +6. Document manual configuration steps, migrations, and known gaps below. ## Notes -- Replace the placeholder long-running process in `start.sh`. -- Populate the `app/` directory with the application build artefacts or git submodules. -- Use the shared packaging container (`docker/packager`) to run `cloudron build` and `cloudron install` so the host remains clean. +- Populate the `app/` directory with runtime overlays or artifacts generated during the build stage. +- Use the shared packaging container (`docker/packager`) for `cloudron build/install` to keep the host clean. +- Record decisions and operational requirements under `docs/apps/docassemble/` as work progresses. diff --git a/apps/docassemble/metadata.json b/apps/docassemble/metadata.json index 883f50e..0e2ee68 100644 --- a/apps/docassemble/metadata.json +++ b/apps/docassemble/metadata.json @@ -4,6 +4,6 @@ "issue": "https://projects.knownelement.com/issues/277", "repo": "https://github.com/jhpyle/docassemble.git", "additionalRepos": [], - "created": "2025-10-02T16:46:49Z", + "created": "2025-10-02T17:19:00Z", "notes": "TODO: capture packaging notes" -} \ No newline at end of file +} diff --git a/apps/docassemble/start.sh b/apps/docassemble/start.sh index dbe42aa..2696318 100755 --- a/apps/docassemble/start.sh +++ b/apps/docassemble/start.sh @@ -1,8 +1,9 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Cloudron injects configuration via environment variables and files under /run -# Use this script to render config files and launch the upstream service. +# TODO: render configuration files from CLOUDRON_* environment variables +# Example: +# envsubst < /app/pkg/config.tmpl > /run/config.yaml -# TODO: Replace the command below with the correct process supervisor. -exec /bin/sh -c "echo 'Replace start.sh with application startup logic for Docassemble' && sleep infinity" +>&2 echo "start.sh for Docassemble is not implemented yet." +exit 1 diff --git a/apps/docassemble/test/smoke.sh b/apps/docassemble/test/smoke.sh index ebd1134..e19abb6 100755 --- a/apps/docassemble/test/smoke.sh +++ b/apps/docassemble/test/smoke.sh @@ -1,16 +1,14 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Basic container reachability check executed inside the packaging container. -# Replace curl target with an endpoint exposed by the app once the package is functional. -cloudron_app_url=${CLOUDRON_APP_ORIGIN:-"http://localhost"} +cloudron_app_origin=${CLOUDRON_APP_ORIGIN:-http://localhost} -http_code=$(curl -s -o /tmp/smoke.log -w "%{http_code}" "${cloudron_app_url}") +http_code=$(curl --silent --show-error --output /tmp/smoke.log --write-out "%{http_code}" "${cloudron_app_origin}/") if [[ "${http_code}" != "200" ]]; then - echo "Unexpected HTTP status: ${http_code}" >&2 - cat /tmp/smoke.log >&2 + >&2 echo "Smoke test failed for Docassemble: expected HTTP 200 from ${cloudron_app_origin}/, got ${http_code}" + >&2 cat /tmp/smoke.log exit 1 fi -echo "Smoke test passed" +echo "Smoke test placeholder passed for Docassemble" diff --git a/apps/docker-webhook/CloudronManifest.json b/apps/docker-webhook/CloudronManifest.json index c154f43..22dd37f 100644 --- a/apps/docker-webhook/CloudronManifest.json +++ b/apps/docker-webhook/CloudronManifest.json @@ -12,9 +12,16 @@ "version": "0.1.0", "tags": ["custom", "known-element"], "healthCheckPath": "/", - "memoryLimit": 536870912, "httpPort": 3000, + "memoryLimit": "512M", "addons": { "localstorage": {} + }, + "optionalAddons": { + "postgresql": {}, + "redis": {}, + "mysql": {}, + "mongodb": {}, + "sendmail": {} } } diff --git a/apps/docker-webhook/Dockerfile b/apps/docker-webhook/Dockerfile index e243d53..a5d1fed 100644 --- a/apps/docker-webhook/Dockerfile +++ b/apps/docker-webhook/Dockerfile @@ -1,21 +1,38 @@ -# syntax=docker/dockerfile:1 -FROM cloudron/base:5.0.0 +# syntax=docker/dockerfile:1.6 +ARG APP_VERSION=latest + +FROM cloudron/base:5.0.0 AS builder +WORKDIR /build + +# ----------------------------------------------------------------------------- +# TODO: Fetch and build docker-webhook +# Example: +# RUN git clone --depth 1 --branch "${APP_VERSION}" https://github.com/thecatlady/docker-webhook source \ +# && cd source \ +# && npm ci \ +# && npm run build +# ----------------------------------------------------------------------------- + +FROM cloudron/base:5.0.0 LABEL org.opencontainers.image.source="https://github.com/thecatlady/docker-webhook" LABEL org.opencontainers.image.description="Cloudron package for docker-webhook" -ARG APP_VERSION -ENV APP_VERSION=${APP_VERSION:-latest} +ENV APP_VERSION=${APP_VERSION} + +# ----------------------------------------------------------------------------- +# TODO: Copy build artefacts from the builder stage +# COPY --from=builder /build/source/dist /app/code +# ----------------------------------------------------------------------------- -# Copy application source into image at build time -# Replace this with a multi-stage build if upstream provides Docker images. COPY ./app /app/code - -# Copy start script and make it executable COPY ./start.sh /app/pkg/start.sh -RUN chmod +x /app/pkg/start.sh +COPY ./test /app/pkg/test + +RUN chmod +x /app/pkg/start.sh /app/pkg/test/smoke.sh \ + && mkdir -p /app/data \ + && chown -R cloudron:cloudron /app -# Cloudron expects all processes to run as cloudron user USER cloudron WORKDIR /app/code diff --git a/apps/docker-webhook/README.md b/apps/docker-webhook/README.md index 4cf7917..44ca383 100644 --- a/apps/docker-webhook/README.md +++ b/apps/docker-webhook/README.md @@ -2,19 +2,19 @@ - **Upstream repository**: https://github.com/thecatlady/docker-webhook - **Implementation issue**: https://projects.knownelement.com/issues/271 -- **Status**: Draft scaffolding generated on $(date -u +"%Y-%m-%dT%H:%M:%SZ") +- **Generated**: 2025-10-02T17:19:00Z UTC ## Packaging Checklist -1. Review upstream deployment requirements and map them to Cloudron services (database, cache, object storage, workers). -2. Update `Dockerfile` with the correct build steps and runtime dependencies. -3. Implement `start.sh` to configure the app from Cloudron-provided environment variables and launch the primary process. -4. Edit `CloudronManifest.json` with accurate metadata, permissions, ports, addons, and health checks. -5. Add integration and smoke tests under `test/` to validate the package. -6. Document manual configuration steps, migration requirements, and known gaps in this README. +1. Map upstream services (databases, caches, workers) to Cloudron addons; remove unused entries from `optionalAddons` and enable required ones under `addons`. +2. Implement the multi-stage build in `Dockerfile` to fetch/compile the correct release of docker-webhook. +3. Update `start.sh` to configure the app from Cloudron environment variables and launch the primary process. +4. Replace the placeholder health checks and smoke test with real coverage. +5. Complete `CloudronManifest.json` (tagline, description, versioning, resource limits, ingress, TCP ports, etc.). +6. Document manual configuration steps, migrations, and known gaps below. ## Notes -- Replace the placeholder long-running process in `start.sh`. -- Populate the `app/` directory with the application build artefacts or git submodules. -- Use the shared packaging container (`docker/packager`) to run `cloudron build` and `cloudron install` so the host remains clean. +- Populate the `app/` directory with runtime overlays or artifacts generated during the build stage. +- Use the shared packaging container (`docker/packager`) for `cloudron build/install` to keep the host clean. +- Record decisions and operational requirements under `docs/apps/docker-webhook/` as work progresses. diff --git a/apps/docker-webhook/metadata.json b/apps/docker-webhook/metadata.json index 0764f51..2954253 100644 --- a/apps/docker-webhook/metadata.json +++ b/apps/docker-webhook/metadata.json @@ -4,6 +4,6 @@ "issue": "https://projects.knownelement.com/issues/271", "repo": "https://github.com/thecatlady/docker-webhook", "additionalRepos": [], - "created": "2025-10-02T16:46:49Z", + "created": "2025-10-02T17:19:00Z", "notes": "TODO: capture packaging notes" -} \ No newline at end of file +} diff --git a/apps/docker-webhook/start.sh b/apps/docker-webhook/start.sh index 82895e9..8bc8a9f 100755 --- a/apps/docker-webhook/start.sh +++ b/apps/docker-webhook/start.sh @@ -1,8 +1,9 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Cloudron injects configuration via environment variables and files under /run -# Use this script to render config files and launch the upstream service. +# TODO: render configuration files from CLOUDRON_* environment variables +# Example: +# envsubst < /app/pkg/config.tmpl > /run/config.yaml -# TODO: Replace the command below with the correct process supervisor. -exec /bin/sh -c "echo 'Replace start.sh with application startup logic for docker-webhook' && sleep infinity" +>&2 echo "start.sh for docker-webhook is not implemented yet." +exit 1 diff --git a/apps/docker-webhook/test/smoke.sh b/apps/docker-webhook/test/smoke.sh index ebd1134..37fa3a8 100755 --- a/apps/docker-webhook/test/smoke.sh +++ b/apps/docker-webhook/test/smoke.sh @@ -1,16 +1,14 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Basic container reachability check executed inside the packaging container. -# Replace curl target with an endpoint exposed by the app once the package is functional. -cloudron_app_url=${CLOUDRON_APP_ORIGIN:-"http://localhost"} +cloudron_app_origin=${CLOUDRON_APP_ORIGIN:-http://localhost} -http_code=$(curl -s -o /tmp/smoke.log -w "%{http_code}" "${cloudron_app_url}") +http_code=$(curl --silent --show-error --output /tmp/smoke.log --write-out "%{http_code}" "${cloudron_app_origin}/") if [[ "${http_code}" != "200" ]]; then - echo "Unexpected HTTP status: ${http_code}" >&2 - cat /tmp/smoke.log >&2 + >&2 echo "Smoke test failed for docker-webhook: expected HTTP 200 from ${cloudron_app_origin}/, got ${http_code}" + >&2 cat /tmp/smoke.log exit 1 fi -echo "Smoke test passed" +echo "Smoke test placeholder passed for docker-webhook" diff --git a/apps/drawio/CloudronManifest.json b/apps/drawio/CloudronManifest.json index 8d5fc2c..315a406 100644 --- a/apps/drawio/CloudronManifest.json +++ b/apps/drawio/CloudronManifest.json @@ -12,9 +12,16 @@ "version": "0.1.0", "tags": ["custom", "known-element"], "healthCheckPath": "/", - "memoryLimit": 536870912, "httpPort": 3000, + "memoryLimit": "512M", "addons": { "localstorage": {} + }, + "optionalAddons": { + "postgresql": {}, + "redis": {}, + "mysql": {}, + "mongodb": {}, + "sendmail": {} } } diff --git a/apps/drawio/Dockerfile b/apps/drawio/Dockerfile index d90aa4d..b1ace9c 100644 --- a/apps/drawio/Dockerfile +++ b/apps/drawio/Dockerfile @@ -1,21 +1,38 @@ -# syntax=docker/dockerfile:1 -FROM cloudron/base:5.0.0 +# syntax=docker/dockerfile:1.6 +ARG APP_VERSION=latest + +FROM cloudron/base:5.0.0 AS builder +WORKDIR /build + +# ----------------------------------------------------------------------------- +# TODO: Fetch and build draw.io +# Example: +# RUN git clone --depth 1 --branch "${APP_VERSION}" https://github.com/jgraph/docker-drawio source \ +# && cd source \ +# && npm ci \ +# && npm run build +# ----------------------------------------------------------------------------- + +FROM cloudron/base:5.0.0 LABEL org.opencontainers.image.source="https://github.com/jgraph/docker-drawio" LABEL org.opencontainers.image.description="Cloudron package for draw.io" -ARG APP_VERSION -ENV APP_VERSION=${APP_VERSION:-latest} +ENV APP_VERSION=${APP_VERSION} + +# ----------------------------------------------------------------------------- +# TODO: Copy build artefacts from the builder stage +# COPY --from=builder /build/source/dist /app/code +# ----------------------------------------------------------------------------- -# Copy application source into image at build time -# Replace this with a multi-stage build if upstream provides Docker images. COPY ./app /app/code - -# Copy start script and make it executable COPY ./start.sh /app/pkg/start.sh -RUN chmod +x /app/pkg/start.sh +COPY ./test /app/pkg/test + +RUN chmod +x /app/pkg/start.sh /app/pkg/test/smoke.sh \ + && mkdir -p /app/data \ + && chown -R cloudron:cloudron /app -# Cloudron expects all processes to run as cloudron user USER cloudron WORKDIR /app/code diff --git a/apps/drawio/README.md b/apps/drawio/README.md index d98b4dc..a4935b0 100644 --- a/apps/drawio/README.md +++ b/apps/drawio/README.md @@ -2,19 +2,19 @@ - **Upstream repository**: https://github.com/jgraph/docker-drawio - **Implementation issue**: https://projects.knownelement.com/issues/272 -- **Status**: Draft scaffolding generated on $(date -u +"%Y-%m-%dT%H:%M:%SZ") +- **Generated**: 2025-10-02T17:19:01Z UTC ## Packaging Checklist -1. Review upstream deployment requirements and map them to Cloudron services (database, cache, object storage, workers). -2. Update `Dockerfile` with the correct build steps and runtime dependencies. -3. Implement `start.sh` to configure the app from Cloudron-provided environment variables and launch the primary process. -4. Edit `CloudronManifest.json` with accurate metadata, permissions, ports, addons, and health checks. -5. Add integration and smoke tests under `test/` to validate the package. -6. Document manual configuration steps, migration requirements, and known gaps in this README. +1. Map upstream services (databases, caches, workers) to Cloudron addons; remove unused entries from `optionalAddons` and enable required ones under `addons`. +2. Implement the multi-stage build in `Dockerfile` to fetch/compile the correct release of draw.io. +3. Update `start.sh` to configure the app from Cloudron environment variables and launch the primary process. +4. Replace the placeholder health checks and smoke test with real coverage. +5. Complete `CloudronManifest.json` (tagline, description, versioning, resource limits, ingress, TCP ports, etc.). +6. Document manual configuration steps, migrations, and known gaps below. ## Notes -- Replace the placeholder long-running process in `start.sh`. -- Populate the `app/` directory with the application build artefacts or git submodules. -- Use the shared packaging container (`docker/packager`) to run `cloudron build` and `cloudron install` so the host remains clean. +- Populate the `app/` directory with runtime overlays or artifacts generated during the build stage. +- Use the shared packaging container (`docker/packager`) for `cloudron build/install` to keep the host clean. +- Record decisions and operational requirements under `docs/apps/drawio/` as work progresses. diff --git a/apps/drawio/metadata.json b/apps/drawio/metadata.json index 26d7555..31fa757 100644 --- a/apps/drawio/metadata.json +++ b/apps/drawio/metadata.json @@ -4,6 +4,6 @@ "issue": "https://projects.knownelement.com/issues/272", "repo": "https://github.com/jgraph/docker-drawio", "additionalRepos": [], - "created": "2025-10-02T16:46:49Z", + "created": "2025-10-02T17:19:01Z", "notes": "TODO: capture packaging notes" -} \ No newline at end of file +} diff --git a/apps/drawio/start.sh b/apps/drawio/start.sh index 9071112..ed9ad7d 100755 --- a/apps/drawio/start.sh +++ b/apps/drawio/start.sh @@ -1,8 +1,9 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Cloudron injects configuration via environment variables and files under /run -# Use this script to render config files and launch the upstream service. +# TODO: render configuration files from CLOUDRON_* environment variables +# Example: +# envsubst < /app/pkg/config.tmpl > /run/config.yaml -# TODO: Replace the command below with the correct process supervisor. -exec /bin/sh -c "echo 'Replace start.sh with application startup logic for draw.io' && sleep infinity" +>&2 echo "start.sh for draw.io is not implemented yet." +exit 1 diff --git a/apps/drawio/test/smoke.sh b/apps/drawio/test/smoke.sh index ebd1134..3cee4b9 100755 --- a/apps/drawio/test/smoke.sh +++ b/apps/drawio/test/smoke.sh @@ -1,16 +1,14 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Basic container reachability check executed inside the packaging container. -# Replace curl target with an endpoint exposed by the app once the package is functional. -cloudron_app_url=${CLOUDRON_APP_ORIGIN:-"http://localhost"} +cloudron_app_origin=${CLOUDRON_APP_ORIGIN:-http://localhost} -http_code=$(curl -s -o /tmp/smoke.log -w "%{http_code}" "${cloudron_app_url}") +http_code=$(curl --silent --show-error --output /tmp/smoke.log --write-out "%{http_code}" "${cloudron_app_origin}/") if [[ "${http_code}" != "200" ]]; then - echo "Unexpected HTTP status: ${http_code}" >&2 - cat /tmp/smoke.log >&2 + >&2 echo "Smoke test failed for draw.io: expected HTTP 200 from ${cloudron_app_origin}/, got ${http_code}" + >&2 cat /tmp/smoke.log exit 1 fi -echo "Smoke test passed" +echo "Smoke test placeholder passed for draw.io" diff --git a/apps/easy-gate/CloudronManifest.json b/apps/easy-gate/CloudronManifest.json index e7465e4..e73a9b3 100644 --- a/apps/easy-gate/CloudronManifest.json +++ b/apps/easy-gate/CloudronManifest.json @@ -12,9 +12,16 @@ "version": "0.1.0", "tags": ["custom", "known-element"], "healthCheckPath": "/", - "memoryLimit": 536870912, "httpPort": 3000, + "memoryLimit": "512M", "addons": { "localstorage": {} + }, + "optionalAddons": { + "postgresql": {}, + "redis": {}, + "mysql": {}, + "mongodb": {}, + "sendmail": {} } } diff --git a/apps/easy-gate/Dockerfile b/apps/easy-gate/Dockerfile index 62f8bbe..2e93899 100644 --- a/apps/easy-gate/Dockerfile +++ b/apps/easy-gate/Dockerfile @@ -1,21 +1,38 @@ -# syntax=docker/dockerfile:1 -FROM cloudron/base:5.0.0 +# syntax=docker/dockerfile:1.6 +ARG APP_VERSION=latest + +FROM cloudron/base:5.0.0 AS builder +WORKDIR /build + +# ----------------------------------------------------------------------------- +# TODO: Fetch and build Easy Gate +# Example: +# RUN git clone --depth 1 --branch "${APP_VERSION}" https://github.com/wiredlush/easy-gate.git source \ +# && cd source \ +# && npm ci \ +# && npm run build +# ----------------------------------------------------------------------------- + +FROM cloudron/base:5.0.0 LABEL org.opencontainers.image.source="https://github.com/wiredlush/easy-gate.git" LABEL org.opencontainers.image.description="Cloudron package for Easy Gate" -ARG APP_VERSION -ENV APP_VERSION=${APP_VERSION:-latest} +ENV APP_VERSION=${APP_VERSION} + +# ----------------------------------------------------------------------------- +# TODO: Copy build artefacts from the builder stage +# COPY --from=builder /build/source/dist /app/code +# ----------------------------------------------------------------------------- -# Copy application source into image at build time -# Replace this with a multi-stage build if upstream provides Docker images. COPY ./app /app/code - -# Copy start script and make it executable COPY ./start.sh /app/pkg/start.sh -RUN chmod +x /app/pkg/start.sh +COPY ./test /app/pkg/test + +RUN chmod +x /app/pkg/start.sh /app/pkg/test/smoke.sh \ + && mkdir -p /app/data \ + && chown -R cloudron:cloudron /app -# Cloudron expects all processes to run as cloudron user USER cloudron WORKDIR /app/code diff --git a/apps/easy-gate/README.md b/apps/easy-gate/README.md index ba2d7eb..7c16246 100644 --- a/apps/easy-gate/README.md +++ b/apps/easy-gate/README.md @@ -2,19 +2,19 @@ - **Upstream repository**: https://github.com/wiredlush/easy-gate.git - **Implementation issue**: https://projects.knownelement.com/issues/54 -- **Status**: Draft scaffolding generated on $(date -u +"%Y-%m-%dT%H:%M:%SZ") +- **Generated**: 2025-10-02T17:19:00Z UTC ## Packaging Checklist -1. Review upstream deployment requirements and map them to Cloudron services (database, cache, object storage, workers). -2. Update `Dockerfile` with the correct build steps and runtime dependencies. -3. Implement `start.sh` to configure the app from Cloudron-provided environment variables and launch the primary process. -4. Edit `CloudronManifest.json` with accurate metadata, permissions, ports, addons, and health checks. -5. Add integration and smoke tests under `test/` to validate the package. -6. Document manual configuration steps, migration requirements, and known gaps in this README. +1. Map upstream services (databases, caches, workers) to Cloudron addons; remove unused entries from `optionalAddons` and enable required ones under `addons`. +2. Implement the multi-stage build in `Dockerfile` to fetch/compile the correct release of Easy Gate. +3. Update `start.sh` to configure the app from Cloudron environment variables and launch the primary process. +4. Replace the placeholder health checks and smoke test with real coverage. +5. Complete `CloudronManifest.json` (tagline, description, versioning, resource limits, ingress, TCP ports, etc.). +6. Document manual configuration steps, migrations, and known gaps below. ## Notes -- Replace the placeholder long-running process in `start.sh`. -- Populate the `app/` directory with the application build artefacts or git submodules. -- Use the shared packaging container (`docker/packager`) to run `cloudron build` and `cloudron install` so the host remains clean. +- Populate the `app/` directory with runtime overlays or artifacts generated during the build stage. +- Use the shared packaging container (`docker/packager`) for `cloudron build/install` to keep the host clean. +- Record decisions and operational requirements under `docs/apps/easy-gate/` as work progresses. diff --git a/apps/easy-gate/metadata.json b/apps/easy-gate/metadata.json index 405ee70..9c9c7bb 100644 --- a/apps/easy-gate/metadata.json +++ b/apps/easy-gate/metadata.json @@ -4,6 +4,6 @@ "issue": "https://projects.knownelement.com/issues/54", "repo": "https://github.com/wiredlush/easy-gate.git", "additionalRepos": [], - "created": "2025-10-02T16:46:49Z", + "created": "2025-10-02T17:19:00Z", "notes": "TODO: capture packaging notes" -} \ No newline at end of file +} diff --git a/apps/easy-gate/start.sh b/apps/easy-gate/start.sh index 4389be0..074a723 100755 --- a/apps/easy-gate/start.sh +++ b/apps/easy-gate/start.sh @@ -1,8 +1,9 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Cloudron injects configuration via environment variables and files under /run -# Use this script to render config files and launch the upstream service. +# TODO: render configuration files from CLOUDRON_* environment variables +# Example: +# envsubst < /app/pkg/config.tmpl > /run/config.yaml -# TODO: Replace the command below with the correct process supervisor. -exec /bin/sh -c "echo 'Replace start.sh with application startup logic for Easy Gate' && sleep infinity" +>&2 echo "start.sh for Easy Gate is not implemented yet." +exit 1 diff --git a/apps/easy-gate/test/smoke.sh b/apps/easy-gate/test/smoke.sh index ebd1134..12017fe 100755 --- a/apps/easy-gate/test/smoke.sh +++ b/apps/easy-gate/test/smoke.sh @@ -1,16 +1,14 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Basic container reachability check executed inside the packaging container. -# Replace curl target with an endpoint exposed by the app once the package is functional. -cloudron_app_url=${CLOUDRON_APP_ORIGIN:-"http://localhost"} +cloudron_app_origin=${CLOUDRON_APP_ORIGIN:-http://localhost} -http_code=$(curl -s -o /tmp/smoke.log -w "%{http_code}" "${cloudron_app_url}") +http_code=$(curl --silent --show-error --output /tmp/smoke.log --write-out "%{http_code}" "${cloudron_app_origin}/") if [[ "${http_code}" != "200" ]]; then - echo "Unexpected HTTP status: ${http_code}" >&2 - cat /tmp/smoke.log >&2 + >&2 echo "Smoke test failed for Easy Gate: expected HTTP 200 from ${cloudron_app_origin}/, got ${http_code}" + >&2 cat /tmp/smoke.log exit 1 fi -echo "Smoke test passed" +echo "Smoke test placeholder passed for Easy Gate" diff --git a/apps/elabftw/CloudronManifest.json b/apps/elabftw/CloudronManifest.json index d5195f7..c87dd2e 100644 --- a/apps/elabftw/CloudronManifest.json +++ b/apps/elabftw/CloudronManifest.json @@ -12,9 +12,16 @@ "version": "0.1.0", "tags": ["custom", "known-element"], "healthCheckPath": "/", - "memoryLimit": 536870912, "httpPort": 3000, + "memoryLimit": "512M", "addons": { "localstorage": {} + }, + "optionalAddons": { + "postgresql": {}, + "redis": {}, + "mysql": {}, + "mongodb": {}, + "sendmail": {} } } diff --git a/apps/elabftw/Dockerfile b/apps/elabftw/Dockerfile index d268faa..19fcb7e 100644 --- a/apps/elabftw/Dockerfile +++ b/apps/elabftw/Dockerfile @@ -1,21 +1,38 @@ -# syntax=docker/dockerfile:1 -FROM cloudron/base:5.0.0 +# syntax=docker/dockerfile:1.6 +ARG APP_VERSION=latest + +FROM cloudron/base:5.0.0 AS builder +WORKDIR /build + +# ----------------------------------------------------------------------------- +# TODO: Fetch and build eLabFTW +# Example: +# RUN git clone --depth 1 --branch "${APP_VERSION}" https://github.com/elabftw/elabftw.git source \ +# && cd source \ +# && npm ci \ +# && npm run build +# ----------------------------------------------------------------------------- + +FROM cloudron/base:5.0.0 LABEL org.opencontainers.image.source="https://github.com/elabftw/elabftw.git" LABEL org.opencontainers.image.description="Cloudron package for eLabFTW" -ARG APP_VERSION -ENV APP_VERSION=${APP_VERSION:-latest} +ENV APP_VERSION=${APP_VERSION} + +# ----------------------------------------------------------------------------- +# TODO: Copy build artefacts from the builder stage +# COPY --from=builder /build/source/dist /app/code +# ----------------------------------------------------------------------------- -# Copy application source into image at build time -# Replace this with a multi-stage build if upstream provides Docker images. COPY ./app /app/code - -# Copy start script and make it executable COPY ./start.sh /app/pkg/start.sh -RUN chmod +x /app/pkg/start.sh +COPY ./test /app/pkg/test + +RUN chmod +x /app/pkg/start.sh /app/pkg/test/smoke.sh \ + && mkdir -p /app/data \ + && chown -R cloudron:cloudron /app -# Cloudron expects all processes to run as cloudron user USER cloudron WORKDIR /app/code diff --git a/apps/elabftw/README.md b/apps/elabftw/README.md index b6b0dd4..e5320b7 100644 --- a/apps/elabftw/README.md +++ b/apps/elabftw/README.md @@ -2,19 +2,19 @@ - **Upstream repository**: https://github.com/elabftw/elabftw.git - **Implementation issue**: https://projects.knownelement.com/issues/188 -- **Status**: Draft scaffolding generated on $(date -u +"%Y-%m-%dT%H:%M:%SZ") +- **Generated**: 2025-10-02T17:19:00Z UTC ## Packaging Checklist -1. Review upstream deployment requirements and map them to Cloudron services (database, cache, object storage, workers). -2. Update `Dockerfile` with the correct build steps and runtime dependencies. -3. Implement `start.sh` to configure the app from Cloudron-provided environment variables and launch the primary process. -4. Edit `CloudronManifest.json` with accurate metadata, permissions, ports, addons, and health checks. -5. Add integration and smoke tests under `test/` to validate the package. -6. Document manual configuration steps, migration requirements, and known gaps in this README. +1. Map upstream services (databases, caches, workers) to Cloudron addons; remove unused entries from `optionalAddons` and enable required ones under `addons`. +2. Implement the multi-stage build in `Dockerfile` to fetch/compile the correct release of eLabFTW. +3. Update `start.sh` to configure the app from Cloudron environment variables and launch the primary process. +4. Replace the placeholder health checks and smoke test with real coverage. +5. Complete `CloudronManifest.json` (tagline, description, versioning, resource limits, ingress, TCP ports, etc.). +6. Document manual configuration steps, migrations, and known gaps below. ## Notes -- Replace the placeholder long-running process in `start.sh`. -- Populate the `app/` directory with the application build artefacts or git submodules. -- Use the shared packaging container (`docker/packager`) to run `cloudron build` and `cloudron install` so the host remains clean. +- Populate the `app/` directory with runtime overlays or artifacts generated during the build stage. +- Use the shared packaging container (`docker/packager`) for `cloudron build/install` to keep the host clean. +- Record decisions and operational requirements under `docs/apps/elabftw/` as work progresses. diff --git a/apps/elabftw/metadata.json b/apps/elabftw/metadata.json index 828b0cf..2d2b3c3 100644 --- a/apps/elabftw/metadata.json +++ b/apps/elabftw/metadata.json @@ -4,6 +4,6 @@ "issue": "https://projects.knownelement.com/issues/188", "repo": "https://github.com/elabftw/elabftw.git", "additionalRepos": [], - "created": "2025-10-02T16:46:49Z", + "created": "2025-10-02T17:19:00Z", "notes": "TODO: capture packaging notes" -} \ No newline at end of file +} diff --git a/apps/elabftw/start.sh b/apps/elabftw/start.sh index 83175fb..380013c 100755 --- a/apps/elabftw/start.sh +++ b/apps/elabftw/start.sh @@ -1,8 +1,9 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Cloudron injects configuration via environment variables and files under /run -# Use this script to render config files and launch the upstream service. +# TODO: render configuration files from CLOUDRON_* environment variables +# Example: +# envsubst < /app/pkg/config.tmpl > /run/config.yaml -# TODO: Replace the command below with the correct process supervisor. -exec /bin/sh -c "echo 'Replace start.sh with application startup logic for eLabFTW' && sleep infinity" +>&2 echo "start.sh for eLabFTW is not implemented yet." +exit 1 diff --git a/apps/elabftw/test/smoke.sh b/apps/elabftw/test/smoke.sh index ebd1134..3179ce0 100755 --- a/apps/elabftw/test/smoke.sh +++ b/apps/elabftw/test/smoke.sh @@ -1,16 +1,14 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Basic container reachability check executed inside the packaging container. -# Replace curl target with an endpoint exposed by the app once the package is functional. -cloudron_app_url=${CLOUDRON_APP_ORIGIN:-"http://localhost"} +cloudron_app_origin=${CLOUDRON_APP_ORIGIN:-http://localhost} -http_code=$(curl -s -o /tmp/smoke.log -w "%{http_code}" "${cloudron_app_url}") +http_code=$(curl --silent --show-error --output /tmp/smoke.log --write-out "%{http_code}" "${cloudron_app_origin}/") if [[ "${http_code}" != "200" ]]; then - echo "Unexpected HTTP status: ${http_code}" >&2 - cat /tmp/smoke.log >&2 + >&2 echo "Smoke test failed for eLabFTW: expected HTTP 200 from ${cloudron_app_origin}/, got ${http_code}" + >&2 cat /tmp/smoke.log exit 1 fi -echo "Smoke test passed" +echo "Smoke test placeholder passed for eLabFTW" diff --git a/apps/fleetdm-fleet/CloudronManifest.json b/apps/fleetdm-fleet/CloudronManifest.json index c41d67a..c275dff 100644 --- a/apps/fleetdm-fleet/CloudronManifest.json +++ b/apps/fleetdm-fleet/CloudronManifest.json @@ -12,9 +12,16 @@ "version": "0.1.0", "tags": ["custom", "known-element"], "healthCheckPath": "/", - "memoryLimit": 536870912, "httpPort": 3000, + "memoryLimit": "512M", "addons": { "localstorage": {} + }, + "optionalAddons": { + "postgresql": {}, + "redis": {}, + "mysql": {}, + "mongodb": {}, + "sendmail": {} } } diff --git a/apps/fleetdm-fleet/Dockerfile b/apps/fleetdm-fleet/Dockerfile index 0faa653..0309d71 100644 --- a/apps/fleetdm-fleet/Dockerfile +++ b/apps/fleetdm-fleet/Dockerfile @@ -1,21 +1,38 @@ -# syntax=docker/dockerfile:1 -FROM cloudron/base:5.0.0 +# syntax=docker/dockerfile:1.6 +ARG APP_VERSION=latest + +FROM cloudron/base:5.0.0 AS builder +WORKDIR /build + +# ----------------------------------------------------------------------------- +# TODO: Fetch and build FleetDM Fleet +# Example: +# RUN git clone --depth 1 --branch "${APP_VERSION}" https://github.com/fleetdm/fleet.git source \ +# && cd source \ +# && npm ci \ +# && npm run build +# ----------------------------------------------------------------------------- + +FROM cloudron/base:5.0.0 LABEL org.opencontainers.image.source="https://github.com/fleetdm/fleet.git" LABEL org.opencontainers.image.description="Cloudron package for FleetDM Fleet" -ARG APP_VERSION -ENV APP_VERSION=${APP_VERSION:-latest} +ENV APP_VERSION=${APP_VERSION} + +# ----------------------------------------------------------------------------- +# TODO: Copy build artefacts from the builder stage +# COPY --from=builder /build/source/dist /app/code +# ----------------------------------------------------------------------------- -# Copy application source into image at build time -# Replace this with a multi-stage build if upstream provides Docker images. COPY ./app /app/code - -# Copy start script and make it executable COPY ./start.sh /app/pkg/start.sh -RUN chmod +x /app/pkg/start.sh +COPY ./test /app/pkg/test + +RUN chmod +x /app/pkg/start.sh /app/pkg/test/smoke.sh \ + && mkdir -p /app/data \ + && chown -R cloudron:cloudron /app -# Cloudron expects all processes to run as cloudron user USER cloudron WORKDIR /app/code diff --git a/apps/fleetdm-fleet/README.md b/apps/fleetdm-fleet/README.md index c0f3a99..b4793fe 100644 --- a/apps/fleetdm-fleet/README.md +++ b/apps/fleetdm-fleet/README.md @@ -2,19 +2,19 @@ - **Upstream repository**: https://github.com/fleetdm/fleet.git - **Implementation issue**: https://projects.knownelement.com/issues/195 -- **Status**: Draft scaffolding generated on $(date -u +"%Y-%m-%dT%H:%M:%SZ") +- **Generated**: 2025-10-02T17:19:00Z UTC ## Packaging Checklist -1. Review upstream deployment requirements and map them to Cloudron services (database, cache, object storage, workers). -2. Update `Dockerfile` with the correct build steps and runtime dependencies. -3. Implement `start.sh` to configure the app from Cloudron-provided environment variables and launch the primary process. -4. Edit `CloudronManifest.json` with accurate metadata, permissions, ports, addons, and health checks. -5. Add integration and smoke tests under `test/` to validate the package. -6. Document manual configuration steps, migration requirements, and known gaps in this README. +1. Map upstream services (databases, caches, workers) to Cloudron addons; remove unused entries from `optionalAddons` and enable required ones under `addons`. +2. Implement the multi-stage build in `Dockerfile` to fetch/compile the correct release of FleetDM Fleet. +3. Update `start.sh` to configure the app from Cloudron environment variables and launch the primary process. +4. Replace the placeholder health checks and smoke test with real coverage. +5. Complete `CloudronManifest.json` (tagline, description, versioning, resource limits, ingress, TCP ports, etc.). +6. Document manual configuration steps, migrations, and known gaps below. ## Notes -- Replace the placeholder long-running process in `start.sh`. -- Populate the `app/` directory with the application build artefacts or git submodules. -- Use the shared packaging container (`docker/packager`) to run `cloudron build` and `cloudron install` so the host remains clean. +- Populate the `app/` directory with runtime overlays or artifacts generated during the build stage. +- Use the shared packaging container (`docker/packager`) for `cloudron build/install` to keep the host clean. +- Record decisions and operational requirements under `docs/apps/fleetdm-fleet/` as work progresses. diff --git a/apps/fleetdm-fleet/metadata.json b/apps/fleetdm-fleet/metadata.json index c8a03a5..2b03715 100644 --- a/apps/fleetdm-fleet/metadata.json +++ b/apps/fleetdm-fleet/metadata.json @@ -4,6 +4,6 @@ "issue": "https://projects.knownelement.com/issues/195", "repo": "https://github.com/fleetdm/fleet.git", "additionalRepos": [], - "created": "2025-10-02T16:46:49Z", + "created": "2025-10-02T17:19:00Z", "notes": "TODO: capture packaging notes" -} \ No newline at end of file +} diff --git a/apps/fleetdm-fleet/start.sh b/apps/fleetdm-fleet/start.sh index 34827af..97ade2f 100755 --- a/apps/fleetdm-fleet/start.sh +++ b/apps/fleetdm-fleet/start.sh @@ -1,8 +1,9 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Cloudron injects configuration via environment variables and files under /run -# Use this script to render config files and launch the upstream service. +# TODO: render configuration files from CLOUDRON_* environment variables +# Example: +# envsubst < /app/pkg/config.tmpl > /run/config.yaml -# TODO: Replace the command below with the correct process supervisor. -exec /bin/sh -c "echo 'Replace start.sh with application startup logic for FleetDM Fleet' && sleep infinity" +>&2 echo "start.sh for FleetDM Fleet is not implemented yet." +exit 1 diff --git a/apps/fleetdm-fleet/test/smoke.sh b/apps/fleetdm-fleet/test/smoke.sh index ebd1134..0237a38 100755 --- a/apps/fleetdm-fleet/test/smoke.sh +++ b/apps/fleetdm-fleet/test/smoke.sh @@ -1,16 +1,14 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Basic container reachability check executed inside the packaging container. -# Replace curl target with an endpoint exposed by the app once the package is functional. -cloudron_app_url=${CLOUDRON_APP_ORIGIN:-"http://localhost"} +cloudron_app_origin=${CLOUDRON_APP_ORIGIN:-http://localhost} -http_code=$(curl -s -o /tmp/smoke.log -w "%{http_code}" "${cloudron_app_url}") +http_code=$(curl --silent --show-error --output /tmp/smoke.log --write-out "%{http_code}" "${cloudron_app_origin}/") if [[ "${http_code}" != "200" ]]; then - echo "Unexpected HTTP status: ${http_code}" >&2 - cat /tmp/smoke.log >&2 + >&2 echo "Smoke test failed for FleetDM Fleet: expected HTTP 200 from ${cloudron_app_origin}/, got ${http_code}" + >&2 cat /tmp/smoke.log exit 1 fi -echo "Smoke test passed" +echo "Smoke test placeholder passed for FleetDM Fleet" diff --git a/apps/fonoster/CloudronManifest.json b/apps/fonoster/CloudronManifest.json index b3b14b9..f67a7fe 100644 --- a/apps/fonoster/CloudronManifest.json +++ b/apps/fonoster/CloudronManifest.json @@ -12,9 +12,16 @@ "version": "0.1.0", "tags": ["custom", "known-element"], "healthCheckPath": "/", - "memoryLimit": 536870912, "httpPort": 3000, + "memoryLimit": "512M", "addons": { "localstorage": {} + }, + "optionalAddons": { + "postgresql": {}, + "redis": {}, + "mysql": {}, + "mongodb": {}, + "sendmail": {} } } diff --git a/apps/fonoster/Dockerfile b/apps/fonoster/Dockerfile index cfc7486..cde21af 100644 --- a/apps/fonoster/Dockerfile +++ b/apps/fonoster/Dockerfile @@ -1,21 +1,38 @@ -# syntax=docker/dockerfile:1 -FROM cloudron/base:5.0.0 +# syntax=docker/dockerfile:1.6 +ARG APP_VERSION=latest + +FROM cloudron/base:5.0.0 AS builder +WORKDIR /build + +# ----------------------------------------------------------------------------- +# TODO: Fetch and build Fonoster +# Example: +# RUN git clone --depth 1 --branch "${APP_VERSION}" https://github.com/fonoster/fonoster.git source \ +# && cd source \ +# && npm ci \ +# && npm run build +# ----------------------------------------------------------------------------- + +FROM cloudron/base:5.0.0 LABEL org.opencontainers.image.source="https://github.com/fonoster/fonoster.git" LABEL org.opencontainers.image.description="Cloudron package for Fonoster" -ARG APP_VERSION -ENV APP_VERSION=${APP_VERSION:-latest} +ENV APP_VERSION=${APP_VERSION} + +# ----------------------------------------------------------------------------- +# TODO: Copy build artefacts from the builder stage +# COPY --from=builder /build/source/dist /app/code +# ----------------------------------------------------------------------------- -# Copy application source into image at build time -# Replace this with a multi-stage build if upstream provides Docker images. COPY ./app /app/code - -# Copy start script and make it executable COPY ./start.sh /app/pkg/start.sh -RUN chmod +x /app/pkg/start.sh +COPY ./test /app/pkg/test + +RUN chmod +x /app/pkg/start.sh /app/pkg/test/smoke.sh \ + && mkdir -p /app/data \ + && chown -R cloudron:cloudron /app -# Cloudron expects all processes to run as cloudron user USER cloudron WORKDIR /app/code diff --git a/apps/fonoster/README.md b/apps/fonoster/README.md index 8918fd9..29c2200 100644 --- a/apps/fonoster/README.md +++ b/apps/fonoster/README.md @@ -2,19 +2,19 @@ - **Upstream repository**: https://github.com/fonoster/fonoster.git - **Implementation issue**: https://projects.knownelement.com/issues/227 -- **Status**: Draft scaffolding generated on $(date -u +"%Y-%m-%dT%H:%M:%SZ") +- **Generated**: 2025-10-02T17:19:00Z UTC ## Packaging Checklist -1. Review upstream deployment requirements and map them to Cloudron services (database, cache, object storage, workers). -2. Update `Dockerfile` with the correct build steps and runtime dependencies. -3. Implement `start.sh` to configure the app from Cloudron-provided environment variables and launch the primary process. -4. Edit `CloudronManifest.json` with accurate metadata, permissions, ports, addons, and health checks. -5. Add integration and smoke tests under `test/` to validate the package. -6. Document manual configuration steps, migration requirements, and known gaps in this README. +1. Map upstream services (databases, caches, workers) to Cloudron addons; remove unused entries from `optionalAddons` and enable required ones under `addons`. +2. Implement the multi-stage build in `Dockerfile` to fetch/compile the correct release of Fonoster. +3. Update `start.sh` to configure the app from Cloudron environment variables and launch the primary process. +4. Replace the placeholder health checks and smoke test with real coverage. +5. Complete `CloudronManifest.json` (tagline, description, versioning, resource limits, ingress, TCP ports, etc.). +6. Document manual configuration steps, migrations, and known gaps below. ## Notes -- Replace the placeholder long-running process in `start.sh`. -- Populate the `app/` directory with the application build artefacts or git submodules. -- Use the shared packaging container (`docker/packager`) to run `cloudron build` and `cloudron install` so the host remains clean. +- Populate the `app/` directory with runtime overlays or artifacts generated during the build stage. +- Use the shared packaging container (`docker/packager`) for `cloudron build/install` to keep the host clean. +- Record decisions and operational requirements under `docs/apps/fonoster/` as work progresses. diff --git a/apps/fonoster/metadata.json b/apps/fonoster/metadata.json index ca95edd..231f98d 100644 --- a/apps/fonoster/metadata.json +++ b/apps/fonoster/metadata.json @@ -4,6 +4,6 @@ "issue": "https://projects.knownelement.com/issues/227", "repo": "https://github.com/fonoster/fonoster.git", "additionalRepos": [], - "created": "2025-10-02T16:46:49Z", + "created": "2025-10-02T17:19:00Z", "notes": "TODO: capture packaging notes" -} \ No newline at end of file +} diff --git a/apps/fonoster/start.sh b/apps/fonoster/start.sh index 2da2bd6..5bf5d60 100755 --- a/apps/fonoster/start.sh +++ b/apps/fonoster/start.sh @@ -1,8 +1,9 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Cloudron injects configuration via environment variables and files under /run -# Use this script to render config files and launch the upstream service. +# TODO: render configuration files from CLOUDRON_* environment variables +# Example: +# envsubst < /app/pkg/config.tmpl > /run/config.yaml -# TODO: Replace the command below with the correct process supervisor. -exec /bin/sh -c "echo 'Replace start.sh with application startup logic for Fonoster' && sleep infinity" +>&2 echo "start.sh for Fonoster is not implemented yet." +exit 1 diff --git a/apps/fonoster/test/smoke.sh b/apps/fonoster/test/smoke.sh index ebd1134..7f1be41 100755 --- a/apps/fonoster/test/smoke.sh +++ b/apps/fonoster/test/smoke.sh @@ -1,16 +1,14 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Basic container reachability check executed inside the packaging container. -# Replace curl target with an endpoint exposed by the app once the package is functional. -cloudron_app_url=${CLOUDRON_APP_ORIGIN:-"http://localhost"} +cloudron_app_origin=${CLOUDRON_APP_ORIGIN:-http://localhost} -http_code=$(curl -s -o /tmp/smoke.log -w "%{http_code}" "${cloudron_app_url}") +http_code=$(curl --silent --show-error --output /tmp/smoke.log --write-out "%{http_code}" "${cloudron_app_origin}/") if [[ "${http_code}" != "200" ]]; then - echo "Unexpected HTTP status: ${http_code}" >&2 - cat /tmp/smoke.log >&2 + >&2 echo "Smoke test failed for Fonoster: expected HTTP 200 from ${cloudron_app_origin}/, got ${http_code}" + >&2 cat /tmp/smoke.log exit 1 fi -echo "Smoke test passed" +echo "Smoke test placeholder passed for Fonoster" diff --git a/apps/grist/CloudronManifest.json b/apps/grist/CloudronManifest.json index c3146aa..f00ed3a 100644 --- a/apps/grist/CloudronManifest.json +++ b/apps/grist/CloudronManifest.json @@ -12,9 +12,16 @@ "version": "0.1.0", "tags": ["custom", "known-element"], "healthCheckPath": "/", - "memoryLimit": 536870912, "httpPort": 3000, + "memoryLimit": "512M", "addons": { "localstorage": {} + }, + "optionalAddons": { + "postgresql": {}, + "redis": {}, + "mysql": {}, + "mongodb": {}, + "sendmail": {} } } diff --git a/apps/grist/Dockerfile b/apps/grist/Dockerfile index 2415285..6940265 100644 --- a/apps/grist/Dockerfile +++ b/apps/grist/Dockerfile @@ -1,21 +1,38 @@ -# syntax=docker/dockerfile:1 -FROM cloudron/base:5.0.0 +# syntax=docker/dockerfile:1.6 +ARG APP_VERSION=latest + +FROM cloudron/base:5.0.0 AS builder +WORKDIR /build + +# ----------------------------------------------------------------------------- +# TODO: Fetch and build Grist +# Example: +# RUN git clone --depth 1 --branch "${APP_VERSION}" https://github.com/gristlabs/grist-core source \ +# && cd source \ +# && npm ci \ +# && npm run build +# ----------------------------------------------------------------------------- + +FROM cloudron/base:5.0.0 LABEL org.opencontainers.image.source="https://github.com/gristlabs/grist-core" LABEL org.opencontainers.image.description="Cloudron package for Grist" -ARG APP_VERSION -ENV APP_VERSION=${APP_VERSION:-latest} +ENV APP_VERSION=${APP_VERSION} + +# ----------------------------------------------------------------------------- +# TODO: Copy build artefacts from the builder stage +# COPY --from=builder /build/source/dist /app/code +# ----------------------------------------------------------------------------- -# Copy application source into image at build time -# Replace this with a multi-stage build if upstream provides Docker images. COPY ./app /app/code - -# Copy start script and make it executable COPY ./start.sh /app/pkg/start.sh -RUN chmod +x /app/pkg/start.sh +COPY ./test /app/pkg/test + +RUN chmod +x /app/pkg/start.sh /app/pkg/test/smoke.sh \ + && mkdir -p /app/data \ + && chown -R cloudron:cloudron /app -# Cloudron expects all processes to run as cloudron user USER cloudron WORKDIR /app/code diff --git a/apps/grist/README.md b/apps/grist/README.md index 454612b..38205d6 100644 --- a/apps/grist/README.md +++ b/apps/grist/README.md @@ -2,19 +2,19 @@ - **Upstream repository**: https://github.com/gristlabs/grist-core - **Implementation issue**: https://projects.knownelement.com/issues/191 -- **Status**: Draft scaffolding generated on $(date -u +"%Y-%m-%dT%H:%M:%SZ") +- **Generated**: 2025-10-02T17:19:00Z UTC ## Packaging Checklist -1. Review upstream deployment requirements and map them to Cloudron services (database, cache, object storage, workers). -2. Update `Dockerfile` with the correct build steps and runtime dependencies. -3. Implement `start.sh` to configure the app from Cloudron-provided environment variables and launch the primary process. -4. Edit `CloudronManifest.json` with accurate metadata, permissions, ports, addons, and health checks. -5. Add integration and smoke tests under `test/` to validate the package. -6. Document manual configuration steps, migration requirements, and known gaps in this README. +1. Map upstream services (databases, caches, workers) to Cloudron addons; remove unused entries from `optionalAddons` and enable required ones under `addons`. +2. Implement the multi-stage build in `Dockerfile` to fetch/compile the correct release of Grist. +3. Update `start.sh` to configure the app from Cloudron environment variables and launch the primary process. +4. Replace the placeholder health checks and smoke test with real coverage. +5. Complete `CloudronManifest.json` (tagline, description, versioning, resource limits, ingress, TCP ports, etc.). +6. Document manual configuration steps, migrations, and known gaps below. ## Notes -- Replace the placeholder long-running process in `start.sh`. -- Populate the `app/` directory with the application build artefacts or git submodules. -- Use the shared packaging container (`docker/packager`) to run `cloudron build` and `cloudron install` so the host remains clean. +- Populate the `app/` directory with runtime overlays or artifacts generated during the build stage. +- Use the shared packaging container (`docker/packager`) for `cloudron build/install` to keep the host clean. +- Record decisions and operational requirements under `docs/apps/grist/` as work progresses. diff --git a/apps/grist/metadata.json b/apps/grist/metadata.json index 2b011ad..3113b7a 100644 --- a/apps/grist/metadata.json +++ b/apps/grist/metadata.json @@ -4,6 +4,6 @@ "issue": "https://projects.knownelement.com/issues/191", "repo": "https://github.com/gristlabs/grist-core", "additionalRepos": [], - "created": "2025-10-02T16:46:49Z", + "created": "2025-10-02T17:19:00Z", "notes": "TODO: capture packaging notes" -} \ No newline at end of file +} diff --git a/apps/grist/start.sh b/apps/grist/start.sh index edac226..85ef44a 100755 --- a/apps/grist/start.sh +++ b/apps/grist/start.sh @@ -1,8 +1,9 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Cloudron injects configuration via environment variables and files under /run -# Use this script to render config files and launch the upstream service. +# TODO: render configuration files from CLOUDRON_* environment variables +# Example: +# envsubst < /app/pkg/config.tmpl > /run/config.yaml -# TODO: Replace the command below with the correct process supervisor. -exec /bin/sh -c "echo 'Replace start.sh with application startup logic for Grist' && sleep infinity" +>&2 echo "start.sh for Grist is not implemented yet." +exit 1 diff --git a/apps/grist/test/smoke.sh b/apps/grist/test/smoke.sh index ebd1134..3b13b60 100755 --- a/apps/grist/test/smoke.sh +++ b/apps/grist/test/smoke.sh @@ -1,16 +1,14 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Basic container reachability check executed inside the packaging container. -# Replace curl target with an endpoint exposed by the app once the package is functional. -cloudron_app_url=${CLOUDRON_APP_ORIGIN:-"http://localhost"} +cloudron_app_origin=${CLOUDRON_APP_ORIGIN:-http://localhost} -http_code=$(curl -s -o /tmp/smoke.log -w "%{http_code}" "${cloudron_app_url}") +http_code=$(curl --silent --show-error --output /tmp/smoke.log --write-out "%{http_code}" "${cloudron_app_origin}/") if [[ "${http_code}" != "200" ]]; then - echo "Unexpected HTTP status: ${http_code}" >&2 - cat /tmp/smoke.log >&2 + >&2 echo "Smoke test failed for Grist: expected HTTP 200 from ${cloudron_app_origin}/, got ${http_code}" + >&2 cat /tmp/smoke.log exit 1 fi -echo "Smoke test passed" +echo "Smoke test placeholder passed for Grist" diff --git a/apps/healthchecks/CloudronManifest.json b/apps/healthchecks/CloudronManifest.json index d210294..7ebd640 100644 --- a/apps/healthchecks/CloudronManifest.json +++ b/apps/healthchecks/CloudronManifest.json @@ -12,9 +12,16 @@ "version": "0.1.0", "tags": ["custom", "known-element"], "healthCheckPath": "/", - "memoryLimit": 536870912, "httpPort": 3000, + "memoryLimit": "512M", "addons": { "localstorage": {} + }, + "optionalAddons": { + "postgresql": {}, + "redis": {}, + "mysql": {}, + "mongodb": {}, + "sendmail": {} } } diff --git a/apps/healthchecks/Dockerfile b/apps/healthchecks/Dockerfile index f3a7101..b510434 100644 --- a/apps/healthchecks/Dockerfile +++ b/apps/healthchecks/Dockerfile @@ -1,21 +1,38 @@ -# syntax=docker/dockerfile:1 -FROM cloudron/base:5.0.0 +# syntax=docker/dockerfile:1.6 +ARG APP_VERSION=latest + +FROM cloudron/base:5.0.0 AS builder +WORKDIR /build + +# ----------------------------------------------------------------------------- +# TODO: Fetch and build Healthchecks +# Example: +# RUN git clone --depth 1 --branch "${APP_VERSION}" https://github.com/healthchecks/healthchecks.git source \ +# && cd source \ +# && npm ci \ +# && npm run build +# ----------------------------------------------------------------------------- + +FROM cloudron/base:5.0.0 LABEL org.opencontainers.image.source="https://github.com/healthchecks/healthchecks.git" LABEL org.opencontainers.image.description="Cloudron package for Healthchecks" -ARG APP_VERSION -ENV APP_VERSION=${APP_VERSION:-latest} +ENV APP_VERSION=${APP_VERSION} + +# ----------------------------------------------------------------------------- +# TODO: Copy build artefacts from the builder stage +# COPY --from=builder /build/source/dist /app/code +# ----------------------------------------------------------------------------- -# Copy application source into image at build time -# Replace this with a multi-stage build if upstream provides Docker images. COPY ./app /app/code - -# Copy start script and make it executable COPY ./start.sh /app/pkg/start.sh -RUN chmod +x /app/pkg/start.sh +COPY ./test /app/pkg/test + +RUN chmod +x /app/pkg/start.sh /app/pkg/test/smoke.sh \ + && mkdir -p /app/data \ + && chown -R cloudron:cloudron /app -# Cloudron expects all processes to run as cloudron user USER cloudron WORKDIR /app/code diff --git a/apps/healthchecks/README.md b/apps/healthchecks/README.md index 38ec902..f9ae5d4 100644 --- a/apps/healthchecks/README.md +++ b/apps/healthchecks/README.md @@ -2,19 +2,19 @@ - **Upstream repository**: https://github.com/healthchecks/healthchecks.git - **Implementation issue**: https://projects.knownelement.com/issues/192 -- **Status**: Draft scaffolding generated on $(date -u +"%Y-%m-%dT%H:%M:%SZ") +- **Generated**: 2025-10-02T17:19:00Z UTC ## Packaging Checklist -1. Review upstream deployment requirements and map them to Cloudron services (database, cache, object storage, workers). -2. Update `Dockerfile` with the correct build steps and runtime dependencies. -3. Implement `start.sh` to configure the app from Cloudron-provided environment variables and launch the primary process. -4. Edit `CloudronManifest.json` with accurate metadata, permissions, ports, addons, and health checks. -5. Add integration and smoke tests under `test/` to validate the package. -6. Document manual configuration steps, migration requirements, and known gaps in this README. +1. Map upstream services (databases, caches, workers) to Cloudron addons; remove unused entries from `optionalAddons` and enable required ones under `addons`. +2. Implement the multi-stage build in `Dockerfile` to fetch/compile the correct release of Healthchecks. +3. Update `start.sh` to configure the app from Cloudron environment variables and launch the primary process. +4. Replace the placeholder health checks and smoke test with real coverage. +5. Complete `CloudronManifest.json` (tagline, description, versioning, resource limits, ingress, TCP ports, etc.). +6. Document manual configuration steps, migrations, and known gaps below. ## Notes -- Replace the placeholder long-running process in `start.sh`. -- Populate the `app/` directory with the application build artefacts or git submodules. -- Use the shared packaging container (`docker/packager`) to run `cloudron build` and `cloudron install` so the host remains clean. +- Populate the `app/` directory with runtime overlays or artifacts generated during the build stage. +- Use the shared packaging container (`docker/packager`) for `cloudron build/install` to keep the host clean. +- Record decisions and operational requirements under `docs/apps/healthchecks/` as work progresses. diff --git a/apps/healthchecks/metadata.json b/apps/healthchecks/metadata.json index 96a2735..907c51a 100644 --- a/apps/healthchecks/metadata.json +++ b/apps/healthchecks/metadata.json @@ -4,6 +4,6 @@ "issue": "https://projects.knownelement.com/issues/192", "repo": "https://github.com/healthchecks/healthchecks.git", "additionalRepos": [], - "created": "2025-10-02T16:46:49Z", + "created": "2025-10-02T17:19:00Z", "notes": "TODO: capture packaging notes" -} \ No newline at end of file +} diff --git a/apps/healthchecks/start.sh b/apps/healthchecks/start.sh index cd644c2..95df96c 100755 --- a/apps/healthchecks/start.sh +++ b/apps/healthchecks/start.sh @@ -1,8 +1,9 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Cloudron injects configuration via environment variables and files under /run -# Use this script to render config files and launch the upstream service. +# TODO: render configuration files from CLOUDRON_* environment variables +# Example: +# envsubst < /app/pkg/config.tmpl > /run/config.yaml -# TODO: Replace the command below with the correct process supervisor. -exec /bin/sh -c "echo 'Replace start.sh with application startup logic for Healthchecks' && sleep infinity" +>&2 echo "start.sh for Healthchecks is not implemented yet." +exit 1 diff --git a/apps/healthchecks/test/smoke.sh b/apps/healthchecks/test/smoke.sh index ebd1134..040e239 100755 --- a/apps/healthchecks/test/smoke.sh +++ b/apps/healthchecks/test/smoke.sh @@ -1,16 +1,14 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Basic container reachability check executed inside the packaging container. -# Replace curl target with an endpoint exposed by the app once the package is functional. -cloudron_app_url=${CLOUDRON_APP_ORIGIN:-"http://localhost"} +cloudron_app_origin=${CLOUDRON_APP_ORIGIN:-http://localhost} -http_code=$(curl -s -o /tmp/smoke.log -w "%{http_code}" "${cloudron_app_url}") +http_code=$(curl --silent --show-error --output /tmp/smoke.log --write-out "%{http_code}" "${cloudron_app_origin}/") if [[ "${http_code}" != "200" ]]; then - echo "Unexpected HTTP status: ${http_code}" >&2 - cat /tmp/smoke.log >&2 + >&2 echo "Smoke test failed for Healthchecks: expected HTTP 200 from ${cloudron_app_origin}/, got ${http_code}" + >&2 cat /tmp/smoke.log exit 1 fi -echo "Smoke test passed" +echo "Smoke test placeholder passed for Healthchecks" diff --git a/apps/huginn/CloudronManifest.json b/apps/huginn/CloudronManifest.json index 4e787a1..54c4e0d 100644 --- a/apps/huginn/CloudronManifest.json +++ b/apps/huginn/CloudronManifest.json @@ -12,9 +12,16 @@ "version": "0.1.0", "tags": ["custom", "known-element"], "healthCheckPath": "/", - "memoryLimit": 536870912, "httpPort": 3000, + "memoryLimit": "512M", "addons": { "localstorage": {} + }, + "optionalAddons": { + "postgresql": {}, + "redis": {}, + "mysql": {}, + "mongodb": {}, + "sendmail": {} } } diff --git a/apps/huginn/Dockerfile b/apps/huginn/Dockerfile index a25a23a..bfa60a4 100644 --- a/apps/huginn/Dockerfile +++ b/apps/huginn/Dockerfile @@ -1,21 +1,38 @@ -# syntax=docker/dockerfile:1 -FROM cloudron/base:5.0.0 +# syntax=docker/dockerfile:1.6 +ARG APP_VERSION=latest + +FROM cloudron/base:5.0.0 AS builder +WORKDIR /build + +# ----------------------------------------------------------------------------- +# TODO: Fetch and build Huginn +# Example: +# RUN git clone --depth 1 --branch "${APP_VERSION}" https://github.com/huginn/huginn.git source \ +# && cd source \ +# && npm ci \ +# && npm run build +# ----------------------------------------------------------------------------- + +FROM cloudron/base:5.0.0 LABEL org.opencontainers.image.source="https://github.com/huginn/huginn.git" LABEL org.opencontainers.image.description="Cloudron package for Huginn" -ARG APP_VERSION -ENV APP_VERSION=${APP_VERSION:-latest} +ENV APP_VERSION=${APP_VERSION} + +# ----------------------------------------------------------------------------- +# TODO: Copy build artefacts from the builder stage +# COPY --from=builder /build/source/dist /app/code +# ----------------------------------------------------------------------------- -# Copy application source into image at build time -# Replace this with a multi-stage build if upstream provides Docker images. COPY ./app /app/code - -# Copy start script and make it executable COPY ./start.sh /app/pkg/start.sh -RUN chmod +x /app/pkg/start.sh +COPY ./test /app/pkg/test + +RUN chmod +x /app/pkg/start.sh /app/pkg/test/smoke.sh \ + && mkdir -p /app/data \ + && chown -R cloudron:cloudron /app -# Cloudron expects all processes to run as cloudron user USER cloudron WORKDIR /app/code diff --git a/apps/huginn/README.md b/apps/huginn/README.md index 1ce6a36..359c77a 100644 --- a/apps/huginn/README.md +++ b/apps/huginn/README.md @@ -2,19 +2,19 @@ - **Upstream repository**: https://github.com/huginn/huginn.git - **Implementation issue**: https://projects.knownelement.com/issues/194 -- **Status**: Draft scaffolding generated on $(date -u +"%Y-%m-%dT%H:%M:%SZ") +- **Generated**: 2025-10-02T17:19:00Z UTC ## Packaging Checklist -1. Review upstream deployment requirements and map them to Cloudron services (database, cache, object storage, workers). -2. Update `Dockerfile` with the correct build steps and runtime dependencies. -3. Implement `start.sh` to configure the app from Cloudron-provided environment variables and launch the primary process. -4. Edit `CloudronManifest.json` with accurate metadata, permissions, ports, addons, and health checks. -5. Add integration and smoke tests under `test/` to validate the package. -6. Document manual configuration steps, migration requirements, and known gaps in this README. +1. Map upstream services (databases, caches, workers) to Cloudron addons; remove unused entries from `optionalAddons` and enable required ones under `addons`. +2. Implement the multi-stage build in `Dockerfile` to fetch/compile the correct release of Huginn. +3. Update `start.sh` to configure the app from Cloudron environment variables and launch the primary process. +4. Replace the placeholder health checks and smoke test with real coverage. +5. Complete `CloudronManifest.json` (tagline, description, versioning, resource limits, ingress, TCP ports, etc.). +6. Document manual configuration steps, migrations, and known gaps below. ## Notes -- Replace the placeholder long-running process in `start.sh`. -- Populate the `app/` directory with the application build artefacts or git submodules. -- Use the shared packaging container (`docker/packager`) to run `cloudron build` and `cloudron install` so the host remains clean. +- Populate the `app/` directory with runtime overlays or artifacts generated during the build stage. +- Use the shared packaging container (`docker/packager`) for `cloudron build/install` to keep the host clean. +- Record decisions and operational requirements under `docs/apps/huginn/` as work progresses. diff --git a/apps/huginn/metadata.json b/apps/huginn/metadata.json index 3b77f2b..afd2bdc 100644 --- a/apps/huginn/metadata.json +++ b/apps/huginn/metadata.json @@ -4,6 +4,6 @@ "issue": "https://projects.knownelement.com/issues/194", "repo": "https://github.com/huginn/huginn.git", "additionalRepos": [], - "created": "2025-10-02T16:46:49Z", + "created": "2025-10-02T17:19:00Z", "notes": "TODO: capture packaging notes" -} \ No newline at end of file +} diff --git a/apps/huginn/start.sh b/apps/huginn/start.sh index a4bcefe..8110344 100755 --- a/apps/huginn/start.sh +++ b/apps/huginn/start.sh @@ -1,8 +1,9 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Cloudron injects configuration via environment variables and files under /run -# Use this script to render config files and launch the upstream service. +# TODO: render configuration files from CLOUDRON_* environment variables +# Example: +# envsubst < /app/pkg/config.tmpl > /run/config.yaml -# TODO: Replace the command below with the correct process supervisor. -exec /bin/sh -c "echo 'Replace start.sh with application startup logic for Huginn' && sleep infinity" +>&2 echo "start.sh for Huginn is not implemented yet." +exit 1 diff --git a/apps/huginn/test/smoke.sh b/apps/huginn/test/smoke.sh index ebd1134..a605e05 100755 --- a/apps/huginn/test/smoke.sh +++ b/apps/huginn/test/smoke.sh @@ -1,16 +1,14 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Basic container reachability check executed inside the packaging container. -# Replace curl target with an endpoint exposed by the app once the package is functional. -cloudron_app_url=${CLOUDRON_APP_ORIGIN:-"http://localhost"} +cloudron_app_origin=${CLOUDRON_APP_ORIGIN:-http://localhost} -http_code=$(curl -s -o /tmp/smoke.log -w "%{http_code}" "${cloudron_app_url}") +http_code=$(curl --silent --show-error --output /tmp/smoke.log --write-out "%{http_code}" "${cloudron_app_origin}/") if [[ "${http_code}" != "200" ]]; then - echo "Unexpected HTTP status: ${http_code}" >&2 - cat /tmp/smoke.log >&2 + >&2 echo "Smoke test failed for Huginn: expected HTTP 200 from ${cloudron_app_origin}/, got ${http_code}" + >&2 cat /tmp/smoke.log exit 1 fi -echo "Smoke test passed" +echo "Smoke test placeholder passed for Huginn" diff --git a/apps/hyperswitch/CloudronManifest.json b/apps/hyperswitch/CloudronManifest.json index 7ee83bc..a74e092 100644 --- a/apps/hyperswitch/CloudronManifest.json +++ b/apps/hyperswitch/CloudronManifest.json @@ -12,9 +12,16 @@ "version": "0.1.0", "tags": ["custom", "known-element"], "healthCheckPath": "/", - "memoryLimit": 536870912, "httpPort": 3000, + "memoryLimit": "512M", "addons": { "localstorage": {} + }, + "optionalAddons": { + "postgresql": {}, + "redis": {}, + "mysql": {}, + "mongodb": {}, + "sendmail": {} } } diff --git a/apps/hyperswitch/Dockerfile b/apps/hyperswitch/Dockerfile index 4781e5a..e999d60 100644 --- a/apps/hyperswitch/Dockerfile +++ b/apps/hyperswitch/Dockerfile @@ -1,21 +1,38 @@ -# syntax=docker/dockerfile:1 -FROM cloudron/base:5.0.0 +# syntax=docker/dockerfile:1.6 +ARG APP_VERSION=latest + +FROM cloudron/base:5.0.0 AS builder +WORKDIR /build + +# ----------------------------------------------------------------------------- +# TODO: Fetch and build HyperSwitch +# Example: +# RUN git clone --depth 1 --branch "${APP_VERSION}" https://github.com/juspay/hyperswitch source \ +# && cd source \ +# && npm ci \ +# && npm run build +# ----------------------------------------------------------------------------- + +FROM cloudron/base:5.0.0 LABEL org.opencontainers.image.source="https://github.com/juspay/hyperswitch" LABEL org.opencontainers.image.description="Cloudron package for HyperSwitch" -ARG APP_VERSION -ENV APP_VERSION=${APP_VERSION:-latest} +ENV APP_VERSION=${APP_VERSION} + +# ----------------------------------------------------------------------------- +# TODO: Copy build artefacts from the builder stage +# COPY --from=builder /build/source/dist /app/code +# ----------------------------------------------------------------------------- -# Copy application source into image at build time -# Replace this with a multi-stage build if upstream provides Docker images. COPY ./app /app/code - -# Copy start script and make it executable COPY ./start.sh /app/pkg/start.sh -RUN chmod +x /app/pkg/start.sh +COPY ./test /app/pkg/test + +RUN chmod +x /app/pkg/start.sh /app/pkg/test/smoke.sh \ + && mkdir -p /app/data \ + && chown -R cloudron:cloudron /app -# Cloudron expects all processes to run as cloudron user USER cloudron WORKDIR /app/code diff --git a/apps/hyperswitch/README.md b/apps/hyperswitch/README.md index 322f328..fae88d6 100644 --- a/apps/hyperswitch/README.md +++ b/apps/hyperswitch/README.md @@ -2,19 +2,19 @@ - **Upstream repository**: https://github.com/juspay/hyperswitch - **Implementation issue**: https://projects.knownelement.com/issues/209 -- **Status**: Draft scaffolding generated on $(date -u +"%Y-%m-%dT%H:%M:%SZ") +- **Generated**: 2025-10-02T17:19:00Z UTC ## Packaging Checklist -1. Review upstream deployment requirements and map them to Cloudron services (database, cache, object storage, workers). -2. Update `Dockerfile` with the correct build steps and runtime dependencies. -3. Implement `start.sh` to configure the app from Cloudron-provided environment variables and launch the primary process. -4. Edit `CloudronManifest.json` with accurate metadata, permissions, ports, addons, and health checks. -5. Add integration and smoke tests under `test/` to validate the package. -6. Document manual configuration steps, migration requirements, and known gaps in this README. +1. Map upstream services (databases, caches, workers) to Cloudron addons; remove unused entries from `optionalAddons` and enable required ones under `addons`. +2. Implement the multi-stage build in `Dockerfile` to fetch/compile the correct release of HyperSwitch. +3. Update `start.sh` to configure the app from Cloudron environment variables and launch the primary process. +4. Replace the placeholder health checks and smoke test with real coverage. +5. Complete `CloudronManifest.json` (tagline, description, versioning, resource limits, ingress, TCP ports, etc.). +6. Document manual configuration steps, migrations, and known gaps below. ## Notes -- Replace the placeholder long-running process in `start.sh`. -- Populate the `app/` directory with the application build artefacts or git submodules. -- Use the shared packaging container (`docker/packager`) to run `cloudron build` and `cloudron install` so the host remains clean. +- Populate the `app/` directory with runtime overlays or artifacts generated during the build stage. +- Use the shared packaging container (`docker/packager`) for `cloudron build/install` to keep the host clean. +- Record decisions and operational requirements under `docs/apps/hyperswitch/` as work progresses. diff --git a/apps/hyperswitch/metadata.json b/apps/hyperswitch/metadata.json index 45b52fc..6f39726 100644 --- a/apps/hyperswitch/metadata.json +++ b/apps/hyperswitch/metadata.json @@ -4,6 +4,6 @@ "issue": "https://projects.knownelement.com/issues/209", "repo": "https://github.com/juspay/hyperswitch", "additionalRepos": [], - "created": "2025-10-02T16:46:49Z", + "created": "2025-10-02T17:19:00Z", "notes": "TODO: capture packaging notes" -} \ No newline at end of file +} diff --git a/apps/hyperswitch/start.sh b/apps/hyperswitch/start.sh index a29a1c2..4f24822 100755 --- a/apps/hyperswitch/start.sh +++ b/apps/hyperswitch/start.sh @@ -1,8 +1,9 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Cloudron injects configuration via environment variables and files under /run -# Use this script to render config files and launch the upstream service. +# TODO: render configuration files from CLOUDRON_* environment variables +# Example: +# envsubst < /app/pkg/config.tmpl > /run/config.yaml -# TODO: Replace the command below with the correct process supervisor. -exec /bin/sh -c "echo 'Replace start.sh with application startup logic for HyperSwitch' && sleep infinity" +>&2 echo "start.sh for HyperSwitch is not implemented yet." +exit 1 diff --git a/apps/hyperswitch/test/smoke.sh b/apps/hyperswitch/test/smoke.sh index ebd1134..73cd64e 100755 --- a/apps/hyperswitch/test/smoke.sh +++ b/apps/hyperswitch/test/smoke.sh @@ -1,16 +1,14 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Basic container reachability check executed inside the packaging container. -# Replace curl target with an endpoint exposed by the app once the package is functional. -cloudron_app_url=${CLOUDRON_APP_ORIGIN:-"http://localhost"} +cloudron_app_origin=${CLOUDRON_APP_ORIGIN:-http://localhost} -http_code=$(curl -s -o /tmp/smoke.log -w "%{http_code}" "${cloudron_app_url}") +http_code=$(curl --silent --show-error --output /tmp/smoke.log --write-out "%{http_code}" "${cloudron_app_origin}/") if [[ "${http_code}" != "200" ]]; then - echo "Unexpected HTTP status: ${http_code}" >&2 - cat /tmp/smoke.log >&2 + >&2 echo "Smoke test failed for HyperSwitch: expected HTTP 200 from ${cloudron_app_origin}/, got ${http_code}" + >&2 cat /tmp/smoke.log exit 1 fi -echo "Smoke test passed" +echo "Smoke test placeholder passed for HyperSwitch" diff --git a/apps/inventree/CloudronManifest.json b/apps/inventree/CloudronManifest.json index 4ffcd02..4cf808e 100644 --- a/apps/inventree/CloudronManifest.json +++ b/apps/inventree/CloudronManifest.json @@ -12,9 +12,16 @@ "version": "0.1.0", "tags": ["custom", "known-element"], "healthCheckPath": "/", - "memoryLimit": 536870912, "httpPort": 3000, + "memoryLimit": "512M", "addons": { "localstorage": {} + }, + "optionalAddons": { + "postgresql": {}, + "redis": {}, + "mysql": {}, + "mongodb": {}, + "sendmail": {} } } diff --git a/apps/inventree/Dockerfile b/apps/inventree/Dockerfile index e6d4f0f..a25f3b7 100644 --- a/apps/inventree/Dockerfile +++ b/apps/inventree/Dockerfile @@ -1,21 +1,38 @@ -# syntax=docker/dockerfile:1 -FROM cloudron/base:5.0.0 +# syntax=docker/dockerfile:1.6 +ARG APP_VERSION=latest + +FROM cloudron/base:5.0.0 AS builder +WORKDIR /build + +# ----------------------------------------------------------------------------- +# TODO: Fetch and build InvenTree +# Example: +# RUN git clone --depth 1 --branch "${APP_VERSION}" https://github.com/inventree/InvenTree.git source \ +# && cd source \ +# && npm ci \ +# && npm run build +# ----------------------------------------------------------------------------- + +FROM cloudron/base:5.0.0 LABEL org.opencontainers.image.source="https://github.com/inventree/InvenTree.git" LABEL org.opencontainers.image.description="Cloudron package for InvenTree" -ARG APP_VERSION -ENV APP_VERSION=${APP_VERSION:-latest} +ENV APP_VERSION=${APP_VERSION} + +# ----------------------------------------------------------------------------- +# TODO: Copy build artefacts from the builder stage +# COPY --from=builder /build/source/dist /app/code +# ----------------------------------------------------------------------------- -# Copy application source into image at build time -# Replace this with a multi-stage build if upstream provides Docker images. COPY ./app /app/code - -# Copy start script and make it executable COPY ./start.sh /app/pkg/start.sh -RUN chmod +x /app/pkg/start.sh +COPY ./test /app/pkg/test + +RUN chmod +x /app/pkg/start.sh /app/pkg/test/smoke.sh \ + && mkdir -p /app/data \ + && chown -R cloudron:cloudron /app -# Cloudron expects all processes to run as cloudron user USER cloudron WORKDIR /app/code diff --git a/apps/inventree/README.md b/apps/inventree/README.md index d1a4af9..334c021 100644 --- a/apps/inventree/README.md +++ b/apps/inventree/README.md @@ -2,19 +2,19 @@ - **Upstream repository**: https://github.com/inventree/InvenTree.git - **Implementation issue**: https://projects.knownelement.com/issues/173 -- **Status**: Draft scaffolding generated on $(date -u +"%Y-%m-%dT%H:%M:%SZ") +- **Generated**: 2025-10-02T17:19:00Z UTC ## Packaging Checklist -1. Review upstream deployment requirements and map them to Cloudron services (database, cache, object storage, workers). -2. Update `Dockerfile` with the correct build steps and runtime dependencies. -3. Implement `start.sh` to configure the app from Cloudron-provided environment variables and launch the primary process. -4. Edit `CloudronManifest.json` with accurate metadata, permissions, ports, addons, and health checks. -5. Add integration and smoke tests under `test/` to validate the package. -6. Document manual configuration steps, migration requirements, and known gaps in this README. +1. Map upstream services (databases, caches, workers) to Cloudron addons; remove unused entries from `optionalAddons` and enable required ones under `addons`. +2. Implement the multi-stage build in `Dockerfile` to fetch/compile the correct release of InvenTree. +3. Update `start.sh` to configure the app from Cloudron environment variables and launch the primary process. +4. Replace the placeholder health checks and smoke test with real coverage. +5. Complete `CloudronManifest.json` (tagline, description, versioning, resource limits, ingress, TCP ports, etc.). +6. Document manual configuration steps, migrations, and known gaps below. ## Notes -- Replace the placeholder long-running process in `start.sh`. -- Populate the `app/` directory with the application build artefacts or git submodules. -- Use the shared packaging container (`docker/packager`) to run `cloudron build` and `cloudron install` so the host remains clean. +- Populate the `app/` directory with runtime overlays or artifacts generated during the build stage. +- Use the shared packaging container (`docker/packager`) for `cloudron build/install` to keep the host clean. +- Record decisions and operational requirements under `docs/apps/inventree/` as work progresses. diff --git a/apps/inventree/metadata.json b/apps/inventree/metadata.json index 04d09aa..7cd759b 100644 --- a/apps/inventree/metadata.json +++ b/apps/inventree/metadata.json @@ -4,6 +4,6 @@ "issue": "https://projects.knownelement.com/issues/173", "repo": "https://github.com/inventree/InvenTree.git", "additionalRepos": [], - "created": "2025-10-02T16:46:49Z", + "created": "2025-10-02T17:19:00Z", "notes": "TODO: capture packaging notes" -} \ No newline at end of file +} diff --git a/apps/inventree/start.sh b/apps/inventree/start.sh index 9d56749..cee49e6 100755 --- a/apps/inventree/start.sh +++ b/apps/inventree/start.sh @@ -1,8 +1,9 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Cloudron injects configuration via environment variables and files under /run -# Use this script to render config files and launch the upstream service. +# TODO: render configuration files from CLOUDRON_* environment variables +# Example: +# envsubst < /app/pkg/config.tmpl > /run/config.yaml -# TODO: Replace the command below with the correct process supervisor. -exec /bin/sh -c "echo 'Replace start.sh with application startup logic for InvenTree' && sleep infinity" +>&2 echo "start.sh for InvenTree is not implemented yet." +exit 1 diff --git a/apps/inventree/test/smoke.sh b/apps/inventree/test/smoke.sh index ebd1134..acaf782 100755 --- a/apps/inventree/test/smoke.sh +++ b/apps/inventree/test/smoke.sh @@ -1,16 +1,14 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Basic container reachability check executed inside the packaging container. -# Replace curl target with an endpoint exposed by the app once the package is functional. -cloudron_app_url=${CLOUDRON_APP_ORIGIN:-"http://localhost"} +cloudron_app_origin=${CLOUDRON_APP_ORIGIN:-http://localhost} -http_code=$(curl -s -o /tmp/smoke.log -w "%{http_code}" "${cloudron_app_url}") +http_code=$(curl --silent --show-error --output /tmp/smoke.log --write-out "%{http_code}" "${cloudron_app_origin}/") if [[ "${http_code}" != "200" ]]; then - echo "Unexpected HTTP status: ${http_code}" >&2 - cat /tmp/smoke.log >&2 + >&2 echo "Smoke test failed for InvenTree: expected HTTP 200 from ${cloudron_app_origin}/, got ${http_code}" + >&2 cat /tmp/smoke.log exit 1 fi -echo "Smoke test passed" +echo "Smoke test placeholder passed for InvenTree" diff --git a/apps/jamovi/CloudronManifest.json b/apps/jamovi/CloudronManifest.json index d3f804f..e8b2a94 100644 --- a/apps/jamovi/CloudronManifest.json +++ b/apps/jamovi/CloudronManifest.json @@ -12,9 +12,16 @@ "version": "0.1.0", "tags": ["custom", "known-element"], "healthCheckPath": "/", - "memoryLimit": 536870912, "httpPort": 3000, + "memoryLimit": "512M", "addons": { "localstorage": {} + }, + "optionalAddons": { + "postgresql": {}, + "redis": {}, + "mysql": {}, + "mongodb": {}, + "sendmail": {} } } diff --git a/apps/jamovi/Dockerfile b/apps/jamovi/Dockerfile index 25d4262..1273c7c 100644 --- a/apps/jamovi/Dockerfile +++ b/apps/jamovi/Dockerfile @@ -1,21 +1,38 @@ -# syntax=docker/dockerfile:1 -FROM cloudron/base:5.0.0 +# syntax=docker/dockerfile:1.6 +ARG APP_VERSION=latest + +FROM cloudron/base:5.0.0 AS builder +WORKDIR /build + +# ----------------------------------------------------------------------------- +# TODO: Fetch and build jamovi +# Example: +# RUN git clone --depth 1 --branch "${APP_VERSION}" https://github.com/jamovi/jamovi.git source \ +# && cd source \ +# && npm ci \ +# && npm run build +# ----------------------------------------------------------------------------- + +FROM cloudron/base:5.0.0 LABEL org.opencontainers.image.source="https://github.com/jamovi/jamovi.git" LABEL org.opencontainers.image.description="Cloudron package for jamovi" -ARG APP_VERSION -ENV APP_VERSION=${APP_VERSION:-latest} +ENV APP_VERSION=${APP_VERSION} + +# ----------------------------------------------------------------------------- +# TODO: Copy build artefacts from the builder stage +# COPY --from=builder /build/source/dist /app/code +# ----------------------------------------------------------------------------- -# Copy application source into image at build time -# Replace this with a multi-stage build if upstream provides Docker images. COPY ./app /app/code - -# Copy start script and make it executable COPY ./start.sh /app/pkg/start.sh -RUN chmod +x /app/pkg/start.sh +COPY ./test /app/pkg/test + +RUN chmod +x /app/pkg/start.sh /app/pkg/test/smoke.sh \ + && mkdir -p /app/data \ + && chown -R cloudron:cloudron /app -# Cloudron expects all processes to run as cloudron user USER cloudron WORKDIR /app/code diff --git a/apps/jamovi/README.md b/apps/jamovi/README.md index 57df295..6ef66ea 100644 --- a/apps/jamovi/README.md +++ b/apps/jamovi/README.md @@ -2,19 +2,19 @@ - **Upstream repository**: https://github.com/jamovi/jamovi.git - **Implementation issue**: https://projects.knownelement.com/issues/196 -- **Status**: Draft scaffolding generated on $(date -u +"%Y-%m-%dT%H:%M:%SZ") +- **Generated**: 2025-10-02T17:19:00Z UTC ## Packaging Checklist -1. Review upstream deployment requirements and map them to Cloudron services (database, cache, object storage, workers). -2. Update `Dockerfile` with the correct build steps and runtime dependencies. -3. Implement `start.sh` to configure the app from Cloudron-provided environment variables and launch the primary process. -4. Edit `CloudronManifest.json` with accurate metadata, permissions, ports, addons, and health checks. -5. Add integration and smoke tests under `test/` to validate the package. -6. Document manual configuration steps, migration requirements, and known gaps in this README. +1. Map upstream services (databases, caches, workers) to Cloudron addons; remove unused entries from `optionalAddons` and enable required ones under `addons`. +2. Implement the multi-stage build in `Dockerfile` to fetch/compile the correct release of jamovi. +3. Update `start.sh` to configure the app from Cloudron environment variables and launch the primary process. +4. Replace the placeholder health checks and smoke test with real coverage. +5. Complete `CloudronManifest.json` (tagline, description, versioning, resource limits, ingress, TCP ports, etc.). +6. Document manual configuration steps, migrations, and known gaps below. ## Notes -- Replace the placeholder long-running process in `start.sh`. -- Populate the `app/` directory with the application build artefacts or git submodules. -- Use the shared packaging container (`docker/packager`) to run `cloudron build` and `cloudron install` so the host remains clean. +- Populate the `app/` directory with runtime overlays or artifacts generated during the build stage. +- Use the shared packaging container (`docker/packager`) for `cloudron build/install` to keep the host clean. +- Record decisions and operational requirements under `docs/apps/jamovi/` as work progresses. diff --git a/apps/jamovi/metadata.json b/apps/jamovi/metadata.json index d884446..fa9b1f3 100644 --- a/apps/jamovi/metadata.json +++ b/apps/jamovi/metadata.json @@ -4,6 +4,6 @@ "issue": "https://projects.knownelement.com/issues/196", "repo": "https://github.com/jamovi/jamovi.git", "additionalRepos": [], - "created": "2025-10-02T16:46:49Z", + "created": "2025-10-02T17:19:00Z", "notes": "TODO: capture packaging notes" -} \ No newline at end of file +} diff --git a/apps/jamovi/start.sh b/apps/jamovi/start.sh index 19105c0..a504297 100755 --- a/apps/jamovi/start.sh +++ b/apps/jamovi/start.sh @@ -1,8 +1,9 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Cloudron injects configuration via environment variables and files under /run -# Use this script to render config files and launch the upstream service. +# TODO: render configuration files from CLOUDRON_* environment variables +# Example: +# envsubst < /app/pkg/config.tmpl > /run/config.yaml -# TODO: Replace the command below with the correct process supervisor. -exec /bin/sh -c "echo 'Replace start.sh with application startup logic for jamovi' && sleep infinity" +>&2 echo "start.sh for jamovi is not implemented yet." +exit 1 diff --git a/apps/jamovi/test/smoke.sh b/apps/jamovi/test/smoke.sh index ebd1134..256742d 100755 --- a/apps/jamovi/test/smoke.sh +++ b/apps/jamovi/test/smoke.sh @@ -1,16 +1,14 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Basic container reachability check executed inside the packaging container. -# Replace curl target with an endpoint exposed by the app once the package is functional. -cloudron_app_url=${CLOUDRON_APP_ORIGIN:-"http://localhost"} +cloudron_app_origin=${CLOUDRON_APP_ORIGIN:-http://localhost} -http_code=$(curl -s -o /tmp/smoke.log -w "%{http_code}" "${cloudron_app_url}") +http_code=$(curl --silent --show-error --output /tmp/smoke.log --write-out "%{http_code}" "${cloudron_app_origin}/") if [[ "${http_code}" != "200" ]]; then - echo "Unexpected HTTP status: ${http_code}" >&2 - cat /tmp/smoke.log >&2 + >&2 echo "Smoke test failed for jamovi: expected HTTP 200 from ${cloudron_app_origin}/, got ${http_code}" + >&2 cat /tmp/smoke.log exit 1 fi -echo "Smoke test passed" +echo "Smoke test placeholder passed for jamovi" diff --git a/apps/jenkins/CloudronManifest.json b/apps/jenkins/CloudronManifest.json index e8f1220..b95c138 100644 --- a/apps/jenkins/CloudronManifest.json +++ b/apps/jenkins/CloudronManifest.json @@ -12,9 +12,16 @@ "version": "0.1.0", "tags": ["custom", "known-element"], "healthCheckPath": "/", - "memoryLimit": 536870912, "httpPort": 3000, + "memoryLimit": "512M", "addons": { "localstorage": {} + }, + "optionalAddons": { + "postgresql": {}, + "redis": {}, + "mysql": {}, + "mongodb": {}, + "sendmail": {} } } diff --git a/apps/jenkins/Dockerfile b/apps/jenkins/Dockerfile index 1e3f3eb..af3a7fd 100644 --- a/apps/jenkins/Dockerfile +++ b/apps/jenkins/Dockerfile @@ -1,21 +1,38 @@ -# syntax=docker/dockerfile:1 -FROM cloudron/base:5.0.0 +# syntax=docker/dockerfile:1.6 +ARG APP_VERSION=latest + +FROM cloudron/base:5.0.0 AS builder +WORKDIR /build + +# ----------------------------------------------------------------------------- +# TODO: Fetch and build Jenkins +# Example: +# RUN git clone --depth 1 --branch "${APP_VERSION}" https://github.com/jenkinsci/jenkins.git source \ +# && cd source \ +# && npm ci \ +# && npm run build +# ----------------------------------------------------------------------------- + +FROM cloudron/base:5.0.0 LABEL org.opencontainers.image.source="https://github.com/jenkinsci/jenkins.git" LABEL org.opencontainers.image.description="Cloudron package for Jenkins" -ARG APP_VERSION -ENV APP_VERSION=${APP_VERSION:-latest} +ENV APP_VERSION=${APP_VERSION} + +# ----------------------------------------------------------------------------- +# TODO: Copy build artefacts from the builder stage +# COPY --from=builder /build/source/dist /app/code +# ----------------------------------------------------------------------------- -# Copy application source into image at build time -# Replace this with a multi-stage build if upstream provides Docker images. COPY ./app /app/code - -# Copy start script and make it executable COPY ./start.sh /app/pkg/start.sh -RUN chmod +x /app/pkg/start.sh +COPY ./test /app/pkg/test + +RUN chmod +x /app/pkg/start.sh /app/pkg/test/smoke.sh \ + && mkdir -p /app/data \ + && chown -R cloudron:cloudron /app -# Cloudron expects all processes to run as cloudron user USER cloudron WORKDIR /app/code diff --git a/apps/jenkins/README.md b/apps/jenkins/README.md index 0f32be0..71f123e 100644 --- a/apps/jenkins/README.md +++ b/apps/jenkins/README.md @@ -2,19 +2,19 @@ - **Upstream repository**: https://github.com/jenkinsci/jenkins.git - **Implementation issue**: https://projects.knownelement.com/issues/234 -- **Status**: Draft scaffolding generated on $(date -u +"%Y-%m-%dT%H:%M:%SZ") +- **Generated**: 2025-10-02T17:19:00Z UTC ## Packaging Checklist -1. Review upstream deployment requirements and map them to Cloudron services (database, cache, object storage, workers). -2. Update `Dockerfile` with the correct build steps and runtime dependencies. -3. Implement `start.sh` to configure the app from Cloudron-provided environment variables and launch the primary process. -4. Edit `CloudronManifest.json` with accurate metadata, permissions, ports, addons, and health checks. -5. Add integration and smoke tests under `test/` to validate the package. -6. Document manual configuration steps, migration requirements, and known gaps in this README. +1. Map upstream services (databases, caches, workers) to Cloudron addons; remove unused entries from `optionalAddons` and enable required ones under `addons`. +2. Implement the multi-stage build in `Dockerfile` to fetch/compile the correct release of Jenkins. +3. Update `start.sh` to configure the app from Cloudron environment variables and launch the primary process. +4. Replace the placeholder health checks and smoke test with real coverage. +5. Complete `CloudronManifest.json` (tagline, description, versioning, resource limits, ingress, TCP ports, etc.). +6. Document manual configuration steps, migrations, and known gaps below. ## Notes -- Replace the placeholder long-running process in `start.sh`. -- Populate the `app/` directory with the application build artefacts or git submodules. -- Use the shared packaging container (`docker/packager`) to run `cloudron build` and `cloudron install` so the host remains clean. +- Populate the `app/` directory with runtime overlays or artifacts generated during the build stage. +- Use the shared packaging container (`docker/packager`) for `cloudron build/install` to keep the host clean. +- Record decisions and operational requirements under `docs/apps/jenkins/` as work progresses. diff --git a/apps/jenkins/metadata.json b/apps/jenkins/metadata.json index 824aeca..3cf16ff 100644 --- a/apps/jenkins/metadata.json +++ b/apps/jenkins/metadata.json @@ -4,6 +4,6 @@ "issue": "https://projects.knownelement.com/issues/234", "repo": "https://github.com/jenkinsci/jenkins.git", "additionalRepos": [], - "created": "2025-10-02T16:46:49Z", + "created": "2025-10-02T17:19:00Z", "notes": "TODO: capture packaging notes" -} \ No newline at end of file +} diff --git a/apps/jenkins/start.sh b/apps/jenkins/start.sh index ffd86bb..dcb6b5c 100755 --- a/apps/jenkins/start.sh +++ b/apps/jenkins/start.sh @@ -1,8 +1,9 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Cloudron injects configuration via environment variables and files under /run -# Use this script to render config files and launch the upstream service. +# TODO: render configuration files from CLOUDRON_* environment variables +# Example: +# envsubst < /app/pkg/config.tmpl > /run/config.yaml -# TODO: Replace the command below with the correct process supervisor. -exec /bin/sh -c "echo 'Replace start.sh with application startup logic for Jenkins' && sleep infinity" +>&2 echo "start.sh for Jenkins is not implemented yet." +exit 1 diff --git a/apps/jenkins/test/smoke.sh b/apps/jenkins/test/smoke.sh index ebd1134..c546da9 100755 --- a/apps/jenkins/test/smoke.sh +++ b/apps/jenkins/test/smoke.sh @@ -1,16 +1,14 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Basic container reachability check executed inside the packaging container. -# Replace curl target with an endpoint exposed by the app once the package is functional. -cloudron_app_url=${CLOUDRON_APP_ORIGIN:-"http://localhost"} +cloudron_app_origin=${CLOUDRON_APP_ORIGIN:-http://localhost} -http_code=$(curl -s -o /tmp/smoke.log -w "%{http_code}" "${cloudron_app_url}") +http_code=$(curl --silent --show-error --output /tmp/smoke.log --write-out "%{http_code}" "${cloudron_app_origin}/") if [[ "${http_code}" != "200" ]]; then - echo "Unexpected HTTP status: ${http_code}" >&2 - cat /tmp/smoke.log >&2 + >&2 echo "Smoke test failed for Jenkins: expected HTTP 200 from ${cloudron_app_origin}/, got ${http_code}" + >&2 cat /tmp/smoke.log exit 1 fi -echo "Smoke test passed" +echo "Smoke test placeholder passed for Jenkins" diff --git a/apps/kibot/CloudronManifest.json b/apps/kibot/CloudronManifest.json index 603ee3e..caf86a7 100644 --- a/apps/kibot/CloudronManifest.json +++ b/apps/kibot/CloudronManifest.json @@ -12,9 +12,16 @@ "version": "0.1.0", "tags": ["custom", "known-element"], "healthCheckPath": "/", - "memoryLimit": 536870912, "httpPort": 3000, + "memoryLimit": "512M", "addons": { "localstorage": {} + }, + "optionalAddons": { + "postgresql": {}, + "redis": {}, + "mysql": {}, + "mongodb": {}, + "sendmail": {} } } diff --git a/apps/kibot/Dockerfile b/apps/kibot/Dockerfile index ce47068..2e2808f 100644 --- a/apps/kibot/Dockerfile +++ b/apps/kibot/Dockerfile @@ -1,21 +1,38 @@ -# syntax=docker/dockerfile:1 -FROM cloudron/base:5.0.0 +# syntax=docker/dockerfile:1.6 +ARG APP_VERSION=latest + +FROM cloudron/base:5.0.0 AS builder +WORKDIR /build + +# ----------------------------------------------------------------------------- +# TODO: Fetch and build KiBot +# Example: +# RUN git clone --depth 1 --branch "${APP_VERSION}" https://github.com/INTI-CMNB/KiBot.git source \ +# && cd source \ +# && npm ci \ +# && npm run build +# ----------------------------------------------------------------------------- + +FROM cloudron/base:5.0.0 LABEL org.opencontainers.image.source="https://github.com/INTI-CMNB/KiBot.git" LABEL org.opencontainers.image.description="Cloudron package for KiBot" -ARG APP_VERSION -ENV APP_VERSION=${APP_VERSION:-latest} +ENV APP_VERSION=${APP_VERSION} + +# ----------------------------------------------------------------------------- +# TODO: Copy build artefacts from the builder stage +# COPY --from=builder /build/source/dist /app/code +# ----------------------------------------------------------------------------- -# Copy application source into image at build time -# Replace this with a multi-stage build if upstream provides Docker images. COPY ./app /app/code - -# Copy start script and make it executable COPY ./start.sh /app/pkg/start.sh -RUN chmod +x /app/pkg/start.sh +COPY ./test /app/pkg/test + +RUN chmod +x /app/pkg/start.sh /app/pkg/test/smoke.sh \ + && mkdir -p /app/data \ + && chown -R cloudron:cloudron /app -# Cloudron expects all processes to run as cloudron user USER cloudron WORKDIR /app/code diff --git a/apps/kibot/README.md b/apps/kibot/README.md index e210fbb..f110b82 100644 --- a/apps/kibot/README.md +++ b/apps/kibot/README.md @@ -2,19 +2,19 @@ - **Upstream repository**: https://github.com/INTI-CMNB/KiBot.git - **Implementation issue**: https://projects.knownelement.com/issues/197 -- **Status**: Draft scaffolding generated on $(date -u +"%Y-%m-%dT%H:%M:%SZ") +- **Generated**: 2025-10-02T17:19:00Z UTC ## Packaging Checklist -1. Review upstream deployment requirements and map them to Cloudron services (database, cache, object storage, workers). -2. Update `Dockerfile` with the correct build steps and runtime dependencies. -3. Implement `start.sh` to configure the app from Cloudron-provided environment variables and launch the primary process. -4. Edit `CloudronManifest.json` with accurate metadata, permissions, ports, addons, and health checks. -5. Add integration and smoke tests under `test/` to validate the package. -6. Document manual configuration steps, migration requirements, and known gaps in this README. +1. Map upstream services (databases, caches, workers) to Cloudron addons; remove unused entries from `optionalAddons` and enable required ones under `addons`. +2. Implement the multi-stage build in `Dockerfile` to fetch/compile the correct release of KiBot. +3. Update `start.sh` to configure the app from Cloudron environment variables and launch the primary process. +4. Replace the placeholder health checks and smoke test with real coverage. +5. Complete `CloudronManifest.json` (tagline, description, versioning, resource limits, ingress, TCP ports, etc.). +6. Document manual configuration steps, migrations, and known gaps below. ## Notes -- Replace the placeholder long-running process in `start.sh`. -- Populate the `app/` directory with the application build artefacts or git submodules. -- Use the shared packaging container (`docker/packager`) to run `cloudron build` and `cloudron install` so the host remains clean. +- Populate the `app/` directory with runtime overlays or artifacts generated during the build stage. +- Use the shared packaging container (`docker/packager`) for `cloudron build/install` to keep the host clean. +- Record decisions and operational requirements under `docs/apps/kibot/` as work progresses. diff --git a/apps/kibot/metadata.json b/apps/kibot/metadata.json index 6da2238..3cbd529 100644 --- a/apps/kibot/metadata.json +++ b/apps/kibot/metadata.json @@ -4,6 +4,6 @@ "issue": "https://projects.knownelement.com/issues/197", "repo": "https://github.com/INTI-CMNB/KiBot.git", "additionalRepos": [], - "created": "2025-10-02T16:46:49Z", + "created": "2025-10-02T17:19:00Z", "notes": "TODO: capture packaging notes" -} \ No newline at end of file +} diff --git a/apps/kibot/start.sh b/apps/kibot/start.sh index 7b4ffa6..52713f1 100755 --- a/apps/kibot/start.sh +++ b/apps/kibot/start.sh @@ -1,8 +1,9 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Cloudron injects configuration via environment variables and files under /run -# Use this script to render config files and launch the upstream service. +# TODO: render configuration files from CLOUDRON_* environment variables +# Example: +# envsubst < /app/pkg/config.tmpl > /run/config.yaml -# TODO: Replace the command below with the correct process supervisor. -exec /bin/sh -c "echo 'Replace start.sh with application startup logic for KiBot' && sleep infinity" +>&2 echo "start.sh for KiBot is not implemented yet." +exit 1 diff --git a/apps/kibot/test/smoke.sh b/apps/kibot/test/smoke.sh index ebd1134..efdb384 100755 --- a/apps/kibot/test/smoke.sh +++ b/apps/kibot/test/smoke.sh @@ -1,16 +1,14 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Basic container reachability check executed inside the packaging container. -# Replace curl target with an endpoint exposed by the app once the package is functional. -cloudron_app_url=${CLOUDRON_APP_ORIGIN:-"http://localhost"} +cloudron_app_origin=${CLOUDRON_APP_ORIGIN:-http://localhost} -http_code=$(curl -s -o /tmp/smoke.log -w "%{http_code}" "${cloudron_app_url}") +http_code=$(curl --silent --show-error --output /tmp/smoke.log --write-out "%{http_code}" "${cloudron_app_origin}/") if [[ "${http_code}" != "200" ]]; then - echo "Unexpected HTTP status: ${http_code}" >&2 - cat /tmp/smoke.log >&2 + >&2 echo "Smoke test failed for KiBot: expected HTTP 200 from ${cloudron_app_origin}/, got ${http_code}" + >&2 cat /tmp/smoke.log exit 1 fi -echo "Smoke test passed" +echo "Smoke test placeholder passed for KiBot" diff --git a/apps/killbill/CloudronManifest.json b/apps/killbill/CloudronManifest.json index 2a836f5..97eb04f 100644 --- a/apps/killbill/CloudronManifest.json +++ b/apps/killbill/CloudronManifest.json @@ -12,9 +12,16 @@ "version": "0.1.0", "tags": ["custom", "known-element"], "healthCheckPath": "/", - "memoryLimit": 536870912, "httpPort": 3000, + "memoryLimit": "512M", "addons": { "localstorage": {} + }, + "optionalAddons": { + "postgresql": {}, + "redis": {}, + "mysql": {}, + "mongodb": {}, + "sendmail": {} } } diff --git a/apps/killbill/Dockerfile b/apps/killbill/Dockerfile index 43eb669..7eb03a1 100644 --- a/apps/killbill/Dockerfile +++ b/apps/killbill/Dockerfile @@ -1,21 +1,38 @@ -# syntax=docker/dockerfile:1 -FROM cloudron/base:5.0.0 +# syntax=docker/dockerfile:1.6 +ARG APP_VERSION=latest + +FROM cloudron/base:5.0.0 AS builder +WORKDIR /build + +# ----------------------------------------------------------------------------- +# TODO: Fetch and build Kill Bill +# Example: +# RUN git clone --depth 1 --branch "${APP_VERSION}" https://github.com/killbill/killbill.git source \ +# && cd source \ +# && npm ci \ +# && npm run build +# ----------------------------------------------------------------------------- + +FROM cloudron/base:5.0.0 LABEL org.opencontainers.image.source="https://github.com/killbill/killbill.git" LABEL org.opencontainers.image.description="Cloudron package for Kill Bill" -ARG APP_VERSION -ENV APP_VERSION=${APP_VERSION:-latest} +ENV APP_VERSION=${APP_VERSION} + +# ----------------------------------------------------------------------------- +# TODO: Copy build artefacts from the builder stage +# COPY --from=builder /build/source/dist /app/code +# ----------------------------------------------------------------------------- -# Copy application source into image at build time -# Replace this with a multi-stage build if upstream provides Docker images. COPY ./app /app/code - -# Copy start script and make it executable COPY ./start.sh /app/pkg/start.sh -RUN chmod +x /app/pkg/start.sh +COPY ./test /app/pkg/test + +RUN chmod +x /app/pkg/start.sh /app/pkg/test/smoke.sh \ + && mkdir -p /app/data \ + && chown -R cloudron:cloudron /app -# Cloudron expects all processes to run as cloudron user USER cloudron WORKDIR /app/code diff --git a/apps/killbill/README.md b/apps/killbill/README.md index 6620513..b408fc0 100644 --- a/apps/killbill/README.md +++ b/apps/killbill/README.md @@ -2,19 +2,19 @@ - **Upstream repository**: https://github.com/killbill/killbill.git - **Implementation issue**: https://projects.knownelement.com/issues/181 -- **Status**: Draft scaffolding generated on $(date -u +"%Y-%m-%dT%H:%M:%SZ") +- **Generated**: 2025-10-02T17:19:00Z UTC ## Packaging Checklist -1. Review upstream deployment requirements and map them to Cloudron services (database, cache, object storage, workers). -2. Update `Dockerfile` with the correct build steps and runtime dependencies. -3. Implement `start.sh` to configure the app from Cloudron-provided environment variables and launch the primary process. -4. Edit `CloudronManifest.json` with accurate metadata, permissions, ports, addons, and health checks. -5. Add integration and smoke tests under `test/` to validate the package. -6. Document manual configuration steps, migration requirements, and known gaps in this README. +1. Map upstream services (databases, caches, workers) to Cloudron addons; remove unused entries from `optionalAddons` and enable required ones under `addons`. +2. Implement the multi-stage build in `Dockerfile` to fetch/compile the correct release of Kill Bill. +3. Update `start.sh` to configure the app from Cloudron environment variables and launch the primary process. +4. Replace the placeholder health checks and smoke test with real coverage. +5. Complete `CloudronManifest.json` (tagline, description, versioning, resource limits, ingress, TCP ports, etc.). +6. Document manual configuration steps, migrations, and known gaps below. ## Notes -- Replace the placeholder long-running process in `start.sh`. -- Populate the `app/` directory with the application build artefacts or git submodules. -- Use the shared packaging container (`docker/packager`) to run `cloudron build` and `cloudron install` so the host remains clean. +- Populate the `app/` directory with runtime overlays or artifacts generated during the build stage. +- Use the shared packaging container (`docker/packager`) for `cloudron build/install` to keep the host clean. +- Record decisions and operational requirements under `docs/apps/killbill/` as work progresses. diff --git a/apps/killbill/metadata.json b/apps/killbill/metadata.json index 38c4aad..a7682ae 100644 --- a/apps/killbill/metadata.json +++ b/apps/killbill/metadata.json @@ -4,6 +4,6 @@ "issue": "https://projects.knownelement.com/issues/181", "repo": "https://github.com/killbill/killbill.git", "additionalRepos": [], - "created": "2025-10-02T16:46:49Z", + "created": "2025-10-02T17:19:00Z", "notes": "TODO: capture packaging notes" -} \ No newline at end of file +} diff --git a/apps/killbill/start.sh b/apps/killbill/start.sh index 35ae79b..ce8140e 100755 --- a/apps/killbill/start.sh +++ b/apps/killbill/start.sh @@ -1,8 +1,9 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Cloudron injects configuration via environment variables and files under /run -# Use this script to render config files and launch the upstream service. +# TODO: render configuration files from CLOUDRON_* environment variables +# Example: +# envsubst < /app/pkg/config.tmpl > /run/config.yaml -# TODO: Replace the command below with the correct process supervisor. -exec /bin/sh -c "echo 'Replace start.sh with application startup logic for Kill Bill' && sleep infinity" +>&2 echo "start.sh for Kill Bill is not implemented yet." +exit 1 diff --git a/apps/killbill/test/smoke.sh b/apps/killbill/test/smoke.sh index ebd1134..0cd98b0 100755 --- a/apps/killbill/test/smoke.sh +++ b/apps/killbill/test/smoke.sh @@ -1,16 +1,14 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Basic container reachability check executed inside the packaging container. -# Replace curl target with an endpoint exposed by the app once the package is functional. -cloudron_app_url=${CLOUDRON_APP_ORIGIN:-"http://localhost"} +cloudron_app_origin=${CLOUDRON_APP_ORIGIN:-http://localhost} -http_code=$(curl -s -o /tmp/smoke.log -w "%{http_code}" "${cloudron_app_url}") +http_code=$(curl --silent --show-error --output /tmp/smoke.log --write-out "%{http_code}" "${cloudron_app_origin}/") if [[ "${http_code}" != "200" ]]; then - echo "Unexpected HTTP status: ${http_code}" >&2 - cat /tmp/smoke.log >&2 + >&2 echo "Smoke test failed for Kill Bill: expected HTTP 200 from ${cloudron_app_origin}/, got ${http_code}" + >&2 cat /tmp/smoke.log exit 1 fi -echo "Smoke test passed" +echo "Smoke test placeholder passed for Kill Bill" diff --git a/apps/langfuse/CloudronManifest.json b/apps/langfuse/CloudronManifest.json index 24cc5ba..7eeff22 100644 --- a/apps/langfuse/CloudronManifest.json +++ b/apps/langfuse/CloudronManifest.json @@ -12,9 +12,16 @@ "version": "0.1.0", "tags": ["custom", "known-element"], "healthCheckPath": "/", - "memoryLimit": 536870912, "httpPort": 3000, + "memoryLimit": "512M", "addons": { "localstorage": {} + }, + "optionalAddons": { + "postgresql": {}, + "redis": {}, + "mysql": {}, + "mongodb": {}, + "sendmail": {} } } diff --git a/apps/langfuse/Dockerfile b/apps/langfuse/Dockerfile index a91ad4b..689fde1 100644 --- a/apps/langfuse/Dockerfile +++ b/apps/langfuse/Dockerfile @@ -1,21 +1,38 @@ -# syntax=docker/dockerfile:1 -FROM cloudron/base:5.0.0 +# syntax=docker/dockerfile:1.6 +ARG APP_VERSION=latest + +FROM cloudron/base:5.0.0 AS builder +WORKDIR /build + +# ----------------------------------------------------------------------------- +# TODO: Fetch and build Langfuse OSS LLMOps Stack +# Example: +# RUN git clone --depth 1 --branch "${APP_VERSION}" https://github.com/langfuse/oss-llmops-stack.git source \ +# && cd source \ +# && npm ci \ +# && npm run build +# ----------------------------------------------------------------------------- + +FROM cloudron/base:5.0.0 LABEL org.opencontainers.image.source="https://github.com/langfuse/oss-llmops-stack.git" LABEL org.opencontainers.image.description="Cloudron package for Langfuse OSS LLMOps Stack" -ARG APP_VERSION -ENV APP_VERSION=${APP_VERSION:-latest} +ENV APP_VERSION=${APP_VERSION} + +# ----------------------------------------------------------------------------- +# TODO: Copy build artefacts from the builder stage +# COPY --from=builder /build/source/dist /app/code +# ----------------------------------------------------------------------------- -# Copy application source into image at build time -# Replace this with a multi-stage build if upstream provides Docker images. COPY ./app /app/code - -# Copy start script and make it executable COPY ./start.sh /app/pkg/start.sh -RUN chmod +x /app/pkg/start.sh +COPY ./test /app/pkg/test + +RUN chmod +x /app/pkg/start.sh /app/pkg/test/smoke.sh \ + && mkdir -p /app/data \ + && chown -R cloudron:cloudron /app -# Cloudron expects all processes to run as cloudron user USER cloudron WORKDIR /app/code diff --git a/apps/langfuse/README.md b/apps/langfuse/README.md index e6693d5..3f0db00 100644 --- a/apps/langfuse/README.md +++ b/apps/langfuse/README.md @@ -2,19 +2,19 @@ - **Upstream repository**: https://github.com/langfuse/oss-llmops-stack.git - **Implementation issue**: https://projects.knownelement.com/issues/283 -- **Status**: Draft scaffolding generated on $(date -u +"%Y-%m-%dT%H:%M:%SZ") +- **Generated**: 2025-10-02T17:19:01Z UTC ## Packaging Checklist -1. Review upstream deployment requirements and map them to Cloudron services (database, cache, object storage, workers). -2. Update `Dockerfile` with the correct build steps and runtime dependencies. -3. Implement `start.sh` to configure the app from Cloudron-provided environment variables and launch the primary process. -4. Edit `CloudronManifest.json` with accurate metadata, permissions, ports, addons, and health checks. -5. Add integration and smoke tests under `test/` to validate the package. -6. Document manual configuration steps, migration requirements, and known gaps in this README. +1. Map upstream services (databases, caches, workers) to Cloudron addons; remove unused entries from `optionalAddons` and enable required ones under `addons`. +2. Implement the multi-stage build in `Dockerfile` to fetch/compile the correct release of Langfuse OSS LLMOps Stack. +3. Update `start.sh` to configure the app from Cloudron environment variables and launch the primary process. +4. Replace the placeholder health checks and smoke test with real coverage. +5. Complete `CloudronManifest.json` (tagline, description, versioning, resource limits, ingress, TCP ports, etc.). +6. Document manual configuration steps, migrations, and known gaps below. ## Notes -- Replace the placeholder long-running process in `start.sh`. -- Populate the `app/` directory with the application build artefacts or git submodules. -- Use the shared packaging container (`docker/packager`) to run `cloudron build` and `cloudron install` so the host remains clean. +- Populate the `app/` directory with runtime overlays or artifacts generated during the build stage. +- Use the shared packaging container (`docker/packager`) for `cloudron build/install` to keep the host clean. +- Record decisions and operational requirements under `docs/apps/langfuse/` as work progresses. diff --git a/apps/langfuse/metadata.json b/apps/langfuse/metadata.json index 89d53e4..dc13e70 100644 --- a/apps/langfuse/metadata.json +++ b/apps/langfuse/metadata.json @@ -4,6 +4,6 @@ "issue": "https://projects.knownelement.com/issues/283", "repo": "https://github.com/langfuse/oss-llmops-stack.git", "additionalRepos": [], - "created": "2025-10-02T16:46:49Z", + "created": "2025-10-02T17:19:01Z", "notes": "TODO: capture packaging notes" -} \ No newline at end of file +} diff --git a/apps/langfuse/start.sh b/apps/langfuse/start.sh index ab3529c..c4d9532 100755 --- a/apps/langfuse/start.sh +++ b/apps/langfuse/start.sh @@ -1,8 +1,9 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Cloudron injects configuration via environment variables and files under /run -# Use this script to render config files and launch the upstream service. +# TODO: render configuration files from CLOUDRON_* environment variables +# Example: +# envsubst < /app/pkg/config.tmpl > /run/config.yaml -# TODO: Replace the command below with the correct process supervisor. -exec /bin/sh -c "echo 'Replace start.sh with application startup logic for Langfuse OSS LLMOps Stack' && sleep infinity" +>&2 echo "start.sh for Langfuse OSS LLMOps Stack is not implemented yet." +exit 1 diff --git a/apps/langfuse/test/smoke.sh b/apps/langfuse/test/smoke.sh index ebd1134..89e0882 100755 --- a/apps/langfuse/test/smoke.sh +++ b/apps/langfuse/test/smoke.sh @@ -1,16 +1,14 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Basic container reachability check executed inside the packaging container. -# Replace curl target with an endpoint exposed by the app once the package is functional. -cloudron_app_url=${CLOUDRON_APP_ORIGIN:-"http://localhost"} +cloudron_app_origin=${CLOUDRON_APP_ORIGIN:-http://localhost} -http_code=$(curl -s -o /tmp/smoke.log -w "%{http_code}" "${cloudron_app_url}") +http_code=$(curl --silent --show-error --output /tmp/smoke.log --write-out "%{http_code}" "${cloudron_app_origin}/") if [[ "${http_code}" != "200" ]]; then - echo "Unexpected HTTP status: ${http_code}" >&2 - cat /tmp/smoke.log >&2 + >&2 echo "Smoke test failed for Langfuse OSS LLMOps Stack: expected HTTP 200 from ${cloudron_app_origin}/, got ${http_code}" + >&2 cat /tmp/smoke.log exit 1 fi -echo "Smoke test passed" +echo "Smoke test placeholder passed for Langfuse OSS LLMOps Stack" diff --git a/apps/manyfold/CloudronManifest.json b/apps/manyfold/CloudronManifest.json index d36b970..99ae2d4 100644 --- a/apps/manyfold/CloudronManifest.json +++ b/apps/manyfold/CloudronManifest.json @@ -12,9 +12,16 @@ "version": "0.1.0", "tags": ["custom", "known-element"], "healthCheckPath": "/", - "memoryLimit": 536870912, "httpPort": 3000, + "memoryLimit": "512M", "addons": { "localstorage": {} + }, + "optionalAddons": { + "postgresql": {}, + "redis": {}, + "mysql": {}, + "mongodb": {}, + "sendmail": {} } } diff --git a/apps/manyfold/Dockerfile b/apps/manyfold/Dockerfile index d5da0be..030a6ac 100644 --- a/apps/manyfold/Dockerfile +++ b/apps/manyfold/Dockerfile @@ -1,21 +1,38 @@ -# syntax=docker/dockerfile:1 -FROM cloudron/base:5.0.0 +# syntax=docker/dockerfile:1.6 +ARG APP_VERSION=latest + +FROM cloudron/base:5.0.0 AS builder +WORKDIR /build + +# ----------------------------------------------------------------------------- +# TODO: Fetch and build Manyfold +# Example: +# RUN git clone --depth 1 --branch "${APP_VERSION}" https://github.com/manyfold3d/manyfold.git source \ +# && cd source \ +# && npm ci \ +# && npm run build +# ----------------------------------------------------------------------------- + +FROM cloudron/base:5.0.0 LABEL org.opencontainers.image.source="https://github.com/manyfold3d/manyfold.git" LABEL org.opencontainers.image.description="Cloudron package for Manyfold" -ARG APP_VERSION -ENV APP_VERSION=${APP_VERSION:-latest} +ENV APP_VERSION=${APP_VERSION} + +# ----------------------------------------------------------------------------- +# TODO: Copy build artefacts from the builder stage +# COPY --from=builder /build/source/dist /app/code +# ----------------------------------------------------------------------------- -# Copy application source into image at build time -# Replace this with a multi-stage build if upstream provides Docker images. COPY ./app /app/code - -# Copy start script and make it executable COPY ./start.sh /app/pkg/start.sh -RUN chmod +x /app/pkg/start.sh +COPY ./test /app/pkg/test + +RUN chmod +x /app/pkg/start.sh /app/pkg/test/smoke.sh \ + && mkdir -p /app/data \ + && chown -R cloudron:cloudron /app -# Cloudron expects all processes to run as cloudron user USER cloudron WORKDIR /app/code diff --git a/apps/manyfold/README.md b/apps/manyfold/README.md index 7cf6a96..9166154 100644 --- a/apps/manyfold/README.md +++ b/apps/manyfold/README.md @@ -2,19 +2,19 @@ - **Upstream repository**: https://github.com/manyfold3d/manyfold.git - **Implementation issue**: https://projects.knownelement.com/issues/282 -- **Status**: Draft scaffolding generated on $(date -u +"%Y-%m-%dT%H:%M:%SZ") +- **Generated**: 2025-10-02T17:19:01Z UTC ## Packaging Checklist -1. Review upstream deployment requirements and map them to Cloudron services (database, cache, object storage, workers). -2. Update `Dockerfile` with the correct build steps and runtime dependencies. -3. Implement `start.sh` to configure the app from Cloudron-provided environment variables and launch the primary process. -4. Edit `CloudronManifest.json` with accurate metadata, permissions, ports, addons, and health checks. -5. Add integration and smoke tests under `test/` to validate the package. -6. Document manual configuration steps, migration requirements, and known gaps in this README. +1. Map upstream services (databases, caches, workers) to Cloudron addons; remove unused entries from `optionalAddons` and enable required ones under `addons`. +2. Implement the multi-stage build in `Dockerfile` to fetch/compile the correct release of Manyfold. +3. Update `start.sh` to configure the app from Cloudron environment variables and launch the primary process. +4. Replace the placeholder health checks and smoke test with real coverage. +5. Complete `CloudronManifest.json` (tagline, description, versioning, resource limits, ingress, TCP ports, etc.). +6. Document manual configuration steps, migrations, and known gaps below. ## Notes -- Replace the placeholder long-running process in `start.sh`. -- Populate the `app/` directory with the application build artefacts or git submodules. -- Use the shared packaging container (`docker/packager`) to run `cloudron build` and `cloudron install` so the host remains clean. +- Populate the `app/` directory with runtime overlays or artifacts generated during the build stage. +- Use the shared packaging container (`docker/packager`) for `cloudron build/install` to keep the host clean. +- Record decisions and operational requirements under `docs/apps/manyfold/` as work progresses. diff --git a/apps/manyfold/metadata.json b/apps/manyfold/metadata.json index 6aca927..ba9f030 100644 --- a/apps/manyfold/metadata.json +++ b/apps/manyfold/metadata.json @@ -4,6 +4,6 @@ "issue": "https://projects.knownelement.com/issues/282", "repo": "https://github.com/manyfold3d/manyfold.git", "additionalRepos": [], - "created": "2025-10-02T16:46:49Z", + "created": "2025-10-02T17:19:01Z", "notes": "TODO: capture packaging notes" -} \ No newline at end of file +} diff --git a/apps/manyfold/start.sh b/apps/manyfold/start.sh index 4e94bfe..f0ae0f0 100755 --- a/apps/manyfold/start.sh +++ b/apps/manyfold/start.sh @@ -1,8 +1,9 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Cloudron injects configuration via environment variables and files under /run -# Use this script to render config files and launch the upstream service. +# TODO: render configuration files from CLOUDRON_* environment variables +# Example: +# envsubst < /app/pkg/config.tmpl > /run/config.yaml -# TODO: Replace the command below with the correct process supervisor. -exec /bin/sh -c "echo 'Replace start.sh with application startup logic for Manyfold' && sleep infinity" +>&2 echo "start.sh for Manyfold is not implemented yet." +exit 1 diff --git a/apps/manyfold/test/smoke.sh b/apps/manyfold/test/smoke.sh index ebd1134..cee34d9 100755 --- a/apps/manyfold/test/smoke.sh +++ b/apps/manyfold/test/smoke.sh @@ -1,16 +1,14 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Basic container reachability check executed inside the packaging container. -# Replace curl target with an endpoint exposed by the app once the package is functional. -cloudron_app_url=${CLOUDRON_APP_ORIGIN:-"http://localhost"} +cloudron_app_origin=${CLOUDRON_APP_ORIGIN:-http://localhost} -http_code=$(curl -s -o /tmp/smoke.log -w "%{http_code}" "${cloudron_app_url}") +http_code=$(curl --silent --show-error --output /tmp/smoke.log --write-out "%{http_code}" "${cloudron_app_origin}/") if [[ "${http_code}" != "200" ]]; then - echo "Unexpected HTTP status: ${http_code}" >&2 - cat /tmp/smoke.log >&2 + >&2 echo "Smoke test failed for Manyfold: expected HTTP 200 from ${cloudron_app_origin}/, got ${http_code}" + >&2 cat /tmp/smoke.log exit 1 fi -echo "Smoke test passed" +echo "Smoke test placeholder passed for Manyfold" diff --git a/apps/mender-server/CloudronManifest.json b/apps/mender-server/CloudronManifest.json index bcafb3d..f54e861 100644 --- a/apps/mender-server/CloudronManifest.json +++ b/apps/mender-server/CloudronManifest.json @@ -12,9 +12,16 @@ "version": "0.1.0", "tags": ["custom", "known-element"], "healthCheckPath": "/", - "memoryLimit": 536870912, "httpPort": 3000, + "memoryLimit": "512M", "addons": { "localstorage": {} + }, + "optionalAddons": { + "postgresql": {}, + "redis": {}, + "mysql": {}, + "mongodb": {}, + "sendmail": {} } } diff --git a/apps/mender-server/Dockerfile b/apps/mender-server/Dockerfile index dedf727..9daa3c5 100644 --- a/apps/mender-server/Dockerfile +++ b/apps/mender-server/Dockerfile @@ -1,21 +1,38 @@ -# syntax=docker/dockerfile:1 -FROM cloudron/base:5.0.0 +# syntax=docker/dockerfile:1.6 +ARG APP_VERSION=latest + +FROM cloudron/base:5.0.0 AS builder +WORKDIR /build + +# ----------------------------------------------------------------------------- +# TODO: Fetch and build Mender Server +# Example: +# RUN git clone --depth 1 --branch "${APP_VERSION}" https://github.com/mendersoftware/mender-server.git source \ +# && cd source \ +# && npm ci \ +# && npm run build +# ----------------------------------------------------------------------------- + +FROM cloudron/base:5.0.0 LABEL org.opencontainers.image.source="https://github.com/mendersoftware/mender-server.git" LABEL org.opencontainers.image.description="Cloudron package for Mender Server" -ARG APP_VERSION -ENV APP_VERSION=${APP_VERSION:-latest} +ENV APP_VERSION=${APP_VERSION} + +# ----------------------------------------------------------------------------- +# TODO: Copy build artefacts from the builder stage +# COPY --from=builder /build/source/dist /app/code +# ----------------------------------------------------------------------------- -# Copy application source into image at build time -# Replace this with a multi-stage build if upstream provides Docker images. COPY ./app /app/code - -# Copy start script and make it executable COPY ./start.sh /app/pkg/start.sh -RUN chmod +x /app/pkg/start.sh +COPY ./test /app/pkg/test + +RUN chmod +x /app/pkg/start.sh /app/pkg/test/smoke.sh \ + && mkdir -p /app/data \ + && chown -R cloudron:cloudron /app -# Cloudron expects all processes to run as cloudron user USER cloudron WORKDIR /app/code diff --git a/apps/mender-server/README.md b/apps/mender-server/README.md index 8c64cef..51fc15d 100644 --- a/apps/mender-server/README.md +++ b/apps/mender-server/README.md @@ -2,19 +2,19 @@ - **Upstream repository**: https://github.com/mendersoftware/mender-server.git - **Implementation issue**: https://projects.knownelement.com/issues/300 -- **Status**: Draft scaffolding generated on $(date -u +"%Y-%m-%dT%H:%M:%SZ") +- **Generated**: 2025-10-02T17:19:01Z UTC ## Packaging Checklist -1. Review upstream deployment requirements and map them to Cloudron services (database, cache, object storage, workers). -2. Update `Dockerfile` with the correct build steps and runtime dependencies. -3. Implement `start.sh` to configure the app from Cloudron-provided environment variables and launch the primary process. -4. Edit `CloudronManifest.json` with accurate metadata, permissions, ports, addons, and health checks. -5. Add integration and smoke tests under `test/` to validate the package. -6. Document manual configuration steps, migration requirements, and known gaps in this README. +1. Map upstream services (databases, caches, workers) to Cloudron addons; remove unused entries from `optionalAddons` and enable required ones under `addons`. +2. Implement the multi-stage build in `Dockerfile` to fetch/compile the correct release of Mender Server. +3. Update `start.sh` to configure the app from Cloudron environment variables and launch the primary process. +4. Replace the placeholder health checks and smoke test with real coverage. +5. Complete `CloudronManifest.json` (tagline, description, versioning, resource limits, ingress, TCP ports, etc.). +6. Document manual configuration steps, migrations, and known gaps below. ## Notes -- Replace the placeholder long-running process in `start.sh`. -- Populate the `app/` directory with the application build artefacts or git submodules. -- Use the shared packaging container (`docker/packager`) to run `cloudron build` and `cloudron install` so the host remains clean. +- Populate the `app/` directory with runtime overlays or artifacts generated during the build stage. +- Use the shared packaging container (`docker/packager`) for `cloudron build/install` to keep the host clean. +- Record decisions and operational requirements under `docs/apps/mender-server/` as work progresses. diff --git a/apps/mender-server/metadata.json b/apps/mender-server/metadata.json index 74e473f..edf1419 100644 --- a/apps/mender-server/metadata.json +++ b/apps/mender-server/metadata.json @@ -4,6 +4,6 @@ "issue": "https://projects.knownelement.com/issues/300", "repo": "https://github.com/mendersoftware/mender-server.git", "additionalRepos": [], - "created": "2025-10-02T16:46:50Z", + "created": "2025-10-02T17:19:01Z", "notes": "TODO: capture packaging notes" -} \ No newline at end of file +} diff --git a/apps/mender-server/start.sh b/apps/mender-server/start.sh index 1bd1633..28a471c 100755 --- a/apps/mender-server/start.sh +++ b/apps/mender-server/start.sh @@ -1,8 +1,9 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Cloudron injects configuration via environment variables and files under /run -# Use this script to render config files and launch the upstream service. +# TODO: render configuration files from CLOUDRON_* environment variables +# Example: +# envsubst < /app/pkg/config.tmpl > /run/config.yaml -# TODO: Replace the command below with the correct process supervisor. -exec /bin/sh -c "echo 'Replace start.sh with application startup logic for Mender Server' && sleep infinity" +>&2 echo "start.sh for Mender Server is not implemented yet." +exit 1 diff --git a/apps/mender-server/test/smoke.sh b/apps/mender-server/test/smoke.sh index ebd1134..1cd0d79 100755 --- a/apps/mender-server/test/smoke.sh +++ b/apps/mender-server/test/smoke.sh @@ -1,16 +1,14 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Basic container reachability check executed inside the packaging container. -# Replace curl target with an endpoint exposed by the app once the package is functional. -cloudron_app_url=${CLOUDRON_APP_ORIGIN:-"http://localhost"} +cloudron_app_origin=${CLOUDRON_APP_ORIGIN:-http://localhost} -http_code=$(curl -s -o /tmp/smoke.log -w "%{http_code}" "${cloudron_app_url}") +http_code=$(curl --silent --show-error --output /tmp/smoke.log --write-out "%{http_code}" "${cloudron_app_origin}/") if [[ "${http_code}" != "200" ]]; then - echo "Unexpected HTTP status: ${http_code}" >&2 - cat /tmp/smoke.log >&2 + >&2 echo "Smoke test failed for Mender Server: expected HTTP 200 from ${cloudron_app_origin}/, got ${http_code}" + >&2 cat /tmp/smoke.log exit 1 fi -echo "Smoke test passed" +echo "Smoke test placeholder passed for Mender Server" diff --git a/apps/midday/CloudronManifest.json b/apps/midday/CloudronManifest.json index 51dec30..5829daf 100644 --- a/apps/midday/CloudronManifest.json +++ b/apps/midday/CloudronManifest.json @@ -12,9 +12,16 @@ "version": "0.1.0", "tags": ["custom", "known-element"], "healthCheckPath": "/", - "memoryLimit": 536870912, "httpPort": 3000, + "memoryLimit": "512M", "addons": { "localstorage": {} + }, + "optionalAddons": { + "postgresql": {}, + "redis": {}, + "mysql": {}, + "mongodb": {}, + "sendmail": {} } } diff --git a/apps/midday/Dockerfile b/apps/midday/Dockerfile index 7d04f95..46732d8 100644 --- a/apps/midday/Dockerfile +++ b/apps/midday/Dockerfile @@ -1,21 +1,38 @@ -# syntax=docker/dockerfile:1 -FROM cloudron/base:5.0.0 +# syntax=docker/dockerfile:1.6 +ARG APP_VERSION=latest + +FROM cloudron/base:5.0.0 AS builder +WORKDIR /build + +# ----------------------------------------------------------------------------- +# TODO: Fetch and build Midday +# Example: +# RUN git clone --depth 1 --branch "${APP_VERSION}" https://github.com/midday-ai/midday.git source \ +# && cd source \ +# && npm ci \ +# && npm run build +# ----------------------------------------------------------------------------- + +FROM cloudron/base:5.0.0 LABEL org.opencontainers.image.source="https://github.com/midday-ai/midday.git" LABEL org.opencontainers.image.description="Cloudron package for Midday" -ARG APP_VERSION -ENV APP_VERSION=${APP_VERSION:-latest} +ENV APP_VERSION=${APP_VERSION} + +# ----------------------------------------------------------------------------- +# TODO: Copy build artefacts from the builder stage +# COPY --from=builder /build/source/dist /app/code +# ----------------------------------------------------------------------------- -# Copy application source into image at build time -# Replace this with a multi-stage build if upstream provides Docker images. COPY ./app /app/code - -# Copy start script and make it executable COPY ./start.sh /app/pkg/start.sh -RUN chmod +x /app/pkg/start.sh +COPY ./test /app/pkg/test + +RUN chmod +x /app/pkg/start.sh /app/pkg/test/smoke.sh \ + && mkdir -p /app/data \ + && chown -R cloudron:cloudron /app -# Cloudron expects all processes to run as cloudron user USER cloudron WORKDIR /app/code diff --git a/apps/midday/README.md b/apps/midday/README.md index 2adee84..25e30b8 100644 --- a/apps/midday/README.md +++ b/apps/midday/README.md @@ -2,19 +2,19 @@ - **Upstream repository**: https://github.com/midday-ai/midday.git - **Implementation issue**: https://projects.knownelement.com/issues/178 -- **Status**: Draft scaffolding generated on $(date -u +"%Y-%m-%dT%H:%M:%SZ") +- **Generated**: 2025-10-02T17:19:00Z UTC ## Packaging Checklist -1. Review upstream deployment requirements and map them to Cloudron services (database, cache, object storage, workers). -2. Update `Dockerfile` with the correct build steps and runtime dependencies. -3. Implement `start.sh` to configure the app from Cloudron-provided environment variables and launch the primary process. -4. Edit `CloudronManifest.json` with accurate metadata, permissions, ports, addons, and health checks. -5. Add integration and smoke tests under `test/` to validate the package. -6. Document manual configuration steps, migration requirements, and known gaps in this README. +1. Map upstream services (databases, caches, workers) to Cloudron addons; remove unused entries from `optionalAddons` and enable required ones under `addons`. +2. Implement the multi-stage build in `Dockerfile` to fetch/compile the correct release of Midday. +3. Update `start.sh` to configure the app from Cloudron environment variables and launch the primary process. +4. Replace the placeholder health checks and smoke test with real coverage. +5. Complete `CloudronManifest.json` (tagline, description, versioning, resource limits, ingress, TCP ports, etc.). +6. Document manual configuration steps, migrations, and known gaps below. ## Notes -- Replace the placeholder long-running process in `start.sh`. -- Populate the `app/` directory with the application build artefacts or git submodules. -- Use the shared packaging container (`docker/packager`) to run `cloudron build` and `cloudron install` so the host remains clean. +- Populate the `app/` directory with runtime overlays or artifacts generated during the build stage. +- Use the shared packaging container (`docker/packager`) for `cloudron build/install` to keep the host clean. +- Record decisions and operational requirements under `docs/apps/midday/` as work progresses. diff --git a/apps/midday/metadata.json b/apps/midday/metadata.json index 3f65881..fc3ae7e 100644 --- a/apps/midday/metadata.json +++ b/apps/midday/metadata.json @@ -4,6 +4,6 @@ "issue": "https://projects.knownelement.com/issues/178", "repo": "https://github.com/midday-ai/midday.git", "additionalRepos": [], - "created": "2025-10-02T16:46:49Z", + "created": "2025-10-02T17:19:00Z", "notes": "TODO: capture packaging notes" -} \ No newline at end of file +} diff --git a/apps/midday/start.sh b/apps/midday/start.sh index b1e7058..0130c99 100755 --- a/apps/midday/start.sh +++ b/apps/midday/start.sh @@ -1,8 +1,9 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Cloudron injects configuration via environment variables and files under /run -# Use this script to render config files and launch the upstream service. +# TODO: render configuration files from CLOUDRON_* environment variables +# Example: +# envsubst < /app/pkg/config.tmpl > /run/config.yaml -# TODO: Replace the command below with the correct process supervisor. -exec /bin/sh -c "echo 'Replace start.sh with application startup logic for Midday' && sleep infinity" +>&2 echo "start.sh for Midday is not implemented yet." +exit 1 diff --git a/apps/midday/test/smoke.sh b/apps/midday/test/smoke.sh index ebd1134..67d66a4 100755 --- a/apps/midday/test/smoke.sh +++ b/apps/midday/test/smoke.sh @@ -1,16 +1,14 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Basic container reachability check executed inside the packaging container. -# Replace curl target with an endpoint exposed by the app once the package is functional. -cloudron_app_url=${CLOUDRON_APP_ORIGIN:-"http://localhost"} +cloudron_app_origin=${CLOUDRON_APP_ORIGIN:-http://localhost} -http_code=$(curl -s -o /tmp/smoke.log -w "%{http_code}" "${cloudron_app_url}") +http_code=$(curl --silent --show-error --output /tmp/smoke.log --write-out "%{http_code}" "${cloudron_app_origin}/") if [[ "${http_code}" != "200" ]]; then - echo "Unexpected HTTP status: ${http_code}" >&2 - cat /tmp/smoke.log >&2 + >&2 echo "Smoke test failed for Midday: expected HTTP 200 from ${cloudron_app_origin}/, got ${http_code}" + >&2 cat /tmp/smoke.log exit 1 fi -echo "Smoke test passed" +echo "Smoke test placeholder passed for Midday" diff --git a/apps/mirlo/CloudronManifest.json b/apps/mirlo/CloudronManifest.json index 2ce04a7..5134b46 100644 --- a/apps/mirlo/CloudronManifest.json +++ b/apps/mirlo/CloudronManifest.json @@ -12,9 +12,16 @@ "version": "0.1.0", "tags": ["custom", "known-element"], "healthCheckPath": "/", - "memoryLimit": 536870912, "httpPort": 3000, + "memoryLimit": "512M", "addons": { "localstorage": {} + }, + "optionalAddons": { + "postgresql": {}, + "redis": {}, + "mysql": {}, + "mongodb": {}, + "sendmail": {} } } diff --git a/apps/mirlo/Dockerfile b/apps/mirlo/Dockerfile index c07958f..4448fd0 100644 --- a/apps/mirlo/Dockerfile +++ b/apps/mirlo/Dockerfile @@ -1,21 +1,38 @@ -# syntax=docker/dockerfile:1 -FROM cloudron/base:5.0.0 +# syntax=docker/dockerfile:1.6 +ARG APP_VERSION=latest + +FROM cloudron/base:5.0.0 AS builder +WORKDIR /build + +# ----------------------------------------------------------------------------- +# TODO: Fetch and build Mirlo +# Example: +# RUN git clone --depth 1 --branch "${APP_VERSION}" https://github.com/funmusicplace/mirlo.git source \ +# && cd source \ +# && npm ci \ +# && npm run build +# ----------------------------------------------------------------------------- + +FROM cloudron/base:5.0.0 LABEL org.opencontainers.image.source="https://github.com/funmusicplace/mirlo.git" LABEL org.opencontainers.image.description="Cloudron package for Mirlo" -ARG APP_VERSION -ENV APP_VERSION=${APP_VERSION:-latest} +ENV APP_VERSION=${APP_VERSION} + +# ----------------------------------------------------------------------------- +# TODO: Copy build artefacts from the builder stage +# COPY --from=builder /build/source/dist /app/code +# ----------------------------------------------------------------------------- -# Copy application source into image at build time -# Replace this with a multi-stage build if upstream provides Docker images. COPY ./app /app/code - -# Copy start script and make it executable COPY ./start.sh /app/pkg/start.sh -RUN chmod +x /app/pkg/start.sh +COPY ./test /app/pkg/test + +RUN chmod +x /app/pkg/start.sh /app/pkg/test/smoke.sh \ + && mkdir -p /app/data \ + && chown -R cloudron:cloudron /app -# Cloudron expects all processes to run as cloudron user USER cloudron WORKDIR /app/code diff --git a/apps/mirlo/README.md b/apps/mirlo/README.md index fb5bb08..bc03d03 100644 --- a/apps/mirlo/README.md +++ b/apps/mirlo/README.md @@ -2,19 +2,19 @@ - **Upstream repository**: https://github.com/funmusicplace/mirlo.git - **Implementation issue**: https://projects.knownelement.com/issues/TBD -- **Status**: Draft scaffolding generated on $(date -u +"%Y-%m-%dT%H:%M:%SZ") +- **Generated**: 2025-10-02T17:19:01Z UTC ## Packaging Checklist -1. Review upstream deployment requirements and map them to Cloudron services (database, cache, object storage, workers). -2. Update `Dockerfile` with the correct build steps and runtime dependencies. -3. Implement `start.sh` to configure the app from Cloudron-provided environment variables and launch the primary process. -4. Edit `CloudronManifest.json` with accurate metadata, permissions, ports, addons, and health checks. -5. Add integration and smoke tests under `test/` to validate the package. -6. Document manual configuration steps, migration requirements, and known gaps in this README. +1. Map upstream services (databases, caches, workers) to Cloudron addons; remove unused entries from `optionalAddons` and enable required ones under `addons`. +2. Implement the multi-stage build in `Dockerfile` to fetch/compile the correct release of Mirlo. +3. Update `start.sh` to configure the app from Cloudron environment variables and launch the primary process. +4. Replace the placeholder health checks and smoke test with real coverage. +5. Complete `CloudronManifest.json` (tagline, description, versioning, resource limits, ingress, TCP ports, etc.). +6. Document manual configuration steps, migrations, and known gaps below. ## Notes -- Replace the placeholder long-running process in `start.sh`. -- Populate the `app/` directory with the application build artefacts or git submodules. -- Use the shared packaging container (`docker/packager`) to run `cloudron build` and `cloudron install` so the host remains clean. +- Populate the `app/` directory with runtime overlays or artifacts generated during the build stage. +- Use the shared packaging container (`docker/packager`) for `cloudron build/install` to keep the host clean. +- Record decisions and operational requirements under `docs/apps/mirlo/` as work progresses. diff --git a/apps/mirlo/metadata.json b/apps/mirlo/metadata.json index 28e7d29..e895802 100644 --- a/apps/mirlo/metadata.json +++ b/apps/mirlo/metadata.json @@ -4,6 +4,6 @@ "issue": "https://projects.knownelement.com/issues/TBD", "repo": "https://github.com/funmusicplace/mirlo.git", "additionalRepos": [], - "created": "2025-10-02T16:46:50Z", + "created": "2025-10-02T17:19:01Z", "notes": "TODO: capture packaging notes" -} \ No newline at end of file +} diff --git a/apps/mirlo/start.sh b/apps/mirlo/start.sh index 249ac7a..b35a0e1 100755 --- a/apps/mirlo/start.sh +++ b/apps/mirlo/start.sh @@ -1,8 +1,9 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Cloudron injects configuration via environment variables and files under /run -# Use this script to render config files and launch the upstream service. +# TODO: render configuration files from CLOUDRON_* environment variables +# Example: +# envsubst < /app/pkg/config.tmpl > /run/config.yaml -# TODO: Replace the command below with the correct process supervisor. -exec /bin/sh -c "echo 'Replace start.sh with application startup logic for Mirlo' && sleep infinity" +>&2 echo "start.sh for Mirlo is not implemented yet." +exit 1 diff --git a/apps/mirlo/test/smoke.sh b/apps/mirlo/test/smoke.sh index ebd1134..06f5345 100755 --- a/apps/mirlo/test/smoke.sh +++ b/apps/mirlo/test/smoke.sh @@ -1,16 +1,14 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Basic container reachability check executed inside the packaging container. -# Replace curl target with an endpoint exposed by the app once the package is functional. -cloudron_app_url=${CLOUDRON_APP_ORIGIN:-"http://localhost"} +cloudron_app_origin=${CLOUDRON_APP_ORIGIN:-http://localhost} -http_code=$(curl -s -o /tmp/smoke.log -w "%{http_code}" "${cloudron_app_url}") +http_code=$(curl --silent --show-error --output /tmp/smoke.log --write-out "%{http_code}" "${cloudron_app_origin}/") if [[ "${http_code}" != "200" ]]; then - echo "Unexpected HTTP status: ${http_code}" >&2 - cat /tmp/smoke.log >&2 + >&2 echo "Smoke test failed for Mirlo: expected HTTP 200 from ${cloudron_app_origin}/, got ${http_code}" + >&2 cat /tmp/smoke.log exit 1 fi -echo "Smoke test passed" +echo "Smoke test placeholder passed for Mirlo" diff --git a/apps/nautilus-trader/CloudronManifest.json b/apps/nautilus-trader/CloudronManifest.json index a2a518c..1e883d2 100644 --- a/apps/nautilus-trader/CloudronManifest.json +++ b/apps/nautilus-trader/CloudronManifest.json @@ -12,9 +12,16 @@ "version": "0.1.0", "tags": ["custom", "known-element"], "healthCheckPath": "/", - "memoryLimit": 536870912, "httpPort": 3000, + "memoryLimit": "512M", "addons": { "localstorage": {} + }, + "optionalAddons": { + "postgresql": {}, + "redis": {}, + "mysql": {}, + "mongodb": {}, + "sendmail": {} } } diff --git a/apps/nautilus-trader/Dockerfile b/apps/nautilus-trader/Dockerfile index 09a6fbf..f29baf5 100644 --- a/apps/nautilus-trader/Dockerfile +++ b/apps/nautilus-trader/Dockerfile @@ -1,21 +1,38 @@ -# syntax=docker/dockerfile:1 -FROM cloudron/base:5.0.0 +# syntax=docker/dockerfile:1.6 +ARG APP_VERSION=latest + +FROM cloudron/base:5.0.0 AS builder +WORKDIR /build + +# ----------------------------------------------------------------------------- +# TODO: Fetch and build Nautilus Trader +# Example: +# RUN git clone --depth 1 --branch "${APP_VERSION}" https://github.com/nautechsystems/nautilus_trader.git source \ +# && cd source \ +# && npm ci \ +# && npm run build +# ----------------------------------------------------------------------------- + +FROM cloudron/base:5.0.0 LABEL org.opencontainers.image.source="https://github.com/nautechsystems/nautilus_trader.git" LABEL org.opencontainers.image.description="Cloudron package for Nautilus Trader" -ARG APP_VERSION -ENV APP_VERSION=${APP_VERSION:-latest} +ENV APP_VERSION=${APP_VERSION} + +# ----------------------------------------------------------------------------- +# TODO: Copy build artefacts from the builder stage +# COPY --from=builder /build/source/dist /app/code +# ----------------------------------------------------------------------------- -# Copy application source into image at build time -# Replace this with a multi-stage build if upstream provides Docker images. COPY ./app /app/code - -# Copy start script and make it executable COPY ./start.sh /app/pkg/start.sh -RUN chmod +x /app/pkg/start.sh +COPY ./test /app/pkg/test + +RUN chmod +x /app/pkg/start.sh /app/pkg/test/smoke.sh \ + && mkdir -p /app/data \ + && chown -R cloudron:cloudron /app -# Cloudron expects all processes to run as cloudron user USER cloudron WORKDIR /app/code diff --git a/apps/nautilus-trader/README.md b/apps/nautilus-trader/README.md index e5c4686..4df28be 100644 --- a/apps/nautilus-trader/README.md +++ b/apps/nautilus-trader/README.md @@ -2,19 +2,19 @@ - **Upstream repository**: https://github.com/nautechsystems/nautilus_trader.git - **Implementation issue**: https://projects.knownelement.com/issues/226 -- **Status**: Draft scaffolding generated on $(date -u +"%Y-%m-%dT%H:%M:%SZ") +- **Generated**: 2025-10-02T17:19:01Z UTC ## Packaging Checklist -1. Review upstream deployment requirements and map them to Cloudron services (database, cache, object storage, workers). -2. Update `Dockerfile` with the correct build steps and runtime dependencies. -3. Implement `start.sh` to configure the app from Cloudron-provided environment variables and launch the primary process. -4. Edit `CloudronManifest.json` with accurate metadata, permissions, ports, addons, and health checks. -5. Add integration and smoke tests under `test/` to validate the package. -6. Document manual configuration steps, migration requirements, and known gaps in this README. +1. Map upstream services (databases, caches, workers) to Cloudron addons; remove unused entries from `optionalAddons` and enable required ones under `addons`. +2. Implement the multi-stage build in `Dockerfile` to fetch/compile the correct release of Nautilus Trader. +3. Update `start.sh` to configure the app from Cloudron environment variables and launch the primary process. +4. Replace the placeholder health checks and smoke test with real coverage. +5. Complete `CloudronManifest.json` (tagline, description, versioning, resource limits, ingress, TCP ports, etc.). +6. Document manual configuration steps, migrations, and known gaps below. ## Notes -- Replace the placeholder long-running process in `start.sh`. -- Populate the `app/` directory with the application build artefacts or git submodules. -- Use the shared packaging container (`docker/packager`) to run `cloudron build` and `cloudron install` so the host remains clean. +- Populate the `app/` directory with runtime overlays or artifacts generated during the build stage. +- Use the shared packaging container (`docker/packager`) for `cloudron build/install` to keep the host clean. +- Record decisions and operational requirements under `docs/apps/nautilus-trader/` as work progresses. diff --git a/apps/nautilus-trader/metadata.json b/apps/nautilus-trader/metadata.json index 92e9cd8..c8cde14 100644 --- a/apps/nautilus-trader/metadata.json +++ b/apps/nautilus-trader/metadata.json @@ -4,6 +4,6 @@ "issue": "https://projects.knownelement.com/issues/226", "repo": "https://github.com/nautechsystems/nautilus_trader.git", "additionalRepos": [], - "created": "2025-10-02T16:46:50Z", + "created": "2025-10-02T17:19:01Z", "notes": "TODO: capture packaging notes" -} \ No newline at end of file +} diff --git a/apps/nautilus-trader/start.sh b/apps/nautilus-trader/start.sh index 46cd694..89e012d 100755 --- a/apps/nautilus-trader/start.sh +++ b/apps/nautilus-trader/start.sh @@ -1,8 +1,9 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Cloudron injects configuration via environment variables and files under /run -# Use this script to render config files and launch the upstream service. +# TODO: render configuration files from CLOUDRON_* environment variables +# Example: +# envsubst < /app/pkg/config.tmpl > /run/config.yaml -# TODO: Replace the command below with the correct process supervisor. -exec /bin/sh -c "echo 'Replace start.sh with application startup logic for Nautilus Trader' && sleep infinity" +>&2 echo "start.sh for Nautilus Trader is not implemented yet." +exit 1 diff --git a/apps/nautilus-trader/test/smoke.sh b/apps/nautilus-trader/test/smoke.sh index ebd1134..43eb693 100755 --- a/apps/nautilus-trader/test/smoke.sh +++ b/apps/nautilus-trader/test/smoke.sh @@ -1,16 +1,14 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Basic container reachability check executed inside the packaging container. -# Replace curl target with an endpoint exposed by the app once the package is functional. -cloudron_app_url=${CLOUDRON_APP_ORIGIN:-"http://localhost"} +cloudron_app_origin=${CLOUDRON_APP_ORIGIN:-http://localhost} -http_code=$(curl -s -o /tmp/smoke.log -w "%{http_code}" "${cloudron_app_url}") +http_code=$(curl --silent --show-error --output /tmp/smoke.log --write-out "%{http_code}" "${cloudron_app_origin}/") if [[ "${http_code}" != "200" ]]; then - echo "Unexpected HTTP status: ${http_code}" >&2 - cat /tmp/smoke.log >&2 + >&2 echo "Smoke test failed for Nautilus Trader: expected HTTP 200 from ${cloudron_app_origin}/, got ${http_code}" + >&2 cat /tmp/smoke.log exit 1 fi -echo "Smoke test passed" +echo "Smoke test placeholder passed for Nautilus Trader" diff --git a/apps/netbox-docker/CloudronManifest.json b/apps/netbox-docker/CloudronManifest.json index eea35dc..72d11b7 100644 --- a/apps/netbox-docker/CloudronManifest.json +++ b/apps/netbox-docker/CloudronManifest.json @@ -12,9 +12,16 @@ "version": "0.1.0", "tags": ["custom", "known-element"], "healthCheckPath": "/", - "memoryLimit": 536870912, "httpPort": 3000, + "memoryLimit": "512M", "addons": { "localstorage": {} + }, + "optionalAddons": { + "postgresql": {}, + "redis": {}, + "mysql": {}, + "mongodb": {}, + "sendmail": {} } } diff --git a/apps/netbox-docker/Dockerfile b/apps/netbox-docker/Dockerfile index 8977490..85cc93a 100644 --- a/apps/netbox-docker/Dockerfile +++ b/apps/netbox-docker/Dockerfile @@ -1,21 +1,38 @@ -# syntax=docker/dockerfile:1 -FROM cloudron/base:5.0.0 +# syntax=docker/dockerfile:1.6 +ARG APP_VERSION=latest + +FROM cloudron/base:5.0.0 AS builder +WORKDIR /build + +# ----------------------------------------------------------------------------- +# TODO: Fetch and build NetBox Docker +# Example: +# RUN git clone --depth 1 --branch "${APP_VERSION}" https://github.com/netbox-community/netbox-docker.git source \ +# && cd source \ +# && npm ci \ +# && npm run build +# ----------------------------------------------------------------------------- + +FROM cloudron/base:5.0.0 LABEL org.opencontainers.image.source="https://github.com/netbox-community/netbox-docker.git" LABEL org.opencontainers.image.description="Cloudron package for NetBox Docker" -ARG APP_VERSION -ENV APP_VERSION=${APP_VERSION:-latest} +ENV APP_VERSION=${APP_VERSION} + +# ----------------------------------------------------------------------------- +# TODO: Copy build artefacts from the builder stage +# COPY --from=builder /build/source/dist /app/code +# ----------------------------------------------------------------------------- -# Copy application source into image at build time -# Replace this with a multi-stage build if upstream provides Docker images. COPY ./app /app/code - -# Copy start script and make it executable COPY ./start.sh /app/pkg/start.sh -RUN chmod +x /app/pkg/start.sh +COPY ./test /app/pkg/test + +RUN chmod +x /app/pkg/start.sh /app/pkg/test/smoke.sh \ + && mkdir -p /app/data \ + && chown -R cloudron:cloudron /app -# Cloudron expects all processes to run as cloudron user USER cloudron WORKDIR /app/code diff --git a/apps/netbox-docker/README.md b/apps/netbox-docker/README.md index b5d197c..fd2c8c0 100644 --- a/apps/netbox-docker/README.md +++ b/apps/netbox-docker/README.md @@ -2,19 +2,19 @@ - **Upstream repository**: https://github.com/netbox-community/netbox-docker.git - **Implementation issue**: https://projects.knownelement.com/issues/201 -- **Status**: Draft scaffolding generated on $(date -u +"%Y-%m-%dT%H:%M:%SZ") +- **Generated**: 2025-10-02T17:19:00Z UTC ## Packaging Checklist -1. Review upstream deployment requirements and map them to Cloudron services (database, cache, object storage, workers). -2. Update `Dockerfile` with the correct build steps and runtime dependencies. -3. Implement `start.sh` to configure the app from Cloudron-provided environment variables and launch the primary process. -4. Edit `CloudronManifest.json` with accurate metadata, permissions, ports, addons, and health checks. -5. Add integration and smoke tests under `test/` to validate the package. -6. Document manual configuration steps, migration requirements, and known gaps in this README. +1. Map upstream services (databases, caches, workers) to Cloudron addons; remove unused entries from `optionalAddons` and enable required ones under `addons`. +2. Implement the multi-stage build in `Dockerfile` to fetch/compile the correct release of NetBox Docker. +3. Update `start.sh` to configure the app from Cloudron environment variables and launch the primary process. +4. Replace the placeholder health checks and smoke test with real coverage. +5. Complete `CloudronManifest.json` (tagline, description, versioning, resource limits, ingress, TCP ports, etc.). +6. Document manual configuration steps, migrations, and known gaps below. ## Notes -- Replace the placeholder long-running process in `start.sh`. -- Populate the `app/` directory with the application build artefacts or git submodules. -- Use the shared packaging container (`docker/packager`) to run `cloudron build` and `cloudron install` so the host remains clean. +- Populate the `app/` directory with runtime overlays or artifacts generated during the build stage. +- Use the shared packaging container (`docker/packager`) for `cloudron build/install` to keep the host clean. +- Record decisions and operational requirements under `docs/apps/netbox-docker/` as work progresses. diff --git a/apps/netbox-docker/metadata.json b/apps/netbox-docker/metadata.json index a0220ac..cadf2b7 100644 --- a/apps/netbox-docker/metadata.json +++ b/apps/netbox-docker/metadata.json @@ -4,6 +4,6 @@ "issue": "https://projects.knownelement.com/issues/201", "repo": "https://github.com/netbox-community/netbox-docker.git", "additionalRepos": [], - "created": "2025-10-02T16:46:49Z", + "created": "2025-10-02T17:19:00Z", "notes": "TODO: capture packaging notes" -} \ No newline at end of file +} diff --git a/apps/netbox-docker/start.sh b/apps/netbox-docker/start.sh index bc06dd2..4289c34 100755 --- a/apps/netbox-docker/start.sh +++ b/apps/netbox-docker/start.sh @@ -1,8 +1,9 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Cloudron injects configuration via environment variables and files under /run -# Use this script to render config files and launch the upstream service. +# TODO: render configuration files from CLOUDRON_* environment variables +# Example: +# envsubst < /app/pkg/config.tmpl > /run/config.yaml -# TODO: Replace the command below with the correct process supervisor. -exec /bin/sh -c "echo 'Replace start.sh with application startup logic for NetBox Docker' && sleep infinity" +>&2 echo "start.sh for NetBox Docker is not implemented yet." +exit 1 diff --git a/apps/netbox-docker/test/smoke.sh b/apps/netbox-docker/test/smoke.sh index ebd1134..0cfb29a 100755 --- a/apps/netbox-docker/test/smoke.sh +++ b/apps/netbox-docker/test/smoke.sh @@ -1,16 +1,14 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Basic container reachability check executed inside the packaging container. -# Replace curl target with an endpoint exposed by the app once the package is functional. -cloudron_app_url=${CLOUDRON_APP_ORIGIN:-"http://localhost"} +cloudron_app_origin=${CLOUDRON_APP_ORIGIN:-http://localhost} -http_code=$(curl -s -o /tmp/smoke.log -w "%{http_code}" "${cloudron_app_url}") +http_code=$(curl --silent --show-error --output /tmp/smoke.log --write-out "%{http_code}" "${cloudron_app_origin}/") if [[ "${http_code}" != "200" ]]; then - echo "Unexpected HTTP status: ${http_code}" >&2 - cat /tmp/smoke.log >&2 + >&2 echo "Smoke test failed for NetBox Docker: expected HTTP 200 from ${cloudron_app_origin}/, got ${http_code}" + >&2 cat /tmp/smoke.log exit 1 fi -echo "Smoke test passed" +echo "Smoke test placeholder passed for NetBox Docker" diff --git a/apps/openblocks/CloudronManifest.json b/apps/openblocks/CloudronManifest.json index 19ff25f..bdeebec 100644 --- a/apps/openblocks/CloudronManifest.json +++ b/apps/openblocks/CloudronManifest.json @@ -12,9 +12,16 @@ "version": "0.1.0", "tags": ["custom", "known-element"], "healthCheckPath": "/", - "memoryLimit": 536870912, "httpPort": 3000, + "memoryLimit": "512M", "addons": { "localstorage": {} + }, + "optionalAddons": { + "postgresql": {}, + "redis": {}, + "mysql": {}, + "mongodb": {}, + "sendmail": {} } } diff --git a/apps/openblocks/Dockerfile b/apps/openblocks/Dockerfile index c3d705a..7dd183c 100644 --- a/apps/openblocks/Dockerfile +++ b/apps/openblocks/Dockerfile @@ -1,21 +1,38 @@ -# syntax=docker/dockerfile:1 -FROM cloudron/base:5.0.0 +# syntax=docker/dockerfile:1.6 +ARG APP_VERSION=latest + +FROM cloudron/base:5.0.0 AS builder +WORKDIR /build + +# ----------------------------------------------------------------------------- +# TODO: Fetch and build OpenBlocks +# Example: +# RUN git clone --depth 1 --branch "${APP_VERSION}" https://github.com/openblocks-dev/openblocks.git source \ +# && cd source \ +# && npm ci \ +# && npm run build +# ----------------------------------------------------------------------------- + +FROM cloudron/base:5.0.0 LABEL org.opencontainers.image.source="https://github.com/openblocks-dev/openblocks.git" LABEL org.opencontainers.image.description="Cloudron package for OpenBlocks" -ARG APP_VERSION -ENV APP_VERSION=${APP_VERSION:-latest} +ENV APP_VERSION=${APP_VERSION} + +# ----------------------------------------------------------------------------- +# TODO: Copy build artefacts from the builder stage +# COPY --from=builder /build/source/dist /app/code +# ----------------------------------------------------------------------------- -# Copy application source into image at build time -# Replace this with a multi-stage build if upstream provides Docker images. COPY ./app /app/code - -# Copy start script and make it executable COPY ./start.sh /app/pkg/start.sh -RUN chmod +x /app/pkg/start.sh +COPY ./test /app/pkg/test + +RUN chmod +x /app/pkg/start.sh /app/pkg/test/smoke.sh \ + && mkdir -p /app/data \ + && chown -R cloudron:cloudron /app -# Cloudron expects all processes to run as cloudron user USER cloudron WORKDIR /app/code diff --git a/apps/openblocks/README.md b/apps/openblocks/README.md index 4fb034a..3b8a4d2 100644 --- a/apps/openblocks/README.md +++ b/apps/openblocks/README.md @@ -2,19 +2,19 @@ - **Upstream repository**: https://github.com/openblocks-dev/openblocks.git - **Implementation issue**: https://projects.knownelement.com/issues/274 -- **Status**: Draft scaffolding generated on $(date -u +"%Y-%m-%dT%H:%M:%SZ") +- **Generated**: 2025-10-02T17:19:01Z UTC ## Packaging Checklist -1. Review upstream deployment requirements and map them to Cloudron services (database, cache, object storage, workers). -2. Update `Dockerfile` with the correct build steps and runtime dependencies. -3. Implement `start.sh` to configure the app from Cloudron-provided environment variables and launch the primary process. -4. Edit `CloudronManifest.json` with accurate metadata, permissions, ports, addons, and health checks. -5. Add integration and smoke tests under `test/` to validate the package. -6. Document manual configuration steps, migration requirements, and known gaps in this README. +1. Map upstream services (databases, caches, workers) to Cloudron addons; remove unused entries from `optionalAddons` and enable required ones under `addons`. +2. Implement the multi-stage build in `Dockerfile` to fetch/compile the correct release of OpenBlocks. +3. Update `start.sh` to configure the app from Cloudron environment variables and launch the primary process. +4. Replace the placeholder health checks and smoke test with real coverage. +5. Complete `CloudronManifest.json` (tagline, description, versioning, resource limits, ingress, TCP ports, etc.). +6. Document manual configuration steps, migrations, and known gaps below. ## Notes -- Replace the placeholder long-running process in `start.sh`. -- Populate the `app/` directory with the application build artefacts or git submodules. -- Use the shared packaging container (`docker/packager`) to run `cloudron build` and `cloudron install` so the host remains clean. +- Populate the `app/` directory with runtime overlays or artifacts generated during the build stage. +- Use the shared packaging container (`docker/packager`) for `cloudron build/install` to keep the host clean. +- Record decisions and operational requirements under `docs/apps/openblocks/` as work progresses. diff --git a/apps/openblocks/metadata.json b/apps/openblocks/metadata.json index 3ebe41d..c7260fb 100644 --- a/apps/openblocks/metadata.json +++ b/apps/openblocks/metadata.json @@ -4,6 +4,6 @@ "issue": "https://projects.knownelement.com/issues/274", "repo": "https://github.com/openblocks-dev/openblocks.git", "additionalRepos": [], - "created": "2025-10-02T16:46:49Z", + "created": "2025-10-02T17:19:01Z", "notes": "TODO: capture packaging notes" -} \ No newline at end of file +} diff --git a/apps/openblocks/start.sh b/apps/openblocks/start.sh index 110241d..1d5d18e 100755 --- a/apps/openblocks/start.sh +++ b/apps/openblocks/start.sh @@ -1,8 +1,9 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Cloudron injects configuration via environment variables and files under /run -# Use this script to render config files and launch the upstream service. +# TODO: render configuration files from CLOUDRON_* environment variables +# Example: +# envsubst < /app/pkg/config.tmpl > /run/config.yaml -# TODO: Replace the command below with the correct process supervisor. -exec /bin/sh -c "echo 'Replace start.sh with application startup logic for OpenBlocks' && sleep infinity" +>&2 echo "start.sh for OpenBlocks is not implemented yet." +exit 1 diff --git a/apps/openblocks/test/smoke.sh b/apps/openblocks/test/smoke.sh index ebd1134..9d5c7b7 100755 --- a/apps/openblocks/test/smoke.sh +++ b/apps/openblocks/test/smoke.sh @@ -1,16 +1,14 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Basic container reachability check executed inside the packaging container. -# Replace curl target with an endpoint exposed by the app once the package is functional. -cloudron_app_url=${CLOUDRON_APP_ORIGIN:-"http://localhost"} +cloudron_app_origin=${CLOUDRON_APP_ORIGIN:-http://localhost} -http_code=$(curl -s -o /tmp/smoke.log -w "%{http_code}" "${cloudron_app_url}") +http_code=$(curl --silent --show-error --output /tmp/smoke.log --write-out "%{http_code}" "${cloudron_app_origin}/") if [[ "${http_code}" != "200" ]]; then - echo "Unexpected HTTP status: ${http_code}" >&2 - cat /tmp/smoke.log >&2 + >&2 echo "Smoke test failed for OpenBlocks: expected HTTP 200 from ${cloudron_app_origin}/, got ${http_code}" + >&2 cat /tmp/smoke.log exit 1 fi -echo "Smoke test passed" +echo "Smoke test placeholder passed for OpenBlocks" diff --git a/apps/openboxes-docker/CloudronManifest.json b/apps/openboxes-docker/CloudronManifest.json index 832122f..83fb508 100644 --- a/apps/openboxes-docker/CloudronManifest.json +++ b/apps/openboxes-docker/CloudronManifest.json @@ -12,9 +12,16 @@ "version": "0.1.0", "tags": ["custom", "known-element"], "healthCheckPath": "/", - "memoryLimit": 536870912, "httpPort": 3000, + "memoryLimit": "512M", "addons": { "localstorage": {} + }, + "optionalAddons": { + "postgresql": {}, + "redis": {}, + "mysql": {}, + "mongodb": {}, + "sendmail": {} } } diff --git a/apps/openboxes-docker/Dockerfile b/apps/openboxes-docker/Dockerfile index 92ac4b5..66c3e5a 100644 --- a/apps/openboxes-docker/Dockerfile +++ b/apps/openboxes-docker/Dockerfile @@ -1,21 +1,38 @@ -# syntax=docker/dockerfile:1 -FROM cloudron/base:5.0.0 +# syntax=docker/dockerfile:1.6 +ARG APP_VERSION=latest + +FROM cloudron/base:5.0.0 AS builder +WORKDIR /build + +# ----------------------------------------------------------------------------- +# TODO: Fetch and build OpenBoxes Docker +# Example: +# RUN git clone --depth 1 --branch "${APP_VERSION}" https://github.com/openboxes/openboxes-docker.git source \ +# && cd source \ +# && npm ci \ +# && npm run build +# ----------------------------------------------------------------------------- + +FROM cloudron/base:5.0.0 LABEL org.opencontainers.image.source="https://github.com/openboxes/openboxes-docker.git" LABEL org.opencontainers.image.description="Cloudron package for OpenBoxes Docker" -ARG APP_VERSION -ENV APP_VERSION=${APP_VERSION:-latest} +ENV APP_VERSION=${APP_VERSION} + +# ----------------------------------------------------------------------------- +# TODO: Copy build artefacts from the builder stage +# COPY --from=builder /build/source/dist /app/code +# ----------------------------------------------------------------------------- -# Copy application source into image at build time -# Replace this with a multi-stage build if upstream provides Docker images. COPY ./app /app/code - -# Copy start script and make it executable COPY ./start.sh /app/pkg/start.sh -RUN chmod +x /app/pkg/start.sh +COPY ./test /app/pkg/test + +RUN chmod +x /app/pkg/start.sh /app/pkg/test/smoke.sh \ + && mkdir -p /app/data \ + && chown -R cloudron:cloudron /app -# Cloudron expects all processes to run as cloudron user USER cloudron WORKDIR /app/code diff --git a/apps/openboxes-docker/README.md b/apps/openboxes-docker/README.md index e36312b..51e373f 100644 --- a/apps/openboxes-docker/README.md +++ b/apps/openboxes-docker/README.md @@ -2,19 +2,19 @@ - **Upstream repository**: https://github.com/openboxes/openboxes-docker.git - **Implementation issue**: https://projects.knownelement.com/issues/205 -- **Status**: Draft scaffolding generated on $(date -u +"%Y-%m-%dT%H:%M:%SZ") +- **Generated**: 2025-10-02T17:19:00Z UTC ## Packaging Checklist -1. Review upstream deployment requirements and map them to Cloudron services (database, cache, object storage, workers). -2. Update `Dockerfile` with the correct build steps and runtime dependencies. -3. Implement `start.sh` to configure the app from Cloudron-provided environment variables and launch the primary process. -4. Edit `CloudronManifest.json` with accurate metadata, permissions, ports, addons, and health checks. -5. Add integration and smoke tests under `test/` to validate the package. -6. Document manual configuration steps, migration requirements, and known gaps in this README. +1. Map upstream services (databases, caches, workers) to Cloudron addons; remove unused entries from `optionalAddons` and enable required ones under `addons`. +2. Implement the multi-stage build in `Dockerfile` to fetch/compile the correct release of OpenBoxes Docker. +3. Update `start.sh` to configure the app from Cloudron environment variables and launch the primary process. +4. Replace the placeholder health checks and smoke test with real coverage. +5. Complete `CloudronManifest.json` (tagline, description, versioning, resource limits, ingress, TCP ports, etc.). +6. Document manual configuration steps, migrations, and known gaps below. ## Notes -- Replace the placeholder long-running process in `start.sh`. -- Populate the `app/` directory with the application build artefacts or git submodules. -- Use the shared packaging container (`docker/packager`) to run `cloudron build` and `cloudron install` so the host remains clean. +- Populate the `app/` directory with runtime overlays or artifacts generated during the build stage. +- Use the shared packaging container (`docker/packager`) for `cloudron build/install` to keep the host clean. +- Record decisions and operational requirements under `docs/apps/openboxes-docker/` as work progresses. diff --git a/apps/openboxes-docker/metadata.json b/apps/openboxes-docker/metadata.json index 31cef30..17b4750 100644 --- a/apps/openboxes-docker/metadata.json +++ b/apps/openboxes-docker/metadata.json @@ -4,6 +4,6 @@ "issue": "https://projects.knownelement.com/issues/205", "repo": "https://github.com/openboxes/openboxes-docker.git", "additionalRepos": [], - "created": "2025-10-02T16:46:49Z", + "created": "2025-10-02T17:19:00Z", "notes": "TODO: capture packaging notes" -} \ No newline at end of file +} diff --git a/apps/openboxes-docker/start.sh b/apps/openboxes-docker/start.sh index 136ae8e..dc2494f 100755 --- a/apps/openboxes-docker/start.sh +++ b/apps/openboxes-docker/start.sh @@ -1,8 +1,9 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Cloudron injects configuration via environment variables and files under /run -# Use this script to render config files and launch the upstream service. +# TODO: render configuration files from CLOUDRON_* environment variables +# Example: +# envsubst < /app/pkg/config.tmpl > /run/config.yaml -# TODO: Replace the command below with the correct process supervisor. -exec /bin/sh -c "echo 'Replace start.sh with application startup logic for OpenBoxes Docker' && sleep infinity" +>&2 echo "start.sh for OpenBoxes Docker is not implemented yet." +exit 1 diff --git a/apps/openboxes-docker/test/smoke.sh b/apps/openboxes-docker/test/smoke.sh index ebd1134..d5a5bc4 100755 --- a/apps/openboxes-docker/test/smoke.sh +++ b/apps/openboxes-docker/test/smoke.sh @@ -1,16 +1,14 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Basic container reachability check executed inside the packaging container. -# Replace curl target with an endpoint exposed by the app once the package is functional. -cloudron_app_url=${CLOUDRON_APP_ORIGIN:-"http://localhost"} +cloudron_app_origin=${CLOUDRON_APP_ORIGIN:-http://localhost} -http_code=$(curl -s -o /tmp/smoke.log -w "%{http_code}" "${cloudron_app_url}") +http_code=$(curl --silent --show-error --output /tmp/smoke.log --write-out "%{http_code}" "${cloudron_app_origin}/") if [[ "${http_code}" != "200" ]]; then - echo "Unexpected HTTP status: ${http_code}" >&2 - cat /tmp/smoke.log >&2 + >&2 echo "Smoke test failed for OpenBoxes Docker: expected HTTP 200 from ${cloudron_app_origin}/, got ${http_code}" + >&2 cat /tmp/smoke.log exit 1 fi -echo "Smoke test passed" +echo "Smoke test placeholder passed for OpenBoxes Docker" diff --git a/apps/openfile/CloudronManifest.json b/apps/openfile/CloudronManifest.json index 24788ec..06b7c4e 100644 --- a/apps/openfile/CloudronManifest.json +++ b/apps/openfile/CloudronManifest.json @@ -12,9 +12,16 @@ "version": "0.1.0", "tags": ["custom", "known-element"], "healthCheckPath": "/", - "memoryLimit": 536870912, "httpPort": 3000, + "memoryLimit": "512M", "addons": { "localstorage": {} + }, + "optionalAddons": { + "postgresql": {}, + "redis": {}, + "mysql": {}, + "mongodb": {}, + "sendmail": {} } } diff --git a/apps/openfile/Dockerfile b/apps/openfile/Dockerfile index 8a35754..c2d315c 100644 --- a/apps/openfile/Dockerfile +++ b/apps/openfile/Dockerfile @@ -1,21 +1,38 @@ -# syntax=docker/dockerfile:1 -FROM cloudron/base:5.0.0 +# syntax=docker/dockerfile:1.6 +ARG APP_VERSION=latest + +FROM cloudron/base:5.0.0 AS builder +WORKDIR /build + +# ----------------------------------------------------------------------------- +# TODO: Fetch and build OpenFile +# Example: +# RUN git clone --depth 1 --branch "${APP_VERSION}" https://github.com/openfiletax/openfile.git source \ +# && cd source \ +# && npm ci \ +# && npm run build +# ----------------------------------------------------------------------------- + +FROM cloudron/base:5.0.0 LABEL org.opencontainers.image.source="https://github.com/openfiletax/openfile.git" LABEL org.opencontainers.image.description="Cloudron package for OpenFile" -ARG APP_VERSION -ENV APP_VERSION=${APP_VERSION:-latest} +ENV APP_VERSION=${APP_VERSION} + +# ----------------------------------------------------------------------------- +# TODO: Copy build artefacts from the builder stage +# COPY --from=builder /build/source/dist /app/code +# ----------------------------------------------------------------------------- -# Copy application source into image at build time -# Replace this with a multi-stage build if upstream provides Docker images. COPY ./app /app/code - -# Copy start script and make it executable COPY ./start.sh /app/pkg/start.sh -RUN chmod +x /app/pkg/start.sh +COPY ./test /app/pkg/test + +RUN chmod +x /app/pkg/start.sh /app/pkg/test/smoke.sh \ + && mkdir -p /app/data \ + && chown -R cloudron:cloudron /app -# Cloudron expects all processes to run as cloudron user USER cloudron WORKDIR /app/code diff --git a/apps/openfile/README.md b/apps/openfile/README.md index 6c50eaf..1fddd49 100644 --- a/apps/openfile/README.md +++ b/apps/openfile/README.md @@ -2,19 +2,19 @@ - **Upstream repository**: https://github.com/openfiletax/openfile.git - **Implementation issue**: https://projects.knownelement.com/issues/316 -- **Status**: Draft scaffolding generated on $(date -u +"%Y-%m-%dT%H:%M:%SZ") +- **Generated**: 2025-10-02T17:19:00Z UTC ## Packaging Checklist -1. Review upstream deployment requirements and map them to Cloudron services (database, cache, object storage, workers). -2. Update `Dockerfile` with the correct build steps and runtime dependencies. -3. Implement `start.sh` to configure the app from Cloudron-provided environment variables and launch the primary process. -4. Edit `CloudronManifest.json` with accurate metadata, permissions, ports, addons, and health checks. -5. Add integration and smoke tests under `test/` to validate the package. -6. Document manual configuration steps, migration requirements, and known gaps in this README. +1. Map upstream services (databases, caches, workers) to Cloudron addons; remove unused entries from `optionalAddons` and enable required ones under `addons`. +2. Implement the multi-stage build in `Dockerfile` to fetch/compile the correct release of OpenFile. +3. Update `start.sh` to configure the app from Cloudron environment variables and launch the primary process. +4. Replace the placeholder health checks and smoke test with real coverage. +5. Complete `CloudronManifest.json` (tagline, description, versioning, resource limits, ingress, TCP ports, etc.). +6. Document manual configuration steps, migrations, and known gaps below. ## Notes -- Replace the placeholder long-running process in `start.sh`. -- Populate the `app/` directory with the application build artefacts or git submodules. -- Use the shared packaging container (`docker/packager`) to run `cloudron build` and `cloudron install` so the host remains clean. +- Populate the `app/` directory with runtime overlays or artifacts generated during the build stage. +- Use the shared packaging container (`docker/packager`) for `cloudron build/install` to keep the host clean. +- Record decisions and operational requirements under `docs/apps/openfile/` as work progresses. diff --git a/apps/openfile/metadata.json b/apps/openfile/metadata.json index af408f7..1a72213 100644 --- a/apps/openfile/metadata.json +++ b/apps/openfile/metadata.json @@ -4,6 +4,6 @@ "issue": "https://projects.knownelement.com/issues/316", "repo": "https://github.com/openfiletax/openfile.git", "additionalRepos": [], - "created": "2025-10-02T16:46:49Z", + "created": "2025-10-02T17:19:00Z", "notes": "TODO: capture packaging notes" -} \ No newline at end of file +} diff --git a/apps/openfile/start.sh b/apps/openfile/start.sh index 238c8af..40c1497 100755 --- a/apps/openfile/start.sh +++ b/apps/openfile/start.sh @@ -1,8 +1,9 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Cloudron injects configuration via environment variables and files under /run -# Use this script to render config files and launch the upstream service. +# TODO: render configuration files from CLOUDRON_* environment variables +# Example: +# envsubst < /app/pkg/config.tmpl > /run/config.yaml -# TODO: Replace the command below with the correct process supervisor. -exec /bin/sh -c "echo 'Replace start.sh with application startup logic for OpenFile' && sleep infinity" +>&2 echo "start.sh for OpenFile is not implemented yet." +exit 1 diff --git a/apps/openfile/test/smoke.sh b/apps/openfile/test/smoke.sh index ebd1134..59049b6 100755 --- a/apps/openfile/test/smoke.sh +++ b/apps/openfile/test/smoke.sh @@ -1,16 +1,14 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Basic container reachability check executed inside the packaging container. -# Replace curl target with an endpoint exposed by the app once the package is functional. -cloudron_app_url=${CLOUDRON_APP_ORIGIN:-"http://localhost"} +cloudron_app_origin=${CLOUDRON_APP_ORIGIN:-http://localhost} -http_code=$(curl -s -o /tmp/smoke.log -w "%{http_code}" "${cloudron_app_url}") +http_code=$(curl --silent --show-error --output /tmp/smoke.log --write-out "%{http_code}" "${cloudron_app_origin}/") if [[ "${http_code}" != "200" ]]; then - echo "Unexpected HTTP status: ${http_code}" >&2 - cat /tmp/smoke.log >&2 + >&2 echo "Smoke test failed for OpenFile: expected HTTP 200 from ${cloudron_app_origin}/, got ${http_code}" + >&2 cat /tmp/smoke.log exit 1 fi -echo "Smoke test passed" +echo "Smoke test placeholder passed for OpenFile" diff --git a/apps/payroll-engine/CloudronManifest.json b/apps/payroll-engine/CloudronManifest.json index 6dc658f..e33ba86 100644 --- a/apps/payroll-engine/CloudronManifest.json +++ b/apps/payroll-engine/CloudronManifest.json @@ -12,9 +12,16 @@ "version": "0.1.0", "tags": ["custom", "known-element"], "healthCheckPath": "/", - "memoryLimit": 536870912, "httpPort": 3000, + "memoryLimit": "512M", "addons": { "localstorage": {} + }, + "optionalAddons": { + "postgresql": {}, + "redis": {}, + "mysql": {}, + "mongodb": {}, + "sendmail": {} } } diff --git a/apps/payroll-engine/Dockerfile b/apps/payroll-engine/Dockerfile index 7d29ef9..2122a44 100644 --- a/apps/payroll-engine/Dockerfile +++ b/apps/payroll-engine/Dockerfile @@ -1,21 +1,38 @@ -# syntax=docker/dockerfile:1 -FROM cloudron/base:5.0.0 +# syntax=docker/dockerfile:1.6 +ARG APP_VERSION=latest + +FROM cloudron/base:5.0.0 AS builder +WORKDIR /build + +# ----------------------------------------------------------------------------- +# TODO: Fetch and build Payroll Engine +# Example: +# RUN git clone --depth 1 --branch "${APP_VERSION}" https://github.com/Payroll-Engine/PayrollEngine.git source \ +# && cd source \ +# && npm ci \ +# && npm run build +# ----------------------------------------------------------------------------- + +FROM cloudron/base:5.0.0 LABEL org.opencontainers.image.source="https://github.com/Payroll-Engine/PayrollEngine.git" LABEL org.opencontainers.image.description="Cloudron package for Payroll Engine" -ARG APP_VERSION -ENV APP_VERSION=${APP_VERSION:-latest} +ENV APP_VERSION=${APP_VERSION} + +# ----------------------------------------------------------------------------- +# TODO: Copy build artefacts from the builder stage +# COPY --from=builder /build/source/dist /app/code +# ----------------------------------------------------------------------------- -# Copy application source into image at build time -# Replace this with a multi-stage build if upstream provides Docker images. COPY ./app /app/code - -# Copy start script and make it executable COPY ./start.sh /app/pkg/start.sh -RUN chmod +x /app/pkg/start.sh +COPY ./test /app/pkg/test + +RUN chmod +x /app/pkg/start.sh /app/pkg/test/smoke.sh \ + && mkdir -p /app/data \ + && chown -R cloudron:cloudron /app -# Cloudron expects all processes to run as cloudron user USER cloudron WORKDIR /app/code diff --git a/apps/payroll-engine/README.md b/apps/payroll-engine/README.md index 407e38a..c664c78 100644 --- a/apps/payroll-engine/README.md +++ b/apps/payroll-engine/README.md @@ -2,19 +2,19 @@ - **Upstream repository**: https://github.com/Payroll-Engine/PayrollEngine.git - **Implementation issue**: https://projects.knownelement.com/issues/208 -- **Status**: Draft scaffolding generated on $(date -u +"%Y-%m-%dT%H:%M:%SZ") +- **Generated**: 2025-10-02T17:19:00Z UTC ## Packaging Checklist -1. Review upstream deployment requirements and map them to Cloudron services (database, cache, object storage, workers). -2. Update `Dockerfile` with the correct build steps and runtime dependencies. -3. Implement `start.sh` to configure the app from Cloudron-provided environment variables and launch the primary process. -4. Edit `CloudronManifest.json` with accurate metadata, permissions, ports, addons, and health checks. -5. Add integration and smoke tests under `test/` to validate the package. -6. Document manual configuration steps, migration requirements, and known gaps in this README. +1. Map upstream services (databases, caches, workers) to Cloudron addons; remove unused entries from `optionalAddons` and enable required ones under `addons`. +2. Implement the multi-stage build in `Dockerfile` to fetch/compile the correct release of Payroll Engine. +3. Update `start.sh` to configure the app from Cloudron environment variables and launch the primary process. +4. Replace the placeholder health checks and smoke test with real coverage. +5. Complete `CloudronManifest.json` (tagline, description, versioning, resource limits, ingress, TCP ports, etc.). +6. Document manual configuration steps, migrations, and known gaps below. ## Notes -- Replace the placeholder long-running process in `start.sh`. -- Populate the `app/` directory with the application build artefacts or git submodules. -- Use the shared packaging container (`docker/packager`) to run `cloudron build` and `cloudron install` so the host remains clean. +- Populate the `app/` directory with runtime overlays or artifacts generated during the build stage. +- Use the shared packaging container (`docker/packager`) for `cloudron build/install` to keep the host clean. +- Record decisions and operational requirements under `docs/apps/payroll-engine/` as work progresses. diff --git a/apps/payroll-engine/metadata.json b/apps/payroll-engine/metadata.json index e82391a..c03d57b 100644 --- a/apps/payroll-engine/metadata.json +++ b/apps/payroll-engine/metadata.json @@ -4,6 +4,6 @@ "issue": "https://projects.knownelement.com/issues/208", "repo": "https://github.com/Payroll-Engine/PayrollEngine.git", "additionalRepos": [], - "created": "2025-10-02T16:46:49Z", + "created": "2025-10-02T17:19:00Z", "notes": "TODO: capture packaging notes" -} \ No newline at end of file +} diff --git a/apps/payroll-engine/start.sh b/apps/payroll-engine/start.sh index d257922..6f929c4 100755 --- a/apps/payroll-engine/start.sh +++ b/apps/payroll-engine/start.sh @@ -1,8 +1,9 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Cloudron injects configuration via environment variables and files under /run -# Use this script to render config files and launch the upstream service. +# TODO: render configuration files from CLOUDRON_* environment variables +# Example: +# envsubst < /app/pkg/config.tmpl > /run/config.yaml -# TODO: Replace the command below with the correct process supervisor. -exec /bin/sh -c "echo 'Replace start.sh with application startup logic for Payroll Engine' && sleep infinity" +>&2 echo "start.sh for Payroll Engine is not implemented yet." +exit 1 diff --git a/apps/payroll-engine/test/smoke.sh b/apps/payroll-engine/test/smoke.sh index ebd1134..b04b56f 100755 --- a/apps/payroll-engine/test/smoke.sh +++ b/apps/payroll-engine/test/smoke.sh @@ -1,16 +1,14 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Basic container reachability check executed inside the packaging container. -# Replace curl target with an endpoint exposed by the app once the package is functional. -cloudron_app_url=${CLOUDRON_APP_ORIGIN:-"http://localhost"} +cloudron_app_origin=${CLOUDRON_APP_ORIGIN:-http://localhost} -http_code=$(curl -s -o /tmp/smoke.log -w "%{http_code}" "${cloudron_app_url}") +http_code=$(curl --silent --show-error --output /tmp/smoke.log --write-out "%{http_code}" "${cloudron_app_origin}/") if [[ "${http_code}" != "200" ]]; then - echo "Unexpected HTTP status: ${http_code}" >&2 - cat /tmp/smoke.log >&2 + >&2 echo "Smoke test failed for Payroll Engine: expected HTTP 200 from ${cloudron_app_origin}/, got ${http_code}" + >&2 cat /tmp/smoke.log exit 1 fi -echo "Smoke test passed" +echo "Smoke test placeholder passed for Payroll Engine" diff --git a/apps/plmore/CloudronManifest.json b/apps/plmore/CloudronManifest.json index 23e00dd..d29cbad 100644 --- a/apps/plmore/CloudronManifest.json +++ b/apps/plmore/CloudronManifest.json @@ -12,9 +12,16 @@ "version": "0.1.0", "tags": ["custom", "known-element"], "healthCheckPath": "/", - "memoryLimit": 536870912, "httpPort": 3000, + "memoryLimit": "512M", "addons": { "localstorage": {} + }, + "optionalAddons": { + "postgresql": {}, + "redis": {}, + "mysql": {}, + "mongodb": {}, + "sendmail": {} } } diff --git a/apps/plmore/Dockerfile b/apps/plmore/Dockerfile index 5693c7c..204ff37 100644 --- a/apps/plmore/Dockerfile +++ b/apps/plmore/Dockerfile @@ -1,21 +1,38 @@ -# syntax=docker/dockerfile:1 -FROM cloudron/base:5.0.0 +# syntax=docker/dockerfile:1.6 +ARG APP_VERSION=latest + +FROM cloudron/base:5.0.0 AS builder +WORKDIR /build + +# ----------------------------------------------------------------------------- +# TODO: Fetch and build PLMore +# Example: +# RUN git clone --depth 1 --branch "${APP_VERSION}" https://github.com/PLMore/PLMore source \ +# && cd source \ +# && npm ci \ +# && npm run build +# ----------------------------------------------------------------------------- + +FROM cloudron/base:5.0.0 LABEL org.opencontainers.image.source="https://github.com/PLMore/PLMore" LABEL org.opencontainers.image.description="Cloudron package for PLMore" -ARG APP_VERSION -ENV APP_VERSION=${APP_VERSION:-latest} +ENV APP_VERSION=${APP_VERSION} + +# ----------------------------------------------------------------------------- +# TODO: Copy build artefacts from the builder stage +# COPY --from=builder /build/source/dist /app/code +# ----------------------------------------------------------------------------- -# Copy application source into image at build time -# Replace this with a multi-stage build if upstream provides Docker images. COPY ./app /app/code - -# Copy start script and make it executable COPY ./start.sh /app/pkg/start.sh -RUN chmod +x /app/pkg/start.sh +COPY ./test /app/pkg/test + +RUN chmod +x /app/pkg/start.sh /app/pkg/test/smoke.sh \ + && mkdir -p /app/data \ + && chown -R cloudron:cloudron /app -# Cloudron expects all processes to run as cloudron user USER cloudron WORKDIR /app/code diff --git a/apps/plmore/README.md b/apps/plmore/README.md index 0cd4293..4d0e731 100644 --- a/apps/plmore/README.md +++ b/apps/plmore/README.md @@ -2,19 +2,19 @@ - **Upstream repository**: https://github.com/PLMore/PLMore - **Implementation issue**: https://projects.knownelement.com/issues/279 -- **Status**: Draft scaffolding generated on $(date -u +"%Y-%m-%dT%H:%M:%SZ") +- **Generated**: 2025-10-02T17:19:01Z UTC ## Packaging Checklist -1. Review upstream deployment requirements and map them to Cloudron services (database, cache, object storage, workers). -2. Update `Dockerfile` with the correct build steps and runtime dependencies. -3. Implement `start.sh` to configure the app from Cloudron-provided environment variables and launch the primary process. -4. Edit `CloudronManifest.json` with accurate metadata, permissions, ports, addons, and health checks. -5. Add integration and smoke tests under `test/` to validate the package. -6. Document manual configuration steps, migration requirements, and known gaps in this README. +1. Map upstream services (databases, caches, workers) to Cloudron addons; remove unused entries from `optionalAddons` and enable required ones under `addons`. +2. Implement the multi-stage build in `Dockerfile` to fetch/compile the correct release of PLMore. +3. Update `start.sh` to configure the app from Cloudron environment variables and launch the primary process. +4. Replace the placeholder health checks and smoke test with real coverage. +5. Complete `CloudronManifest.json` (tagline, description, versioning, resource limits, ingress, TCP ports, etc.). +6. Document manual configuration steps, migrations, and known gaps below. ## Notes -- Replace the placeholder long-running process in `start.sh`. -- Populate the `app/` directory with the application build artefacts or git submodules. -- Use the shared packaging container (`docker/packager`) to run `cloudron build` and `cloudron install` so the host remains clean. +- Populate the `app/` directory with runtime overlays or artifacts generated during the build stage. +- Use the shared packaging container (`docker/packager`) for `cloudron build/install` to keep the host clean. +- Record decisions and operational requirements under `docs/apps/plmore/` as work progresses. diff --git a/apps/plmore/metadata.json b/apps/plmore/metadata.json index 7a9d9bc..cb3abdd 100644 --- a/apps/plmore/metadata.json +++ b/apps/plmore/metadata.json @@ -4,6 +4,6 @@ "issue": "https://projects.knownelement.com/issues/279", "repo": "https://github.com/PLMore/PLMore", "additionalRepos": [], - "created": "2025-10-02T16:46:49Z", + "created": "2025-10-02T17:19:01Z", "notes": "TODO: capture packaging notes" -} \ No newline at end of file +} diff --git a/apps/plmore/start.sh b/apps/plmore/start.sh index aaa1e5d..e4e39c6 100755 --- a/apps/plmore/start.sh +++ b/apps/plmore/start.sh @@ -1,8 +1,9 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Cloudron injects configuration via environment variables and files under /run -# Use this script to render config files and launch the upstream service. +# TODO: render configuration files from CLOUDRON_* environment variables +# Example: +# envsubst < /app/pkg/config.tmpl > /run/config.yaml -# TODO: Replace the command below with the correct process supervisor. -exec /bin/sh -c "echo 'Replace start.sh with application startup logic for PLMore' && sleep infinity" +>&2 echo "start.sh for PLMore is not implemented yet." +exit 1 diff --git a/apps/plmore/test/smoke.sh b/apps/plmore/test/smoke.sh index ebd1134..e3eab97 100755 --- a/apps/plmore/test/smoke.sh +++ b/apps/plmore/test/smoke.sh @@ -1,16 +1,14 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Basic container reachability check executed inside the packaging container. -# Replace curl target with an endpoint exposed by the app once the package is functional. -cloudron_app_url=${CLOUDRON_APP_ORIGIN:-"http://localhost"} +cloudron_app_origin=${CLOUDRON_APP_ORIGIN:-http://localhost} -http_code=$(curl -s -o /tmp/smoke.log -w "%{http_code}" "${cloudron_app_url}") +http_code=$(curl --silent --show-error --output /tmp/smoke.log --write-out "%{http_code}" "${cloudron_app_origin}/") if [[ "${http_code}" != "200" ]]; then - echo "Unexpected HTTP status: ${http_code}" >&2 - cat /tmp/smoke.log >&2 + >&2 echo "Smoke test failed for PLMore: expected HTTP 200 from ${cloudron_app_origin}/, got ${http_code}" + >&2 cat /tmp/smoke.log exit 1 fi -echo "Smoke test passed" +echo "Smoke test placeholder passed for PLMore" diff --git a/apps/puter/CloudronManifest.json b/apps/puter/CloudronManifest.json index 560a814..e61395e 100644 --- a/apps/puter/CloudronManifest.json +++ b/apps/puter/CloudronManifest.json @@ -12,9 +12,16 @@ "version": "0.1.0", "tags": ["custom", "known-element"], "healthCheckPath": "/", - "memoryLimit": 536870912, "httpPort": 3000, + "memoryLimit": "512M", "addons": { "localstorage": {} + }, + "optionalAddons": { + "postgresql": {}, + "redis": {}, + "mysql": {}, + "mongodb": {}, + "sendmail": {} } } diff --git a/apps/puter/Dockerfile b/apps/puter/Dockerfile index 7b9868c..801e073 100644 --- a/apps/puter/Dockerfile +++ b/apps/puter/Dockerfile @@ -1,21 +1,38 @@ -# syntax=docker/dockerfile:1 -FROM cloudron/base:5.0.0 +# syntax=docker/dockerfile:1.6 +ARG APP_VERSION=latest + +FROM cloudron/base:5.0.0 AS builder +WORKDIR /build + +# ----------------------------------------------------------------------------- +# TODO: Fetch and build Puter +# Example: +# RUN git clone --depth 1 --branch "${APP_VERSION}" https://github.com/HeyPuter/puter.git source \ +# && cd source \ +# && npm ci \ +# && npm run build +# ----------------------------------------------------------------------------- + +FROM cloudron/base:5.0.0 LABEL org.opencontainers.image.source="https://github.com/HeyPuter/puter.git" LABEL org.opencontainers.image.description="Cloudron package for Puter" -ARG APP_VERSION -ENV APP_VERSION=${APP_VERSION:-latest} +ENV APP_VERSION=${APP_VERSION} + +# ----------------------------------------------------------------------------- +# TODO: Copy build artefacts from the builder stage +# COPY --from=builder /build/source/dist /app/code +# ----------------------------------------------------------------------------- -# Copy application source into image at build time -# Replace this with a multi-stage build if upstream provides Docker images. COPY ./app /app/code - -# Copy start script and make it executable COPY ./start.sh /app/pkg/start.sh -RUN chmod +x /app/pkg/start.sh +COPY ./test /app/pkg/test + +RUN chmod +x /app/pkg/start.sh /app/pkg/test/smoke.sh \ + && mkdir -p /app/data \ + && chown -R cloudron:cloudron /app -# Cloudron expects all processes to run as cloudron user USER cloudron WORKDIR /app/code diff --git a/apps/puter/README.md b/apps/puter/README.md index 812a572..8bb7e8b 100644 --- a/apps/puter/README.md +++ b/apps/puter/README.md @@ -2,19 +2,19 @@ - **Upstream repository**: https://github.com/HeyPuter/puter.git - **Implementation issue**: https://projects.knownelement.com/issues/286 -- **Status**: Draft scaffolding generated on $(date -u +"%Y-%m-%dT%H:%M:%SZ") +- **Generated**: 2025-10-02T17:19:01Z UTC ## Packaging Checklist -1. Review upstream deployment requirements and map them to Cloudron services (database, cache, object storage, workers). -2. Update `Dockerfile` with the correct build steps and runtime dependencies. -3. Implement `start.sh` to configure the app from Cloudron-provided environment variables and launch the primary process. -4. Edit `CloudronManifest.json` with accurate metadata, permissions, ports, addons, and health checks. -5. Add integration and smoke tests under `test/` to validate the package. -6. Document manual configuration steps, migration requirements, and known gaps in this README. +1. Map upstream services (databases, caches, workers) to Cloudron addons; remove unused entries from `optionalAddons` and enable required ones under `addons`. +2. Implement the multi-stage build in `Dockerfile` to fetch/compile the correct release of Puter. +3. Update `start.sh` to configure the app from Cloudron environment variables and launch the primary process. +4. Replace the placeholder health checks and smoke test with real coverage. +5. Complete `CloudronManifest.json` (tagline, description, versioning, resource limits, ingress, TCP ports, etc.). +6. Document manual configuration steps, migrations, and known gaps below. ## Notes -- Replace the placeholder long-running process in `start.sh`. -- Populate the `app/` directory with the application build artefacts or git submodules. -- Use the shared packaging container (`docker/packager`) to run `cloudron build` and `cloudron install` so the host remains clean. +- Populate the `app/` directory with runtime overlays or artifacts generated during the build stage. +- Use the shared packaging container (`docker/packager`) for `cloudron build/install` to keep the host clean. +- Record decisions and operational requirements under `docs/apps/puter/` as work progresses. diff --git a/apps/puter/metadata.json b/apps/puter/metadata.json index 828a6b7..3516583 100644 --- a/apps/puter/metadata.json +++ b/apps/puter/metadata.json @@ -4,6 +4,6 @@ "issue": "https://projects.knownelement.com/issues/286", "repo": "https://github.com/HeyPuter/puter.git", "additionalRepos": [], - "created": "2025-10-02T16:46:49Z", + "created": "2025-10-02T17:19:01Z", "notes": "TODO: capture packaging notes" -} \ No newline at end of file +} diff --git a/apps/puter/start.sh b/apps/puter/start.sh index b719ec9..6389109 100755 --- a/apps/puter/start.sh +++ b/apps/puter/start.sh @@ -1,8 +1,9 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Cloudron injects configuration via environment variables and files under /run -# Use this script to render config files and launch the upstream service. +# TODO: render configuration files from CLOUDRON_* environment variables +# Example: +# envsubst < /app/pkg/config.tmpl > /run/config.yaml -# TODO: Replace the command below with the correct process supervisor. -exec /bin/sh -c "echo 'Replace start.sh with application startup logic for Puter' && sleep infinity" +>&2 echo "start.sh for Puter is not implemented yet." +exit 1 diff --git a/apps/puter/test/smoke.sh b/apps/puter/test/smoke.sh index ebd1134..c11e65d 100755 --- a/apps/puter/test/smoke.sh +++ b/apps/puter/test/smoke.sh @@ -1,16 +1,14 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Basic container reachability check executed inside the packaging container. -# Replace curl target with an endpoint exposed by the app once the package is functional. -cloudron_app_url=${CLOUDRON_APP_ORIGIN:-"http://localhost"} +cloudron_app_origin=${CLOUDRON_APP_ORIGIN:-http://localhost} -http_code=$(curl -s -o /tmp/smoke.log -w "%{http_code}" "${cloudron_app_url}") +http_code=$(curl --silent --show-error --output /tmp/smoke.log --write-out "%{http_code}" "${cloudron_app_origin}/") if [[ "${http_code}" != "200" ]]; then - echo "Unexpected HTTP status: ${http_code}" >&2 - cat /tmp/smoke.log >&2 + >&2 echo "Smoke test failed for Puter: expected HTTP 200 from ${cloudron_app_origin}/, got ${http_code}" + >&2 cat /tmp/smoke.log exit 1 fi -echo "Smoke test passed" +echo "Smoke test placeholder passed for Puter" diff --git a/apps/rathole/CloudronManifest.json b/apps/rathole/CloudronManifest.json index a016221..b1759a6 100644 --- a/apps/rathole/CloudronManifest.json +++ b/apps/rathole/CloudronManifest.json @@ -12,9 +12,16 @@ "version": "0.1.0", "tags": ["custom", "known-element"], "healthCheckPath": "/", - "memoryLimit": 536870912, "httpPort": 3000, + "memoryLimit": "512M", "addons": { "localstorage": {} + }, + "optionalAddons": { + "postgresql": {}, + "redis": {}, + "mysql": {}, + "mongodb": {}, + "sendmail": {} } } diff --git a/apps/rathole/Dockerfile b/apps/rathole/Dockerfile index 09c8478..62aaeb7 100644 --- a/apps/rathole/Dockerfile +++ b/apps/rathole/Dockerfile @@ -1,21 +1,38 @@ -# syntax=docker/dockerfile:1 -FROM cloudron/base:5.0.0 +# syntax=docker/dockerfile:1.6 +ARG APP_VERSION=latest + +FROM cloudron/base:5.0.0 AS builder +WORKDIR /build + +# ----------------------------------------------------------------------------- +# TODO: Fetch and build rathole +# Example: +# RUN git clone --depth 1 --branch "${APP_VERSION}" https://github.com/rathole-org/rathole.git source \ +# && cd source \ +# && npm ci \ +# && npm run build +# ----------------------------------------------------------------------------- + +FROM cloudron/base:5.0.0 LABEL org.opencontainers.image.source="https://github.com/rathole-org/rathole.git" LABEL org.opencontainers.image.description="Cloudron package for rathole" -ARG APP_VERSION -ENV APP_VERSION=${APP_VERSION:-latest} +ENV APP_VERSION=${APP_VERSION} + +# ----------------------------------------------------------------------------- +# TODO: Copy build artefacts from the builder stage +# COPY --from=builder /build/source/dist /app/code +# ----------------------------------------------------------------------------- -# Copy application source into image at build time -# Replace this with a multi-stage build if upstream provides Docker images. COPY ./app /app/code - -# Copy start script and make it executable COPY ./start.sh /app/pkg/start.sh -RUN chmod +x /app/pkg/start.sh +COPY ./test /app/pkg/test + +RUN chmod +x /app/pkg/start.sh /app/pkg/test/smoke.sh \ + && mkdir -p /app/data \ + && chown -R cloudron:cloudron /app -# Cloudron expects all processes to run as cloudron user USER cloudron WORKDIR /app/code diff --git a/apps/rathole/README.md b/apps/rathole/README.md index 98fef3d..0e638ae 100644 --- a/apps/rathole/README.md +++ b/apps/rathole/README.md @@ -2,19 +2,19 @@ - **Upstream repository**: https://github.com/rathole-org/rathole.git - **Implementation issue**: https://projects.knownelement.com/issues/225 -- **Status**: Draft scaffolding generated on $(date -u +"%Y-%m-%dT%H:%M:%SZ") +- **Generated**: 2025-10-02T17:19:00Z UTC ## Packaging Checklist -1. Review upstream deployment requirements and map them to Cloudron services (database, cache, object storage, workers). -2. Update `Dockerfile` with the correct build steps and runtime dependencies. -3. Implement `start.sh` to configure the app from Cloudron-provided environment variables and launch the primary process. -4. Edit `CloudronManifest.json` with accurate metadata, permissions, ports, addons, and health checks. -5. Add integration and smoke tests under `test/` to validate the package. -6. Document manual configuration steps, migration requirements, and known gaps in this README. +1. Map upstream services (databases, caches, workers) to Cloudron addons; remove unused entries from `optionalAddons` and enable required ones under `addons`. +2. Implement the multi-stage build in `Dockerfile` to fetch/compile the correct release of rathole. +3. Update `start.sh` to configure the app from Cloudron environment variables and launch the primary process. +4. Replace the placeholder health checks and smoke test with real coverage. +5. Complete `CloudronManifest.json` (tagline, description, versioning, resource limits, ingress, TCP ports, etc.). +6. Document manual configuration steps, migrations, and known gaps below. ## Notes -- Replace the placeholder long-running process in `start.sh`. -- Populate the `app/` directory with the application build artefacts or git submodules. -- Use the shared packaging container (`docker/packager`) to run `cloudron build` and `cloudron install` so the host remains clean. +- Populate the `app/` directory with runtime overlays or artifacts generated during the build stage. +- Use the shared packaging container (`docker/packager`) for `cloudron build/install` to keep the host clean. +- Record decisions and operational requirements under `docs/apps/rathole/` as work progresses. diff --git a/apps/rathole/metadata.json b/apps/rathole/metadata.json index f7df99f..3c94d53 100644 --- a/apps/rathole/metadata.json +++ b/apps/rathole/metadata.json @@ -4,6 +4,6 @@ "issue": "https://projects.knownelement.com/issues/225", "repo": "https://github.com/rathole-org/rathole.git", "additionalRepos": [], - "created": "2025-10-02T16:46:49Z", + "created": "2025-10-02T17:19:00Z", "notes": "TODO: capture packaging notes" -} \ No newline at end of file +} diff --git a/apps/rathole/start.sh b/apps/rathole/start.sh index 3af1a8f..ed004e6 100755 --- a/apps/rathole/start.sh +++ b/apps/rathole/start.sh @@ -1,8 +1,9 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Cloudron injects configuration via environment variables and files under /run -# Use this script to render config files and launch the upstream service. +# TODO: render configuration files from CLOUDRON_* environment variables +# Example: +# envsubst < /app/pkg/config.tmpl > /run/config.yaml -# TODO: Replace the command below with the correct process supervisor. -exec /bin/sh -c "echo 'Replace start.sh with application startup logic for rathole' && sleep infinity" +>&2 echo "start.sh for rathole is not implemented yet." +exit 1 diff --git a/apps/rathole/test/smoke.sh b/apps/rathole/test/smoke.sh index ebd1134..d1ccffd 100755 --- a/apps/rathole/test/smoke.sh +++ b/apps/rathole/test/smoke.sh @@ -1,16 +1,14 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Basic container reachability check executed inside the packaging container. -# Replace curl target with an endpoint exposed by the app once the package is functional. -cloudron_app_url=${CLOUDRON_APP_ORIGIN:-"http://localhost"} +cloudron_app_origin=${CLOUDRON_APP_ORIGIN:-http://localhost} -http_code=$(curl -s -o /tmp/smoke.log -w "%{http_code}" "${cloudron_app_url}") +http_code=$(curl --silent --show-error --output /tmp/smoke.log --write-out "%{http_code}" "${cloudron_app_origin}/") if [[ "${http_code}" != "200" ]]; then - echo "Unexpected HTTP status: ${http_code}" >&2 - cat /tmp/smoke.log >&2 + >&2 echo "Smoke test failed for rathole: expected HTTP 200 from ${cloudron_app_origin}/, got ${http_code}" + >&2 cat /tmp/smoke.log exit 1 fi -echo "Smoke test passed" +echo "Smoke test placeholder passed for rathole" diff --git a/apps/resgrid/CloudronManifest.json b/apps/resgrid/CloudronManifest.json index d23c7dd..b8778be 100644 --- a/apps/resgrid/CloudronManifest.json +++ b/apps/resgrid/CloudronManifest.json @@ -12,9 +12,16 @@ "version": "0.1.0", "tags": ["custom", "known-element"], "healthCheckPath": "/", - "memoryLimit": 536870912, "httpPort": 3000, + "memoryLimit": "512M", "addons": { "localstorage": {} + }, + "optionalAddons": { + "postgresql": {}, + "redis": {}, + "mysql": {}, + "mongodb": {}, + "sendmail": {} } } diff --git a/apps/resgrid/Dockerfile b/apps/resgrid/Dockerfile index bf8422a..35bd77d 100644 --- a/apps/resgrid/Dockerfile +++ b/apps/resgrid/Dockerfile @@ -1,21 +1,38 @@ -# syntax=docker/dockerfile:1 -FROM cloudron/base:5.0.0 +# syntax=docker/dockerfile:1.6 +ARG APP_VERSION=latest + +FROM cloudron/base:5.0.0 AS builder +WORKDIR /build + +# ----------------------------------------------------------------------------- +# TODO: Fetch and build Resgrid Core +# Example: +# RUN git clone --depth 1 --branch "${APP_VERSION}" https://github.com/Resgrid/Core source \ +# && cd source \ +# && npm ci \ +# && npm run build +# ----------------------------------------------------------------------------- + +FROM cloudron/base:5.0.0 LABEL org.opencontainers.image.source="https://github.com/Resgrid/Core" LABEL org.opencontainers.image.description="Cloudron package for Resgrid Core" -ARG APP_VERSION -ENV APP_VERSION=${APP_VERSION:-latest} +ENV APP_VERSION=${APP_VERSION} + +# ----------------------------------------------------------------------------- +# TODO: Copy build artefacts from the builder stage +# COPY --from=builder /build/source/dist /app/code +# ----------------------------------------------------------------------------- -# Copy application source into image at build time -# Replace this with a multi-stage build if upstream provides Docker images. COPY ./app /app/code - -# Copy start script and make it executable COPY ./start.sh /app/pkg/start.sh -RUN chmod +x /app/pkg/start.sh +COPY ./test /app/pkg/test + +RUN chmod +x /app/pkg/start.sh /app/pkg/test/smoke.sh \ + && mkdir -p /app/data \ + && chown -R cloudron:cloudron /app -# Cloudron expects all processes to run as cloudron user USER cloudron WORKDIR /app/code diff --git a/apps/resgrid/README.md b/apps/resgrid/README.md index 012af0e..13419cc 100644 --- a/apps/resgrid/README.md +++ b/apps/resgrid/README.md @@ -2,19 +2,19 @@ - **Upstream repository**: https://github.com/Resgrid/Core - **Implementation issue**: https://projects.knownelement.com/issues/214 -- **Status**: Draft scaffolding generated on $(date -u +"%Y-%m-%dT%H:%M:%SZ") +- **Generated**: 2025-10-02T17:19:00Z UTC ## Packaging Checklist -1. Review upstream deployment requirements and map them to Cloudron services (database, cache, object storage, workers). -2. Update `Dockerfile` with the correct build steps and runtime dependencies. -3. Implement `start.sh` to configure the app from Cloudron-provided environment variables and launch the primary process. -4. Edit `CloudronManifest.json` with accurate metadata, permissions, ports, addons, and health checks. -5. Add integration and smoke tests under `test/` to validate the package. -6. Document manual configuration steps, migration requirements, and known gaps in this README. +1. Map upstream services (databases, caches, workers) to Cloudron addons; remove unused entries from `optionalAddons` and enable required ones under `addons`. +2. Implement the multi-stage build in `Dockerfile` to fetch/compile the correct release of Resgrid Core. +3. Update `start.sh` to configure the app from Cloudron environment variables and launch the primary process. +4. Replace the placeholder health checks and smoke test with real coverage. +5. Complete `CloudronManifest.json` (tagline, description, versioning, resource limits, ingress, TCP ports, etc.). +6. Document manual configuration steps, migrations, and known gaps below. ## Notes -- Replace the placeholder long-running process in `start.sh`. -- Populate the `app/` directory with the application build artefacts or git submodules. -- Use the shared packaging container (`docker/packager`) to run `cloudron build` and `cloudron install` so the host remains clean. +- Populate the `app/` directory with runtime overlays or artifacts generated during the build stage. +- Use the shared packaging container (`docker/packager`) for `cloudron build/install` to keep the host clean. +- Record decisions and operational requirements under `docs/apps/resgrid/` as work progresses. diff --git a/apps/resgrid/metadata.json b/apps/resgrid/metadata.json index 9989dc7..01dbf74 100644 --- a/apps/resgrid/metadata.json +++ b/apps/resgrid/metadata.json @@ -4,6 +4,6 @@ "issue": "https://projects.knownelement.com/issues/214", "repo": "https://github.com/Resgrid/Core", "additionalRepos": [], - "created": "2025-10-02T16:46:49Z", + "created": "2025-10-02T17:19:00Z", "notes": "TODO: capture packaging notes" -} \ No newline at end of file +} diff --git a/apps/resgrid/start.sh b/apps/resgrid/start.sh index a36f73e..044f1bb 100755 --- a/apps/resgrid/start.sh +++ b/apps/resgrid/start.sh @@ -1,8 +1,9 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Cloudron injects configuration via environment variables and files under /run -# Use this script to render config files and launch the upstream service. +# TODO: render configuration files from CLOUDRON_* environment variables +# Example: +# envsubst < /app/pkg/config.tmpl > /run/config.yaml -# TODO: Replace the command below with the correct process supervisor. -exec /bin/sh -c "echo 'Replace start.sh with application startup logic for Resgrid Core' && sleep infinity" +>&2 echo "start.sh for Resgrid Core is not implemented yet." +exit 1 diff --git a/apps/resgrid/test/smoke.sh b/apps/resgrid/test/smoke.sh index ebd1134..edfd049 100755 --- a/apps/resgrid/test/smoke.sh +++ b/apps/resgrid/test/smoke.sh @@ -1,16 +1,14 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Basic container reachability check executed inside the packaging container. -# Replace curl target with an endpoint exposed by the app once the package is functional. -cloudron_app_url=${CLOUDRON_APP_ORIGIN:-"http://localhost"} +cloudron_app_origin=${CLOUDRON_APP_ORIGIN:-http://localhost} -http_code=$(curl -s -o /tmp/smoke.log -w "%{http_code}" "${cloudron_app_url}") +http_code=$(curl --silent --show-error --output /tmp/smoke.log --write-out "%{http_code}" "${cloudron_app_origin}/") if [[ "${http_code}" != "200" ]]; then - echo "Unexpected HTTP status: ${http_code}" >&2 - cat /tmp/smoke.log >&2 + >&2 echo "Smoke test failed for Resgrid Core: expected HTTP 200 from ${cloudron_app_origin}/, got ${http_code}" + >&2 cat /tmp/smoke.log exit 1 fi -echo "Smoke test passed" +echo "Smoke test placeholder passed for Resgrid Core" diff --git a/apps/reviewboard/CloudronManifest.json b/apps/reviewboard/CloudronManifest.json index 543c961..dc626ac 100644 --- a/apps/reviewboard/CloudronManifest.json +++ b/apps/reviewboard/CloudronManifest.json @@ -12,9 +12,16 @@ "version": "0.1.0", "tags": ["custom", "known-element"], "healthCheckPath": "/", - "memoryLimit": 536870912, "httpPort": 3000, + "memoryLimit": "512M", "addons": { "localstorage": {} + }, + "optionalAddons": { + "postgresql": {}, + "redis": {}, + "mysql": {}, + "mongodb": {}, + "sendmail": {} } } diff --git a/apps/reviewboard/Dockerfile b/apps/reviewboard/Dockerfile index db4a987..c4f7a97 100644 --- a/apps/reviewboard/Dockerfile +++ b/apps/reviewboard/Dockerfile @@ -1,21 +1,38 @@ -# syntax=docker/dockerfile:1 -FROM cloudron/base:5.0.0 +# syntax=docker/dockerfile:1.6 +ARG APP_VERSION=latest + +FROM cloudron/base:5.0.0 AS builder +WORKDIR /build + +# ----------------------------------------------------------------------------- +# TODO: Fetch and build Review Board +# Example: +# RUN git clone --depth 1 --branch "${APP_VERSION}" https://github.com/reviewboard/reviewboard.git source \ +# && cd source \ +# && npm ci \ +# && npm run build +# ----------------------------------------------------------------------------- + +FROM cloudron/base:5.0.0 LABEL org.opencontainers.image.source="https://github.com/reviewboard/reviewboard.git" LABEL org.opencontainers.image.description="Cloudron package for Review Board" -ARG APP_VERSION -ENV APP_VERSION=${APP_VERSION:-latest} +ENV APP_VERSION=${APP_VERSION} + +# ----------------------------------------------------------------------------- +# TODO: Copy build artefacts from the builder stage +# COPY --from=builder /build/source/dist /app/code +# ----------------------------------------------------------------------------- -# Copy application source into image at build time -# Replace this with a multi-stage build if upstream provides Docker images. COPY ./app /app/code - -# Copy start script and make it executable COPY ./start.sh /app/pkg/start.sh -RUN chmod +x /app/pkg/start.sh +COPY ./test /app/pkg/test + +RUN chmod +x /app/pkg/start.sh /app/pkg/test/smoke.sh \ + && mkdir -p /app/data \ + && chown -R cloudron:cloudron /app -# Cloudron expects all processes to run as cloudron user USER cloudron WORKDIR /app/code diff --git a/apps/reviewboard/README.md b/apps/reviewboard/README.md index b1c1a20..71a4a50 100644 --- a/apps/reviewboard/README.md +++ b/apps/reviewboard/README.md @@ -2,19 +2,19 @@ - **Upstream repository**: https://github.com/reviewboard/reviewboard.git - **Implementation issue**: https://projects.knownelement.com/issues/216 -- **Status**: Draft scaffolding generated on $(date -u +"%Y-%m-%dT%H:%M:%SZ") +- **Generated**: 2025-10-02T17:19:01Z UTC ## Packaging Checklist -1. Review upstream deployment requirements and map them to Cloudron services (database, cache, object storage, workers). -2. Update `Dockerfile` with the correct build steps and runtime dependencies. -3. Implement `start.sh` to configure the app from Cloudron-provided environment variables and launch the primary process. -4. Edit `CloudronManifest.json` with accurate metadata, permissions, ports, addons, and health checks. -5. Add integration and smoke tests under `test/` to validate the package. -6. Document manual configuration steps, migration requirements, and known gaps in this README. +1. Map upstream services (databases, caches, workers) to Cloudron addons; remove unused entries from `optionalAddons` and enable required ones under `addons`. +2. Implement the multi-stage build in `Dockerfile` to fetch/compile the correct release of Review Board. +3. Update `start.sh` to configure the app from Cloudron environment variables and launch the primary process. +4. Replace the placeholder health checks and smoke test with real coverage. +5. Complete `CloudronManifest.json` (tagline, description, versioning, resource limits, ingress, TCP ports, etc.). +6. Document manual configuration steps, migrations, and known gaps below. ## Notes -- Replace the placeholder long-running process in `start.sh`. -- Populate the `app/` directory with the application build artefacts or git submodules. -- Use the shared packaging container (`docker/packager`) to run `cloudron build` and `cloudron install` so the host remains clean. +- Populate the `app/` directory with runtime overlays or artifacts generated during the build stage. +- Use the shared packaging container (`docker/packager`) for `cloudron build/install` to keep the host clean. +- Record decisions and operational requirements under `docs/apps/reviewboard/` as work progresses. diff --git a/apps/reviewboard/metadata.json b/apps/reviewboard/metadata.json index cc3d215..0472b85 100644 --- a/apps/reviewboard/metadata.json +++ b/apps/reviewboard/metadata.json @@ -4,6 +4,6 @@ "issue": "https://projects.knownelement.com/issues/216", "repo": "https://github.com/reviewboard/reviewboard.git", "additionalRepos": [], - "created": "2025-10-02T16:46:49Z", + "created": "2025-10-02T17:19:01Z", "notes": "TODO: capture packaging notes" -} \ No newline at end of file +} diff --git a/apps/reviewboard/start.sh b/apps/reviewboard/start.sh index c440b67..b1a6b04 100755 --- a/apps/reviewboard/start.sh +++ b/apps/reviewboard/start.sh @@ -1,8 +1,9 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Cloudron injects configuration via environment variables and files under /run -# Use this script to render config files and launch the upstream service. +# TODO: render configuration files from CLOUDRON_* environment variables +# Example: +# envsubst < /app/pkg/config.tmpl > /run/config.yaml -# TODO: Replace the command below with the correct process supervisor. -exec /bin/sh -c "echo 'Replace start.sh with application startup logic for Review Board' && sleep infinity" +>&2 echo "start.sh for Review Board is not implemented yet." +exit 1 diff --git a/apps/reviewboard/test/smoke.sh b/apps/reviewboard/test/smoke.sh index ebd1134..717dd4d 100755 --- a/apps/reviewboard/test/smoke.sh +++ b/apps/reviewboard/test/smoke.sh @@ -1,16 +1,14 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Basic container reachability check executed inside the packaging container. -# Replace curl target with an endpoint exposed by the app once the package is functional. -cloudron_app_url=${CLOUDRON_APP_ORIGIN:-"http://localhost"} +cloudron_app_origin=${CLOUDRON_APP_ORIGIN:-http://localhost} -http_code=$(curl -s -o /tmp/smoke.log -w "%{http_code}" "${cloudron_app_url}") +http_code=$(curl --silent --show-error --output /tmp/smoke.log --write-out "%{http_code}" "${cloudron_app_origin}/") if [[ "${http_code}" != "200" ]]; then - echo "Unexpected HTTP status: ${http_code}" >&2 - cat /tmp/smoke.log >&2 + >&2 echo "Smoke test failed for Review Board: expected HTTP 200 from ${cloudron_app_origin}/, got ${http_code}" + >&2 cat /tmp/smoke.log exit 1 fi -echo "Smoke test passed" +echo "Smoke test placeholder passed for Review Board" diff --git a/apps/rundeck/CloudronManifest.json b/apps/rundeck/CloudronManifest.json index 49e18b0..d9d268f 100644 --- a/apps/rundeck/CloudronManifest.json +++ b/apps/rundeck/CloudronManifest.json @@ -12,9 +12,16 @@ "version": "0.1.0", "tags": ["custom", "known-element"], "healthCheckPath": "/", - "memoryLimit": 536870912, "httpPort": 3000, + "memoryLimit": "512M", "addons": { "localstorage": {} + }, + "optionalAddons": { + "postgresql": {}, + "redis": {}, + "mysql": {}, + "mongodb": {}, + "sendmail": {} } } diff --git a/apps/rundeck/Dockerfile b/apps/rundeck/Dockerfile index 29f7210..78ad7f6 100644 --- a/apps/rundeck/Dockerfile +++ b/apps/rundeck/Dockerfile @@ -1,21 +1,38 @@ -# syntax=docker/dockerfile:1 -FROM cloudron/base:5.0.0 +# syntax=docker/dockerfile:1.6 +ARG APP_VERSION=latest + +FROM cloudron/base:5.0.0 AS builder +WORKDIR /build + +# ----------------------------------------------------------------------------- +# TODO: Fetch and build Rundeck +# Example: +# RUN git clone --depth 1 --branch "${APP_VERSION}" https://github.com/rundeck/rundeck.git source \ +# && cd source \ +# && npm ci \ +# && npm run build +# ----------------------------------------------------------------------------- + +FROM cloudron/base:5.0.0 LABEL org.opencontainers.image.source="https://github.com/rundeck/rundeck.git" LABEL org.opencontainers.image.description="Cloudron package for Rundeck" -ARG APP_VERSION -ENV APP_VERSION=${APP_VERSION:-latest} +ENV APP_VERSION=${APP_VERSION} + +# ----------------------------------------------------------------------------- +# TODO: Copy build artefacts from the builder stage +# COPY --from=builder /build/source/dist /app/code +# ----------------------------------------------------------------------------- -# Copy application source into image at build time -# Replace this with a multi-stage build if upstream provides Docker images. COPY ./app /app/code - -# Copy start script and make it executable COPY ./start.sh /app/pkg/start.sh -RUN chmod +x /app/pkg/start.sh +COPY ./test /app/pkg/test + +RUN chmod +x /app/pkg/start.sh /app/pkg/test/smoke.sh \ + && mkdir -p /app/data \ + && chown -R cloudron:cloudron /app -# Cloudron expects all processes to run as cloudron user USER cloudron WORKDIR /app/code diff --git a/apps/rundeck/README.md b/apps/rundeck/README.md index 412ccc0..efc5838 100644 --- a/apps/rundeck/README.md +++ b/apps/rundeck/README.md @@ -2,19 +2,19 @@ - **Upstream repository**: https://github.com/rundeck/rundeck.git - **Implementation issue**: https://projects.knownelement.com/issues/217 -- **Status**: Draft scaffolding generated on $(date -u +"%Y-%m-%dT%H:%M:%SZ") +- **Generated**: 2025-10-02T17:19:00Z UTC ## Packaging Checklist -1. Review upstream deployment requirements and map them to Cloudron services (database, cache, object storage, workers). -2. Update `Dockerfile` with the correct build steps and runtime dependencies. -3. Implement `start.sh` to configure the app from Cloudron-provided environment variables and launch the primary process. -4. Edit `CloudronManifest.json` with accurate metadata, permissions, ports, addons, and health checks. -5. Add integration and smoke tests under `test/` to validate the package. -6. Document manual configuration steps, migration requirements, and known gaps in this README. +1. Map upstream services (databases, caches, workers) to Cloudron addons; remove unused entries from `optionalAddons` and enable required ones under `addons`. +2. Implement the multi-stage build in `Dockerfile` to fetch/compile the correct release of Rundeck. +3. Update `start.sh` to configure the app from Cloudron environment variables and launch the primary process. +4. Replace the placeholder health checks and smoke test with real coverage. +5. Complete `CloudronManifest.json` (tagline, description, versioning, resource limits, ingress, TCP ports, etc.). +6. Document manual configuration steps, migrations, and known gaps below. ## Notes -- Replace the placeholder long-running process in `start.sh`. -- Populate the `app/` directory with the application build artefacts or git submodules. -- Use the shared packaging container (`docker/packager`) to run `cloudron build` and `cloudron install` so the host remains clean. +- Populate the `app/` directory with runtime overlays or artifacts generated during the build stage. +- Use the shared packaging container (`docker/packager`) for `cloudron build/install` to keep the host clean. +- Record decisions and operational requirements under `docs/apps/rundeck/` as work progresses. diff --git a/apps/rundeck/metadata.json b/apps/rundeck/metadata.json index 38532ae..0fc69fb 100644 --- a/apps/rundeck/metadata.json +++ b/apps/rundeck/metadata.json @@ -4,6 +4,6 @@ "issue": "https://projects.knownelement.com/issues/217", "repo": "https://github.com/rundeck/rundeck.git", "additionalRepos": [], - "created": "2025-10-02T16:46:49Z", + "created": "2025-10-02T17:19:00Z", "notes": "TODO: capture packaging notes" -} \ No newline at end of file +} diff --git a/apps/rundeck/start.sh b/apps/rundeck/start.sh index 6a0fb24..f2832ed 100755 --- a/apps/rundeck/start.sh +++ b/apps/rundeck/start.sh @@ -1,8 +1,9 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Cloudron injects configuration via environment variables and files under /run -# Use this script to render config files and launch the upstream service. +# TODO: render configuration files from CLOUDRON_* environment variables +# Example: +# envsubst < /app/pkg/config.tmpl > /run/config.yaml -# TODO: Replace the command below with the correct process supervisor. -exec /bin/sh -c "echo 'Replace start.sh with application startup logic for Rundeck' && sleep infinity" +>&2 echo "start.sh for Rundeck is not implemented yet." +exit 1 diff --git a/apps/rundeck/test/smoke.sh b/apps/rundeck/test/smoke.sh index ebd1134..c89f842 100755 --- a/apps/rundeck/test/smoke.sh +++ b/apps/rundeck/test/smoke.sh @@ -1,16 +1,14 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Basic container reachability check executed inside the packaging container. -# Replace curl target with an endpoint exposed by the app once the package is functional. -cloudron_app_url=${CLOUDRON_APP_ORIGIN:-"http://localhost"} +cloudron_app_origin=${CLOUDRON_APP_ORIGIN:-http://localhost} -http_code=$(curl -s -o /tmp/smoke.log -w "%{http_code}" "${cloudron_app_url}") +http_code=$(curl --silent --show-error --output /tmp/smoke.log --write-out "%{http_code}" "${cloudron_app_origin}/") if [[ "${http_code}" != "200" ]]; then - echo "Unexpected HTTP status: ${http_code}" >&2 - cat /tmp/smoke.log >&2 + >&2 echo "Smoke test failed for Rundeck: expected HTTP 200 from ${cloudron_app_origin}/, got ${http_code}" + >&2 cat /tmp/smoke.log exit 1 fi -echo "Smoke test passed" +echo "Smoke test placeholder passed for Rundeck" diff --git a/apps/runme/CloudronManifest.json b/apps/runme/CloudronManifest.json index 4742ce9..d76b6b0 100644 --- a/apps/runme/CloudronManifest.json +++ b/apps/runme/CloudronManifest.json @@ -12,9 +12,16 @@ "version": "0.1.0", "tags": ["custom", "known-element"], "healthCheckPath": "/", - "memoryLimit": 536870912, "httpPort": 3000, + "memoryLimit": "512M", "addons": { "localstorage": {} + }, + "optionalAddons": { + "postgresql": {}, + "redis": {}, + "mysql": {}, + "mongodb": {}, + "sendmail": {} } } diff --git a/apps/runme/Dockerfile b/apps/runme/Dockerfile index df79d5b..bdc796e 100644 --- a/apps/runme/Dockerfile +++ b/apps/runme/Dockerfile @@ -1,21 +1,38 @@ -# syntax=docker/dockerfile:1 -FROM cloudron/base:5.0.0 +# syntax=docker/dockerfile:1.6 +ARG APP_VERSION=latest + +FROM cloudron/base:5.0.0 AS builder +WORKDIR /build + +# ----------------------------------------------------------------------------- +# TODO: Fetch and build Runme +# Example: +# RUN git clone --depth 1 --branch "${APP_VERSION}" https://github.com/runmedev/runme.git source \ +# && cd source \ +# && npm ci \ +# && npm run build +# ----------------------------------------------------------------------------- + +FROM cloudron/base:5.0.0 LABEL org.opencontainers.image.source="https://github.com/runmedev/runme.git" LABEL org.opencontainers.image.description="Cloudron package for Runme" -ARG APP_VERSION -ENV APP_VERSION=${APP_VERSION:-latest} +ENV APP_VERSION=${APP_VERSION} + +# ----------------------------------------------------------------------------- +# TODO: Copy build artefacts from the builder stage +# COPY --from=builder /build/source/dist /app/code +# ----------------------------------------------------------------------------- -# Copy application source into image at build time -# Replace this with a multi-stage build if upstream provides Docker images. COPY ./app /app/code - -# Copy start script and make it executable COPY ./start.sh /app/pkg/start.sh -RUN chmod +x /app/pkg/start.sh +COPY ./test /app/pkg/test + +RUN chmod +x /app/pkg/start.sh /app/pkg/test/smoke.sh \ + && mkdir -p /app/data \ + && chown -R cloudron:cloudron /app -# Cloudron expects all processes to run as cloudron user USER cloudron WORKDIR /app/code diff --git a/apps/runme/README.md b/apps/runme/README.md index 9020da2..c25f052 100644 --- a/apps/runme/README.md +++ b/apps/runme/README.md @@ -2,19 +2,19 @@ - **Upstream repository**: https://github.com/runmedev/runme.git - **Implementation issue**: https://projects.knownelement.com/issues/322 -- **Status**: Draft scaffolding generated on $(date -u +"%Y-%m-%dT%H:%M:%SZ") +- **Generated**: 2025-10-02T17:19:00Z UTC ## Packaging Checklist -1. Review upstream deployment requirements and map them to Cloudron services (database, cache, object storage, workers). -2. Update `Dockerfile` with the correct build steps and runtime dependencies. -3. Implement `start.sh` to configure the app from Cloudron-provided environment variables and launch the primary process. -4. Edit `CloudronManifest.json` with accurate metadata, permissions, ports, addons, and health checks. -5. Add integration and smoke tests under `test/` to validate the package. -6. Document manual configuration steps, migration requirements, and known gaps in this README. +1. Map upstream services (databases, caches, workers) to Cloudron addons; remove unused entries from `optionalAddons` and enable required ones under `addons`. +2. Implement the multi-stage build in `Dockerfile` to fetch/compile the correct release of Runme. +3. Update `start.sh` to configure the app from Cloudron environment variables and launch the primary process. +4. Replace the placeholder health checks and smoke test with real coverage. +5. Complete `CloudronManifest.json` (tagline, description, versioning, resource limits, ingress, TCP ports, etc.). +6. Document manual configuration steps, migrations, and known gaps below. ## Notes -- Replace the placeholder long-running process in `start.sh`. -- Populate the `app/` directory with the application build artefacts or git submodules. -- Use the shared packaging container (`docker/packager`) to run `cloudron build` and `cloudron install` so the host remains clean. +- Populate the `app/` directory with runtime overlays or artifacts generated during the build stage. +- Use the shared packaging container (`docker/packager`) for `cloudron build/install` to keep the host clean. +- Record decisions and operational requirements under `docs/apps/runme/` as work progresses. diff --git a/apps/runme/metadata.json b/apps/runme/metadata.json index a3fd4ec..4e6c5d6 100644 --- a/apps/runme/metadata.json +++ b/apps/runme/metadata.json @@ -4,6 +4,6 @@ "issue": "https://projects.knownelement.com/issues/322", "repo": "https://github.com/runmedev/runme.git", "additionalRepos": [], - "created": "2025-10-02T16:46:49Z", + "created": "2025-10-02T17:19:00Z", "notes": "TODO: capture packaging notes" -} \ No newline at end of file +} diff --git a/apps/runme/start.sh b/apps/runme/start.sh index 378564c..640bc6f 100755 --- a/apps/runme/start.sh +++ b/apps/runme/start.sh @@ -1,8 +1,9 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Cloudron injects configuration via environment variables and files under /run -# Use this script to render config files and launch the upstream service. +# TODO: render configuration files from CLOUDRON_* environment variables +# Example: +# envsubst < /app/pkg/config.tmpl > /run/config.yaml -# TODO: Replace the command below with the correct process supervisor. -exec /bin/sh -c "echo 'Replace start.sh with application startup logic for Runme' && sleep infinity" +>&2 echo "start.sh for Runme is not implemented yet." +exit 1 diff --git a/apps/runme/test/smoke.sh b/apps/runme/test/smoke.sh index ebd1134..bb0b6e7 100755 --- a/apps/runme/test/smoke.sh +++ b/apps/runme/test/smoke.sh @@ -1,16 +1,14 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Basic container reachability check executed inside the packaging container. -# Replace curl target with an endpoint exposed by the app once the package is functional. -cloudron_app_url=${CLOUDRON_APP_ORIGIN:-"http://localhost"} +cloudron_app_origin=${CLOUDRON_APP_ORIGIN:-http://localhost} -http_code=$(curl -s -o /tmp/smoke.log -w "%{http_code}" "${cloudron_app_url}") +http_code=$(curl --silent --show-error --output /tmp/smoke.log --write-out "%{http_code}" "${cloudron_app_origin}/") if [[ "${http_code}" != "200" ]]; then - echo "Unexpected HTTP status: ${http_code}" >&2 - cat /tmp/smoke.log >&2 + >&2 echo "Smoke test failed for Runme: expected HTTP 200 from ${cloudron_app_origin}/, got ${http_code}" + >&2 cat /tmp/smoke.log exit 1 fi -echo "Smoke test passed" +echo "Smoke test placeholder passed for Runme" diff --git a/apps/satnogs-kaitai/CloudronManifest.json b/apps/satnogs-kaitai/CloudronManifest.json index c0ca30e..d051468 100644 --- a/apps/satnogs-kaitai/CloudronManifest.json +++ b/apps/satnogs-kaitai/CloudronManifest.json @@ -12,9 +12,16 @@ "version": "0.1.0", "tags": ["custom", "known-element"], "healthCheckPath": "/", - "memoryLimit": 536870912, "httpPort": 3000, + "memoryLimit": "512M", "addons": { "localstorage": {} + }, + "optionalAddons": { + "postgresql": {}, + "redis": {}, + "mysql": {}, + "mongodb": {}, + "sendmail": {} } } diff --git a/apps/satnogs-kaitai/Dockerfile b/apps/satnogs-kaitai/Dockerfile index 4f6e7a5..c145d9e 100644 --- a/apps/satnogs-kaitai/Dockerfile +++ b/apps/satnogs-kaitai/Dockerfile @@ -1,21 +1,38 @@ -# syntax=docker/dockerfile:1 -FROM cloudron/base:5.0.0 +# syntax=docker/dockerfile:1.6 +ARG APP_VERSION=latest + +FROM cloudron/base:5.0.0 AS builder +WORKDIR /build + +# ----------------------------------------------------------------------------- +# TODO: Fetch and build SatNOGS Kaitai +# Example: +# RUN git clone --depth 1 --branch "${APP_VERSION}" https://gitlab.com/librespacefoundation/satnogs/docker-kaitai.git source \ +# && cd source \ +# && npm ci \ +# && npm run build +# ----------------------------------------------------------------------------- + +FROM cloudron/base:5.0.0 LABEL org.opencontainers.image.source="https://gitlab.com/librespacefoundation/satnogs/docker-kaitai.git" LABEL org.opencontainers.image.description="Cloudron package for SatNOGS Kaitai" -ARG APP_VERSION -ENV APP_VERSION=${APP_VERSION:-latest} +ENV APP_VERSION=${APP_VERSION} + +# ----------------------------------------------------------------------------- +# TODO: Copy build artefacts from the builder stage +# COPY --from=builder /build/source/dist /app/code +# ----------------------------------------------------------------------------- -# Copy application source into image at build time -# Replace this with a multi-stage build if upstream provides Docker images. COPY ./app /app/code - -# Copy start script and make it executable COPY ./start.sh /app/pkg/start.sh -RUN chmod +x /app/pkg/start.sh +COPY ./test /app/pkg/test + +RUN chmod +x /app/pkg/start.sh /app/pkg/test/smoke.sh \ + && mkdir -p /app/data \ + && chown -R cloudron:cloudron /app -# Cloudron expects all processes to run as cloudron user USER cloudron WORKDIR /app/code diff --git a/apps/satnogs-kaitai/README.md b/apps/satnogs-kaitai/README.md index 61a2227..a359a48 100644 --- a/apps/satnogs-kaitai/README.md +++ b/apps/satnogs-kaitai/README.md @@ -2,19 +2,19 @@ - **Upstream repository**: https://gitlab.com/librespacefoundation/satnogs/docker-kaitai.git - **Implementation issue**: https://projects.knownelement.com/issues/218 -- **Status**: Draft scaffolding generated on $(date -u +"%Y-%m-%dT%H:%M:%SZ") +- **Generated**: 2025-10-02T17:19:01Z UTC ## Packaging Checklist -1. Review upstream deployment requirements and map them to Cloudron services (database, cache, object storage, workers). -2. Update `Dockerfile` with the correct build steps and runtime dependencies. -3. Implement `start.sh` to configure the app from Cloudron-provided environment variables and launch the primary process. -4. Edit `CloudronManifest.json` with accurate metadata, permissions, ports, addons, and health checks. -5. Add integration and smoke tests under `test/` to validate the package. -6. Document manual configuration steps, migration requirements, and known gaps in this README. +1. Map upstream services (databases, caches, workers) to Cloudron addons; remove unused entries from `optionalAddons` and enable required ones under `addons`. +2. Implement the multi-stage build in `Dockerfile` to fetch/compile the correct release of SatNOGS Kaitai. +3. Update `start.sh` to configure the app from Cloudron environment variables and launch the primary process. +4. Replace the placeholder health checks and smoke test with real coverage. +5. Complete `CloudronManifest.json` (tagline, description, versioning, resource limits, ingress, TCP ports, etc.). +6. Document manual configuration steps, migrations, and known gaps below. ## Notes -- Replace the placeholder long-running process in `start.sh`. -- Populate the `app/` directory with the application build artefacts or git submodules. -- Use the shared packaging container (`docker/packager`) to run `cloudron build` and `cloudron install` so the host remains clean. +- Populate the `app/` directory with runtime overlays or artifacts generated during the build stage. +- Use the shared packaging container (`docker/packager`) for `cloudron build/install` to keep the host clean. +- Record decisions and operational requirements under `docs/apps/satnogs-kaitai/` as work progresses. diff --git a/apps/satnogs-kaitai/metadata.json b/apps/satnogs-kaitai/metadata.json index 7ed513b..1da2a4f 100644 --- a/apps/satnogs-kaitai/metadata.json +++ b/apps/satnogs-kaitai/metadata.json @@ -4,6 +4,6 @@ "issue": "https://projects.knownelement.com/issues/218", "repo": "https://gitlab.com/librespacefoundation/satnogs/docker-kaitai.git", "additionalRepos": [], - "created": "2025-10-02T16:46:49Z", + "created": "2025-10-02T17:19:01Z", "notes": "TODO: capture packaging notes" -} \ No newline at end of file +} diff --git a/apps/satnogs-kaitai/start.sh b/apps/satnogs-kaitai/start.sh index 5bae151..d53bb4c 100755 --- a/apps/satnogs-kaitai/start.sh +++ b/apps/satnogs-kaitai/start.sh @@ -1,8 +1,9 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Cloudron injects configuration via environment variables and files under /run -# Use this script to render config files and launch the upstream service. +# TODO: render configuration files from CLOUDRON_* environment variables +# Example: +# envsubst < /app/pkg/config.tmpl > /run/config.yaml -# TODO: Replace the command below with the correct process supervisor. -exec /bin/sh -c "echo 'Replace start.sh with application startup logic for SatNOGS Kaitai' && sleep infinity" +>&2 echo "start.sh for SatNOGS Kaitai is not implemented yet." +exit 1 diff --git a/apps/satnogs-kaitai/test/smoke.sh b/apps/satnogs-kaitai/test/smoke.sh index ebd1134..eaf2c85 100755 --- a/apps/satnogs-kaitai/test/smoke.sh +++ b/apps/satnogs-kaitai/test/smoke.sh @@ -1,16 +1,14 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Basic container reachability check executed inside the packaging container. -# Replace curl target with an endpoint exposed by the app once the package is functional. -cloudron_app_url=${CLOUDRON_APP_ORIGIN:-"http://localhost"} +cloudron_app_origin=${CLOUDRON_APP_ORIGIN:-http://localhost} -http_code=$(curl -s -o /tmp/smoke.log -w "%{http_code}" "${cloudron_app_url}") +http_code=$(curl --silent --show-error --output /tmp/smoke.log --write-out "%{http_code}" "${cloudron_app_origin}/") if [[ "${http_code}" != "200" ]]; then - echo "Unexpected HTTP status: ${http_code}" >&2 - cat /tmp/smoke.log >&2 + >&2 echo "Smoke test failed for SatNOGS Kaitai: expected HTTP 200 from ${cloudron_app_origin}/, got ${http_code}" + >&2 cat /tmp/smoke.log exit 1 fi -echo "Smoke test passed" +echo "Smoke test placeholder passed for SatNOGS Kaitai" diff --git a/apps/satnogs-webgui/CloudronManifest.json b/apps/satnogs-webgui/CloudronManifest.json index 9081a05..5bc1e73 100644 --- a/apps/satnogs-webgui/CloudronManifest.json +++ b/apps/satnogs-webgui/CloudronManifest.json @@ -12,9 +12,16 @@ "version": "0.1.0", "tags": ["custom", "known-element"], "healthCheckPath": "/", - "memoryLimit": 536870912, "httpPort": 3000, + "memoryLimit": "512M", "addons": { "localstorage": {} + }, + "optionalAddons": { + "postgresql": {}, + "redis": {}, + "mysql": {}, + "mongodb": {}, + "sendmail": {} } } diff --git a/apps/satnogs-webgui/Dockerfile b/apps/satnogs-webgui/Dockerfile index e3c1677..ca13f3b 100644 --- a/apps/satnogs-webgui/Dockerfile +++ b/apps/satnogs-webgui/Dockerfile @@ -1,21 +1,38 @@ -# syntax=docker/dockerfile:1 -FROM cloudron/base:5.0.0 +# syntax=docker/dockerfile:1.6 +ARG APP_VERSION=latest + +FROM cloudron/base:5.0.0 AS builder +WORKDIR /build + +# ----------------------------------------------------------------------------- +# TODO: Fetch and build SatNOGS WebGUI +# Example: +# RUN git clone --depth 1 --branch "${APP_VERSION}" https://gitlab.com/librespacefoundation/satnogs/docker-satnogs-webgui.git source \ +# && cd source \ +# && npm ci \ +# && npm run build +# ----------------------------------------------------------------------------- + +FROM cloudron/base:5.0.0 LABEL org.opencontainers.image.source="https://gitlab.com/librespacefoundation/satnogs/docker-satnogs-webgui.git" LABEL org.opencontainers.image.description="Cloudron package for SatNOGS WebGUI" -ARG APP_VERSION -ENV APP_VERSION=${APP_VERSION:-latest} +ENV APP_VERSION=${APP_VERSION} + +# ----------------------------------------------------------------------------- +# TODO: Copy build artefacts from the builder stage +# COPY --from=builder /build/source/dist /app/code +# ----------------------------------------------------------------------------- -# Copy application source into image at build time -# Replace this with a multi-stage build if upstream provides Docker images. COPY ./app /app/code - -# Copy start script and make it executable COPY ./start.sh /app/pkg/start.sh -RUN chmod +x /app/pkg/start.sh +COPY ./test /app/pkg/test + +RUN chmod +x /app/pkg/start.sh /app/pkg/test/smoke.sh \ + && mkdir -p /app/data \ + && chown -R cloudron:cloudron /app -# Cloudron expects all processes to run as cloudron user USER cloudron WORKDIR /app/code diff --git a/apps/satnogs-webgui/README.md b/apps/satnogs-webgui/README.md index 74c6243..3bbc5ea 100644 --- a/apps/satnogs-webgui/README.md +++ b/apps/satnogs-webgui/README.md @@ -2,19 +2,19 @@ - **Upstream repository**: https://gitlab.com/librespacefoundation/satnogs/docker-satnogs-webgui.git - **Implementation issue**: https://projects.knownelement.com/issues/218 -- **Status**: Draft scaffolding generated on $(date -u +"%Y-%m-%dT%H:%M:%SZ") +- **Generated**: 2025-10-02T17:19:01Z UTC ## Packaging Checklist -1. Review upstream deployment requirements and map them to Cloudron services (database, cache, object storage, workers). -2. Update `Dockerfile` with the correct build steps and runtime dependencies. -3. Implement `start.sh` to configure the app from Cloudron-provided environment variables and launch the primary process. -4. Edit `CloudronManifest.json` with accurate metadata, permissions, ports, addons, and health checks. -5. Add integration and smoke tests under `test/` to validate the package. -6. Document manual configuration steps, migration requirements, and known gaps in this README. +1. Map upstream services (databases, caches, workers) to Cloudron addons; remove unused entries from `optionalAddons` and enable required ones under `addons`. +2. Implement the multi-stage build in `Dockerfile` to fetch/compile the correct release of SatNOGS WebGUI. +3. Update `start.sh` to configure the app from Cloudron environment variables and launch the primary process. +4. Replace the placeholder health checks and smoke test with real coverage. +5. Complete `CloudronManifest.json` (tagline, description, versioning, resource limits, ingress, TCP ports, etc.). +6. Document manual configuration steps, migrations, and known gaps below. ## Notes -- Replace the placeholder long-running process in `start.sh`. -- Populate the `app/` directory with the application build artefacts or git submodules. -- Use the shared packaging container (`docker/packager`) to run `cloudron build` and `cloudron install` so the host remains clean. +- Populate the `app/` directory with runtime overlays or artifacts generated during the build stage. +- Use the shared packaging container (`docker/packager`) for `cloudron build/install` to keep the host clean. +- Record decisions and operational requirements under `docs/apps/satnogs-webgui/` as work progresses. diff --git a/apps/satnogs-webgui/metadata.json b/apps/satnogs-webgui/metadata.json index 14b5fc2..fb35e07 100644 --- a/apps/satnogs-webgui/metadata.json +++ b/apps/satnogs-webgui/metadata.json @@ -4,6 +4,6 @@ "issue": "https://projects.knownelement.com/issues/218", "repo": "https://gitlab.com/librespacefoundation/satnogs/docker-satnogs-webgui.git", "additionalRepos": [], - "created": "2025-10-02T16:46:49Z", + "created": "2025-10-02T17:19:01Z", "notes": "TODO: capture packaging notes" -} \ No newline at end of file +} diff --git a/apps/satnogs-webgui/start.sh b/apps/satnogs-webgui/start.sh index 37c15dd..cd68f14 100755 --- a/apps/satnogs-webgui/start.sh +++ b/apps/satnogs-webgui/start.sh @@ -1,8 +1,9 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Cloudron injects configuration via environment variables and files under /run -# Use this script to render config files and launch the upstream service. +# TODO: render configuration files from CLOUDRON_* environment variables +# Example: +# envsubst < /app/pkg/config.tmpl > /run/config.yaml -# TODO: Replace the command below with the correct process supervisor. -exec /bin/sh -c "echo 'Replace start.sh with application startup logic for SatNOGS WebGUI' && sleep infinity" +>&2 echo "start.sh for SatNOGS WebGUI is not implemented yet." +exit 1 diff --git a/apps/satnogs-webgui/test/smoke.sh b/apps/satnogs-webgui/test/smoke.sh index ebd1134..f00f63f 100755 --- a/apps/satnogs-webgui/test/smoke.sh +++ b/apps/satnogs-webgui/test/smoke.sh @@ -1,16 +1,14 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Basic container reachability check executed inside the packaging container. -# Replace curl target with an endpoint exposed by the app once the package is functional. -cloudron_app_url=${CLOUDRON_APP_ORIGIN:-"http://localhost"} +cloudron_app_origin=${CLOUDRON_APP_ORIGIN:-http://localhost} -http_code=$(curl -s -o /tmp/smoke.log -w "%{http_code}" "${cloudron_app_url}") +http_code=$(curl --silent --show-error --output /tmp/smoke.log --write-out "%{http_code}" "${cloudron_app_origin}/") if [[ "${http_code}" != "200" ]]; then - echo "Unexpected HTTP status: ${http_code}" >&2 - cat /tmp/smoke.log >&2 + >&2 echo "Smoke test failed for SatNOGS WebGUI: expected HTTP 200 from ${cloudron_app_origin}/, got ${http_code}" + >&2 cat /tmp/smoke.log exit 1 fi -echo "Smoke test passed" +echo "Smoke test placeholder passed for SatNOGS WebGUI" diff --git a/apps/sdrangel/CloudronManifest.json b/apps/sdrangel/CloudronManifest.json index 05c0ba9..0a29046 100644 --- a/apps/sdrangel/CloudronManifest.json +++ b/apps/sdrangel/CloudronManifest.json @@ -12,9 +12,16 @@ "version": "0.1.0", "tags": ["custom", "known-element"], "healthCheckPath": "/", - "memoryLimit": 536870912, "httpPort": 3000, + "memoryLimit": "512M", "addons": { "localstorage": {} + }, + "optionalAddons": { + "postgresql": {}, + "redis": {}, + "mysql": {}, + "mongodb": {}, + "sendmail": {} } } diff --git a/apps/sdrangel/Dockerfile b/apps/sdrangel/Dockerfile index b4454ae..5067a89 100644 --- a/apps/sdrangel/Dockerfile +++ b/apps/sdrangel/Dockerfile @@ -1,21 +1,38 @@ -# syntax=docker/dockerfile:1 -FROM cloudron/base:5.0.0 +# syntax=docker/dockerfile:1.6 +ARG APP_VERSION=latest + +FROM cloudron/base:5.0.0 AS builder +WORKDIR /build + +# ----------------------------------------------------------------------------- +# TODO: Fetch and build SDRAngel +# Example: +# RUN git clone --depth 1 --branch "${APP_VERSION}" https://github.com/f4exb/sdrangel-docker source \ +# && cd source \ +# && npm ci \ +# && npm run build +# ----------------------------------------------------------------------------- + +FROM cloudron/base:5.0.0 LABEL org.opencontainers.image.source="https://github.com/f4exb/sdrangel-docker" LABEL org.opencontainers.image.description="Cloudron package for SDRAngel" -ARG APP_VERSION -ENV APP_VERSION=${APP_VERSION:-latest} +ENV APP_VERSION=${APP_VERSION} + +# ----------------------------------------------------------------------------- +# TODO: Copy build artefacts from the builder stage +# COPY --from=builder /build/source/dist /app/code +# ----------------------------------------------------------------------------- -# Copy application source into image at build time -# Replace this with a multi-stage build if upstream provides Docker images. COPY ./app /app/code - -# Copy start script and make it executable COPY ./start.sh /app/pkg/start.sh -RUN chmod +x /app/pkg/start.sh +COPY ./test /app/pkg/test + +RUN chmod +x /app/pkg/start.sh /app/pkg/test/smoke.sh \ + && mkdir -p /app/data \ + && chown -R cloudron:cloudron /app -# Cloudron expects all processes to run as cloudron user USER cloudron WORKDIR /app/code diff --git a/apps/sdrangel/README.md b/apps/sdrangel/README.md index 9587182..2070e7c 100644 --- a/apps/sdrangel/README.md +++ b/apps/sdrangel/README.md @@ -2,19 +2,19 @@ - **Upstream repository**: https://github.com/f4exb/sdrangel-docker - **Implementation issue**: https://projects.knownelement.com/issues/219 -- **Status**: Draft scaffolding generated on $(date -u +"%Y-%m-%dT%H:%M:%SZ") +- **Generated**: 2025-10-02T17:19:01Z UTC ## Packaging Checklist -1. Review upstream deployment requirements and map them to Cloudron services (database, cache, object storage, workers). -2. Update `Dockerfile` with the correct build steps and runtime dependencies. -3. Implement `start.sh` to configure the app from Cloudron-provided environment variables and launch the primary process. -4. Edit `CloudronManifest.json` with accurate metadata, permissions, ports, addons, and health checks. -5. Add integration and smoke tests under `test/` to validate the package. -6. Document manual configuration steps, migration requirements, and known gaps in this README. +1. Map upstream services (databases, caches, workers) to Cloudron addons; remove unused entries from `optionalAddons` and enable required ones under `addons`. +2. Implement the multi-stage build in `Dockerfile` to fetch/compile the correct release of SDRAngel. +3. Update `start.sh` to configure the app from Cloudron environment variables and launch the primary process. +4. Replace the placeholder health checks and smoke test with real coverage. +5. Complete `CloudronManifest.json` (tagline, description, versioning, resource limits, ingress, TCP ports, etc.). +6. Document manual configuration steps, migrations, and known gaps below. ## Notes -- Replace the placeholder long-running process in `start.sh`. -- Populate the `app/` directory with the application build artefacts or git submodules. -- Use the shared packaging container (`docker/packager`) to run `cloudron build` and `cloudron install` so the host remains clean. +- Populate the `app/` directory with runtime overlays or artifacts generated during the build stage. +- Use the shared packaging container (`docker/packager`) for `cloudron build/install` to keep the host clean. +- Record decisions and operational requirements under `docs/apps/sdrangel/` as work progresses. diff --git a/apps/sdrangel/metadata.json b/apps/sdrangel/metadata.json index 32104da..63b1aab 100644 --- a/apps/sdrangel/metadata.json +++ b/apps/sdrangel/metadata.json @@ -4,6 +4,6 @@ "issue": "https://projects.knownelement.com/issues/219", "repo": "https://github.com/f4exb/sdrangel-docker", "additionalRepos": [], - "created": "2025-10-02T16:46:49Z", + "created": "2025-10-02T17:19:01Z", "notes": "TODO: capture packaging notes" -} \ No newline at end of file +} diff --git a/apps/sdrangel/start.sh b/apps/sdrangel/start.sh index e73f3bb..d40adde 100755 --- a/apps/sdrangel/start.sh +++ b/apps/sdrangel/start.sh @@ -1,8 +1,9 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Cloudron injects configuration via environment variables and files under /run -# Use this script to render config files and launch the upstream service. +# TODO: render configuration files from CLOUDRON_* environment variables +# Example: +# envsubst < /app/pkg/config.tmpl > /run/config.yaml -# TODO: Replace the command below with the correct process supervisor. -exec /bin/sh -c "echo 'Replace start.sh with application startup logic for SDRAngel' && sleep infinity" +>&2 echo "start.sh for SDRAngel is not implemented yet." +exit 1 diff --git a/apps/sdrangel/test/smoke.sh b/apps/sdrangel/test/smoke.sh index ebd1134..eacfe2a 100755 --- a/apps/sdrangel/test/smoke.sh +++ b/apps/sdrangel/test/smoke.sh @@ -1,16 +1,14 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Basic container reachability check executed inside the packaging container. -# Replace curl target with an endpoint exposed by the app once the package is functional. -cloudron_app_url=${CLOUDRON_APP_ORIGIN:-"http://localhost"} +cloudron_app_origin=${CLOUDRON_APP_ORIGIN:-http://localhost} -http_code=$(curl -s -o /tmp/smoke.log -w "%{http_code}" "${cloudron_app_url}") +http_code=$(curl --silent --show-error --output /tmp/smoke.log --write-out "%{http_code}" "${cloudron_app_origin}/") if [[ "${http_code}" != "200" ]]; then - echo "Unexpected HTTP status: ${http_code}" >&2 - cat /tmp/smoke.log >&2 + >&2 echo "Smoke test failed for SDRAngel: expected HTTP 200 from ${cloudron_app_origin}/, got ${http_code}" + >&2 cat /tmp/smoke.log exit 1 fi -echo "Smoke test passed" +echo "Smoke test placeholder passed for SDRAngel" diff --git a/apps/seatunnel/CloudronManifest.json b/apps/seatunnel/CloudronManifest.json index 65a388c..2a46343 100644 --- a/apps/seatunnel/CloudronManifest.json +++ b/apps/seatunnel/CloudronManifest.json @@ -12,9 +12,16 @@ "version": "0.1.0", "tags": ["custom", "known-element"], "healthCheckPath": "/", - "memoryLimit": 536870912, "httpPort": 3000, + "memoryLimit": "512M", "addons": { "localstorage": {} + }, + "optionalAddons": { + "postgresql": {}, + "redis": {}, + "mysql": {}, + "mongodb": {}, + "sendmail": {} } } diff --git a/apps/seatunnel/Dockerfile b/apps/seatunnel/Dockerfile index b0b1495..1ba191d 100644 --- a/apps/seatunnel/Dockerfile +++ b/apps/seatunnel/Dockerfile @@ -1,21 +1,38 @@ -# syntax=docker/dockerfile:1 -FROM cloudron/base:5.0.0 +# syntax=docker/dockerfile:1.6 +ARG APP_VERSION=latest + +FROM cloudron/base:5.0.0 AS builder +WORKDIR /build + +# ----------------------------------------------------------------------------- +# TODO: Fetch and build SeaTunnel +# Example: +# RUN git clone --depth 1 --branch "${APP_VERSION}" https://github.com/apache/seatunnel source \ +# && cd source \ +# && npm ci \ +# && npm run build +# ----------------------------------------------------------------------------- + +FROM cloudron/base:5.0.0 LABEL org.opencontainers.image.source="https://github.com/apache/seatunnel" LABEL org.opencontainers.image.description="Cloudron package for SeaTunnel" -ARG APP_VERSION -ENV APP_VERSION=${APP_VERSION:-latest} +ENV APP_VERSION=${APP_VERSION} + +# ----------------------------------------------------------------------------- +# TODO: Copy build artefacts from the builder stage +# COPY --from=builder /build/source/dist /app/code +# ----------------------------------------------------------------------------- -# Copy application source into image at build time -# Replace this with a multi-stage build if upstream provides Docker images. COPY ./app /app/code - -# Copy start script and make it executable COPY ./start.sh /app/pkg/start.sh -RUN chmod +x /app/pkg/start.sh +COPY ./test /app/pkg/test + +RUN chmod +x /app/pkg/start.sh /app/pkg/test/smoke.sh \ + && mkdir -p /app/data \ + && chown -R cloudron:cloudron /app -# Cloudron expects all processes to run as cloudron user USER cloudron WORKDIR /app/code diff --git a/apps/seatunnel/README.md b/apps/seatunnel/README.md index ddb836b..006cfd1 100644 --- a/apps/seatunnel/README.md +++ b/apps/seatunnel/README.md @@ -2,19 +2,19 @@ - **Upstream repository**: https://github.com/apache/seatunnel - **Implementation issue**: https://projects.knownelement.com/issues/301 -- **Status**: Draft scaffolding generated on $(date -u +"%Y-%m-%dT%H:%M:%SZ") +- **Generated**: 2025-10-02T17:19:00Z UTC ## Packaging Checklist -1. Review upstream deployment requirements and map them to Cloudron services (database, cache, object storage, workers). -2. Update `Dockerfile` with the correct build steps and runtime dependencies. -3. Implement `start.sh` to configure the app from Cloudron-provided environment variables and launch the primary process. -4. Edit `CloudronManifest.json` with accurate metadata, permissions, ports, addons, and health checks. -5. Add integration and smoke tests under `test/` to validate the package. -6. Document manual configuration steps, migration requirements, and known gaps in this README. +1. Map upstream services (databases, caches, workers) to Cloudron addons; remove unused entries from `optionalAddons` and enable required ones under `addons`. +2. Implement the multi-stage build in `Dockerfile` to fetch/compile the correct release of SeaTunnel. +3. Update `start.sh` to configure the app from Cloudron environment variables and launch the primary process. +4. Replace the placeholder health checks and smoke test with real coverage. +5. Complete `CloudronManifest.json` (tagline, description, versioning, resource limits, ingress, TCP ports, etc.). +6. Document manual configuration steps, migrations, and known gaps below. ## Notes -- Replace the placeholder long-running process in `start.sh`. -- Populate the `app/` directory with the application build artefacts or git submodules. -- Use the shared packaging container (`docker/packager`) to run `cloudron build` and `cloudron install` so the host remains clean. +- Populate the `app/` directory with runtime overlays or artifacts generated during the build stage. +- Use the shared packaging container (`docker/packager`) for `cloudron build/install` to keep the host clean. +- Record decisions and operational requirements under `docs/apps/seatunnel/` as work progresses. diff --git a/apps/seatunnel/metadata.json b/apps/seatunnel/metadata.json index b443e55..2316b8c 100644 --- a/apps/seatunnel/metadata.json +++ b/apps/seatunnel/metadata.json @@ -4,6 +4,6 @@ "issue": "https://projects.knownelement.com/issues/301", "repo": "https://github.com/apache/seatunnel", "additionalRepos": [], - "created": "2025-10-02T16:46:49Z", + "created": "2025-10-02T17:19:00Z", "notes": "TODO: capture packaging notes" -} \ No newline at end of file +} diff --git a/apps/seatunnel/start.sh b/apps/seatunnel/start.sh index 7182f69..c00f054 100755 --- a/apps/seatunnel/start.sh +++ b/apps/seatunnel/start.sh @@ -1,8 +1,9 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Cloudron injects configuration via environment variables and files under /run -# Use this script to render config files and launch the upstream service. +# TODO: render configuration files from CLOUDRON_* environment variables +# Example: +# envsubst < /app/pkg/config.tmpl > /run/config.yaml -# TODO: Replace the command below with the correct process supervisor. -exec /bin/sh -c "echo 'Replace start.sh with application startup logic for SeaTunnel' && sleep infinity" +>&2 echo "start.sh for SeaTunnel is not implemented yet." +exit 1 diff --git a/apps/seatunnel/test/smoke.sh b/apps/seatunnel/test/smoke.sh index ebd1134..8d78627 100755 --- a/apps/seatunnel/test/smoke.sh +++ b/apps/seatunnel/test/smoke.sh @@ -1,16 +1,14 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Basic container reachability check executed inside the packaging container. -# Replace curl target with an endpoint exposed by the app once the package is functional. -cloudron_app_url=${CLOUDRON_APP_ORIGIN:-"http://localhost"} +cloudron_app_origin=${CLOUDRON_APP_ORIGIN:-http://localhost} -http_code=$(curl -s -o /tmp/smoke.log -w "%{http_code}" "${cloudron_app_url}") +http_code=$(curl --silent --show-error --output /tmp/smoke.log --write-out "%{http_code}" "${cloudron_app_origin}/") if [[ "${http_code}" != "200" ]]; then - echo "Unexpected HTTP status: ${http_code}" >&2 - cat /tmp/smoke.log >&2 + >&2 echo "Smoke test failed for SeaTunnel: expected HTTP 200 from ${cloudron_app_origin}/, got ${http_code}" + >&2 cat /tmp/smoke.log exit 1 fi -echo "Smoke test passed" +echo "Smoke test placeholder passed for SeaTunnel" diff --git a/apps/signoz/CloudronManifest.json b/apps/signoz/CloudronManifest.json index 803f5b4..7e02567 100644 --- a/apps/signoz/CloudronManifest.json +++ b/apps/signoz/CloudronManifest.json @@ -12,9 +12,16 @@ "version": "0.1.0", "tags": ["custom", "known-element"], "healthCheckPath": "/", - "memoryLimit": 536870912, "httpPort": 3000, + "memoryLimit": "512M", "addons": { "localstorage": {} + }, + "optionalAddons": { + "postgresql": {}, + "redis": {}, + "mysql": {}, + "mongodb": {}, + "sendmail": {} } } diff --git a/apps/signoz/Dockerfile b/apps/signoz/Dockerfile index fd79eaf..7dcd6c1 100644 --- a/apps/signoz/Dockerfile +++ b/apps/signoz/Dockerfile @@ -1,21 +1,38 @@ -# syntax=docker/dockerfile:1 -FROM cloudron/base:5.0.0 +# syntax=docker/dockerfile:1.6 +ARG APP_VERSION=latest + +FROM cloudron/base:5.0.0 AS builder +WORKDIR /build + +# ----------------------------------------------------------------------------- +# TODO: Fetch and build SigNoz +# Example: +# RUN git clone --depth 1 --branch "${APP_VERSION}" https://github.com/SigNoz/signoz.git source \ +# && cd source \ +# && npm ci \ +# && npm run build +# ----------------------------------------------------------------------------- + +FROM cloudron/base:5.0.0 LABEL org.opencontainers.image.source="https://github.com/SigNoz/signoz.git" LABEL org.opencontainers.image.description="Cloudron package for SigNoz" -ARG APP_VERSION -ENV APP_VERSION=${APP_VERSION:-latest} +ENV APP_VERSION=${APP_VERSION} + +# ----------------------------------------------------------------------------- +# TODO: Copy build artefacts from the builder stage +# COPY --from=builder /build/source/dist /app/code +# ----------------------------------------------------------------------------- -# Copy application source into image at build time -# Replace this with a multi-stage build if upstream provides Docker images. COPY ./app /app/code - -# Copy start script and make it executable COPY ./start.sh /app/pkg/start.sh -RUN chmod +x /app/pkg/start.sh +COPY ./test /app/pkg/test + +RUN chmod +x /app/pkg/start.sh /app/pkg/test/smoke.sh \ + && mkdir -p /app/data \ + && chown -R cloudron:cloudron /app -# Cloudron expects all processes to run as cloudron user USER cloudron WORKDIR /app/code diff --git a/apps/signoz/README.md b/apps/signoz/README.md index 704b780..0510cbc 100644 --- a/apps/signoz/README.md +++ b/apps/signoz/README.md @@ -2,19 +2,19 @@ - **Upstream repository**: https://github.com/SigNoz/signoz.git - **Implementation issue**: https://projects.knownelement.com/issues/221 -- **Status**: Draft scaffolding generated on $(date -u +"%Y-%m-%dT%H:%M:%SZ") +- **Generated**: 2025-10-02T17:19:01Z UTC ## Packaging Checklist -1. Review upstream deployment requirements and map them to Cloudron services (database, cache, object storage, workers). -2. Update `Dockerfile` with the correct build steps and runtime dependencies. -3. Implement `start.sh` to configure the app from Cloudron-provided environment variables and launch the primary process. -4. Edit `CloudronManifest.json` with accurate metadata, permissions, ports, addons, and health checks. -5. Add integration and smoke tests under `test/` to validate the package. -6. Document manual configuration steps, migration requirements, and known gaps in this README. +1. Map upstream services (databases, caches, workers) to Cloudron addons; remove unused entries from `optionalAddons` and enable required ones under `addons`. +2. Implement the multi-stage build in `Dockerfile` to fetch/compile the correct release of SigNoz. +3. Update `start.sh` to configure the app from Cloudron environment variables and launch the primary process. +4. Replace the placeholder health checks and smoke test with real coverage. +5. Complete `CloudronManifest.json` (tagline, description, versioning, resource limits, ingress, TCP ports, etc.). +6. Document manual configuration steps, migrations, and known gaps below. ## Notes -- Replace the placeholder long-running process in `start.sh`. -- Populate the `app/` directory with the application build artefacts or git submodules. -- Use the shared packaging container (`docker/packager`) to run `cloudron build` and `cloudron install` so the host remains clean. +- Populate the `app/` directory with runtime overlays or artifacts generated during the build stage. +- Use the shared packaging container (`docker/packager`) for `cloudron build/install` to keep the host clean. +- Record decisions and operational requirements under `docs/apps/signoz/` as work progresses. diff --git a/apps/signoz/metadata.json b/apps/signoz/metadata.json index a2a977d..b948e2b 100644 --- a/apps/signoz/metadata.json +++ b/apps/signoz/metadata.json @@ -4,6 +4,6 @@ "issue": "https://projects.knownelement.com/issues/221", "repo": "https://github.com/SigNoz/signoz.git", "additionalRepos": [], - "created": "2025-10-02T16:46:49Z", + "created": "2025-10-02T17:19:01Z", "notes": "TODO: capture packaging notes" -} \ No newline at end of file +} diff --git a/apps/signoz/start.sh b/apps/signoz/start.sh index 3e7249b..2c82ca5 100755 --- a/apps/signoz/start.sh +++ b/apps/signoz/start.sh @@ -1,8 +1,9 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Cloudron injects configuration via environment variables and files under /run -# Use this script to render config files and launch the upstream service. +# TODO: render configuration files from CLOUDRON_* environment variables +# Example: +# envsubst < /app/pkg/config.tmpl > /run/config.yaml -# TODO: Replace the command below with the correct process supervisor. -exec /bin/sh -c "echo 'Replace start.sh with application startup logic for SigNoz' && sleep infinity" +>&2 echo "start.sh for SigNoz is not implemented yet." +exit 1 diff --git a/apps/signoz/test/smoke.sh b/apps/signoz/test/smoke.sh index ebd1134..3b71080 100755 --- a/apps/signoz/test/smoke.sh +++ b/apps/signoz/test/smoke.sh @@ -1,16 +1,14 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Basic container reachability check executed inside the packaging container. -# Replace curl target with an endpoint exposed by the app once the package is functional. -cloudron_app_url=${CLOUDRON_APP_ORIGIN:-"http://localhost"} +cloudron_app_origin=${CLOUDRON_APP_ORIGIN:-http://localhost} -http_code=$(curl -s -o /tmp/smoke.log -w "%{http_code}" "${cloudron_app_url}") +http_code=$(curl --silent --show-error --output /tmp/smoke.log --write-out "%{http_code}" "${cloudron_app_origin}/") if [[ "${http_code}" != "200" ]]; then - echo "Unexpected HTTP status: ${http_code}" >&2 - cat /tmp/smoke.log >&2 + >&2 echo "Smoke test failed for SigNoz: expected HTTP 200 from ${cloudron_app_origin}/, got ${http_code}" + >&2 cat /tmp/smoke.log exit 1 fi -echo "Smoke test passed" +echo "Smoke test placeholder passed for SigNoz" diff --git a/apps/slurm/CloudronManifest.json b/apps/slurm/CloudronManifest.json index e37ddd4..a172946 100644 --- a/apps/slurm/CloudronManifest.json +++ b/apps/slurm/CloudronManifest.json @@ -12,9 +12,16 @@ "version": "0.1.0", "tags": ["custom", "known-element"], "healthCheckPath": "/", - "memoryLimit": 536870912, "httpPort": 3000, + "memoryLimit": "512M", "addons": { "localstorage": {} + }, + "optionalAddons": { + "postgresql": {}, + "redis": {}, + "mysql": {}, + "mongodb": {}, + "sendmail": {} } } diff --git a/apps/slurm/Dockerfile b/apps/slurm/Dockerfile index 98a2df8..a893611 100644 --- a/apps/slurm/Dockerfile +++ b/apps/slurm/Dockerfile @@ -1,21 +1,38 @@ -# syntax=docker/dockerfile:1 -FROM cloudron/base:5.0.0 +# syntax=docker/dockerfile:1.6 +ARG APP_VERSION=latest + +FROM cloudron/base:5.0.0 AS builder +WORKDIR /build + +# ----------------------------------------------------------------------------- +# TODO: Fetch and build Slurm +# Example: +# RUN git clone --depth 1 --branch "${APP_VERSION}" https://github.com/SchedMD/slurm.git source \ +# && cd source \ +# && npm ci \ +# && npm run build +# ----------------------------------------------------------------------------- + +FROM cloudron/base:5.0.0 LABEL org.opencontainers.image.source="https://github.com/SchedMD/slurm.git" LABEL org.opencontainers.image.description="Cloudron package for Slurm" -ARG APP_VERSION -ENV APP_VERSION=${APP_VERSION:-latest} +ENV APP_VERSION=${APP_VERSION} + +# ----------------------------------------------------------------------------- +# TODO: Copy build artefacts from the builder stage +# COPY --from=builder /build/source/dist /app/code +# ----------------------------------------------------------------------------- -# Copy application source into image at build time -# Replace this with a multi-stage build if upstream provides Docker images. COPY ./app /app/code - -# Copy start script and make it executable COPY ./start.sh /app/pkg/start.sh -RUN chmod +x /app/pkg/start.sh +COPY ./test /app/pkg/test + +RUN chmod +x /app/pkg/start.sh /app/pkg/test/smoke.sh \ + && mkdir -p /app/data \ + && chown -R cloudron:cloudron /app -# Cloudron expects all processes to run as cloudron user USER cloudron WORKDIR /app/code diff --git a/apps/slurm/README.md b/apps/slurm/README.md index 1183c27..52fa1d0 100644 --- a/apps/slurm/README.md +++ b/apps/slurm/README.md @@ -2,19 +2,19 @@ - **Upstream repository**: https://github.com/SchedMD/slurm.git - **Implementation issue**: https://projects.knownelement.com/issues/222 -- **Status**: Draft scaffolding generated on $(date -u +"%Y-%m-%dT%H:%M:%SZ") +- **Generated**: 2025-10-02T17:19:00Z UTC ## Packaging Checklist -1. Review upstream deployment requirements and map them to Cloudron services (database, cache, object storage, workers). -2. Update `Dockerfile` with the correct build steps and runtime dependencies. -3. Implement `start.sh` to configure the app from Cloudron-provided environment variables and launch the primary process. -4. Edit `CloudronManifest.json` with accurate metadata, permissions, ports, addons, and health checks. -5. Add integration and smoke tests under `test/` to validate the package. -6. Document manual configuration steps, migration requirements, and known gaps in this README. +1. Map upstream services (databases, caches, workers) to Cloudron addons; remove unused entries from `optionalAddons` and enable required ones under `addons`. +2. Implement the multi-stage build in `Dockerfile` to fetch/compile the correct release of Slurm. +3. Update `start.sh` to configure the app from Cloudron environment variables and launch the primary process. +4. Replace the placeholder health checks and smoke test with real coverage. +5. Complete `CloudronManifest.json` (tagline, description, versioning, resource limits, ingress, TCP ports, etc.). +6. Document manual configuration steps, migrations, and known gaps below. ## Notes -- Replace the placeholder long-running process in `start.sh`. -- Populate the `app/` directory with the application build artefacts or git submodules. -- Use the shared packaging container (`docker/packager`) to run `cloudron build` and `cloudron install` so the host remains clean. +- Populate the `app/` directory with runtime overlays or artifacts generated during the build stage. +- Use the shared packaging container (`docker/packager`) for `cloudron build/install` to keep the host clean. +- Record decisions and operational requirements under `docs/apps/slurm/` as work progresses. diff --git a/apps/slurm/metadata.json b/apps/slurm/metadata.json index 549e778..c16f3a2 100644 --- a/apps/slurm/metadata.json +++ b/apps/slurm/metadata.json @@ -3,9 +3,9 @@ "title": "Slurm", "issue": "https://projects.knownelement.com/issues/222", "repo": "https://github.com/SchedMD/slurm.git", - "additionalRepos": [ + "additionalRepos": [ "https://github.com/giovtorres/slurm-docker-cluster.git" ], - "created": "2025-10-02T16:46:49Z", + "created": "2025-10-02T17:19:00Z", "notes": "TODO: capture packaging notes" -} \ No newline at end of file +} diff --git a/apps/slurm/start.sh b/apps/slurm/start.sh index 5e4691c..ccbb99c 100755 --- a/apps/slurm/start.sh +++ b/apps/slurm/start.sh @@ -1,8 +1,9 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Cloudron injects configuration via environment variables and files under /run -# Use this script to render config files and launch the upstream service. +# TODO: render configuration files from CLOUDRON_* environment variables +# Example: +# envsubst < /app/pkg/config.tmpl > /run/config.yaml -# TODO: Replace the command below with the correct process supervisor. -exec /bin/sh -c "echo 'Replace start.sh with application startup logic for Slurm' && sleep infinity" +>&2 echo "start.sh for Slurm is not implemented yet." +exit 1 diff --git a/apps/slurm/test/smoke.sh b/apps/slurm/test/smoke.sh index ebd1134..81e9e11 100755 --- a/apps/slurm/test/smoke.sh +++ b/apps/slurm/test/smoke.sh @@ -1,16 +1,14 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Basic container reachability check executed inside the packaging container. -# Replace curl target with an endpoint exposed by the app once the package is functional. -cloudron_app_url=${CLOUDRON_APP_ORIGIN:-"http://localhost"} +cloudron_app_origin=${CLOUDRON_APP_ORIGIN:-http://localhost} -http_code=$(curl -s -o /tmp/smoke.log -w "%{http_code}" "${cloudron_app_url}") +http_code=$(curl --silent --show-error --output /tmp/smoke.log --write-out "%{http_code}" "${cloudron_app_origin}/") if [[ "${http_code}" != "200" ]]; then - echo "Unexpected HTTP status: ${http_code}" >&2 - cat /tmp/smoke.log >&2 + >&2 echo "Smoke test failed for Slurm: expected HTTP 200 from ${cloudron_app_origin}/, got ${http_code}" + >&2 cat /tmp/smoke.log exit 1 fi -echo "Smoke test passed" +echo "Smoke test placeholder passed for Slurm" diff --git a/apps/sniperphish/CloudronManifest.json b/apps/sniperphish/CloudronManifest.json index 396b6aa..1d0abf3 100644 --- a/apps/sniperphish/CloudronManifest.json +++ b/apps/sniperphish/CloudronManifest.json @@ -12,9 +12,16 @@ "version": "0.1.0", "tags": ["custom", "known-element"], "healthCheckPath": "/", - "memoryLimit": 536870912, "httpPort": 3000, + "memoryLimit": "512M", "addons": { "localstorage": {} + }, + "optionalAddons": { + "postgresql": {}, + "redis": {}, + "mysql": {}, + "mongodb": {}, + "sendmail": {} } } diff --git a/apps/sniperphish/Dockerfile b/apps/sniperphish/Dockerfile index 436fdaf..873eaca 100644 --- a/apps/sniperphish/Dockerfile +++ b/apps/sniperphish/Dockerfile @@ -1,21 +1,38 @@ -# syntax=docker/dockerfile:1 -FROM cloudron/base:5.0.0 +# syntax=docker/dockerfile:1.6 +ARG APP_VERSION=latest + +FROM cloudron/base:5.0.0 AS builder +WORKDIR /build + +# ----------------------------------------------------------------------------- +# TODO: Fetch and build SniperPhish +# Example: +# RUN git clone --depth 1 --branch "${APP_VERSION}" https://github.com/GemGeorge/SniperPhish-Docker.git source \ +# && cd source \ +# && npm ci \ +# && npm run build +# ----------------------------------------------------------------------------- + +FROM cloudron/base:5.0.0 LABEL org.opencontainers.image.source="https://github.com/GemGeorge/SniperPhish-Docker.git" LABEL org.opencontainers.image.description="Cloudron package for SniperPhish" -ARG APP_VERSION -ENV APP_VERSION=${APP_VERSION:-latest} +ENV APP_VERSION=${APP_VERSION} + +# ----------------------------------------------------------------------------- +# TODO: Copy build artefacts from the builder stage +# COPY --from=builder /build/source/dist /app/code +# ----------------------------------------------------------------------------- -# Copy application source into image at build time -# Replace this with a multi-stage build if upstream provides Docker images. COPY ./app /app/code - -# Copy start script and make it executable COPY ./start.sh /app/pkg/start.sh -RUN chmod +x /app/pkg/start.sh +COPY ./test /app/pkg/test + +RUN chmod +x /app/pkg/start.sh /app/pkg/test/smoke.sh \ + && mkdir -p /app/data \ + && chown -R cloudron:cloudron /app -# Cloudron expects all processes to run as cloudron user USER cloudron WORKDIR /app/code diff --git a/apps/sniperphish/README.md b/apps/sniperphish/README.md index f351b75..2f8062d 100644 --- a/apps/sniperphish/README.md +++ b/apps/sniperphish/README.md @@ -2,19 +2,19 @@ - **Upstream repository**: https://github.com/GemGeorge/SniperPhish-Docker.git - **Implementation issue**: https://projects.knownelement.com/issues/211 -- **Status**: Draft scaffolding generated on $(date -u +"%Y-%m-%dT%H:%M:%SZ") +- **Generated**: 2025-10-02T17:19:00Z UTC ## Packaging Checklist -1. Review upstream deployment requirements and map them to Cloudron services (database, cache, object storage, workers). -2. Update `Dockerfile` with the correct build steps and runtime dependencies. -3. Implement `start.sh` to configure the app from Cloudron-provided environment variables and launch the primary process. -4. Edit `CloudronManifest.json` with accurate metadata, permissions, ports, addons, and health checks. -5. Add integration and smoke tests under `test/` to validate the package. -6. Document manual configuration steps, migration requirements, and known gaps in this README. +1. Map upstream services (databases, caches, workers) to Cloudron addons; remove unused entries from `optionalAddons` and enable required ones under `addons`. +2. Implement the multi-stage build in `Dockerfile` to fetch/compile the correct release of SniperPhish. +3. Update `start.sh` to configure the app from Cloudron environment variables and launch the primary process. +4. Replace the placeholder health checks and smoke test with real coverage. +5. Complete `CloudronManifest.json` (tagline, description, versioning, resource limits, ingress, TCP ports, etc.). +6. Document manual configuration steps, migrations, and known gaps below. ## Notes -- Replace the placeholder long-running process in `start.sh`. -- Populate the `app/` directory with the application build artefacts or git submodules. -- Use the shared packaging container (`docker/packager`) to run `cloudron build` and `cloudron install` so the host remains clean. +- Populate the `app/` directory with runtime overlays or artifacts generated during the build stage. +- Use the shared packaging container (`docker/packager`) for `cloudron build/install` to keep the host clean. +- Record decisions and operational requirements under `docs/apps/sniperphish/` as work progresses. diff --git a/apps/sniperphish/metadata.json b/apps/sniperphish/metadata.json index 6144939..8875bf2 100644 --- a/apps/sniperphish/metadata.json +++ b/apps/sniperphish/metadata.json @@ -4,6 +4,6 @@ "issue": "https://projects.knownelement.com/issues/211", "repo": "https://github.com/GemGeorge/SniperPhish-Docker.git", "additionalRepos": [], - "created": "2025-10-02T16:46:49Z", + "created": "2025-10-02T17:19:00Z", "notes": "TODO: capture packaging notes" -} \ No newline at end of file +} diff --git a/apps/sniperphish/start.sh b/apps/sniperphish/start.sh index 4dbd474..2b05ff9 100755 --- a/apps/sniperphish/start.sh +++ b/apps/sniperphish/start.sh @@ -1,8 +1,9 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Cloudron injects configuration via environment variables and files under /run -# Use this script to render config files and launch the upstream service. +# TODO: render configuration files from CLOUDRON_* environment variables +# Example: +# envsubst < /app/pkg/config.tmpl > /run/config.yaml -# TODO: Replace the command below with the correct process supervisor. -exec /bin/sh -c "echo 'Replace start.sh with application startup logic for SniperPhish' && sleep infinity" +>&2 echo "start.sh for SniperPhish is not implemented yet." +exit 1 diff --git a/apps/sniperphish/test/smoke.sh b/apps/sniperphish/test/smoke.sh index ebd1134..315d6bd 100755 --- a/apps/sniperphish/test/smoke.sh +++ b/apps/sniperphish/test/smoke.sh @@ -1,16 +1,14 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Basic container reachability check executed inside the packaging container. -# Replace curl target with an endpoint exposed by the app once the package is functional. -cloudron_app_url=${CLOUDRON_APP_ORIGIN:-"http://localhost"} +cloudron_app_origin=${CLOUDRON_APP_ORIGIN:-http://localhost} -http_code=$(curl -s -o /tmp/smoke.log -w "%{http_code}" "${cloudron_app_url}") +http_code=$(curl --silent --show-error --output /tmp/smoke.log --write-out "%{http_code}" "${cloudron_app_origin}/") if [[ "${http_code}" != "200" ]]; then - echo "Unexpected HTTP status: ${http_code}" >&2 - cat /tmp/smoke.log >&2 + >&2 echo "Smoke test failed for SniperPhish: expected HTTP 200 from ${cloudron_app_origin}/, got ${http_code}" + >&2 cat /tmp/smoke.log exit 1 fi -echo "Smoke test passed" +echo "Smoke test placeholder passed for SniperPhish" diff --git a/apps/swupdate/CloudronManifest.json b/apps/swupdate/CloudronManifest.json index a535cbe..1c21291 100644 --- a/apps/swupdate/CloudronManifest.json +++ b/apps/swupdate/CloudronManifest.json @@ -12,9 +12,16 @@ "version": "0.1.0", "tags": ["custom", "known-element"], "healthCheckPath": "/", - "memoryLimit": 536870912, "httpPort": 3000, + "memoryLimit": "512M", "addons": { "localstorage": {} + }, + "optionalAddons": { + "postgresql": {}, + "redis": {}, + "mysql": {}, + "mongodb": {}, + "sendmail": {} } } diff --git a/apps/swupdate/Dockerfile b/apps/swupdate/Dockerfile index 9b7e620..63e970e 100644 --- a/apps/swupdate/Dockerfile +++ b/apps/swupdate/Dockerfile @@ -1,21 +1,38 @@ -# syntax=docker/dockerfile:1 -FROM cloudron/base:5.0.0 +# syntax=docker/dockerfile:1.6 +ARG APP_VERSION=latest + +FROM cloudron/base:5.0.0 AS builder +WORKDIR /build + +# ----------------------------------------------------------------------------- +# TODO: Fetch and build swupdate +# Example: +# RUN git clone --depth 1 --branch "${APP_VERSION}" https://github.com/sbabic/swupdate.git source \ +# && cd source \ +# && npm ci \ +# && npm run build +# ----------------------------------------------------------------------------- + +FROM cloudron/base:5.0.0 LABEL org.opencontainers.image.source="https://github.com/sbabic/swupdate.git" LABEL org.opencontainers.image.description="Cloudron package for swupdate" -ARG APP_VERSION -ENV APP_VERSION=${APP_VERSION:-latest} +ENV APP_VERSION=${APP_VERSION} + +# ----------------------------------------------------------------------------- +# TODO: Copy build artefacts from the builder stage +# COPY --from=builder /build/source/dist /app/code +# ----------------------------------------------------------------------------- -# Copy application source into image at build time -# Replace this with a multi-stage build if upstream provides Docker images. COPY ./app /app/code - -# Copy start script and make it executable COPY ./start.sh /app/pkg/start.sh -RUN chmod +x /app/pkg/start.sh +COPY ./test /app/pkg/test + +RUN chmod +x /app/pkg/start.sh /app/pkg/test/smoke.sh \ + && mkdir -p /app/data \ + && chown -R cloudron:cloudron /app -# Cloudron expects all processes to run as cloudron user USER cloudron WORKDIR /app/code diff --git a/apps/swupdate/README.md b/apps/swupdate/README.md index a3e984e..caa5d2e 100644 --- a/apps/swupdate/README.md +++ b/apps/swupdate/README.md @@ -2,19 +2,19 @@ - **Upstream repository**: https://github.com/sbabic/swupdate.git - **Implementation issue**: https://projects.knownelement.com/issues/326 -- **Status**: Draft scaffolding generated on $(date -u +"%Y-%m-%dT%H:%M:%SZ") +- **Generated**: 2025-10-02T17:19:01Z UTC ## Packaging Checklist -1. Review upstream deployment requirements and map them to Cloudron services (database, cache, object storage, workers). -2. Update `Dockerfile` with the correct build steps and runtime dependencies. -3. Implement `start.sh` to configure the app from Cloudron-provided environment variables and launch the primary process. -4. Edit `CloudronManifest.json` with accurate metadata, permissions, ports, addons, and health checks. -5. Add integration and smoke tests under `test/` to validate the package. -6. Document manual configuration steps, migration requirements, and known gaps in this README. +1. Map upstream services (databases, caches, workers) to Cloudron addons; remove unused entries from `optionalAddons` and enable required ones under `addons`. +2. Implement the multi-stage build in `Dockerfile` to fetch/compile the correct release of swupdate. +3. Update `start.sh` to configure the app from Cloudron environment variables and launch the primary process. +4. Replace the placeholder health checks and smoke test with real coverage. +5. Complete `CloudronManifest.json` (tagline, description, versioning, resource limits, ingress, TCP ports, etc.). +6. Document manual configuration steps, migrations, and known gaps below. ## Notes -- Replace the placeholder long-running process in `start.sh`. -- Populate the `app/` directory with the application build artefacts or git submodules. -- Use the shared packaging container (`docker/packager`) to run `cloudron build` and `cloudron install` so the host remains clean. +- Populate the `app/` directory with runtime overlays or artifacts generated during the build stage. +- Use the shared packaging container (`docker/packager`) for `cloudron build/install` to keep the host clean. +- Record decisions and operational requirements under `docs/apps/swupdate/` as work progresses. diff --git a/apps/swupdate/metadata.json b/apps/swupdate/metadata.json index 15d5e8b..cb1fe51 100644 --- a/apps/swupdate/metadata.json +++ b/apps/swupdate/metadata.json @@ -4,6 +4,6 @@ "issue": "https://projects.knownelement.com/issues/326", "repo": "https://github.com/sbabic/swupdate.git", "additionalRepos": [], - "created": "2025-10-02T16:46:50Z", + "created": "2025-10-02T17:19:01Z", "notes": "TODO: capture packaging notes" -} \ No newline at end of file +} diff --git a/apps/swupdate/start.sh b/apps/swupdate/start.sh index 8b7dffc..8cc6dcf 100755 --- a/apps/swupdate/start.sh +++ b/apps/swupdate/start.sh @@ -1,8 +1,9 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Cloudron injects configuration via environment variables and files under /run -# Use this script to render config files and launch the upstream service. +# TODO: render configuration files from CLOUDRON_* environment variables +# Example: +# envsubst < /app/pkg/config.tmpl > /run/config.yaml -# TODO: Replace the command below with the correct process supervisor. -exec /bin/sh -c "echo 'Replace start.sh with application startup logic for swupdate' && sleep infinity" +>&2 echo "start.sh for swupdate is not implemented yet." +exit 1 diff --git a/apps/swupdate/test/smoke.sh b/apps/swupdate/test/smoke.sh index ebd1134..49fef7c 100755 --- a/apps/swupdate/test/smoke.sh +++ b/apps/swupdate/test/smoke.sh @@ -1,16 +1,14 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Basic container reachability check executed inside the packaging container. -# Replace curl target with an endpoint exposed by the app once the package is functional. -cloudron_app_url=${CLOUDRON_APP_ORIGIN:-"http://localhost"} +cloudron_app_origin=${CLOUDRON_APP_ORIGIN:-http://localhost} -http_code=$(curl -s -o /tmp/smoke.log -w "%{http_code}" "${cloudron_app_url}") +http_code=$(curl --silent --show-error --output /tmp/smoke.log --write-out "%{http_code}" "${cloudron_app_origin}/") if [[ "${http_code}" != "200" ]]; then - echo "Unexpected HTTP status: ${http_code}" >&2 - cat /tmp/smoke.log >&2 + >&2 echo "Smoke test failed for swupdate: expected HTTP 200 from ${cloudron_app_origin}/, got ${http_code}" + >&2 cat /tmp/smoke.log exit 1 fi -echo "Smoke test passed" +echo "Smoke test placeholder passed for swupdate" diff --git a/apps/tak-server/CloudronManifest.json b/apps/tak-server/CloudronManifest.json index 25fa12a..83ef321 100644 --- a/apps/tak-server/CloudronManifest.json +++ b/apps/tak-server/CloudronManifest.json @@ -12,9 +12,16 @@ "version": "0.1.0", "tags": ["custom", "known-element"], "healthCheckPath": "/", - "memoryLimit": 536870912, "httpPort": 3000, + "memoryLimit": "512M", "addons": { "localstorage": {} + }, + "optionalAddons": { + "postgresql": {}, + "redis": {}, + "mysql": {}, + "mongodb": {}, + "sendmail": {} } } diff --git a/apps/tak-server/Dockerfile b/apps/tak-server/Dockerfile index 53a1b56..a79e130 100644 --- a/apps/tak-server/Dockerfile +++ b/apps/tak-server/Dockerfile @@ -1,21 +1,38 @@ -# syntax=docker/dockerfile:1 -FROM cloudron/base:5.0.0 +# syntax=docker/dockerfile:1.6 +ARG APP_VERSION=latest + +FROM cloudron/base:5.0.0 AS builder +WORKDIR /build + +# ----------------------------------------------------------------------------- +# TODO: Fetch and build TAK Server +# Example: +# RUN git clone --depth 1 --branch "${APP_VERSION}" https://github.com/Cloud-RF/tak-server source \ +# && cd source \ +# && npm ci \ +# && npm run build +# ----------------------------------------------------------------------------- + +FROM cloudron/base:5.0.0 LABEL org.opencontainers.image.source="https://github.com/Cloud-RF/tak-server" LABEL org.opencontainers.image.description="Cloudron package for TAK Server" -ARG APP_VERSION -ENV APP_VERSION=${APP_VERSION:-latest} +ENV APP_VERSION=${APP_VERSION} + +# ----------------------------------------------------------------------------- +# TODO: Copy build artefacts from the builder stage +# COPY --from=builder /build/source/dist /app/code +# ----------------------------------------------------------------------------- -# Copy application source into image at build time -# Replace this with a multi-stage build if upstream provides Docker images. COPY ./app /app/code - -# Copy start script and make it executable COPY ./start.sh /app/pkg/start.sh -RUN chmod +x /app/pkg/start.sh +COPY ./test /app/pkg/test + +RUN chmod +x /app/pkg/start.sh /app/pkg/test/smoke.sh \ + && mkdir -p /app/data \ + && chown -R cloudron:cloudron /app -# Cloudron expects all processes to run as cloudron user USER cloudron WORKDIR /app/code diff --git a/apps/tak-server/README.md b/apps/tak-server/README.md index a4ffb17..766bef3 100644 --- a/apps/tak-server/README.md +++ b/apps/tak-server/README.md @@ -2,19 +2,19 @@ - **Upstream repository**: https://github.com/Cloud-RF/tak-server - **Implementation issue**: https://projects.knownelement.com/issues/180 -- **Status**: Draft scaffolding generated on $(date -u +"%Y-%m-%dT%H:%M:%SZ") +- **Generated**: 2025-10-02T17:19:00Z UTC ## Packaging Checklist -1. Review upstream deployment requirements and map them to Cloudron services (database, cache, object storage, workers). -2. Update `Dockerfile` with the correct build steps and runtime dependencies. -3. Implement `start.sh` to configure the app from Cloudron-provided environment variables and launch the primary process. -4. Edit `CloudronManifest.json` with accurate metadata, permissions, ports, addons, and health checks. -5. Add integration and smoke tests under `test/` to validate the package. -6. Document manual configuration steps, migration requirements, and known gaps in this README. +1. Map upstream services (databases, caches, workers) to Cloudron addons; remove unused entries from `optionalAddons` and enable required ones under `addons`. +2. Implement the multi-stage build in `Dockerfile` to fetch/compile the correct release of TAK Server. +3. Update `start.sh` to configure the app from Cloudron environment variables and launch the primary process. +4. Replace the placeholder health checks and smoke test with real coverage. +5. Complete `CloudronManifest.json` (tagline, description, versioning, resource limits, ingress, TCP ports, etc.). +6. Document manual configuration steps, migrations, and known gaps below. ## Notes -- Replace the placeholder long-running process in `start.sh`. -- Populate the `app/` directory with the application build artefacts or git submodules. -- Use the shared packaging container (`docker/packager`) to run `cloudron build` and `cloudron install` so the host remains clean. +- Populate the `app/` directory with runtime overlays or artifacts generated during the build stage. +- Use the shared packaging container (`docker/packager`) for `cloudron build/install` to keep the host clean. +- Record decisions and operational requirements under `docs/apps/tak-server/` as work progresses. diff --git a/apps/tak-server/metadata.json b/apps/tak-server/metadata.json index eab8fc1..41c85df 100644 --- a/apps/tak-server/metadata.json +++ b/apps/tak-server/metadata.json @@ -4,6 +4,6 @@ "issue": "https://projects.knownelement.com/issues/180", "repo": "https://github.com/Cloud-RF/tak-server", "additionalRepos": [], - "created": "2025-10-02T16:46:49Z", + "created": "2025-10-02T17:19:00Z", "notes": "TODO: capture packaging notes" -} \ No newline at end of file +} diff --git a/apps/tak-server/start.sh b/apps/tak-server/start.sh index 4e78626..bab6298 100755 --- a/apps/tak-server/start.sh +++ b/apps/tak-server/start.sh @@ -1,8 +1,9 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Cloudron injects configuration via environment variables and files under /run -# Use this script to render config files and launch the upstream service. +# TODO: render configuration files from CLOUDRON_* environment variables +# Example: +# envsubst < /app/pkg/config.tmpl > /run/config.yaml -# TODO: Replace the command below with the correct process supervisor. -exec /bin/sh -c "echo 'Replace start.sh with application startup logic for TAK Server' && sleep infinity" +>&2 echo "start.sh for TAK Server is not implemented yet." +exit 1 diff --git a/apps/tak-server/test/smoke.sh b/apps/tak-server/test/smoke.sh index ebd1134..eec266a 100755 --- a/apps/tak-server/test/smoke.sh +++ b/apps/tak-server/test/smoke.sh @@ -1,16 +1,14 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Basic container reachability check executed inside the packaging container. -# Replace curl target with an endpoint exposed by the app once the package is functional. -cloudron_app_url=${CLOUDRON_APP_ORIGIN:-"http://localhost"} +cloudron_app_origin=${CLOUDRON_APP_ORIGIN:-http://localhost} -http_code=$(curl -s -o /tmp/smoke.log -w "%{http_code}" "${cloudron_app_url}") +http_code=$(curl --silent --show-error --output /tmp/smoke.log --write-out "%{http_code}" "${cloudron_app_origin}/") if [[ "${http_code}" != "200" ]]; then - echo "Unexpected HTTP status: ${http_code}" >&2 - cat /tmp/smoke.log >&2 + >&2 echo "Smoke test failed for TAK Server: expected HTTP 200 from ${cloudron_app_origin}/, got ${http_code}" + >&2 cat /tmp/smoke.log exit 1 fi -echo "Smoke test passed" +echo "Smoke test placeholder passed for TAK Server" diff --git a/apps/target-goalert/CloudronManifest.json b/apps/target-goalert/CloudronManifest.json index e264963..c017b02 100644 --- a/apps/target-goalert/CloudronManifest.json +++ b/apps/target-goalert/CloudronManifest.json @@ -12,9 +12,16 @@ "version": "0.1.0", "tags": ["custom", "known-element"], "healthCheckPath": "/", - "memoryLimit": 536870912, "httpPort": 3000, + "memoryLimit": "512M", "addons": { "localstorage": {} + }, + "optionalAddons": { + "postgresql": {}, + "redis": {}, + "mysql": {}, + "mongodb": {}, + "sendmail": {} } } diff --git a/apps/target-goalert/Dockerfile b/apps/target-goalert/Dockerfile index bdcf1f7..db76196 100644 --- a/apps/target-goalert/Dockerfile +++ b/apps/target-goalert/Dockerfile @@ -1,21 +1,38 @@ -# syntax=docker/dockerfile:1 -FROM cloudron/base:5.0.0 +# syntax=docker/dockerfile:1.6 +ARG APP_VERSION=latest + +FROM cloudron/base:5.0.0 AS builder +WORKDIR /build + +# ----------------------------------------------------------------------------- +# TODO: Fetch and build GoAlert +# Example: +# RUN git clone --depth 1 --branch "${APP_VERSION}" https://github.com/target/goalert.git source \ +# && cd source \ +# && npm ci \ +# && npm run build +# ----------------------------------------------------------------------------- + +FROM cloudron/base:5.0.0 LABEL org.opencontainers.image.source="https://github.com/target/goalert.git" LABEL org.opencontainers.image.description="Cloudron package for GoAlert" -ARG APP_VERSION -ENV APP_VERSION=${APP_VERSION:-latest} +ENV APP_VERSION=${APP_VERSION} + +# ----------------------------------------------------------------------------- +# TODO: Copy build artefacts from the builder stage +# COPY --from=builder /build/source/dist /app/code +# ----------------------------------------------------------------------------- -# Copy application source into image at build time -# Replace this with a multi-stage build if upstream provides Docker images. COPY ./app /app/code - -# Copy start script and make it executable COPY ./start.sh /app/pkg/start.sh -RUN chmod +x /app/pkg/start.sh +COPY ./test /app/pkg/test + +RUN chmod +x /app/pkg/start.sh /app/pkg/test/smoke.sh \ + && mkdir -p /app/data \ + && chown -R cloudron:cloudron /app -# Cloudron expects all processes to run as cloudron user USER cloudron WORKDIR /app/code diff --git a/apps/target-goalert/README.md b/apps/target-goalert/README.md index b2076f2..99b19e0 100644 --- a/apps/target-goalert/README.md +++ b/apps/target-goalert/README.md @@ -2,19 +2,19 @@ - **Upstream repository**: https://github.com/target/goalert.git - **Implementation issue**: https://projects.knownelement.com/issues/204 -- **Status**: Draft scaffolding generated on $(date -u +"%Y-%m-%dT%H:%M:%SZ") +- **Generated**: 2025-10-02T17:19:00Z UTC ## Packaging Checklist -1. Review upstream deployment requirements and map them to Cloudron services (database, cache, object storage, workers). -2. Update `Dockerfile` with the correct build steps and runtime dependencies. -3. Implement `start.sh` to configure the app from Cloudron-provided environment variables and launch the primary process. -4. Edit `CloudronManifest.json` with accurate metadata, permissions, ports, addons, and health checks. -5. Add integration and smoke tests under `test/` to validate the package. -6. Document manual configuration steps, migration requirements, and known gaps in this README. +1. Map upstream services (databases, caches, workers) to Cloudron addons; remove unused entries from `optionalAddons` and enable required ones under `addons`. +2. Implement the multi-stage build in `Dockerfile` to fetch/compile the correct release of GoAlert. +3. Update `start.sh` to configure the app from Cloudron environment variables and launch the primary process. +4. Replace the placeholder health checks and smoke test with real coverage. +5. Complete `CloudronManifest.json` (tagline, description, versioning, resource limits, ingress, TCP ports, etc.). +6. Document manual configuration steps, migrations, and known gaps below. ## Notes -- Replace the placeholder long-running process in `start.sh`. -- Populate the `app/` directory with the application build artefacts or git submodules. -- Use the shared packaging container (`docker/packager`) to run `cloudron build` and `cloudron install` so the host remains clean. +- Populate the `app/` directory with runtime overlays or artifacts generated during the build stage. +- Use the shared packaging container (`docker/packager`) for `cloudron build/install` to keep the host clean. +- Record decisions and operational requirements under `docs/apps/target-goalert/` as work progresses. diff --git a/apps/target-goalert/metadata.json b/apps/target-goalert/metadata.json index ac002c4..4163758 100644 --- a/apps/target-goalert/metadata.json +++ b/apps/target-goalert/metadata.json @@ -4,6 +4,6 @@ "issue": "https://projects.knownelement.com/issues/204", "repo": "https://github.com/target/goalert.git", "additionalRepos": [], - "created": "2025-10-02T16:46:49Z", + "created": "2025-10-02T17:19:00Z", "notes": "TODO: capture packaging notes" -} \ No newline at end of file +} diff --git a/apps/target-goalert/start.sh b/apps/target-goalert/start.sh index 20611ee..901c093 100755 --- a/apps/target-goalert/start.sh +++ b/apps/target-goalert/start.sh @@ -1,8 +1,9 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Cloudron injects configuration via environment variables and files under /run -# Use this script to render config files and launch the upstream service. +# TODO: render configuration files from CLOUDRON_* environment variables +# Example: +# envsubst < /app/pkg/config.tmpl > /run/config.yaml -# TODO: Replace the command below with the correct process supervisor. -exec /bin/sh -c "echo 'Replace start.sh with application startup logic for GoAlert' && sleep infinity" +>&2 echo "start.sh for GoAlert is not implemented yet." +exit 1 diff --git a/apps/target-goalert/test/smoke.sh b/apps/target-goalert/test/smoke.sh index ebd1134..d8cef27 100755 --- a/apps/target-goalert/test/smoke.sh +++ b/apps/target-goalert/test/smoke.sh @@ -1,16 +1,14 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Basic container reachability check executed inside the packaging container. -# Replace curl target with an endpoint exposed by the app once the package is functional. -cloudron_app_url=${CLOUDRON_APP_ORIGIN:-"http://localhost"} +cloudron_app_origin=${CLOUDRON_APP_ORIGIN:-http://localhost} -http_code=$(curl -s -o /tmp/smoke.log -w "%{http_code}" "${cloudron_app_url}") +http_code=$(curl --silent --show-error --output /tmp/smoke.log --write-out "%{http_code}" "${cloudron_app_origin}/") if [[ "${http_code}" != "200" ]]; then - echo "Unexpected HTTP status: ${http_code}" >&2 - cat /tmp/smoke.log >&2 + >&2 echo "Smoke test failed for GoAlert: expected HTTP 200 from ${cloudron_app_origin}/, got ${http_code}" + >&2 cat /tmp/smoke.log exit 1 fi -echo "Smoke test passed" +echo "Smoke test placeholder passed for GoAlert" diff --git a/apps/warp/CloudronManifest.json b/apps/warp/CloudronManifest.json index fa06489..06cef14 100644 --- a/apps/warp/CloudronManifest.json +++ b/apps/warp/CloudronManifest.json @@ -12,9 +12,16 @@ "version": "0.1.0", "tags": ["custom", "known-element"], "healthCheckPath": "/", - "memoryLimit": 536870912, "httpPort": 3000, + "memoryLimit": "512M", "addons": { "localstorage": {} + }, + "optionalAddons": { + "postgresql": {}, + "redis": {}, + "mysql": {}, + "mongodb": {}, + "sendmail": {} } } diff --git a/apps/warp/Dockerfile b/apps/warp/Dockerfile index 6204067..43e5523 100644 --- a/apps/warp/Dockerfile +++ b/apps/warp/Dockerfile @@ -1,21 +1,38 @@ -# syntax=docker/dockerfile:1 -FROM cloudron/base:5.0.0 +# syntax=docker/dockerfile:1.6 +ARG APP_VERSION=latest + +FROM cloudron/base:5.0.0 AS builder +WORKDIR /build + +# ----------------------------------------------------------------------------- +# TODO: Fetch and build Warp +# Example: +# RUN git clone --depth 1 --branch "${APP_VERSION}" https://github.com/sebo-b/warp.git source \ +# && cd source \ +# && npm ci \ +# && npm run build +# ----------------------------------------------------------------------------- + +FROM cloudron/base:5.0.0 LABEL org.opencontainers.image.source="https://github.com/sebo-b/warp.git" LABEL org.opencontainers.image.description="Cloudron package for Warp" -ARG APP_VERSION -ENV APP_VERSION=${APP_VERSION:-latest} +ENV APP_VERSION=${APP_VERSION} + +# ----------------------------------------------------------------------------- +# TODO: Copy build artefacts from the builder stage +# COPY --from=builder /build/source/dist /app/code +# ----------------------------------------------------------------------------- -# Copy application source into image at build time -# Replace this with a multi-stage build if upstream provides Docker images. COPY ./app /app/code - -# Copy start script and make it executable COPY ./start.sh /app/pkg/start.sh -RUN chmod +x /app/pkg/start.sh +COPY ./test /app/pkg/test + +RUN chmod +x /app/pkg/start.sh /app/pkg/test/smoke.sh \ + && mkdir -p /app/data \ + && chown -R cloudron:cloudron /app -# Cloudron expects all processes to run as cloudron user USER cloudron WORKDIR /app/code diff --git a/apps/warp/README.md b/apps/warp/README.md index 4a3f3eb..0cbcc7e 100644 --- a/apps/warp/README.md +++ b/apps/warp/README.md @@ -2,19 +2,19 @@ - **Upstream repository**: https://github.com/sebo-b/warp.git - **Implementation issue**: https://projects.knownelement.com/issues/228 -- **Status**: Draft scaffolding generated on $(date -u +"%Y-%m-%dT%H:%M:%SZ") +- **Generated**: 2025-10-02T17:19:01Z UTC ## Packaging Checklist -1. Review upstream deployment requirements and map them to Cloudron services (database, cache, object storage, workers). -2. Update `Dockerfile` with the correct build steps and runtime dependencies. -3. Implement `start.sh` to configure the app from Cloudron-provided environment variables and launch the primary process. -4. Edit `CloudronManifest.json` with accurate metadata, permissions, ports, addons, and health checks. -5. Add integration and smoke tests under `test/` to validate the package. -6. Document manual configuration steps, migration requirements, and known gaps in this README. +1. Map upstream services (databases, caches, workers) to Cloudron addons; remove unused entries from `optionalAddons` and enable required ones under `addons`. +2. Implement the multi-stage build in `Dockerfile` to fetch/compile the correct release of Warp. +3. Update `start.sh` to configure the app from Cloudron environment variables and launch the primary process. +4. Replace the placeholder health checks and smoke test with real coverage. +5. Complete `CloudronManifest.json` (tagline, description, versioning, resource limits, ingress, TCP ports, etc.). +6. Document manual configuration steps, migrations, and known gaps below. ## Notes -- Replace the placeholder long-running process in `start.sh`. -- Populate the `app/` directory with the application build artefacts or git submodules. -- Use the shared packaging container (`docker/packager`) to run `cloudron build` and `cloudron install` so the host remains clean. +- Populate the `app/` directory with runtime overlays or artifacts generated during the build stage. +- Use the shared packaging container (`docker/packager`) for `cloudron build/install` to keep the host clean. +- Record decisions and operational requirements under `docs/apps/warp/` as work progresses. diff --git a/apps/warp/metadata.json b/apps/warp/metadata.json index 1bc1fa2..584886e 100644 --- a/apps/warp/metadata.json +++ b/apps/warp/metadata.json @@ -4,6 +4,6 @@ "issue": "https://projects.knownelement.com/issues/228", "repo": "https://github.com/sebo-b/warp.git", "additionalRepos": [], - "created": "2025-10-02T16:46:49Z", + "created": "2025-10-02T17:19:01Z", "notes": "TODO: capture packaging notes" -} \ No newline at end of file +} diff --git a/apps/warp/start.sh b/apps/warp/start.sh index 0c19b00..a9c3b85 100755 --- a/apps/warp/start.sh +++ b/apps/warp/start.sh @@ -1,8 +1,9 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Cloudron injects configuration via environment variables and files under /run -# Use this script to render config files and launch the upstream service. +# TODO: render configuration files from CLOUDRON_* environment variables +# Example: +# envsubst < /app/pkg/config.tmpl > /run/config.yaml -# TODO: Replace the command below with the correct process supervisor. -exec /bin/sh -c "echo 'Replace start.sh with application startup logic for Warp' && sleep infinity" +>&2 echo "start.sh for Warp is not implemented yet." +exit 1 diff --git a/apps/warp/test/smoke.sh b/apps/warp/test/smoke.sh index ebd1134..e081aea 100755 --- a/apps/warp/test/smoke.sh +++ b/apps/warp/test/smoke.sh @@ -1,16 +1,14 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Basic container reachability check executed inside the packaging container. -# Replace curl target with an endpoint exposed by the app once the package is functional. -cloudron_app_url=${CLOUDRON_APP_ORIGIN:-"http://localhost"} +cloudron_app_origin=${CLOUDRON_APP_ORIGIN:-http://localhost} -http_code=$(curl -s -o /tmp/smoke.log -w "%{http_code}" "${cloudron_app_url}") +http_code=$(curl --silent --show-error --output /tmp/smoke.log --write-out "%{http_code}" "${cloudron_app_origin}/") if [[ "${http_code}" != "200" ]]; then - echo "Unexpected HTTP status: ${http_code}" >&2 - cat /tmp/smoke.log >&2 + >&2 echo "Smoke test failed for Warp: expected HTTP 200 from ${cloudron_app_origin}/, got ${http_code}" + >&2 cat /tmp/smoke.log exit 1 fi -echo "Smoke test passed" +echo "Smoke test placeholder passed for Warp" diff --git a/apps/windmill/CloudronManifest.json b/apps/windmill/CloudronManifest.json index 2a2ec8e..98ed920 100644 --- a/apps/windmill/CloudronManifest.json +++ b/apps/windmill/CloudronManifest.json @@ -12,9 +12,16 @@ "version": "0.1.0", "tags": ["custom", "known-element"], "healthCheckPath": "/", - "memoryLimit": 536870912, "httpPort": 3000, + "memoryLimit": "512M", "addons": { "localstorage": {} + }, + "optionalAddons": { + "postgresql": {}, + "redis": {}, + "mysql": {}, + "mongodb": {}, + "sendmail": {} } } diff --git a/apps/windmill/Dockerfile b/apps/windmill/Dockerfile index 83e9002..965b418 100644 --- a/apps/windmill/Dockerfile +++ b/apps/windmill/Dockerfile @@ -1,21 +1,38 @@ -# syntax=docker/dockerfile:1 -FROM cloudron/base:5.0.0 +# syntax=docker/dockerfile:1.6 +ARG APP_VERSION=latest + +FROM cloudron/base:5.0.0 AS builder +WORKDIR /build + +# ----------------------------------------------------------------------------- +# TODO: Fetch and build Windmill +# Example: +# RUN git clone --depth 1 --branch "${APP_VERSION}" https://github.com/windmill-labs/windmill.git source \ +# && cd source \ +# && npm ci \ +# && npm run build +# ----------------------------------------------------------------------------- + +FROM cloudron/base:5.0.0 LABEL org.opencontainers.image.source="https://github.com/windmill-labs/windmill.git" LABEL org.opencontainers.image.description="Cloudron package for Windmill" -ARG APP_VERSION -ENV APP_VERSION=${APP_VERSION:-latest} +ENV APP_VERSION=${APP_VERSION} + +# ----------------------------------------------------------------------------- +# TODO: Copy build artefacts from the builder stage +# COPY --from=builder /build/source/dist /app/code +# ----------------------------------------------------------------------------- -# Copy application source into image at build time -# Replace this with a multi-stage build if upstream provides Docker images. COPY ./app /app/code - -# Copy start script and make it executable COPY ./start.sh /app/pkg/start.sh -RUN chmod +x /app/pkg/start.sh +COPY ./test /app/pkg/test + +RUN chmod +x /app/pkg/start.sh /app/pkg/test/smoke.sh \ + && mkdir -p /app/data \ + && chown -R cloudron:cloudron /app -# Cloudron expects all processes to run as cloudron user USER cloudron WORKDIR /app/code diff --git a/apps/windmill/README.md b/apps/windmill/README.md index 7d979f9..e6611c0 100644 --- a/apps/windmill/README.md +++ b/apps/windmill/README.md @@ -2,19 +2,19 @@ - **Upstream repository**: https://github.com/windmill-labs/windmill.git - **Implementation issue**: https://projects.knownelement.com/issues/285 -- **Status**: Draft scaffolding generated on $(date -u +"%Y-%m-%dT%H:%M:%SZ") +- **Generated**: 2025-10-02T17:19:01Z UTC ## Packaging Checklist -1. Review upstream deployment requirements and map them to Cloudron services (database, cache, object storage, workers). -2. Update `Dockerfile` with the correct build steps and runtime dependencies. -3. Implement `start.sh` to configure the app from Cloudron-provided environment variables and launch the primary process. -4. Edit `CloudronManifest.json` with accurate metadata, permissions, ports, addons, and health checks. -5. Add integration and smoke tests under `test/` to validate the package. -6. Document manual configuration steps, migration requirements, and known gaps in this README. +1. Map upstream services (databases, caches, workers) to Cloudron addons; remove unused entries from `optionalAddons` and enable required ones under `addons`. +2. Implement the multi-stage build in `Dockerfile` to fetch/compile the correct release of Windmill. +3. Update `start.sh` to configure the app from Cloudron environment variables and launch the primary process. +4. Replace the placeholder health checks and smoke test with real coverage. +5. Complete `CloudronManifest.json` (tagline, description, versioning, resource limits, ingress, TCP ports, etc.). +6. Document manual configuration steps, migrations, and known gaps below. ## Notes -- Replace the placeholder long-running process in `start.sh`. -- Populate the `app/` directory with the application build artefacts or git submodules. -- Use the shared packaging container (`docker/packager`) to run `cloudron build` and `cloudron install` so the host remains clean. +- Populate the `app/` directory with runtime overlays or artifacts generated during the build stage. +- Use the shared packaging container (`docker/packager`) for `cloudron build/install` to keep the host clean. +- Record decisions and operational requirements under `docs/apps/windmill/` as work progresses. diff --git a/apps/windmill/metadata.json b/apps/windmill/metadata.json index 32af7a5..2bf44fe 100644 --- a/apps/windmill/metadata.json +++ b/apps/windmill/metadata.json @@ -4,6 +4,6 @@ "issue": "https://projects.knownelement.com/issues/285", "repo": "https://github.com/windmill-labs/windmill.git", "additionalRepos": [], - "created": "2025-10-02T16:46:50Z", + "created": "2025-10-02T17:19:01Z", "notes": "TODO: capture packaging notes" -} \ No newline at end of file +} diff --git a/apps/windmill/start.sh b/apps/windmill/start.sh index 11257fd..3c6ecc1 100755 --- a/apps/windmill/start.sh +++ b/apps/windmill/start.sh @@ -1,8 +1,9 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Cloudron injects configuration via environment variables and files under /run -# Use this script to render config files and launch the upstream service. +# TODO: render configuration files from CLOUDRON_* environment variables +# Example: +# envsubst < /app/pkg/config.tmpl > /run/config.yaml -# TODO: Replace the command below with the correct process supervisor. -exec /bin/sh -c "echo 'Replace start.sh with application startup logic for Windmill' && sleep infinity" +>&2 echo "start.sh for Windmill is not implemented yet." +exit 1 diff --git a/apps/windmill/test/smoke.sh b/apps/windmill/test/smoke.sh index ebd1134..afb7bed 100755 --- a/apps/windmill/test/smoke.sh +++ b/apps/windmill/test/smoke.sh @@ -1,16 +1,14 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Basic container reachability check executed inside the packaging container. -# Replace curl target with an endpoint exposed by the app once the package is functional. -cloudron_app_url=${CLOUDRON_APP_ORIGIN:-"http://localhost"} +cloudron_app_origin=${CLOUDRON_APP_ORIGIN:-http://localhost} -http_code=$(curl -s -o /tmp/smoke.log -w "%{http_code}" "${cloudron_app_url}") +http_code=$(curl --silent --show-error --output /tmp/smoke.log --write-out "%{http_code}" "${cloudron_app_origin}/") if [[ "${http_code}" != "200" ]]; then - echo "Unexpected HTTP status: ${http_code}" >&2 - cat /tmp/smoke.log >&2 + >&2 echo "Smoke test failed for Windmill: expected HTTP 200 from ${cloudron_app_origin}/, got ${http_code}" + >&2 cat /tmp/smoke.log exit 1 fi -echo "Smoke test passed" +echo "Smoke test placeholder passed for Windmill" diff --git a/apps/wireflow/CloudronManifest.json b/apps/wireflow/CloudronManifest.json index 5770e5b..85518c2 100644 --- a/apps/wireflow/CloudronManifest.json +++ b/apps/wireflow/CloudronManifest.json @@ -12,9 +12,16 @@ "version": "0.1.0", "tags": ["custom", "known-element"], "healthCheckPath": "/", - "memoryLimit": 536870912, "httpPort": 3000, + "memoryLimit": "512M", "addons": { "localstorage": {} + }, + "optionalAddons": { + "postgresql": {}, + "redis": {}, + "mysql": {}, + "mongodb": {}, + "sendmail": {} } } diff --git a/apps/wireflow/Dockerfile b/apps/wireflow/Dockerfile index 22109b4..01566f3 100644 --- a/apps/wireflow/Dockerfile +++ b/apps/wireflow/Dockerfile @@ -1,21 +1,38 @@ -# syntax=docker/dockerfile:1 -FROM cloudron/base:5.0.0 +# syntax=docker/dockerfile:1.6 +ARG APP_VERSION=latest + +FROM cloudron/base:5.0.0 AS builder +WORKDIR /build + +# ----------------------------------------------------------------------------- +# TODO: Fetch and build Wireflow +# Example: +# RUN git clone --depth 1 --branch "${APP_VERSION}" https://github.com/vanila-io/wireflow.git source \ +# && cd source \ +# && npm ci \ +# && npm run build +# ----------------------------------------------------------------------------- + +FROM cloudron/base:5.0.0 LABEL org.opencontainers.image.source="https://github.com/vanila-io/wireflow.git" LABEL org.opencontainers.image.description="Cloudron package for Wireflow" -ARG APP_VERSION -ENV APP_VERSION=${APP_VERSION:-latest} +ENV APP_VERSION=${APP_VERSION} + +# ----------------------------------------------------------------------------- +# TODO: Copy build artefacts from the builder stage +# COPY --from=builder /build/source/dist /app/code +# ----------------------------------------------------------------------------- -# Copy application source into image at build time -# Replace this with a multi-stage build if upstream provides Docker images. COPY ./app /app/code - -# Copy start script and make it executable COPY ./start.sh /app/pkg/start.sh -RUN chmod +x /app/pkg/start.sh +COPY ./test /app/pkg/test + +RUN chmod +x /app/pkg/start.sh /app/pkg/test/smoke.sh \ + && mkdir -p /app/data \ + && chown -R cloudron:cloudron /app -# Cloudron expects all processes to run as cloudron user USER cloudron WORKDIR /app/code diff --git a/apps/wireflow/README.md b/apps/wireflow/README.md index ec5474f..f80f82e 100644 --- a/apps/wireflow/README.md +++ b/apps/wireflow/README.md @@ -2,19 +2,19 @@ - **Upstream repository**: https://github.com/vanila-io/wireflow.git - **Implementation issue**: https://projects.knownelement.com/issues/50 -- **Status**: Draft scaffolding generated on $(date -u +"%Y-%m-%dT%H:%M:%SZ") +- **Generated**: 2025-10-02T17:19:01Z UTC ## Packaging Checklist -1. Review upstream deployment requirements and map them to Cloudron services (database, cache, object storage, workers). -2. Update `Dockerfile` with the correct build steps and runtime dependencies. -3. Implement `start.sh` to configure the app from Cloudron-provided environment variables and launch the primary process. -4. Edit `CloudronManifest.json` with accurate metadata, permissions, ports, addons, and health checks. -5. Add integration and smoke tests under `test/` to validate the package. -6. Document manual configuration steps, migration requirements, and known gaps in this README. +1. Map upstream services (databases, caches, workers) to Cloudron addons; remove unused entries from `optionalAddons` and enable required ones under `addons`. +2. Implement the multi-stage build in `Dockerfile` to fetch/compile the correct release of Wireflow. +3. Update `start.sh` to configure the app from Cloudron environment variables and launch the primary process. +4. Replace the placeholder health checks and smoke test with real coverage. +5. Complete `CloudronManifest.json` (tagline, description, versioning, resource limits, ingress, TCP ports, etc.). +6. Document manual configuration steps, migrations, and known gaps below. ## Notes -- Replace the placeholder long-running process in `start.sh`. -- Populate the `app/` directory with the application build artefacts or git submodules. -- Use the shared packaging container (`docker/packager`) to run `cloudron build` and `cloudron install` so the host remains clean. +- Populate the `app/` directory with runtime overlays or artifacts generated during the build stage. +- Use the shared packaging container (`docker/packager`) for `cloudron build/install` to keep the host clean. +- Record decisions and operational requirements under `docs/apps/wireflow/` as work progresses. diff --git a/apps/wireflow/metadata.json b/apps/wireflow/metadata.json index 89c253a..cb02613 100644 --- a/apps/wireflow/metadata.json +++ b/apps/wireflow/metadata.json @@ -4,6 +4,6 @@ "issue": "https://projects.knownelement.com/issues/50", "repo": "https://github.com/vanila-io/wireflow.git", "additionalRepos": [], - "created": "2025-10-02T16:46:50Z", + "created": "2025-10-02T17:19:01Z", "notes": "TODO: capture packaging notes" -} \ No newline at end of file +} diff --git a/apps/wireflow/start.sh b/apps/wireflow/start.sh index 18c7425..feb785f 100755 --- a/apps/wireflow/start.sh +++ b/apps/wireflow/start.sh @@ -1,8 +1,9 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Cloudron injects configuration via environment variables and files under /run -# Use this script to render config files and launch the upstream service. +# TODO: render configuration files from CLOUDRON_* environment variables +# Example: +# envsubst < /app/pkg/config.tmpl > /run/config.yaml -# TODO: Replace the command below with the correct process supervisor. -exec /bin/sh -c "echo 'Replace start.sh with application startup logic for Wireflow' && sleep infinity" +>&2 echo "start.sh for Wireflow is not implemented yet." +exit 1 diff --git a/apps/wireflow/test/smoke.sh b/apps/wireflow/test/smoke.sh index ebd1134..6410947 100755 --- a/apps/wireflow/test/smoke.sh +++ b/apps/wireflow/test/smoke.sh @@ -1,16 +1,14 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Basic container reachability check executed inside the packaging container. -# Replace curl target with an endpoint exposed by the app once the package is functional. -cloudron_app_url=${CLOUDRON_APP_ORIGIN:-"http://localhost"} +cloudron_app_origin=${CLOUDRON_APP_ORIGIN:-http://localhost} -http_code=$(curl -s -o /tmp/smoke.log -w "%{http_code}" "${cloudron_app_url}") +http_code=$(curl --silent --show-error --output /tmp/smoke.log --write-out "%{http_code}" "${cloudron_app_origin}/") if [[ "${http_code}" != "200" ]]; then - echo "Unexpected HTTP status: ${http_code}" >&2 - cat /tmp/smoke.log >&2 + >&2 echo "Smoke test failed for Wireflow: expected HTTP 200 from ${cloudron_app_origin}/, got ${http_code}" + >&2 cat /tmp/smoke.log exit 1 fi -echo "Smoke test passed" +echo "Smoke test placeholder passed for Wireflow" diff --git a/apps/wireviz-web/CloudronManifest.json b/apps/wireviz-web/CloudronManifest.json index 351bbe6..be1b056 100644 --- a/apps/wireviz-web/CloudronManifest.json +++ b/apps/wireviz-web/CloudronManifest.json @@ -12,9 +12,16 @@ "version": "0.1.0", "tags": ["custom", "known-element"], "healthCheckPath": "/", - "memoryLimit": 536870912, "httpPort": 3000, + "memoryLimit": "512M", "addons": { "localstorage": {} + }, + "optionalAddons": { + "postgresql": {}, + "redis": {}, + "mysql": {}, + "mongodb": {}, + "sendmail": {} } } diff --git a/apps/wireviz-web/Dockerfile b/apps/wireviz-web/Dockerfile index 3baad74..46e7055 100644 --- a/apps/wireviz-web/Dockerfile +++ b/apps/wireviz-web/Dockerfile @@ -1,21 +1,38 @@ -# syntax=docker/dockerfile:1 -FROM cloudron/base:5.0.0 +# syntax=docker/dockerfile:1.6 +ARG APP_VERSION=latest + +FROM cloudron/base:5.0.0 AS builder +WORKDIR /build + +# ----------------------------------------------------------------------------- +# TODO: Fetch and build Wireviz Web +# Example: +# RUN git clone --depth 1 --branch "${APP_VERSION}" https://github.com/wireviz/wireviz-web.git source \ +# && cd source \ +# && npm ci \ +# && npm run build +# ----------------------------------------------------------------------------- + +FROM cloudron/base:5.0.0 LABEL org.opencontainers.image.source="https://github.com/wireviz/wireviz-web.git" LABEL org.opencontainers.image.description="Cloudron package for Wireviz Web" -ARG APP_VERSION -ENV APP_VERSION=${APP_VERSION:-latest} +ENV APP_VERSION=${APP_VERSION} + +# ----------------------------------------------------------------------------- +# TODO: Copy build artefacts from the builder stage +# COPY --from=builder /build/source/dist /app/code +# ----------------------------------------------------------------------------- -# Copy application source into image at build time -# Replace this with a multi-stage build if upstream provides Docker images. COPY ./app /app/code - -# Copy start script and make it executable COPY ./start.sh /app/pkg/start.sh -RUN chmod +x /app/pkg/start.sh +COPY ./test /app/pkg/test + +RUN chmod +x /app/pkg/start.sh /app/pkg/test/smoke.sh \ + && mkdir -p /app/data \ + && chown -R cloudron:cloudron /app -# Cloudron expects all processes to run as cloudron user USER cloudron WORKDIR /app/code diff --git a/apps/wireviz-web/README.md b/apps/wireviz-web/README.md index 1e0c6f1..01a18ca 100644 --- a/apps/wireviz-web/README.md +++ b/apps/wireviz-web/README.md @@ -2,19 +2,19 @@ - **Upstream repository**: https://github.com/wireviz/wireviz-web.git - **Implementation issue**: https://projects.knownelement.com/issues/276 -- **Status**: Draft scaffolding generated on $(date -u +"%Y-%m-%dT%H:%M:%SZ") +- **Generated**: 2025-10-02T17:19:01Z UTC ## Packaging Checklist -1. Review upstream deployment requirements and map them to Cloudron services (database, cache, object storage, workers). -2. Update `Dockerfile` with the correct build steps and runtime dependencies. -3. Implement `start.sh` to configure the app from Cloudron-provided environment variables and launch the primary process. -4. Edit `CloudronManifest.json` with accurate metadata, permissions, ports, addons, and health checks. -5. Add integration and smoke tests under `test/` to validate the package. -6. Document manual configuration steps, migration requirements, and known gaps in this README. +1. Map upstream services (databases, caches, workers) to Cloudron addons; remove unused entries from `optionalAddons` and enable required ones under `addons`. +2. Implement the multi-stage build in `Dockerfile` to fetch/compile the correct release of Wireviz Web. +3. Update `start.sh` to configure the app from Cloudron environment variables and launch the primary process. +4. Replace the placeholder health checks and smoke test with real coverage. +5. Complete `CloudronManifest.json` (tagline, description, versioning, resource limits, ingress, TCP ports, etc.). +6. Document manual configuration steps, migrations, and known gaps below. ## Notes -- Replace the placeholder long-running process in `start.sh`. -- Populate the `app/` directory with the application build artefacts or git submodules. -- Use the shared packaging container (`docker/packager`) to run `cloudron build` and `cloudron install` so the host remains clean. +- Populate the `app/` directory with runtime overlays or artifacts generated during the build stage. +- Use the shared packaging container (`docker/packager`) for `cloudron build/install` to keep the host clean. +- Record decisions and operational requirements under `docs/apps/wireviz-web/` as work progresses. diff --git a/apps/wireviz-web/metadata.json b/apps/wireviz-web/metadata.json index 5eb5e70..e7c99fd 100644 --- a/apps/wireviz-web/metadata.json +++ b/apps/wireviz-web/metadata.json @@ -4,6 +4,6 @@ "issue": "https://projects.knownelement.com/issues/276", "repo": "https://github.com/wireviz/wireviz-web.git", "additionalRepos": [], - "created": "2025-10-02T16:46:49Z", + "created": "2025-10-02T17:19:01Z", "notes": "TODO: capture packaging notes" -} \ No newline at end of file +} diff --git a/apps/wireviz-web/start.sh b/apps/wireviz-web/start.sh index a88a7f1..c7ace11 100755 --- a/apps/wireviz-web/start.sh +++ b/apps/wireviz-web/start.sh @@ -1,8 +1,9 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Cloudron injects configuration via environment variables and files under /run -# Use this script to render config files and launch the upstream service. +# TODO: render configuration files from CLOUDRON_* environment variables +# Example: +# envsubst < /app/pkg/config.tmpl > /run/config.yaml -# TODO: Replace the command below with the correct process supervisor. -exec /bin/sh -c "echo 'Replace start.sh with application startup logic for Wireviz Web' && sleep infinity" +>&2 echo "start.sh for Wireviz Web is not implemented yet." +exit 1 diff --git a/apps/wireviz-web/test/smoke.sh b/apps/wireviz-web/test/smoke.sh index ebd1134..959e9cd 100755 --- a/apps/wireviz-web/test/smoke.sh +++ b/apps/wireviz-web/test/smoke.sh @@ -1,16 +1,14 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Basic container reachability check executed inside the packaging container. -# Replace curl target with an endpoint exposed by the app once the package is functional. -cloudron_app_url=${CLOUDRON_APP_ORIGIN:-"http://localhost"} +cloudron_app_origin=${CLOUDRON_APP_ORIGIN:-http://localhost} -http_code=$(curl -s -o /tmp/smoke.log -w "%{http_code}" "${cloudron_app_url}") +http_code=$(curl --silent --show-error --output /tmp/smoke.log --write-out "%{http_code}" "${cloudron_app_origin}/") if [[ "${http_code}" != "200" ]]; then - echo "Unexpected HTTP status: ${http_code}" >&2 - cat /tmp/smoke.log >&2 + >&2 echo "Smoke test failed for Wireviz Web: expected HTTP 200 from ${cloudron_app_origin}/, got ${http_code}" + >&2 cat /tmp/smoke.log exit 1 fi -echo "Smoke test passed" +echo "Smoke test placeholder passed for Wireviz Web" diff --git a/docker/devtools/Dockerfile b/docker/devtools/Dockerfile new file mode 100644 index 0000000..cd827f3 --- /dev/null +++ b/docker/devtools/Dockerfile @@ -0,0 +1,22 @@ +FROM python:3.11-slim + +ENV DEBIAN_FRONTEND=noninteractive \ + PIP_DISABLE_PIP_VERSION_CHECK=1 \ + PYTHONDONTWRITEBYTECODE=1 + +RUN apt-get update \ + && apt-get install --yes --no-install-recommends \ + git \ + jq \ + curl \ + ca-certificates \ + make \ + && rm -rf /var/lib/apt/lists/* + +WORKDIR /workspace + +COPY ./docker/devtools/requirements.txt /tmp/requirements.txt +RUN pip install --no-cache-dir -r /tmp/requirements.txt + +ENTRYPOINT ["bash", "-lc"] +CMD ["sleep infinity"] diff --git a/docker/devtools/requirements.txt b/docker/devtools/requirements.txt new file mode 100644 index 0000000..43d380e --- /dev/null +++ b/docker/devtools/requirements.txt @@ -0,0 +1,2 @@ +Jinja2>=3.1.4 +jsonschema>=4.22.0 diff --git a/docs/APP_STATUS.md b/docs/APP_STATUS.md index 9669d1a..02a7b3a 100644 --- a/docs/APP_STATUS.md +++ b/docs/APP_STATUS.md @@ -1,6 +1,6 @@ # Application Status -_Updated: 2025-10-02T16:50:06Z_ +_Updated: 2025-10-02T17:22:39Z_ | Slug | Title | Version | Status | Issue | | --- | --- | --- | --- | --- | diff --git a/docs/CI_CD_GITEA.md b/docs/CI_CD_GITEA.md index 99db959..767c0cf 100644 --- a/docs/CI_CD_GITEA.md +++ b/docs/CI_CD_GITEA.md @@ -14,22 +14,26 @@ This project uses the Gitea Actions runner and the built-in container registry h ## Workflow overview -The manual `workflow_dispatch` job builds the `docker/ci-runner` image, then executes `scripts/ci_local.sh` with the requested task list (default `all`). This mirrors the local harness, so whatever succeeds locally will succeed in CI. +The manual `workflow_dispatch` job builds the CI image and then executes the same commands you run locally via: -> Re-enable push/PR triggers once a runner is available and `make ci-local` is consistently green. +```bash +./run/dev.sh python scripts/lint_repo.py --slug apache-apisix --strict +./run/dev.sh python scripts/generate_status.py --preserve-timestamp +``` + +> Re-enable push/PR triggers once a runner is available and the commands above consistently succeed. ## Container registry usage - Tag Cloudron packages against the registry namespace, e.g. `git.knownelement.com/knel/cloudron/apache-apisix:`. -- The packager helper script reads `IMAGE_NAME`; override it when pushing to the registry: +- Build and push images directly via Docker: ```bash - IMAGE_NAME=git.knownelement.com/knel/cloudron-packager BUILD=1 scripts/run_packager.sh + docker build -t git.knownelement.com/knel/cloudron-packager docker/packager docker push git.knownelement.com/knel/cloudron-packager ``` -- Cloudron’s CLI can push directly to the registry once you log in within the packager container. +- Cloudron’s CLI can push directly to the registry once you log in within the packager shell (`./run/packager.sh`). ## Future enhancements -- Add `make lint` and `make status` as required checks in Gitea branch protection. +- Add lint/status checks as required gates in Gitea branch protection. - Extend the workflow with matrix builds for priority apps (e.g. run smoke scripts once implemented). - diff --git a/docs/LOCAL_TESTING.md b/docs/LOCAL_TESTING.md index 65bb6f9..68aaf84 100644 --- a/docs/LOCAL_TESTING.md +++ b/docs/LOCAL_TESTING.md @@ -1,33 +1,20 @@ # Local Test Harness -All verification runs locally inside Docker containers so your workstation matches the eventual Gitea Actions runner exactly. +All verification runs through the wrapper scripts under `run/`, ensuring every command executes in Docker. -## CI-equivalent container +## Devtools checks -- `docker/ci-runner/Dockerfile` builds the image `knel/cloudron-ci`, derived from the same base the Gitea runner will use. -- `scripts/ci_local.sh` orchestrates tasks inside that container. Run `BUILD=1 ./scripts/ci_local.sh lint` the first time to build the image. -- Tasks: - - `lint` → `make lint` + `make status` + `git diff docs/APP_STATUS.md` - - `packager-smoke` → builds `docker/packager` and runs `cloudron --help` - - `all` (default) → runs both. - -The script mounts `/var/run/docker.sock` so Docker CLI calls inside the container reuse the host daemon. - -## Git hooks - -Use `scripts/hooks/install_hooks.sh` to install local hooks: +Use `./run/dev.sh` for linting and documentation updates: ```bash -./scripts/hooks/install_hooks.sh +./run/dev.sh python scripts/lint_repo.py --slug apache-apisix --strict +./run/dev.sh python scripts/generate_status.py --preserve-timestamp ``` -- `pre-commit` runs `./scripts/ci_local.sh lint`. -- `post-commit` refreshes `docs/APP_STATUS.md` (non-fatal). -- `pre-push` runs the packager smoke test. +## Packaging shell -Set `SKIP_CI_HOOKS=1` when you need to bypass the hooks temporarily. +Invoke `./run/packager.sh` (optionally with `BUILD=1`) when you need the Cloudron CLI to build, install, or push packages. -## Alignment with Gitea Actions - -The `.gitea/workflows/ci.yml` workflow wraps the same `scripts/ci_local.sh` entrypoint and is currently manual-only (`workflow_dispatch`). Enable push/PR triggers once a runner is provisioned. +## CI parity +The Gitea workflow calls the same commands via the devtools image. To mimic it locally, run the lint/status commands above followed by any smoke tests inside the packager shell. diff --git a/docs/PACKAGING_GUIDE.md b/docs/PACKAGING_GUIDE.md index 6c5e705..3da1dd9 100644 --- a/docs/PACKAGING_GUIDE.md +++ b/docs/PACKAGING_GUIDE.md @@ -4,79 +4,92 @@ This repository standardises the workflow for building and maintaining Cloudron ## Reference workflow -1. Generate a package scaffold from the shared template using `scripts/new_app.py`. -2. Run all build, test, and release tasks inside the `docker/packager` container to avoid host pollution. -3. Implement application-specific build steps in `apps//Dockerfile` and configure the runtime via `start.sh`. -4. Update `CloudronManifest.json` with accurate metadata, addons, ports, and health checks based on the upstream project. -5. Build and test locally with the Cloudron CLI (`cloudron build`, `cloudron install --app `) inside the packaging container. -6. Push the image to the Cloudron registry (`cloudron push`) and publish once happy with smoke-test coverage. +1. Build or refresh the devtools image when dependencies change: + ```bash + ./run/dev.sh python --version + ``` +2. Enter an interactive devtools shell so every command runs inside Docker: + ```bash + ./run/dev.sh bash --login + ``` +3. Implement application-specific build steps in `apps//Dockerfile` and configure runtime behaviour through `start.sh`. +4. Update `CloudronManifest.json` with accurate metadata, addons, ports, and health checks. +5. Build and test using the devtools shell or one-off wrappers. +6. Push new images via the Cloudron packager shell when smoke tests pass. ## Cloudron packaging essentials -- **Base image**: Start from `cloudron/base:` and add only the dependencies the app requires. -- **CloudronManifest**: The manifest declares metadata, exposed ports, resource limits, addons (databases, object storage, email), and health checks. Always keep the `id` stable since it uniquely identifies the package inside Cloudron ecosystems. -- **Start script**: Use `start.sh` to render configuration from environment variables and launch the primary process under the `cloudron` user. -- **Tests**: Provide smoke tests in `test/` that Cloudron can run via `cloudron build --test`. -- **Updates**: Bump the manifest `version`, document the change in `changelog`, and rebuild when upstream releases. +- **Base image:** The runtime stage **must** derive from `cloudron/base:`; use a dedicated builder stage to compile artefacts and copy only what you need. +- **CloudronManifest:** Declare metadata, exposed ports, resource limits, addons, and health checks. Keep `id` stable and set realistic limits per app. +- **Start script:** Render configuration from environment variables and launch the primary process as `cloudron`. +- **Tests:** Provide smoke tests in `test/` so `cloudron build --test` can validate deployments. +- **Updates:** Bump the manifest `version`, document the change in `changelog`, and rebuild for upstream releases. ## Repository linting -Run the scaffold lint checks after editing an app to catch placeholder artefacts: +Run lint checks entirely through the devtools wrapper: ```bash -python3 scripts/lint_repo.py +./run/dev.sh python scripts/lint_repo.py --slug apache-apisix --strict ``` -Set `CLOUDRON_BASE` to override the expected base image version when needed. +Add `--base-prefix` if you intentionally change the final base image prefix. -Use the Makefile shortcuts for common tasks: +## Common workflows + +Interactive session (recommended while iterating): ```bash -make scaffold # regenerate scaffolds from catalog -make lint # run repo lint checks -make status # refresh docs/APP_STATUS.md +./run/dev.sh bash --login + +# inside the container +python scripts/new_app.py --slug apache-apisix +python scripts/new_app.py --force +python scripts/lint_repo.py --slug apache-apisix --strict +python scripts/generate_status.py --preserve-timestamp ``` -Leverage the Gitea Actions workflow (`.gitea/workflows/ci.yml`) to enforce `make lint` and status generation on every push; instructions for runner setup live in `docs/CI_CD_GITEA.md`. +Non-interactive equivalents: -Run the local harness via `./scripts/ci_local.sh` (or `make ci-local`) to replicate the CI pipeline without relying on a remote runner; see `docs/LOCAL_TESTING.md` for hook integration. +```bash +./run/dev.sh python scripts/new_app.py --slug apache-apisix +./run/dev.sh python scripts/new_app.py --force +./run/dev.sh python scripts/lint_repo.py --slug apache-apisix --strict +./run/dev.sh python scripts/generate_status.py --preserve-timestamp +``` ## Using the packager container -```bash -# Build the helper image -BUILD=1 scripts/run_packager.sh +Open the Cloudron packaging environment via: -# Launch an interactive shell inside the packaging environment -scripts/run_packager.sh +```bash +./run/packager.sh ``` -The container bundles the Cloudron CLI, Docker CLI, git, curl, and other tooling for reproducible builds. The host Docker socket is mounted so you can reuse local credentials while keeping the host clean. +Pass `BUILD=1` to rebuild the image before launching (`BUILD=1 ./run/packager.sh`). Use this shell for `cloudron build`, `cloudron install`, and `cloudron push` operations. ## Adding a new application -```bash -# Create the full scaffold for all catalog entries -python3 scripts/new_app.py +Generate scaffolds with the devtools wrapper: -# Or generate a single skeleton -python3 scripts/new_app.py --slug apache-apisix +```bash +./run/dev.sh python scripts/new_app.py --force # regenerate entire catalog +./run/dev.sh python scripts/new_app.py --slug apache-apisix ``` Each scaffold contains: -- `Dockerfile` – build instructions +- `Dockerfile` – multi-stage build instructions - `start.sh` – runtime entrypoint - `CloudronManifest.json` – metadata and permissions - `test/smoke.sh` – placeholder smoke test - `metadata.json` – issue and upstream bookkeeping - `README.md` – packaging checklist -Update these files with the app-specific details, add upstream artefacts under `app/`, and commit the changes. +Update these files with app-specific details, add artefacts under `app/`, and commit the changes. ## Repository etiquette - Document design decisions and manual steps in `docs/` or the per-app README. - Keep automation scripts idempotent; rerunning them should not damage uncommitted work. - Use semantic versioning in manifest files (`MAJOR.MINOR.PATCH`). - diff --git a/run/dev.sh b/run/dev.sh new file mode 100755 index 0000000..cb859ff --- /dev/null +++ b/run/dev.sh @@ -0,0 +1,8 @@ +#!/bin/bash +set -euo pipefail +IMAGE_NAME="knel/cloudron-devtools" +if ! docker image inspect "${IMAGE_NAME}" >/dev/null 2>&1; then + echo "Devtools image '${IMAGE_NAME}' not found. Building..." + docker build -t "${IMAGE_NAME}" -f docker/devtools/Dockerfile . +fi +docker run --rm -it -v "$PWD:/workspace" -v "/var/run/docker.sock:/var/run/docker.sock" -w /workspace "${IMAGE_NAME}" "$@" diff --git a/run/packager.sh b/run/packager.sh new file mode 100755 index 0000000..83751c7 --- /dev/null +++ b/run/packager.sh @@ -0,0 +1,8 @@ +#!/bin/bash +set -euo pipefail +IMAGE_NAME="knel/cloudron-packager" +if [[ "${BUILD:-0}" == "1" ]] || ! docker image inspect "${IMAGE_NAME}" >/dev/null 2>&1; then + echo "Packager image '${IMAGE_NAME}' not found or BUILD=1. Building..." + docker build -t "${IMAGE_NAME}" docker/packager +fi +docker run --rm -it -v "$PWD:/workspace" -v "/var/run/docker.sock:/var/run/docker.sock" -w /workspace -e "HOME=/home/cloudron" "${IMAGE_NAME}" bash diff --git a/schema/cloudron-manifest.schema.json b/schema/cloudron-manifest.schema.json new file mode 100644 index 0000000..8450800 --- /dev/null +++ b/schema/cloudron-manifest.schema.json @@ -0,0 +1,62 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Cloudron Manifest", + "type": "object", + "required": ["manifestVersion", "id", "title", "version", "addons"], + "properties": { + "manifestVersion": { + "type": "integer", + "enum": [2] + }, + "id": { + "type": "string", + "pattern": "^[a-z0-9]+(\\.[a-z0-9]+)+$" + }, + "title": { + "type": "string", + "minLength": 1 + }, + "author": { + "type": "string" + }, + "tagline": { + "type": "string" + }, + "description": { + "type": "string" + }, + "changelog": { + "type": "string" + }, + "website": { + "type": "string" + }, + "supportUrl": { + "type": "string" + }, + "sourceUrl": { + "type": "string" + }, + "version": { + "type": "string" + }, + "tags": { + "type": "array", + "items": {"type": "string"} + }, + "healthCheckPath": { + "type": "string" + }, + "httpPort": { + "type": "integer", + "minimum": 1 + }, + "addons": { + "type": "object" + }, + "optionalAddons": { + "type": "object" + } + }, + "additionalProperties": true +} diff --git a/scripts/ci_local.sh b/scripts/ci_local.sh deleted file mode 100755 index 8a78033..0000000 --- a/scripts/ci_local.sh +++ /dev/null @@ -1,83 +0,0 @@ -#!/bin/bash -set -euo pipefail - -REPO_ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd) -CI_IMAGE=${CI_IMAGE:-knel/cloudron-ci} -BUILD=${BUILD:-0} - -ensure_image() { - if [[ "${BUILD}" == "1" ]]; then - docker build -t "${CI_IMAGE}" "${REPO_ROOT}/docker/ci-runner" - return - fi - - if ! docker image inspect "${CI_IMAGE}" >/dev/null 2>&1; then - docker build -t "${CI_IMAGE}" "${REPO_ROOT}/docker/ci-runner" - fi -} - -run_in_ci() { - local cmd=$1 - docker run --rm -t \ - -v "${REPO_ROOT}:/workspace" \ - -v /var/run/docker.sock:/var/run/docker.sock \ - "${CI_IMAGE}" "${cmd}" -} - -lint() { - run_in_ci 'git config --global --add safe.directory /workspace && make lint && make status && git diff --exit-code docs/APP_STATUS.md' -} - -packager_smoke() { - run_in_ci 'git config --global --add safe.directory /workspace && docker build -t knel/cloudron-packager-test docker/packager && docker run --rm knel/cloudron-packager-test cloudron --help' -} - -usage() { - cat <&2 - usage - exit 1 - ;; - esac -} - -main "$@" diff --git a/scripts/generate_status.py b/scripts/generate_status.py index ed0a795..2efa844 100755 --- a/scripts/generate_status.py +++ b/scripts/generate_status.py @@ -1,8 +1,10 @@ #!/usr/bin/env python3 """Produce status documentation for all apps.""" +import argparse import json import pathlib +import re from datetime import datetime from typing import Dict, List @@ -30,7 +32,7 @@ def detect_status(app_dir: pathlib.Path) -> str: placeholders = 0 if "TODO" in json.dumps(manifest): placeholders += 1 - if "Replace start.sh" in start_script: + if "not implemented" in start_script: placeholders += 1 if placeholders == 0: @@ -50,7 +52,27 @@ def render_table(rows: List[Dict[str, str]]) -> str: return "\n".join(lines) +def parse_args() -> argparse.Namespace: + parser = argparse.ArgumentParser(description="Generate docs/APP_STATUS.md") + parser.add_argument( + "--preserve-timestamp", + action="store_true", + help="Reuse the existing timestamp if the status file already exists", + ) + return parser.parse_args() + + +def extract_existing_timestamp(path: pathlib.Path) -> str | None: + if not path.exists(): + return None + match = re.search(r"_Updated: ([0-9T:-]+Z)_", path.read_text(encoding="utf-8")) + if match: + return match.group(1) + return None + + def main() -> None: + args = parse_args() catalog = load_catalog() rows: List[Dict[str, str]] = [] for entry in catalog: @@ -65,7 +87,13 @@ def main() -> None: "issue": entry.get("issue", "") }) - output = ["# Application Status", "", f"_Updated: {datetime.utcnow().isoformat(timespec='seconds')}Z_", "", render_table(rows)] + timestamp = datetime.utcnow().isoformat(timespec='seconds') + "Z" + if args.preserve_timestamp: + existing = extract_existing_timestamp(ROOT / "docs" / "APP_STATUS.md") + if existing: + timestamp = existing + + output = ["# Application Status", "", f"_Updated: {timestamp}_", "", render_table(rows)] status_path = ROOT / "docs" / "APP_STATUS.md" status_path.write_text("\n".join(output) + "\n", encoding="utf-8") print(f"Updated {status_path.relative_to(ROOT)}") diff --git a/scripts/hooks/install_hooks.sh b/scripts/hooks/install_hooks.sh deleted file mode 100755 index 31e9f43..0000000 --- a/scripts/hooks/install_hooks.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash -set -euo pipefail - -REPO_ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd) -HOOK_DIR="${REPO_ROOT}/.git/hooks" - -if [[ ! -d "${HOOK_DIR}" ]]; then - echo "This script must be run inside a git repository." >&2 - exit 1 -fi - -for hook in pre-commit post-commit pre-push; do - ln -sf "${REPO_ROOT}/scripts/hooks/${hook}" "${HOOK_DIR}/${hook}" - chmod +x "${HOOK_DIR}/${hook}" - echo "Installed ${hook} hook" -done diff --git a/scripts/hooks/post-commit b/scripts/hooks/post-commit deleted file mode 100755 index 09b46bc..0000000 --- a/scripts/hooks/post-commit +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash -set -euo pipefail - -if [[ "${SKIP_CI_HOOKS:-}" == "1" ]]; then - echo "Skipping CI hooks because SKIP_CI_HOOKS=1" - exit 0 -fi - -REPO_ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd) - -${REPO_ROOT}/scripts/ci_local.sh status || true diff --git a/scripts/hooks/pre-commit b/scripts/hooks/pre-commit deleted file mode 100755 index eb178af..0000000 --- a/scripts/hooks/pre-commit +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash -set -euo pipefail - -if [[ "${SKIP_CI_HOOKS:-}" == "1" ]]; then - echo "Skipping CI hooks because SKIP_CI_HOOKS=1" - exit 0 -fi - -REPO_ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd) - -${REPO_ROOT}/scripts/ci_local.sh lint diff --git a/scripts/hooks/pre-push b/scripts/hooks/pre-push deleted file mode 100755 index dc47e31..0000000 --- a/scripts/hooks/pre-push +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash -set -euo pipefail - -if [[ "${SKIP_CI_HOOKS:-}" == "1" ]]; then - echo "Skipping CI hooks because SKIP_CI_HOOKS=1" - exit 0 -fi - -REPO_ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd) - -${REPO_ROOT}/scripts/ci_local.sh packager-smoke diff --git a/scripts/lint_repo.py b/scripts/lint_repo.py index 9503a8a..d8c563f 100755 --- a/scripts/lint_repo.py +++ b/scripts/lint_repo.py @@ -1,96 +1,236 @@ #!/usr/bin/env python3 -"""Basic sanity checks for Cloudron packaging scaffolds.""" +"""Lint Cloudron app scaffolds.""" +from __future__ import annotations + +import argparse import json import os import pathlib -import sys -from typing import Dict, List +import subprocess +from dataclasses import dataclass +from typing import Dict, Iterable, List, Sequence, Tuple + +try: + import jsonschema +except ModuleNotFoundError as exc: # pragma: no cover - guidance for local execution + raise SystemExit( + "jsonschema is required. Run this script through './run/dev.sh python scripts/lint_repo.py ...' so dependencies come from the devtools container." + ) from exc ROOT = pathlib.Path(__file__).resolve().parents[1] -EXPECTED_BASE = os.environ.get("CLOUDRON_BASE", "cloudron/base:5.0.0") +SCHEMA_PATH = ROOT / "schema" / "cloudron-manifest.schema.json" +DEFAULT_BASE_IMAGE_PREFIX = "cloudron/base" -def find_apps(apps_dir: pathlib.Path) -> List[pathlib.Path]: +@dataclass +class Issue: + severity: str # "error" or "warning" + message: str + + def __str__(self) -> str: + return f"{self.severity.upper()}: {self.message}" + + +def load_schema() -> Dict[str, object]: + with SCHEMA_PATH.open("r", encoding="utf-8") as handle: + return json.load(handle) + + +def list_apps(apps_dir: pathlib.Path) -> List[pathlib.Path]: return sorted(p for p in apps_dir.iterdir() if p.is_dir()) -def check_manifest(app_dir: pathlib.Path) -> List[str]: - issues: List[str] = [] - manifest = app_dir / "CloudronManifest.json" - if not manifest.exists(): - issues.append("missing CloudronManifest.json") - return issues +def resolve_slugs_from_paths(paths: Sequence[str]) -> List[str]: + slugs = set() + for path in paths: + parts = pathlib.PurePosixPath(path).parts + if len(parts) >= 2 and parts[0] == "apps": + slugs.add(parts[1]) + return sorted(slugs) + + +def collect_paths_from_git(diff_target: str) -> List[str]: + if not diff_target: + return [] + result = subprocess.run( + ["git", "diff", "--name-only", diff_target], + cwd=ROOT, + check=False, + capture_output=True, + text=True, + ) + if result.returncode != 0: + return [] + return [line.strip() for line in result.stdout.splitlines() if line.strip()] + + +def parse_args() -> argparse.Namespace: + parser = argparse.ArgumentParser(description="Lint Cloudron app scaffolds") + parser.add_argument("--slug", action="append", dest="slugs", help="Limit linting to the provided slug") + parser.add_argument("--path", action="append", dest="paths", help="Infer slugs from changed file paths") + parser.add_argument("--git-diff", default=None, help="Infer paths from git diff target (e.g. HEAD)") + parser.add_argument("--strict", action="store_true", help="Treat placeholder warnings as errors") + parser.add_argument("--base-prefix", default=DEFAULT_BASE_IMAGE_PREFIX, help="Expected base image prefix") + return parser.parse_args() + + +def load_manifest(manifest_path: pathlib.Path, schema: Dict[str, object]) -> Tuple[Dict[str, object] | None, List[Issue]]: + issues: List[Issue] = [] + if not manifest_path.exists(): + issues.append(Issue("error", "missing CloudronManifest.json")) + return None, issues try: - data = json.loads(manifest.read_text(encoding="utf-8")) + data = json.loads(manifest_path.read_text(encoding="utf-8")) except json.JSONDecodeError as exc: - issues.append(f"manifest JSON invalid: {exc}") - return issues - for key in ("id", "title", "version"): - if not data.get(key): - issues.append(f"manifest missing {key}") - tagline = data.get("tagline", "") - description = data.get("description", "") - if "TODO" in tagline: - issues.append("manifest tagline still contains TODO placeholder") - if "TODO" in description: - issues.append("manifest description still contains TODO placeholder") - return issues + issues.append(Issue("error", f"manifest JSON invalid: {exc}")) + return None, issues + + try: + jsonschema.validate(data, schema) + except jsonschema.ValidationError as exc: + issues.append(Issue("error", f"manifest schema violation: {exc.message}")) + + if "TODO" in data.get("tagline", ""): + issues.append(Issue("warning", "manifest tagline still contains TODO placeholder")) + if "TODO" in data.get("description", ""): + issues.append(Issue("warning", "manifest description still contains TODO placeholder")) + + return data, issues -def check_dockerfile(app_dir: pathlib.Path) -> List[str]: - issues: List[str] = [] - dockerfile = app_dir / "Dockerfile" +def parse_dockerfile(dockerfile: pathlib.Path) -> Tuple[str | None, List[str]]: + import re + if not dockerfile.exists(): - issues.append("missing Dockerfile") - return issues - first_from = None + return None, ["missing Dockerfile"] + + stage_sources: Dict[str, str] = {} + stage_order: List[str] = [] + final_reference: str | None = None + + pattern = re.compile( + r"^FROM\s+(?:(?:--[\w=/\-:.]+\s+)+)?(?P[\w./:@+-]+)(?:\s+AS\s+(?P[A-Za-z0-9_\-\.]+))?", + re.IGNORECASE, + ) + for line in dockerfile.read_text(encoding="utf-8").splitlines(): - line = line.strip() - if line.startswith("FROM "): - first_from = line.split()[1] - break - if first_from != EXPECTED_BASE: - issues.append(f"Dockerfile base image '{first_from}' != '{EXPECTED_BASE}'") - return issues + stripped = line.strip() + if not stripped or stripped.startswith("#"): + continue + if not stripped.upper().startswith("FROM"): + continue + match = pattern.match(stripped) + if not match: + continue + image = match.group("image") + alias = match.group("alias") + stage_name = alias or f"__stage_{len(stage_order)}" + stage_sources[stage_name] = image + stage_order.append(stage_name) + final_reference = stage_name + + if final_reference is None: + return None, ["Dockerfile does not define any FROM instructions"] + + return resolve_final_image(final_reference, stage_sources), [] -def check_start_script(app_dir: pathlib.Path) -> List[str]: - issues: List[str] = [] - start = app_dir / "start.sh" - if not start.exists(): - issues.append("missing start.sh") +def resolve_final_image(stage: str, stage_sources: Dict[str, str]) -> str: + seen = set() + current = stage + while True: + source = stage_sources.get(current) + if source is None: + return current + if source not in stage_sources: + return source + if source in seen: + # Circular reference; return last known reference to avoid infinite loop + return source + seen.add(source) + current = source + + +def lint_dockerfile(dockerfile: pathlib.Path, base_prefix: str) -> List[Issue]: + issues: List[Issue] = [] + final_image, errors = parse_dockerfile(dockerfile) + if errors: + for err in errors: + issues.append(Issue("error", err)) return issues - mode = start.stat().st_mode - if not mode & 0o111: - issues.append("start.sh is not executable") - if "Replace start.sh" in start.read_text(encoding="utf-8"): - issues.append("start.sh still contains placeholder command") + assert final_image is not None + if not final_image.startswith(base_prefix): + issues.append( + Issue( + "error", + f"final Docker image '{final_image}' does not use expected base prefix '{base_prefix}'", + ) + ) + content = dockerfile.read_text(encoding="utf-8") + if "chown -R cloudron:cloudron" not in content: + issues.append(Issue("warning", "Dockerfile missing chown step for /app")) return issues -def main() -> int: +def lint_start_script(start_script: pathlib.Path) -> List[Issue]: + issues: List[Issue] = [] + if not start_script.exists(): + issues.append(Issue("error", "missing start.sh")) + return issues + if not os.access(start_script, os.X_OK): + issues.append(Issue("error", "start.sh is not executable")) + text = start_script.read_text(encoding="utf-8") + if "not implemented" in text: + issues.append(Issue("warning", "start.sh still contains not-implemented placeholder")) + return issues + + +def lint_app(app_dir: pathlib.Path, base_prefix: str, schema: Dict[str, object]) -> List[Issue]: + _, manifest_issues = load_manifest(app_dir / "CloudronManifest.json", schema) + dockerfile_issues = lint_dockerfile(app_dir / "Dockerfile", base_prefix) + start_issues = lint_start_script(app_dir / "start.sh") + return manifest_issues + dockerfile_issues + start_issues + + +def select_slugs(apps_dir: pathlib.Path, args: argparse.Namespace) -> List[str]: + slugs = set(args.slugs or []) + if args.paths: + slugs.update(resolve_slugs_from_paths(args.paths)) + if args.git_diff: + slugs.update(resolve_slugs_from_paths(collect_paths_from_git(args.git_diff))) + if not slugs: + return [path.name for path in list_apps(apps_dir)] + return sorted(slugs) + + +def main() -> None: + args = parse_args() apps_dir = ROOT / "apps" - if not apps_dir.exists(): - print("No apps directory present", file=sys.stderr) - return 1 - failures = 0 - for app_dir in find_apps(apps_dir): - app_issues: List[str] = [] - app_issues.extend(check_manifest(app_dir)) - app_issues.extend(check_dockerfile(app_dir)) - app_issues.extend(check_start_script(app_dir)) - if app_issues: - failures += 1 - print(f"[FAIL] {app_dir.relative_to(ROOT)}") - for issue in app_issues: - print(f" - {issue}") - if failures: - print(f"\n{failures} app(s) require updates", file=sys.stderr) - return 2 - print("All apps passed lint checks") - return 0 + schema = load_schema() + + slugs = select_slugs(apps_dir, args) + + hard_failures = 0 + for slug in slugs: + app_dir = apps_dir / slug + if not app_dir.exists(): + print(f"[SKIP] {slug}: directory does not exist") + continue + issues = lint_app(app_dir, args.base_prefix, schema) + if not issues: + print(f"[OK] {slug}") + continue + print(f"[ISSUES] {slug}") + for issue in issues: + print(f" - {issue}") + for issue in issues: + if issue.severity == "error" or (issue.severity == "warning" and args.strict): + hard_failures += 1 + + if hard_failures: + raise SystemExit(f"Lint failed with {hard_failures} blocking issue(s)") if __name__ == "__main__": - sys.exit(main()) + main() diff --git a/scripts/new_app.py b/scripts/new_app.py index 6dfb96f..3cac674 100755 --- a/scripts/new_app.py +++ b/scripts/new_app.py @@ -1,13 +1,21 @@ #!/usr/bin/env python3 import argparse -import datetime +import datetime as dt import json -import os import pathlib import shutil -from typing import Dict, List +from typing import Dict, Iterable, List, Sequence + +try: + import jinja2 +except ModuleNotFoundError as exc: # pragma: no cover - guidance for local execution + raise SystemExit( + "Jinja2 is required. Run this script via './run/dev.sh python scripts/new_app.py ...' so dependencies are provided by the devtools container." + ) from exc ROOT = pathlib.Path(__file__).resolve().parents[1] +DEFAULT_BASE_IMAGE = "cloudron/base:5.0.0" +DEFAULT_BUILDER_IMAGE = "cloudron/base:5.0.0" def load_catalog(path: pathlib.Path) -> List[Dict[str, object]]: @@ -16,109 +24,124 @@ def load_catalog(path: pathlib.Path) -> List[Dict[str, object]]: def build_app_id(slug: str) -> str: - sanitized = ''.join(ch.lower() if ch.isalnum() else '.' for ch in slug) - sanitized = '.'.join(filter(None, sanitized.split('.'))) - return f"com.knel.{sanitized}" + import re + + normalized = slug.lower() + normalized = re.sub(r"[^a-z0-9]+", ".", normalized) + normalized = re.sub(r"\.\.+", ".", normalized).strip(".") + if not normalized: + raise ValueError(f"Unable to derive Cloudron app id from slug '{slug}'") + return f"com.knel.{normalized}" -def default_tags() -> List[str]: - return ["custom", "known-element"] - - -def default_placeholder_map(entry: Dict[str, object]) -> Dict[str, str]: - slug = entry["slug"] - title = entry["title"] - repo = entry["repo"] - issue = entry.get("issue", "") - website = entry.get("website") or repo.rstrip(".git") - description = entry.get("description") or "TODO: Add package description." - tags = entry.get("tags") or default_tags() - http_port = str(entry.get("httpPort", 3000)) - base_image = entry.get("baseImage", "cloudron/base:5.0.0") - - placeholder_map = { - "{{APP_ID}}": build_app_id(slug), - "{{APP_TITLE}}": title, - "{{APP_SLUG}}": slug, - "{{APP_REPO}}": repo, - "{{APP_ISSUE}}": issue, - "{{APP_WEBSITE}}": website, - "{{APP_DESCRIPTION}}": description, - "{{HTTP_PORT}}": http_port, - "{{BASE_IMAGE}}": base_image, - "{{APP_TAGS}}": json.dumps(tags) - } - - return placeholder_map - - -def render_templates(template_dir: pathlib.Path, destination: pathlib.Path, entry: Dict[str, object]) -> None: - shutil.copytree(template_dir, destination, dirs_exist_ok=True) - - placeholders = default_placeholder_map(entry) - - for path in destination.rglob('*'): - if path.is_dir(): - continue - text = path.read_text(encoding='utf-8') - for key, value in placeholders.items(): - text = text.replace(key, value) - path.write_text(text, encoding='utf-8') - - # Ensure critical scripts are executable - for relpath in ["start.sh", "test/smoke.sh"]: - target = destination / relpath - if target.exists(): - mode = target.stat().st_mode - target.chmod(mode | 0o111) - - # Drop metadata file for bookkeeping - metadata = { - "slug": entry["slug"], - "title": entry["title"], - "issue": entry.get("issue"), - "repo": entry.get("repo"), - "additionalRepos": entry.get("additionalRepos", []), - "created": datetime.datetime.utcnow().replace(microsecond=0).isoformat() + "Z", - "notes": entry.get("notes", "TODO: capture packaging notes") - } - with (destination / "metadata.json").open("w", encoding="utf-8") as handle: - json.dump(metadata, handle, indent=2) - - -def ensure_app_directory(entry: Dict[str, object], template_dir: pathlib.Path, apps_dir: pathlib.Path, force: bool) -> pathlib.Path: - app_dir = apps_dir / entry["slug"] +def ensure_clean_destination(app_dir: pathlib.Path, force: bool) -> None: if app_dir.exists(): if not force: - raise FileExistsError(f"Destination {app_dir} already exists. Use --force to overwrite.") + raise FileExistsError( + f"Destination {app_dir} already exists. Use --force to overwrite or remove it manually." + ) shutil.rmtree(app_dir) - render_templates(template_dir, app_dir, entry) + app_dir.mkdir(parents=True, exist_ok=True) + + +def render_templates(template_dir: pathlib.Path, destination: pathlib.Path, context: Dict[str, object]) -> None: + env = jinja2.Environment( + loader=jinja2.FileSystemLoader(str(template_dir)), + keep_trailing_newline=True, + autoescape=False, + ) + + for source in template_dir.rglob("*"): + if source.is_dir(): + continue + relative = source.relative_to(template_dir) + target = destination / relative + + if source.suffix == ".j2": + rendered_path = target.with_suffix("") + rendered_path.parent.mkdir(parents=True, exist_ok=True) + template = env.get_template(str(relative)) + rendered_path.write_text(template.render(**context), encoding="utf-8") + else: + target.parent.mkdir(parents=True, exist_ok=True) + shutil.copy2(source, target) + + for relpath in ("start.sh", "test/smoke.sh"): + path = destination / relpath + if path.exists(): + path.chmod(path.stat().st_mode | 0o111) + + +def build_context(entry: Dict[str, object]) -> Dict[str, object]: + generated_at = dt.datetime.utcnow().replace(microsecond=0).isoformat() + "Z" + tags = entry.get("tags") or ["custom", "known-element"] + website = entry.get("website") or entry.get("repo", "").rstrip(".git") + http_port = int(entry.get("httpPort", 3000)) + base_image = entry.get("baseImage", DEFAULT_BASE_IMAGE) + builder_image = entry.get("builderImage", DEFAULT_BUILDER_IMAGE) + additional_repos = entry.get("additionalRepos", []) + + return { + "app_id": build_app_id(entry["slug"]), + "app_slug": entry["slug"], + "app_title": entry["title"], + "app_repo": entry["repo"], + "app_issue": entry.get("issue", ""), + "app_website": website, + "app_tags": json.dumps(tags), + "http_port": http_port, + "base_image": base_image, + "builder_image": builder_image, + "generated_at": generated_at, + "additional_repos_json": json.dumps(additional_repos, indent=2), + "default_app_version": entry.get("defaultVersion", "latest"), + } + + +def render_app(entry: Dict[str, object], template_dir: pathlib.Path, apps_dir: pathlib.Path, force: bool) -> pathlib.Path: + app_dir = apps_dir / entry["slug"] + ensure_clean_destination(app_dir, force) + context = build_context(entry) + render_templates(template_dir, app_dir, context) return app_dir -def main() -> None: +def iter_entries(catalog: Sequence[Dict[str, object]], slugs: Iterable[str] | None) -> Iterable[Dict[str, object]]: + if slugs is None: + yield from catalog + return + + slug_set = set(slugs) + for entry in catalog: + if entry["slug"] in slug_set: + yield entry + slug_set.remove(entry["slug"]) + + if slug_set: + missing = ", ".join(sorted(slug_set)) + raise SystemExit(f"Unknown slug(s): {missing}") + + +def parse_args() -> argparse.Namespace: parser = argparse.ArgumentParser(description="Scaffold Cloudron app packages from catalog entries") - parser.add_argument("--slug", help="Generate scaffold for a single slug", default=None) + parser.add_argument("--slug", action="append", dest="slugs", help="Generate scaffold for the provided slug (repeatable)") parser.add_argument("--catalog", default=str(ROOT / "apps" / "catalog.json"), help="Path to catalog JSON") parser.add_argument("--template", default=str(ROOT / "templates" / "cloudron-app"), help="Template directory") parser.add_argument("--apps-dir", default=str(ROOT / "apps"), help="Destination apps directory") parser.add_argument("--force", action="store_true", help="Overwrite existing app directory") - args = parser.parse_args() + return parser.parse_args() + + +def main() -> None: + args = parse_args() catalog = load_catalog(pathlib.Path(args.catalog)) - - entries = catalog - if args.slug: - entries = [entry for entry in catalog if entry["slug"] == args.slug] - if not entries: - raise SystemExit(f"Slug {args.slug} not found in catalog") - template_dir = pathlib.Path(args.template) apps_dir = pathlib.Path(args.apps_dir) apps_dir.mkdir(parents=True, exist_ok=True) - for entry in entries: - app_dir = ensure_app_directory(entry, template_dir, apps_dir, args.force) + for entry in iter_entries(catalog, args.slugs): + app_dir = render_app(entry, template_dir, apps_dir, args.force) print(f"Created {app_dir.relative_to(ROOT)}") diff --git a/scripts/run_packager.sh b/scripts/run_packager.sh deleted file mode 100755 index 9c4697f..0000000 --- a/scripts/run_packager.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash -set -euo pipefail - -REPO_ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd) -IMAGE_NAME=${IMAGE_NAME:-knel/cloudron-packager} -BUILD=${BUILD:-0} - -if [[ "${BUILD}" == "1" ]]; then - docker build -t "${IMAGE_NAME}" "${REPO_ROOT}/docker/packager" -fi - -docker run --rm -it \ - -v "${REPO_ROOT}:/workspace" \ - -v /var/run/docker.sock:/var/run/docker.sock \ - -e HOME=/home/packager \ - "${IMAGE_NAME}" "$@" diff --git a/templates/cloudron-app/CloudronManifest.json b/templates/cloudron-app/CloudronManifest.json deleted file mode 100644 index cc9989a..0000000 --- a/templates/cloudron-app/CloudronManifest.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "manifestVersion": 2, - "id": "{{APP_ID}}", - "title": "{{APP_TITLE}}", - "author": "Known Element Packaging Team", - "tagline": "TODO: Short one-line pitch", - "description": "TODO: Comprehensive description for the Cloudron App Store entry.", - "changelog": "Initial scaffold", - "website": "{{APP_WEBSITE}}", - "supportUrl": "{{APP_ISSUE}}", - "sourceUrl": "{{APP_REPO}}", - "version": "0.1.0", - "tags": {{APP_TAGS}}, - "healthCheckPath": "/", - "memoryLimit": 536870912, - "httpPort": {{HTTP_PORT}}, - "addons": { - "localstorage": {} - } -} diff --git a/templates/cloudron-app/CloudronManifest.json.j2 b/templates/cloudron-app/CloudronManifest.json.j2 new file mode 100644 index 0000000..6a23e50 --- /dev/null +++ b/templates/cloudron-app/CloudronManifest.json.j2 @@ -0,0 +1,27 @@ +{ + "manifestVersion": 2, + "id": "{{ app_id }}", + "title": "{{ app_title }}", + "author": "Known Element Packaging Team", + "tagline": "TODO: Short one-line pitch", + "description": "TODO: Comprehensive description for the Cloudron App Store entry.", + "changelog": "Initial scaffold", + "website": "{{ app_website }}", + "supportUrl": "{{ app_issue }}", + "sourceUrl": "{{ app_repo }}", + "version": "0.1.0", + "tags": {{ app_tags }}, + "healthCheckPath": "/", + "httpPort": {{ http_port }}, + "memoryLimit": "{{ memory_limit | default('512M') }}", // IMPORTANT: Replace with a realistic value, e.g., "2G", "1024M" + "addons": { + "localstorage": {} + }, + "optionalAddons": { + "postgresql": {}, + "redis": {}, + "mysql": {}, + "mongodb": {}, + "sendmail": {} + } +} diff --git a/templates/cloudron-app/Dockerfile b/templates/cloudron-app/Dockerfile deleted file mode 100644 index 11ebb4a..0000000 --- a/templates/cloudron-app/Dockerfile +++ /dev/null @@ -1,22 +0,0 @@ -# syntax=docker/dockerfile:1 -FROM {{BASE_IMAGE}} - -LABEL org.opencontainers.image.source="{{APP_REPO}}" -LABEL org.opencontainers.image.description="Cloudron package for {{APP_TITLE}}" - -ARG APP_VERSION -ENV APP_VERSION=${APP_VERSION:-latest} - -# Copy application source into image at build time -# Replace this with a multi-stage build if upstream provides Docker images. -COPY ./app /app/code - -# Copy start script and make it executable -COPY ./start.sh /app/pkg/start.sh -RUN chmod +x /app/pkg/start.sh - -# Cloudron expects all processes to run as cloudron user -USER cloudron -WORKDIR /app/code - -CMD ["/app/pkg/start.sh"] diff --git a/templates/cloudron-app/Dockerfile.j2 b/templates/cloudron-app/Dockerfile.j2 new file mode 100644 index 0000000..4b8a9a9 --- /dev/null +++ b/templates/cloudron-app/Dockerfile.j2 @@ -0,0 +1,39 @@ +# syntax=docker/dockerfile:1.6 + +ARG APP_VERSION={{ default_app_version }} + +FROM {{ builder_image }} AS builder +WORKDIR /build + +# ----------------------------------------------------------------------------- +# TODO: Fetch and build {{ app_title }} +# Example: +# RUN git clone --depth 1 --branch "${APP_VERSION}" {{ app_repo }} source \ +# && cd source \ +# && npm ci \ +# && npm run build +# ----------------------------------------------------------------------------- + +FROM {{ base_image }} +LABEL org.opencontainers.image.source="{{ app_repo }}" +LABEL org.opencontainers.image.description="Cloudron package for {{ app_title }}" + +ENV APP_VERSION=${APP_VERSION} + +# ----------------------------------------------------------------------------- +# TODO: Copy build artefacts from the builder stage +# COPY --from=builder /build/source/dist /app/code +# ----------------------------------------------------------------------------- + +COPY ./app /app/code +COPY ./start.sh /app/pkg/start.sh +COPY ./test /app/pkg/test + +RUN chmod +x /app/pkg/start.sh /app/pkg/test/smoke.sh \ + && mkdir -p /app/data \ + && chown -R cloudron:cloudron /app + +USER cloudron +WORKDIR /app/code + +CMD ["/app/pkg/start.sh"] diff --git a/templates/cloudron-app/README.md b/templates/cloudron-app/README.md deleted file mode 100644 index ac30fae..0000000 --- a/templates/cloudron-app/README.md +++ /dev/null @@ -1,20 +0,0 @@ -# {{APP_TITLE}} on Cloudron - -- **Upstream repository**: {{APP_REPO}} -- **Implementation issue**: {{APP_ISSUE}} -- **Status**: Draft scaffolding generated on $(date -u +"%Y-%m-%dT%H:%M:%SZ") - -## Packaging Checklist - -1. Review upstream deployment requirements and map them to Cloudron services (database, cache, object storage, workers). -2. Update `Dockerfile` with the correct build steps and runtime dependencies. -3. Implement `start.sh` to configure the app from Cloudron-provided environment variables and launch the primary process. -4. Edit `CloudronManifest.json` with accurate metadata, permissions, ports, addons, and health checks. -5. Add integration and smoke tests under `test/` to validate the package. -6. Document manual configuration steps, migration requirements, and known gaps in this README. - -## Notes - -- Replace the placeholder long-running process in `start.sh`. -- Populate the `app/` directory with the application build artefacts or git submodules. -- Use the shared packaging container (`docker/packager`) to run `cloudron build` and `cloudron install` so the host remains clean. diff --git a/templates/cloudron-app/README.md.j2 b/templates/cloudron-app/README.md.j2 new file mode 100644 index 0000000..dd5fdea --- /dev/null +++ b/templates/cloudron-app/README.md.j2 @@ -0,0 +1,20 @@ +# {{ app_title }} on Cloudron + +- **Upstream repository**: {{ app_repo }} +- **Implementation issue**: {{ app_issue }} +- **Generated**: {{ generated_at }} UTC + +## Packaging Checklist + +1. Map upstream services (databases, caches, workers) to Cloudron addons; remove unused entries from `optionalAddons` and enable required ones under `addons`. +2. Implement the multi-stage build in `Dockerfile` to fetch/compile the correct release of {{ app_title }}. +3. Update `start.sh` to configure the app from Cloudron environment variables and launch the primary process. +4. Replace the placeholder health checks and smoke test with real coverage. +5. Complete `CloudronManifest.json` (tagline, description, versioning, resource limits, ingress, TCP ports, etc.). +6. Document manual configuration steps, migrations, and known gaps below. + +## Notes + +- Populate the `app/` directory with runtime overlays or artifacts generated during the build stage. +- Use the shared packaging container (`docker/packager`) for `cloudron build/install` to keep the host clean. +- Record decisions and operational requirements under `docs/apps/{{ app_slug }}/` as work progresses. diff --git a/templates/cloudron-app/metadata.json.j2 b/templates/cloudron-app/metadata.json.j2 new file mode 100644 index 0000000..7a87f39 --- /dev/null +++ b/templates/cloudron-app/metadata.json.j2 @@ -0,0 +1,9 @@ +{ + "slug": "{{ app_slug }}", + "title": "{{ app_title }}", + "issue": "{{ app_issue }}", + "repo": "{{ app_repo }}", + "additionalRepos": {% if additional_repos_json != '[]' %}{{ additional_repos_json | indent(2, True) }}{% else %}[]{% endif %}, + "created": "{{ generated_at }}", + "notes": "TODO: capture packaging notes" +} diff --git a/templates/cloudron-app/start.sh b/templates/cloudron-app/start.sh deleted file mode 100644 index 8fdf09b..0000000 --- a/templates/cloudron-app/start.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -set -euo pipefail - -# Cloudron injects configuration via environment variables and files under /run -# Use this script to render config files and launch the upstream service. - -# TODO: Replace the command below with the correct process supervisor. -exec /bin/sh -c "echo 'Replace start.sh with application startup logic for {{APP_TITLE}}' && sleep infinity" diff --git a/templates/cloudron-app/start.sh.j2 b/templates/cloudron-app/start.sh.j2 new file mode 100644 index 0000000..c9fda90 --- /dev/null +++ b/templates/cloudron-app/start.sh.j2 @@ -0,0 +1,9 @@ +#!/usr/bin/env bash +set -euo pipefail + +# TODO: render configuration files from CLOUDRON_* environment variables +# Example: +# envsubst < /app/pkg/config.tmpl > /run/config.yaml + +>&2 echo "start.sh for {{ app_title }} is not implemented yet." +exit 1 diff --git a/templates/cloudron-app/test/smoke.sh b/templates/cloudron-app/test/smoke.sh deleted file mode 100644 index ebd1134..0000000 --- a/templates/cloudron-app/test/smoke.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash -set -euo pipefail - -# Basic container reachability check executed inside the packaging container. -# Replace curl target with an endpoint exposed by the app once the package is functional. -cloudron_app_url=${CLOUDRON_APP_ORIGIN:-"http://localhost"} - -http_code=$(curl -s -o /tmp/smoke.log -w "%{http_code}" "${cloudron_app_url}") - -if [[ "${http_code}" != "200" ]]; then - echo "Unexpected HTTP status: ${http_code}" >&2 - cat /tmp/smoke.log >&2 - exit 1 -fi - -echo "Smoke test passed" diff --git a/templates/cloudron-app/test/smoke.sh.j2 b/templates/cloudron-app/test/smoke.sh.j2 new file mode 100644 index 0000000..373e67f --- /dev/null +++ b/templates/cloudron-app/test/smoke.sh.j2 @@ -0,0 +1,14 @@ +#!/usr/bin/env bash +set -euo pipefail + +cloudron_app_origin=${CLOUDRON_APP_ORIGIN:-http://localhost} + +http_code=$(curl --silent --show-error --output /tmp/smoke.log --write-out "%{http_code}" "${cloudron_app_origin}/") + +if [[ "${http_code}" != "200" ]]; then + >&2 echo "Smoke test failed for {{ app_title }}: expected HTTP 200 from ${cloudron_app_origin}/, got ${http_code}" + >&2 cat /tmp/smoke.log + exit 1 +fi + +echo "Smoke test placeholder passed for {{ app_title }}"