From a5baf5bbb5e764b6e5bec3713b08198af0f3c635 Mon Sep 17 00:00:00 2001 From: FoggyMtnDrifter Date: Mon, 23 Nov 2026 13:42:23 -0500 Subject: [PATCH] Add Libredesk, a support desk for email and live chat (#36) * Add Libredesk, a support desk for email and live chat Libredesk 2.9.2 with PostgreSQL and Redis, configured entirely by environment variables. Its admin password must mix cases, digits and a symbol, so it uses a new "password" secret generator; the schema, README and local test know it. Libredesk keeps its address in its own database, so a small settings service sets it to HARBOR_PUBLIC_URL on every start before the app boots. Its logos are PNG only, so it gets a drawn icon for now (docs/icons.md). * Check recipes against Harbor a21eb2c, which knows generate: password --- .github/platform.ref | 2 +- README.md | 2 +- apps/libredesk/README.md | 24 ++++++++ apps/libredesk/cottage.yml | 19 ++++++ apps/libredesk/icon.svg | 1 + apps/libredesk/template.yml | 113 ++++++++++++++++++++++++++++++++++++ bump/track.yml | 4 ++ docs/icons.md | 3 +- docs/licensing.md | 1 + schema/cottage.schema.json | 2 +- scripts/local-test-plan.py | 22 ++++++- 11 files changed, 186 insertions(+), 7 deletions(-) create mode 100644 apps/libredesk/README.md create mode 100644 apps/libredesk/cottage.yml create mode 100644 apps/libredesk/icon.svg create mode 100644 apps/libredesk/template.yml diff --git a/.github/platform.ref b/.github/platform.ref index c9cb070..9baeeff 100644 --- a/.github/platform.ref +++ b/.github/platform.ref @@ -1 +1 @@ -63af6fc046feb06ef94d5e3cdba826a500ff52d3 +a21eb2c9d0f850baea8fbaaff3f064e8c45724cf diff --git a/README.md b/README.md index 418e092..e8d261c 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ Cottage how to run it: | `health_path` | a path that answers 200 once the app is ready | | `default_resources`, `min_resources` | `cpu_millis`, `memory_mb`, `storage_mb` | | `volumes` | named volumes to hand to a non-root user: `data: { uid: 1000, gid: 1000, mode: "0750" }` | -| `parameters` | settings people can see or change; secrets are generated (`generate: random32`, `random16` or `hex32`) | +| `parameters` | settings people can see or change; secrets are generated (`generate: random32`, `random16`, `hex32`, or `password` for apps whose passwords must mix cases, digits and a symbol) | | `tcp_ports` | at most two ports the app needs besides HTTPS, for protocols with their own authentication such as SSH: `[{ name: ssh, service: app, port: 2222 }]` | Each parameter has a `key`, `label` and `type` (`string`, `int`, `bool` or `choice` with `choices`), and diff --git a/apps/libredesk/README.md b/apps/libredesk/README.md new file mode 100644 index 0000000..af163a7 --- /dev/null +++ b/apps/libredesk/README.md @@ -0,0 +1,24 @@ +## First login + +Sign in with the email **System** and the admin password shown on the app's page in your Cottage dashboard. That's Libredesk's built-in administrator. Then open **Admin → Agents** and add yourself and your team as agents with your own email addresses, so day-to-day work isn't done as System. + +Cottage keeps **Admin → General → Root URL** set to your app's address, including after you add a custom domain, so links in emails and the chat widget always point to the right place. + +## Connect your support email + +Open **Admin → Inboxes**, add an **Email** inbox, and fill in your mail provider's details for both directions: + +- **Incoming (IMAP):** the server, port 993 and the mailbox's login. Libredesk checks the mailbox and turns new emails into conversations. +- **Outgoing (SMTP):** the server, port 465 or 587, and the same login. Replies are sent from the inbox's address, so customers see them as normal email. + +Most providers, like Fastmail, Gmail and MXroute, publish these settings in their help pages. Use an app password if your provider offers them. Port 25 is blocked on Cottage, so use 465 or 587 for sending. + +For emails to agents (assignments, SLA alerts and password resets), fill in your SMTP details under **Admin → Notifications**, then restart the app from your Cottage dashboard so the change takes effect. + +## Add live chat to your website + +Add a **Live Chat** inbox under **Admin → Inboxes**, then copy the snippet it shows into your website. Visitors' messages arrive in the same place as email. + +## Export your data + +Open a contact and choose **Export data** to download everything Libredesk holds about them, for example when a customer asks for their data. Cottage also keeps nightly backups of the whole app, database and attachments included. diff --git a/apps/libredesk/cottage.yml b/apps/libredesk/cottage.yml new file mode 100644 index 0000000..d1e8fc0 --- /dev/null +++ b/apps/libredesk/cottage.yml @@ -0,0 +1,19 @@ +name: Libredesk +tagline: A shared support inbox for email and live chat. +category: Customer support +description: >- + Answer customers from one place: connect your support email addresses and a + live-chat widget for your website, then assign conversations, add private + notes, reply with saved responses and track response times. A lightweight + alternative to Zendesk, Intercom and Help Scout. +upstream: https://github.com/abhinavxd/libredesk/tree/v2.9.2 +website: https://libredesk.io +license: AGPL-3.0-only +images: + - ref: libredesk/libredesk:v2.9.2 + digest: sha256:1c5a234b113b6fa7b4170219a4e1063d8a9e4a396d4811b2ea03fdfcd02c63de + - ref: postgres:18.7-alpine + digest: sha256:0115267ab5a509022df9319c77be365cef335adb71556c75f60f5360ee247e71 + - ref: redis:8.10.3-alpine + digest: sha256:7958cfbb9d152f87dadfbc89f1b0b15938f0b81ff8982feb327476f4911935c3 +mobile_apps: false diff --git a/apps/libredesk/icon.svg b/apps/libredesk/icon.svg new file mode 100644 index 0000000..8858aa7 --- /dev/null +++ b/apps/libredesk/icon.svg @@ -0,0 +1 @@ + diff --git a/apps/libredesk/template.yml b/apps/libredesk/template.yml new file mode 100644 index 0000000..940c998 --- /dev/null +++ b/apps/libredesk/template.yml @@ -0,0 +1,113 @@ +# Libredesk: customer support desk (shared email inboxes and live chat), with PostgreSQL and Redis. +x-harbor: + slug: libredesk + name: Libredesk + description: Customer support desk with shared inboxes and live chat. + version: "2.9.2-c1" + primary: { service: app, port: 9000 } + health_path: /health + default_resources: { cpu_millis: 750, memory_mb: 768, storage_mb: 10240 } + min_resources: { cpu_millis: 500, memory_mb: 512, storage_mb: 2048 } + weights: { app: 4, db: 2, redis: 1, settings: 1 } + volumes: + uploads: { uid: 1000, gid: 1000, mode: "0750" } + setup: { uid: 1000, gid: 1000, mode: "0750" } + db_data: { uid: 70, gid: 70, mode: "0700" } + redis_data: { uid: 999, gid: 1000, mode: "0750" } + parameters: + # Libredesk refuses an admin password without upper- and lowercase letters, a digit and a symbol. + - { key: ADMIN_PASSWORD, label: Admin password, type: string, secret: true, generate: password } + - { key: ENCRYPTION_KEY, label: Encryption key, type: string, secret: true, generate: hex32 } + - { key: DB_PASSWORD, label: Database password, type: string, secret: true, generate: random32 } + +services: + app: + image: libredesk/libredesk:v2.9.2 + user: "1000:1000" + # Install on the first start (idempotent: skipped once installed), apply upgrades, then wait + # for the settings service below to set the app's address before starting. + command: + - sh + - -c + - >- + ./libredesk --install --idempotent-install --yes && + ./libredesk --upgrade --yes && + until [ "$$(cat /setup/root-url 2>/dev/null)" = "$$LIBREDESK_ROOT_URL" ]; do sleep 1; done && + exec ./libredesk + depends_on: + db: { condition: service_healthy } + redis: { condition: service_healthy } + environment: + LIBREDESK_DB__HOST: db + LIBREDESK_DB__PORT: "5432" + LIBREDESK_DB__USER: libredesk + LIBREDESK_DB__PASSWORD: ${DB_PASSWORD} + LIBREDESK_DB__DATABASE: libredesk + LIBREDESK_DB__SSL_MODE: disable + LIBREDESK_REDIS__ADDRESS: redis:6379 + LIBREDESK_ROOT_URL: ${HARBOR_PUBLIC_URL} + LIBREDESK_SYSTEM_USER_PASSWORD: ${ADMIN_PASSWORD} + LIBREDESK_APP__ENCRYPTION_KEY: ${ENCRYPTION_KEY} + LIBREDESK_APP__ENV: prod + LIBREDESK_APP__LOG_LEVEL: info + # Cottage updates the app; Libredesk's own update banner would only confuse. + LIBREDESK_APP__CHECK_UPDATES: "false" + # Libredesk reads one address from this header; Cloudflare, in front of every Cottage app, + # sets it to the visitor's IP. Without it every visitor shares one rate limit. + LIBREDESK_APP__SERVER__CLIENT_IP_HEADER: CF-Connecting-IP + LIBREDESK_UPLOAD__PROVIDER: fs + LIBREDESK_UPLOAD__FS__UPLOAD_PATH: /libredesk/uploads + volumes: [ "uploads:/libredesk/uploads", "setup:/setup" ] + # Libredesk keeps its own address in its database, and that copy wins over configuration. This + # sets it (and the default favicon address) to the app's real address on every start, then tells + # the app it can start. It stays running because Cottage restarts services that exit. + settings: + image: postgres:18.7-alpine + user: "1000:1000" + depends_on: + db: { condition: service_healthy } + environment: + PGHOST: db + PGUSER: libredesk + PGDATABASE: libredesk + PGPASSWORD: ${DB_PASSWORD} + ROOT_URL: ${HARBOR_PUBLIC_URL} + command: + - sh + - -c + - >- + until psql -tAc "select 1 from settings where key = 'app.root_url'" 2>/dev/null | grep -q 1; do sleep 2; done && + printf '%s\n' + "update settings set value = to_jsonb(:'url'::text), updated_at = now() where key = 'app.root_url';" + "update settings set value = to_jsonb(:'url' || '/favicon.ico'), updated_at = now() where key = 'app.favicon_url' and value = '\"http://localhost:9000/favicon.ico\"'::jsonb;" + | psql -v ON_ERROR_STOP=1 -v url="$$ROOT_URL" -q && + echo "$$ROOT_URL" > /setup/root-url && + while :; do sleep 3600; done + volumes: [ "setup:/setup" ] + db: + image: postgres:18.7-alpine + user: "70:70" + environment: + POSTGRES_DB: libredesk + POSTGRES_USER: libredesk + POSTGRES_PASSWORD: ${DB_PASSWORD} + volumes: [ "db_data:/var/lib/postgresql" ] + healthcheck: + test: [ "CMD", "pg_isready", "-U", "libredesk", "-d", "libredesk" ] + interval: 5s + retries: 30 + redis: + image: redis:8.10.3-alpine + user: "999:1000" + command: [ "redis-server", "--appendonly", "yes" ] + volumes: [ "redis_data:/data" ] + healthcheck: + test: [ "CMD", "redis-cli", "ping" ] + interval: 5s + retries: 30 + +volumes: + uploads: + setup: + db_data: + redis_data: diff --git a/bump/track.yml b/bump/track.yml index c2619b3..e338819 100644 --- a/bump/track.yml +++ b/bump/track.yml @@ -164,6 +164,10 @@ leantime: image_tag: '{version}' repo: Leantime/leantime source: github +libredesk: + image_tag: 'v{version}' + repo: abhinavxd/libredesk + source: github linkding: image_tag: '{version}' repo: sissbruecker/linkding diff --git a/docs/icons.md b/docs/icons.md index 547ac9f..fd00e15 100644 --- a/docs/icons.md +++ b/docs/icons.md @@ -103,7 +103,7 @@ Ask before switching. Each row says why. | Twenty | Trademark policy .github/TRADEMARK.md (Twenty.com, PBC); code licenses grant no trademark rights | [terms](https://github.com/twentyhq/twenty/blob/main/.github/TRADEMARK.md) | | Wealthfolio | TRADEMARKS.md + assets/brand/README.md (Teymz Inc.); brand assets excluded from AGPL-3.0 | [terms](https://github.com/wealthfolio/wealthfolio/blob/main/TRADEMARKS.md) | -## Our icon: the only official logo is a PNG (20) +## Our icon: the only official logo is a PNG (21) Allowed, but the catalog takes only SVG icons. Switch if the project publishes an SVG. @@ -119,6 +119,7 @@ Allowed, but the catalog takes only SVG icons. Switch if the project publishes a | flatnotes | Repo license only (MIT); no trademark policy | | Fusion | Repo license only (MIT); no trademark policy | | Gokapi | Repo license only (AGPL-3.0); no trademark policy | +| Libredesk | Repo licence only (AGPL-3.0); no trademark policy found. Logos are PNG only (frontend/public/images). | | LubeLogger | repo license only (MIT, Hargata Softworks); no trademark policy on repo or lubelogger.com | | Mealie | repo license only (AGPL-3.0); no trademark/brand policy found on repo or mealie.io | | MicroBin | repo license only (BSD-3-Clause); no trademark policy on repo or microbin.eu | diff --git a/docs/licensing.md b/docs/licensing.md index 1cc4da2..78fef6c 100644 --- a/docs/licensing.md +++ b/docs/licensing.md @@ -117,6 +117,7 @@ provider's details. | Keycloak | [keycloak/keycloak](https://github.com/keycloak/keycloak) | Apache-2.0 | Allowed | | [licence](https://github.com/keycloak/keycloak/blob/main/LICENSE.txt) | | Komga | [gotson/komga](https://github.com/gotson/komga) | MIT | Allowed | Deferred: needs file access. | [licence](https://github.com/gotson/komga/blob/master/LICENSE) | | Leantime | [Leantime/leantime](https://github.com/Leantime/leantime) | AGPL-3.0 | Allowed with conditions | AGPL: listing links the exact upstream source; publish any patch we apply. | [licence](https://github.com/Leantime/leantime/blob/master/LICENSE) | +| Libredesk | [abhinavxd/libredesk](https://github.com/abhinavxd/libredesk) | AGPL-3.0 | Allowed with conditions | AGPL: listing links the exact upstream source; publish any patch we apply. Not on PikaPods; added 23 November 2026. | [licence](https://github.com/abhinavxd/libredesk/blob/main/LICENSE) | | Linkding | [sissbruecker/linkding](https://github.com/sissbruecker/linkding) | MIT | Allowed | | [licence](https://github.com/sissbruecker/linkding/blob/master/LICENSE.txt) | | Linkwarden | [linkwarden/linkwarden](https://github.com/linkwarden/linkwarden) | AGPL-3.0 | Allowed with conditions | AGPL: listing links the exact upstream source; publish any patch we apply. | [licence](https://github.com/linkwarden/linkwarden/blob/main/LICENSE.md) | | Listmonk | [knadh/listmonk](https://github.com/knadh/listmonk) | AGPL-3.0 | Allowed with conditions | AGPL: listing links the exact upstream source; publish any patch we apply. | [licence](https://github.com/knadh/listmonk/blob/master/LICENSE) | diff --git a/schema/cottage.schema.json b/schema/cottage.schema.json index 169e858..8e19823 100644 --- a/schema/cottage.schema.json +++ b/schema/cottage.schema.json @@ -39,7 +39,7 @@ "default": { "type": "string", "description": "Always a quoted string, e.g. \"587\"." }, "required": { "type": "boolean" }, "secret": { "type": "boolean", "description": "Shown masked in the dashboard." }, - "generate": { "enum": ["random16", "random32", "hex32"] }, + "generate": { "enum": ["random16", "random32", "hex32", "password"] }, "choices": { "type": "array", "minItems": 1, "items": { "type": "string", "pattern": "^[a-z0-9_]+$" } }, "editable": { "type": "boolean", "description": "The owner may change it after the app exists." }, "group": { "type": "string", "pattern": "^[a-z][a-z0-9-]{0,31}$", "description": "Groups fields in the dashboard. Outgoing mail settings use \"email\"." }, diff --git a/scripts/local-test-plan.py b/scripts/local-test-plan.py index 0e52fd3..1571f15 100644 --- a/scripts/local-test-plan.py +++ b/scripts/local-test-plan.py @@ -23,13 +23,29 @@ with socket.socket() as s: # a free port on this machine port = s.getsockname()[1] # Same as Cottage's servers: random32 and random16 are 24 and 12 characters from this -# alphabet (no look-alike characters), hex32 is 32 hex digits. Match them exactly, so a recipe -# that depends on a secret's length or characters fails here rather than in production. -ALPHA = "abcdefghijkmnpqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789" +# alphabet (no look-alike characters), hex32 is 32 hex digits, and password is 24 characters +# with at least one lowercase, uppercase, digit and symbol (-_.), never starting with a symbol. +# Match them exactly, so a recipe that depends on a secret's length or characters fails here +# rather than in production. +LOWER, UPPER, DIGIT, SYMBOL = "abcdefghijkmnpqrstuvwxyz", "ABCDEFGHJKLMNPQRSTUVWXYZ", "23456789", "-_." +ALPHA = LOWER + UPPER + DIGIT + + +def password(): + chars = [secrets.choice(s) for s in (LOWER, UPPER, DIGIT, SYMBOL)] + chars += [secrets.choice(ALPHA + SYMBOL) for _ in range(20)] + secrets.SystemRandom().shuffle(chars) + if chars[0] in SYMBOL: + i = next(i for i, c in enumerate(chars) if c not in SYMBOL) + chars[0], chars[i] = chars[i], chars[0] + return "".join(chars) + + GEN = { "random32": lambda: "".join(secrets.choice(ALPHA) for _ in range(24)), "random16": lambda: "".join(secrets.choice(ALPHA) for _ in range(12)), "hex32": lambda: secrets.token_hex(16), + "password": password, } env = { # what Cottage's servers provide to every app