change the domain and add the api key to the script
This commit is contained in:
@@ -39,7 +39,7 @@ API_TOKEN=<paste output of: openssl rand -hex 32>
|
|||||||
ALLOWED_ORIGINS=https://asuracomic.net,https://asurascans.com,https://demonicscans.org
|
ALLOWED_ORIGINS=https://asuracomic.net,https://asurascans.com,https://demonicscans.org
|
||||||
|
|
||||||
# Required for the Traefik override.
|
# Required for the Traefik override.
|
||||||
MANGA_API_HOST=manga-api.yourdomain.com
|
MANGA_API_HOST=manga-api.violetcrown.my.id
|
||||||
|
|
||||||
# Only if your Traefik setup differs from these defaults:
|
# Only if your Traefik setup differs from these defaults:
|
||||||
# PROXY_NETWORK=proxy
|
# PROXY_NETWORK=proxy
|
||||||
@@ -85,21 +85,21 @@ Give Traefik a few seconds to issue the cert, then:
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Health (no auth) — must be valid TLS, no cert warning.
|
# Health (no auth) — must be valid TLS, no cert warning.
|
||||||
curl -s https://manga-api.yourdomain.com/healthz # -> ok
|
curl -s https://manga-api.violetcrown.my.id/healthz # -> ok
|
||||||
|
|
||||||
# Auth enforced.
|
# Auth enforced.
|
||||||
curl -s -o /dev/null -w '%{http_code}\n' \
|
curl -s -o /dev/null -w '%{http_code}\n' \
|
||||||
https://manga-api.yourdomain.com/bookmarks # -> 401
|
https://manga-api.violetcrown.my.id/bookmarks # -> 401
|
||||||
|
|
||||||
TOKEN=$(grep -E '^API_TOKEN=' .env | cut -d= -f2)
|
TOKEN=$(grep -E '^API_TOKEN=' .env | cut -d= -f2)
|
||||||
curl -s -H "Authorization: Bearer $TOKEN" \
|
curl -s -H "Authorization: Bearer $TOKEN" \
|
||||||
https://manga-api.yourdomain.com/bookmarks # -> []
|
https://manga-api.violetcrown.my.id/bookmarks # -> []
|
||||||
|
|
||||||
# CORS preflight from a real site origin.
|
# CORS preflight from a real site origin.
|
||||||
curl -s -i -X OPTIONS \
|
curl -s -i -X OPTIONS \
|
||||||
-H 'Origin: https://asurascans.com' \
|
-H 'Origin: https://asurascans.com' \
|
||||||
-H 'Access-Control-Request-Method: PUT' \
|
-H 'Access-Control-Request-Method: PUT' \
|
||||||
https://manga-api.yourdomain.com/bookmarks/x | grep -i access-control
|
https://manga-api.violetcrown.my.id/bookmarks/x | grep -i access-control
|
||||||
# -> Access-Control-Allow-Origin: https://asurascans.com (+ Methods/Headers)
|
# -> Access-Control-Allow-Origin: https://asurascans.com (+ Methods/Headers)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -17,8 +17,8 @@
|
|||||||
// ============================================================
|
// ============================================================
|
||||||
// CONFIG — fill these in before installing.
|
// CONFIG — fill these in before installing.
|
||||||
// ============================================================
|
// ============================================================
|
||||||
const API_BASE = "https://manga-api.example.com"; // your backend origin, no trailing slash
|
const API_BASE = "https://manga-api.violetcrown.my.id"; // your backend origin, no trailing slash
|
||||||
const API_TOKEN = "PASTE_YOUR_API_TOKEN_HERE"; // must equal backend API_TOKEN
|
const API_TOKEN = "40d79969b5442f90df4fe306a092c7c50e7b4a7a98099f98cc398f4fb374b1df"; // must equal backend API_TOKEN
|
||||||
|
|
||||||
// Safe in Bromite's isolated world: the page's own JS cannot read these.
|
// Safe in Bromite's isolated world: the page's own JS cannot read these.
|
||||||
const CACHE_KEY = "mangabm:cache";
|
const CACHE_KEY = "mangabm:cache";
|
||||||
|
|||||||
Reference in New Issue
Block a user