- Notifications
You must be signed in to change notification settings - Fork20
Platform to serve Hololive content to the community tools.
License
holofans/holoapi
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Platform to serve Hololive information to community tools
- Requirements
- Optional, you can just run Postgres locally.
docker
anddocker-compose
to run Postgres and PGAdmin4.
- Optional, you can just run Postgres locally.
- Have a
gcp-key.json
on project root- You may get this from your GCP Project,under credentials
- CreateService Account
- CreateJSON key file. Rename it to
gcp-key.json
. Store it safely since it cannot be re-downloaded.
- You may get this from your GCP Project,under credentials
- Copy
.env.example
into.env
- Change values for your environment
- Change values in
ecosystem.config.js
for your environment - Execute
docker-compose up
ornpm start
on root- API is then accessible through
http://localhost:2434/
- API is then accessible through
Note that cron format used here is:
* * * * * * ┬ ┬ ┬ ┬ ┬ ┬ │ │ │ │ │ │ │ │ │ │ │ └ day of week (0 - 7) (0 or 7 is Sun) │ │ │ │ └───── month (1 - 12) │ │ │ └────────── day of month (1 - 31) │ │ └─────────────── hour (0 - 23) │ └──────────────────── minute (0 - 59) └───────────────────────── second (0 - 59, OPTIONAL)
Set up deployment of holotools-api by using the following deployment methods:
- HEROKU Automatic Deployment using aProcfile
- Digital Ocean Deployment
- or if you'd rather not deploy from local, and would like it semi-automated, use a webhook:https://github.com/adnanh/webhook
Setting up a dev user account
# Add user to run DB under$ adduser holotools$ usermod -aG sudo holotools# Have SSH keys synced$ rsync --archive --chown=holotools:holotools ~/.ssh /home/holotools
Setting up postgresql
$ sudo apt update && sudo apt install postgresql postgresql-contrib$ sudo -i -u postgres# Create a new user in postgres with same username as the dev user (holotools):$ createuser --interactive# Set it up with the holotools user.$ createdb holotools
Now you haveholotools
user which can modifyholotools
database without pg auth.
For testing connections from outside, modify the pg_hba.conf for your postgres install:
host all all 127.0.0.1/32 trust
change the pg_hba.conf for localhost (127.0.0.1/32) frommd5
totrust
to give pg permissions. This allows SSH tunneling to log in to postgres.
To connect to postgres from external: set up SSH tunnel-L 9999:localhost:5432
or, use SSH-tunnel connection option bundled with any db administration tools (tableplus, pgAdmin4). Then useholotools
user to log in. No db password is needed in this setup, but don't open up the db to external or security issues may arise.
Installing Memcached:Detailed Guide
$ sudo apt install memcached libmemcached-tools
This sets up memcached service at localhost:11211, well, it's not daemonized.
About
Platform to serve Hololive content to the community tools.