easy gate package for cloudron

This commit is contained in:
2025-04-21 15:47:19 -04:00
parent 4817710a10
commit f2230d1663
5 changed files with 307 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
{
"id": "com.easygate.cloudron",
"title": "Easy-gate",
"author": "r7wx",
"description": "A simple web application designed to serve as the central hub for your self-hosted infrastructure. Easy-gate provides real-time parsing of services and notes from a configuration file.",
"tagline": "A gate to your self-hosted infrastructure",
"version": "1.0.0",
"healthCheckPath": "/",
"httpPort": 8080,
"addons": {
"localstorage": {}
},
"manifestVersion": 2,
"website": "https://github.com/r7wx/easy-gate",
"contactEmail": "support@cloudron.io",
"icon": "logo.png",
"tags": [
"dashboard",
"infrastructure",
"services",
"homepage"
],
"env": {
"EASY_GATE_CONFIG": "/app/data/easy-gate.json",
"EASY_GATE_ROOT_PATH": "/app/data"
},
"configurePath": "/",
"minBoxVersion": "7.0.0",
"postInstallMessage": "Easy-gate has been successfully installed. You can now configure your services in the /app/data/easy-gate.json file. By default, Easy-gate runs behind Cloudron's proxy (EASY_GATE_BEHIND_PROXY=true). More configuration options available at https://github.com/r7wx/easy-gate"
}

View File

@@ -0,0 +1,41 @@
FROM cloudron/base:4.2.0
# Adding non-free repo for any potential dependencies
RUN apt-get update && \
apt-get install -y --no-install-recommends \
wget \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# Set up directory structure
RUN mkdir -p /app/code /app/data /tmp/data
# Default config file
COPY easy-gate.json /tmp/data/easy-gate.json
# Download and install the latest Easy-gate release
RUN mkdir -p /tmp/easy-gate && \
cd /tmp/easy-gate && \
LATEST_VERSION=$(wget -qO- https://api.github.com/repos/r7wx/easy-gate/releases/latest | grep tag_name | cut -d '"' -f 4) && \
wget -q https://github.com/r7wx/easy-gate/releases/download/${LATEST_VERSION}/easy-gate_${LATEST_VERSION#v}_linux_amd64.tar.gz && \
tar -xzf easy-gate_${LATEST_VERSION#v}_linux_amd64.tar.gz && \
mv easy-gate /app/code/ && \
chmod +x /app/code/easy-gate && \
rm -rf /tmp/easy-gate
# Prepare start script
COPY start.sh /app/code/
RUN chmod +x /app/code/start.sh
# Set proper permissions
RUN chown -R cloudron:cloudron /app/code /app/data /tmp/data
# Configure working directory and user
WORKDIR /app/code
USER cloudron
# Expose the port the app runs on
EXPOSE 8080
# Start the application
CMD ["/app/code/start.sh"]

View File

@@ -0,0 +1,147 @@
# Easy-gate Build Notes for Cloudron
This document provides instructions for building, testing, and deploying Easy-gate to your Cloudron instance.
## Overview
Easy-gate is a simple web application designed to serve as the central hub for your self-hosted infrastructure. It allows you to organize and access all your self-hosted services from a single dashboard.
Key features:
- Real-time parsing of services and notes from a configuration file (JSON/YAML)
- Ability to assign items to specific user groups based on IP addresses
- Organization of services into categories
- Customizable theme and icons
## Building the Package
### Prerequisites
- A Linux environment with Docker installed
- Cloudron CLI tool installed (`npm install -g cloudron`)
- Authenticated with your Cloudron instance (`cloudron login`)
### Build Steps
1. Create a directory for your build and copy all files into it:
```bash
mkdir easy-gate-build
cd easy-gate-build
# Copy CloudronManifest.json, Dockerfile, start.sh, and easy-gate.json
```
2. Create a logo.png file for the icon or download one from the Easy-gate repository.
3. Build the package:
```bash
cloudron build
```
This command will create a package file (usually named `easy-gate-1.0.0.tar.gz`).
## Testing Locally
You can test the Docker container locally before deploying to Cloudron:
```bash
# Build the Docker image
docker build -t easy-gate-local .
# Run the container
docker run -p 8080:8080 -e EASY_GATE_BEHIND_PROXY=true easy-gate-local
```
Access the dashboard at http://localhost:8080 to verify it works correctly.
## Deploying to Cloudron
1. Upload the built package to your Cloudron:
```bash
cloudron install —app easy-gate.example.com
```
2. Or, if you want to update an existing installation:
```bash
cloudron update —app easy-gate.example.com
```
3. Configure your Easy-gate instance:
After installation, youll need to edit the configuration file to add your services. You can do this in two ways:
### Option 1: Using Cloudron File Manager
1. Go to your Cloudron dashboard
2. Click on the Easy-gate application
3. Go to “Files” tab
4. Navigate to `/app/data/`
5. Edit `easy-gate.json`
### Option 2: SSH Access
1. SSH into your Cloudron server
2. Access the apps data directory:
```bash
cloudron exec —app easy-gate.example.com
```
3. Edit the configuration file:
```bash
nano /app/data/easy-gate.json
```
## Configuration File Structure
The configuration file uses the following structure:
```json
{
“title”: “My Dashboard”,
“theme”: {
“background”: “#f8f9fa”,
“foreground”: “#212529”,
“custom_css”: “”
},
“groups”: [
{
“name”: “group-name”,
“subnet”: “192.168.1.1/24”
}
],
“categories”: [
{
“name”: “Category Name”,
“services”: [
{
“name”: “Service Name”,
“url”: “https://service.example.com”,
“description”: “Service Description”,
“icon”: “”,
“groups”: [“group-name”]
}
]
}
],
“notes”: [
{
“name”: “Note Title”,
“text”: “Note Content”,
“groups”: [“group-name”]
}
],
“behind_proxy”: true
}
```
## Troubleshooting
- If you encounter “502 Bad Gateway” errors, check that the application is running inside the container: `cloudron logs -f —app easy-gate.example.com`
- Make sure the `behind_proxy` setting is set to `true` in your configuration file
- Verify that the user groups and subnets are configured correctly
- Check the logs for any specific error messages
## Maintenance
Easy-gate is designed to be low-maintenance. To update to a newer version, simply rebuild the package with the latest release and update your Cloudron app.

View File

@@ -0,0 +1,69 @@
{
"title": "My Self-Hosted Infrastructure",
"theme": {
"background": "#f8f9fa",
"foreground": "#212529",
"custom_css": ""
},
"groups": [
{
"name": "internal",
"subnet": "192.168.1.1/24"
},
{
"name": "admin",
"subnet": "10.8.0.1/24"
}
],
"categories": [
{
"name": "Applications",
"services": [
{
"name": "Cloudron",
"url": "https://my.example.com",
"description": "My Cloudron Dashboard",
"icon": "",
"groups": []
}
]
},
{
"name": "Media",
"services": [
{
"name": "Jellyfin",
"url": "https://jellyfin.example.com",
"description": "Media Server",
"icon": "",
"groups": []
}
]
},
{
"name": "Monitoring",
"services": [
{
"name": "Grafana",
"url": "https://grafana.example.com",
"description": "Monitoring Dashboard",
"icon": "",
"groups": ["admin"]
}
]
}
],
"notes": [
{
"name": "Welcome to Easy-gate",
"text": "This is your new Easy-gate dashboard. Edit this configuration file to customize your services and notes.",
"groups": []
},
{
"name": "For Administrators",
"text": "Admin-only information can be seen here when connecting from the admin subnet.",
"groups": ["admin"]
}
],
"behind_proxy": true
}

View File

@@ -0,0 +1,20 @@
#!/bin/bash
set -e
# Initialize data directory if it doesn't exist
if [ ! -f /app/data/easy-gate.json ]; then
echo "Initializing Easy-gate with default configuration..."
cp /tmp/data/easy-gate.json /app/data/
chown cloudron:cloudron /app/data/easy-gate.json
fi
# Set environment variables
export EASY_GATE_CONFIG="/app/data/easy-gate.json"
export EASY_GATE_ROOT_PATH="/app/data"
export EASY_GATE_BEHIND_PROXY="true"
echo "Starting Easy-gate with configuration at ${EASY_GATE_CONFIG}..."
echo "Easy-gate is configured to run behind a proxy (EASY_GATE_BEHIND_PROXY=true)"
# Run the application
exec /app/code/easy-gate