diff --git a/.github/workflows/build-branch.yml b/.github/workflows/build-branch.yml index 627c782f998..97a15e13e73 100644 --- a/.github/workflows/build-branch.yml +++ b/.github/workflows/build-branch.yml @@ -127,7 +127,7 @@ jobs: apiserver: - apiserver/** proxy: - - nginx/** + - caddy/** admin: - admin/** - packages/** @@ -306,8 +306,8 @@ jobs: docker-token: ${{ secrets.DOCKERHUB_TOKEN }} docker-image-owner: makeplane docker-image-name: ${{ needs.branch_build_setup.outputs.dh_img_proxy }} - build-context: ./nginx - dockerfile-path: ./nginx/Dockerfile + build-context: ./caddy + dockerfile-path: ./caddy/Dockerfile buildx-driver: ${{ needs.branch_build_setup.outputs.gh_buildx_driver }} buildx-version: ${{ needs.branch_build_setup.outputs.gh_buildx_version }} buildx-platforms: ${{ needs.branch_build_setup.outputs.gh_buildx_platforms }} diff --git a/aio/Dockerfile-app b/aio/Dockerfile-app index 54b5269e348..502980ba967 100644 --- a/aio/Dockerfile-app +++ b/aio/Dockerfile-app @@ -11,7 +11,7 @@ WORKDIR /app RUN yarn global add turbo COPY . . -RUN turbo prune --scope=web --scope=space --scope=admin --docker +RUN turbo prune --scope=web --scope=space --scope=admin --scope=live --docker # ***************************************************************************** # STAGE 2: Install dependencies & build the project @@ -53,7 +53,7 @@ ENV NEXT_PUBLIC_WEB_BASE_URL=$NEXT_PUBLIC_WEB_BASE_URL ENV NEXT_TELEMETRY_DISABLED=1 ENV TURBO_TELEMETRY_DISABLED=1 -RUN yarn turbo run build --filter=web --filter=space --filter=admin +RUN yarn turbo run build --filter=web --filter=space --filter=admin --filter=live # ***************************************************************************** # STAGE 3: Copy the project and start it @@ -87,6 +87,8 @@ RUN chmod +x ./api/bin/* RUN chmod -R 777 ./api/ # NEXTJS BUILDS +COPY --from=installer /app/node_modules ./node_modules/ + COPY --from=installer /app/web/next.config.js ./web/ COPY --from=installer /app/web/package.json ./web/ COPY --from=installer /app/web/.next/standalone ./web @@ -105,6 +107,10 @@ COPY --from=installer /app/admin/.next/standalone ./admin COPY --from=installer /app/admin/.next/static ./admin/admin/.next/static COPY --from=installer /app/admin/public ./admin/admin/public +COPY --from=installer /app/live/package.json ./live/ +COPY --from=installer /app/live/dist ./live/dist +# COPY --from=installer /app/live/node_modules ./live/node_modules + ARG NEXT_PUBLIC_API_BASE_URL="" ENV NEXT_PUBLIC_API_BASE_URL=$NEXT_PUBLIC_API_BASE_URL diff --git a/aio/nginx.conf b/aio/nginx.conf index 78ae00d28ce..8093b9fb8ca 100644 --- a/aio/nginx.conf +++ b/aio/nginx.conf @@ -45,6 +45,14 @@ http { proxy_pass http://localhost:3003/god-mode/; } + location /live/ { + proxy_http_version 1.1; + proxy_set_header Upgrade ${dollar}http_upgrade; + proxy_set_header Connection "upgrade"; + proxy_set_header Host ${dollar}http_host; + proxy_pass http://localhost:3004/; + } + location /api/ { proxy_http_version 1.1; proxy_set_header Upgrade ${dollar}http_upgrade; diff --git a/aio/supervisord-app b/aio/supervisord-app index e2cf1f04754..ae0d540dd4e 100644 --- a/aio/supervisord-app +++ b/aio/supervisord-app @@ -29,6 +29,16 @@ stderr_logfile=/dev/stdout stderr_logfile_maxbytes=0 environment=PORT=3003,HOSTNAME=0.0.0.0 +[program:live] +command=node /app/live/dist/server.js +autostart=true +autorestart=true +stdout_logfile=/dev/stdout +stdout_logfile_maxbytes=0 +stderr_logfile=/dev/stdout +stderr_logfile_maxbytes=0 +environment=PORT=3004,HOSTNAME=0.0.0.0,API_BASE_URL="http://localhost:8000" + [program:migrator] directory=/app/api command=sh -c "./bin/docker-entrypoint-migrator.sh" diff --git a/caddy/Caddyfile.template b/caddy/Caddyfile.template new file mode 100644 index 00000000000..4c28a70c99a --- /dev/null +++ b/caddy/Caddyfile.template @@ -0,0 +1,34 @@ +(plane_proxy) { + request_body { + max_size {$FILE_SIZE_LIMIT} + } + + reverse_proxy /spaces/* space:3000 + + reverse_proxy /god-mode/* admin:3000 + + reverse_proxy /live/* live:3000 + + reverse_proxy /api/* api:8000 + + reverse_proxy /auth/* api:8000 + + reverse_proxy /{$BUCKET_NAME}/* plane-minio:9000 + + reverse_proxy /* web:3000 +} + +{ + email {$CERT_EMAIL:admin@example.com} + acme_ca {$CERT_ACME_CA} + {$CERT_ACME_DNS} + servers { + max_header_size 5MB + client_ip_headers X-Forwarded-For X-Real-IP + trusted_proxies static {$TRUSTED_PROXIES:0.0.0.0/0} + } +} + +{$SITE_ADDRESS} { + import plane_proxy +} diff --git a/caddy/Dockerfile b/caddy/Dockerfile new file mode 100644 index 00000000000..5dd666163f3 --- /dev/null +++ b/caddy/Dockerfile @@ -0,0 +1,9 @@ +FROM makeplane/caddy:latest + +COPY ./Caddyfile.template /etc/caddy/Caddyfile + +COPY ./caddy.sh /docker-entrypoint.sh + +RUN chmod +x /docker-entrypoint.sh + +CMD ["/docker-entrypoint.sh"] diff --git a/caddy/caddy.sh b/caddy/caddy.sh new file mode 100644 index 00000000000..0392a16c949 --- /dev/null +++ b/caddy/caddy.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +if [ "$APP_DOMAIN" == "localhost" ]; then + export SITE_ADDRESS=":${LISTEN_HTTP_PORT}" +elif [ "$SSL" == "true" ]; then + export SITE_ADDRESS="${APP_DOMAIN}:${LISTEN_HTTPS_PORT}" +else + export SITE_ADDRESS="http://${APP_DOMAIN}:${LISTEN_HTTP_PORT}" +fi + +exec caddy run --config /etc/caddy/Caddyfile diff --git a/deploy/selfhost/README.md b/deploy/selfhost/README.md index d93d85ca14d..4322c146ded 100644 --- a/deploy/selfhost/README.md +++ b/deploy/selfhost/README.md @@ -55,14 +55,14 @@ Installing plane is a very easy and minimal step process. - User context used must have access to docker services. In most cases, use sudo su to switch as root user - Use the terminal (or gitbash) window to run all the future steps -### Downloading Latest Stable Release +### Downloading Latest Release ``` -mkdir plane-selfhost +mkdir -p plane-selfhost && cd plane-selfhost -cd plane-selfhost +RELEASE_VERSION= -curl -fsSL -o setup.sh https://raw.githubusercontent.com/makeplane/plane/master/deploy/selfhost/install.sh +curl -fsSL -o setup.sh https://github.com/makeplane/plane/releases/download/${RELEASE_VERSION}/setup.sh chmod +x setup.sh ``` @@ -106,11 +106,15 @@ Again the `options [1-8]` will be popped up and this time hit `8` to exit. Before proceeding, we suggest used to review `.env` file and set the values. Below are the most import keys you must refer to. _You can use any text editor to edit this file_. -> `NGINX_PORT` - This is default set to `80`. Make sure the port you choose to use is not preoccupied. (e.g `NGINX_PORT=8080`) - -> `WEB_URL` - This is default set to `http://localhost`. Change this to the FQDN you plan to use along with NGINX_PORT (eg. `https://plane.example.com:8080` or `http://[IP-ADDRESS]:8080`) - -> `CORS_ALLOWED_ORIGINS` - This is default set to `http://localhost`. Change this to the FQDN you plan to use along with NGINX_PORT (eg. `https://plane.example.com:8080` or `http://[IP-ADDRESS]:8080`) +> `APP_DOMAIN` - Set the Fully Qualified Domain Name here. (eg. `plane.example.com`) +> +> `LISTEN_PORT` - This is default set to `80`. Make sure the port you choose to use is not preoccupied. (e.g `LISTEN_PORT=8080`) +> +> `LISTEN_SSL_PORT` - This is default set to `443`. Make sure the port you choose to use is not preoccupied. (e.g `LISTEN_SSL_PORT=8443`) +> +> `WEB_URL` - This is default set to `http://localhost`. Change this to the FQDN you plan to use along with LISTEN_PORT/LISTEN_SSL_PORT (eg. `https://plane.example.com:8443` or `http://[IP-ADDRESS]:8080`) +> +> `CORS_ALLOWED_ORIGINS` - This is default set to `http://${APP_DOMAIN},https://${APP_DOMAIN}`. Change this to the FQDN you plan to use along with LISTEN_PORT and LISTEN_SSL_PORT (eg. `http://plane.example.com:8080,https://plane.example.com:8443`) There are many other settings you can play with, but we suggest you configure `EMAIL SETTINGS` as it will enable you to invite your teammates onto the platform. @@ -134,6 +138,8 @@ Select a Action you want to perform: Action [2]: 2 ``` +> You can also choose to run `./setup.sh start` as direct command. + Expect something like this. ![Downloading docker images](images/download.png) @@ -167,6 +173,8 @@ Select a Action you want to perform: Action [2]: 3 ``` +> You can also choose to run `./setup.sh stop` as direct command. + If all goes well, you must see something like this ![Stop Services](images/stopped.png) @@ -193,6 +201,8 @@ Select a Action you want to perform: Action [2]: 4 ``` +> You can also choose to run `./setup.sh restart` as direct command. + If all goes well, you must see something like this ![Restart Services](images/restart.png) @@ -219,6 +229,8 @@ Select a Action you want to perform: Action [2]: 5 ``` +> You can also choose to run `./setup.sh upgrade` as direct command. + By choosing this, it will stop the services and then will download the latest `docker-compose.yaml` and `plane.env`. You must expect the below message @@ -253,6 +265,7 @@ Select a Action you want to perform: Action [2]: 6 ``` +> You can also choose to run `./setup.sh logs` as direct command. This will further open sub-menu with list of services ```bash @@ -343,6 +356,8 @@ Select a Action you want to perform: Action [2]: 7 ``` +> You can also choose to run `./setup.sh backup` as direct command. + In response, you can find the backup folder ```bash @@ -364,7 +379,8 @@ When you want to restore the previously backed-up data, follow the instructions 1. Download the restore script using the command below. We suggest downloading it in the same folder as `setup.sh`. ```bash - curl -fsSL -o restore.sh https://raw.githubusercontent.com/makeplane/plane/master/deploy/selfhost/restore.sh + RELEASE_VERSION= + curl -fsSL -o restore.sh https://github.com/makeplane/plane/releases/download/${RELEASE_VERSION}/restore.sh chmod +x restore.sh ``` diff --git a/deploy/selfhost/build.yml b/deploy/selfhost/build.yml index b65d297e9fd..d72206549e1 100644 --- a/deploy/selfhost/build.yml +++ b/deploy/selfhost/build.yml @@ -17,6 +17,12 @@ services: context: ./ dockerfile: ./admin/Dockerfile.admin + live: + image: ${DOCKERHUB_USER:-local}/plane-live:${APP_RELEASE:-latest} + build: + context: . + dockerfile: ./live/Dockerfile.live + api: image: ${DOCKERHUB_USER:-local}/plane-backend:${APP_RELEASE:-latest} build: @@ -26,5 +32,5 @@ services: proxy: image: ${DOCKERHUB_USER:-local}/plane-proxy:${APP_RELEASE:-latest} build: - context: ./nginx + context: ./caddy dockerfile: ./Dockerfile diff --git a/deploy/selfhost/docker-compose.yml b/deploy/selfhost/docker-compose.yml index fe47e625f65..f0e7763a32c 100644 --- a/deploy/selfhost/docker-compose.yml +++ b/deploy/selfhost/docker-compose.yml @@ -1,54 +1,66 @@ +x-db-env: &db-env + PGHOST: ${PGHOST:-plane-db} + PGDATABASE: ${PGDATABASE:-plane} + POSTGRES_USER: ${POSTGRES_USER:-plane} + POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-plane} + POSTGRES_DB: ${POSTGRES_DB:-plane} + POSTGRES_PORT: ${POSTGRES_PORT:-5432} + PGDATA: ${PGDATA:-/var/lib/postgresql/data} + +x-redis-env: &redis-env + REDIS_HOST: ${REDIS_HOST:-plane-redis} + REDIS_PORT: ${REDIS_PORT:-6379} + REDIS_URL: ${REDIS_URL:-redis://plane-redis:6379/} + +x-mq-env: &mq-env + RABBITMQ_DEFAULT_USER: ${RABBITMQ_USER:-plane} + RABBITMQ_DEFAULT_PASS: ${RABBITMQ_PASSWORD:-plane} + RABBITMQ_DEFAULT_VHOST: ${RABBITMQ_VHOST:-plane} + +x-data-store-env: &data-store-env + USE_MINIO: ${USE_MINIO:-1} + MINIO_ROOT_USER: ${MINIO_ROOT_USER:-access-key} + MINIO_ROOT_PASSWORD: ${MINIO_ROOT_PASSWORD:-secret-key} + AWS_REGION: ${AWS_REGION:-} + AWS_ACCESS_KEY_ID: ${AWS_ACCESS_KEY_ID:-access-key} + AWS_SECRET_ACCESS_KEY: ${AWS_SECRET_ACCESS_KEY:-secret-key} + AWS_S3_ENDPOINT_URL: ${AWS_S3_ENDPOINT_URL:-http://plane-minio:9000} + AWS_S3_BUCKET_NAME: ${AWS_S3_BUCKET_NAME:-uploads} + BUCKET_NAME: ${BUCKET_NAME:-uploads} + +x-proxy-env: &proxy-env + SSL: ${SSL:-false} + APP_DOMAIN: ${APP_DOMAIN:-localhost} + FILE_SIZE_LIMIT: ${FILE_SIZE_LIMIT:-5242880} + CERT_EMAIL: ${CERT_EMAIL:-admin@example.com} + CERT_ACME_CA: ${CERT_ACME_CA:-} + LISTEN_HTTP_PORT: ${LISTEN_PORT:-80} + LISTEN_HTTPS_PORT: ${LISTEN_SSL_PORT:-443} + +x-live-env: &live-env + API_BASE_URL: ${API_BASE_URL:-http://api:8000} + x-app-env: &app-env - environment: - - NGINX_PORT=${NGINX_PORT:-80} - - WEB_URL=${WEB_URL:-http://localhost} - - DEBUG=${DEBUG:-0} - - SENTRY_DSN=${SENTRY_DSN:-""} - - SENTRY_ENVIRONMENT=${SENTRY_ENVIRONMENT:-"production"} - - CORS_ALLOWED_ORIGINS=${CORS_ALLOWED_ORIGINS:-} - # Gunicorn Workers - - GUNICORN_WORKERS=${GUNICORN_WORKERS:-1} - #DB SETTINGS - - PGHOST=${PGHOST:-plane-db} - - PGDATABASE=${PGDATABASE:-plane} - - POSTGRES_USER=${POSTGRES_USER:-plane} - - POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-plane} - - POSTGRES_DB=${POSTGRES_DB:-plane} - - POSTGRES_PORT=${POSTGRES_PORT:-5432} - - PGDATA=${PGDATA:-/var/lib/postgresql/data} - - DATABASE_URL=${DATABASE_URL:-postgresql://plane:plane@plane-db/plane} - # REDIS SETTINGS - - REDIS_HOST=${REDIS_HOST:-plane-redis} - - REDIS_PORT=${REDIS_PORT:-6379} - - REDIS_URL=${REDIS_URL:-redis://plane-redis:6379/} - - # RabbitMQ Settings - - RABBITMQ_HOST=${RABBITMQ_HOST:-plane-mq} - - RABBITMQ_PORT=${RABBITMQ_PORT:-5672} - - RABBITMQ_DEFAULT_USER=${RABBITMQ_USER:-plane} - - RABBITMQ_DEFAULT_PASS=${RABBITMQ_PASSWORD:-plane} - - RABBITMQ_DEFAULT_VHOST=${RABBITMQ_VHOST:-plane} - - RABBITMQ_VHOST=${RABBITMQ_VHOST:-plane} - - AMQP_URL=${AMQP_URL:-amqp://plane:plane@plane-mq:5672/plane} - # Application secret - - SECRET_KEY=${SECRET_KEY:-60gp0byfz2dvffa45cxl20p1scy9xbpf6d8c5y0geejgkyp1b5} - # DATA STORE SETTINGS - - USE_MINIO=${USE_MINIO:-1} - - AWS_REGION=${AWS_REGION:-} - - AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID:-"access-key"} - - AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY:-"secret-key"} - - AWS_S3_ENDPOINT_URL=${AWS_S3_ENDPOINT_URL:-http://plane-minio:9000} - - AWS_S3_BUCKET_NAME=${AWS_S3_BUCKET_NAME:-uploads} - - MINIO_ROOT_USER=${MINIO_ROOT_USER:-"access-key"} - - MINIO_ROOT_PASSWORD=${MINIO_ROOT_PASSWORD:-"secret-key"} - - BUCKET_NAME=${BUCKET_NAME:-uploads} - - FILE_SIZE_LIMIT=${FILE_SIZE_LIMIT:-5242880} - # Live server env - - API_BASE_URL=${API_BASE_URL:-http://api:8000} + WEB_URL: ${WEB_URL:-http://localhost} + DEBUG: ${DEBUG:-0} + SENTRY_DSN: ${SENTRY_DSN} + SENTRY_ENVIRONMENT: ${SENTRY_ENVIRONMENT:-production} + CORS_ALLOWED_ORIGINS: ${CORS_ALLOWED_ORIGINS} + GUNICORN_WORKERS: 1 + DATABASE_URL: ${DATABASE_URL:-postgresql://plane:plane@plane-db/plane} + SECRET_KEY: ${SECRET_KEY:-60gp0byfz2dvffa45cxl20p1scy9xbpf6d8c5y0geejgkyp1b5} + ADMIN_BASE_URL: ${ADMIN_BASE_URL} + SPACE_BASE_URL: ${SPACE_BASE_URL} + APP_BASE_URL: ${APP_BASE_URL} + RABBITMQ_HOST: ${RABBITMQ_HOST:-plane-mq} + RABBITMQ_PORT: ${RABBITMQ_PORT:-5672} + RABBITMQ_USER: ${RABBITMQ_USER:-plane} + RABBITMQ_PASSWORD: ${RABBITMQ_PASSWORD:-plane} + RABBITMQ_VHOST: ${RABBITMQ_VHOST:-plane} + AMQP_URL: ${AMQP_URL} services: web: - <<: *app-env image: ${DOCKERHUB_USER:-makeplane}/plane-frontend:${APP_RELEASE:-stable} platform: ${DOCKER_PLATFORM:-} pull_policy: if_not_present @@ -61,7 +73,6 @@ services: - worker space: - <<: *app-env image: ${DOCKERHUB_USER:-makeplane}/plane-space:${APP_RELEASE:-stable} platform: ${DOCKER_PLATFORM:-} pull_policy: if_not_present @@ -75,7 +86,6 @@ services: - web admin: - <<: *app-env image: ${DOCKERHUB_USER:-makeplane}/plane-admin:${APP_RELEASE:-stable} platform: ${DOCKER_PLATFORM:-} pull_policy: if_not_present @@ -88,12 +98,13 @@ services: - web live: - <<: *app-env image: ${DOCKERHUB_USER:-makeplane}/plane-live:${APP_RELEASE:-stable} platform: ${DOCKER_PLATFORM:-} pull_policy: if_not_present restart: unless-stopped command: node live/dist/server.js live + environment: + <<: [ *live-env, *redis-env ] deploy: replicas: ${LIVE_REPLICAS:-1} depends_on: @@ -101,7 +112,6 @@ services: - web api: - <<: *app-env image: ${DOCKERHUB_USER:-makeplane}/plane-backend:${APP_RELEASE:-stable} platform: ${DOCKER_PLATFORM:-} pull_policy: if_not_present @@ -111,14 +121,14 @@ services: replicas: ${API_REPLICAS:-1} volumes: - logs_api:/code/plane/logs + environment: + <<: [ *app-env, *db-env, *redis-env, *data-store-env, *proxy-env ] depends_on: - plane-db - plane-redis - plane-mq - worker: - <<: *app-env image: ${DOCKERHUB_USER:-makeplane}/plane-backend:${APP_RELEASE:-stable} platform: ${DOCKER_PLATFORM:-} pull_policy: if_not_present @@ -126,6 +136,8 @@ services: command: ./bin/docker-entrypoint-worker.sh volumes: - logs_worker:/code/plane/logs + environment: + <<: [ *app-env, *db-env, *redis-env, *data-store-env, *proxy-env ] depends_on: - api - plane-db @@ -133,7 +145,6 @@ services: - plane-mq beat-worker: - <<: *app-env image: ${DOCKERHUB_USER:-makeplane}/plane-backend:${APP_RELEASE:-stable} platform: ${DOCKER_PLATFORM:-} pull_policy: if_not_present @@ -141,6 +152,8 @@ services: command: ./bin/docker-entrypoint-beat.sh volumes: - logs_beat-worker:/code/plane/logs + environment: + <<: [ *app-env, *db-env, *redis-env, *data-store-env, *proxy-env ] depends_on: - api - plane-db @@ -148,7 +161,6 @@ services: - plane-mq migrator: - <<: *app-env image: ${DOCKERHUB_USER:-makeplane}/plane-backend:${APP_RELEASE:-stable} platform: ${DOCKER_PLATFORM:-} pull_policy: if_not_present @@ -156,52 +168,63 @@ services: command: ./bin/docker-entrypoint-migrator.sh volumes: - logs_migrator:/code/plane/logs + environment: + <<: [ *app-env, *db-env, *redis-env, *data-store-env, *proxy-env ] depends_on: - plane-db - plane-redis plane-db: - <<: *app-env image: postgres:15.7-alpine pull_policy: if_not_present restart: unless-stopped command: postgres -c 'max_connections=1000' + environment: + <<: *db-env volumes: - pgdata:/var/lib/postgresql/data plane-redis: - <<: *app-env image: valkey/valkey:7.2.5-alpine pull_policy: if_not_present restart: unless-stopped + environment: + <<: *redis-env volumes: - redisdata:/data plane-mq: - <<: *app-env image: rabbitmq:3.13.6-management-alpine restart: always + environment: + <<: *mq-env volumes: - rabbitmq_data:/var/lib/rabbitmq plane-minio: - <<: *app-env image: minio/minio:latest pull_policy: if_not_present restart: unless-stopped command: server /export --console-address ":9090" + environment: + <<: *data-store-env volumes: - uploads:/export # Comment this if you already have a reverse proxy running proxy: - <<: *app-env image: ${DOCKERHUB_USER:-makeplane}/plane-proxy:${APP_RELEASE:-stable} platform: ${DOCKER_PLATFORM:-} pull_policy: if_not_present restart: unless-stopped ports: - - ${NGINX_PORT}:80 + - ${LISTEN_HTTP_PORT:-80}:${LISTEN_HTTP_PORT:-80} + - ${LISTEN_HTTPS_PORT:-443}:${LISTEN_HTTPS_PORT:-443} + volumes: + - caddy_config:/config + - caddy_data:/data + environment: + <<: *proxy-env depends_on: - web - api @@ -210,10 +233,11 @@ services: volumes: pgdata: redisdata: - uploads: logs_api: logs_worker: logs_beat-worker: logs_migrator: + caddy_config: + caddy_data: rabbitmq_data: diff --git a/deploy/selfhost/install.sh b/deploy/selfhost/install.sh index 08cd4d9169e..b008689c4b1 100755 --- a/deploy/selfhost/install.sh +++ b/deploy/selfhost/install.sh @@ -1,6 +1,7 @@ #!/bin/bash BRANCH=${BRANCH:-master} +RELEASE_TAG=${RELEASE_TAG:-v0.22-dev} SCRIPT_DIR=$PWD SERVICE_FOLDER=plane-app PLANE_INSTALL_DIR=$PWD/$SERVICE_FOLDER @@ -166,11 +167,13 @@ function syncEnvFile(){ updateEnvFile "$key" "$value" "$DOCKER_ENV_PATH" fi done < "$DOCKER_ENV_PATH" + # Replace APP_RELEASE with the latest value + updateEnvFile "APP_RELEASE" "$APP_RELEASE" "$DOCKER_ENV_PATH" fi echo "Environment variables synced successfully" >&2 } -function buildYourOwnImage(){ +function buildYourOwnImage() { echo "Building images locally..." export DOCKERHUB_USER="myplane" @@ -233,7 +236,16 @@ function download() { fi curl -H 'Cache-Control: no-cache, no-store' -s -o $PLANE_INSTALL_DIR/docker-compose.yaml https://raw.githubusercontent.com/makeplane/plane/$BRANCH/deploy/selfhost/docker-compose.yml?$(date +%s) + if [ $? -ne 0 ]; then + echo "Failed to download the docker-compose.yaml file. Exiting..." + exit 1 + fi + curl -H 'Cache-Control: no-cache, no-store' -s -o $PLANE_INSTALL_DIR/variables-upgrade.env https://raw.githubusercontent.com/makeplane/plane/$BRANCH/deploy/selfhost/variables.env?$(date +%s) + if [ $? -ne 0 ]; then + echo "Failed to download the variables.env file. Exiting..." + exit 1 + fi if [ -f "$DOCKER_ENV_PATH" ]; then @@ -339,7 +351,7 @@ function upgrade() { stopServices echo - echo "***** DOWNLOADING STABLE VERSION ****" + echo "***** DOWNLOADING $APP_RELEASE VERSION ****" install echo "***** PLEASE VALIDATE AND START SERVICES ****" diff --git a/deploy/selfhost/variables.env b/deploy/selfhost/variables.env index b5221c71a1c..f41745c2de5 100644 --- a/deploy/selfhost/variables.env +++ b/deploy/selfhost/variables.env @@ -1,17 +1,19 @@ APP_DOMAIN=localhost APP_RELEASE=stable +SSL=false WEB_REPLICAS=1 SPACE_REPLICAS=1 ADMIN_REPLICAS=1 API_REPLICAS=1 -NGINX_PORT=80 +LISTEN_PORT=80 +LISTEN_SSL_PORT=443 WEB_URL=http://${APP_DOMAIN} DEBUG=0 SENTRY_DSN= SENTRY_ENVIRONMENT=production -CORS_ALLOWED_ORIGINS=http://${APP_DOMAIN} +CORS_ALLOWED_ORIGINS=http://${APP_DOMAIN},https://${APP_DOMAIN} API_BASE_URL=http://api:8000 #DB SETTINGS @@ -29,6 +31,11 @@ REDIS_HOST=plane-redis REDIS_PORT=6379 REDIS_URL= +# If SSL Cert to be generated, set CERT_EMAIL and APP_PROTOCOL to https +CERT_EMAIL= +CERT_ACME_CA=https://acme-v02.api.letsencrypt.org/directory +TRUSTED_PROXIES=0.0.0.0/0 + # RabbitMQ Settings RABBITMQ_HOST=plane-mq RABBITMQ_PORT=5672 diff --git a/plane-enterprise-1.0.7.tgz b/plane-enterprise-1.0.7.tgz new file mode 100644 index 00000000000..5f4a1cbb657 Binary files /dev/null and b/plane-enterprise-1.0.7.tgz differ