From 47f8f2f03a2bfebd41493fef50dc0aef39485796 Mon Sep 17 00:00:00 2001 From: Nicolas Meienberger Date: Wed, 27 May 2026 17:40:43 +0200 Subject: [PATCH] docs: update local dev server instructions --- AGENTS.md | 17 ++++++++++++++++- README.md | 34 +++++++++++++++++----------------- 2 files changed, 33 insertions(+), 18 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index a1c72922..62ac15c6 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -2,7 +2,7 @@ - Never create migration files manually. Always use the provided command to generate migrations - If you realize an automated migration is incorrect, make sure to remove all the associated entries from the `_journal.json` and the newly created files located in `app/drizzle/` before re-generating the migration -- The dev server is running at http://localhost:3000. Username is `admin` and password is `password` +- The dev server runs through Portless. Start it with `bun run dev`, then use `portless get zerobyte` to get the current worktree-specific URL. Do not assume a fixed port like `3000` or `4096`. Username is `admin` and password is `password` - The repo is https://github.com/nicotsx/zerobyte - If you need to run a specific restic command on a repository, you can open and use the dev panel with `Meta+Shift+D` @@ -10,6 +10,21 @@ Zerobyte is a backup automation tool built on top of Restic that provides a web interface for scheduling, managing, and monitoring encrypted backups. It supports multiple volume backends (NFS, SMB, WebDAV, SFTP, local directories) and repository backends (S3, Azure, GCS, local, and rclone-based storage). +### Development Server + +```bash +# Start the dev server through Portless +bun run dev + +# Get the current app URL for this worktree +portless get zerobyte + +# Inspect active Portless routes if needed +portless list +``` + +Portless applies git worktree prefixes automatically, so linked worktrees may return URLs like `https://branch-name.zerobyte.localhost`. Use the Portless URL for browser testing and manual verification. + ### Type Checking ```bash diff --git a/README.md b/README.md index bef906ee..65fd4d1b 100644 --- a/README.md +++ b/README.md @@ -99,22 +99,22 @@ Zerobyte can be customized using environment variables. Below are the available ### Environment variables -| Variable | Description | Default | -| :-------------------- | :---------------------------------------------------------------------------------------------------------------------------------------- | :--------------------- | -| `BASE_URL` | **Required.** The base URL of your Zerobyte instance (e.g., `https://zerobyte.example.com`). See [Authentication](#authentication) below. | (none) | -| `APP_SECRET` | **Required.** A random secret key (32+ chars) used to encrypt sensitive data in the database. Generate with `openssl rand -hex 32`. | (none) | -| `APP_SECRET_FILE` | Path to a file containing `APP_SECRET`, useful with Docker or Kubernetes secrets. Mutually exclusive with `APP_SECRET`. | (none) | -| `PORT` | The port the web interface and API will listen on. | `4096` | -| `RESTIC_HOSTNAME` | The hostname used by Restic when creating snapshots. Automatically detected if a custom hostname is set in Docker. | `zerobyte` | -| `TZ` | Timezone for the container (e.g., `Europe/Zurich`). **Crucial for accurate backup scheduling.** | `UTC` | -| `TRUST_PROXY` | When `true`, trust an existing `X-Forwarded-For` header from your reverse proxy. Leave `false` for direct deployments. | `false` | -| `TRUSTED_ORIGINS` | Comma-separated list of extra trusted origins for CORS (e.g., `http://localhost:3000,http://example.com`). | (none) | -| `WEBHOOK_ALLOWED_ORIGINS` | Comma-separated list of HTTP origins allowed for backup webhooks and outbound HTTP notification destinations. | (none) | -| `WEBHOOK_TIMEOUT` | Timeout for backup webhook requests in seconds. | `60` | -| `LOG_LEVEL` | Logging verbosity. Options: `debug`, `info`, `warn`, `error`. | `info` | -| `SERVER_IDLE_TIMEOUT` | Idle timeout for the server in seconds. | `60` | -| `RCLONE_CONFIG_DIR` | Path to the directory containing `rclone.conf` inside the container. Change this if running as a non-root user. | `/root/.config/rclone` | -| `PROVISIONING_PATH` | Path to a JSON file with operator-managed repositories and volumes to sync at startup. | (none) | +| Variable | Description | Default | +| :------------------------ | :---------------------------------------------------------------------------------------------------------------------------------------- | :--------------------- | +| `BASE_URL` | **Required.** The base URL of your Zerobyte instance (e.g., `https://zerobyte.example.com`). See [Authentication](#authentication) below. | (none) | +| `APP_SECRET` | **Required.** A random secret key (32+ chars) used to encrypt sensitive data in the database. Generate with `openssl rand -hex 32`. | (none) | +| `APP_SECRET_FILE` | Path to a file containing `APP_SECRET`, useful with Docker or Kubernetes secrets. Mutually exclusive with `APP_SECRET`. | (none) | +| `PORT` | The port the web interface and API will listen on. | `4096` | +| `RESTIC_HOSTNAME` | The hostname used by Restic when creating snapshots. Automatically detected if a custom hostname is set in Docker. | `zerobyte` | +| `TZ` | Timezone for the container (e.g., `Europe/Zurich`). **Crucial for accurate backup scheduling.** | `UTC` | +| `TRUST_PROXY` | When `true`, trust an existing `X-Forwarded-For` header from your reverse proxy. Leave `false` for direct deployments. | `false` | +| `TRUSTED_ORIGINS` | Comma-separated list of extra trusted origins for CORS (e.g., `http://localhost:3000,http://example.com`). | (none) | +| `WEBHOOK_ALLOWED_ORIGINS` | Comma-separated list of HTTP origins allowed for backup webhooks and outbound HTTP notification destinations. | (none) | +| `WEBHOOK_TIMEOUT` | Timeout for backup webhook requests in seconds. | `60` | +| `LOG_LEVEL` | Logging verbosity. Options: `debug`, `info`, `warn`, `error`. | `info` | +| `SERVER_IDLE_TIMEOUT` | Idle timeout for the server in seconds. | `60` | +| `RCLONE_CONFIG_DIR` | Path to the directory containing `rclone.conf` inside the container. Change this if running as a non-root user. | `/root/.config/rclone` | +| `PROVISIONING_PATH` | Path to a JSON file with operator-managed repositories and volumes to sync at startup. | (none) | ### Webhook and notification network policy @@ -398,7 +398,7 @@ RESTIC_PASS_FILE=./data/restic.pass RESTIC_CACHE_DIR=./data/restic/cache ZEROBYTE_REPOSITORIES_DIR=./data/repositories ZEROBYTE_VOLUMES_DIR=./data/volumes -BASE_URL=http://localhost:4096 +BASE_URL=https://*.localhost ``` Notes: