diff --git a/.gitignore b/.gitignore index fbd8f6f..6ce8e82 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,5 @@ icecast2/fallback_music/* !icecast2/fallback_music/.gitkeep -searxng/settings.yml certbot/conf certbot/www backend/token/ @@ -17,6 +16,10 @@ gitea-runner/nohup.out # Rust build artifacts **/target/ +# Python bytecode +__pycache__/ +*.pyc + # Generated WASM output vue/src/wasm/ diff --git a/CLAUDE.md b/CLAUDE.md index 88931c0..e3b7152 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -48,6 +48,8 @@ Dockerized multi-service personal website self-hosted on a Raspberry Pi. **Frontend** (`vue/`): Vue 3 SPA with Vite, Tailwind CSS v4, Pinia stores, Vue Router. Built in a separate container; assets served through Nginx (production) or proxied to Vite dev server (dev mode). +**Python API** (`python/`): FastAPI app served by uvicorn on port 8000. Nginx proxies `/py/` to it and strips the prefix, so routes in `python/app/main.py` are written relative to `/`. Swagger UI at `/py/docs`. Dev mode mounts `python/app` and runs uvicorn with `--reload`. + **Nginx** (`nginx/`): Reverse proxy + SPA server. Config is templated (`nginx.conf.template`) and selected at runtime by `entrypoint.sh` based on `DEV_MODE` and certificate presence. Rate limiting on login (5/min), API (30/sec), uploads (5/min). ## Backend Structure @@ -68,6 +70,7 @@ Dockerized multi-service personal website self-hosted on a Raspberry Pi. - `src/stores/` — Pinia stores for auth, posts, favorites, activities, songs, messages, homeData - `src/views/` — page components (Home, Admin, CV, Notes, Bookmarks, shrines) - `src/components/` — reusable UI components +- `src/assets/styles.css` — design tokens (Tailwind `@theme`), base element styles, shared classes and transitions. `layouts/CVLayout.vue` re-points the colour tokens for the light CV theme. See "Styling" in `vue/README.md`. ## Key Patterns diff --git a/README.md b/README.md index e5a1a82..6e69552 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ db (5432) ── PostgreSQL 16 icecast2 (8000) ── Audio Streaming (Icecast2 + Liquidsoap) gitea (3000) ── Self-Hosted Git quartz (8080) ── Obsidian Notes Publisher (Quartz v4.4.0) -searxng (8080) ── Meta Search Engine +python (8000) ── Python API (FastAPI) hasura (8080) ── Hasura GraphQL Engine (Docker profile: hasura) autoheal ── Auto-restart unhealthy containers certbot ── SSL Certificate Management (disabled in dev) @@ -55,9 +55,8 @@ certbot ── SSL Certificate Management (disabled in dev) - Printable CV with role-specific sections - Job application tracker with status workflow and CSV export (admin-only, `/cv/jobs`) - Database-backed bookmarks grouped by category, managed via GraphQL (admin-only) -- SearXNG meta search engine (admin-only) - Hasura GraphQL console (admin-only) -- Admin-gated routes: `/searxng`, `/notes`, `/hasura` require admin JWT via Nginx `auth_request` +- Admin-gated routes: `/notes`, `/hasura` require admin JWT via Nginx `auth_request` - Landing page with animated stamps section - Route transitions (slide/fade) and performance optimizations (gzip, WOFF2 fonts, lazy loading) - Backend healthcheck with autoheal container for automatic recovery @@ -183,10 +182,10 @@ Access tokens are valid for 7 days; refresh tokens for 365 days. `ValidateAdmin` | `/gitea` | gitea:3000 | Git service | | `/hasura` | hasura:8080 | GraphQL console + WebSocket (admin-only) | | `/notes` | quartz:8080 | Obsidian notes (admin-only) | -| `/searxng` | searxng:8080 | Search engine (admin-only) | +| `/py` | python:8000 | Python API (FastAPI; docs at `/py/docs`) | | `/uploads` | local alias | User-uploaded files | -`/hasura`, `/notes`, and `/searxng` are protected by `auth_request` to `GET /api/auth/validate-admin`. Requests without a valid admin JWT are rejected with 401. +`/hasura` and `/notes` are protected by `auth_request` to `GET /api/auth/validate-admin`. Requests without a valid admin JWT are rejected with 401. ### Deprecated Endpoints @@ -213,9 +212,6 @@ Create a `.env` file in the project root. All services read from this file. | `POSTGRES_GITEA_DB` | Gitea database name | | `UPTIMEKUMA_HOST` | Uptime Kuma hostname (planned) | | `UPTIMEKUMA_PORT` | Uptime Kuma port (planned) | -| `SEARXNG_HOST` | SearXNG hostname (use `searxng` for Docker) | -| `SEARXNG_PORT` | SearXNG port (typically `8080`) | -| `SEARXNG_SECRET_KEY` | SearXNG secret key (random hex string) | | `WALLABAG_HOST` | Wallabag hostname (planned) | | `WALLABAG_PORT` | Wallabag port (planned) | | `QUARTZ_HOST` | Quartz hostname (use `quartz` for Docker) | @@ -249,6 +245,8 @@ Create a `.env` file in the project root. All services read from this file. | `HASURA_GRAPHQL_ADMIN_SECRET` | Hasura admin secret | | `HASURA_HOST` | Hasura hostname (use `hasura` for Docker) | | `HASURA_PORT` | Hasura port (typically `8080`) | +| `PYTHON_HOST` | Python API hostname (defaults to `python`) | +| `PYTHON_PORT` | Python API port (defaults to `8000`) | | `SEED_DB` | Set to `true` to seed test data on startup | ### Gitea Config @@ -261,16 +259,6 @@ cp gitea/config/app.ini.template gitea/config/app.ini Populate `LFS_JWT_SECRET`, `SECRET_KEY`, `INTERNAL_TOKEN`, `JWT_SECRET`, and the database `PASSWD`. Alternatively, the Gitea entrypoint generates `app.ini` from the template using environment variables. -### SearXNG Config - -Copy from the template: - -```sh -cp searxng/settings.yml.template searxng/settings.yml -``` - -The Docker entrypoint handles environment variable substitution (`${BASE_URL}`, `${SEARXNG_SECRET_KEY}`) automatically, so manual setup is only needed when running outside Docker. - ### Spotify Token Setup 4. After authorization, Spotify redirects to the callback endpoint which stores tokens at `/backend/token/spotify_token.json` @@ -340,7 +328,6 @@ These files are git-ignored and must be created manually: | ------------------------------- | --------------------------------------------------------------- | | `.env` | See setup section above | | `gitea/config/app.ini` | Copy from `app.ini.template` or let entrypoint generate it | -| `searxng/settings.yml` | Copy from `settings.yml.template` or let entrypoint generate it | | `certbot/conf/`, `certbot/www/` | Created automatically by certbot; use dev mode to skip | | `backend/token/` | Created automatically by Docker volume mount | | `icecast2/fallback_music/*.mp3` | Place at least one MP3 file | diff --git a/certbot/entrypoint.sh b/certbot/entrypoint.sh index 944c788..f4161ab 100755 --- a/certbot/entrypoint.sh +++ b/certbot/entrypoint.sh @@ -1,7 +1,8 @@ #!/bin/sh certbot certonly --webroot -w /var/www/certbot \ --email ${EMAIL} \ - -d ${DOMAIN} -d www.${DOMAIN} -d chat.${DOMAIN} \ + -d ${DOMAIN} -d www.${DOMAIN} \ + --cert-name ${DOMAIN} \ --agree-tos --non-interactive --expand; trap exit TERM; diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml index 4bb827a..bbe09e7 100644 --- a/docker-compose.dev.yml +++ b/docker-compose.dev.yml @@ -24,6 +24,10 @@ services: environment: HASURA_GRAPHQL_ENABLE_CONSOLE: "true" HASURA_GRAPHQL_DEV_MODE: "true" + python: + command: ["sh", "-c", "uvicorn app.main:app --host 0.0.0.0 --port ${PYTHON_PORT:-8000} --root-path /py --reload"] + volumes: + - ./python/app:/app/app certbot: profiles: - disabled diff --git a/docker-compose.yml b/docker-compose.yml index 8389b72..fc47332 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -12,10 +12,6 @@ volumes: uploads: # Vue build vue_dist: - # Searxng data - searxng_data: - # Open-WebUI data - openwebui_data: services: vue: @@ -42,8 +38,7 @@ services: - gitea - hasura - quartz - - searxng - - open-webui + - python networks: - app-network ports: @@ -158,35 +153,24 @@ services: volumes: - ${OBSIDIAN_DIR}:/quartz/content:ro - searxng: + python: build: - context: ./searxng + context: ./python dockerfile: Dockerfile - container_name: "${SEARXNG_HOST}" - restart: unless-stopped - networks: - - app-network - environment: - - BASE_URL=https://www.${DOMAIN}/searxng/ - - INSTANCE_NAME=searxng - - SEARXNG_SECRET_KEY=${SEARXNG_SECRET_KEY} - volumes: - - searxng_data:/etc/searxng - - open-webui: - image: ghcr.io/open-webui/open-webui:main - container_name: "${OPENWEBUI_HOST}" + container_name: "${PYTHON_HOST:-python}" restart: always networks: - app-network - env_file: - - ./.env environment: - - OLLAMA_BASE_URL=${OLLAMA_BASE_URL} - - WEBUI_AUTH=False - - WEBUI_URL=https://chat.${DOMAIN} - volumes: - - openwebui_data:/app/backend/data + - PYTHON_PORT=${PYTHON_PORT:-8000} + - ROOT_PATH=/py + - TFL_APP_KEY=${TFL_APP_KEY:-} + healthcheck: + test: ["CMD", "python", "-c", "import urllib.request,os; urllib.request.urlopen(f\"http://localhost:{os.environ.get('PYTHON_PORT','8000')}/health\")"] + interval: 30s + timeout: 5s + retries: 3 + start_period: 10s gitea: image: docker.gitea.com/gitea:1.25.4-rootless diff --git a/nginx/entrypoint.sh b/nginx/entrypoint.sh index 2ed89eb..90d019f 100755 --- a/nginx/entrypoint.sh +++ b/nginx/entrypoint.sh @@ -1,6 +1,10 @@ #!/bin/sh set -e +# Defaults for optional services so envsubst never leaves an empty upstream +export PYTHON_HOST="${PYTHON_HOST:-python}" +export PYTHON_PORT="${PYTHON_PORT:-8000}" + # Check if DEV_MODE if [ "$DEV_MODE" = "true" ]; then echo "Dev mode. Generating self-signed certificate for HTTPS." @@ -13,13 +17,13 @@ if [ "$DEV_MODE" = "true" ]; then -subj "/CN=localhost" 2>/dev/null fi # In dev mode, so use nginx_dev.conf.template - envsubst '${DOMAIN} ${BACKEND_HOST} ${BACKEND_PORT} ${BACKEND_ENDPOINT} ${ICECAST_HOST} ${ICECAST_PORT} ${GITEA_HOST} ${GITEA_PORT} ${HASURA_HOST} ${HASURA_PORT} ${QUARTZ_HOST} ${QUARTZ_PORT} ${UPTIMEKUMA_HOST} ${UPTIMEKUMA_PORT} ${SEARXNG_HOST} ${SEARXNG_PORT} ${WALLABAG_HOST} ${WALLABAG_PORT} ${OPENWEBUI_HOST} ${OPENWEBUI_PORT}' \ + envsubst '${DOMAIN} ${BACKEND_HOST} ${BACKEND_PORT} ${BACKEND_ENDPOINT} ${ICECAST_HOST} ${ICECAST_PORT} ${GITEA_HOST} ${GITEA_PORT} ${HASURA_HOST} ${HASURA_PORT} ${QUARTZ_HOST} ${QUARTZ_PORT} ${UPTIMEKUMA_HOST} ${UPTIMEKUMA_PORT} ${WALLABAG_HOST} ${WALLABAG_PORT} ${PYTHON_HOST} ${PYTHON_PORT}' \ /etc/nginx/nginx.conf elif [ -f "/etc/letsencrypt/live/$DOMAIN/fullchain.pem" ] && [ -f "/etc/letsencrypt/live/$DOMAIN/privkey.pem" ]; then echo "Certificates found. Using production nginx config." # In production with certificates already existing, so use nginx.conf.template - envsubst '${DOMAIN} ${BACKEND_HOST} ${BACKEND_PORT} ${BACKEND_ENDPOINT} ${ICECAST_HOST} ${ICECAST_PORT} ${GITEA_HOST} ${GITEA_PORT} ${HASURA_HOST} ${HASURA_PORT} ${QUARTZ_HOST} ${QUARTZ_PORT} ${UPTIMEKUMA_HOST} ${UPTIMEKUMA_PORT} ${SEARXNG_HOST} ${SEARXNG_PORT} ${WALLABAG_HOST} ${WALLABAG_PORT} ${OPENWEBUI_HOST} ${OPENWEBUI_PORT}' \ + envsubst '${DOMAIN} ${BACKEND_HOST} ${BACKEND_PORT} ${BACKEND_ENDPOINT} ${ICECAST_HOST} ${ICECAST_PORT} ${GITEA_HOST} ${GITEA_PORT} ${HASURA_HOST} ${HASURA_PORT} ${QUARTZ_HOST} ${QUARTZ_PORT} ${UPTIMEKUMA_HOST} ${UPTIMEKUMA_PORT} ${WALLABAG_HOST} ${WALLABAG_PORT} ${PYTHON_HOST} ${PYTHON_PORT}' \ /etc/nginx/nginx.conf else diff --git a/nginx/nginx.conf.template b/nginx/nginx.conf.template index bf8f6f0..a4d171a 100644 --- a/nginx/nginx.conf.template +++ b/nginx/nginx.conf.template @@ -17,6 +17,7 @@ http { limit_req_zone $binary_remote_addr zone=api:10m rate=30r/s; limit_req_zone $binary_remote_addr zone=graphql:10m rate=10r/s; limit_req_zone $binary_remote_addr zone=upload:10m rate=5r/m; + limit_req_zone $binary_remote_addr zone=hotel_search:10m rate=3r/m; log_format compact '$remote_addr "$request" $status rt=$request_time'; @@ -78,7 +79,7 @@ http { set $upstream_gitea http://$GITEA_HOST:$GITEA_PORT; set $upstream_hasura http://$HASURA_HOST:$HASURA_PORT; set $upstream_quartz http://$QUARTZ_HOST:$QUARTZ_PORT; - set $upstream_searxng http://$SEARXNG_HOST:$SEARXNG_PORT; + set $upstream_python http://$PYTHON_HOST:$PYTHON_PORT; root /etc/nginx/html; index index.html; @@ -259,6 +260,35 @@ http { proxy_set_header X-Forwarded-Proto $scheme; } + location /py { + return 301 /py/; + } + + location = /py/hotels/search { + # Public, minutes-long upstream call with a single search slot: keep it to a few per minute per IP + limit_req zone=hotel_search burst=2 nodelay; + proxy_read_timeout 300s; + proxy_send_timeout 300s; + rewrite ^/py/(.*)$ /$1 break; + proxy_pass $upstream_python; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + } + + location /py/ { + limit_req zone=api burst=20 nodelay; + # Hotel search blocks for up to a few minutes while it calls Travelodge and TfL + proxy_read_timeout 300s; + proxy_send_timeout 300s; + rewrite ^/py/(.*)$ /$1 break; + proxy_pass $upstream_python; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + } location = /internal/auth/admin-validate { internal; @@ -273,83 +303,6 @@ http { return 302 /admin/login?redirect=$request_uri; } - location /searxng { - return 301 /searxng/; - } - - location /searxng/ { - auth_request /internal/auth/admin-validate; - error_page 401 403 = @auth_denied; - rewrite ^/searxng/(.*)$ /$1 break; - proxy_pass $upstream_searxng; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - } - - - - } - - server { - listen 80; - server_name chat.$DOMAIN; - - location /.well-known/acme-challenge/ { - root /var/www/certbot; - } - - location / { - return 301 https://chat.$DOMAIN$request_uri; - } - } - - server { - listen 443 ssl; - http2 on; - server_name chat.$DOMAIN; - - ssl_certificate /etc/letsencrypt/live/$DOMAIN/fullchain.pem; - ssl_certificate_key /etc/letsencrypt/live/$DOMAIN/privkey.pem; - - set $upstream_openwebui http://$OPENWEBUI_HOST:$OPENWEBUI_PORT; - - add_header X-Frame-Options "SAMEORIGIN" always; - add_header X-Content-Type-Options "nosniff" always; - add_header Referrer-Policy "strict-origin-when-cross-origin" always; - add_header Strict-Transport-Security "max-age=63072000; includeSubDomains" always; - - client_max_body_size 50M; - - location = /internal/auth/admin-validate { - internal; - rewrite ^ /auth/validate-admin break; - proxy_pass http://$BACKEND_HOST:$BACKEND_PORT; - proxy_pass_request_body off; - proxy_set_header Content-Length ""; - proxy_set_header Cookie $http_cookie; - } - - location @auth_denied { - return 302 https://www.$DOMAIN/admin/login?redirect=https://chat.$DOMAIN$request_uri; - } - - location / { - auth_request /internal/auth/admin-validate; - error_page 401 403 = @auth_denied; - proxy_pass $upstream_openwebui; - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection "upgrade"; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - proxy_buffering off; - proxy_read_timeout 300s; - proxy_send_timeout 300s; - } } } diff --git a/nginx/nginx_dev.conf.template b/nginx/nginx_dev.conf.template index aec5c62..3199f17 100644 --- a/nginx/nginx_dev.conf.template +++ b/nginx/nginx_dev.conf.template @@ -16,6 +16,7 @@ http { limit_req_zone $binary_remote_addr zone=login:10m rate=5r/m; limit_req_zone $binary_remote_addr zone=api:10m rate=30r/s; limit_req_zone $binary_remote_addr zone=upload:10m rate=5r/m; + limit_req_zone $binary_remote_addr zone=hotel_search:10m rate=3r/m; log_format compact '$remote_addr "$request" $status rt=$request_time'; @@ -51,7 +52,7 @@ http { set $upstream_gitea http://$GITEA_HOST:$GITEA_PORT; set $upstream_hasura http://$HASURA_HOST:$HASURA_PORT; set $upstream_quartz http://$QUARTZ_HOST:$QUARTZ_PORT; - set $upstream_searxng http://$SEARXNG_HOST:$SEARXNG_PORT; + set $upstream_python http://$PYTHON_HOST:$PYTHON_PORT; location /uploads/ { alias /uploads/; @@ -176,6 +177,35 @@ http { proxy_set_header X-Forwarded-Proto $scheme; } + location /py { + return 301 /py/; + } + + location = /py/hotels/search { + # Public, minutes-long upstream call with a single search slot: keep it to a few per minute per IP + limit_req zone=hotel_search burst=2 nodelay; + proxy_read_timeout 300s; + proxy_send_timeout 300s; + rewrite ^/py/(.*)$ /$1 break; + proxy_pass $upstream_python; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + } + + location /py/ { + limit_req zone=api burst=20 nodelay; + # Hotel search blocks for up to a few minutes while it calls Travelodge and TfL + proxy_read_timeout 300s; + proxy_send_timeout 300s; + rewrite ^/py/(.*)$ /$1 break; + proxy_pass $upstream_python; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + } location = /internal/auth/admin-validate { internal; @@ -190,21 +220,6 @@ http { return 302 /admin/login?redirect=$request_uri; } - location /searxng { - return 301 /searxng/; - } - - location /searxng/ { - auth_request /internal/auth/admin-validate; - error_page 401 403 = @auth_denied; - rewrite ^/searxng/(.*)$ /$1 break; - proxy_pass $upstream_searxng; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - } - } server { @@ -219,7 +234,7 @@ http { set $upstream_gitea http://$GITEA_HOST:$GITEA_PORT; set $upstream_hasura http://$HASURA_HOST:$HASURA_PORT; set $upstream_quartz http://$QUARTZ_HOST:$QUARTZ_PORT; - set $upstream_searxng http://$SEARXNG_HOST:$SEARXNG_PORT; + set $upstream_python http://$PYTHON_HOST:$PYTHON_PORT; location /uploads/ { alias /uploads/; @@ -344,6 +359,35 @@ http { proxy_set_header X-Forwarded-Proto $scheme; } + location /py { + return 301 /py/; + } + + location = /py/hotels/search { + # Public, minutes-long upstream call with a single search slot: keep it to a few per minute per IP + limit_req zone=hotel_search burst=2 nodelay; + proxy_read_timeout 300s; + proxy_send_timeout 300s; + rewrite ^/py/(.*)$ /$1 break; + proxy_pass $upstream_python; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + } + + location /py/ { + limit_req zone=api burst=20 nodelay; + # Hotel search blocks for up to a few minutes while it calls Travelodge and TfL + proxy_read_timeout 300s; + proxy_send_timeout 300s; + rewrite ^/py/(.*)$ /$1 break; + proxy_pass $upstream_python; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + } location = /internal/auth/admin-validate { internal; @@ -358,21 +402,6 @@ http { return 302 /admin/login?redirect=$request_uri; } - location /searxng { - return 301 /searxng/; - } - - location /searxng/ { - auth_request /internal/auth/admin-validate; - error_page 401 403 = @auth_denied; - rewrite ^/searxng/(.*)$ /$1 break; - proxy_pass $upstream_searxng; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - } - } } diff --git a/python/.dockerignore b/python/.dockerignore new file mode 100644 index 0000000..00f2d38 --- /dev/null +++ b/python/.dockerignore @@ -0,0 +1,3 @@ +__pycache__/ +*.pyc +.venv/ diff --git a/python/Dockerfile b/python/Dockerfile new file mode 100644 index 0000000..13cc317 --- /dev/null +++ b/python/Dockerfile @@ -0,0 +1,16 @@ +FROM python:3.12-slim + +ENV PYTHONDONTWRITEBYTECODE=1 \ + PYTHONUNBUFFERED=1 + +WORKDIR /app + +COPY requirements.txt . +RUN pip install --no-cache-dir -r requirements.txt + +COPY app ./app + +EXPOSE 8000 + +# PYTHON_PORT and ROOT_PATH are supplied by docker compose (defaults below). +CMD ["sh", "-c", "uvicorn app.main:app --host 0.0.0.0 --port ${PYTHON_PORT:-8000} --root-path ${ROOT_PATH:-/py}"] diff --git a/python/app/__init__.py b/python/app/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/python/app/main.py b/python/app/main.py new file mode 100644 index 0000000..2366a0f --- /dev/null +++ b/python/app/main.py @@ -0,0 +1,242 @@ +"""Small Python API service. + +Nginx proxies https://www./py/... to this container and strips the +/py prefix, so routes here are defined relative to "/". FastAPI's root_path +(set via --root-path on the uvicorn command line) keeps the generated docs +at /py/docs working behind the proxy. +""" + +import json +import re +import threading +import time +from datetime import date, datetime, timedelta, timezone +from typing import Optional + +from fastapi import FastAPI, HTTPException +from pydantic import BaseModel, Field, field_validator, model_validator + +from . import travelodge + +app = FastAPI( + title="Python API", + version="0.2.0", + docs_url="/docs", + openapi_url="/openapi.json", +) + + +class Health(BaseModel): + status: str + time: datetime + + +class Greeting(BaseModel): + message: str + + +@app.get("/", response_model=Greeting, summary="Service index") +def index() -> Greeting: + return Greeting(message="Python API is running. See /py/docs for the schema.") + + +@app.get("/health", response_model=Health, summary="Liveness check") +def health() -> Health: + return Health(status="ok", time=datetime.now(timezone.utc)) + + +@app.get("/hello/{name}", response_model=Greeting, summary="Greet a caller") +def hello(name: str) -> Greeting: + return Greeting(message=f"Hello, {name}!") + + +# --------------------------------------------------------------------------- # +# Cheap Travelodge finder +# --------------------------------------------------------------------------- # +MAX_ROOMS = 4 +MAX_ADULTS = 8 +MAX_CHILDREN = 8 +CACHE_TTL_S = 10 * 60 + +_search_slot = threading.Semaphore(1) +_cache_lock = threading.Lock() +_cache: dict = {} # key -> (expires_at, response dict) + + +class Origin(BaseModel): + key: str + name: str + lat: float + lon: float + + +class HotelSearchRequest(BaseModel): + location: str = Field("Central London", min_length=1, max_length=80, description="Travelodge search text") + checkin: date = Field(..., description="Check-in date (today or later)") + checkout: Optional[date] = Field(None, description="Check-out date; overrides nights") + nights: int = Field(1, ge=1, le=14, description="Used when checkout is not given") + guests: str = Field("1", max_length=40, description='Rooms/guests e.g. "1", "2+1", "2,2+2"') + railcard_holders: int = Field(1, ge=0, le=MAX_ADULTS, description="Adults with a Railcard (1/3 off off-peak rail)") + origin: str = Field("clapham junction", max_length=60, description="Known station key or 'lat,lon'") + depart: str = Field("19:30", description="Outbound departure time HH:MM") + top: int = Field(15, ge=1, le=25, description="Price transport for the N cheapest stays only") + max_miles: Optional[float] = Field(None, gt=0, le=50, description="Drop hotels further than this from the search") + max_travel_min: int = Field(75, ge=10, le=240, description="Ignore slower routes than this when picking cheapest") + + @field_validator("location") + @classmethod + def _strip_location(cls, v: str) -> str: + v = v.strip() + if not v: + raise ValueError("location cannot be empty") + return v + + @field_validator("depart") + @classmethod + def _check_depart(cls, v: str) -> str: + if not re.fullmatch(r"([01]\d|2[0-3]):[0-5]\d", v.strip()): + raise ValueError("depart must be HH:MM") + return v.strip() + + @field_validator("guests") + @classmethod + def _check_guests(cls, v: str) -> str: + try: + rooms = travelodge.parse_guests(v) + except ValueError as e: + raise ValueError(f"invalid guests spec: {e}") from None + if len(rooms) > MAX_ROOMS: + raise ValueError(f"at most {MAX_ROOMS} rooms") + if sum(a for a, _ in rooms) > MAX_ADULTS: + raise ValueError(f"at most {MAX_ADULTS} adults") + if sum(c for _, c in rooms) > MAX_CHILDREN: + raise ValueError(f"at most {MAX_CHILDREN} children") + return v.strip() + + @field_validator("origin") + @classmethod + def _check_origin(cls, v: str) -> str: + travelodge.parse_origin(v) # raises ValueError with a useful message + return v.strip() + + @model_validator(mode="after") + def _check_dates(self): + if self.checkin < date.today(): + raise ValueError("checkin must be today or later") + checkout = self.checkout or self.checkin + timedelta(days=self.nights) + if checkout <= self.checkin: + raise ValueError("checkout must be after checkin") + if (checkout - self.checkin).days > 14: + raise ValueError("stays are limited to 14 nights") + self.checkout = checkout + self.nights = (checkout - self.checkin).days + return self + + +class HotelRow(BaseModel): + code: Optional[str] = None + name: Optional[str] = None + lat: Optional[float] = None + lon: Optional[float] = None + room_price: Optional[float] = None + room_code: Optional[str] = None + available: bool = True + low_availability: bool = False + distance_from_search_mi: Optional[float] = None + rating: Optional[float] = None + url: str + transport_out: Optional[float] = None + transport_return: Optional[float] = None + transport_total: Optional[float] = None + travel_minutes: Optional[int] = None + route: str + fastest_minutes: Optional[int] = None + fastest_total: Optional[float] = None + fastest_route: Optional[str] = None + total: Optional[float] = None + + +class HotelSearchSummary(BaseModel): + location: str + checkin: date + checkout: date + nights: int + rooms: int + adults: int + children: int + railcard_holders: int + origin_name: str + origin_lat: float + origin_lon: float + depart: datetime + max_travel_min: int + hotels_found: int + hotels_available: int + hotels_priced: int + truncated: bool = False + + +class HotelSearchResponse(BaseModel): + summary: HotelSearchSummary + rows: list[HotelRow] + cached: bool = False + + +@app.get("/hotels/origins", response_model=list[Origin], summary="Known origin stations") +def hotel_origins() -> list[Origin]: + return [Origin(key=k, name=n, lat=lat, lon=lon) for k, (n, lat, lon) in travelodge.ORIGINS.items()] + + +@app.post( + "/hotels/search", + response_model=HotelSearchResponse, + summary="Rank Travelodges by room price plus TfL transport", + description=( + "Blocking search: pulls live Travelodge prices, then prices a round trip on TfL for the " + "cheapest `top` hotels. Takes roughly a minute. Only one search runs at a time; identical " + "searches are cached for ten minutes." + ), + responses={429: {"description": "Another search is already running"}, 502: {"description": "Upstream API failed"}}, +) +def hotel_search(req: HotelSearchRequest) -> HotelSearchResponse: + key = json.dumps(req.model_dump(mode="json"), sort_keys=True) + now = time.monotonic() + + with _cache_lock: + hit = _cache.get(key) + if hit and hit[0] > now: + return HotelSearchResponse(**hit[1], cached=True) + + if not _search_slot.acquire(blocking=False): + raise HTTPException(status_code=429, detail="A search is already running, try again in a minute.") + try: + origin_name, origin = travelodge.parse_origin(req.origin) + result = travelodge.run_search( + location=req.location, + checkin=req.checkin, + checkout=req.checkout, + rooms=travelodge.parse_guests(req.guests), + railcard_holders=req.railcard_holders, + origin_name=origin_name, + origin=origin, + depart=req.depart, + top=req.top, + max_miles=req.max_miles, + max_travel_min=req.max_travel_min, + ) + except travelodge.UpstreamError as e: + raise HTTPException(status_code=502, detail=str(e)) from e + except (KeyError, TypeError) as e: + raise HTTPException(status_code=502, detail=f"Unexpected upstream response: {e}") from e + except ValueError as e: + raise HTTPException(status_code=422, detail=str(e)) from e + finally: + _search_slot.release() + + with _cache_lock: + expired = [k for k, (exp, _) in _cache.items() if exp <= now] + for k in expired: + del _cache[k] + _cache[key] = (time.monotonic() + CACHE_TTL_S, result) + + return HotelSearchResponse(**result) diff --git a/python/app/travelodge.py b/python/app/travelodge.py new file mode 100644 index 0000000..283432d --- /dev/null +++ b/python/app/travelodge.py @@ -0,0 +1,396 @@ +"""Cheapest Travelodge (room + TfL transport) for a stay in London. + +Ported from ~/cheap_hotel/cheap_travelodge.py. The pricing logic is unchanged; +only the CLI/report/CSV plumbing has been removed. + +Data sources + * Travelodge's own search JSON API -> live room prices for every hotel + matching a location search. + * TfL Journey Planner API -> route + pay-as-you-go fare from the origin to + each hotel. + +Method + 1. Pull every hotel for the search, drop ones with no availability, sort by + cheapest room price and keep only the cheapest `top` hotels. + 2. For each, ask TfL for (a) the fastest route and (b) a bus-only route at + the given departure time. Pick the cheapest that isn't slower than + `max_travel_min`. + 3. Apply a Railcard discount (1/3 off) to OFF-PEAK rail/tube fares. Buses + are never discounted. + 4. Assume the return journey the next morning costs the off-peak equivalent + of the outbound. + 5. Rank by room + round-trip transport. +""" + +import os +import time +from datetime import date, datetime + +import requests + +TL_API = "https://www.travelodge.co.uk/api/v2/hotel" +TL_SITE = "https://www.travelodge.co.uk" +TFL_API = "https://api.tfl.gov.uk/Journey/JourneyResults/{frm}/to/{to}" +HEADERS = { + "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0 Safari/537.36", + "Accept": "application/json", +} + +# Well-known origins: key -> (display name, lat, lon) +ORIGINS = { + "clapham junction": ("Clapham Junction", 51.4645, -0.1705), + "waterloo": ("London Waterloo", 51.5031, -0.1132), + "victoria": ("London Victoria", 51.4952, -0.1441), + "kings cross": ("King's Cross St Pancras", 51.5308, -0.1238), + "liverpool street": ("Liverpool Street", 51.5178, -0.0817), + "paddington": ("London Paddington", 51.5154, -0.1755), + "london bridge": ("London Bridge", 51.5050, -0.0864), + "euston": ("London Euston", 51.5282, -0.1337), +} + +# Rough Greater London bounding box for custom "lat,lon" origins. +LONDON_BOX = (51.25, 51.75, -0.55, 0.35) # min lat, max lat, min lon, max lon + +# Wall-clock budget for one run_search call. Nginx cuts the connection at +# 300s, so stop pricing transport well before that and return what we have. +SEARCH_DEADLINE_S = 240 + + +class UpstreamError(Exception): + """Travelodge or TfL could not be reached or returned garbage.""" + + +# --------------------------------------------------------------------------- # +# Input parsing +# --------------------------------------------------------------------------- # +def parse_guests(spec): + """'2,2+1' -> [(2, 0), (2, 1)] (list of (adults, children) per room).""" + rooms = [] + for part in spec.split(","): + part = part.strip() + if not part: + continue + a, _, c = part.partition("+") + rooms.append((int(a), int(c or 0))) + if not rooms: + raise ValueError("guests spec is empty") + for adults, children in rooms: + if adults < 1: + raise ValueError("each room needs at least one adult") + if children < 0: + raise ValueError("children cannot be negative") + return rooms + + +def parse_origin(spec): + """Return (name, (lat, lon)) for an ORIGINS key or a 'lat,lon' string.""" + key = spec.strip().lower() + if key in ORIGINS: + name, lat, lon = ORIGINS[key] + return name, (lat, lon) + if "," in spec: + try: + lat, lon = (float(x) for x in spec.split(",", 1)) + except ValueError: + raise ValueError("origin must be a known station or 'lat,lon'") from None + lo_lat, hi_lat, lo_lon, hi_lon = LONDON_BOX + if not (lo_lat <= lat <= hi_lat and lo_lon <= lon <= hi_lon): + raise ValueError("origin coordinates must be inside Greater London") + return f"{lat:.4f},{lon:.4f}", (lat, lon) + raise ValueError("unknown origin '%s' (known: %s, or 'lat,lon')" % (spec, ", ".join(ORIGINS))) + + +# --------------------------------------------------------------------------- # +# Travelodge +# --------------------------------------------------------------------------- # +def fetch_hotels(location, checkin, checkout, rooms, page_size=10): + """Return list of hotel dicts from the Travelodge search API (all pages). + + rooms: list of (adults, children) tuples, one per room. + """ + hotels, start, seen = [], 0, set() + while True: + params = { + "pagination": "false", + "checkIn": checkin.isoformat(), + "checkOut": checkout.isoformat(), + "q": location, + "action": "hotel_amend", + "start": start, + } + for i, (adults, children) in enumerate(rooms): + params[f"rooms[{i}][adults]"] = adults + params[f"rooms[{i}][children]"] = children + try: + r = requests.get(TL_API, params=params, headers=HEADERS, timeout=30) + r.raise_for_status() + results = r.json().get("results") or [] + except (requests.RequestException, ValueError, AttributeError) as e: + raise UpstreamError(f"Travelodge search failed: {e}") from e + if not results: + break + new = [h for h in results if h.get("code") and h.get("code") not in seen] + if not new: + break + for h in new: + seen.add(h["code"]) + hotels.extend(new) + start += page_size + if start > 500: # safety + break + return hotels + + +def normalise_hotel(h): + return { + "code": h.get("code"), + "name": h.get("title"), + "lat": h.get("lat"), + "lon": h.get("lon"), + "room_price": h.get("minPrice"), + "room_code": h.get("minRoomCode"), + "available": bool(h.get("hasAvailability")), + "low_availability": bool(h.get("hasLowAvailability")), + "distance_from_search_mi": h.get("distance"), + "rating": (h.get("rating") or {}).get("averageRating"), + "url": TL_SITE + (h.get("hotelUrl") or ""), + } + + +# --------------------------------------------------------------------------- # +# TfL +# --------------------------------------------------------------------------- # +def round_5p(pence): + return int(5 * round(pence / 5.0)) + + +def price_journey(journey, adults=1, railcard_holders=1): + """ + Return (outbound_pence, return_pence, detail) for one TfL journey for the + whole party, or None if the fare can't be determined. + + adults: number of fare-paying adults. railcard_holders: how many of them + get 1/3 off off-peak rail fares (0 = nobody has a railcard). + """ + railcard_holders = max(0, min(adults, railcard_holders)) + full_fare = adults - railcard_holders + legs = journey.get("legs") or [] + modes = [(l.get("mode") or {}).get("id") for l in legs] + modes = [m for m in modes if m] # skip legs without a mode id + non_walk = [m for m in modes if m != "walking"] + fare = journey.get("fare") + + if not non_walk: # walking only + return 0, 0, "walk" + + if not fare or not fare.get("fares"): + return None + + out = ret = 0 + for f in fare["fares"]: + cost = f.get("cost") or 0 + peak, offpeak = f.get("peak") or 0, f.get("offPeak") or 0 + is_bus = (peak == 0 and offpeak == 0) or any( + (t.get("tapDetails") or {}).get("modeType") == "Bus" for t in (f.get("taps") or []) + ) + if is_bus: + # Bus: flat fare, hopper legs already come through as cost 0. No railcard. + out += cost * adults + ret += cost * adults + else: + level = (f.get("chargeLevel") or "").lower() + out_full = cost + ret_full = offpeak or cost # next-day return assumed off-peak + out_disc = round_5p(out_full * 2 / 3) if ("off" in level or cost == offpeak) else out_full + ret_disc = round_5p(ret_full * 2 / 3) + out += out_full * full_fare + out_disc * railcard_holders + ret += ret_full * full_fare + ret_disc * railcard_holders + + # short human summary of the route + parts = [] + for l in legs: + m = (l.get("mode") or {}).get("id") + if not m or m == "walking": + continue + ri = l.get("routeOptions") or [{}] + name = ri[0].get("name") or "" + parts.append(f"{m.replace('national-rail','rail')}{(' ' + name) if name else ''}") + return out, ret, " > ".join(parts) if parts else "walk" + + +def sleep_within(seconds, deadline): + """Sleep for `seconds` unless that would overrun `deadline` (a time.monotonic() + value, or None for no limit). Returns False if the sleep was skipped.""" + if deadline is not None and time.monotonic() + seconds > deadline: + return False + time.sleep(seconds) + return True + + +def tfl_journeys(frm, to, when, extra=None, app_key=None, retries=3, deadline=None): + params = { + "date": when.strftime("%Y%m%d"), + "time": when.strftime("%H%M"), + "timeIs": "Departing", + "journeyPreference": "LeastTime", + } + if extra: + params.update(extra) + if app_key: + params["app_key"] = app_key + url = TFL_API.format(frm=f"{frm[0]},{frm[1]}", to=f"{to[0]},{to[1]}") + for attempt in range(retries): + remaining = 40 if deadline is None else deadline - time.monotonic() + if remaining < 1: + return [] + try: + r = requests.get(url, params=params, headers=HEADERS, timeout=min(40, remaining)) + except requests.RequestException: + if not sleep_within(2, deadline): + return [] + continue + if r.status_code == 429: + if not sleep_within(10 * (attempt + 1), deadline): + return [] + continue + if r.status_code >= 500: + if not sleep_within(2, deadline): + return [] + continue + if r.status_code != 200: + return [] + try: + return r.json().get("journeys") or [] + except ValueError: + return [] + return [] + + +def best_transport(origin, hotel, when, adults, railcard_holders, max_minutes, app_key=None, pause=1.2, deadline=None): + """Cheapest acceptable round-trip transport to a hotel. Returns dict or None.""" + dest = (hotel["lat"], hotel["lon"]) + options = [] + queries = (("fast", None), ("bus", {"mode": "bus,walking"})) + for i, (label, extra) in enumerate(queries): + for j in tfl_journeys(origin, dest, when, extra, app_key, deadline=deadline): + if not isinstance(j.get("duration"), int): + continue + priced = price_journey(j, adults, railcard_holders) + if priced is None: + continue + out, ret, desc = priced + options.append({ + "kind": label, + "outbound_p": out, + "return_p": ret, + "total_p": out + ret, + "minutes": j["duration"], + "route": desc, + }) + if i < len(queries) - 1: # pause between TfL calls, not after the last + sleep_within(pause, deadline) + if not options: + return None + fastest = min(options, key=lambda o: o["minutes"]) + ok = [o for o in options if o["minutes"] <= max_minutes] or [fastest] + cheapest = min(ok, key=lambda o: (o["total_p"], o["minutes"])) + cheapest["fastest_minutes"] = fastest["minutes"] + cheapest["fastest_total_p"] = fastest["total_p"] + cheapest["fastest_route"] = fastest["route"] + return cheapest + + +# --------------------------------------------------------------------------- # +# Search +# --------------------------------------------------------------------------- # +def run_search( + *, + location: str, + checkin: date, + checkout: date, + rooms: list, + railcard_holders: int, + origin_name: str, + origin: tuple, + depart: str, + top: int, + max_miles, + max_travel_min: int, +): + """Everything main() in the original script did between parsing and reporting.""" + nights = (checkout - checkin).days + adults = sum(a for a, _ in rooms) + children = sum(c for _, c in rooms) + railcard_holders = max(0, min(adults, railcard_holders)) + hh, mm = map(int, depart.split(":")) + depart_dt = datetime(checkin.year, checkin.month, checkin.day, hh, mm) + app_key = os.environ.get("TFL_APP_KEY") or None + deadline = time.monotonic() + SEARCH_DEADLINE_S + + raw = fetch_hotels(location, checkin, checkout, rooms) + hotels = [normalise_hotel(h) for h in raw] + avail = [h for h in hotels if h["available"] and h["room_price"]] + if max_miles is not None: + avail = [h for h in avail if (h["distance_from_search_mi"] or 0) <= max_miles] + + avail.sort(key=lambda h: h["room_price"]) + shortlist = avail[:top] + + rows = [] + truncated = False + for h in shortlist: + skipped = time.monotonic() >= deadline + if skipped: + truncated = True + t = None + else: + t = best_transport(origin, h, depart_dt, adults, railcard_holders, max_travel_min, app_key, deadline=deadline) + row = dict(h) + if t: + row.update({ + "transport_out": t["outbound_p"] / 100, + "transport_return": t["return_p"] / 100, + "transport_total": t["total_p"] / 100, + "travel_minutes": t["minutes"], + "route": t["route"], + "fastest_minutes": t["fastest_minutes"], + "fastest_total": t["fastest_total_p"] / 100, + "fastest_route": t["fastest_route"], + "total": round(h["room_price"] + t["total_p"] / 100, 2), + }) + else: + row.update({ + "transport_out": None, + "transport_return": None, + "transport_total": None, + "travel_minutes": None, + "route": "not priced (time limit)" if skipped else "no TfL fare found", + "fastest_minutes": None, + "fastest_total": None, + "fastest_route": None, + "total": None, + }) + rows.append(row) + + rows.sort(key=lambda r: (r["total"] is None, r["total"] or 0, r["room_price"])) + + summary = { + "location": location, + "checkin": checkin, + "checkout": checkout, + "nights": nights, + "rooms": len(rooms), + "adults": adults, + "children": children, + "railcard_holders": railcard_holders, + "origin_name": origin_name, + "origin_lat": origin[0], + "origin_lon": origin[1], + "depart": depart_dt, + "max_travel_min": max_travel_min, + "hotels_found": len(hotels), + "hotels_available": len(avail), + "hotels_priced": len(rows), + "truncated": truncated, + } + return {"summary": summary, "rows": rows} diff --git a/python/requirements.txt b/python/requirements.txt new file mode 100644 index 0000000..cf48bac --- /dev/null +++ b/python/requirements.txt @@ -0,0 +1,3 @@ +fastapi==0.115.6 +uvicorn[standard]==0.34.0 +requests==2.32.3 diff --git a/searxng/Dockerfile b/searxng/Dockerfile deleted file mode 100644 index 3629ddb..0000000 --- a/searxng/Dockerfile +++ /dev/null @@ -1,8 +0,0 @@ -FROM searxng/searxng:latest - - -COPY settings.yml.template /searxng/settings.yml.template -COPY entrypoint.sh /searxng/entrypoint.sh -RUN chmod +x /searxng/entrypoint.sh - -ENTRYPOINT ["/searxng/entrypoint.sh"] diff --git a/searxng/entrypoint.sh b/searxng/entrypoint.sh deleted file mode 100644 index 113f019..0000000 --- a/searxng/entrypoint.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -set -e - -sed -e "s|\${BASE_URL}|${BASE_URL}|g" \ - -e "s|\${SEARXNG_SECRET_KEY}|${SEARXNG_SECRET_KEY}|g" \ - /searxng/settings.yml.template > /etc/searxng/settings.yml - -exec /usr/local/searxng/entrypoint.sh "$@" diff --git a/searxng/settings.yml.template b/searxng/settings.yml.template deleted file mode 100644 index 891b6af..0000000 --- a/searxng/settings.yml.template +++ /dev/null @@ -1,5 +0,0 @@ -use_default_settings: true - -server: - base_url: ${BASE_URL} - secret_key: "${SEARXNG_SECRET_KEY}" diff --git a/vue/README.md b/vue/README.md index 242bf26..fb69b8d 100644 --- a/vue/README.md +++ b/vue/README.md @@ -19,6 +19,43 @@ The Vite dev server proxies API requests: - `/gitea` -> `http://localhost:3000` (Gitea) - `/radio` -> `http://localhost:8000` (Icecast2) +## Styling + +Everything visual is defined in three places: + +| File | What it holds | +| --- | --- | +| `src/assets/styles.css` | Fonts, **design tokens**, default element styles (dark theme), reusable classes (`bdr-1`, `bdr-2`, `page-a4`, `halftone`), the `slide` and `fade` transitions, print rules | +| `src/layouts/CVLayout.vue` | The **light theme** for `/cv` and `/cv/jobs`: re-points the colour tokens to ink-on-paper values and holds the shared `.cv-btn` styles | +| `src/views/CV/cv-shared.css` | Typography and page layout for the CV templates (`.cv-template`, `.cv-page`, `--cv-*` size variables) | + +### Tokens + +Tokens are declared once in a Tailwind `@theme` block, so each is available both as a utility class in templates and as a CSS variable in ` diff --git a/vue/src/components/input/Button.vue b/vue/src/components/input/Button.vue index a7caa23..91d446f 100644 --- a/vue/src/components/input/Button.vue +++ b/vue/src/components/input/Button.vue @@ -2,10 +2,8 @@ - - diff --git a/vue/src/components/input/CreateToggle.vue b/vue/src/components/input/CreateToggle.vue new file mode 100644 index 0000000..e9f4efb --- /dev/null +++ b/vue/src/components/input/CreateToggle.vue @@ -0,0 +1,14 @@ + + + diff --git a/vue/src/components/input/ToggleButton.vue b/vue/src/components/input/ToggleButton.vue index 9d1a6f1..7b6c8fc 100644 --- a/vue/src/components/input/ToggleButton.vue +++ b/vue/src/components/input/ToggleButton.vue @@ -18,7 +18,7 @@ function toggle() {