All checks were successful
OpenClimb Docker Deploy / build-and-push (push) Successful in 2m29s
37 lines
1.2 KiB
Markdown
37 lines
1.2 KiB
Markdown
# Sync Server
|
|
|
|
A simple Go server for self-hosting your OpenClimb sync data.
|
|
|
|
## How It Works
|
|
|
|
This server is dead simple. It uses a single `openclimb.json` file for your data and a directory for images. The last client to upload wins, overwriting the old data. Authentication is just a static bearer token.
|
|
|
|
## Getting Started
|
|
|
|
1. Create a `.env` file in this directory:
|
|
```
|
|
IMAGE=git.atri.dad/atridad/openclimb-sync:latest
|
|
APP_PORT=8080
|
|
AUTH_TOKEN=your-super-secret-token
|
|
DATA_FILE=/data/openclimb.json
|
|
IMAGES_DIR=/data/images
|
|
ROOT_DIR=./openclimb-data
|
|
```
|
|
Set `AUTH_TOKEN` to a long, random string. `ROOT_DIR` is where the server will store its data on your machine.
|
|
|
|
2. Run with Docker:
|
|
```bash
|
|
docker-compose up -d
|
|
```
|
|
The server will be running on `http://localhost:8080`.
|
|
|
|
## API
|
|
|
|
The API is minimal, just enough for the app to work. All endpoints require an `Authorization: Bearer <your-auth-token>` header.
|
|
|
|
- `GET /sync`: Download `openclimb.json`.
|
|
- `POST /sync`: Upload `openclimb.json`.
|
|
- `GET /images/{imageName}`: Download an image.
|
|
- `POST /images/{imageName}`: Upload an image.
|
|
|
|
Check out `main.go` for the full details. |