Compare commits

..

No commits in common. "381b8b04b75d7b610a1dfd9b684467fc49128ca6" and "c6e1f80b472a51d7dc50e88c997674a7702e0d67" have entirely different histories.

3 changed files with 4 additions and 12 deletions

View File

@ -1,9 +1,4 @@
APP_LOGGING=true
APP_HOST=0.0.0.0:80
REDIS_PASS=bfile
REDIS_HOST=redis
REDIS_PORT=6379
REDIS_PREFIX=bfile-
USERCONTENT_DIR=/opt/user_uploads
REDIS_PASS=bfile

View File

@ -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.
## 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.

View File

@ -3,7 +3,7 @@
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)]
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 path = Path::new(&spath);
if ! path.exists() {
fs::create_dir_all(path)?;
}
if ! path.is_dir() {
return Err(format!("USERCONTENT_DIR is set to \"{}\", which exists but is not a directory!", &spath).into())
return Err(format!("USERCONTENT_DIR is set to \"{}\", which does not exist!", &spath).into())
}
spath
}