···11+A fork of https://github.com/teal-fm/piper
22+13# piper
2435#### what is piper?
···1012well its just a work in progress... we build in the open!
11131214## setup
1515+1316It is recommend to have port forward url while working with piper. Development or running from docker because of external callbacks.
14171518You have a couple of options
1919+16201. Setup the traditional port forward on your router
17212. Use a tool like [ngrok](https://ngrok.com/) with the command `ngrok http 8080` or [Cloudflare tunnels](https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/get-started/create-remote-tunnel/) (follow the 2a. portion of the guide when you get to that point)
18221923Either way make note of what the publicly accessible domain name is for setting up env variables. It will be something like `https://piper.teal.fm` that you can access publicly
20242125#### env variables
2626+2227Copy [.env.template](.env.template) and name it [.env](.env)
23282429This is a break down of what each env variable is and what it may look like
···3035- `ATPROTO_CLIENT_SECRET_KEY` - Private key for oauth confidential client. This can be generated via goat `goat key generate -t P-256`
3136- `ATPROTO_CLIENT_SECRET_KEY_ID` - Key ID for oauth confidential client. This needs to be persistent and unique, can use a timestamp. Here's one for you: `1758199756`
32373333-3438- `SERVER_PORT` - The port piper is hosted on
3539- `SERVER_HOST` - The server host. `localhost` is fine here, or `0.0.0.0` for docker
3640- `SERVER_ROOT_URL` - This needs to be the pubically accessible url created in [Setup](#setup). Like `https://piper.teal.fm`
···49535054- `TRACKER_INTERVAL` - How long between checks to see if the registered users are listening to new music
5155- `DB_PATH`= Path for the sqlite db. If you are using the docker compose probably want `/db/piper.db` to persist data
5252-5353-54565557## development
5658···7678```
7779air
7880```
7979-air should automatically build and run piper, and watch for changes on relevant files.
80818282+air should automatically build and run piper, and watch for changes on relevant files.
81838284## tailwindcss
83858484-To use tailwindcss you will have to install the tailwindcss cli. This will take the [./pages/static/base.css](./pages/static/base.css) and transform it into a [./pages/static/main.css](./pages/static/main.css)
8686+To use tailwindcss you will have to install the tailwindcss cli. This will take the [./pages/static/base.css](./pages/static/base.css) and transform it into a [./pages/static/main.css](./pages/static/main.css)
8587which is imported on the [./pages/templates/layouts/base.gohtml](./pages/templates/layouts/base.gohtml). When running the dev server tailwindcss will watch for changes and recompile the main.css file.
868887891. Install tailwindcss cli `npm install tailwindcss @tailwindcss/cli`
88902. run `npx @tailwindcss/cli -i ./pages/static/base.css -o ./pages/static/main.css --watch`
89919090-9191-9292+#### Lexicon changes
92939393-#### Lexicon changes
94941. Copy the new or changed json schema files to the [lexicon folders](./lexicons)
95952. run `make go-lexicons`
96969797-Go types should be updated and should have the changes to the schemas
9797+Go types should be updated and should have the changes to the schemas
98989999#### docker
100100+100101We also provide a docker compose file to use to run piper locally. There are a few edits to the [.env](.env) to make it run smoother in a container
101102`SERVER_HOST`- `0.0.0.0`
102103`DB_PATH` = `/db/piper.db` to persist your piper db through container restarts