Comments (6)
Hi, our thoughts on it:
- Users can now use a config template to maintain the "environment" options.
- We agree it's more convenient to provide native variables for the application options like
working_directory
andenvironment
. Now we are on the 1.32 version and we'll try it when we start the 1.33 version.
Thanks.
from unit.
If we consider that envsubst(1) and similar tools provides a reasonable workaround today, how useful would it be to "pass through" specific environment variables to the application's environment?
{
"applications": {
"foo": {
"type": "external",
"working_directory": "/path/to/thing",
"executable": "app",
"environment_passthrough": ["SOME_ENV_VAR", "OTHER_ENV_VAR"],
"environment": {
"HOME": "/path/to/thing"
}
}
}
}
Would this be a worthwhile feature in its own right? Or is full access to env vars, across the entire configuration scope the main thing? If so, we might also consider environment variable substitution a function that the unitc
CLI tool can provide.
from unit.
Yup, same here. Here's what one of our configs looks like and how we use ENV vars in our config:
"applications": {
"sinatra": {
"type": "ruby",
"processes": {{ NUM_WORKERS }},
"threads": {{ WORKER_THREADS_MAX }},
"script": "{{ HOME }}/workspace/app/config.ru",
"hooks": "{{ HOME }}/workspace/app/config/unit/hooks.rb",
"working_directory": "{{ HOME}}/workspace/app/",
"limits": {
"timeout": 30
}
}
}
from unit.
Oooooh, this is a good one. I use envtpl
right now to get this functionality in my configs but would love to drop it as a dependency!
from unit.
Hi,
There are a few separate functions here.
- Unit supports variables and njs/JS for options like
pass
,share
, etc.
https://unit.nginx.org/scripting/ - It's able to access environment variables with njs.
https://nginx.org/en/docs/njs/reference.html#process - The variables and JS only work on the runtime phase.
But the option environment
in the application is applied when the proto process starts, it's a different phase than the runtime phase which runs for the http request.
To make it short, the feature is about whether Unit provides variable engine in the application starting phase.
We'll discuss it with the team, and any thoughts are welcome.
from unit.
Our use-case would be to configure number of processes
, options for applications (like memory_limit
), etc. Thank you!
from unit.
Related Issues (20)
- Getting strange message when trying to get static files HOT 4
- Add PHP 8.3 image HOT 1
- Does nginx-unit want to support WSGI+ ? HOT 2
- Unit fails to build against njs 0.8.2 and libxml2 2.12, or njs 0.8.3 HOT 3
- ./configure: error: no PHP embed SAPI found when there is no libphp.so HOT 10
- Issue with creating files and folders from PHP HOT 3
- WebsocketConnection WebSocket onerror while trying nginx htpasswd protection HOT 1
- Using `vars` multiple times in `access_log.format` does not work correctly with njs HOT 3
- App process XXXX exited on signal 7 HOT 1
- Broken stdout and stderr logging in Amazon Linux HOT 4
- Application restart breaks WebAssembly Components HOT 8
- How to pass $request_id to my application?
- Support for modifying request headers HOT 3
- Ability to read mounted configuration file HOT 5
- Very hard to run .sh scripts from within Flask app HOT 2
- Consider updating containers to bookworm base image HOT 3
- Issue with WAR in unit-jsc11 HOT 6
- OpenSSL 3.2.1 breaks TLS related pytests HOT 4
- Module `wasm-wasi-component` is not found among available application modules HOT 3
- Choosing TLS library at startup time HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from unit.