docs: add openapi.yml and readme.md

This commit is contained in:
b1ek 2024-05-11 22:28:37 +10:00
parent 6d68a704a3
commit d3452a4ac7
Signed by: blek
GPG Key ID: 14546221E3595D0C
2 changed files with 117 additions and 0 deletions

View File

@ -1 +1,17 @@
# backupd
a dead simple backup server
## usage
### as a hoster
to get started, `git clone` this repo to a permanent location, and create `docker-compose.yml` and `config.json` from their `.example` files. modify those to your likind and `docker-compose up -d` it.
to create a new client, add an entry to `config.json` like in example. don't forget to put their password's `SHA256` sum in the `keySha256Sum` field.
### as a client
first step is get your key from the hoster, or make a client yourself if you are the hoster.
then, see [the API reference](./openapi.yml)

101
openapi.yml Normal file
View File

@ -0,0 +1,101 @@
openapi: 3.0.0
info:
title: Backup server API
description: |
The backup server API reference
version: 0.0.1 GPL-3.0-only
tags:
- name: General
paths:
/upload:
post:
description: Upload a file
summary: Upload a file
tags: [General]
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
status:
type: string
example: ok
name:
type: string
example: sample-filename
requestBody:
content:
application/json:
schema:
type: object
properties:
data:
type: string
example: base64 encoded file
name:
type: string
example: sample-filename
/get/{name}:
get:
description: Get a file
summary: Get a file
tags: [General]
parameters:
- in: path
name: name
schema: { type: string }
required: true
responses:
200:
description: |
OK
The returned body is the file
content:
application/octet-stream:
example: ''
/list:
get:
description: List all files owned by you
summary: List all files
tags: [General]
responses:
200:
description: OK
content:
application/json:
schema:
type: array
items:
type: string
/{name}:
delete:
description: Delete a file
summary: Deleete a file
tags: [General]
parameters:
- in: path
name: name
schema: { type: string }
required: true
responses:
200:
description: OK
content:
application/json:
schema:
type: object
properties:
status:
type: string
example: ok
components:
securitySchemes:
key:
type: http
scheme: bearer
security:
- key: []