DashMachine icon indicating copy to clipboard operation
DashMachine copied to clipboard

[Enhancement] Environment variables

Open dferrandizmont opened this issue 4 years ago • 4 comments

Hello, how about adding environment variables?

I'd love to change between local address (192.168.X.XXX) to an external address with just some kind of switch or a dropdown like Postman has.

Thanks for this awesome home page!

dferrandizmont avatar May 28 '20 06:05 dferrandizmont

Hey thanks! :)

Do you mean like enviroment variables when the docker image is set up?

rmountjoy92 avatar May 30 '20 13:05 rmountjoy92

Hello! :)

No no, what I mean is something like Postman has, for example, in the config

[Home Assistant]
prefix = {{ envPrefix }}
url = {{ homeAssistantUrl }}
icon = static/images/apps/home-assistant.png
description = Open source home automation that puts local control and privacy first
open_in = new_tab
tags = Home

[Bitwarden]
prefix = {{ bitwardenPrefix }}
url = {{ bitwardenUrl }}
icon = static/images/apps/bitwarden.png
description = A free and open-source password management service
open_in = new_tab
tags = Secure 

and then, somewhere in the config, have some kind of config where I can say

[Home environment]
envPrefix = http://
homeAssistantUrl = 192.168.1.XX:5214
jenkinsUrl = 192.168.1.XX:5888
bitwardenPrefix = https://
bitwardenUrl = 192.168.1.XX:3005

[Office environment]
envPrefix = https://
homeAssistantUrl = myhomeassistant.com
jenkinsUrl = myjenkins.com
bitwardenPrefix = https://
bitwardenUrl = mybitwarden.com

and then, in the UI, somewhere a dropdown to chose which environment I want to use.

Dunno if I have explain myself.

dferrandizmont avatar May 31 '20 09:05 dferrandizmont

Well at this point Dashmachine could use the IP of your login to determine if you are in LAN and apply default addresses, or if there's no match use the "fallback" URLs

auanasgheps avatar May 31 '20 10:05 auanasgheps

I like this behavior, but what about applying http or https ? Could be customized too.

dferrandizmont avatar May 31 '20 10:05 dferrandizmont