From 29f21e2bbd13fb52535497c2d3ccf7222e233fa3 Mon Sep 17 00:00:00 2001 From: Bailey Townsend Date: Thu, 29 May 2025 22:24:58 -0500 Subject: [PATCH] some docs --- .env.template | 21 +++++++++++++++------ README.md | 28 ++++++++++++++++++++++++++-- apps/amethyst/Dockerfile | 2 +- compose.dev.yml | 6 +----- 4 files changed, 43 insertions(+), 14 deletions(-) diff --git a/.env.template b/.env.template index cf99824..3a859ac 100644 --- a/.env.template +++ b/.env.template @@ -1,9 +1,18 @@ +#Aqua setup NODE_ENV=development PORT=3000 -HOST=localhost -PUBLIC_URL= -DB_USER= -DID_WEB_PUBKEY= -DB_PASSWORD= -DB_NAME= +HOST=0.0.0.0 +PUBLIC_URL=A publicly accessible url for aqua +DB_USER=postgres +DB_PASSWORD=supersecurepassword123987 +DB_NAME=teal DATABASE_URL="postgresql://${DB_USER}:${DB_PASSWORD}@localhost:5432/${DB_NAME}" +DOCKER_DB_URL="postgresql://${DB_USER}:${DB_PASSWORD}@host.docker.internal:5432/${DB_NAME}" +#This is not currently being used fully so can just use this default pubkey for now +DID_WEB_PUBKEY=zQ3sheEnMKhEK87PSu4P2mjAevViqHcjKmgxBWsDQPjLRM9wP +CLIENT_ADDRESS=A publicly accessible host for amethyst like amethyst.teal.fm +PUBLIC_DID_WEB=did:web:{aqua's PUBLIC_URL goes here after did:web:} + +#amethyst +EXPO_PUBLIC_DID_WEB=same as PUBLIC_DID_WEB +EXPO_PUBLIC_BASE_URL=same as CLIENT_ADDRESS but with http scheme like https://amethyst.teal.fm \ No newline at end of file diff --git a/README.md b/README.md index 4eb073f..f61f3cf 100644 --- a/README.md +++ b/README.md @@ -25,5 +25,29 @@ turbo dev --filter=@teal/aqua Open http://localhost:3000/ with your browser to see the home page. You will need to login with Bluesky to test the posting functionality of the app. Note: if the redirect back to the app after you login isn't working correctly, you may need to replace the `127.0.0.1` with `localhost`. -### Hosting the aqua appview in docker locally -notes for caddy and cloud flare tunnel https://caddy.community/t/caddy-with-cloudflare-tunnel/18569 \ No newline at end of file +### Running the full stack in docker for development +_Still a work in progress and may have some hiccups_ + +#### 1. Set up publicly accessible endpoints. +It is recommended if you are running aqua to make a publicly accessible endpoint for the app to post to. You can do that a couple of ways: + +* Set up the traditional port forward on your router +* 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). + +If you do the cloudflare tunnels for amethyst as well, +you will also need +to follow [this](https://caddy.community/t/caddy-with-cloudflare-tunnel/18569) for routing to work properly. +Although you can just run it locally and it will work. + +#### 2. Set up .envs +1. copy [.env.template](.env.template) and name it [.env](.env). The docker build will pull everything from this `.env`. There are notes in the [.env.template](.env.template) on what some of the values should be. +2. Follow the instructions in [piper](https://github.com/teal-fm/piper) to set up environment variables for the music scraper. But name it `.env.air` + +#### 3. Run docker +1. Make sure docker and docker compose is installed +2. It is recommended to run 'docker compose -f compose.dev.yml pull' to pull the latest remote images before running the docker compose command. +3. Run `docker compose -f compose.dev.yml up -d` + + +And that's it! You should have the full teal.fm stack running locally. Now if you are working on aqua you can do `docker container stop aqua-app` and run that locally during development while everything else is running in docker. + diff --git a/apps/amethyst/Dockerfile b/apps/amethyst/Dockerfile index 13565ba..15d6cee 100644 --- a/apps/amethyst/Dockerfile +++ b/apps/amethyst/Dockerfile @@ -42,7 +42,7 @@ RUN echo '{ \ "client_uri": "https://'"${CLIENT_ADDRESS}"'", \ "dpop_bound_access_tokens": true \ }' > /app/client-metadata.json \ - + FROM caddy:2.1.0-alpine AS caddy EXPOSE 80 diff --git a/compose.dev.yml b/compose.dev.yml index dd90765..054ffb7 100644 --- a/compose.dev.yml +++ b/compose.dev.yml @@ -77,8 +77,7 @@ services: depends_on: - postgres piper: -# image: ghcr.io/teal-fm/piper:main - image: fatfingers23/piper:latest + image: ghcr.io/teal-fm/piper:main # Depends on your .env.air ports: - "8080:8080" @@ -86,9 +85,6 @@ services: - .env.air volumes: - piper_data:/db - -# db-migrations - #TODO to not forget to add an image to run db migrations or add it to aqua in a bash script on run networks: app_network: driver: bridge -- 2.51.2