diff --git a/astro.config.mjs b/astro.config.mjs index 616dbb2..2cfe1fb 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -6,6 +6,9 @@ export default defineConfig({ server: { port: 4321, host: true }, vite: { server: { + // Vite blocks unknown Host headers by default; the demo is viewed through an + // ephemeral cloudflared quick tunnel, so allow any *.trycloudflare.com host. + allowedHosts: ['.trycloudflare.com'], // Same-origin path for the Sveltia/Decap local backend proxy (default port // moved to 8082 to avoid colliding with Metro on 8081). Proxying it here // means the CMS admin talks to one origin, so editing also works through the diff --git a/public/admin/config.yml b/public/admin/config.yml index bb86a91..c3c9f28 100644 --- a/public/admin/config.yml +++ b/public/admin/config.yml @@ -1,17 +1,16 @@ -# Sveltia/Decap CMS config. In production `backend` would be GitHub (editors log in -# with GitHub, content committed to the repo). For this local demo we use the local -# backend: edits are written straight to the Markdown files on disk via a local proxy. +# Sveltia CMS config — backend: local Gitea (demo). Editors log in via Gitea OAuth +# (PKCE, no client secret); edits are committed to the ctao/portal repo in Gitea. +# NOTE: base_url/api_root point at an ephemeral cloudflared quick tunnel — if the +# tunnel restarts, update these URLs and the OAuth app redirect_uri in Gitea. backend: - name: github - repo: ctao/portal-ctao # placeholder — unused in local mode + name: gitea + repo: ctao/portal branch: main + base_url: https://powerseller-increased-banana-extremely.trycloudflare.com + api_root: https://powerseller-increased-banana-extremely.trycloudflare.com/api/v1 + app_id: 73c02331-8842-4ddc-b769-8b09c3c422fb -# Local editing without GitHub. The proxy runs on 8082 (8081 is taken by Metro) and -# is reached same-origin at /api/v1 (proxied by Astro) so editing also works via the tunnel. -local_backend: - url: /api/v1 - -media_folder: "public/uploads" # relative to the proxy CWD (demo-git-cms/) +media_folder: "public/uploads" public_folder: "/uploads" collections: diff --git a/public/admin/index.html b/public/admin/index.html deleted file mode 100644 index 1a2b088..0000000 --- a/public/admin/index.html +++ /dev/null @@ -1,13 +0,0 @@ - - -
- - -