Sign inSign up

dcgsteve/pman-server

By dcgsteve

โ€ขUpdated about 1 year ago

Server component for pman password utility

Image
0

1.2K

dcgsteve/pman-server repository overview

โ PMAN - Multi-OS Password Manager

A secure, multi-OS compatible password manager designed for teams with advanced automation support and enterprise-grade security features.

Go Version License Platform

โ ๐Ÿš€ Features

โ Core Functionality
  • ๐Ÿ” Secure Password Storage - AES encryption with environment-specific keys
  • ๐Ÿ‘ฅ Multi-User Support - Team-based access with role-based permissions
  • ๐ŸŒ Cross-Platform - Native binaries for Linux, macOS, Windows, FreeBSD
  • ๐Ÿ”— API-First Design - RESTful backend with JWT authentication
  • ๐ŸŽฏ Automation Friendly - Pipe support and scriptable commands
โ CLI Commands
  • Authentication: login, logout, passwd
  • Password Management: add, get, edit, rm, ls, info
  • Group Management: setgroup with priority resolution
  • Admin Functions: useradd, userdel, userlist, userupdate, userenable, userdisable
โ Advanced Features
  • ๐Ÿท๏ธ Beautiful Tree Display - Groups ๐Ÿท๏ธ, folders ๐Ÿ“, and passwords ๐Ÿ”‘
  • ๐Ÿ”’ Token Blacklisting - Immediate revocation on user disable
  • ๐Ÿงน Automatic Cleanup - Empty folders disappear automatically
  • โšก High Performance - SQLite backend with optimized queries
  • ๐Ÿ›ก๏ธ Enterprise Security - Token tracking, audit trails, secure hashing

โ ๐Ÿ“ฆ Quick Start

โ Installation

Download pre-built binaries from releasesโ  or build from source:

git clone https://github.com/dcgsteve/pman.git
cd pman
./build-binaries.sh
โ Server Setup
# Build Docker image locally
./build-docker-server.sh

# Or build and push to Docker Hub
./build-docker-server.sh /p

# Run with docker-compose
export PMAN_ENCRYPTION_KEY="your-32-character-encryption-key"
export PMAN_DOMAIN_NAME="your-server.example.com"
export PMAN_UID=$(id -u)  # Optional: match host user for volume permissions
export PMAN_GID=$(id -g)  # Optional: match host group for volume permissions
docker-compose up -d

Note: Pre-built server images are available on Docker Hub: dcgsteve/pman-serverโ 

โ Client Usage
# First login (interactive - prompts for server, email, password)
pman login

# First login (non-interactive with parameters)
pman login -s https://your-server.com -u [email protected] -p DefaultPassword

# Login with custom token expiry
pman login -expire 10  # Token valid for 10 days

# Change default password
pman passwd

# Set default group
pman setgroup team1

# Add passwords
pman add project1/database/password
echo "secret123" | pman add project1/api/key

# List passwords (beautiful tree view)
pman ls

# Get password for automation
DB_PASS=$(pman get project1/database/password)

โ ๐Ÿ—๏ธ Architecture

flowchart LR
    Client["๐Ÿ–ฅ๏ธ CLI Client<br/>Go Binary"]
    API["๐Ÿš€ Backend API<br/>Docker/Binary"]
    Config["โš™๏ธ Config<br/>Encrypted JWT"]
    Database["๐Ÿ—„๏ธ Database<br/>SQLite + AES"]

    Client <--> |"๐Ÿ”’ HTTPS + JWT"| API
    Client --> |"๐Ÿ” Local Encryption"| Config
    API --> |"๐Ÿ” AES-256"| Database

    classDef client fill:#2196F3,stroke:#1976D2,stroke-width:2px,color:#fff
    classDef server fill:#4CAF50,stroke:#388E3C,stroke-width:2px,color:#fff
    classDef storage fill:#FF9800,stroke:#F57C00,stroke-width:2px,color:#fff
    
    class Client client
    class API server
    class Config,Database storage
โ Security Architecture
  • ๐Ÿ”’ End-to-End Security - Data encrypted in transit (HTTPS) and at rest (AES-256)
  • ๐ŸŽซ JWT Authentication - Stateless tokens with configurable expiration
  • ๐Ÿ”‘ Dual Encryption - Separate client and server encryption keys
  • ๐Ÿšซ Token Blacklisting - Immediate revocation on user disable
  • ๐Ÿ‘ฅ RBAC - Role-based access control with group permissions
โ Docker Features
  • ๐Ÿณ Containerized Backend - Production-ready Docker deployment
  • ๐Ÿ”ง Configurable User Permissions - Runtime UID/GID adjustment via environment variables
  • ๐Ÿ“ Volume Mounting - Persistent data storage with proper permissions
  • ๐Ÿฅ Health Checks - Built-in container health monitoring

โ ๐Ÿ”ง Development

โ Build System
# Docker build (local only)
./build-docker-server.sh

# Docker build and push to registry
./build-docker-server.sh /p
โ Build Targets
  • linux/amd64, linux/arm64
  • darwin/amd64, darwin/arm64 (macOS)
  • windows/amd64, windows/arm64
  • freebsd/amd64

โ ๐Ÿ“š Documentation

โ ๐Ÿ”’ Security

PMAN implements enterprise-grade security:

  • ๐Ÿ” AES-256 Encryption - All passwords encrypted at rest
  • ๐ŸŽซ JWT Authentication - Secure token-based auth with expiration
  • ๐Ÿšซ Token Blacklisting - Immediate revocation on user disable
  • ๐Ÿ”‘ Machine-Specific Keys - Client configs encrypted per machine
  • ๐Ÿ‘ฅ Role-Based Access - Admin/user roles with group permissions
  • ๐Ÿ“Š Audit Trails - Creation/modification tracking per password

โ ๐ŸŽฏ Use Cases

โ Development Teams
# Team lead sets up shared credentials
pman add staging/database/password
pman add prod/api/keys/stripe

# Developers access as needed
export DB_PASS=$(pman get staging/database/password)
โ DevOps Automation
# CI/CD pipeline integration
DEPLOY_KEY=$(pman get deploy/ssh/production)
ssh -i <(echo "$DEPLOY_KEY") deploy@server
โ Enterprise Environment
# Admin manages users
pman useradd "[email protected]" "user" "dev-team:rw,staging:ro"
pman userdisable "[email protected]"  # Revokes all tokens immediately

โ ๐Ÿค Contributing

  1. Fork the repository
  2. Create feature branch (git checkout -b feature/amazing-feature)
  3. Commit changes (git commit -m 'Add amazing feature')
  4. Push to branch (git push origin feature/amazing-feature)
  5. Open Pull Request

โ ๐Ÿ“„ License

This project is licensed under the Creative Commons Attribution-NoDerivatives 4.0 International License - see the LICENSEโ  file for details.

What this means:

  • โœ… Free to use - Individual and enterprise use without cost
  • โœ… Free to distribute - Share the original software freely
  • โœ… Attribution required - Credit the original creator
  • โŒ No modifications - Use as-is, no code changes allowed, please branch and then raise pull request with changes

โ ๐Ÿ™ Acknowledgments

  • Built with Go for performance and cross-platform compatibility
  • SQLite for reliable local storage
  • JWT for secure authentication
  • Inspired by the need for simple automation-friendly password management

PMAN - Making password management simple, secure, and scriptable for teams. ๐Ÿ”

Tag summary

Content type

Image

Digest

sha256:771202be5โ€ฆ

Size

8.4 MB

Last updated

about 1 year ago

docker pull dcgsteve/pman-server