inlaycms 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +14 -7
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -168,7 +168,14 @@ npx inlaycms serve
168
168
 
169
169
  `serve` runs the live release in a worker process and keeps the database untouched at start: shipped content is applied only when a release is activated. With no release yet, the site shows a plain "no site yet" page (status 200, not indexed) and the admin works. When a live site can't be served (its release is missing from the data folder, needs another version of Inlay, or keeps crashing), visitors get a "temporarily unavailable" page instead, with status 503 and `Retry-After`, so search engines keep the site; the admin still works. A worker that crashes is started again. On SIGTERM or SIGINT it finishes the requests in flight, closes the database and exits.
170
170
 
171
- The Docker image (`Dockerfile`, also the CLI: see [Without Node: the Docker image](#without-node-the-docker-image)) runs `inlaycms serve` with `INLAY_DATA_DIR=/data` on a volume and port 3000: `docker compose up serve` with `INLAY_SECRET` and `INLAY_TRUSTED_KEYS` set in your shell. Run `inlaycms activate` in the same container to give it its first release. The release file must be inside the container, so mount it: `docker compose run --rm -v "$PWD/release.tgz:/release.tgz:ro" serve inlaycms activate /release.tgz`. The image holds the packed `inlaycms` with its production dependencies only, with `inlaycms` on the `PATH`.
171
+ The Docker image, `ghcr.io/donstephan/inlaycms` (also the CLI: see [Without Node: the Docker image](#without-node-the-docker-image)), runs `inlaycms serve` with `INLAY_DATA_DIR=/data` on a volume and port 3000. With `INLAY_SECRET` and `INLAY_TRUSTED_KEYS` set in your shell:
172
+
173
+ ```sh
174
+ docker run -d --name inlay --restart unless-stopped -p 3000:3000 -v inlay-data:/data \
175
+ -e INLAY_SECRET -e INLAY_TRUSTED_KEYS ghcr.io/donstephan/inlaycms
176
+ ```
177
+
178
+ Run `inlaycms activate` in a container on the same volume to give it its first release. The release file must be inside the container, so mount it: `docker run --rm -v inlay-data:/data -v "$PWD/release.tgz:/release.tgz:ro" ghcr.io/donstephan/inlaycms inlaycms activate /release.tgz`. The image holds the packed `inlaycms` with its production dependencies only, with `inlaycms` on the `PATH`. Every release of Inlay is tagged with its version (`ghcr.io/donstephan/inlaycms:0.2.0`, and `0.2` for the newest patch of 0.2); `latest` is the newest release. In this repository, `docker compose up serve` builds the image from source and runs it.
172
179
 
173
180
  To give a host its first release, or to make a release live while it is stopped:
174
181
 
@@ -218,22 +225,22 @@ If your site's `tsconfig.json` has `skipLibCheck: false`, `tsc` reports one erro
218
225
 
219
226
  ## Without Node: the Docker image
220
227
 
221
- The Inlay image holds the whole CLI as well as the host, so a computer with Docker needs no Node or npm. Build it from this repository with `pnpm run image` (it's tagged `inlaycms`), and install the `inlaycms` script it carries:
228
+ The Inlay image holds the whole CLI as well as the host, so a computer with Docker needs no Node or npm. It's published on GitHub's container registry as `ghcr.io/donstephan/inlaycms`. Install the `inlaycms` script it carries:
222
229
 
223
230
  ```sh
224
- docker run --rm inlaycms cat /opt/inlaycms/wrapper/inlaycms > ~/.local/bin/inlaycms
231
+ docker run --rm ghcr.io/donstephan/inlaycms cat /opt/inlaycms/wrapper/inlaycms > ~/.local/bin/inlaycms
225
232
  chmod +x ~/.local/bin/inlaycms
226
233
  ```
227
234
 
228
- Then use `inlaycms` in a site's folder as anywhere else in this README: `inlaycms dev`, `inlaycms check`, `inlaycms pack`, `inlaycms push`. A site needs no `node_modules`: its `inlaycms` imports load the image's copy, and `inlaycms pack` type-checks with the image's TypeScript when the site has a `tsconfig.json`. A site that uses npm packages installs them as usual, with npm or through the image (`docker run --rm -u "$(id -u):$(id -g)" -v "$PWD:$PWD" -w "$PWD" -e HOME=/tmp inlay npm install <package>`).
235
+ Then use `inlaycms` in a site's folder as anywhere else in this README: `inlaycms dev`, `inlaycms check`, `inlaycms pack`, `inlaycms push`. A site needs no `node_modules`: its `inlaycms` imports load the image's copy, and `inlaycms pack` type-checks with the image's TypeScript when the site has a `tsconfig.json`. A site that uses npm packages installs them as usual, with npm or through the image (`docker run --rm -u "$(id -u):$(id -g)" -v "$PWD:$PWD" -w "$PWD" -e HOME=/tmp ghcr.io/donstephan/inlaycms npm install <package>`).
229
236
 
230
237
  The script runs the image on the current folder, mounted at the same path, so paths mean the same inside and out; files outside the folder aren't visible to the command. What it writes belongs to you. `dev` and `serve` publish their port on this computer only (`127.0.0.1`). Without `INLAY_DATA_DIR`, `dev` and the database commands keep their data in the site folder, as without Docker; with it, that folder is mounted too. Its settings:
231
238
 
232
- - `INLAY_IMAGE`: the image to run (default `inlaycms`), such as a tag from a registry.
239
+ - `INLAY_IMAGE`: the image to run (default `ghcr.io/donstephan/inlaycms`, the newest release you have pulled), such as a version (`ghcr.io/donstephan/inlaycms:0.2.0`) or an image built from this repository with `pnpm run image` (`inlaycms`).
233
240
  - `INLAY_DOCKER_ARGS`: more `docker run` options, split on spaces. Pass a secret the site declares with `-e CAPTCHA_SECRET`, and reach a server on this computer for `inlaycms push http://localhost:3000` with `--network host`.
234
241
  - Every other `INLAY_` variable is passed to the command.
235
242
 
236
- The image's default command is `inlaycms serve`, with its data in a volume at `/data` (see [Running a host](#running-a-host)).
243
+ `docker pull ghcr.io/donstephan/inlaycms` updates the image to the newest release. The image's default command is `inlaycms serve`, with its data in a volume at `/data` (see [Running a host](#running-a-host)).
237
244
 
238
245
  ### Types in your editor
239
246
 
@@ -242,7 +249,7 @@ Without `node_modules`, an editor on your computer can't find Inlay's types. Ope
242
249
  ```json
243
250
  {
244
251
  "name": "Inlay site",
245
- "image": "inlaycms",
252
+ "image": "ghcr.io/donstephan/inlaycms",
246
253
  "containerEnv": { "INLAY_DATA_DIR": "" },
247
254
  "forwardPorts": [3000]
248
255
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "inlaycms",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "A code-first CMS for content sites: templates, schemas and content in code, one SQLite file, signed releases.",
5
5
  "license": "MIT",
6
6
  "repository": {