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: Plane *WIP* #453

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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
155 changes: 140 additions & 15 deletions templates/plane/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.

Please make the default username and password configurable.
Also, good luck! I spent a month trying to get this to work.

Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,82 @@ export function generate(input: Input): Output {
const services: Services = [];
const secretkey = randomString(32);
const randomPasswordRedis = randomPassword();
const randomPasswordPostgres = randomPassword();
const databasePassword = randomPassword();
const minioPassword = randomPassword();

services.push({
type: "app",
data: {
projectName: input.projectName,
serviceName: input.appFrontendServiceName,
env: [
`NODE_ENV=production`,
`NEXT_PUBLIC_EXTRA_IMAGE_DOMAINS=`,
`NEXT_PUBLIC_GOOGLE_CLIENTID=""`,
`NEXT_PUBLIC_GITHUB_ID=""`,
`NEXT_PUBLIC_GITHUB_APP_NAME=""`,
`NEXT_PUBLIC_SENTRY_DSN=""`,
`NEXT_PUBLIC_ENABLE_OAUTH=0`,
`NEXT_PUBLIC_ENABLE_SENTRY=0`,
`NEXT_PUBLIC_ENABLE_SESSION_RECORDER=0`,
`NEXT_PUBLIC_TRACK_EVENTS=0`,
`NEXT_PUBLIC_SLACK_CLIENT_ID=""`,
`DEBUG=0`,
`SENTRY_DSN=""`,
`DATABASE_URL=postgres://postgres:${databasePassword}@$(PROJECT_NAME)_${input.databaseServiceName}:5432/$(PROJECT_NAME)`,
`REDIS_URL="redis://${input.databaseServiceName}:6379/"`,
`EMAIL_HOST=""`,
`EMAIL_HOST_USER=""`,
`EMAIL_HOST_PASSWORD=""`,
`EMAIL_PORT=587`,
`EMAIL_FROM="Team Plane <[email protected]>"`,
`EMAIL_USE_TLS="1"`,
`EMAIL_USE_SSL="0"`,
`AWS_S3_BUCKET_NAME="uploads"`,
`FILE_SIZE_LIMIT=5242880`,
`OPENAI_API_KEY=""`,
`GPT_ENGINE=""`,
`GITHUB_CLIENT_SECRET=`,
`DOCKERIZED=1`,
`USE_MINIO=1`,
`NGINX_PORT=80`,
`DEFAULT_EMAIL="[email protected]"`,
`DEFAULT_PASSWORD="password123"`,
`ENABLE_SIGNUP="1"`,
`NEXT_PUBLIC_API_BASE_URL=https://$(PRIMARY_DOMAIN)`,
`SECRET_KEY=${secretkey}`,
`WEB_URL=https://$(PRIMARY_DOMAIN)`,
].join("\n"),
source: {
type: "image",
image: input.appFrontendServiceName,
},
domains: [
{
host: "$(EASYPANEL_DOMAIN)",
port: 3000,
},
],
mounts: [
{
type: "volume",
name: "data",
mountPath: "/data/storage",
},
{
type: "volume",
name: "app",
mountPath: "/app/storage",
},
],
},
});

services.push({
type: "app",
data: {
projectName: input.projectName,
serviceName: input.appServiceName,
serviceName: input.appBackendServiceName,
env: [
`NODE_ENV=production`,
`NEXT_PUBLIC_EXTRA_IMAGE_DOMAINS=`,
Expand All @@ -33,14 +100,8 @@ export function generate(input: Input): Output {
`NEXT_PUBLIC_SLACK_CLIENT_ID=""`,
`DEBUG=0`,
`SENTRY_DSN=""`,
`PGUSER=postgres`,
`PGPASSWORD=${randomPasswordPostgres}`,
`PGHOST=$(PROJECT_NAME)_${input.databaseServiceName}`,
`PGDATABASE=$(PROJECT_NAME)`,
`DATABASE_URL=postgresql://${PGUSER}:${PGPASSWORD}@${PGHOST}/${PGDATABASE}`,
`REDIS_HOST="plane-redis"`,
`REDIS_PORT="6379"`,
`REDIS_URL="redis://${REDIS_HOST}:${REDIS_PORT}/"`,
`DATABASE_URL=postgres://postgres:${databasePassword}@$(PROJECT_NAME)_${input.databaseServiceName}:5432/$(PROJECT_NAME)`,
`REDIS_URL="redis://${input.databaseServiceName}:6379/"`,
`EMAIL_HOST=""`,
`EMAIL_HOST_USER=""`,
`EMAIL_HOST_PASSWORD=""`,
Expand All @@ -61,22 +122,86 @@ export function generate(input: Input): Output {
`ENABLE_SIGNUP="1"`,
`NEXT_PUBLIC_API_BASE_URL=https://$(PRIMARY_DOMAIN)`,
`SECRET_KEY=${secretkey}`,
`WEB_URL=https://$(PRIMARY_DOMAIN)`
`WEB_URL=https://$(PRIMARY_DOMAIN)`,
].join("\n"),
source: {
type: "image",
image: input.appServiceImage,
image: input.appBackendServiceName,
},
domains: [
{
host: "$(EASYPANEL_DOMAIN)",
port: 3000,
},
],
deploy: {
command:
"bundle exec rails db:chatwoot_prepare && bundle exec rails s -p 3000 -b 0.0.0.0",
mounts: [
{
type: "volume",
name: "data",
mountPath: "/data/storage",
},
{
type: "volume",
name: "app",
mountPath: "/app/storage",
},
],
},
});

services.push({
type: "app",
data: {
projectName: input.projectName,
serviceName: input.appWorkerServiceName,
env: [
`NODE_ENV=production`,
`NEXT_PUBLIC_EXTRA_IMAGE_DOMAINS=`,
`NEXT_PUBLIC_GOOGLE_CLIENTID=""`,
`NEXT_PUBLIC_GITHUB_ID=""`,
`NEXT_PUBLIC_GITHUB_APP_NAME=""`,
`NEXT_PUBLIC_SENTRY_DSN=""`,
`NEXT_PUBLIC_ENABLE_OAUTH=0`,
`NEXT_PUBLIC_ENABLE_SENTRY=0`,
`NEXT_PUBLIC_ENABLE_SESSION_RECORDER=0`,
`NEXT_PUBLIC_TRACK_EVENTS=0`,
`NEXT_PUBLIC_SLACK_CLIENT_ID=""`,
`DEBUG=0`,
`SENTRY_DSN=""`,
`DATABASE_URL=postgres://postgres:${databasePassword}@$(PROJECT_NAME)_${input.databaseServiceName}:5432/$(PROJECT_NAME)`,
`REDIS_URL="redis://${input.databaseServiceName}:6379/"`,
`EMAIL_HOST=""`,
`EMAIL_HOST_USER=""`,
`EMAIL_HOST_PASSWORD=""`,
`EMAIL_PORT=587`,
`EMAIL_FROM="Team Plane <[email protected]>"`,
`EMAIL_USE_TLS="1"`,
`EMAIL_USE_SSL="0"`,
`AWS_S3_BUCKET_NAME="uploads"`,
`FILE_SIZE_LIMIT=5242880`,
`OPENAI_API_KEY=""`,
`GPT_ENGINE=""`,
`GITHUB_CLIENT_SECRET=`,
`DOCKERIZED=1`,
`USE_MINIO=1`,
`NGINX_PORT=80`,
`DEFAULT_EMAIL="[email protected]"`,
`DEFAULT_PASSWORD="password123"`,
`ENABLE_SIGNUP="1"`,
`NEXT_PUBLIC_API_BASE_URL=https://$(PRIMARY_DOMAIN)`,
`SECRET_KEY=${secretkey}`,
`WEB_URL=https://$(PRIMARY_DOMAIN)`,
].join("\n"),
source: {
type: "image",
image: input.appWorkerServiceImage,
},
domains: [
{
host: "$(EASYPANEL_DOMAIN)",
port: 3000,
},
],
mounts: [
{
type: "volume",
Expand Down
4 changes: 4 additions & 0 deletions templates/plane/meta.yaml
Copy link
Collaborator

Choose a reason for hiding this comment

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

Reminder to change this - makeplane/plane on docker hub for the image (check tags, don't pin latest)

Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ schema:
projectName:
type: string
title: Project Name
appServiceImage:
type: string
title: App Service Image
default: electerious/ackee:3.4.2
defaultLocale:
type: string
title: Default Locale
Expand Down