realip header
This commit is contained in:
parent
1d04c7ed59
commit
6f6f48d80b
4 changed files with 11 additions and 4 deletions
|
@ -13,6 +13,8 @@
|
|||
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
|
||||
|
|
|
@ -42,4 +42,5 @@ _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
|
||||
- moderation utilities
|
||||
- probably make more things bools in the database
|
|
@ -13,7 +13,8 @@ pub struct Config {
|
|||
#[derive(Deserialize)]
|
||||
pub struct ConfigGeneral {
|
||||
pub append_path: String,
|
||||
pub port: u16
|
||||
pub port: u16,
|
||||
pub realip_header: String
|
||||
}
|
||||
|
||||
#[derive(Deserialize)]
|
||||
|
|
|
@ -39,11 +39,14 @@ async fn files(file: PathBuf) -> Option<NamedFile> {
|
|||
#[launch]
|
||||
fn rocket() -> _ {
|
||||
// this is a bit scuffed
|
||||
fs::create_dir_all(&CONFIG.db.data_folder).expect("failed to create data directory! (probably a permission err)");
|
||||
fs::create_dir_all(&CONFIG.db.data_folder).expect("failed to create data directory!");
|
||||
fs::create_dir_all(format!("{}/levels", &CONFIG.db.data_folder)).expect("failed to create data directory for levels");
|
||||
|
||||
rocket::build()
|
||||
.configure(rocket::Config::figment().merge(("port", CONFIG.general.port)))
|
||||
// conf
|
||||
.configure(rocket::Config::figment()
|
||||
.merge(("port", CONFIG.general.port))
|
||||
.merge(("ip_header", CONFIG.general.realip_header.as_str())))
|
||||
// actual website
|
||||
.mount("/", routes![
|
||||
template_endpoints::index::index
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue