mirror of
https://github.com/Dvorinka/Primora.git
synced 2026-10-28 15:51:23 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
61f0974c61 | ||
|
|
769d04471f | ||
|
|
da294aaa2b | ||
|
|
1226d44872 | ||
|
|
ac4ca9a3ae | ||
|
|
597db3287e | ||
|
|
bbc57f9c0d | ||
|
|
9ab9b550d1 |
No files matched your search
@@ -327,6 +327,8 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
permissions:
|
||||||
packages: read
|
packages: read
|
||||||
|
# contents: write — the job uploads SBOM assets onto the release.
|
||||||
|
contents: write
|
||||||
env:
|
env:
|
||||||
VERSION: ${{ needs.verify.outputs.version }}
|
VERSION: ${{ needs.verify.outputs.version }}
|
||||||
steps:
|
steps:
|
||||||
|
|||||||
@@ -4,6 +4,16 @@ All notable changes to Primora. Format follows [Keep a Changelog](https://keepac
|
|||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
## [0.8.3] - 2026-09-28
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- **Install script asks for the public URL** — `install.sh` now prompts for where you'll open the app and accepts a full URL: `https://primora.example.com` (TLS at your proxy, hints printed at the end), `primora.example.com`, or `192.168.1.50:8085` (the port becomes `NGINX_PORT`). The answer rewrites every public URL var in `.env` and `COOKIE_DOMAIN` for real DNS names. The prompt reads the controlling terminal so it appears under `curl | bash`; no tty (CI, cron) falls back to `localhost`. Non-interactive via `PUBLIC_URL=`; legacy `DOMAIN`/`NGINX_PORT` envs still work; reruns over an existing `.env` skip the question.
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- **Auth origins behind external TLS terminators** — trusted origins now accept both URL schemes on the serving host. Verified live over a Cloudflare quick tunnel: a real browser session cookie + `https://*.trycloudflare.com` origin was 403'd on v0.8.2 (nginx reports `X-Forwarded-Proto: http` inbound); the same request now signs in cleanly while cross-site origins still 403.
|
||||||
|
|
||||||
## [0.8.2] - 2026-09-28
|
## [0.8.2] - 2026-09-28
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|||||||
@@ -77,7 +77,9 @@ Prerequisites: Docker with the Compose plugin.
|
|||||||
curl -fsSL https://raw.githubusercontent.com/Dvorinka/Primora/master/install.sh | bash
|
curl -fsSL https://raw.githubusercontent.com/Dvorinka/Primora/master/install.sh | bash
|
||||||
```
|
```
|
||||||
|
|
||||||
Installs into `./primora`, generates secrets, and starts the stack on port 80.
|
Installs into `./primora`, asks one question — the URL you'll open the app on
|
||||||
|
(domain, IP, optional port) — generates secrets, and starts the stack.
|
||||||
|
Non-interactive: `PUBLIC_URL=https://primora.example.com bash install.sh`.
|
||||||
Or from a clone:
|
Or from a clone:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
|||||||
@@ -63,6 +63,9 @@ export const auth = betterAuth({
|
|||||||
if (host) {
|
if (host) {
|
||||||
const proto = request?.headers.get("x-forwarded-proto") ?? "http";
|
const proto = request?.headers.get("x-forwarded-proto") ?? "http";
|
||||||
origins.push(`${proto}://${host}`);
|
origins.push(`${proto}://${host}`);
|
||||||
|
// TLS often terminates at an external proxy — nginx then reports http.
|
||||||
|
// Both schemes on the serving host are legitimately this instance.
|
||||||
|
origins.push(proto === "https" ? `http://${host}` : `https://${host}`);
|
||||||
}
|
}
|
||||||
return origins;
|
return origins;
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@primora/desktop",
|
"name": "@primora/desktop",
|
||||||
"version": "0.8.2",
|
"version": "0.8.3",
|
||||||
"private": true,
|
"private": true,
|
||||||
"description": "Primora desktop shell — thin Tauri client for a self-hosted deployment",
|
"description": "Primora desktop shell — thin Tauri client for a self-hosted deployment",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://schema.tauri.app/config/2",
|
"$schema": "https://schema.tauri.app/config/2",
|
||||||
"productName": "Primora",
|
"productName": "Primora",
|
||||||
"version": "0.8.2",
|
"version": "0.8.3",
|
||||||
"identifier": "dev.tdvorak.primora",
|
"identifier": "dev.tdvorak.primora",
|
||||||
"build": {
|
"build": {
|
||||||
"frontendDist": "../ui"
|
"frontendDist": "../ui"
|
||||||
|
|||||||
+69
-14
@@ -3,8 +3,14 @@
|
|||||||
#
|
#
|
||||||
# curl -fsSL https://raw.githubusercontent.com/Dvorinka/Primora/master/install.sh | bash
|
# curl -fsSL https://raw.githubusercontent.com/Dvorinka/Primora/master/install.sh | bash
|
||||||
#
|
#
|
||||||
# Installs into ./primora (override with PRIMORA_DIR). Non-interactive:
|
# Installs into ./primora (override with PRIMORA_DIR). On a fresh install,
|
||||||
# DOMAIN=example.com NGINX_PORT=8080 bash install.sh
|
# interactive shells get one question — the URL the app will be opened on
|
||||||
|
# (domain or IP, optional port). Non-interactive:
|
||||||
|
# PUBLIC_URL=https://primora.example.com bash install.sh
|
||||||
|
# DOMAIN=192.168.1.50 NGINX_PORT=8085 bash install.sh (legacy form)
|
||||||
|
#
|
||||||
|
# https URLs mean TLS terminates at your own proxy in front of Primora's
|
||||||
|
# bundled nginx (which always speaks http on NGINX_PORT).
|
||||||
#
|
#
|
||||||
# Pulls prebuilt GHCR images when available; otherwise downloads the source
|
# Pulls prebuilt GHCR images when available; otherwise downloads the source
|
||||||
# tarball and builds locally. Either way the result is the same compose stack.
|
# tarball and builds locally. Either way the result is the same compose stack.
|
||||||
@@ -14,8 +20,8 @@ set -euo pipefail
|
|||||||
REPO="Dvorinka/Primora"
|
REPO="Dvorinka/Primora"
|
||||||
REF="${PRIMORA_REF:-master}"
|
REF="${PRIMORA_REF:-master}"
|
||||||
DIR="${PRIMORA_DIR:-primora}"
|
DIR="${PRIMORA_DIR:-primora}"
|
||||||
DOMAIN="${DOMAIN:-localhost}"
|
|
||||||
NGINX_PORT="${NGINX_PORT:-80}"
|
NGINX_PORT="${NGINX_PORT:-80}"
|
||||||
|
PUBLIC_URL="${PUBLIC_URL:-}"
|
||||||
|
|
||||||
info() { echo "==> $*"; }
|
info() { echo "==> $*"; }
|
||||||
die() { echo "ERROR: $*" >&2; exit 1; }
|
die() { echo "ERROR: $*" >&2; exit 1; }
|
||||||
@@ -37,7 +43,52 @@ for f in docker-compose.yml .env.example infra/nginx/default.conf; do
|
|||||||
curl -fsSL "https://raw.githubusercontent.com/$REPO/$REF/$f" -o "$f"
|
curl -fsSL "https://raw.githubusercontent.com/$REPO/$REF/$f" -o "$f"
|
||||||
done
|
done
|
||||||
|
|
||||||
if [ ! -f .env ]; then
|
if [ -f .env ]; then
|
||||||
|
info "Existing .env kept"
|
||||||
|
# Display URL comes from the file — answers here would change nothing.
|
||||||
|
PUBLIC_URL="$(grep -E '^VITE_APP_URL=' .env | tail -1 | cut -d= -f2- || true)"
|
||||||
|
[ -z "$PUBLIC_URL" ] && PUBLIC_URL="http://localhost"
|
||||||
|
else
|
||||||
|
# Public URL — the single question. Env wins, then prompt, then default.
|
||||||
|
if [ -z "$PUBLIC_URL" ] && [ -n "${DOMAIN:-}" ]; then
|
||||||
|
PUBLIC_URL="http://${DOMAIN}"
|
||||||
|
[ "$NGINX_PORT" != "80" ] && PUBLIC_URL="$PUBLIC_URL:$NGINX_PORT"
|
||||||
|
fi
|
||||||
|
if [ -z "$PUBLIC_URL" ]; then
|
||||||
|
DEFAULT_URL="http://localhost"
|
||||||
|
[ "$NGINX_PORT" != "80" ] && DEFAULT_URL="http://localhost:$NGINX_PORT"
|
||||||
|
# Under `curl | bash` stdin is the script pipe — prompt on the
|
||||||
|
# controlling terminal instead. No tty (CI/cron) → default silently.
|
||||||
|
if exec 9</dev/tty 2>/dev/null; then
|
||||||
|
read -rp "URL where you'll open Primora (domain or IP, e.g. https://primora.example.com) [$DEFAULT_URL]: " PUBLIC_URL <&9 || true
|
||||||
|
exec 9>&-
|
||||||
|
fi
|
||||||
|
PUBLIC_URL="${PUBLIC_URL:-$DEFAULT_URL}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Normalize: default scheme http, strip trailing slash.
|
||||||
|
case "$PUBLIC_URL" in
|
||||||
|
http://*|https://*) ;;
|
||||||
|
*) PUBLIC_URL="http://$PUBLIC_URL" ;;
|
||||||
|
esac
|
||||||
|
PUBLIC_URL="${PUBLIC_URL%/}"
|
||||||
|
|
||||||
|
# Split host[:port]; URL paths aren't supported — nginx mounts auth at /auth.
|
||||||
|
REST="${PUBLIC_URL#*://}"
|
||||||
|
HOSTPORT="${REST%%/*}"
|
||||||
|
[ "$REST" != "$HOSTPORT" ] && die "URL paths are not supported — use a domain or port instead: $PUBLIC_URL"
|
||||||
|
if [[ "$HOSTPORT" == *:* ]]; then
|
||||||
|
HOST="${HOSTPORT%%:*}"
|
||||||
|
PORT="${HOSTPORT##*:}"
|
||||||
|
else
|
||||||
|
HOST="$HOSTPORT"; PORT=""
|
||||||
|
fi
|
||||||
|
[ -z "$HOST" ] && die "could not parse a host from: $PUBLIC_URL"
|
||||||
|
if [ -n "$PORT" ]; then
|
||||||
|
[[ "$PORT" =~ ^[0-9]+$ ]] || die "invalid port in: $PUBLIC_URL"
|
||||||
|
NGINX_PORT="$PORT"
|
||||||
|
fi
|
||||||
|
|
||||||
info "Generating .env with random secrets"
|
info "Generating .env with random secrets"
|
||||||
cp .env.example .env
|
cp .env.example .env
|
||||||
|
|
||||||
@@ -53,12 +104,15 @@ if [ ! -f .env ]; then
|
|||||||
"${SED[@]}" "s|^PRIMORA_ENCRYPTION_KEY=.*|PRIMORA_ENCRYPTION_KEY=$ENCRYPTION_KEY|" .env
|
"${SED[@]}" "s|^PRIMORA_ENCRYPTION_KEY=.*|PRIMORA_ENCRYPTION_KEY=$ENCRYPTION_KEY|" .env
|
||||||
"${SED[@]}" "s|^NGINX_PORT=.*|NGINX_PORT=$NGINX_PORT|" .env
|
"${SED[@]}" "s|^NGINX_PORT=.*|NGINX_PORT=$NGINX_PORT|" .env
|
||||||
|
|
||||||
if [ "$DOMAIN" != "localhost" ]; then
|
# Every public URL var (VITE_APP_URL, BETTER_AUTH_URL, AUTH_BASE_URL,
|
||||||
"${SED[@]}" "s|http://localhost|http://$DOMAIN|g" .env
|
# VITE_AUTH_BASE_URL, VITE_API_BASE_URL, BACKEND_PUBLIC_URL) is built on the
|
||||||
"${SED[@]}" "s|^COOKIE_DOMAIN=.*|COOKIE_DOMAIN=$DOMAIN|" .env
|
# http://localhost prefix in .env.example — one rewrite covers them all.
|
||||||
|
"${SED[@]}" "s|http://localhost|$PUBLIC_URL|g" .env
|
||||||
|
|
||||||
|
# Cookie domains only apply to real DNS names — never IPs or localhost.
|
||||||
|
if [ "$HOST" != "localhost" ] && ! [[ "$HOST" =~ ^[0-9.]+$ ]]; then
|
||||||
|
"${SED[@]}" "s|^COOKIE_DOMAIN=.*|COOKIE_DOMAIN=$HOST|" .env
|
||||||
fi
|
fi
|
||||||
else
|
|
||||||
info "Existing .env kept"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Compose v5 skips `pull` for services that declare build:, so fetch the
|
# Compose v5 skips `pull` for services that declare build:, so fetch the
|
||||||
@@ -79,11 +133,12 @@ else
|
|||||||
docker compose up -d --build
|
docker compose up -d --build
|
||||||
fi
|
fi
|
||||||
|
|
||||||
DISPLAY_URL="http://$DOMAIN"
|
|
||||||
[ "$NGINX_PORT" != "80" ] && DISPLAY_URL="$DISPLAY_URL:$NGINX_PORT"
|
|
||||||
|
|
||||||
info "Primora is starting"
|
info "Primora is starting"
|
||||||
echo " Dashboard: $DISPLAY_URL"
|
echo " Dashboard: $PUBLIC_URL"
|
||||||
echo " Health: $DISPLAY_URL/api/v1/health/liveness"
|
echo " Health: $PUBLIC_URL/api/v1/health/liveness"
|
||||||
echo " Logs: cd $DIR && docker compose logs -f"
|
echo " Logs: cd $DIR && docker compose logs -f"
|
||||||
echo " Stop: cd $DIR && docker compose down"
|
echo " Stop: cd $DIR && docker compose down"
|
||||||
|
if [[ "$PUBLIC_URL" == https://* ]]; then
|
||||||
|
echo
|
||||||
|
echo " Primora listens on http port $NGINX_PORT — point your TLS proxy there."
|
||||||
|
fi
|
||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "primora",
|
"name": "primora",
|
||||||
"version": "0.8.2",
|
"version": "0.8.3",
|
||||||
"private": true,
|
"private": true,
|
||||||
"packageManager": "[email protected]",
|
"packageManager": "[email protected]",
|
||||||
"workspaces": [
|
"workspaces": [
|
||||||
|
|||||||
Reference in new issue
Block a user