mirror of
https://gitea.dmz.rs/Decentrala/luser.git
synced 2026-09-20 04:10:32 +02:00
Compare commits
3 Commits
ad5cdde65e
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| fc84ded0c6 | |||
| dc50e422ba | |||
| 66f0ab50dd |
@@ -1,3 +1,69 @@
|
|||||||
# Flask LDAP user management
|
# LUSER
|
||||||
|
|
||||||
Web app that allows users to add,remove and change passwords in LDAP system
|
A lightweight user management system for LDAP, implemented using Flask. This application provides a web interface for users to register, change passwords, and unregister themselves from an LDAP directory.
|
||||||
|
|
||||||
|
## Features
|
||||||
|
|
||||||
|
- **User Registration**: New users can create an account with a captcha to prevent automated registrations.
|
||||||
|
- **Password Management**: Users can change their LDAP passwords securely.
|
||||||
|
- **User Unregistration**: Users can remove themselves from the LDAP system.
|
||||||
|
- **Captcha Protection**: Uses a custom captcha mechanism to mitigate bot registrations.
|
||||||
|
- **LDAP Integration**: Directly interacts with LDAP for all credential and user management tasks.
|
||||||
|
|
||||||
|
## Prerequisites
|
||||||
|
|
||||||
|
- Python 3.x
|
||||||
|
- LDAP Server
|
||||||
|
- `passlib` for secure password hashing
|
||||||
|
- `Flask` for the web framework
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
1. **Clone the repository**:
|
||||||
|
```bash
|
||||||
|
git clone <repository-url>
|
||||||
|
cd luser
|
||||||
|
```
|
||||||
|
|
||||||
|
2. **Install dependencies**:
|
||||||
|
```bash
|
||||||
|
pip install -r requirements.txt
|
||||||
|
```
|
||||||
|
|
||||||
|
3. **Configure the application**:
|
||||||
|
Edit the `config.ini` file to provide your LDAP server details and paths:
|
||||||
|
- `LDAPHOST`: Address of your LDAP server.
|
||||||
|
- `LDAPADMINNAME`: Admin username for LDAP operations.
|
||||||
|
- `LDAPPASS`: Admin password for LDAP operations.
|
||||||
|
- `USERBASE`: The base DN for users.
|
||||||
|
- `CAPTCHA_PATH`: Path where captcha images are stored.
|
||||||
|
|
||||||
|
4. **Setup Captcha script**:
|
||||||
|
Ensure the `captcha.sh` script is available in `/usr/local/bin/` and is executable.
|
||||||
|
|
||||||
|
## Running the Application
|
||||||
|
|
||||||
|
You can run the application using the provided `run.py` script:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
python run.py
|
||||||
|
```
|
||||||
|
|
||||||
|
The application will be available at `http://localhost:5000` (or the port specified in your configuration).
|
||||||
|
|
||||||
|
## Project Structure
|
||||||
|
|
||||||
|
- `luser/`: Main application package.
|
||||||
|
- `routes.py`: Defines the web endpoints and business logic.
|
||||||
|
- `models.py`: Handles LDAP interactions.
|
||||||
|
- `templates/`: HTML templates for the web interface.
|
||||||
|
- `static/`: Static files (CSS, etc.).
|
||||||
|
- `build-deb/`: Contains instructions and files for building a Debian package.
|
||||||
|
- `run.py`: Entry point for the Flask application.
|
||||||
|
- `config.ini`: Configuration file for LDAP and system settings.
|
||||||
|
|
||||||
|
## Security Considerations
|
||||||
|
|
||||||
|
- This application uses `ldap_salted_sha1` for password hashing.
|
||||||
|
- Ensure the LDAP connection is secured (e.g., via LDAPS) in production environments.
|
||||||
|
- The captcha mechanism is implemented to prevent automated registration attempts.
|
||||||
|
|||||||
@@ -8,4 +8,4 @@ Depends: python3-flask, python3-ldap3, gunicorn, imagemagick, python3-passlib
|
|||||||
Homepage: https://gitea.dmz.rs/fram3d/luser
|
Homepage: https://gitea.dmz.rs/fram3d/luser
|
||||||
Maintainer: fram3d <fram3d@dmz.rs>
|
Maintainer: fram3d <fram3d@dmz.rs>
|
||||||
Description: Web app that allows users to add,remove and change passwords in LDAP system
|
Description: Web app that allows users to add,remove and change passwords in LDAP system
|
||||||
Version: 1.3.0
|
Version: 1.4.1
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<link rel="shortcut icon" href="/img/favicon.ico" type="image/x-icon">
|
<link rel="shortcut icon" href="/img/favicon.ico" type="image/x-icon">
|
||||||
<link rel="stylesheet" href="styles/main.css">
|
<link rel="stylesheet" href="/account/static/styles/main.css">
|
||||||
<title>User password change in LDAP system</title>
|
<title>User password change in LDAP system</title>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<link rel="shortcut icon" href="/img/favicon.ico" type="image/x-icon">
|
<link rel="shortcut icon" href="/img/favicon.ico" type="image/x-icon">
|
||||||
<link rel="stylesheet" href="styles/main.css">
|
<link rel="stylesheet" href="/account/static/styles/main.css">
|
||||||
<title>User registration to LDAP system</title>
|
<title>User registration to LDAP system</title>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<link rel="shortcut icon" href="/img/favicon.ico" type="image/x-icon">
|
<link rel="shortcut icon" href="/img/favicon.ico" type="image/x-icon">
|
||||||
<link rel="stylesheet" href="styles/main.css">
|
<link rel="stylesheet" href="/account/static/styles/main.css">
|
||||||
<title>User unregistration to LDAP system</title>
|
<title>User unregistration to LDAP system</title>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user