From 286e946a03eed40a6388d786ae648d2a964c8443 Mon Sep 17 00:00:00 2001 From: Charles N Wyble Date: Mon, 21 Apr 2025 12:21:42 -0400 Subject: [PATCH] cleanup --- .../inventree.knownelement.com/config.yaml | 49 ------------- Techops/inventree.knownelement.com/start.sh | 69 ------------------- 2 files changed, 118 deletions(-) delete mode 100644 Techops/inventree.knownelement.com/config.yaml delete mode 100644 Techops/inventree.knownelement.com/start.sh diff --git a/Techops/inventree.knownelement.com/config.yaml b/Techops/inventree.knownelement.com/config.yaml deleted file mode 100644 index 8638928..0000000 --- a/Techops/inventree.knownelement.com/config.yaml +++ /dev/null @@ -1,49 +0,0 @@ -# InvenTree configuration file for Cloudron -# Refer to InvenTree documentation for detailed configuration options - -# Database connection settings will be provided via environment variables - -# General settings -debug: False -log_level: WARNING - -# Secret key will be stored in a file -secret_key_file: /app/data/secret_key.txt - -# Plugin settings -plugins: - enabled: True - plugin_dir: /app/data/plugins - -# File storage locations -media_root: /app/data/media -static_root: /app/data/static - -# Email settings - adjust with your Cloudron email settings if needed -email: - host: localhost - port: 25 - tls: false - ssl: false - sender: inventree@localhost - -# Login settings -login: - default_protocol: https - allow_unverified_signup: False - allow_signup: True - signup_email_verification: False - login_confirm_days: 3 - password_reset_timeout_days: 3 - -# Display settings -customization: - instance_name: InvenTree - default_currency: USD - base_url: "" # Will be set by Cloudron - -# Server settings -server: - workers: 2 - allowed_hosts: - - '*' # Cloudron handles this \ No newline at end of file diff --git a/Techops/inventree.knownelement.com/start.sh b/Techops/inventree.knownelement.com/start.sh deleted file mode 100644 index 61e961a..0000000 --- a/Techops/inventree.knownelement.com/start.sh +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/bash -set -e - -# PostgreSQL configuration from Cloudron environment variables -if [ -n "${CLOUDRON_POSTGRESQL_HOST}" ]; then - export INVENTREE_DB_ENGINE="postgresql" - export INVENTREE_DB_NAME="${CLOUDRON_POSTGRESQL_DATABASE}" - export INVENTREE_DB_USER="${CLOUDRON_POSTGRESQL_USERNAME}" - export INVENTREE_DB_PASSWORD="${CLOUDRON_POSTGRESQL_PASSWORD}" - export INVENTREE_DB_HOST="${CLOUDRON_POSTGRESQL_HOST}" - export INVENTREE_DB_PORT="${CLOUDRON_POSTGRESQL_PORT}" -else - echo "PostgreSQL addon not configured!" - exit 1 -fi - -# Ensure data directories exist -if [ ! -d "${INVENTREE_HOME}/media" ]; then - echo "Creating media directory..." - mkdir -p "${INVENTREE_HOME}/media" - cp -rn /tmp/data/media/* "${INVENTREE_HOME}/media/" || true -fi - -if [ ! -d "${INVENTREE_HOME}/static" ]; then - echo "Creating static directory..." - mkdir -p "${INVENTREE_HOME}/static" - cp -rn /tmp/data/static/* "${INVENTREE_HOME}/static/" || true -fi - -if [ ! -d "${INVENTREE_HOME}/plugins" ]; then - echo "Creating plugins directory..." - mkdir -p "${INVENTREE_HOME}/plugins" - cp -rn /tmp/data/plugins/* "${INVENTREE_HOME}/plugins/" || true -fi - -if [ ! -d "${INVENTREE_HOME}/config" ]; then - echo "Creating config directory..." - mkdir -p "${INVENTREE_HOME}/config" - cp -rn /tmp/data/config/* "${INVENTREE_HOME}/config/" || true -fi - -# Generate secret key if it doesn't exist -if [ ! -f "${INVENTREE_SECRET_KEY_FILE}" ]; then - echo "Generating secret key..." - python3 -c "from django.core.management.utils import get_random_secret_key; print(get_random_secret_key())" > "${INVENTREE_SECRET_KEY_FILE}" -fi - -cd /app/code/inventree - -# Apply database migrations and collect static files -echo "Applying database migrations..." -/app/code/env/bin/python manage.py migrate --noinput - -echo "Collecting static files..." -/app/code/env/bin/python manage.py collectstatic --noinput - -# Create superuser if not exists -echo "Checking for superuser..." -DJANGO_SUPERUSER_PASSWORD="${INVENTREE_ADMIN_PASSWORD}" \ -/app/code/env/bin/python manage.py createsuperuser --noinput \ - --username "${INVENTREE_ADMIN_USER}" \ - --email "${INVENTREE_ADMIN_EMAIL}" || true - -# Set proper permissions -chown -R cloudron:cloudron "${INVENTREE_HOME}" - -# Start supervisor to manage processes -echo "Starting supervisor..." -exec /usr/bin/supervisord -c /etc/supervisor/supervisord.conf \ No newline at end of file