diff --git a/filed/.env.example b/filed/.env.example index 0f1a01c..71d80da 100644 --- a/filed/.env.example +++ b/filed/.env.example @@ -6,4 +6,6 @@ REDIS_HOST=redis REDIS_PORT=6379 REDIS_PREFIX=bfile- -USERCONTENT_DIR=/opt/user_uploads \ No newline at end of file +USERCONTENT_DIR=/opt/user_uploads + +INSTANCE_URL=http://localhost \ No newline at end of file diff --git a/filed/src/env.rs b/filed/src/env.rs index f2cf1e5..40d5b66 100644 --- a/filed/src/env.rs +++ b/filed/src/env.rs @@ -18,7 +18,8 @@ pub struct Env { pub logging: bool, pub listen: SocketAddr, pub redis: Redis, - pub filedir: String + pub filedir: String, + pub instanceurl: String } fn get_var, O: From>(name: T) -> Result { @@ -51,7 +52,8 @@ pub fn loadenv() -> Result> { return Err(format!("USERCONTENT_DIR is set to \"{}\", which exists but is not a directory!", &spath).into()) } spath - } + }, + instanceurl: get_var("INSTANCE_URL")? } ) }