fix: HOME is already an env var, so stop using it
This commit is contained in:
parent
36832f0875
commit
f193bb5ee9
2 changed files with 4 additions and 3 deletions
|
@ -62,7 +62,7 @@
|
||||||
# secret options are in the env file loaded separately
|
# secret options are in the env file loaded separately
|
||||||
environment_config = {
|
environment_config = {
|
||||||
# basic server stuff
|
# basic server stuff
|
||||||
HOME = cfg.home;
|
DATABASE_HOME = cfg.home;
|
||||||
DATABASE = "database.db";
|
DATABASE = "database.db";
|
||||||
HOST_PORT = cfg.host_port;
|
HOST_PORT = cfg.host_port;
|
||||||
SSH_ROOT = "skynet_old";
|
SSH_ROOT = "skynet_old";
|
||||||
|
|
|
@ -60,8 +60,9 @@ pub struct Accounts {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn db_init(config: &Config) -> Result<Pool<Sqlite>, Error> {
|
pub async fn db_init(config: &Config) -> Result<Pool<Sqlite>, Error> {
|
||||||
|
dbg!(config);
|
||||||
let database = format!("{}/{}", &config.home, &config.database);
|
let database = format!("{}/{}", &config.home, &config.database);
|
||||||
|
dbg!(&database);
|
||||||
let pool = SqlitePoolOptions::new()
|
let pool = SqlitePoolOptions::new()
|
||||||
.max_connections(5)
|
.max_connections(5)
|
||||||
.connect_with(
|
.connect_with(
|
||||||
|
@ -146,7 +147,7 @@ pub fn get_config() -> Config {
|
||||||
if let Ok(x) = env::var("LDAP_ADMIN_PW") {
|
if let Ok(x) = env::var("LDAP_ADMIN_PW") {
|
||||||
config.ldap_admin_pw = x.trim().to_string();
|
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();
|
config.home = x.trim().to_string();
|
||||||
}
|
}
|
||||||
if let Ok(x) = env::var("DATABASE") {
|
if let Ok(x) = env::var("DATABASE") {
|
||||||
|
|
Loading…
Add table
Reference in a new issue