Skip to content

alpemreelmas/sysara

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

8 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Sysara - Futuristic System Management Platform

Sysara Logo

Sysara is a modern, web-based system management platform built with Go, designed to provide comprehensive server administration, monitoring, and configuration management through an intuitive web interface.

✨ Features

πŸ” User Management

  • User Authentication: Secure login/logout with session management
  • User CRUD Operations: Create, read, update, and delete user accounts
  • Password Security: BCrypt password hashing
  • Session Management: Secure session handling with Gorilla Sessions

🌍 Environment Configuration

  • Multi-Environment Support: Manage .env, .env.production, .env.testing, etc.
  • Web-Based Editor: Edit environment files directly from the web interface
  • Automatic Backup: Creates backups before saving changes
  • Syntax Validation: Basic validation for environment file format

πŸ”‘ SSH Key Management

  • Key Storage: Securely store and manage SSH public keys
  • Format Validation: Validates SSH key formats (RSA, Ed25519, ECDSA)
  • Fingerprint Generation: Automatic fingerprint generation
  • User Association: Keys are associated with specific users

πŸ“Š System Monitoring

  • Real-Time Metrics: Live CPU, Memory, Disk, and Network monitoring
  • Process Management: View running processes with CPU and memory usage
  • System Information: Display host information, uptime, and OS details
  • Auto-Refresh: HTMX-powered automatic updates every 5 seconds

🎨 Modern UI/UX

  • Responsive Design: Built with Tailwind CSS for mobile-first design
  • Interactive Elements: HTMX for seamless user interactions
  • Real-Time Updates: Dynamic content updates without page reloads
  • Accessibility: WCAG-compliant interface design

πŸ› οΈ Technology Stack

  • Backend: Go 1.21+ with Gin web framework
  • Database: SQLite with GORM ORM
  • Frontend: HTML templates + HTMX + Tailwind CSS
  • Authentication: Gorilla Sessions with BCrypt
  • Monitoring: gopsutil for system metrics
  • Deployment: Systemd service with installer script

πŸ“‹ Requirements

  • Go 1.21 or higher
  • SQLite3
  • Linux/Unix system (for deployment)
  • Modern web browser

πŸš€ Quick Start

Development

  1. Clone the repository (or use existing files):
git clone https://github.com/alpemreelmas/sysara.git
cd sysara
  1. Install dependencies:
go mod tidy
  1. Build the application:
# For Linux
go build .

# For Windows (disable CGO)
CGO_ENABLED=0 go build .
  1. Run the application:
./sysara
  1. Access the application: Open your browser and navigate to http://localhost:8080

Production Deployment (Linux)

  1. Make installer executable:
chmod +x installer.sh
  1. Run the installer:
sudo ./installer.sh
  1. Access the application: Navigate to http://your-server-ip:8080

πŸ“ Project Structure

sysara/
β”œβ”€β”€ cmd/                    # Command-line applications
β”œβ”€β”€ config/                 # Configuration files
β”œβ”€β”€ data/                   # Database and data files
β”œβ”€β”€ internal/
β”‚   β”œβ”€β”€ auth/              # Authentication logic
β”‚   β”œβ”€β”€ handlers/          # HTTP handlers
β”‚   β”œβ”€β”€ middleware/        # HTTP middleware
β”‚   β”œβ”€β”€ models/            # Database models
β”‚   └── services/          # Business logic services
β”œβ”€β”€ logs/                  # Application logs
β”œβ”€β”€ pkg/
β”‚   └── utils/             # Utility functions
β”œβ”€β”€ static/
β”‚   β”œβ”€β”€ css/               # Stylesheets
β”‚   β”œβ”€β”€ js/                # JavaScript files
β”‚   └── images/            # Static images
β”œβ”€β”€ templates/
β”‚   β”œβ”€β”€ layouts/           # Layout templates
β”‚   β”œβ”€β”€ pages/             # Page templates
β”‚   └── partials/          # Partial templates
β”œβ”€β”€ installer.sh           # Linux installation script
β”œβ”€β”€ main.go               # Application entry point
└── README.md             # This file

πŸ”§ Configuration

Environment Variables

Create a .env file in the root directory:

# Server Configuration
PORT=8080
GIN_MODE=release

# Database
DATABASE_PATH=data/sysara.db

# Security
SESSION_SECRET=your-secret-key-here

# Monitoring
REFRESH_INTERVAL=5000

Default Configuration

The application will create default configurations on first run:

  • SQLite database in data/sysara.db
  • Log files in logs/ directory
  • Static files served from static/ directory

πŸ” Security Features

  • Password Hashing: BCrypt with salt
  • Session Security: Secure cookie settings
  • Input Validation: Server-side validation for all inputs
  • CSRF Protection: Built-in CSRF protection
  • SSH Key Validation: Format validation for SSH keys

πŸ“– API Documentation

Authentication Endpoints

  • GET /login - Display login page
  • POST /login - Authenticate user
  • GET /register - Display registration page
  • POST /register - Create new user account
  • POST /logout - Logout current user

Protected Endpoints

  • GET /dashboard - Main dashboard
  • GET /users - List all users
  • GET /env - Environment file management
  • GET /ssh - SSH key management
  • GET /monitor - System monitoring dashboard

API Endpoints (HTMX)

  • GET /monitor/api/stats - System statistics
  • GET /monitor/api/processes - Running processes

πŸ”„ Development

Adding New Features

  1. Create Handler: Add new handler in internal/handlers/
  2. Add Routes: Update main.go with new routes
  3. Create Templates: Add HTML templates in templates/
  4. Update Models: Modify database models if needed

Running in Development Mode

# Set development mode
export GIN_MODE=debug

# Run with auto-reload (requires air)
air

# Or run normally
go run main.go

πŸ§ͺ Testing

# Run all tests
go test ./...

# Run tests with coverage
go test -cover ./...

# Run specific test
go test ./internal/auth/

πŸ“¦ Building for Production

Linux

GOOS=linux GOARCH=amd64 go build -o sysara-linux .

Windows

GOOS=windows GOARCH=amd64 go build -o sysara-windows.exe .

macOS

GOOS=darwin GOARCH=amd64 go build -o sysara-darwin .

🐳 Docker Support

FROM golang:1.21-alpine AS builder
WORKDIR /app
COPY . .
RUN go mod tidy && go build -o sysara .

FROM alpine:latest
RUN apk --no-cache add ca-certificates
WORKDIR /root/
COPY --from=builder /app/sysara .
COPY --from=builder /app/static ./static
COPY --from=builder /app/templates ./templates
EXPOSE 8080
CMD ["./sysara"]

🀝 Contributing

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

πŸ“ License

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

πŸ†˜ Support

If you encounter any issues or have questions:

  1. Check the Issues page
  2. Create a new issue with detailed information
  3. Include system information and error logs

πŸ—ΊοΈ Roadmap

  • Multi-server support
  • Docker container management
  • Advanced alerting system
  • REST API for external integrations
  • Two-factor authentication
  • Advanced user roles and permissions
  • Database backups and restoration
  • Plugin system for extensions

πŸ‘₯ Authors

  • alpemreelmas - Initial work - GitHub

πŸ™ Acknowledgments


Sysara - Empowering system administrators with modern, intuitive tools for server management.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published