-
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,10 @@ pub struct Config { | |
pub tls: bool, | ||
pub cert: String, | ||
pub key: String, | ||
|
||
pub pass: bool, | ||
pub hash: String, | ||
pub secret: String, | ||
} | ||
|
||
pub fn config() -> Config { | ||
|
@@ -32,7 +36,6 @@ pub fn config() -> Config { | |
let port: u16 = cfg.get("port").unwrap_or(&Toml::Num(8088.0)).num() as u16; | ||
|
||
let tls = cfg.get("tls").unwrap_or(&Toml::Bool(false)); | ||
|
||
let cert = cfg | ||
.get("cert") | ||
.unwrap_or(&Toml::Str(String::new())) | ||
|
@@ -44,10 +47,25 @@ pub fn config() -> Config { | |
.str() | ||
.to_string(); | ||
|
||
let pass = cfg.get("pass").unwrap_or(&Toml::Bool(false)); | ||
let hash = cfg | ||
.get("hash") | ||
.unwrap_or(&Toml::Str(String::new())) | ||
.str() | ||
.to_string(); | ||
let secret = cfg | ||
.get("secret") | ||
.unwrap_or(&Toml::Str(String::new())) | ||
.str() | ||
.to_string(); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
ravenclaw900
Author
Owner
|
||
|
||
Config { | ||
port, | ||
tls: tls == &Toml::Bool(true), | ||
cert, | ||
key, | ||
pass: pass == &Toml::Bool(true), | ||
hash, | ||
secret, | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,8 @@ | |
|
||
<head> | ||
<meta charset="UTF-8" /> | ||
<!--<meta http-equiv="Content-Security-Policy" | ||
content="default-src 'self'; font-src 'self'; img-src 'self'; script-src 'self'; style-src 'unsafe-inline' 'self';" />--> | ||
This comment has been minimized.
Sorry, something went wrong.
MichaIng
Collaborator
|
||
<link rel="icon" href="/favicon.png" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>DietPi Dashboard</title> | ||
|
@ravenclaw900
Little suggestion: What about only loading
hash
andsecret
ifpass
is actually true? I guess it doesn't make any measurable difference, but just my perfectionism to not load something which definitely won't be required with known condition.