diff --git a/.env b/.env index 3d3e74e..ceb45a0 100644 --- a/.env +++ b/.env @@ -131,6 +131,7 @@ COMET_HOSTNAME=comet.${DOMAIN} DASHDOT_HOSTNAME=dash.${DOMAIN} DEBRIDAV_HOSTNAME=debridav.${DOMAIN} DECYPHARR_HOSTNAME=decypharr.${DOMAIN} +DISCORD_TICKETS_HOSTNAME=tickets.${DOMAIN} DOCKGE_HOSTNAME=dockge.${DOMAIN} DOZZLE_HOSTNAME=dozzle.${DOMAIN} EASYNEWS_PLUS_HOSTNAME=easynews-plus.${DOMAIN} diff --git a/apps/cloudflare-ddns/compose.yaml b/apps/cloudflare-ddns/compose.yaml index 40fa495..e8b145e 100644 --- a/apps/cloudflare-ddns/compose.yaml +++ b/apps/cloudflare-ddns/compose.yaml @@ -30,6 +30,7 @@ services: ${DASHDOT_HOSTNAME}, ${DEBRIDAV_HOSTNAME}, ${DECYPHARR_HOSTNAME}, + ${DISCORD_TICKETS_HOSTNAME}, ${DOCKGE_HOSTNAME}, ${DOZZLE_HOSTNAME}, ${EASYNEWS_PLUS_HOSTNAME}, diff --git a/apps/discord-tickets/.env b/apps/discord-tickets/.env new file mode 100644 index 0000000..b54cd3c --- /dev/null +++ b/apps/discord-tickets/.env @@ -0,0 +1,37 @@ +# Your Discord bot details. +# Follow guide at https://discordtickets.app/self-hosting/installation/docker/#creating-the-discord-application +# to see where to get these values. +# Your redirect URI would be https://tickets.yourdomain.com/auth/callback +DISCORD_SECRET= +DISCORD_TOKEN= + +# Generate an encryption key using the command: +# openssl rand -hex 32 +ENCRYPTION_KEY= + +# Comma separated list to define super users. (users who have elevated privileges) +# You can find your user ID by right clicking your name in Discord and clicking "Copy ID" (Assuming Developer Mode is enabled) +# You should set this to your own user ID. +SUPER_USERS= + +# Make sure the permissions of the ${DOCKER_DATA_DIR}/discord-tickets are set to the correct permissions. +# After starting discord-tickets, run this command to check what user it is +# sudo docker exec -it discord-tickets id +# You'll see a uid and gid, which you can use to set the permissions using the command: +# sudo chown -R : ${DOCKER_DATA_DIR}/discord-tickets +# For oracle users, it will likely be 1001:1001, and otherwise it would be 1000:1000. + +# After starting the bot, and it is healthy, we need to publish its commands. +# First, find the container ID of the discord-tickets container using: +# sudo docker ps --filter name=discord-tickets +# Then run the following commands to publish the commands: +# sudo docker attach +# commands publish + +# Follow https://discordtickets.app/configuration/ +# to add the bot to your server and configure it. + +# Make sure to +# Can be left as is as our database is not exposed. +MYSQL_PASSWORD=insecure +MYSQL_ROOT_PASSWORD=insecure \ No newline at end of file diff --git a/apps/discord-tickets/compose.yaml b/apps/discord-tickets/compose.yaml new file mode 100644 index 0000000..edd88ba --- /dev/null +++ b/apps/discord-tickets/compose.yaml @@ -0,0 +1,62 @@ +services: + discord-tickets: + image: eartharoid/discord-tickets:4.0 + container_name: discord-tickets + restart: unless-stopped + expose: + - 8169 + tty: true + stdin_open: true + environment: + DB_CONNECTION_URL: mysql://tickets:${MYSQL_PASSWORD?}@discord-tickets_mysql:3306/tickets + DISCORD_SECRET: ${DISCORD_SECRET?} + DISCORD_TOKEN: ${DISCORD_TOKEN?} + ENCRYPTION_KEY: ${ENCRYPTION_KEY?} + DB_PROVIDER: mysql + HTTP_EXTERNAL: https://${DISCORD_TICKETS_HOSTNAME?} + HTTP_HOST: 0.0.0.0 + # HTTP_INTERNAL: http://discord-tickets:8169 + HTTP_INTERNAL: http://localhost:8169 + HTTP_PORT: 8169 + HTTP_TRUST_PROXY: "true" + INVALIDATE_TOKENS: + OVERRIDE_ARCHIVE: null + PUBLIC_BOT: "false" + PUBLISH_COMMANDS: "false" + SUPER: ${SUPER_USERS?} + labels: + - "traefik.enable=true" + - "traefik.http.routers.discord-tickets.rule=Host(`${DISCORD_TICKETS_HOSTNAME?}`)" + - "traefik.http.routers.discord-tickets.entrypoints=websecure" + - "traefik.http.routers.discord-tickets.tls.certresolver=letsencrypt" + - "traefik.http.services.discord-tickets.loadbalancer.server.port=8169" + volumes: + - ${DOCKER_DATA_DIR}/discord-tickets:/home/container/user + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro + depends_on: + discord-tickets_mysql: + condition: service_healthy + profiles: + - discord-tickets + - all + + discord-tickets_mysql: + image: mysql:8 + container_name: discord-tickets_mysql + restart: unless-stopped + volumes: + - ${DOCKER_DATA_DIR}/discord-tickets/db:/var/lib/mysql + environment: + MYSQL_DATABASE: tickets + MYSQL_PASSWORD: ${MYSQL_PASSWORD?} + MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD?} + MYSQL_USER: tickets + healthcheck: + test: ["CMD-SHELL", "mysqladmin ping -h localhost -u tickets --password=${MYSQL_PASSWORD?}"] + start_period: 30s + interval: 30s + retries: 5 + profiles: + - discord-tickets + - all diff --git a/compose.yaml b/compose.yaml index abd11af..faadc9b 100644 --- a/compose.yaml +++ b/compose.yaml @@ -19,6 +19,7 @@ include: - apps/crowdsec/compose.yaml - apps/dash/compose.yaml - apps/decypharr/compose.yaml + - apps/discord-tickets/compose.yaml - apps/dockge/compose.yaml - apps/dozzle/compose.yaml - apps/easynews-plus/compose.yaml