polonel / trudesk

:coffee: :seedling: Trudesk is an open-source help desk/ticketing solution.
http://trudesk.io
Other
1.32k stars 444 forks source link

CONTRIBUTION - Created/tested Trudesk template for Caprover PaaS One-Click-Apps #665

Closed nativeit closed 6 months ago

nativeit commented 7 months ago

Is this a BUG REPORT or FEATURE REQUEST?:

What happened: I adapted the Docker Compose spec to be used with the fantastic Caprover PaaS one-click-app templates.

What did you expect to happen: An awesome open source help desk with supporting database and elasticsearch are provisioned, connected, and launched successfully behind a secured Nginx reverse proxy with Lets Encrypt SSL with minimal effort.

How to reproduce it (as minimally and precisely as possible):

  1. Setup a server with Caprover.
  2. Choose to deploy a new "One-Click App" and either select Trudesk from its presets (pending PR approval/merge), or copy/paste the code below into a generic Template.
  3. Launch using default settings.
  4. ?
  5. Profit.

Anything else we need to know?: This has been tested (and is working a treat!) with Debian 10/11, using the settings found in the official Docker Compose file, Trudesk docs, and bits and pieces from previously closed issues. I will be submitting a PR to include Trudesk in Caprover's official One Click Apps directory, after which Trudesk can be deployed to a Caprover instance/cluster with just a few clicks.

Environment:

captainVersion: 4
services:
    $$cap_appname:
        image: polonel/trudesk:$$cap_trudesk_version
        volumes:
            - $$cap_appname-data:/usr/src/trudesk/public/uploads
            - $$cap_appname-plugins:/usr/src/trudesk/plugins
            - $$cap_appname-backups:/usr/src/trudesk/backups
        depends_on:
            - $$cap_appname-mongodb
            - $$cap_appname-elasticsearch
        restart: always
        environment:
            NODE_ENV: $$cap_node_env
            TRUDESK_DOCKER: "true"
            TD_MONGODB_SERVER: srv-captain--$$cap_appname-mongodb
            TD_MONGODB_PORT: $$cap_appname-mongodb-port
            TD_MONGODB_USERNAME: root
            TD_MONGODB_PASSWORD: $$cap_mongo_password
            TD_MONGODB_DATABASE: trudesk
            TD_MONGODB_URI: "mongodb://root:$$cap_mongo_password@srv-captain--$$cap_appname-mongodb:27017/trudesk?authSource=admin"
            ELATICSEARCH_URI: http://srv-captain--$$cap_appname-elasticsearch:9200
            USE_XFORWARDIP: "true"
        caproverExtra:
            containerHttpPort: '8118'
    $$cap_appname-mongodb:
        image: mongo:$$cap_mongodb_version
        volumes:
            - $$cap_appname-db-data:/data/db
            - $$cap_appname-db-config:/var/lib/mongo
        restart: always
        environment:
            MONGO_INITDB_ROOT_USERNAME: root
            MONGO_INITDB_ROOT_PASSWORD: $$cap_mongo_password
        caproverExtra:
            notExposeAsWebApp: 'true'
    $$cap_appname-elasticsearch:
        image: elasticsearch:$$cap_elasticsearch_version
        volumes:
            - $$cap_appname-elasticsearch-data:/usr/share/elasticsearch/data
        restart: always
        environment:
            xpack.security.enabled: $$cap_elasticsearch_security_enabled
            xpack.security.http.ssl.enabled: $$cap_elasticsearch_security_enabled
            discovery.type: single-node
            node.name: estrudesk01
            bootstrap.memory_lock: true
            ES_JAVA_OPTS: "-Xms512m -Xmx512m"
        caproverExtra:
            notExposeAsWebApp: 'true'
caproverOneClickApp:
    variables:
        - id: $$cap_trudesk_version
          label: Trudesk Version
          defaultValue: '1.2.10'
          description: Check out their docker page for the valid tags https://hub.docker.com/r/polonel/trudesk/tags
          validRegex: /^([^\s^\/])+$/
        - id: $$cap_mongodb_version
          label: MongoDB Version
          defaultValue: '5.0.26'
          description: Check out their docker page for the valid tags https://hub.docker.com/r/library/mongo/tags/
          validRegex: /^([^\s^\/])+$/
        - id: $$cap_appname-mongodb-port
          label: MongoDB Port
          defaultValue: '27017'
          description: MongoDB port
          validRegex: /^([^\s^\/])+$/
        - id: $$cap_elasticsearch_version
          label: Elasticsearch Version
          defaultValue: '8.13.0'
          description: Check out their docker page for the valid tags https://hub.docker.com/_/elasticsearch
          validRegex: /^([^\s^\/])+$/
        - id: $$cap_elasticsearch_security_enabled
          label: Security Enabled
          defaultValue: 'false'
          description: 'When you enable this option, Elasticsearch will create a random password (see startup logs) for the `elastic` user and create SSL certificates required for authentication. **It is recommended to leave this off for a quick setup**. Warning: make sure to enable HTTP Basic Auth in CapRover!'
          validRegex: /^([^\s^\/])+$/
        - id: $$cap_node_env
          label: Application Environment
          description: NodeJS application environment. Should be either `production` or `development`
          defaultValue: production
          validRegex: /^(production|development)$/
        - id: $$cap_mongo_password
          label: MongoDB Root Password
          defaultValue: $$cap_gen_random_hex(16)
          description: MongoDB root password
          validRegex: /^([^\s^\/])+$/
    instructions:
        start: |-
            Trudesk is built with nodejs and mongodb and can run on any cloud provider, docker, bare-metal, or even a raspberry pi.
        end: |-
            Trudesk has been successfully deployed! 

            **IMPORTANT**: The intial setup process may take a few minutes. Please be patient.

            Please perform the following steps:
            1. Go to the **HTTP Settings** of `$$cap_appname` and **Enable WebSocket Support**. Enabling **HTTPS** is also recommended.
            2. Visit your Trudesk instance at `http://$$cap_appname.$$cap_root_domain` and create your account
            3. Have fun with Trudesk!
    displayName: 'Trudesk'
    isOfficial: true
    description: Trudesk is an open-source help desk/ticketing solution.
    documentation: Taken from https://trudesk.io/docs
github-actions[bot] commented 6 months ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] commented 6 months ago

This issue was closed because it has been stalled for 5 days with no activity.