From 5b662e7033c7570de5a3f1df7432551cbc5c642c Mon Sep 17 00:00:00 2001 From: louis Date: Sun, 22 Oct 2023 11:32:57 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20Update=20documentation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .markdownlint.yml | 5 +++++ docs/api.md | 5 +++-- docs/configuration.md | 29 +++++++++++++++++------------ docs/index.md | 22 ++++++++++------------ mkdocs.yml | 9 +++++++-- 5 files changed, 42 insertions(+), 28 deletions(-) create mode 100644 .markdownlint.yml diff --git a/.markdownlint.yml b/.markdownlint.yml new file mode 100644 index 00000000..d81bcd55 --- /dev/null +++ b/.markdownlint.yml @@ -0,0 +1,5 @@ +--- +default: true +line-length: + line_length: 160 +code-block-style: false diff --git a/docs/api.md b/docs/api.md index 3897ac69..2e75c9b6 100644 --- a/docs/api.md +++ b/docs/api.md @@ -1,6 +1,7 @@ # API Specification -!!! important - The Specification is work in progress at the moment. Inaccuracies or errors are possible. +!!! Information + + The API Specification only contains the public endpoints at the moment. !!swagger swagger.yaml!! diff --git a/docs/configuration.md b/docs/configuration.md index 8f288732..33c0f157 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -9,8 +9,10 @@ log_level: "error" log_format: "json" # initiator is the email for the first admin user (see password in logs) initiator: "admin@systemli.org" -# database is the path to the bolt file -database: "ticker.db" +# configuration for the database +database: + type: "sqlite" # postgres, mysql, sqlite + dsn: "ticker.db" # postgres: "host=localhost port=5432 user=ticker dbname=ticker password=ticker sslmode=disable" # secret used for JSON Web Tokens secret: "slorp-panfil-becall-dorp-hashab-incus-biter-lyra-pelage-sarraf-drunk" # telegram configuration @@ -18,7 +20,7 @@ telegram_bot_token: "" # listen port for prometheus metrics exporter metrics_listen: ":8181" # path where to store the uploaded files -upload_path: "/path/to/uploads" +upload_path: "uploads" # base url for uploaded assets upload_url: "http://localhost:8080" ``` @@ -30,12 +32,15 @@ upload_url: "http://localhost:8080" The following env vars can be used: -* TICKER_DATABASE -* TICKER_LISTEN -* TICKER_LOG_LEVEL -* TICKER_INITIATOR -* TICKER_SECRET -* TICKER_TELEGRAM_BOT_TOKEN -* TICKER_METRICS_LISTEN -* TICKER_UPLOAD_PATH -* TICKER_UPLOAD_URL +* `TICKER_LISTEN` +* `TICKER_LOG_FORMAT` +* `TICKER_LOG_LEVEL` +* `TICKER_DATABASE_TYPE` +* `TICKER_DATABASE_DSN` +* `TICKER_LOG_LEVEL` +* `TICKER_INITIATOR` +* `TICKER_SECRET` +* `TICKER_TELEGRAM_BOT_TOKEN` +* `TICKER_METRICS_LISTEN` +* `TICKER_UPLOAD_PATH` +* `TICKER_UPLOAD_URL` diff --git a/docs/index.md b/docs/index.md index bb52a2c6..c0b49c3a 100644 --- a/docs/index.md +++ b/docs/index.md @@ -2,8 +2,7 @@ **Service to distribute short messages in support of events, demonstrations, or other time-sensitive events.** -This repository contains the API and storage for -the [Systemli Ticker Project](https://www.systemli.org/en/service/ticker.html). +This repository contains the API for the [Systemli Ticker Project](https://www.systemli.org/en/service/ticker.html). !!! note "Requirements" @@ -12,20 +11,19 @@ the [Systemli Ticker Project](https://www.systemli.org/en/service/ticker.html). ## First run -- make sure you have pulled the repository +1. Clone the project - ```shell - git clone git@github.com:systemli/ticker.git - ``` + git clone -- start the ticker +2. Start the project - ```shell - cp config.yml.dist config.yml - go run . run - ``` + cd ticker + cp config.yml.dist config.yml + go run . run -Now you have a running ticker API! +3. Check the API + + curl http://localhost:8080/v1/health ## Testing diff --git a/mkdocs.yml b/mkdocs.yml index 052cab72..349af7be 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -2,6 +2,12 @@ site_name: Systemli Ticker site_author: Systemli Admin Team repo_url: https://github.com/systemli/ticker +nav: + - Home: index.md + - Configuration: configuration.md + - API: api.md + - Quick Install Guide: quick-install.md + theme: name: material @@ -24,5 +30,4 @@ extra: markdown_extensions: - admonition - - pymdownx.details - - pymdownx.superfences + - pymdownx.betterem