diff --git a/Database/Dockerfile b/Database/Dockerfile index 9c62900..8ebc917 100644 --- a/Database/Dockerfile +++ b/Database/Dockerfile @@ -15,9 +15,9 @@ FROM ${PB_IMAGE} COPY pb_migrations /pb/pb_migrations COPY pb_hooks /pb/pb_hooks -# docwell-server expects PocketBase on 8090 (DOCWELL_PB_URL=http://db:8090). +# docwell-server expects PocketBase on 8070 (DOCWELL_PB_URL=http://db:8070). # The base image's entrypoint and HEALTHCHECK both read PB_PORT. -ENV PB_PORT=8090 -EXPOSE 8090 +ENV PB_PORT=8070 +EXPOSE 8070 # Inherited: VOLUME /pb/pb_data, HEALTHCHECK on /api/health, ENTRYPOINT. diff --git a/Database/README.md b/Database/README.md index 88e709a..35011ef 100644 --- a/Database/README.md +++ b/Database/README.md @@ -20,7 +20,7 @@ Download PocketBase v0.40.6 for your OS into `Database/bin/`, then: ./bin/pocketbase serve --dir ./pb_data --migrationsDir ./pb_migrations --hooksDir ./pb_hooks ``` -The PocketBase dashboard is at http://127.0.0.1:8090/_/. +The PocketBase dashboard is at http://127.0.0.1:8070/_/. ## New migration diff --git a/Docker-AIO/start.sh b/Docker-AIO/start.sh index 4eb0e01..9d66e08 100644 --- a/Docker-AIO/start.sh +++ b/Docker-AIO/start.sh @@ -22,19 +22,19 @@ pocketbase migrate up --dir /pb_data --migrationsDir /pb_migrations $ENC pocketbase superuser upsert "$PB_ADMIN_EMAIL" "$PB_ADMIN_PASSWORD" --dir /pb_data $ENC # shellcheck disable=SC2086 -pocketbase serve --http 127.0.0.1:8090 --dir /pb_data \ +pocketbase serve --http 127.0.0.1:8070 --dir /pb_data \ --migrationsDir /pb_migrations --hooksDir /pb_hooks --automigrate=false $ENC & PB_PID=$! i=0 -until wget -qO- http://127.0.0.1:8090/api/health >/dev/null 2>&1; do +until wget -qO- http://127.0.0.1:8070/api/health >/dev/null 2>&1; do i=$((i + 1)) [ "$i" -gt 50 ] && echo "PocketBase did not start" >&2 && exit 1 sleep 0.2 done DOCWELL_ADDR=127.0.0.1:8080 \ -DOCWELL_PB_URL=http://127.0.0.1:8090 \ +DOCWELL_PB_URL=http://127.0.0.1:8070 \ DOCWELL_PB_EMAIL="$PB_ADMIN_EMAIL" \ DOCWELL_PB_PASSWORD="$PB_ADMIN_PASSWORD" \ docwell-server & diff --git a/Docker/.env.prod.example b/Docker/.env.prod.example index 0489040..4e9b97c 100644 --- a/Docker/.env.prod.example +++ b/Docker/.env.prod.example @@ -73,7 +73,7 @@ SERVER_BIND=0.0.0.0 SERVER_PORT=8080 # The PocketBase dashboard (/_/). Loopback only; use an SSH tunnel to reach it. PB_BIND=127.0.0.1 -PB_PORT=8090 +PB_PORT=8070 # --- Storage ----------------------------------------------------------------- # Docker-managed named volumes by default; set absolute host paths for bind diff --git a/Docker/.env.prod.s3.example b/Docker/.env.prod.s3.example index 4904b92..276aa1f 100644 --- a/Docker/.env.prod.s3.example +++ b/Docker/.env.prod.s3.example @@ -73,7 +73,7 @@ SERVER_BIND=0.0.0.0 SERVER_PORT=8080 # The PocketBase dashboard (/_/). Loopback only; use an SSH tunnel to reach it. PB_BIND=127.0.0.1 -PB_PORT=8090 +PB_PORT=8070 # --- Storage ----------------------------------------------------------------- # Docker-managed named volumes by default; set absolute host paths for bind diff --git a/Docker/.env.prod.seaweedfs.example b/Docker/.env.prod.seaweedfs.example index f954f30..4832dd3 100644 --- a/Docker/.env.prod.seaweedfs.example +++ b/Docker/.env.prod.seaweedfs.example @@ -73,7 +73,7 @@ SERVER_BIND=0.0.0.0 SERVER_PORT=8080 # The PocketBase dashboard (/_/). Loopback only; use an SSH tunnel to reach it. PB_BIND=127.0.0.1 -PB_PORT=8090 +PB_PORT=8070 # --- Storage ----------------------------------------------------------------- # Docker-managed named volumes by default; set absolute host paths for bind diff --git a/Docker/.env.prod.seaweedfs.split.example b/Docker/.env.prod.seaweedfs.split.example index 6b3167c..a16090b 100644 --- a/Docker/.env.prod.seaweedfs.split.example +++ b/Docker/.env.prod.seaweedfs.split.example @@ -73,7 +73,7 @@ SERVER_BIND=0.0.0.0 SERVER_PORT=8080 # The PocketBase dashboard (/_/). Loopback only; use an SSH tunnel to reach it. PB_BIND=127.0.0.1 -PB_PORT=8090 +PB_PORT=8070 # --- Storage ----------------------------------------------------------------- # Docker-managed named volumes by default; set absolute host paths for bind diff --git a/Docker/docker-compose.prod.s3.yml b/Docker/docker-compose.prod.s3.yml index cb5838b..aa68eba 100644 --- a/Docker/docker-compose.prod.s3.yml +++ b/Docker/docker-compose.prod.s3.yml @@ -83,11 +83,11 @@ services: # The PocketBase dashboard (/_/), bound to loopback: every collection is # superuser-only and nothing but docwell-server should talk to it. Reach # it from elsewhere with an SSH tunnel rather than PB_BIND=0.0.0.0. - - "${PB_BIND:-127.0.0.1}:${PB_PORT:-8090}:8090" + - "${PB_BIND:-127.0.0.1}:${PB_PORT:-8070}:8070" healthcheck: # Declared here as well as in the image, so the depends_on gate below # works against any image tag. - test: ["CMD-SHELL", "wget -qO- http://127.0.0.1:8090/api/health || exit 1"] + test: ["CMD-SHELL", "wget -qO- http://127.0.0.1:8070/api/health || exit 1"] interval: 10s timeout: 3s retries: 12 @@ -103,7 +103,7 @@ services: environment: # Service name on the compose network. Override DOCWELL_PB_URL in .env to # use a PocketBase outside this stack. - DOCWELL_PB_URL: "${DOCWELL_PB_URL:-http://db:8090}" + DOCWELL_PB_URL: "${DOCWELL_PB_URL:-http://db:8070}" DOCWELL_PB_EMAIL: "${PB_ADMIN_EMAIL}" DOCWELL_PB_PASSWORD: "${PB_ADMIN_PASSWORD}" # Where browsers reach this service, and where they reach docwell-web. diff --git a/Docker/docker-compose.prod.seaweedfs.split.yml b/Docker/docker-compose.prod.seaweedfs.split.yml index 0c41eb1..c35a14f 100644 --- a/Docker/docker-compose.prod.seaweedfs.split.yml +++ b/Docker/docker-compose.prod.seaweedfs.split.yml @@ -252,11 +252,11 @@ services: # The PocketBase dashboard (/_/), bound to loopback: every collection is # superuser-only and nothing but docwell-server should talk to it. Reach # it from elsewhere with an SSH tunnel rather than PB_BIND=0.0.0.0. - - "${PB_BIND:-127.0.0.1}:${PB_PORT:-8090}:8090" + - "${PB_BIND:-127.0.0.1}:${PB_PORT:-8070}:8070" healthcheck: # Declared here as well as in the image, so the depends_on gate below # works against any image tag. - test: ["CMD-SHELL", "wget -qO- http://127.0.0.1:8090/api/health || exit 1"] + test: ["CMD-SHELL", "wget -qO- http://127.0.0.1:8070/api/health || exit 1"] interval: 10s timeout: 3s retries: 12 @@ -272,7 +272,7 @@ services: environment: # Service name on the compose network. Override DOCWELL_PB_URL in .env to # use a PocketBase outside this stack. - DOCWELL_PB_URL: "${DOCWELL_PB_URL:-http://db:8090}" + DOCWELL_PB_URL: "${DOCWELL_PB_URL:-http://db:8070}" DOCWELL_PB_EMAIL: "${PB_ADMIN_EMAIL}" DOCWELL_PB_PASSWORD: "${PB_ADMIN_PASSWORD}" # Where browsers reach this service, and where they reach docwell-web. diff --git a/Docker/docker-compose.prod.seaweedfs.yml b/Docker/docker-compose.prod.seaweedfs.yml index decb4ff..134b226 100644 --- a/Docker/docker-compose.prod.seaweedfs.yml +++ b/Docker/docker-compose.prod.seaweedfs.yml @@ -128,11 +128,11 @@ services: # The PocketBase dashboard (/_/), bound to loopback: every collection is # superuser-only and nothing but docwell-server should talk to it. Reach # it from elsewhere with an SSH tunnel rather than PB_BIND=0.0.0.0. - - "${PB_BIND:-127.0.0.1}:${PB_PORT:-8090}:8090" + - "${PB_BIND:-127.0.0.1}:${PB_PORT:-8070}:8070" healthcheck: # Declared here as well as in the image, so the depends_on gate below # works against any image tag. - test: ["CMD-SHELL", "wget -qO- http://127.0.0.1:8090/api/health || exit 1"] + test: ["CMD-SHELL", "wget -qO- http://127.0.0.1:8070/api/health || exit 1"] interval: 10s timeout: 3s retries: 12 @@ -148,7 +148,7 @@ services: environment: # Service name on the compose network. Override DOCWELL_PB_URL in .env to # use a PocketBase outside this stack. - DOCWELL_PB_URL: "${DOCWELL_PB_URL:-http://db:8090}" + DOCWELL_PB_URL: "${DOCWELL_PB_URL:-http://db:8070}" DOCWELL_PB_EMAIL: "${PB_ADMIN_EMAIL}" DOCWELL_PB_PASSWORD: "${PB_ADMIN_PASSWORD}" # Where browsers reach this service, and where they reach docwell-web. diff --git a/Docker/docker-compose.prod.yml b/Docker/docker-compose.prod.yml index 9938a5f..c68c5f0 100644 --- a/Docker/docker-compose.prod.yml +++ b/Docker/docker-compose.prod.yml @@ -57,11 +57,11 @@ services: # The PocketBase dashboard (/_/), bound to loopback: every collection is # superuser-only and nothing but docwell-server should talk to it. Reach # it from elsewhere with an SSH tunnel rather than PB_BIND=0.0.0.0. - - "${PB_BIND:-127.0.0.1}:${PB_PORT:-8090}:8090" + - "${PB_BIND:-127.0.0.1}:${PB_PORT:-8070}:8070" healthcheck: # Declared here as well as in the image, so the depends_on gate below # works against any image tag. - test: ["CMD-SHELL", "wget -qO- http://127.0.0.1:8090/api/health || exit 1"] + test: ["CMD-SHELL", "wget -qO- http://127.0.0.1:8070/api/health || exit 1"] interval: 10s timeout: 3s retries: 12 @@ -77,7 +77,7 @@ services: environment: # Service name on the compose network. Override DOCWELL_PB_URL in .env to # use a PocketBase outside this stack. - DOCWELL_PB_URL: "${DOCWELL_PB_URL:-http://db:8090}" + DOCWELL_PB_URL: "${DOCWELL_PB_URL:-http://db:8070}" DOCWELL_PB_EMAIL: "${PB_ADMIN_EMAIL}" DOCWELL_PB_PASSWORD: "${PB_ADMIN_PASSWORD}" # Where browsers reach this service, and where they reach docwell-web. diff --git a/Docker/docker-compose.yml b/Docker/docker-compose.yml index fbf6879..9482aa6 100644 --- a/Docker/docker-compose.yml +++ b/Docker/docker-compose.yml @@ -28,7 +28,7 @@ services: - pb_data:/pb/pb_data # Private: only docwell-server talks to PocketBase. To open the PocketBase # dashboard during development, uncomment: - # ports: ["127.0.0.1:8090:8090"] + # ports: ["127.0.0.1:8070:8070"] server: image: ${DOCWELL_REGISTRY:-ghcr.io/docwell}/docwell-server:${DOCWELL_VERSION:-latest} @@ -40,7 +40,7 @@ services: db: condition: service_healthy environment: - DOCWELL_PB_URL: http://db:8090 + DOCWELL_PB_URL: http://db:8070 DOCWELL_PB_EMAIL: ${PB_ADMIN_EMAIL} DOCWELL_PB_PASSWORD: ${PB_ADMIN_PASSWORD} DOCWELL_PUBLIC_URL: ${DOCWELL_PUBLIC_URL:-http://localhost:8080} diff --git a/Docs-Site/guide/configuration.md b/Docs-Site/guide/configuration.md index ee39821..3663c84 100644 --- a/Docs-Site/guide/configuration.md +++ b/Docs-Site/guide/configuration.md @@ -31,7 +31,7 @@ Docwell is configured with environment variables, set in `.env` (separate servic | Variable | Default | What it does | | --- | --- | --- | | `DOCWELL_ADDR` | `:8080` | Listen address. | -| `DOCWELL_PB_URL` | `http://127.0.0.1:8090` | Where docwell-db is. Keep it on a private network. | +| `DOCWELL_PB_URL` | `http://127.0.0.1:8070` | Where docwell-db is. Keep it on a private network. | | `DOCWELL_PB_EMAIL`, `DOCWELL_PB_PASSWORD` | *(required)* | The PocketBase superuser (`PB_ADMIN_EMAIL`, `PB_ADMIN_PASSWORD`). | | `DOCWELL_PUBLIC_URL` | `http://localhost:8080` | The API's public address. Exported pages link attachments here. | | `DOCWELL_WEB_URL` | `http://localhost:3000` | The web app's address, for invite and share links. | diff --git a/Docs-Site/guide/reverse-proxy.md b/Docs-Site/guide/reverse-proxy.md index ceeb418..dc7d7bb 100644 --- a/Docs-Site/guide/reverse-proxy.md +++ b/Docs-Site/guide/reverse-proxy.md @@ -60,4 +60,4 @@ DOCWELL_COLLAB_URL=wss://api.wiki.example.com/collab DOCWELL_CORS_ORIGINS=https://wiki.example.com ``` -Never expose docwell-db (port 8090): only docwell-server may talk to it. +Never expose docwell-db (port 8070): only docwell-server may talk to it. diff --git a/Server/internal/config/config.go b/Server/internal/config/config.go index 9719788..8125a1f 100644 --- a/Server/internal/config/config.go +++ b/Server/internal/config/config.go @@ -62,7 +62,7 @@ func fromLookup(lookup func(string) (string, bool)) (Config, error) { PublicURL: strings.TrimRight(get("DOCWELL_PUBLIC_URL", "http://localhost:8080"), "/"), WebURL: strings.TrimRight(get("DOCWELL_WEB_URL", "http://localhost:3000"), "/"), CORSOrigins: splitList(get("DOCWELL_CORS_ORIGINS", "http://localhost:5173,http://localhost:3000")), - PocketBaseURL: strings.TrimRight(get("DOCWELL_PB_URL", "http://127.0.0.1:8090"), "/"), + PocketBaseURL: strings.TrimRight(get("DOCWELL_PB_URL", "http://127.0.0.1:8070"), "/"), PocketBaseEmail: get("DOCWELL_PB_EMAIL", ""), PocketBasePassword: get("DOCWELL_PB_PASSWORD", ""), SignupEnabled: get("DOCWELL_SIGNUP_ENABLED", "true") == "true", diff --git a/Server/internal/config/config_test.go b/Server/internal/config/config_test.go index 73092a2..d9715a8 100644 --- a/Server/internal/config/config_test.go +++ b/Server/internal/config/config_test.go @@ -40,7 +40,7 @@ func TestOverridesAndTrimming(t *testing.T) { cfg, err := fromLookup(lookup(map[string]string{ "DOCWELL_PB_EMAIL": "a@b.c", "DOCWELL_PB_PASSWORD": "x", - "DOCWELL_PB_URL": "http://db:8090/", + "DOCWELL_PB_URL": "http://db:8070/", "DOCWELL_CORS_ORIGINS": " https://a.test , ,https://b.test", "DOCWELL_SHUTDOWN_TIMEOUT": "3s", "DOCWELL_SIGNUP_ENABLED": "false", @@ -49,7 +49,7 @@ func TestOverridesAndTrimming(t *testing.T) { if err != nil { t.Fatal(err) } - if cfg.PocketBaseURL != "http://db:8090" { + if cfg.PocketBaseURL != "http://db:8070" { t.Errorf("PocketBaseURL = %q", cfg.PocketBaseURL) } if len(cfg.CORSOrigins) != 2 || cfg.CORSOrigins[1] != "https://b.test" {