Compare commits

...

3 commits

Author SHA1 Message Date
3cb7293c36
increase bundling limit 2024-06-01 23:32:18 +02:00
963f04a88b
correct config file in readme 2024-06-01 23:06:41 +02:00
a2fd79d8ca
remove server_errors counter; set log level to error 2024-06-01 23:01:02 +02:00
4 changed files with 21 additions and 19 deletions

View file

@ -11,8 +11,8 @@ can correlate user information across services.
1. build binary with `cargo`
2. fill out `config.toml.sample`. The server expects a file called
`config.toml` in its working directory.
2. fill out `config.yml.sample`. The server expects a file called
`config.yml` in its working directory.
3. Generate the keypair for signing JWT tokens with:
```bash

View file

@ -1,13 +0,0 @@
host = "0.0.0.0"
port = 8000
issuer_uri = "http://localhost:8000/"
issuer_name = "My Issuer"
salt = "SOMETHING SOMETHING"
rsa_key_file = "rsa-key.pk8"
[clients]
[clients.a1]
name = "a1.example.com"
client_secret = "SECRET"
redirect_uris = ["https://a1.example.com/cb"]

17
config.yml.sample Normal file
View file

@ -0,0 +1,17 @@
host: "0.0.0.0"
port: 8000
issuer_uri: "https://anon.my-org.invalid"
issuer_name: "My Org"
salt: "longhexstringdeadbeefsomething"
rsa_key_file: "rsa-key.pk8"
clients:
service1:
name: "Service 1"
client_secret: "abcd"
redirect_uris: ["https://service1/redirect"]
service2:
name: "Service 2"
client_secret: "2222"
redirect_uris: ["http://service2/redirect"]

View file

@ -518,7 +518,6 @@ pub struct AppStateRaw {
pub total_logins: AtomicUsize,
pub successful_logins: AtomicUsize,
pub expired_logins: AtomicUsize,
pub server_errors: AtomicUsize,
}
type AppState = Arc<AppStateRaw>;
@ -539,7 +538,7 @@ pub struct Authorization {
#[async_std::main]
async fn main() -> anyhow::Result<()> {
log::with_level(log::LevelFilter::Debug);
log::with_level(log::LevelFilter::Error);
let mut conf_file =
File::open(env::var("CONFIG_FILE").unwrap_or("config.yml".to_owned())).await?;
@ -559,7 +558,6 @@ async fn main() -> anyhow::Result<()> {
total_logins: AtomicUsize::new(0),
successful_logins: AtomicUsize::new(0),
expired_logins: AtomicUsize::new(0),
server_errors: AtomicUsize::new(0),
}));
app.with(tide::utils::After(error_handler));
@ -575,7 +573,7 @@ async fn main() -> anyhow::Result<()> {
app.at("/new-account").get(create_account_endpoint);
app.at("/metrics").get(metrics_endpoint);
auto_serve_dir!(app, "/static", "static");
auto_serve_dir!(app, "/static", "static", 51200);
println!("Server started at {}", &bind_address);