Files
slump-x-land-studio/README.md
T

87 lines
6.9 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Slump X Land Studio — v1.1
A standalone site and publishing dashboard for `slumpxland-official.com`. Django runs the dashboard and public pages, PostgreSQL holds the database, and the existing host Caddy serves HTTPS. The dashboard, chapter numbering, and public site belong to one title: SLUMP X LAND. The title is fixed and chapter numbering is shared across the story. This build runs independently of WordPress and OGO.
- **Dashboard:** `/admin/`. Publishing overview, live/scheduled/draft counts, chapter and editorial editing, site settings, and staff accounts and groups.
- **Public site:** SLUMP X LAND hub with its chapter archive, news, cast, and world entries. Chapters may link to ONSOL-GO! or use this site's scroll reader with numbered page images. A dedicated `/coming-soon/` page shows the release countdown with no outbound links. Site settings control hero artwork and blur.
- **Publishing:** set a date and time in Chicago time, then select **Publish when scheduled**. An unchecked draft remains hidden even after its date; checked content becomes public at release time. Draft chapter images are served only to authorized studio users. An OGO chapter link preserves the publisher's own access rules. Locally published chapters are publicly readable.
- **Content:** this is a clean install. It doesn't import live assets, account data or chapters from another site. Enter official links and upload artwork in the studio.
## Put it on a private staging subdomain
Use Docker Compose and Caddy 2.8 or later. Place the extracted `slump-x-land-studio` folder at `/opt/slump-x-land-studio`, or change both Caddy snippets to match its actual path. Caddy runs on the host. If your Caddy is containerized, adjust its shared network, mount and upstream so it can reach the app.
1. Create the DNS record for `stage.slumpxland-official.com` only. Keep the main domain and OGO's records as they are.
2. Run these commands from the extracted project folder:
```sh
sh scripts/setup.sh
docker compose config --quiet
docker compose up -d --build
docker compose ps
docker compose exec -u slump web python manage.py createsuperuser
```
The setup script defaults to port **8093** on loopback. If it is occupied, use `sh scripts/setup.sh stage.slumpxland-official.com 8094` on first run and change the port in the Caddy snippet. No database port is exposed. The generated `secrets/` directory is owner-only; preserve it if moving or restoring the installation.
3. Run `caddy hash-password` to generate a staging password hash. Add the block in `deploy/staging.caddy.example` to your existing Caddy configuration and replace the hash placeholder. Give the Caddy service read/traverse access for `data/static` and its parent directories; keep database files and credentials private. Validate and reload Caddy, for example on a standard Linux systemd install:
```sh
sudo caddy validate --config /etc/caddy/Caddyfile --adapter caddyfile
sudo systemctl reload caddy
```
Keep the existing OGO blocks in place. Let Django handle `/media/` so draft image rules still apply.
4. Open `https://stage.slumpxland-official.com/admin/`. Use `preview` with the Caddy password in the browser prompt, then sign in with your separate Django staff account. Start at **Site settings**, then add chapters and editorial entries. Before going live, check a draft, a scheduled chapter, image uploads, the countdown, and at least one published page.
## Cut over when ready
Add the block in `deploy/production.caddy.example` to the existing Caddy config. Add the production hostname to `SLX_ALLOWED_HOSTS` and the corresponding HTTPS origin to `SLX_CSRF_ORIGINS` in `.env` (comma-separated). Verify the site configuration, back up the database and uploaded media, and recreate the web service with `docker compose up -d`. Only route the main domain here after validating and reloading Caddy and reviewing the staged site. Do not retain a public staging copy without authentication. Back up both the PostgreSQL volume and `data/media`; `data/static` can be rebuilt.
## Local development
```sh
python -m venv .venv
. .venv/bin/activate
pip install -r requirements.txt
export SLX_SECRET_KEY=local-development-example SLX_HTTPS=0 SLX_DEBUG=1
python manage.py migrate
python manage.py createsuperuser
python manage.py runserver
```
Open `http://127.0.0.1:8000/admin/`. Local mode uses SQLite. Run `python manage.py test` to exercise publishing visibility, draft artwork access, staff permissions, and the countdown page. Don't use the development key or HTTP settings on the server.
## Updating Studio v1.0
Keep the same project directory, `.env`, `secrets/`, `data/`, and Docker volumes. After making a database backup, unpack the updated project files into that directory and run `docker compose up -d --build`. Startup applies the migration. It locks the displayed title to SLUMP X LAND and keeps existing chapters, editorial content, and site settings.
### Pages, chapter samples and Fan Club checkout
- **Pages → Manage pages**: edit a page title, slug, navigation label/placement,
local destination, or plain-text body. Clear the destination to publish an
original content page. Select a published row and use **Use the selected
published page as homepage** to switch. **Restore the Sol’Terra map as homepage**
restores the map; the map is always available at `/map/`.
- **Chapters**: set **Chapter price (USD)** to $0.50 or more to enable a Stripe
one-time purchase. A paid order unlocks that chapter in the reader for the
signed-in purchaser. A physical book does not automatically unlock the reader.
- **Shop products**: select a **Sample chapter** on a listing. The storefront
links to that published chapter. The newest three published chapters are free in full; older chapters require access.
A physical product with that association appears in the reader's purchase options.
- The migration creates two inactive monthly Fan Club product records: **Early
Access** and **Studio Vault**. Replace the placeholder price with your real
monthly price and optionally set the matching same-mode Stripe recurring
Price ID before making each product active. If using a Price ID, match the
displayed Studio price to the amount charged by Stripe. Both tiers unlock the
published chapter library; member posts still follow tier requirements.
- In Stripe create an endpoint at
`https://slumpxland-official.com/shop/webhooks/stripe/` for
`checkout.session.completed`, `checkout.session.async_payment_succeeded`,
`customer.subscription.updated`, `customer.subscription.deleted`,
`invoice.paid`, `invoice.payment_failed`, and `charge.refunded`.
Set the new endpoint's signing secret in the live `.env` as
`SLX_COMMERCE_STRIPE_WEBHOOK_SECRET`. The existing Stripe API key and
`SLX_STRIPE_ORIGIN` can be reused. A separate endpoint signing secret keeps
the existing legacy checkout endpoint independent. Test in Stripe test mode
before accepting live payments, and don't put payment keys into this ZIP.