diff --git a/config.example.toml b/config.example.toml index 8f9e714..7e20b53 100644 --- a/config.example.toml +++ b/config.example.toml @@ -13,8 +13,6 @@ append_path = "/" # where can your server be accessible? port = 8000 -# your realip header, if you're behind a reverse proxy -realip_header = "X-Real-IP" [accounts] # allow new accounts to be created diff --git a/readme.md b/readme.md index 1fc274d..caf9ac3 100644 --- a/readme.md +++ b/readme.md @@ -42,5 +42,4 @@ _these features are implemented_ - better way for checking if song is custom (currently `id > 50`) - sqlite would make sense for this - unscuff difficulties -- moderation utilities -- probably make more things bools in the database \ No newline at end of file +- moderation utilities \ No newline at end of file diff --git a/src/config.rs b/src/config.rs index 597d744..6333b20 100644 --- a/src/config.rs +++ b/src/config.rs @@ -13,8 +13,7 @@ pub struct Config { #[derive(Deserialize)] pub struct ConfigGeneral { pub append_path: String, - pub port: u16, - pub realip_header: String + pub port: u16 } #[derive(Deserialize)] diff --git a/src/main.rs b/src/main.rs index ab78110..ed8f513 100644 --- a/src/main.rs +++ b/src/main.rs @@ -26,6 +26,11 @@ use template_endpoints::*; mod config; use config::*; +#[get("/")] +fn index() -> String { + return String::from("gdps-server | https://git.reidlab.online/reidlab/gdps-server"); +} + #[get("/")] async fn files(file: PathBuf) -> Option { NamedFile::open(Path::new("public/").join(file)).await.ok() @@ -34,14 +39,11 @@ async fn files(file: PathBuf) -> Option { #[launch] fn rocket() -> _ { // this is a bit scuffed - fs::create_dir_all(&CONFIG.db.data_folder).expect("failed to create data directory!"); + fs::create_dir_all(&CONFIG.db.data_folder).expect("failed to create data directory! (probably a permission err)"); fs::create_dir_all(format!("{}/levels", &CONFIG.db.data_folder)).expect("failed to create data directory for levels"); rocket::build() - // conf - .configure(rocket::Config::figment() - .merge(("port", CONFIG.general.port)) - .merge(("ip_header", CONFIG.general.realip_header.as_str()))) + .configure(rocket::Config::figment().merge(("port", CONFIG.general.port))) // actual website .mount("/", routes![ template_endpoints::index::index