fix: HOME is already an env var, so stop using it

This commit is contained in:
silver 2025-03-11 00:01:59 +00:00
parent 36832f0875
commit f193bb5ee9
Signed by: silver
GPG key ID: 36F93D61BAD3FD7D
2 changed files with 4 additions and 3 deletions

View file

@ -62,7 +62,7 @@
# secret options are in the env file loaded separately
environment_config = {
# basic server stuff
HOME = cfg.home;
DATABASE_HOME = cfg.home;
DATABASE = "database.db";
HOST_PORT = cfg.host_port;
SSH_ROOT = "skynet_old";

View file

@ -60,8 +60,9 @@ pub struct Accounts {
}
pub async fn db_init(config: &Config) -> Result<Pool<Sqlite>, Error> {
dbg!(config);
let database = format!("{}/{}", &config.home, &config.database);
dbg!(&database);
let pool = SqlitePoolOptions::new()
.max_connections(5)
.connect_with(
@ -146,7 +147,7 @@ pub fn get_config() -> Config {
if let Ok(x) = env::var("LDAP_ADMIN_PW") {
config.ldap_admin_pw = x.trim().to_string();
}
if let Ok(x) = env::var("HOME") {
if let Ok(x) = env::var("DATABASE_HOME") {
config.home = x.trim().to_string();
}
if let Ok(x) = env::var("DATABASE") {