jocxfin / pwgen

Simple self hosted password generator
GNU Affero General Public License v3.0
62 stars 5 forks source link

Environment Variable for Domain Subpaths #85

Closed zsteinmetz closed 2 months ago

zsteinmetz commented 4 months ago

Title

Add an environment variable to run pwgen in domain subpaths like https://joonatanh.com/pwgen.

Is Your Feature Request Related to a Problem? Please Describe.

At the moment, I'm struggling to get pwgen to work in a subpath of a domain rather than the web root of a subdomain. The index page is accessible but links to static assets point to the web root, such as https://joonatanh.com/ instead, which makes the site break.

Description

It would be nice to have an environment variable that defines the base path or the web root of the installation. It could default to "/" for installations using a full domain or subdomain but allow for the flexibility to change it to "/pwgen", for instance.

User Story

As an administrator, I would like the flexibility to decide whether to host pwgen on a subdomain like https://pwgen.joonatanh.com/ or in subdirectory like https://joonatanh.com/pwgen.

Labels

backend, enhancement

jocxfin commented 2 months ago

Starting to work on this @zsteinmetz.

jocxfin commented 2 months ago

@zsteinmetz it's implemented and you can try it with the jocxfin/pwgen-dev:latest dockerhub image.

Use -e BASE_PATH="/pwgen/" \ when starting the container or whatever subpath you want to use! Cheers. I'll soon update it to the main branch

zsteinmetz commented 2 months ago

Nice! Thank you!