umami-software / umami

Umami is a simple, fast, privacy-focused alternative to Google Analytics.
https://umami.is
MIT License
23.16k stars 4.3k forks source link

Allow different env vars for the same configuration #3078

Open luizkowalski opened 4 days ago

luizkowalski commented 4 days ago

Describe the feature or enhancement

This might be too specific but I think there is still value: Umami should expect different env vars for the same configuration.

Example: I'm deploying an application with Kamal and one of the "accessories" I'm deploying too is Umami. Kamal loads the the env vars from a single file so I can't have duplicates and both my app and Umami expect DATABASE_URL and they are not the same so for Umami I have to do some workaround:

<% require "dotenv"; Dotenv.load(".kamal/secrets") %> 
  umami:
    image: umamisoftware/umami:postgresql-v2.14.0
    port: 3000
    hosts:
      - web
    env:
      clear:
        DATABASE_URL: <%= ENV["UMAMI_DATABASE_URL"] %>
...

My point is that DATABASE_URL (and other env vars like PORT for example) are usually too generic and a lot other services and applications might expect the same var. Ideally, such variables should also be accessible with UMAMI_ as UMAMI_DATABASE_URL and UMAMI_PORT. Filebrowser does something like this, it prepepnds FB_ to every possible env var too.

not sure if I'm being clear, let me know how does this sound!

franciscao633 commented 17 hours ago

Good idea. I do see this pattern a lot when working with images. Not a high priority, but I'll mark enhancement so it doesn't become stale.