···11-FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:latest as builder
11+FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.24.3-alpine3.21 as builder
2233ARG TARGETPLATFORM
44ARG BUILDPLATFORM
55ARG TARGETOS
66ARG TARGETARCH
7788+#needed for sqlite
99+RUN apk add --update gcc musl-dev
1010+811# step 1. dep cache
912WORKDIR /app
1013ARG TARGETPLATFORM=${BUILDPLATFORM:-linux/amd64}
···1417# step 2. build the actual app
1518WORKDIR /app
1619COPY . .
1717-RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -ldflags="-w -s" -o main ./cmd
2020+#generate the jwks
2121+RUN go run github.com/haileyok/atproto-oauth-golang/cmd/helper generate-jwks
2222+RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -ldflags='-w -s -extldflags "-static"' -o main ./cmd
1823ARG TARGETOS=${TARGETPLATFORM%%/*}
1924ARG TARGETARCH=${TARGETPLATFORM##*/}
20252121-FROM --platform=${TARGETPLATFORM:-linux/amd64} scratch
2222-WORKDIR /app/
2626+FROM --platform=${TARGETPLATFORM:-linux/amd64} alpine:3.21
2727+#Creates an empty /db folder for docker compose
2828+WORKDIR /db
2929+WORKDIR /app
2330COPY --from=builder /app/main /app/main
3131+COPY --from=builder /app/jwks.json /app/jwks.json
2432ENTRYPOINT ["/app/main"]
+41-3
README.md
···991010well its just a work in progress... we build in the open!
11111212+## Setup
1313+It is recommend to have port forward url while working with piper. Development or running from docker because of external callbacks.
1414+1515+You have a couple of options
1616+1. Setup the traditional port forward on your router
1717+2. 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)
1818+1919+Either 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
2020+2121+#### env variables
2222+Copy [.env.template](.env.template) and name it [.env](.env)
2323+2424+This is a break down of what each env variable is and what it may look like
2525+2626+- `SERVER_PORT` - The port piper is hosted on
2727+- `SERVER_HOST` - The server host. `localhost` is fine here, or `0.0.0.0` for docker
2828+- `SERVER_ROOT_URL` - This needs to be the pubically accessible url created in [Setup](#setup). Like `https://piper.teal.fm`
2929+- `SPOTIFY_CLIENT_ID` - Client Id from setup in [Spotify developer dashboard](https://developer.spotify.com/documentation/web-api/tutorials/getting-started)
3030+- `SPOTIFY_CLIENT_SECRET` - Client Secret from setup in [Spotify developer dashboard](https://developer.spotify.com/documentation/web-api/tutorials/getting-started)
3131+- `SPOTIFY_AUTH_URL` - most likely `https://accounts.spotify.com/authorize`
3232+- `SPOTIFY_TOKEN_URL` - most likely `https://accounts.spotify.com/api/token`
3333+- `SPOTIFY_SCOPES` - most likely `user-read-currently-playing user-read-email`
3434+- `CALLBACK_SPOTIFY` - The first part is your publicly accessible domain. So will something like this `https://piper.teal.fm/callback/spotify`
3535+3636+- `ATPROTO_CLIENT_ID` - The first part is your publicly accessible domain. So will something like this `https://piper.teal.fm/.well-known/client-metadata.json`
3737+- `ATPROTO_METADATA_URL` - The first part is your publicly accessible domain. So will something like this `https://piper.teal.fm/.well-known/client-metadata.json`
3838+- `ATPROTO_CALLBACK_URL` - The first part is your publicly accessible domain. So will something like this `https://piper.teal.fm/callback/atproto`
3939+4040+- `LASTFM_API_KEY` - Your lastfm api key. Can find out how to setup [here](https://www.last.fm/api)
4141+4242+- `TRACKER_INTERVAL` - How long between checks to see if the registered users are listening to new music
4343+- `DB_PATH`= Path for the sqlite db. If you are using the docker compose probably want `/db/piper.db` to persist data
4444+4545+4646+1247#### development
4848+4949+make sure you have your env setup following [the env var setup](#env-variables)
13501451assuming you have go installed and set up properly:
1552···4279Go types should be updated and should have the changes to the schemas
43804481#### docker
8282+We 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
8383+`SERVER_HOST`- `0.0.0.0`
8484+`DB_PATH` = `/db/piper.db` to persist your piper db through container restarts
45854646-TODO
4747-4848-8686+Make sure you have docker and docker compose installed, then you can run piper with `docker compose up`