Deploying OliveTin
Introduction
OliveTin is a web interface for running predefined shell commands and scripts. It provides a simple, clean dashboard with buttons that trigger scripts, making system administration tasks accessible to users who might not be comfortable with the command line.
Built with Go, OliveTin is lightweight, fast, and secure. It’s perfect for creating self-service portals where users can run specific operations without needing SSH access or command-line knowledge. Each action is explicitly defined in a configuration file, ensuring only authorized commands can be executed.
Key highlights of OliveTin:
- Simple Interface: Clean, button-based dashboard
- Predefined Actions: Only configured commands can run
- Arguments Support: Accept user input for commands
- Output Display: Show command results in the UI
- Access Control: Authentication and authorization options
- API Access: REST API for programmatic triggering
- Themes: Customizable appearance
- Logging: Track all executed commands
- Webhooks: Trigger actions via webhooks
- Cross-Platform: Runs on Linux, Windows, macOS
- Open Source: Apache 2.0 license
This guide walks through deploying OliveTin on Klutch.sh using Docker.
Why Deploy OliveTin on Klutch.sh
Deploying OliveTin on Klutch.sh provides several advantages:
Simplified Deployment: Klutch.sh handles the Go application deployment automatically.
Persistent Storage: Attach persistent volumes for configuration and logs.
HTTPS by Default: Automatic SSL certificates for secure access.
GitHub Integration: Version-controlled deployments through your repository.
Scalable Resources: Allocate CPU and memory as needed.
Custom Domains: Use your own domain for your operations portal.
Always-On Availability: Your automation portal remains accessible 24/7.
Prerequisites
Before deploying OliveTin on Klutch.sh, ensure you have:
- A Klutch.sh account
- A GitHub account with a repository for your configuration
- Understanding of shell commands and scripting
- (Optional) A custom domain for your OliveTin instance
Understanding OliveTin Architecture
OliveTin has a simple architecture:
Go Server: Handles web interface and command execution.
YAML Configuration: Defines all available actions.
Web Interface: Button-based dashboard for users.
Execution Engine: Runs shell commands securely.
Logging System: Records all command executions.
Deploying OliveTin on Klutch.sh
- Select HTTP as the traffic type
- Set the internal port to 1337
Create Your GitHub Repository
Create a new GitHub repository for your OliveTin deployment configuration.
Create Configuration File
Create config.yaml with your actions:
actions: - title: Check System Status icon: "💻" shell: uptime
- title: View Disk Usage icon: "💾" shell: df -h
- title: Check Memory icon: "🧠" shell: free -m
- title: Run Custom Script icon: "⚙" shell: /scripts/my-script.sh {{ message }} arguments: - name: message title: Enter a message type: asciiCreate the Dockerfile
Create a Dockerfile in your repository root:
FROM jamesread/olivetin:latest
# Copy configurationCOPY config.yaml /config/config.yaml
# Create scripts directoryRUN mkdir -p /scripts
# Copy custom scripts (if any)COPY scripts/ /scripts/RUN chmod +x /scripts/*
EXPOSE 1337
CMD ["/usr/bin/OliveTin"]Create a New Project on Klutch.sh
Navigate to the Klutch.sh dashboard and create a new project.
Create a New App
Within your project, create a new app and connect your GitHub repository.
Configure HTTP Traffic
In the deployment settings:
Attach Persistent Volumes
Add persistent storage:
| Mount Path | Recommended Size | Purpose |
|---|---|---|
/config | 1 GB | Configuration files |
/var/log/OliveTin | 5 GB | Execution logs |
Deploy Your Application
Click Deploy to start the build process.
Access OliveTin
Once deployed, access your dashboard at https://your-app.klutch.sh.
Configuration Examples
Basic Actions
Simple command buttons:
actions: - title: Hello World shell: echo "Hello, World!"
- title: Current Date shell: date
- title: Hostname shell: hostnameActions with Arguments
Accept user input:
actions: - title: Ping Host icon: "📡" shell: ping -c 4 {{ host }} arguments: - name: host title: Hostname or IP type: ascii
- title: Create User shell: useradd {{ username }} arguments: - name: username title: Username type: ascii_identifierDropdown Selections
Provide predefined choices:
actions: - title: Restart Service shell: systemctl restart {{ service }} arguments: - name: service title: Select Service type: ascii choices: - nginx - apache2 - mysqlDangerous Actions
Require confirmation:
actions: - title: Clear Cache shell: rm -rf /var/cache/* popupOnStart: confirm timeout: 60Advanced Configuration
Icons
Use emoji or custom icons:
actions: - title: Start Server icon: "▶" # Play button shell: ./start.sh
- title: Stop Server icon: "■" # Stop button shell: ./stop.shCategories
Organize actions into groups:
actions: - title: Web Server shell: echo "Category" hidden: true
- title: Start Nginx shell: systemctl start nginx
- title: Database shell: echo "Category" hidden: true
- title: Start MySQL shell: systemctl start mysqlTimeouts
Set execution limits:
actions: - title: Long Running Task shell: ./long-task.sh timeout: 300 # 5 minutesSecurity Configuration
Access Control
Add authentication:
# In config.yamlauthenticationEnabled: trueusers: - username: admin password: $2y$... # bcrypt hashLimiting Access
Restrict by action:
actions: - title: Admin Only Action shell: ./admin-task.sh acl: - "admin"Logging
Track all executions:
logLevel: "INFO"logFormat: "json"API Usage
REST API
Trigger actions programmatically:
curl -X POST https://your-olivetin.klutch.sh/api/StartAction \ -H "Content-Type: application/json" \ -d '{"actionName": "Check System Status"}'Webhooks
Configure webhook triggers:
actions: - title: Deploy Application shell: ./deploy.sh execOnWebhook: true webhookId: "deploy-webhook"Use Cases
Server Management
Common sysadmin tasks:
actions: - title: View Logs shell: tail -100 /var/log/syslog
- title: Clear Temp Files shell: rm -rf /tmp/* popupOnStart: confirmApplication Deployment
Deployment automation:
actions: - title: Deploy to Staging shell: ./deploy.sh staging
- title: Deploy to Production shell: ./deploy.sh production popupOnStart: confirmSelf-Service Portal
User-friendly operations:
actions: - title: Reset My Password shell: ./reset-password.sh {{ email }} arguments: - name: email title: Your Email type: asciiProduction Best Practices
Security Recommendations
- Enable authentication
- Use bcrypt for passwords
- Limit command scope
- Review all actions carefully
- Log all executions
Command Safety
Write safe scripts:
- Validate all inputs
- Use absolute paths
- Set appropriate timeouts
- Handle errors gracefully
Monitoring
Track usage:
- Review execution logs
- Monitor for failures
- Set up alerting
Troubleshooting Common Issues
Commands Not Running
- Check script permissions
- Verify paths are correct
- Review execution logs
- Test commands manually
Authentication Problems
- Verify password hashes
- Check configuration syntax
- Review access logs
Timeout Issues
- Increase timeout value
- Optimize long-running scripts
- Consider async execution
Additional Resources
Conclusion
Deploying OliveTin on Klutch.sh provides a secure, user-friendly way to expose shell commands through a web interface. By defining exactly which commands can be run, OliveTin strikes a balance between accessibility and security. Whether for team self-service, customer portals, or personal automation, OliveTin simplifies running predefined operations without requiring command-line expertise.