@@ -6,6 +6,8 @@ This is aimed at Hash Kennels to announce runs which then can be consumed
66by [ Harrier Central] ( https://www.harriercentral.com )
77
88## Requirements
9+ You need to have a running Wordpress site with 'WP Event Manager' Plugin installed.
10+
911### Software
1012* python >= 3.6
1113* starlette
@@ -20,22 +22,22 @@ by [Harrier Central](https://www.harriercentral.com)
2022### WP Event Manager Plugin
2123* WP Event Manager >= 3.1.21
2224
23- # Installing
25+ ## Installing
2426* here we assume we install in ``` /opt ```
2527
26- ## RedHat based OS
28+ ### RedHat based OS
2729* on RedHat/CentOS 7 you need to install python3.6 and pip from EPEL first
2830* on RHEL/Rocky Linux 8 systems the package name changed to ` python3-pip `
2931``` shell
3032yum install python36-pip
3133```
3234
33- ## Ubuntu 18.04 & 20.04
35+ ### Ubuntu 18.04 & 20.04
3436``` shell
3537apt-get update && apt-get install python3-venv
3638```
3739
38- ## Clone repo and install dependencies
40+ ### Clone repo and install dependencies
3941* download and setup of virtual environment
4042``` shell
4143cd /opt
@@ -46,7 +48,7 @@ python3 -m venv .venv
4648pip3 install -r requirements.txt || pip install -r requirements.txt
4749```
4850
49- ## Install as systemd service
51+ ### Install as systemd service
5052If files have been installed in a different directory then the systemd service file
5153needs to be edited.
5254
@@ -66,7 +68,7 @@ systemctl start wordpress-hash-event-api
6668systemctl enable wordpress-hash-event-api
6769```
6870
69- ## Install as OpenRC service
71+ ### Install as OpenRC service
7072The [ uvicorn.confd] ( contrib/uvicorn.confd ) config file needs to be copied to ` /etc/conf.d/ ` .
7173Let's assume the API is called ` nerd-h3 ` .
7274``` shell
@@ -90,7 +92,7 @@ is finished the service can be started.
9092rc-update add uvicorn.nerd-h3 default
9193```
9294
93- ## Docker
95+ ### Docker
9496
9597Run the application in docker container
9698
@@ -99,31 +101,36 @@ Run the application in docker container
99101
100102```
101103docker build -t wordpress-hash-event-api .
102- docker run --rm -it -v $(pwd)/config.ini:/app/settings.ini wordpress-hash-event-api
104+ docker run --rm -it -v $(pwd)/config.ini:/app/config.ini wordpress-hash-event-api
105+ ```
106+
107+ ### Nginx as reverse proxy
108+ In case you want to use Nginx as a reverse proxy you can add following lines
109+ to your server block configuration. Make sure to adjust your IP and port accordingly.
110+ ``` nginx
111+ location /api {
112+ return 307 /api/v1;
113+ }
114+ location /api/v1/ {
115+ rewrite /api/v1/(.*) /$1 break;
116+ proxy_pass http://127.0.0.1:8000;
117+ proxy_redirect off;
118+ proxy_set_header Host $host;
119+ proxy_set_header X-Real-IP $remote_addr;
120+ # activate to see the actual remote IP and not just your reverse proxy
121+ # attention: in Europe this has implications on your GDPR statements on your page
122+ # as you log IP addresses.
123+ #proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
124+ #proxy_set_header X-Forwarded-Proto $scheme;
125+ }
103126```
104127
105128## Setup
106129Copy the [ config-example.ini] ( config-example.ini ) sample settings file to ` config.ini ` .
107130All options are described in the example file.
108131
109-
110- ## ToDo
111- - [x] fix and test db connection timeout
112- - [ ] fill README with useful information
113- - [x] describe config
114- - [ ] function and class doc strings
115- - [x] add filters for most run attributes
116- - [x] add API auth
117- - [x] clean up code / linting
118- - [x] describe setup and installation
119- - [x] add docker file
120- - [x] try to add "auto-install", this should set up the WordPress Event Manager to add all available fields to all events
121- - [x] requirements.ini
122- - [x] add OpenRC init script and config to server API via uvicorn
123- - [ ] add nginx config example
124- - [ ] add CORS Headers to nginx config
125-
126-
132+ After starting the API the first time it will add additional fields to each event.
133+ Such as a choice for the hosting Kennel or amount of Hash Cash.
127134
128135
129136## License
0 commit comments