diff --git a/filed/.env.example b/filed/.env.example index 71d80da..f399e1e 100644 --- a/filed/.env.example +++ b/filed/.env.example @@ -8,4 +8,5 @@ REDIS_PREFIX=bfile- USERCONTENT_DIR=/opt/user_uploads -INSTANCE_URL=http://localhost \ No newline at end of file +INSTANCE_URL=http://localhost +UPLOADS_PATH=file # can be only one alphanumeric word diff --git a/filed/src/env.rs b/filed/src/env.rs index 40d5b66..f561384 100644 --- a/filed/src/env.rs +++ b/filed/src/env.rs @@ -19,7 +19,8 @@ pub struct Env { pub listen: SocketAddr, pub redis: Redis, pub filedir: String, - pub instanceurl: String + pub instanceurl: String, + pub uploadspath: String } fn get_var, O: From>(name: T) -> Result { @@ -53,7 +54,8 @@ pub fn loadenv() -> Result> { } spath }, - instanceurl: get_var("INSTANCE_URL")? + instanceurl: get_var("INSTANCE_URL")?, + uploadspath: get_var("UPLOADS_PATH")? } ) }