From f37ea77870edb3d765bdf2ab979cc76a767a8f0c Mon Sep 17 00:00:00 2001 From: Charles N Wyble Date: Mon, 21 Apr 2025 14:30:02 -0400 Subject: [PATCH] first cut of home chart --- .../CloudronManifest.json | 40 +++++++ Techops/homechart.knownelement.com/Dockerfile | 45 ++++++++ .../HomeChart-BuildNotes.md | 107 ++++++++++++++++++ .../docker-compose.yml | 1 - .../input-files/info | 1 - Techops/homechart.knownelement.com/nginx.conf | 42 +++++++ .../output-files/info | 1 - Techops/homechart.knownelement.com/start.sh | 53 +++++++++ .../supervisord.conf | 28 +++++ .../vendor-files/info | 1 - 10 files changed, 315 insertions(+), 4 deletions(-) create mode 100644 Techops/homechart.knownelement.com/CloudronManifest.json create mode 100644 Techops/homechart.knownelement.com/Dockerfile create mode 100644 Techops/homechart.knownelement.com/HomeChart-BuildNotes.md delete mode 100644 Techops/homechart.knownelement.com/docker-compose.yml delete mode 100644 Techops/homechart.knownelement.com/input-files/info create mode 100644 Techops/homechart.knownelement.com/nginx.conf delete mode 100644 Techops/homechart.knownelement.com/output-files/info create mode 100644 Techops/homechart.knownelement.com/start.sh create mode 100644 Techops/homechart.knownelement.com/supervisord.conf delete mode 100644 Techops/homechart.knownelement.com/vendor-files/info diff --git a/Techops/homechart.knownelement.com/CloudronManifest.json b/Techops/homechart.knownelement.com/CloudronManifest.json new file mode 100644 index 0000000..c892e97 --- /dev/null +++ b/Techops/homechart.knownelement.com/CloudronManifest.json @@ -0,0 +1,40 @@ +{ + "id": "app.homechart.cloudron", + "title": "HomeChart", + "author": "HomeChart Package Maintainer", + "description": "Your all-in-one household management platform. Organize calendars, budgets, shopping lists, and more in one place. Enjoy features like shared calendars, meal planning, task management, and multilingual support. Secure, private, and ad-free.", + "tagline": "Your Family's Mission Control", + "version": "1.0.0", + "upstreamVersion": "2024.09.0", + "healthCheckPath": "/", + "httpPort": 3000, + "memoryLimit": 512, + "addons": { + "localstorage": {}, + "postgresql": { + "version": "16" + } + }, + "tags": [ + "household", + "family", + "organization", + "calendar", + "budget", + "tasks" + ], + "postInstallMessage": "HomeChart has been installed successfully! You can now access your family's mission control panel.\n\nThe default administrator credentials are:\nUsername: admin@example.com\nPassword: changeme\n\nPlease login and change these credentials immediately.", + "manifestVersion": 2, + "website": "https://homechart.app/", + "contactEmail": "support@example.com", + "icon": "file://logo.png", + "minBoxVersion": "5.4.0", + "forumUrl": "https://forum.cloudron.io/", + "documentationUrl": "https://homechart.app/docs/", + "changelog": "Initial Cloudron package for HomeChart", + "configurePath": "/settings", + "oauth": { + "loginRedirectUri": "/oidc", + "scope": "openid email profile" + } +} \ No newline at end of file diff --git a/Techops/homechart.knownelement.com/Dockerfile b/Techops/homechart.knownelement.com/Dockerfile new file mode 100644 index 0000000..dcca0cd --- /dev/null +++ b/Techops/homechart.knownelement.com/Dockerfile @@ -0,0 +1,45 @@ +FROM cloudron/base:4.2.0 + +# Install required dependencies +RUN apt-get update && \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + curl \ + supervisor \ + nginx \ + tzdata \ + gosu && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* + +# Create the application directory structure +RUN mkdir -p /app/code /app/data /run/nginx + +# Create homechart data directories structure +RUN mkdir -p /tmp/data + +# Download the latest HomeChart release +RUN curl -L -o /app/code/homechart.tar.gz https://github.com/candiddev/homechart/releases/latest/download/homechart_linux_amd64.tar.gz && \ + tar -xzf /app/code/homechart.tar.gz -C /app/code && \ + rm /app/code/homechart.tar.gz && \ + mv /app/code/homechart_linux_amd64 /app/code/homechart && \ + chmod +x /app/code/homechart + +# Add NGINX configuration +COPY nginx.conf /etc/nginx/sites-enabled/homechart.conf +RUN rm -f /etc/nginx/sites-enabled/default + +# Add Supervisor configuration +COPY supervisor.conf /etc/supervisor/conf.d/homechart.conf + +# Add the startup script +COPY start.sh /app/code/ +RUN chmod +x /app/code/start.sh + +# Set permissions +RUN chown -R cloudron:cloudron /app/code /app/data /run/nginx + +# Expose the port (should match the httpPort in the CloudronManifest.json) +EXPOSE 3000 + +CMD ["/app/code/start.sh"] \ No newline at end of file diff --git a/Techops/homechart.knownelement.com/HomeChart-BuildNotes.md b/Techops/homechart.knownelement.com/HomeChart-BuildNotes.md new file mode 100644 index 0000000..f299f3a --- /dev/null +++ b/Techops/homechart.knownelement.com/HomeChart-BuildNotes.md @@ -0,0 +1,107 @@ +# HomeChart Cloudron Package - Build Notes + +This document provides instructions for building, testing, and deploying the HomeChart Cloudron package. + +## Prerequisites + +1. A running Cloudron instance +2. Docker installed on your local machine +3. Cloudron CLI tool installed (`npm install -g cloudron`) +4. Git for cloning the repository + +## Files Overview + +- **CloudronManifest.json**: Contains metadata and configuration for the Cloudron app +- **Dockerfile**: Defines how to build the Docker image for HomeChart +- **start.sh**: Startup script that handles initialization and configuration +- **nginx.conf**: NGINX configuration for proxying requests +- **supervisor.conf**: Supervisor configuration for process management + +## Building and Deploying + +### Step 1: Clone the repository + +```bash +git clone https://github.com/yourusername/homechart-cloudron.git +cd homechart-cloudron +``` + +### Step 2: Build the Docker image + +```bash +# Login to Docker Hub if not already logged in +docker login + +# Build the image +cloudron build +``` + +When prompted, enter a repository name in the format `username/homechart` where `username` is your Docker Hub username. + +### Step 3: Install on your Cloudron + +```bash +# Install the app +cloudron install —image username/homechart:latest +``` + +You’ll be prompted to select a subdomain for the app. + +### Step 4: Configure the app + +After installation, you’ll need to: + +1. Log in using the default credentials provided in the post-install message +2. Change the default administrator password +3. Set up your household and invite family members + +## Updating the App + +To update the app after making changes: + +```bash +# Rebuild the Docker image +cloudron build + +# Update the installed app +cloudron update —app homechart +``` + +## Authentication + +HomeChart is configured to use Cloudron’s OIDC provider for authentication. Users from your Cloudron instance can log in to HomeChart using their Cloudron credentials. + +## Data Persistence + +All HomeChart data is stored in: +- PostgreSQL database (managed by Cloudron) +- `/app/data` directory (backed up by Cloudron) + +## Troubleshooting + +### View logs + +```bash +cloudron logs -f —app homechart +``` + +### Database access + +To access the PostgreSQL database directly: + +```bash +cloudron exec —app homechart +psql -U “$CLOUDRON_POSTGRESQL_USERNAME” -h “$CLOUDRON_POSTGRESQL_HOST” “$CLOUDRON_POSTGRESQL_DATABASE” +``` + +### Common Issues + +- **OIDC configuration issues**: Ensure the Cloudron environment variables are correctly passed to the app +- **Database connection errors**: Check PostgreSQL connection details in the app config +- **Memory limits**: If the app crashes due to memory issues, increase the memory limit in the CloudronManifest.json + +## Resources + +- [HomeChart Documentation](https://homechart.app/docs/) +- [Cloudron Documentation](https://docs.cloudron.io/) +- [HomeChart GitHub Repository](https://github.com/candiddev/homechart) \ No newline at end of file diff --git a/Techops/homechart.knownelement.com/docker-compose.yml b/Techops/homechart.knownelement.com/docker-compose.yml deleted file mode 100644 index 5918651..0000000 --- a/Techops/homechart.knownelement.com/docker-compose.yml +++ /dev/null @@ -1 +0,0 @@ -#homechart docker compose for tsys \ No newline at end of file diff --git a/Techops/homechart.knownelement.com/input-files/info b/Techops/homechart.knownelement.com/input-files/info deleted file mode 100644 index bc15867..0000000 --- a/Techops/homechart.knownelement.com/input-files/info +++ /dev/null @@ -1 +0,0 @@ -This directory contains template files for the application at FQDN indidicated by the parent directory. They will be processed using mo (bash mustache). diff --git a/Techops/homechart.knownelement.com/nginx.conf b/Techops/homechart.knownelement.com/nginx.conf new file mode 100644 index 0000000..52176c6 --- /dev/null +++ b/Techops/homechart.knownelement.com/nginx.conf @@ -0,0 +1,42 @@ +server { + listen 3000; + server_name localhost; + + # Add proper headers for running behind Cloudron's proxy + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + + client_max_body_size 100M; + + # Custom Cloudron error pages + error_page 403 /error/403.html; + error_page 404 /error/404.html; + error_page 50x /error/50x.html; + location ^~ /error/ { + alias /app/code/public/error/; + internal; + } + + # Use Cloudron's runtime directory for nginx (read-only filesystem) + client_body_temp_path /run/nginx/body; + proxy_temp_path /run/nginx/proxy; + fastcgi_temp_path /run/nginx/fastcgi; + uwsgi_temp_path /run/nginx/uwsgi; + scgi_temp_path /run/nginx/scgi; + + location / { + proxy_pass http://127.0.0.1:8000; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + proxy_read_timeout 86400; + } + + # Needed for Cloudron's health checks + location = /healthcheck { + access_log off; + return 200; + } +} \ No newline at end of file diff --git a/Techops/homechart.knownelement.com/output-files/info b/Techops/homechart.knownelement.com/output-files/info deleted file mode 100644 index fe6b01e..0000000 --- a/Techops/homechart.knownelement.com/output-files/info +++ /dev/null @@ -1 +0,0 @@ -This directory contains final docker compose files for the application at FQDN indidicated by the parent directory. diff --git a/Techops/homechart.knownelement.com/start.sh b/Techops/homechart.knownelement.com/start.sh new file mode 100644 index 0000000..36fbb66 --- /dev/null +++ b/Techops/homechart.knownelement.com/start.sh @@ -0,0 +1,53 @@ +#!/bin/bash +set -e + +# Create required runtime directories +mkdir -p /run/nginx/body /run/nginx/proxy /run/nginx/fastcgi /run/nginx/uwsgi /run/nginx/scgi +chown -R cloudron:cloudron /run/nginx + +# Initialize data directory if not existing +if [ ! -d "/app/data/config" ]; then + mkdir -p /app/data/config + chown -R cloudron:cloudron /app/data +fi + +# Configuration +CONFIG_FILE="/app/data/config/homechart.json" +if [ ! -f "$CONFIG_FILE" ]; then + echo "Creating initial configuration file..." + cat > "$CONFIG_FILE" <