louislam / uptime-kuma

A fancy self-hosted monitoring tool
https://uptime.kuma.pet
MIT License
59.46k stars 5.32k forks source link

Storing API keys, tokens and other data as variables for use in multiple monitors without duplication #1223

Open jamesmacwhite opened 2 years ago

jamesmacwhite commented 2 years ago

⚠️ Please verify that this feature request has NOT been suggested before.

🏷️ Feature Request Type

Other

🔖 Feature description

It would be nice to be able to store certain data like API keys, tokens or other data that might be re-used in more than one monitor, rather than having to duplicate these in each monitor. I have several monitors currently which use the same API key for different endpoints under the same API and currently these are hard coded into each monitor, meaning if the API key ever changes it needs to be updated in multiple monitors.

✔️ Solution

Potentially this could be achieved with environment variables, if fields like URL, body and headers would support parsing the data with environment variable awareness, this could be an option.

Or alternatively have a specific table in the database to store a key and value and then reference the key with a specific template syntax such as {{ myStoredApiKey }}.

❓ Alternatives

No response

📝 Additional Context

No response

cocoonkid commented 2 years ago

+1 for a monitorN/.env

qiujianzhong commented 1 week ago

Is there a place to store global variables? such as cookies/keys/tokens, etc
up up up