A simple web-based editor for YAML, Markdown, JSON, and text files with user authentication.
- Split-view layout (file list left, editor right)
- CodeMirror editor with syntax highlighting (Dracula theme)
- Supported file formats: YAML, Markdown, JSON, TXT
- Real-time linting for YAML and JSON with error markers
- Syntax validation before save (YAML and JSON)
- Markdown live preview with split view
- Markdown formatting toolbar (bold, italic, headings, lists, links, code, tables, etc.)
- Autosave for Markdown files (15 seconds after last change)
- Automatic file backups with configurable retention
- Keyboard shortcuts (Ctrl+S save, Ctrl+B bold, Ctrl+I italic)
- Password change functionality for all users
- User authentication with SQLite database
- CRUD operations for files and users
- Admin panel for user management
- User import/export functionality
- Docker support
# Clone the repository
git clone https://github.com/walleralexander/yamleditor.git
cd yamleditor
# Copy environment file and configure
cp .env.example .env
# Edit .env with your settings
# Start with Docker Compose
docker-compose up -dAccess the editor at http://localhost:8080
Requirements:
- PHP 8.0+
- SQLite3 extension
# Clone and enter directory
git clone https://github.com/walleralexander/yamleditor.git
cd yamleditor
# Copy environment file
cp .env.example .env
# Start PHP development server
php -S localhost:8080 -t publicCopy .env.example to .env and adjust the settings:
| Variable | Description | Default |
|---|---|---|
ADMIN_USERNAME |
Initial admin username | admin |
ADMIN_PASSWORD |
Initial admin password | changeme |
FILES_DIR |
Directory for editable files | data/files |
DB_PATH |
SQLite database path | database/users.db |
SESSION_LIFETIME |
Session timeout in seconds | 3600 |
PASSWORD_MIN_LENGTH |
Minimum password length | 8 |
MAX_BACKUPS |
Number of backups to keep per file | 15 |
Additional environment variables for Docker:
| Variable | Description | Default |
|---|---|---|
FILES_HOST_DIR |
Host directory to mount | ./data/files |
PUID |
User ID for file permissions | 1000 |
PGID |
Group ID for file permissions | 1000 |
yamleditor/
├── config/ # Configuration files
├── data/files/ # Editable YAML/MD files
├── database/ # SQLite database
├── public/ # Web root
│ ├── api/ # REST API endpoints
│ ├── js/ # Frontend JavaScript
│ ├── index.php # Main editor
│ ├── login.php # Login page
│ └── admin.php # User management
├── src/ # PHP classes
├── .env.example # Environment template
├── Dockerfile # Docker image
└── docker-compose.yml
GET /api/files.php- List all filesGET /api/files.php?file=name.yaml- Read file contentPOST /api/files.php- Create new filePUT /api/files.php- Update fileDELETE /api/files.php?file=name.yaml- Delete file
GET /api/users.php- List all users (admin only)GET /api/users.php?export=1- Export users as JSONPOST /api/users.php- Create user or import usersPUT /api/users.php- Update userDELETE /api/users.php?id=1- Delete user
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.