chore: update readme instructions and example config
This commit is contained in:
parent
bd21e2dacf
commit
966b97f2f0
2 changed files with 39 additions and 32 deletions
59
README.md
59
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.
|
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:
|
Additional features are:
|
||||||
|
|
||||||
1. attach [/threads](https://ayco.io/sh/threads) flask blueprint behind `/threads` route
|
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)
|
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)
|
1. Set up your **Debian** (for other environments, search for counterpart instructions)
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# update repositories
|
# update repositories
|
||||||
$ sudo apt update
|
$ sudo apt update
|
||||||
|
|
||||||
# install python stuff
|
# install python stuff
|
||||||
$ sudo apt install python3-pip python3-dev build-essential libssl-dev libffi-dev python3-setuptools python3-venv
|
$ sudo apt install python3-pip python3-dev build-essential libssl-dev libffi-dev python3-setuptools python3-venv
|
||||||
```
|
```
|
||||||
|
|
||||||
2. Install dependencies
|
2. Install dependencies
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# clone the project
|
# clone the project
|
||||||
$ git clone git@git.sr.ht:~ayoayco/ayco.io-flask
|
$ git clone git@git.sr.ht:~ayoayco/ayco.io-flask
|
||||||
|
|
||||||
# go into the project directory
|
# go into the project directory
|
||||||
$ cd ayco.io-flask
|
$ cd ayco.io-flask
|
||||||
|
|
||||||
# create python environment:
|
# create python environment:
|
||||||
$ python3 -m venv .venv
|
$ python3 -m venv .venv
|
||||||
|
|
||||||
# activate python env:
|
# activate python env:
|
||||||
$ . .venv/bin/activate
|
$ . .venv/bin/activate
|
||||||
|
|
||||||
# install wheel:
|
# install dependencies:
|
||||||
(.venv)$ python -m pip install -r requirements.txt
|
(.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:
|
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. 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
|
5. After development session, deactivate the python env
|
||||||
```bash
|
```bash
|
||||||
(.venv)$ deactivate
|
(.venv)$ deactivate
|
||||||
```
|
```
|
||||||
|
|
||||||
## Deployment
|
## Deployment
|
||||||
|
|
||||||
|
|
|
@ -8,17 +8,19 @@
|
||||||
"APPS": {
|
"APPS": {
|
||||||
"threads": {
|
"threads": {
|
||||||
"site_name": "Thoughts",
|
"site_name": "Thoughts",
|
||||||
"title":"Thoughts",
|
"title": "Thoughts",
|
||||||
"description": "Hand-picked public posts from my social feed",
|
"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_TYPE": "SimpleCache",
|
||||||
"CACHE_DEFAULT_TIMEOUT": 30,
|
"CACHE_DEFAULT_TIMEOUT": 30,
|
||||||
"CACHE_KEY_PREFIX": "ayco_io",
|
"CACHE_KEY_PREFIX": "ayco_io",
|
||||||
"ATTRIBUTION": {
|
"ATTRIBUTION": {
|
||||||
"owner": "Ayo Ayco",
|
"owner": "Ayo Ayco",
|
||||||
"year": "2022"
|
"year": "2022"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue