Skip to content

Django-based web application for managing ProFTPD users and folder access permissions

Notifications You must be signed in to change notification settings

arheops/proftpdcontrol

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ProFTPD Control Panel

Disclaimer: This project was generated by Claude Code, an AI-powered coding assistant by Anthropic. Model used: Claude Opus 4.5 (claude-opus-4-5-20251101).

A Django-based web application for managing ProFTPD users and folder access permissions. Designed for use with OpenMediaVault servers with ZFS storage.

Features

  • User Management: Create, edit, and delete FTP users with password hashing
  • Folder Management: Define folders with paths and descriptions
  • Access Control: Assign read-only or read/write permissions per user per folder
  • Config Generation: Automatically generates proftpd.conf and ftpd.passwd files
  • Web Interface: Clean Bootstrap 5 UI with dashboard overview

Requirements

  • Python 3.8+
  • Django 4.2+

Installation

cd d:\work\proftpdcontrol
pip install -r requirements.txt
python manage.py migrate
python manage.py runserver

Open http://127.0.0.1:8000 in your browser.

Usage

  1. Add Folders: Navigate to Folders → Add Folder. Enter your ZFS paths (e.g., /pool/documents)
  2. Create Users: Navigate to Users → Add User. Set username and password
  3. Assign Permissions: Click the key icon next to a user to manage folder access
  4. Generate Config: Go to "Generate Config" to preview and download configuration files
  5. Deploy: Copy proftpd.conf and ftpd.passwd to your server and restart ProFTPD

Data Models

FTPUser

Field Type Description
username CharField(100) Unique username for FTP login
password_hash CharField(255) MD5 password hash for ProFTPD
is_active BooleanField Whether the user can log in
created_at DateTimeField Auto-set on creation
updated_at DateTimeField Auto-updated on save

Folder

Field Type Description
name CharField(200) Display name for the folder
path CharField(500) Full filesystem path (unique)
description TextField Optional description
created_at DateTimeField Auto-set on creation

FolderAccess

Field Type Description
user ForeignKey(FTPUser) The FTP user
folder ForeignKey(Folder) The folder being accessed
permission CharField(10) Either read or write
created_at DateTimeField Auto-set on creation

Constraint: unique_together = ['user', 'folder']

Project Structure

proftpdcontrol/
├── manage.py                    # Django management script
├── requirements.txt             # Python dependencies
├── db.sqlite3                   # SQLite database
├── README.md                    # This file
│
├── proftpdcontrol/              # Django project configuration
│   ├── __init__.py
│   ├── settings.py              # Django settings
│   ├── urls.py                  # Root URL configuration
│   ├── asgi.py                  # ASGI config
│   └── wsgi.py                  # WSGI config
│
└── ftpmanager/                  # Main application
    ├── __init__.py
    ├── admin.py                 # Django admin (unused)
    ├── apps.py                  # App configuration
    ├── models.py                # Database models (FTPUser, Folder, FolderAccess)
    ├── views.py                 # View functions (CRUD + config generation)
    ├── forms.py                 # Django forms for user input
    ├── urls.py                  # App URL routing
    ├── config_generator.py      # ProFTPD config file generator
    ├── tests.py                 # Tests (placeholder)
    │
    ├── migrations/              # Database migrations
    │   ├── __init__.py
    │   └── 0001_initial.py      # Initial migration
    │
    ├── templates/ftpmanager/    # HTML templates
    │   ├── base.html            # Base template with sidebar
    │   ├── dashboard.html       # Dashboard overview
    │   ├── user_list.html       # List all users
    │   ├── user_form.html       # Create/edit user form
    │   ├── user_confirm_delete.html
    │   ├── user_access.html     # Manage user's folder permissions
    │   ├── folder_list.html     # List all folders
    │   ├── folder_form.html     # Create/edit folder form
    │   ├── folder_confirm_delete.html
    │   └── generate_config.html # Config preview and download
    │
    └── templatetags/            # Custom template tags
        ├── __init__.py
        └── ftpmanager_tags.py   # Dictionary lookup filter

Generated Configuration Files

proftpd.conf

Contains:

  • Server settings (port 21, standalone mode)
  • Virtual user authentication via ftpd.passwd
  • Directory-level access rules based on user permissions
  • Logging configuration

ftpd.passwd

Format: username:password_hash:uid:gid:gecos:homedir:shell

Contains all active FTP users with their hashed passwords.

Deployment

Using Django Command (Recommended)

cd /opt/proftpdcontrol
source venv/bin/activate

# Preview changes
python manage.py deploy_config --dry-run

# Deploy and restart ProFTPD
sudo python manage.py deploy_config --test --restart

Options:

  • --config-dir - ProFTPD config directory (default: /etc/proftpd)
  • --config-file - Config file path (default: conf.d/users.conf)
  • --passwd-file - Password file path (default: ftpd.passwd)
  • --test - Test configuration after deploy
  • --restart - Restart ProFTPD after deploy
  • --dry-run - Preview without making changes

Manual Deployment

  1. Download both config files from the web interface
  2. Copy to your server:
    scp proftpd.conf root@server:/etc/proftpd/conf.d/users.conf
    scp ftpd.passwd root@server:/etc/proftpd/ftpd.passwd
  3. Set permissions:
    chmod 600 /etc/proftpd/ftpd.passwd
    chown root:root /etc/proftpd/ftpd.passwd
  4. Test and restart:
    proftpd -t
    systemctl restart proftpd

License

This project is provided as-is for personal use.

About

Django-based web application for managing ProFTPD users and folder access permissions

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •