Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add: Trudesk #452

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
52 changes: 16 additions & 36 deletions templates/trudesk/index.ts
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

elasticsearch URI should not be hardcoded.

Elasticsearch is NOT a template, so if you'd like to add that too, feel free to do so.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How? :) IDK how to do it. Any idea?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like you got it

matbrgz marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

elasticsearch URL is still hardcoded!

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I said in last review, I have no idea how to prooced.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$(PROJECT_NAME)_${input.searchServiceName} may work

Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,18 @@ import { Input } from "./meta";
export function generate(input: Input): Output {
const services: Services = [];
const secretkey = randomString(32);
const randomPasswordRedis = randomPassword();
const randomPasswordPostgres = randomPassword();
const mongoPassword = randomPassword();

services.push({
type: "app",
data: {
projectName: input.projectName,
serviceName: input.appServiceName,
env: [
`SECRET_KEY_BASE=${secretkey}`,
`FRONTEND_URL=https://$(PRIMARY_DOMAIN)`,
`DEFAULT_LOCALE=${input.defaultLocale}`,
`FORCE_SSL=true`,
`ENABLE_ACCOUNT_SIGNUP=true`,
`REDIS_URL=redis://default@$(PROJECT_NAME)_${input.redisServiceName}:6379`,
`REDIS_PASSWORD=${randomPasswordRedis}`,
`REDIS_OPENSSL_VERIFY_MODE=none`,
`POSTGRES_DATABASE=$(PROJECT_NAME)`,
`POSTGRES_HOST=$(PROJECT_NAME)_${input.databaseServiceName}`,
`POSTGRES_USERNAME=postgres`,
`POSTGRES_PASSWORD=${randomPasswordPostgres}`,
`RAILS_MAX_THREADS=5`,
`NODE_ENV=production`,
`RAILS_ENV=production`,
`INSTALLATION_ENV=docker`,
`TRUDESK_DOCKER=true `,
`TD_MONGODB_SERVER=mongodb://mongo:${mongoPassword}@$(PROJECT_NAME)_${input.databaseServiceName}:27017`,
`ELATICSEARCH_URI=http://elasticsearch:9200`,
].join("\n"),
source: {
type: "image",
Expand All @@ -42,46 +29,39 @@ export function generate(input: Input): Output {
domains: [
{
host: "$(EASYPANEL_DOMAIN)",
port: 3000,
port: 8118,
},
],
deploy: {
command:
"bundle exec rails db:chatwoot_prepare && bundle exec rails s -p 3000 -b 0.0.0.0",
},
mounts: [
{
type: "volume",
name: "data",
name: "uploads",
mountPath: "/data/storage",
},
{
type: "volume",
name: "plugins",
mountPath: "/data/storage",
},
{
type: "volume",
name: "app",
name: "backups",
mountPath: "/app/storage",
},
],
},
});

services.push({
type: "redis",
data: {
projectName: input.projectName,
serviceName: input.redisServiceName,
password: randomPasswordRedis,
},
});

services.push({
type: "postgres",
type: "mongo",
data: {
projectName: input.projectName,
serviceName: input.databaseServiceName,
image: "postgres:12",
password: randomPasswordPostgres,
password: mongoPassword,
},
});

/* TODO: ADD elasticsearch */

return { services };
}
18 changes: 4 additions & 14 deletions templates/trudesk/meta.yaml
matbrgz marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -32,24 +32,14 @@ schema:
appServiceName:
type: string
title: App Service Name
default: chatwoot
default: trudesk
appServiceImage:
type: string
title: App Service Image
default: chatwoot/chatwoot:v2.17.1
default: polonel/trudesk:1.2.9
databaseServiceName:
type: string
title: Database Service Name
default: chatwoot-db
redisServiceName:
type: string
title: Redis Service Name
default: chatwoot-redis
benefits:
- title: TODO
description: TODO
features:
- title: TODO
description: TODO
default: trudesk-db
tags:
- TODO
- CRM