feat: close registration with ROCKET_REGISTRATION_DISABLED=true

This commit is contained in:
timokoesters 2020-06-06 19:02:31 +02:00
parent c85d363d71
commit 0067f49d52
No known key found for this signature in database
GPG key ID: 24DA7517711A2BA4
3 changed files with 27 additions and 13 deletions

View file

@ -7,6 +7,7 @@ pub(self) mod uiaa;
pub(self) mod users;
use directories::ProjectDirs;
use log::info;
use std::fs::remove_dir_all;
use rocket::Config;
@ -49,13 +50,10 @@ impl Database {
});
let db = sled::open(&path).unwrap();
log::info!("Opened sled database at {}", path);
info!("Opened sled database at {}", path);
Self {
globals: globals::Globals::load(
db.open_tree("global").unwrap(),
server_name.to_owned(),
),
globals: globals::Globals::load(db.open_tree("global").unwrap(), config),
users: users::Users {
userid_password: db.open_tree("userid_password").unwrap(),
userid_displayname: db.open_tree("userid_displayname").unwrap(),