auth_lite

Crates.ioauth_lite
lib.rsauth_lite
version0.1.1
sourcesrc
created_at2023-10-13 14:05:15.326165
updated_at2023-10-13 14:24:31.906599
descriptionA simple authentication server
homepagehttps://github.com/jtdowney/auth_lite
repositoryhttps://github.com/jtdowney/auth_lite
max_upload_size
id1002332
size84,799
John Downey (jtdowney)

documentation

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:

    git clone https://github.com/jtdowney/auth_lite.git
    cd auth_lite
    
  2. Build the project:

    cargo build --release
    
  3. The compiled binary will be available in the target/release directory.

Setup

  1. Add a user:

    ./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:

    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:

    ./auth_lite serve --port YOUR_AUTH_LITE_PORT
    

Usage

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
    

Contributing

Contributions are warmly welcomed! Whether it's bug reports, feature requests, or code contributions, please open an issue or a pull request.

License

auth_lite is licensed under the MIT License.

Commit count: 12

cargo fmt