Compare commits
No commits in common. "381b8b04b75d7b610a1dfd9b684467fc49128ca6" and "c6e1f80b472a51d7dc50e88c997674a7702e0d67" have entirely different histories.
381b8b04b7
...
c6e1f80b47
|
@ -1,9 +1,4 @@
|
||||||
APP_LOGGING=true
|
APP_LOGGING=true
|
||||||
APP_HOST=0.0.0.0:80
|
APP_HOST=0.0.0.0:80
|
||||||
|
|
||||||
REDIS_PASS=bfile
|
REDIS_PASS=bfile
|
||||||
REDIS_HOST=redis
|
|
||||||
REDIS_PORT=6379
|
|
||||||
REDIS_PREFIX=bfile-
|
|
||||||
|
|
||||||
USERCONTENT_DIR=/opt/user_uploads
|
|
|
@ -8,4 +8,4 @@ To get started with this, copy either `Dockerfile.dev` or `Dockerfile.prod` to `
|
||||||
Then either build it manually or start it up using the `docker-compose.yml` file, which is provided in the top level directory.
|
Then either build it manually or start it up using the `docker-compose.yml` file, which is provided in the top level directory.
|
||||||
|
|
||||||
## Deploying notes
|
## Deploying notes
|
||||||
Files will be saved in `/opt/user_uploads` (as defined in `.env`). Mount that directory into a volume or host directory to easily back up the data.
|
Files will be saved in `/opt/useruploads`. Mount that directory into a volume or host directory to easily back up the data.
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
This file provides the `loadenv` function that will do just that.
|
This file provides the `loadenv` function that will do just that.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use std::{env::var, net::SocketAddr, path::Path, fs};
|
use std::{env::var, net::SocketAddr, path::Path};
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
pub struct Redis {
|
pub struct Redis {
|
||||||
|
@ -45,10 +45,7 @@ pub fn loadenv() -> Result<Env, Box<dyn std::error::Error>> {
|
||||||
let spath: String = get_var("USERCONTENT_DIR")?;
|
let spath: String = get_var("USERCONTENT_DIR")?;
|
||||||
let path = Path::new(&spath);
|
let path = Path::new(&spath);
|
||||||
if ! path.exists() {
|
if ! path.exists() {
|
||||||
fs::create_dir_all(path)?;
|
return Err(format!("USERCONTENT_DIR is set to \"{}\", which does not exist!", &spath).into())
|
||||||
}
|
|
||||||
if ! path.is_dir() {
|
|
||||||
return Err(format!("USERCONTENT_DIR is set to \"{}\", which exists but is not a directory!", &spath).into())
|
|
||||||
}
|
}
|
||||||
spath
|
spath
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue