Server backend for gorb, the chat app https://gorb.app/
Find a file
Radical c2bface373
All checks were successful
ci/woodpecker/push/build-and-publish Pipeline was successful
Merge pull request 'wip/authorization-header' (#7) from wip/authorization-header into main
Reviewed-on: #7
Reviewed-by: SauceyRed <saucey@saucey.red>

Uses authorization headers instead of keeping access_token and refresh_token in body.

auth header is used for `access_token`

## Changes
Moved everything to /api

### POST -> GET /v1/users/me
Request: auth header

### POST -> GET /v1/users/{uuid}
Request: auth header

### POST -> GET /v1/users
Request: auth header and query params `start=int` and `amount=int`

### POST /v1/auth/register
Response: Remove `refresh_token` from body and instead set-cookie `refresh_token`

### POST /v1/auth/login
Response: Remove `refresh_token` from body and instead set-cookie `refresh_token`

### POST /v1/auth/refresh
Request: cookie `refresh_token`
Response: Remove `refresh_token` from body and instead set-cookie `refresh_token`

### POST /v1/auth/revoke
Request: auth header (password still in body)
2025-05-04 21:18:27 +00:00
.woodpecker use docker as build system 2025-05-02 14:23:50 +02:00
src feat: expire refresh_token immediately on unauthorized response 2025-05-04 23:02:17 +02:00
.gitignore chore: add config.toml to gitignore 2025-04-30 11:10:02 +00:00
Cargo.toml feat: add users endpoint and add me and uuid under it 2025-05-02 19:19:59 +02:00
compose.dev.yml build: add a run-dev.sh for local testing 2025-05-02 16:23:45 +02:00
compose.yml feat: use a logging library 2025-05-02 01:18:13 +02:00
Dockerfile use docker as build system 2025-05-02 14:23:50 +02:00
entrypoint.sh build: use one log file instead of 2 2025-05-02 16:23:11 +02:00
LICENSE Update LICENSE 2025-04-28 18:27:46 +00:00
README.md feat: use a logging library 2025-05-02 01:18:13 +02:00
run-dev.sh build: add a run-dev.sh for local testing 2025-05-02 16:23:45 +02:00

backend

You can run and test the latest backend by using the docker image based on main

docker compose file

version: '3.5'
volumes:
  gorb-backend:
  gorb-database:
networks:
  gorb:
services:
  backend:
    image: git.gorb.app/gorb/backend:main
    restart: always
    ports:
      - 8080:8080
    networks:
      - gorb
    volumes:
      - gorb-backend:/gorb
    environment:
      #- RUST_LOG=debug
      - DATABASE_USERNAME=gorb
      - DATABASE_PASSWORD=gorb
      - DATABASE=gorb
      - DATABASE_HOST=database
      - DATABASE_PORT=5432
  database:
    image: postgres:16
    restart: always
    networks:
      - gorb
    volumes:
      - gorb-database:/var/lib/postgresql/data
    environment:
      - POSTGRES_USER=gorb
      - POSTGRES_PASSWORD=gorb
      - POSTGRES_DB=gorb