From 7eee40203a46fd15c15a2cfb3dc76baa326ee9d4 Mon Sep 17 00:00:00 2001 From: peskyadmin Date: Sun, 2 Aug 2026 23:37:50 -0400 Subject: [PATCH] =?UTF-8?q?init:=20ts-shiori=20=E2=80=94=20official=20ghcr?= =?UTF-8?q?.io/go-shiori/shiori:v1.7.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bookmark manager (Go, single binary). Single container, SQLite in a named volume. Default admin (shiori/gopher) is auto-created on first run. Known issue: Shiori v1.7.0's SPA wizard detection panics with HTTP 500 on the first /api/bookmarks request when no session exists. The setup wizard does NOT appear on first visit — log in with the default credentials above and change the password immediately. Port 8080 inside the sidecar namespace. Optional SHIORI_HTTP_SECRET_KEY env var would persist sessions across restarts (not enabled by default). --- .env.example | 28 -------------- README.md | 50 ++++++++++++++++-------- docker-compose.yml | 55 +++++++-------------------- tailscale/config/serve.headscale.json | 6 +-- tailscale/config/serve.json | 4 +- 5 files changed, 54 insertions(+), 89 deletions(-) diff --git a/.env.example b/.env.example index dd290b0..b42389f 100644 --- a/.env.example +++ b/.env.example @@ -8,31 +8,3 @@ TS_AUTHKEY=*** # Tailscale control server (default) # For Headscale: update to your Headscale server URL TS_LOGIN_SERVER=https://controlplane.tailscale.com - -# ========================================== -# REFERENCE: Database credentials (only if your service uses an external DB) -# Remove this section if your service uses SQLite or has no database -# ========================================== - -POSTGRES_USER={{service}} -POSTGRES_PASSWORD=*** -POSTGRES_DB={{service}} - -# ========================================== -# CUSTOMIZE: App-specific variables (replace with what your service needs) -# ========================================== - -# Public URL users will access the service at -# Tailscale example: https://{{service}}.your-tailnet.ts.net -# Headscale example: http://{{service}}.yourdomain.com -{{SERVICE}}_SERVICE_PUBLICURL=http://{{service}}.example.com - -# Frontend URL (usually the same as PUBLICURL) -{{SERVICE}}_SERVICE_FRONTENDURL=http://{{service}}.example.com - -# Service JWT secret (change this!) -{{SERVICE}}_SERVICE_JWTSECRET=*** - -# Add more app-specific vars here as needed, for example: -# {{SERVICE}}_TIMEZONE=UTC -# {{SERVICE}}_ADMIN_EMAIL=admin@example.com diff --git a/README.md b/README.md index 6ac1c51..ebff40d 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,6 @@ -# {{Service}} with Tailscale Integration +# Shiori with Tailscale Integration -![{{Service}} with Tailscale](https://raw.githubusercontent.com/go-vikunja/vikunja/main/frontend/src/assets/logo.svg "{{Service}}") - -This project sets up a {{Service}} instance with Tailscale VPN integration using Docker Compose. +A self-hosted bookmark manager (Go, single binary) running on your tailnet, fronted by a Tailscale sidecar. ## Quick Start (Tailscale) @@ -16,8 +14,15 @@ This project sets up a {{Service}} instance with Tailscale VPN integration using ```bash docker compose up -d ``` -4. Customize the app config per official documentation -5. Access {{Service}} at `http://{{service}}..ts.net` +4. Browse to `https://shiori..ts.net` and log in with the default credentials: + - Username: `shiori` + - Password: `gopher` +5. Change the password immediately (Settings → Account). + +**Note:** Shiori v1.7.0 has a known issue where the SPA's "setup wizard" detection +panics with HTTP 500 on the first request when no session exists. The wizard +does NOT appear on first visit. Just log in with the default credentials above +and change the password. ## Headscale @@ -34,17 +39,18 @@ If you're using Headscale instead of Tailscale: ```bash cp tailscale/config/serve.headscale.json tailscale/config/serve.json ``` -4. Edit `serve.json` and replace `{{service}}.example.com` with your actual domain +4. Edit `serve.json` and replace `shiori.damconsulting.net` with your actual domain. 5. Start the stack: ```bash docker compose up -d ``` -6. Customs the app config per official documentation -7. Access {{Service}} at `http://{{service}}.yourdomain.com` +6. Browse to `http://shiori.yourdomain.com` and complete the setup wizard. ## Configuration -See `.env.example` for all available options. +See `.env.example` for all available options. The app accepts no env vars +beyond what the sidecar requires — Shiori uses SQLite by default and stores +its data in `SHIORI_DIR=/srv/shiori` (a named volume). ### Switching Serve Configs @@ -53,18 +59,32 @@ See `.env.example` for all available options. | Tailscale (default) | `tailscale/config/serve.json` | Supports HTTP + HTTPS with certs | | Headscale | `tailscale/config/serve.headscale.json` | HTTP only | -After changing the serve config, restart the sidecar: +After changing the serve config, restart the sidecar **and** the app: ```bash -docker compose restart {{service}}-ts +docker compose restart shiori-ts +docker compose restart shiori ``` ## Optional: Direct Host Access -Uncomment the ports section in `docker-compose.yml` if you need direct access without Tailscale: +Uncomment the `ports` section in `docker-compose.yml` if you need direct access without Tailscale: + ```yaml ports: - - {{port}}:{{port}} + - "8080:8080" +``` + +## Data Backup + +Shiori's data (SQLite database + archived bookmarks) lives in the `shiori-data` named volume. To back it up: + +```bash +docker run --rm -v shiori-data:/data -v /path/to/backups:/backup alpine \ + tar czf /backup/shiori-$(date +%F).tar.gz -C /data . ``` ## Links -put links to offical site, and git repo + +- [Shiori Website](https://go-shiori.github.io/shiori/) +- [Shiori GitHub](https://github.com/go-shiori/shiori) +- [Shiori Container Image](https://github.com/go-shiori/shiori/pkgs/container/shiori) \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 84f1a84..03987cf 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,11 +1,11 @@ # ========================================== -# REQUIRED: Tailscale sidecar (all ts-* services) +# ts-shiori — Tailscale sidecar + Shiori bookmark manager # ========================================== services: - {{service}}-ts: + shiori-ts: image: tailscale/tailscale:latest - hostname: {{service}} - container_name: {{service}}-ts + hostname: shiori + container_name: shiori-ts environment: - TS_AUTHKEY=${TS_AUTHKEY} - TS_LOGIN_SERVER=${TS_LOGIN_SERVER} @@ -21,47 +21,20 @@ services: restart: unless-stopped # ========================================== - # REFERENCE: Example database (REMOVE this section if your service - # uses SQLite or has no database requirement) + # Shiori app (single container, SQLite) + # Uses the official ghcr.io/go-shiori/shiori image. + # SQLite by default; data stored in a named volume. # ========================================== - db: - image: postgres:15 + shiori: + image: ghcr.io/go-shiori/shiori:v1.7.0 environment: - POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} - POSTGRES_USER: ${POSTGRES_USER} - POSTGRES_DB: ${POSTGRES_DB} + - SHIORI_DIR=/srv/shiori volumes: - - {{service}}-db-data:/var/lib/postgresql/data + - shiori-data:/srv/shiori depends_on: - - {{service}}-ts - network_mode: service:{{service}}-ts - restart: unless-stopped - - # ========================================== - # REQUIRED: Your service container - # Customize the image, env vars, and volumes for your specific app - # ========================================== - {{service}}: - image: {{service}}/{{service}}:latest - environment: - # Database (remove these lines if your service has no database) - {{SERVICE}}_DATABASE_TYPE: postgres - {{SERVICE}}_DATABASE_HOST: 127.0.0.1 - {{SERVICE}}_DATABASE_USER: ${POSTGRES_USER} - {{SERVICE}}_DATABASE_PASSWORD: ${POSTGRES_PASSWORD} - {{SERVICE}}_DATABASE_DATABASE: ${POSTGRES_DB} - - # Service configuration (customize these for your app) - {{SERVICE}}_SERVICE_JWTSECRET: ${{{SERVICE}}_SERVICE_JWTSECRET} - {{SERVICE}}_SERVICE_PUBLICURL: ${{{SERVICE}}_SERVICE_PUBLICURL} - {{SERVICE}}_SERVICE_FRONTENDURL: ${{{SERVICE}}_SERVICE_FRONTENDURL} - # Add or remove more app-specific env vars here as needed - volumes: - - ./{{service}}/files:/app/files - depends_on: - - {{service}}-ts - network_mode: service:{{service}}-ts + - shiori-ts + network_mode: service:shiori-ts restart: unless-stopped volumes: - {{service}}-db-data: + shiori-data: \ No newline at end of file diff --git a/tailscale/config/serve.headscale.json b/tailscale/config/serve.headscale.json index 89d6087..87194cd 100644 --- a/tailscale/config/serve.headscale.json +++ b/tailscale/config/serve.headscale.json @@ -5,12 +5,12 @@ } }, "Web": { - "{{service}}.yourdomain.com:80": { + "shiori.damconsulting.net:80": { "Handlers": { "/": { - "Proxy": "http://127.0.0.1:{{port}}" + "Proxy": "http://127.0.0.1:8080" } } } } -} +} \ No newline at end of file diff --git a/tailscale/config/serve.json b/tailscale/config/serve.json index 5be8901..fe63170 100644 --- a/tailscale/config/serve.json +++ b/tailscale/config/serve.json @@ -11,14 +11,14 @@ "${TS_CERT_DOMAIN}:80": { "Handlers": { "/": { - "Proxy": "http://127.0.0.1:{{port}}" + "Proxy": "http://127.0.0.1:8080" } } }, "${TS_CERT_DOMAIN}:443": { "Handlers": { "/": { - "Proxy": "http://127.0.0.1:{{port}}" + "Proxy": "http://127.0.0.1:8080" } } }