{"id":17024524,"url":"https://github.com/0wain/gmsv_dot_env","last_synced_at":"2025-04-12T11:20:31.130Z","repository":{"id":48522598,"uuid":"516897747","full_name":"0wain/gmsv_dot_env","owner":"0wain","description":"📁 A not-so-true-to-life implementation of .env (dot env) for Garry's Mod","archived":false,"fork":false,"pushed_at":"2025-01-07T14:55:46.000Z","size":19,"stargazers_count":9,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-04T18:07:27.300Z","etag":null,"topics":["dot-env","dotenv","garrys-mod","garrysmod","gmod","gmod-module","gmsv","rust","rust-lang"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/0wain.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-07-22T22:03:31.000Z","updated_at":"2025-02-12T21:31:35.000Z","dependencies_parsed_at":"2022-09-22T21:52:05.248Z","dependency_job_id":null,"html_url":"https://github.com/0wain/gmsv_dot_env","commit_stats":null,"previous_names":["0wain/gmsv_dot_env"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0wain%2Fgmsv_dot_env","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0wain%2Fgmsv_dot_env/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0wain%2Fgmsv_dot_env/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0wain%2Fgmsv_dot_env/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/0wain","download_url":"https://codeload.github.com/0wain/gmsv_dot_env/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248558122,"owners_count":21124223,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dot-env","dotenv","garrys-mod","garrysmod","gmod","gmod-module","gmsv","rust","rust-lang"],"created_at":"2024-10-14T07:25:55.730Z","updated_at":"2025-04-12T11:20:31.096Z","avatar_url":"https://github.com/0wain.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gmsv_dot_env\n\nA not-so-true-to-life implementation of a .env file for gmod. Place a .env at `./garrysmod/.env` and any variables set in it will be accessible from within Lua through the `env()` function. The file will require you to run `require(\"dot_env\")` at the top of a config file.\n\nThis does not respect ENVIRONMENT_VARIABLES defined outside of the .env. ~My intentions were (And always will be) to keep the context of the variables tight and strict, so they are only creatable through the .env file.~ I change my mind (I was an idiot then), if you want to add this functionality please open a PR!\n\nAlso, this will only work on server side. So if you require it inside a shared file, make sure to account for that.\n\n*Also, idk wtf I'm doing with Rust and this is probably a low key mess*\n\n## Install\n\n1. Place the dll in `./garrysmod/lua/bin`.\n2. Create a `.env` file at `./garrysmod/.env`.\n3. Populate the .env file with an appropriate config.\n4. Go to a config file and require the DLL at the top of the file: `if SERVER then require('dot_env') end`\n5. Set the config value using the `env()` function: `MyAddon.Config.SQL.Password = env('MY_ADDON_SQL_PASSWORD') or \"password\"`.\n6. If you are using this in a shared context, you may need to account for that like so: `MyAddon.Config.SharedValue = SERVER and (env('MY_ADDON_SHARED_VAL') or \"Fallback\") or \"Client Fallback\"`, but it is unlikely you would be using this in a shared context.\n\n## Credits\n\n- [WilliamVenner](https://github.com/WilliamVenner) - Making gmod-rs. Digging through his endless Gmod Rust DLL repos in order to understand how gmod-rs works. I also stole his build action, sue me.\n- [dotenv-parser](https://github.com/rubik/dotenv-parser) - Parsing the .env file. Because why make something yourself when someone has already done it better?\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0wain%2Fgmsv_dot_env","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F0wain%2Fgmsv_dot_env","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0wain%2Fgmsv_dot_env/lists"}