chore: update readme instructions and example config

This commit is contained in:
Ayo Ayco 2025-01-19 09:47:59 +01:00
parent bd21e2dacf
commit 966b97f2f0
2 changed files with 39 additions and 32 deletions

View file

@ -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

View file

@ -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"
}
}