diff --git a/Techops/homebox.knownelement.com/CloudronManifest.json b/Techops/homebox.knownelement.com/CloudronManifest.json new file mode 100644 index 0000000..6b8323d --- /dev/null +++ b/Techops/homebox.knownelement.com/CloudronManifest.json @@ -0,0 +1,38 @@ +{ + "id": "software.homebox.cloudronapp", + "title": "Homebox", + "author": "CloudronApp", + "description": "Homebox is an inventory and organization system built for home users. Manage your home inventory with a simple, fast, and lightweight application.", + "tagline": "Simple home inventory management", + "version": "1.0.0", + "healthCheckPath": "/", + "httpPort": 7745, + "addons": { + "localstorage": { + "description": "Data directory for Homebox" + } + }, + "manifestVersion": 2, + "website": "https://homebox.software/", + "contactEmail": "support@homebox.software", + "icon": "file://logo.png", + "tags": [ + "inventory", + "organization", + "asset-management", + "home" + ], + "minBoxVersion": "7.5.0", + "documentationUrl": "https://homebox.software/en/", + "forumUrl": "https://github.com/sysadminsmedia/homebox/discussions", + "postInstallMessage": "Homebox has been successfully installed! The first user to register will be the administrator. You can disable registration after creating the first account.", + "memoryLimit": 256000000, + "targetBoxVersion": "7.5.0", + "changelog": "Initial Cloudron package", + "mediaLinks": [], + "containerOptions": { + "securityContext": { + "allowPrivilegeEscalation": false + } + } +} \ No newline at end of file diff --git a/Techops/homebox.knownelement.com/Dockerfile b/Techops/homebox.knownelement.com/Dockerfile new file mode 100644 index 0000000..7c39d16 --- /dev/null +++ b/Techops/homebox.knownelement.com/Dockerfile @@ -0,0 +1,46 @@ +FROM cloudron/base:4.2.0 + +# Add version specifics +ARG VERSION=latest +ARG DEBIAN_FRONTEND=noninteractive + +# Update the system and install dependencies +RUN apt-get update && \ + apt-get install -y \ + curl \ + ca-certificates \ + wget \ + && apt-get clean && rm -rf /var/lib/apt/lists/* + +# Set up directory structure following Cloudron filesystem layout +RUN mkdir -p /app/code /app/data /tmp/data + +# Set working directory +WORKDIR /app/code + +# Download and install the latest Homebox release +RUN if [ "$VERSION" = "latest" ]; then \ + DOWNLOAD_URL=$(curl -s https://api.github.com/repos/sysadminsmedia/homebox/releases/latest | grep "browser_download_url.*linux_amd64" | cut -d '"' -f 4); \ + else \ + DOWNLOAD_URL="https://github.com/sysadminsmedia/homebox/releases/download/v${VERSION}/homebox_${VERSION}_linux_amd64.tar.gz"; \ + fi && \ + wget -O /tmp/homebox.tar.gz ${DOWNLOAD_URL} && \ + tar -xzf /tmp/homebox.tar.gz -C /app/code && \ + rm /tmp/homebox.tar.gz && \ + chmod +x /app/code/homebox + +# Copy initialization template for /app/data +COPY data_init /tmp/data/ + +# Copy application scripts +COPY start.sh /app/code/ +RUN chmod +x /app/code/start.sh + +# Copy NGINX configuration +COPY nginx.conf /app/code/ + +# Set ownership to cloudron user +RUN chown -R cloudron:cloudron /app/code /tmp/data + +# Set entrypoint +ENTRYPOINT ["/app/code/start.sh"] \ No newline at end of file diff --git a/Techops/homebox.knownelement.com/docker-compose.yml b/Techops/homebox.knownelement.com/docker-compose.yml deleted file mode 100644 index 5918651..0000000 --- a/Techops/homebox.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/homebox.knownelement.com/input-files/info b/Techops/homebox.knownelement.com/input-files/info deleted file mode 100644 index bc15867..0000000 --- a/Techops/homebox.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/homebox.knownelement.com/nginx.conf b/Techops/homebox.knownelement.com/nginx.conf new file mode 100644 index 0000000..246ccb3 --- /dev/null +++ b/Techops/homebox.knownelement.com/nginx.conf @@ -0,0 +1,67 @@ +worker_processes auto; +pid /run/nginx.pid; + +events { + worker_connections 768; + multi_accept on; +} + +http { + sendfile on; + tcp_nopush on; + tcp_nodelay on; + keepalive_timeout 65; + types_hash_max_size 2048; + server_tokens off; + + # Mime types + include /etc/nginx/mime.types; + default_type application/octet-stream; + + # Logging + access_log /dev/stdout; + error_log /dev/stderr; + + # Gzip settings + gzip on; + gzip_disable "msie6"; + gzip_vary on; + gzip_proxied any; + gzip_comp_level 6; + gzip_buffers 16 8k; + gzip_http_version 1.1; + gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript; + + # Virtual Host Configs + server { + listen 8000 default_server; + listen [::]:8000 default_server; + + server_name _; + + # Maximum upload size + client_max_body_size 100M; + + # Proxy settings + proxy_buffers 16 16k; + proxy_buffer_size 16k; + + location / { + proxy_pass http://127.0.0.1:7745; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + 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; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-Port $server_port; + + # Set timeouts + proxy_connect_timeout 60s; + proxy_send_timeout 60s; + proxy_read_timeout 300s; + } + } +} \ No newline at end of file diff --git a/Techops/homebox.knownelement.com/output-files/info b/Techops/homebox.knownelement.com/output-files/info deleted file mode 100644 index fe6b01e..0000000 --- a/Techops/homebox.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/homebox.knownelement.com/start.sh b/Techops/homebox.knownelement.com/start.sh new file mode 100644 index 0000000..381fe9d --- /dev/null +++ b/Techops/homebox.knownelement.com/start.sh @@ -0,0 +1,108 @@ +#!/bin/bash +set -e + +# Ensure proper directory structure in /app/data +if [ ! -d "/app/data/.database" ]; then + echo "Initializing data directory structure..." + mkdir -p /app/data/.database + mkdir -p /app/data/uploads + + # Copy initialization files if provided + if [ -d "/tmp/data" ]; then + cp -r /tmp/data/* /app/data/ + fi + + # Fix permissions + chown -R cloudron:cloudron /app/data + chmod -R 750 /app/data +fi + +# Set environment variables for Homebox +export HBOX_MODE=production +export HBOX_STORAGE_DATA=/app/data +export HBOX_DATABASE_DRIVER=sqlite3 +export HBOX_DATABASE_SQLITE_PATH="/app/data/.database/homebox.db" +export HBOX_WEB_PORT=7745 +export HBOX_WEB_HOST=127.0.0.1 +export HBOX_LOG_LEVEL=info +export HBOX_LOG_FORMAT=text +export HBOX_WEB_MAX_FILE_UPLOAD=50 + +# Check if registration should be disabled by default +# If this is a fresh install, we'll allow registration for first user +if [ ! -f "/app/data/.database/homebox.db" ]; then + export HBOX_OPTIONS_ALLOW_REGISTRATION=true +else + export HBOX_OPTIONS_ALLOW_REGISTRATION=false +fi + +# Configure NGINX +echo "Configuring NGINX..." +mkdir -p /run/nginx +cat > /app/data/nginx.conf < /etc/supervisor/conf.d/homebox.conf <