Giter VIP home page Giter VIP logo

Comments (5)

Masu-Baumgartner avatar Masu-Baumgartner commented on August 28, 2024 1

Elo, using environment variables for loading config options has been implemented in the v2 version of moonlight (more information about v2, see our discord server). v2 builds are not available in this development state

You can set values using the json structure of the config.json.
e.g. the config looks like that:
{ "AppUrl": "http://localhost:5132", ... "Store": { "Currency": "$" }, ... }

You can set the currency using the env var: Moonlight_Store_Currency

If the type of the value is e.g. a integer or a boolean moonlight tries automatically to parse it and ignores the variable if unable to do so.

I hope you are happy with this implementation. If you have any feedback about it, feel free to give feedback ^^

from moonlight.

Masu-Baumgartner avatar Masu-Baumgartner commented on August 28, 2024

Hey hey, thanks for you feature request. The storage folder is essential for some moonlight features (e.g. log files and custom images). I can make it that you can pass the configuration file content, so the whole json, as an environment variable. Would you be okay with this way of implementing it or do you have a better idea which i can integrate?

from moonlight.

davmin avatar davmin commented on August 28, 2024

Love the panel, great work!

Passing the whole json as an environment variable would be a big step up for me from the current methods.

Alternatively, I think its preferable, though more work, to expose each config setting manually as environment variables. This is how most container-first applications I've deployed take their configuration. So for moonlight panel you could have the settings exposed with env variables like -

MOONLIGHT_DATABASE__DATABASE
MOONLIGHT_DATABASE__HOST
MOONLIGHT_DATABASE__PASSWORD
MOONLIGHT_LETSENCRYPT__ENABLE

This has the advantage of being able to individually set settings directly in my manifests (e.g. this docker-compose.yml for pterodactyl) which are then kept in source control. My deployment method (fluxcd) makes it very easy to pull individual secrets from vault and set them as env variables in containers. It's possible to do substitution within a template e.g. the config.json but significantly more effort, and requires maintaining the json template somewhere in source. Some of the other benefits of config as env are detailed here.

from moonlight.

Masu-Baumgartner avatar Masu-Baumgartner commented on August 28, 2024

Hey hey,

the Moonlight__Something way of implementing config options looks like the best solution and will be implemented in Moonlight v2 (the current version i am working on. For more information, join in discord. Link in docs).

from moonlight.

davmin avatar davmin commented on August 28, 2024

Awesome, thank you!

from moonlight.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.