Giter Site home page Giter Site logo

crystalnet-org / pure-ftpd-paperless-dbauth Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 14.56 MB

a small go programm to plug into pureftpd's authd programm that verifies users against a paperless-ngx mariadb or postgresql database

License: MIT License

Shell 34.40% Go 64.83% TypeScript 0.76%
authentication mariadb paperless paperless-ng paperless-ngx postgresql pure-ftpd pureftpd

pure-ftpd-paperless-dbauth's Introduction

Pure-FTPd Authd Database Authenticator

status-badge GitHub release (with filter)

This small Go program is designed to be plugged into Pure-FTPd's authd program, providing authentication against a Paperless-NGX MariaDB or PostgreSQL database.

Prerequisites

  • Go installed on your machine
  • Pure-FTPd with authd support
  • MariaDB or PostgreSQL database configured for Paperless-NGX

Features

  • Authenticate users against a Paperless-NGX database
  • Support for both MariaDB and PostgreSQL databases
  • Automatic dependency resolution using Go Modules

Getting Started

Installation

  1. Clone the repository:

    git clone https://github.com/psych0d0g/pure-ftpd-paperless-dbauth.git
  2. Change into the project directory:

    cd pure-ftpd-paperless-dbauth
  3. Run the build script to compile the binary:

    ./build.sh

Configuration

  1. Set up environment variables:

    export PAPERLESS_DBHOST="your_database_host"
    export PAPERLESS_DBPORT="your_database_port"
    export PAPERLESS_DBNAME="your_database_name"
    export DB_USER="your_database_user"
    export PAPERLESS_DBPASS="your_database_password"
    export PAPERLESS_DBENGINE="postgres"  # or "mysql" for MariaDB
    export PAPERLESS_CONSUMPTION_DIR="your_paperless_consumption_dir"
  2. Set up authd configuration to use the compiled binary.

Test

Run the compiled binary to authenticate users against the Paperless-NGX database.

AUTHD_ACCOUNT=username AUTHD_PASSWORD=password ./verify_pw

authd configuration

please refer to pure-ftpd documentation on how to integrate it with authd: https://github.com/jedisct1/pure-ftpd/blob/master/README.Authentication-Modules

Database Schema

Ensure your Paperless-NGX database has a table similar to the following:

CREATE TABLE auth_user (
    id SERIAL PRIMARY KEY,
    username VARCHAR(255) NOT NULL,
    password VARCHAR(255) NOT NULL,
    last_login TIMESTAMP,
    is_superuser BOOLEAN NOT NULL,
    first_name VARCHAR(30),
    last_name VARCHAR(30),
    email VARCHAR(255),
    is_staff BOOLEAN NOT NULL,
    is_active BOOLEAN NOT NULL,
    date_joined TIMESTAMP NOT NULL
);

Built With

- Go - The Go Programming Language
- github.com/go-sql-driver/mysql - MySQL driver for Go
- github.com/lib/pq - PostgreSQL driver for Go

Contributing

i am open to any improvement suggestions via issues or pull reqests

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

Acknowledgments

-  ChatGPT

pure-ftpd-paperless-dbauth's People

Contributors

dependabot[bot] avatar psych0d0g avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.