feat: Add domain env variable support

master
John Montagu, the 4th Earl of Sandvich 2024-12-12 12:07:54 -08:00
parent f9eb48fc78
commit 0f7995f0c2
Signed by: sandvich
GPG Key ID: 9A39BE37E602B22D
2 changed files with 5 additions and 1 deletions

View File

@ -10,6 +10,7 @@ from sqlalchemy_utc import UtcDateTime
from discord_webhook import DiscordWebhook
import app_db
import spec
import os
class Event(app_db.BaseModel):
@ -101,6 +102,8 @@ class Event(app_db.BaseModel):
if ringers_needed > 0:
ringers_needed_msg = f" **({ringers_needed} ringer(s) needed)**"
domain = os.environ.get("DOMAIN", "availabili.tf")
return "\n".join([
f"# {self.name}",
"",
@ -111,7 +114,7 @@ class Event(app_db.BaseModel):
f"Max bipartite matching size: {matchings}" + ringers_needed_msg,
"",
"[Confirm attendance here]" +
f"(https://availabili.tf/team/id/{self.team.id}/events/{self.id})",
f"(https://{domain}/team/id/{self.team.id}/events/{self.id})",
])
def get_or_create_webhook(self):

View File

@ -35,6 +35,7 @@ services:
- FLASK_CELERY_BROKER_URL=redis://redis:6379/0
- FLASK_CELERY_RESULT_BACKEND=redis://redis:6379/0
- DATABASE_URI=postgresql+psycopg://postgres:password@db:5432/availabilitf
- DOMAIN=availabili.tf.sandvich.xyz
depends_on:
- redis
- db