feat: ADD work with local .env file #14
This commit is contained in:
parent
30e6956fa4
commit
d0373f0198
4 changed files with 81 additions and 0 deletions
37
README.md
37
README.md
|
|
@ -14,6 +14,7 @@ Simple SSG to create dynamic gallery one-pagers in your shell! Shell+Gallery
|
|||
**Available**:
|
||||
- Simple use, single dependency (exiftool)
|
||||
- Removes EXIF/GPS metadata from published images by default
|
||||
- Configurable title and optional footer via environment variables
|
||||
- no Javascript
|
||||
- Lightbox of image with anchor
|
||||
- Order of images via filename
|
||||
|
|
@ -70,6 +71,42 @@ docker run -v $(pwd)/images:/app/images -v $(pwd)/output:/app/output localhost/s
|
|||
|
||||
The generated gallery will be in `./output/index.html`
|
||||
|
||||
### Configuration
|
||||
|
||||
All options can be set in a `.env` file, as environment variables, or as flags.
|
||||
`.env.example` lists every option with its default, so an unedited copy changes nothing:
|
||||
|
||||
```bash
|
||||
cp .env.example .env
|
||||
```
|
||||
|
||||
`.env` is gitignored. Precedence is **flags > environment > `.env` > defaults**, so a
|
||||
`-e` value passed to the container still wins over the file. Point `ENV_FILE` at another
|
||||
path to use a different file.
|
||||
|
||||
| Variable | Flag | Default | Effect |
|
||||
|---|---|---|---|
|
||||
| `GALLERY_TITLE` | `--title=TEXT` | `Gallery` | Page `<title>` and the `<h1>` header |
|
||||
| `SHOW_FOOTER` | `--no-footer` | `1` | Set to `0` to hide the "Powered by shellery" footer |
|
||||
| `STRIP_EXIF` | `--keep-exif` | `1` | Set to `0` to publish image metadata as-is |
|
||||
| `ENV_FILE` | - | `.env` | Path to the config file to load |
|
||||
|
||||
```bash
|
||||
GALLERY_TITLE="Holiday 2026" SHOW_FOOTER=0 ./build.sh
|
||||
# or
|
||||
./build.sh --title="Holiday 2026" --no-footer
|
||||
|
||||
# container, via -e
|
||||
podman run -e GALLERY_TITLE="Holiday 2026" -e SHOW_FOOTER=0 \
|
||||
-v $(pwd)/images:/app/images -v $(pwd)/output:/app/output \
|
||||
git.uphillsecurity.com/cf7/shellery:latest
|
||||
|
||||
# container, via a mounted .env
|
||||
podman run -v $(pwd)/.env:/app/.env:ro \
|
||||
-v $(pwd)/images:/app/images -v $(pwd)/output:/app/output \
|
||||
git.uphillsecurity.com/cf7/shellery:latest
|
||||
```
|
||||
|
||||
### Metadata removal
|
||||
|
||||
EXIF, GPS, IPTC and XMP metadata is stripped from every image by default. Only the copies
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue