Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jtdowney/auth_lite
Simple authentication server
https://github.com/jtdowney/auth_lite
Last synced: about 2 months ago
JSON representation
Simple authentication server
- Host: GitHub
- URL: https://github.com/jtdowney/auth_lite
- Owner: jtdowney
- License: mit
- Created: 2023-10-11T02:29:49.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-10-13T14:38:00.000Z (over 1 year ago)
- Last Synced: 2024-11-16T13:38:07.898Z (2 months ago)
- Language: Rust
- Size: 31.3 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# auth_lite
`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.
## Installation
1. Clone the repository:
```bash
git clone https://github.com/jtdowney/auth_lite.git
cd auth_lite
```2. Build the project:
```bash
cargo build --release
```3. The compiled binary will be available in the `target/release` directory.
## Setup
1. Add a user:
```bash
./auth_lite add-user USERNAME
```> This will prompt you for a password. Passwords are hashed and stored securely.
2. Setup nginx:
In your nginx configuration, incorporate the `auth_request` directive:
```nginx
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.
3. Start the `auth_lite` server:
```bash
./auth_lite serve --port YOUR_AUTH_LITE_PORT
```## Usage
To manage users in the `auth_lite` SQLite database:
- Add a user:
```bash
./auth_lite add-user USERNAME
```- List all users:
```bash
./auth_lite list-users
```- Remove a user:
```bash
./auth_lite remove-user USERNAME
```- Change a user's password:
```bash
./auth_lite change-password USERNAME
```## Contributing
Contributions are warmly welcomed! Whether it's bug reports, feature requests, or code contributions, please [open an issue](https://github.com/jtdowney/auth_lite/issues) or a pull request.
## License
`auth_lite` is licensed under the [MIT License](LICENSE).