From fa31485e44680de0213553a2fc417eb57b290990 Mon Sep 17 00:00:00 2001 From: Matthieu Bessat Date: Fri, 15 Nov 2024 18:34:17 +0100 Subject: [PATCH] fix: rename project to minauthator --- README.md | 25 +++++++++++++++++++++---- justfile | 12 ++++++------ src/cli.rs | 4 ++-- src/main.rs | 6 +++--- src/models/config.rs | 3 +-- src/models/token_claims.rs | 2 +- src/templates/pages/home.html | 4 ++-- 7 files changed, 36 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 56d36a8..431f119 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,31 @@ # Minauthator -Auth provider supporting [OAuth2](https://datatracker.ietf.org/doc/html/rfc6749). +Minauthator is an identity provider supporting [OpenID Connect (OIDC)](https://en.wikipedia.org/wiki/OpenID_Connect). + +This project aims to allow an organization to setup [single sign-on (SSO)](https://en.wikipedia.org/wiki/Single_sign-on) using a self-hosted free software. + +**Project status: *early development, work-in-progress*** ## Features -- [x] register -- [x] login -- [ ] authorize +- Login +- Register +- OpenID Connect & OAuth 2.0 +- Activation token +- Profile details +- Static apps +- User roles +- MFA/TOTP +- Email notifications +- Login page customization +- App carousel (App presentation to users) ## Deps - +## Alternatives + +- [Authentik](https://goauthentik.io/) +- [Keycloak](https://www.keycloak.org/) + diff --git a/justfile b/justfile index 86a77e0..4f04243 100644 --- a/justfile +++ b/justfile @@ -2,20 +2,20 @@ export RUST_BACKTRACE := "1" export RUST_LOG := "trace" watch-run: - cargo-watch -x 'run -- --config ./config.toml --database ./tmp/dbs/minauth.db --static-assets ./assets' + cargo-watch -x 'run -- --config ./config.toml --database ./tmp/dbs/minauthator.db --static-assets ./assets' run: - cargo run -- --database ./tmp/dbs/minauth.db --config ./config.toml --static-assets ./assets + cargo run -- --database ./tmp/dbs/minauthator.db --config ./config.toml --static-assets ./assets docker-run: - docker run -p 3085:8080 -v ./tmp/docker/config:/etc/minauth -v ./tmp/docker/db:/var/lib/minauth minauth + docker run -p 3085:8080 -v ./tmp/docker/config:/etc/minauthator -v ./tmp/docker/db:/var/lib/minauthator minauthator docker-init-db: - docker run -v ./tmp/docker/config:/etc/minauth -v ./tmp/docker/db:/var/lib/minauth autotasker /usr/local/bin/minauth_init_db.sh + docker run -v ./tmp/docker/config:/etc/minauthator -v ./tmp/docker/db:/var/lib/minauthator minauthator /usr/local/bin/minauthator_init_db.sh docker-build: - docker build -t minauth . + docker build -t minauthator . init-db: - sqlite3 -echo tmp/dbs/minauth.db < migrations/all.sql + sqlite3 -echo tmp/dbs/minauthator.db < migrations/all.sql diff --git a/src/cli.rs b/src/cli.rs index 639d1b2..9317f31 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -5,9 +5,9 @@ use log::info; use crate::{get_app_context, server::{start_http_server, ServerConfig}, DEFAULT_ASSETS_PATH}; #[derive(Debug, FromArgs)] -/// Autotasker daemon +/// Minauthator daemon struct ServerCliFlags { - /// path to YAML config file to use to configure autotasker + /// path to YAML config file to use to configure this instance #[argh(option)] config: Option, diff --git a/src/main.rs b/src/main.rs index cd1836d..4d6aa4e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -17,9 +17,9 @@ use log::info; use sqlx::{Pool, Sqlite}; use models::config::{AppSecrets, Config}; -pub const DEFAULT_DB_PATH: &str = "/var/lib/autotasker/autotasker.db"; -pub const DEFAULT_ASSETS_PATH: &str = "/usr/local/lib/autotasker/assets"; -pub const DEFAULT_CONFIG_PATH: &str = "/etc/autotasker/config.yaml"; +pub const DEFAULT_DB_PATH: &str = "/var/lib/minauthator/minauthator.db"; +pub const DEFAULT_ASSETS_PATH: &str = "/usr/local/lib/minauthator/assets"; +pub const DEFAULT_CONFIG_PATH: &str = "/etc/minauthator/config.yaml"; fn get_config(path: String) -> Result { let inp_def_yaml = fs::read_to_string(path) diff --git a/src/models/config.rs b/src/models/config.rs index c76f54d..2c09da5 100644 --- a/src/models/config.rs +++ b/src/models/config.rs @@ -37,9 +37,8 @@ struct Role { #[derive(Debug, Clone, Serialize, Deserialize)] #[fully_pub] -/// Configuration of this minauthator instance +/// Configuration of this Minauthator instance struct Config { - /// configure current autotasker instance instance: InstanceConfig, applications: Vec, roles: Vec diff --git a/src/models/token_claims.rs b/src/models/token_claims.rs index 3855292..00cf029 100644 --- a/src/models/token_claims.rs +++ b/src/models/token_claims.rs @@ -21,7 +21,7 @@ impl UserTokenClaims { UserTokenClaims { sub: user_id.into(), exp: get_current_timestamp() + 86_000, - iss: "Minauth".into() + iss: "Minauthator".into() } } } diff --git a/src/templates/pages/home.html b/src/templates/pages/home.html index cffdcd4..1d10bf8 100644 --- a/src/templates/pages/home.html +++ b/src/templates/pages/home.html @@ -1,9 +1,9 @@ {% extends "layouts/base.html" %} {% block body %} -

Bienvenue sur Minauth

+

Bienvenue sur Minauthator

-Minauth is free software under GPLv3 licence. +Minauthator is free software under GPLv3 licence. You can find source code on a self-hosted forge repository.