Improved the bootstrap script to write the canonical site origin and also, fixed some nasty bugs.
This commit is contained in:
@@ -53,9 +53,9 @@ make bootstrap # or: ./Scripts/bootstrap
|
||||
|
||||
| Prompt | Example | Rewrites |
|
||||
| --- | --- | --- |
|
||||
| **Site display name** (PascalCase) | `Loud` | Server name (`LoudWebsite`), `Loud.xcodeproj`, README title. |
|
||||
| **Project slug** (lowercase) | `loud-ams` | Container owner, database name/user, Compose project name. |
|
||||
| **Canonical site URL** (scheme + host) | `https://loud.amsterdam` | The `Sitemap:` reference in `robots.txt` and the `<loc>` entry in `sitemap.xml`. |
|
||||
| **Site display name** (PascalCase) | `Acme` | Server name (`AcmeWebsite`), `Acme.xcodeproj`, README title. |
|
||||
| **Project slug** (lowercase) | `acme-web` | Container owner, database name/user, Compose project name. |
|
||||
| **Canonical site URL** (scheme + host) | `https://acme.example.com` | The `Sitemap:` reference in `robots.txt`, the `<loc>` entry in `sitemap.xml`, and `String.Site.origin`. |
|
||||
|
||||
- The URL defaults to the reserved `https://site.example.com`; leaving it is
|
||||
allowed (the script warns) and can be corrected later in the two crawler files.
|
||||
@@ -84,10 +84,14 @@ make bootstrap # or: ./Scripts/bootstrap
|
||||
set `ANALYTICS_WEBSITE_ID`. `ANALYTICS_DOMAINS` limits which hosts report;
|
||||
`ANALYTICS_RECORDER` opts into the session recorder. See
|
||||
[Analytics](Services/Website/README.md#analytics).
|
||||
5. **Secrets** — set a real `DATABASE_PASSWORD` in a git-ignored
|
||||
5. **Site origin** — bootstrap writes the canonical URL into `String.Site.origin`
|
||||
(override with `SITE_ORIGIN`), leaving it empty for the placeholder. An empty
|
||||
or non-HTTPS origin disables the HTTPS redirect, which
|
||||
`HTTPS_TRUST_FORWARDED_PROTO` must enable besides.
|
||||
6. **Secrets** — set a real `DATABASE_PASSWORD` in a git-ignored
|
||||
`Services/Website/.env`; the committed `.env.local` is an example and defaults
|
||||
the password to the slug.
|
||||
6. **Domain models** — replace the `Persistence` package's sample `ExampleRecord`
|
||||
7. **Domain models** — replace the `Persistence` package's sample `ExampleRecord`
|
||||
/ `ExampleRepository`. The default driver is in-memory SQLite, migrated on
|
||||
every boot; a real site sets `DATABASE_DRIVER=postgres` and migrates out of
|
||||
band (`swift run Website --database-migrate`). See
|
||||
|
||||
Reference in New Issue
Block a user