You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Get a list of all available environment variable names for this plugin.
181
+
182
+
**Returns:** Array of variable names
183
+
184
+
**Example:**
185
+
```lua
186
+
localvars=env_list()
187
+
fori, var_nameinipairs(vars) do
188
+
log_info("Available env var: " ..var_name)
189
+
end
190
+
```
191
+
192
+
### The `.plugins.env` File
193
+
194
+
The `.plugins.env` file in the server root directory stores environment variables that plugins can access. This is useful for API keys, tokens, and other sensitive configuration.
195
+
196
+
**File Format:**
197
+
```
198
+
# Comment lines start with #
199
+
API_KEY=your_api_key_here
200
+
API_SECRET=your_secret_here
201
+
BASE_URL=https://api.example.com
202
+
203
+
# Values can be quoted or unquoted
204
+
DB_HOST="database.example.com"
205
+
DB_PORT=5432
206
+
```
207
+
208
+
**Security Notes:**
209
+
- Each plugin can only access environment variables explicitly listed in its `env_vars` configuration
210
+
- Never commit `.plugins.env` to version control (add it to `.gitignore`)
211
+
- Use environment variables for sensitive data instead of hardcoding in plugin files
212
+
213
+
## Complete Example
214
+
215
+
Here's a complete example of a plugin using custom User-Agent and environment variables:
0 commit comments