diff --git a/docker-compose.yml b/docker-compose.yml index 58e9df1..2be79f3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,6 +5,9 @@ services: - "8000:80" environment: - DATABASE_URL=postgres://elongate:elongate@db:5432/elongate + #- CONTACT_NAME=Your Name Here + #- CONTACT_EMAIL=your@email.example + #- CONTACT_URL=https://your.website.example/contact depends_on: - db db: diff --git a/src/main.py b/src/main.py index 4960941..5d069b3 100644 --- a/src/main.py +++ b/src/main.py @@ -27,6 +27,15 @@ except FileNotFoundError: WORDS = [] +def get_contact_details(): + v = {"name": os.getenv("CONTACT_NAME", "not specified")} + if (email := os.getenv("CONTACT_EMAIL")) is not None: + v["email"] = email + if (url := os.getenv("CONTACT_URL")) is not None: + v["url"] = url + return v + + @asynccontextmanager async def lifespan(_app: FastAPI): if os.path.exists("./data"): @@ -43,7 +52,7 @@ async def lifespan(_app: FastAPI): yield -app = FastAPI(lifespan=lifespan) +app = FastAPI(lifespan=lifespan, contact=get_contact_details()) templates = Jinja2Templates(directory="templates") diff --git a/src/static/index.html b/src/static/index.html index 3818c78..fa71df1 100644 --- a/src/static/index.html +++ b/src/static/index.html @@ -80,7 +80,9 @@

Create redirect

Link shorteners? nah. Link Elongater. Make your URLs really long.

- WARNING: This service is operated out of good faith, please return that good faith. If you find any redirects that are harmful or malicious, please report them to the operator of this service. + WARNING: This service is operated out of good faith, please return that good faith. + If you find any redirects that are harmful or malicious, please report them to the operator of this service + (can be found in the API Documentation).