lowercasename / gathio

Self-destructing, shareable, no-registration event pages
GNU General Public License v3.0
309 stars 36 forks source link

Please Help - Installation via Docker, cannot create event #150

Closed superdingo101 closed 3 months ago

superdingo101 commented 5 months ago

Hello, I have installed my instance via docker on a NAS and am struggling to get it up and running.

Ultimately, the error message isn't specific enough to help me troubleshoot it on my own.

A note on my config and things I have tried:

docker-compose.yml:

services:
    gathio:
        build: .
        ports:
            - 3000:3000
    mongo:
        ports:
            - 3009:27017
        volumes:
            - mongo-data:/data/db
        image: mongo:4.4

volumes:
    mongo-data:

Dockerfile

FROM node:18-alpine
WORKDIR /app
RUN apk add --no-cache python3 build-base
ADD package.json pnpm-lock.yaml /app/
RUN npm install -g pnpm
RUN pnpm install
COPY . /app/
# RUN cp config/config.example.toml config/config.toml
# Always exit 0 here because TSC will fail while we're migrating to TypeScript but
# not everything uses TypeScript
RUN pnpm run build; exit 0
CMD pnpm run start

config.toml:

[general]
# Your domain goes here. If there is a port it should be 'domain.com:port', but
# otherwise just 'domain.com'.
domain = "192.168.0.99:3000"
port = "3000"
email = "[redacted]"
site_name = "Events!"
is_federated = false
# Events will be deleted this many days after they have ended. Set to 0 to
# disable automatic deletion (old events will never be deleted).
delete_after_days = 0
# If left blank, this defaults to
# https://yourdomain.com/images/gathio-email-logo.gif. Set a full URL here to
# change it to your own logo (or just change the file itself).
email_logo_url = ""
# Show a Ko-Fi box to donate money to Raphael (Gathio's creator) on the front
# page.
show_kofi = false
# Show a list of events and groups on the front page which have been marked as
# 'Display this event/group on the public event/group list'.
show_public_event_list = false
# Which mail service to use to send emails to hosts and attendees. Options are
# 'nodemailer' or 'sendgrid'. Configure settings for this mail
# service below.
mail_service = "sendgrid"
# An array of email addresses which are permitted to create events. If this is
# empty, anyone can create events.
# For example:
# creator_email_addresses = ["test@test.com", "admin@test.com"]
creator_email_addresses = []

[database]
# Set up for a locally running MongoDB connection. Change this to
# 'mongodb://mongo:27017/gathio' for a Dockerised connection.
mongodb_url = "mongodb://192.168.0.99:3009/gathdb"

[nodemailer]
smtp_server = ""
smtp_port = ""
smtp_username = ""
smtp_password = ""

[sendgrid]
api_key = "[redacted]"

# Links to static pages (for example a privacy policy) or an external community page,
# which will be displayed in the footer.
# If paths begin with a slash, they are treated as internal and will open the specified
# Markdown or text file. If they are absolute (begin with https://), they will simply
# link to the specified URL.

[[static_pages]]
title = "Privacy Policy"
path = "/privacy"
filename = "privacy-policy.md"

# [[static_pages]]
# title = "External Link"
# path = "https://example.com"

error message: https://imgur.com/MKYZQrf

Result of docker logs gathio-gathio-1:

> gathio@1.4.1 start /app
> node dist/start.js

Sendgrid is ready to send emails.
Sendgrid is ready to send emails.
Welcome to gathio! The app is now running on http://localhost:3000
Mongoose connection open!
lowercasename commented 5 months ago

Hm, it's really odd that everything starts up successfully but the server just mysteriously fails. I'll see if I can replicate this!

HybridSarcasm commented 4 months ago

I can replicate. My setup is pretty vanilla, too. I'm using nodemailer, instead of SendGrid, though.

services:
    gathio:
        build: .
        links:
            - mongo
        ports:
            - 3000:3000

    mongo:
        image: mongo:latest
        volumes:
            - /docker/data/gathio/mongodb_data_db:/data/db
> gathio@1.5.0 start /app
> node dist/start.js

Welcome to gathio! The app is now running on http://localhost:3000
Mongoose connection open!
lowercasename commented 3 months ago

I still can't replicate, although at the moment the only machine I have access to is an M1 MacBook, which I don't think is necessarily the best testing machine for this. I have however just made some commits which have pushed the Node version to 20 and removed that COPY line for the config file in the Dockerfile. Instead I've set up a volume mount in the default docker-compose.yml file, which makes a lot more sense. I've also now made the default mail service 'none', which means no emails will be sent. None of these are changes that I think will fix this, but I'm still investigating!

eprouty-chwy commented 3 months ago

Setting is_federated=false in the config is how you replicate this. The server works if that's set to true but otherwise fails with 404 responses to /event calls.

@lowercasename for vis 👀

lowercasename commented 3 months ago

Oh well done - I've fixed this! It was a pretty egregious bug in the ActivityPub router which made all routes listed after that router to return 404 when ActivityPub was disabled.