Crates.io | auth_lite |
lib.rs | auth_lite |
version | 0.1.1 |
source | src |
created_at | 2023-10-13 14:05:15.326165 |
updated_at | 2023-10-13 14:24:31.906599 |
description | A simple authentication server |
homepage | https://github.com/jtdowney/auth_lite |
repository | https://github.com/jtdowney/auth_lite |
max_upload_size | |
id | 1002332 |
size | 84,799 |
auth_lite
is a lightweight authentication server tailored for web servers that utilize features like the nginx auth_request
module. Instead of relying on traditional .htpasswd
files, auth_lite
employs a nimble SQLite database, making the management of credentials more efficient and seamless.
Clone the repository:
git clone https://github.com/jtdowney/auth_lite.git
cd auth_lite
Build the project:
cargo build --release
The compiled binary will be available in the target/release
directory.
Add a user:
./auth_lite add-user USERNAME
This will prompt you for a password. Passwords are hashed and stored securely.
Setup nginx:
In your nginx configuration, incorporate the auth_request
directive:
location /protected/ {
auth_request /_auth;
...
}
location = /_auth {
internal;
proxy_pass http://127.0.0.1:YOUR_AUTH_LITE_PORT/auth;
}
Make sure to replace YOUR_AUTH_LITE_PORT
with the port auth_lite
is listening on.
Start the auth_lite
server:
./auth_lite serve --port YOUR_AUTH_LITE_PORT
To manage users in the auth_lite
SQLite database:
Add a user:
./auth_lite add-user USERNAME
List all users:
./auth_lite list-users
Remove a user:
./auth_lite remove-user USERNAME
Change a user's password:
./auth_lite change-password USERNAME
Contributions are warmly welcomed! Whether it's bug reports, feature requests, or code contributions, please open an issue or a pull request.
auth_lite
is licensed under the MIT License.