fix: gitea backend + allowedHosts + admin route
This commit is contained in:
@@ -6,6 +6,9 @@ export default defineConfig({
|
|||||||
server: { port: 4321, host: true },
|
server: { port: 4321, host: true },
|
||||||
vite: {
|
vite: {
|
||||||
server: {
|
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
|
// 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
|
// 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
|
// means the CMS admin talks to one origin, so editing also works through the
|
||||||
|
|||||||
+10
-11
@@ -1,17 +1,16 @@
|
|||||||
# Sveltia/Decap CMS config. In production `backend` would be GitHub (editors log in
|
# Sveltia CMS config — backend: local Gitea (demo). Editors log in via Gitea OAuth
|
||||||
# with GitHub, content committed to the repo). For this local demo we use the local
|
# (PKCE, no client secret); edits are committed to the ctao/portal repo in Gitea.
|
||||||
# backend: edits are written straight to the Markdown files on disk via a local proxy.
|
# 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:
|
backend:
|
||||||
name: github
|
name: gitea
|
||||||
repo: ctao/portal-ctao # placeholder — unused in local mode
|
repo: ctao/portal
|
||||||
branch: main
|
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
|
media_folder: "public/uploads"
|
||||||
# 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/)
|
|
||||||
public_folder: "/uploads"
|
public_folder: "/uploads"
|
||||||
|
|
||||||
collections:
|
collections:
|
||||||
|
|||||||
@@ -1,13 +0,0 @@
|
|||||||
<!doctype html>
|
|
||||||
<html lang="pl">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8" />
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
||||||
<title>CTAO — Edytor treści</title>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<!-- Sveltia CMS: statyczny bundle admina. W demo ładowany z CDN; w produkcji
|
|
||||||
wrzuca się go jako jeden statyczny plik obok strony (zero backendu). -->
|
|
||||||
<script src="https://unpkg.com/@sveltia/cms/dist/sveltia-cms.js"></script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
---
|
||||||
|
// Editor entry point (/admin). Sveltia CMS loads its config from ./config.yml
|
||||||
|
// (served statically from public/admin/config.yml). The external bundle is kept
|
||||||
|
// inline so Astro doesn't try to process/bundle it.
|
||||||
|
---
|
||||||
|
<!doctype html>
|
||||||
|
<html lang="pl">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
|
<title>CTAO — Edytor treści</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<script is:inline src="https://unpkg.com/@sveltia/cms/dist/sveltia-cms.js"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
Reference in New Issue
Block a user