From 18d1bd81e067838ce523ea4e45846b09030c28f6 Mon Sep 17 00:00:00 2001 From: John Crisp Date: Thu, 30 Oct 2025 16:14:30 +0100 Subject: [PATCH] update with .env file and new config entries --- createlinks | 2 + .../e-smith/files/docker/configs/.env/10Base | 61 +++++++++++++++++++ .../docker/configs/docker-compose.yml/10Base | 54 ++++++++++++++++ .../configs/docker-compose.yml/20rocketchat | 32 ---------- smeserver-rocketchat.spec | 10 ++- 5 files changed, 124 insertions(+), 35 deletions(-) create mode 100644 root/etc/e-smith/templates/home/e-smith/files/docker/configs/.env/10Base create mode 100644 root/etc/e-smith/templates/home/e-smith/files/docker/configs/docker-compose.yml/10Base delete mode 100644 root/etc/e-smith/templates/home/e-smith/files/docker/configs/docker-compose.yml/20rocketchat diff --git a/createlinks b/createlinks index 7878cca..a4d09c9 100644 --- a/createlinks +++ b/createlinks @@ -8,6 +8,7 @@ use esmith::Build::CreateLinks qw(:all); foreach (qw( /home/e-smith/files/docker/configs/docker-compose.yml + /home/e-smith/files/docker/configs/.env )) { @@ -17,6 +18,7 @@ foreach (qw( bootstrap-console-save remoteaccess-update smeserver-rocketchat-update + smeserver-docker-compose-update )); } diff --git a/root/etc/e-smith/templates/home/e-smith/files/docker/configs/.env/10Base b/root/etc/e-smith/templates/home/e-smith/files/docker/configs/.env/10Base new file mode 100644 index 0000000..f750cea --- /dev/null +++ b/root/etc/e-smith/templates/home/e-smith/files/docker/configs/.env/10Base @@ -0,0 +1,61 @@ +#!/bin/sh +# Change these +#REG_TOKEN= +#DOMAIN="" + +# Koozali mods + +{ +my $root_url = ${rocketchat}{rootURL}; +$OUT .= "ROOT_URL=https://$root_url\n"; + +my $version = ${rocketchat}{Version} || "1.0.0"; +$OUT .= "RELEASE=$version\n"; + +my $mailUrl = ${rocketchat}{mailURL} || "localhost"; +my $mailPort = ":" . ${rocketchat}{mailPort} || ":25"; +my $mailServer = "smtp://" . $mailUrl . $mailPort; +my $memLimit = ${rocketchat}{memLimit} || "2048"; +$memLimit = $memLimit . "MB"; + +$OUT .= "MAIL_URL=$mailServer\n"; +$OUT .= "TCP_PORT=4000\n"; +$OUT .= "MEM_LIMIT=$memLimit\n"; +} + +# Running a local mongo +MONGO_URL=mongodb://127.0.0.1:27017/rocketchat?replicaSet=rs0 + +# End Koozali Mods + +# Change to true after you set your domain and valid lets encrypt email +LETSENCRYPT_ENABLED=false +LETSENCRYPT_EMAIL=demo@email.com +TRAEFIK_PROTOCOL=http + +# Prometheus +PROMETHEUS_RETENTION_SIZE=15GB +PROMETHEUS_RETENTION_TIME=15d +# default prometheus port (9090) conflicts with cockpit in centos +PROMETHEUS_PORT=9000 +# Grafana +# Set to empty string to use a subpath +GRAFANA_DOMAIN= +# set to /grafana to use from a subpath +GRAFANA_PATH=/grafana + +GRAFANA_ADMIN_PASSWORD=rc-admin +GRAFANA_HOST_PORT=5050 + +# Traefik ports +TRAEFIK_HTTP_PORT=80 +TRAEFIK_DASHBOARD_PORT=8080 +TRAEFIK_HTTPS_PORT=443 +# Port for Grafana to be accessed externally +GRAFANA_HOST_PORT=5050 + +# MongoDB +MONGODB_BIND_IP=127.0.0.1 +MONGODB_PORT_NUMBER=27017 + + diff --git a/root/etc/e-smith/templates/home/e-smith/files/docker/configs/docker-compose.yml/10Base b/root/etc/e-smith/templates/home/e-smith/files/docker/configs/docker-compose.yml/10Base new file mode 100644 index 0000000..f05c77d --- /dev/null +++ b/root/etc/e-smith/templates/home/e-smith/files/docker/configs/docker-compose.yml/10Base @@ -0,0 +1,54 @@ + rocketchat: + image: "$\{IMAGE:-registry.rocket.chat/rocketchat/rocket.chat\}:$\{RELEASE:-latest\}" + restart: always + container_name: rocketchat + #labels: + # traefik.enable: "false" + # prometheus.io/scrape: "true" + # prometheus.io/port: $\{METRICS_PORT:-9458\} + environment: + ROOT_URL: $\{ROOT_URL:-http://localhost\} + PORT: $\{PORT:-3000\} + DEPLOY_METHOD: docker + DEPLOY_PLATFORM: compose + # REG_TOKEN: $\{REG_TOKEN:-\} + LICENSE_DEBUG: true + #OVERWRITE_SETTING_Prometheus_Enabled: true + #OVERWRITE_SETTING_Prometheus_Port: $\{METRICS_PORT:-9458\} + MONGO_URL: $\{MONGO_URL:-mongodb://mongodb:27017/rocketchat?replicaSet=rs0\} + #TRANSPORTER: $\{NATS_URL-monolith+nats://nats:4222\} + #INSTANCE_IP: $\{INSTANCE_IP:-\} + TCP_PORT: $\{TCP_PORT:-4000\} + + # Koozali Extras + MAIL_URL: $\{MAIL_URL\} + HTTP_FORWARDED_COUNT: 1 + Accounts_UseDNSDomainCheck: True + OVERWRITE_SETTING_Accounts_TwoFactorAuthentication_Enforce_Password_Fallback: false + OVERWRITE_SETTING_Accounts_TwoFactorAuthentication_Enabled: false + BYPASS_MONGO_VALIDATION: true + + # Specify an absolute path mapping + volumes: + - /opt/uploads/:/opt/uploads/ + network_mode: "host" + # End Koozali Extras + + mem_limit: $\{MEM_LIMIT:-2048MB\}"; + + #expose: + #- ${PORT:-3000} + #- ${METRICS_PORT:-9458} + + #ports: + #- "${BIND_IP:-0.0.0.0}:${HOST_PORT:-3000}:${PORT:-3000}" + #- "${BIND_IP:-0.0.0.0}:${METRICS_PORT:-9458}:${METRICS_PORT:-9458}" + + # healthcheck: + # test: ["CMD", "nc", "-zv", "-w", "10", "rocketchat", "${PORT:-3000}"] + # interval: 30s + # timeout: 10s + # retries: 10 + # start_period: 30s + + diff --git a/root/etc/e-smith/templates/home/e-smith/files/docker/configs/docker-compose.yml/20rocketchat b/root/etc/e-smith/templates/home/e-smith/files/docker/configs/docker-compose.yml/20rocketchat deleted file mode 100644 index 4b1f2cd..0000000 --- a/root/etc/e-smith/templates/home/e-smith/files/docker/configs/docker-compose.yml/20rocketchat +++ /dev/null @@ -1,32 +0,0 @@ - rocketchat: -{ -my $version = ${rocketchat}{Version} || "1.0.0"; -#$OUT .= " image: registry.rocket.chat/rocketchat/rocket.chat:$version"; -$OUT .= " image: rocketchat/rocket.chat:$version"; -} - container_name: rocketchat - environment: -# Use ?replSet=rs0 if you have replica sets (this is the templates-custom template) - - MONGO_URL=mongodb://127.0.0.1:27017/rocketchat?replicaSet=rs0 - - MONGO_OPLOG_URL=mongodb://127.0.0.1:27017/local?replicaSet=rs0 -{ -$OUT .= " - ROOT_URL=https://$rocketchat{rootURL}\n"; -$OUT .= " - MAIL_URL=smtp://$rocketchat{mailURL}"; -} - - HTTP_FORWARDED_COUNT=1 - - Accounts_UseDNSDomainCheck=True - - OVERWRITE_SETTING_Accounts_TwoFactorAuthentication_Enforce_Password_Fallback=false - - OVERWRITE_SETTING_Accounts_TwoFactorAuthentication_Enabled=false -# ports: -# - 3000:3000 - network_mode: host -# Specify an absolute path mapping - volumes: - - /opt/uploads/:/opt/uploads/ - restart: on-failure:2 -# Might need the UID/GID rather than name -# user: dockerroot:dockerroot -# user: 392:390 -# Memory Limit - mem_limit: 2048MB - diff --git a/smeserver-rocketchat.spec b/smeserver-rocketchat.spec index ac00bd4..585e23d 100644 --- a/smeserver-rocketchat.spec +++ b/smeserver-rocketchat.spec @@ -1,6 +1,6 @@ %define name smeserver-rocketchat %define version 0.4 -%define release 3 +%define release 4 Summary: Plugin to enable RocketChat Name: %{name} Version: %{version} @@ -12,8 +12,8 @@ Source: %{name}-%{version}.tar.xz BuildRoot: /var/tmp/%{name}-%{version} BuildArchitectures: noarch BuildRequires: smeserver-devtools -Requires: smeserver-release >= 10.0 -Requires: mongodb-org-server >= 4.2 +Requires: smeserver-release >= 11.0 +Requires: mongodb-org-server >= 7.0 Requires: smeserver-docker AutoReqProv: no @@ -22,6 +22,10 @@ AutoReqProv: no The ultimate Free Open Source Solution for team communications. %changelog +* THu Oct 30 2025 John Crisp 0.4-4.sme +- Update for docker-compose with .env [SME: 13259] +- Add TCP_PORT and memLimit keys + * Sun Sep 08 2024 fix-e-smith-pkg.sh by Trevor Batley 0.4-3.sme - Fix e-smith references in smeserver-rocketchat [SME: 12732]