videah / SkyBridge

A work in progress bridge/proxy that lets you use Mastodon apps with Bluesky
https://skybridge.fly.dev
MIT License
532 stars 34 forks source link

Development instructions #77

Open jefflewis opened 6 days ago

jefflewis commented 6 days ago

When I run the docker container locally, the container successfully starts, but is inaccessible when visiting the port on localhost:8080.

Am I missing something about a local development environment? I was planning to build the docker image for other work but wanted to start with just the base image here.

> curl http://localhost:8080
curl: (7) Failed to connect to localhost port 8080 after 0 ms: Couldn't connect to server
WARN[0000] /Users/jeff/Developer/jefflewis/SkyBridge/docker-compose.yml: the attribute `version` is obsolete, it will be ignored, please remove it to avoid potential confusion
[+] Running 1/0
 ✔ Container skybridge  Recreated                                                             0.1s
Attaching to skybridge
skybridge  | Prisma schema loaded from prisma/schema.prisma
skybridge  | Datasource "db": SQLite database "skybridge.db" at "file:../database/skybridge.db"
skybridge  |
skybridge  | 4 migrations found in prisma/migrations
skybridge  |
skybridge  |
skybridge  | No pending migrations to apply.
skybridge  | npm notice
skybridge  | npm notice New minor version of npm available! 10.2.4 -> 10.9.0
skybridge  | npm notice Changelog: <https://github.com/npm/cli/releases/tag/v10.9.0>
skybridge  | npm notice Run `npm install -g npm@10.9.0` to update!
skybridge  | npm notice
skybridge  | No .env file found, continuing without one.
skybridge  | Enforcing bridge password.
skybridge  | Attempting to connect to database...
skybridge  | Indexed 0 users and 0 posts.
skybridge  | ✓ Running on http://:::8080

cat docker-compose.yml
version: "3.8"
services:
  skybridge:
    container_name: "skybridge"
    image: videah/skybridge:latest
    restart: always
    volumes:
      - skybridge:/app/database
    environment:
      # Base URL of where SkyBridge will be hosted without the protocol.
      - SKYBRIDGE_BASEURL=localhost
      # Random secret, generate with `openssl rand -base64 32`.
      - SKYBRIDGE_SECRET=super-secret
      # Password used to make a SkyBridge instance private.
      - SKYBRIDGE_AUTH_PASSWORD=super-secret
      # Should a bridge password be required to authenticate?
      - SKYBRIDGE_REQUIRE_AUTH_PASSWORD=true
      # Should a nice index page be shown on the root URL?
      - SKYBRIDGE_SHOW_INDEX=true
      # Allow backfilling/scrolling on timelines? (can cause issues on instances under heavy load)
      - SKYBRIDGE_ALLOW_BACKFILL=true

volumes:
  skybridge:
jefflewis commented 6 days ago

After further investigation, I think the cause of this is me not having a valid IPV6 address to hand out. IPV6 seems like it should be an optional feature. Would you be open to a PR that allows for configuration with an IPV4 if one cannot be found with the "get ipv6 address" call?