fix: add support for http_proxy and https_proxy

This commit is contained in:
Ruben Fiszel
2023-06-09 19:14:02 +02:00
parent 61cde59011
commit 3d8c97c154
5 changed files with 16 additions and 10 deletions
+3 -1
View File
@@ -362,7 +362,9 @@ it being synced automatically everyday.
| EXIT_AFTER_NO_JOB_FOR_SECS | None | Exit worker if no job is received after duration in secs if defined | Worker |
| OAUTH_JSON_AS_BASE64 | None | Base64 encoded JSON of the OAuth configuration. e.g `OAUTH_JSON_AS_BASE64=$(base64 oauth.json \| tr -d '\n')` to encode it | Server |
| REQUEST_SIZE_LIMIT | 2097152 (2MB) | Max request size which impact the maximum size of resources and payload size of job args | Server |
| ACCEPT_INVALID_CERTS | false | Accept invalid certificates, including self-signed and expired certificates | Server |
| ACCEPT_INVALID_CERTS | false | Accept invalid certificates, including self-signed and expired certificates | Server |
| HTTP_PROXY | None | http_proxy | Server + Worker |
| HTTPS_PROXY | false | https_proxy | Server + Worker |
## Run a local dev setup
+1 -6
View File
@@ -1,10 +1,5 @@
{
"python.analysis.typeCheckingMode": "basic",
"rust-analyzer.linkedProjects": [
"./windmill-common/Cargo.toml",
"./parsers/windmill-parser-ts-wasm/Cargo.toml",
"./parsers/windmill-parser-ts-wasm/Cargo.toml",
"./parsers/windmill-parser-ts-wasm/Cargo.toml"
],
"rust-analyzer.linkedProjects": ["./windmill-common/Cargo.toml"],
"rust-analyzer.showUnlinkedFileNotification": false
}
+1 -1
View File
@@ -1,5 +1,5 @@
{
"name": "windmill-parser-ts-wasm",
"name": "windmill-parser-wasm",
"lockfileVersion": 3,
"requires": true,
"packages": {}
@@ -19,6 +19,7 @@ lazy_static::lazy_static! {
static ref PYTHON_PATH: String =
std::env::var("PYTHON_PATH").unwrap_or_else(|_| "/usr/local/bin/python3".to_string());
static ref PIP_INDEX_URL: Option<String> = std::env::var("PIP_INDEX_URL").ok();
static ref PIP_EXTRA_INDEX_URL: Option<String> = std::env::var("PIP_EXTRA_INDEX_URL").ok();
static ref PIP_TRUSTED_HOST: Option<String> = std::env::var("PIP_TRUSTED_HOST").ok();
+10 -2
View File
@@ -175,7 +175,8 @@ lazy_static::lazy_static! {
.and_then(|x| x.parse::<bool>().ok())
.unwrap_or(false);
static ref HTTP_PROXY: Option<String> = std::env::var("http_proxy").ok().or(std::env::var("HTTP_PROXY").ok());
static ref HTTPS_PROXY: Option<String> = std::env::var("https_proxy").ok().or(std::env::var("HTTPS_PROXY").ok());
pub static ref DENO_PATH: String = std::env::var("DENO_PATH").unwrap_or_else(|_| "/usr/bin/deno".to_string());
pub static ref NSJAIL_PATH: String = std::env::var("NSJAIL_PATH").unwrap_or_else(|_| "nsjail".to_string());
pub static ref PATH_ENV: String = std::env::var("PATH").unwrap_or_else(|_| String::new());
@@ -1278,7 +1279,7 @@ mount {{
};
// println!("handle lang job {:?}", SystemTime::now());
let envs = if *CLOUD_HOSTED || envs.is_none() {
let mut envs = if *CLOUD_HOSTED || envs.is_none() {
HashMap::new()
} else {
let mut hm = HashMap::new();
@@ -1294,6 +1295,13 @@ mount {{
hm
};
if let Some(ref env) = *HTTPS_PROXY {
envs.insert("HTTPS_PROXY".to_string(), env.to_string());
}
if let Some(ref env) = *HTTP_PROXY {
envs.insert("HTTP_PROXY".to_string(), env.to_string());
}
let result: error::Result<serde_json::Value> = match language {
None => {
return Err(Error::ExecutionErr(