From 966b97f2f030bdce2e04ea812f938fde8c9f7081 Mon Sep 17 00:00:00 2001 From: Ayo Ayco Date: Sun, 19 Jan 2025 09:47:59 +0100 Subject: [PATCH] chore: update readme instructions and example config --- README.md | 59 ++++++++++++++++++++++++--------------------- example_config.json | 12 +++++---- 2 files changed, 39 insertions(+), 32 deletions(-) diff --git a/README.md b/README.md index 936d70a..b7d542d 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,7 @@ This is the default server running at [https://ayo.ayco.io](https://ayco.io). Its main responsibility is serving static files generated with Astro SSG which I maintain in a [separate project](https://ayco.io/sh/ayco.io-astro). The generated files from that project will populate a `dist` directory in here, which will then be served as-is. Additional features are: + 1. attach [/threads](https://ayco.io/sh/threads) flask blueprint behind `/threads` route 1. perf monitoring and error tracking with [sentry.io](https://sentry.io) @@ -15,48 +16,52 @@ Additional features are: 1. Set up your **Debian** (for other environments, search for counterpart instructions) - ```bash - # update repositories - $ sudo apt update + ```bash + # update repositories + $ sudo apt update - # install python stuff - $ sudo apt install python3-pip python3-dev build-essential libssl-dev libffi-dev python3-setuptools python3-venv - ``` + # install python stuff + $ sudo apt install python3-pip python3-dev build-essential libssl-dev libffi-dev python3-setuptools python3-venv + ``` 2. Install dependencies - ```bash - # clone the project - $ git clone git@git.sr.ht:~ayoayco/ayco.io-flask + ```bash + # clone the project + $ git clone git@git.sr.ht:~ayoayco/ayco.io-flask - # go into the project directory - $ cd ayco.io-flask + # go into the project directory + $ cd ayco.io-flask - # create python environment: - $ python3 -m venv .venv + # create python environment: + $ python3 -m venv .venv - # activate python env: - $ . .venv/bin/activate + # activate python env: + $ . .venv/bin/activate - # install wheel: - (.venv)$ python -m pip install -r requirements.txt + # install dependencies: + (.venv)$ python -m pip install -r requirements.txt - # rejoice! - ``` + # create configuration from example config file + (.venv)$ cp ./example_config.json ./config.json + + # rejoice! + ``` 3. To start development, run the following: - ```bash - (.venv)$ flask --app web.py --debug run - ``` - > Note: On a Mac, the default port 5000 is used by AirDrop & Handoff; you may have to turn those off + ```bash + (.venv)$ flask --app web.py --debug run + ``` + + > Note: On a Mac, the default port 5000 is used by AirDrop & Handoff; you may have to turn those off 4. Populate a `dist` directory with static files (e.g., `*.html` for pages). Currently I generate static files in a separate [Astro site project](https://ayco.io/sh/ayco.io-astro) -- see instructions on how to set it up separately, run the build script and copy the `dist` here. -4. After development session, deactivate the python env - ```bash - (.venv)$ deactivate - ``` +5. After development session, deactivate the python env + ```bash + (.venv)$ deactivate + ``` ## Deployment diff --git a/example_config.json b/example_config.json index d2739ea..fcd5ef2 100644 --- a/example_config.json +++ b/example_config.json @@ -8,17 +8,19 @@ "APPS": { "threads": { "site_name": "Thoughts", - "title":"Thoughts", + "title": "Thoughts", "description": "Hand-picked public posts from my social feed", - "server" : "https://social.ayco.io" + "server": "https://social.ayco.io", + "user": "user@mastodon.social", + "password": "ultraelectromagneticpassword", + "secret_file": "threads-masto-client.secret" } }, "CACHE_TYPE": "SimpleCache", "CACHE_DEFAULT_TIMEOUT": 30, "CACHE_KEY_PREFIX": "ayco_io", "ATTRIBUTION": { - "owner": "Ayo Ayco", - "year": "2022" + "owner": "Ayo Ayco", + "year": "2022" } } -