From a60786e7d92db45b27f4c76085b52701985fa8ea Mon Sep 17 00:00:00 2001
From: srinivaspendem <you@example.comsrinivaspendem2612@gmail.com>
Date: Mon, 2 Oct 2023 14:18:23 +0530
Subject: [PATCH] Updating new selhosted env setup

---
 src/components/Layout.jsx |   2 +-
 src/pages/self-hosting.md | 128 ++++++++++++++++++++++++++------------
 src/styles/docsearch.css  |  19 ++++--
 3 files changed, 104 insertions(+), 45 deletions(-)

diff --git a/src/components/Layout.jsx b/src/components/Layout.jsx
index 5504cb8..e4d6f1b 100644
--- a/src/components/Layout.jsx
+++ b/src/components/Layout.jsx
@@ -219,7 +219,7 @@ export function Layout({ children, title, tableOfContents }) {
           <div className="absolute inset-y-0 right-0 w-[50vw] bg-slate-50 dark:hidden" />
           <div className="absolute bottom-0 right-0 top-16 hidden h-12 w-px bg-gradient-to-t from-slate-800 dark:block" />
           <div className="absolute bottom-0 right-0 top-28 hidden w-px bg-slate-800 dark:block" />
-          <div className="sticky top-[4.5rem] -ml-0.5 h-[calc(100vh-4.5rem)] overflow-y-auto overflow-x-hidden py-16 pl-0.5">
+          <div className="scrollbar-hidden sticky top-[4.5rem] -ml-0.5 h-[calc(100vh-4.5rem)] overflow-y-auto overflow-x-hidden py-16 pl-0.5">
             <Navigation
               navigation={navigation}
               className="w-56 pr-8 xl:w-56 xl:pr-16"
diff --git a/src/pages/self-hosting.md b/src/pages/self-hosting.md
index 6e7494b..ff0c2a9 100644
--- a/src/pages/self-hosting.md
+++ b/src/pages/self-hosting.md
@@ -26,44 +26,36 @@ git clone --depth 1 -b master https://github.com/makeplane/plane.git && cd plane
 This script sets up the environment with the IP address or the Domain name you provided.
 
 ```bash
-./setup.sh http://<your_ip|domain_name>
+./setup.sh
 ```
 
-{% callout type="note" %}
-`<your_ip>` is a placeholder for the actual IP address
-that you'd want your Plane instance to be available on.
+### Environment Variables
 
-If you are setting Plane up, for example, on your own PC,
-it is recommended to use `localhost` for the IP address.
-{% /callout %}
+The Docker setup has undergone a major overhaul. Instead of a single `.env` file, there are now four distinct `.env` files. The `setup.sh` script no longer requires an argument; you can run it without specifying one. It will copy all four `.env.example` files and replace them with the corresponding `.env` files in three different folders. Additionally, it will append the `SECRET_KEY` to the `apiserver/.env` file.
 
-### Environment Variables
-```bash
-# Frontend
-# Extra image domains that need to be added for Next Image
-NEXT_PUBLIC_EXTRA_IMAGE_DOMAINS=
-# Google Client ID for Google OAuth
-NEXT_PUBLIC_GOOGLE_CLIENTID=""
-# Github ID for Github OAuth
-NEXT_PUBLIC_GITHUB_ID=""
-# Github App Name for GitHub Integration
-NEXT_PUBLIC_GITHUB_APP_NAME=""
-# Sentry DSN for error monitoring
-NEXT_PUBLIC_SENTRY_DSN=""
-# Enable/Disable OAUTH - default 0 for selfhosted instance 
+#### web/.env.example
+
+```
+# Enable/Disable OAUTH - default 0 for selfhosted instance
 NEXT_PUBLIC_ENABLE_OAUTH=0
-# Enable/Disable sentry
-NEXT_PUBLIC_ENABLE_SENTRY=0
-# Enable/Disable session recording 
-NEXT_PUBLIC_ENABLE_SESSION_RECORDER=0
-# Enable/Disable event tracking
-NEXT_PUBLIC_TRACK_EVENTS=0
-# Slack for Slack Integration
-NEXT_PUBLIC_SLACK_CLIENT_ID=""
+# Public boards deploy URL
+NEXT_PUBLIC_DEPLOY_URL="http://localhost/spaces"
+```
 
+#### spaces/.env.example
+
+```
+# Flag to toggle OAuth
+NEXT_PUBLIC_ENABLE_OAUTH=0
+```
+
+#### apiserver/.env
+
+```
 # Backend
 # Debug value for api server use it as 0 for production use
 DEBUG=0
+DJANGO_SETTINGS_MODULE="plane.settings.selfhosted"
 
 # Error logs
 SENTRY_DSN=""
@@ -100,15 +92,16 @@ AWS_S3_BUCKET_NAME="uploads"
 FILE_SIZE_LIMIT=5242880
 
 # GPT settings
-OPENAI_API_KEY=""
-GPT_ENGINE=""
+OPENAI_API_BASE="https://api.openai.com/v1" # change if using a custom endpoint
+OPENAI_API_KEY="sk-" # add your openai key here
+GPT_ENGINE="gpt-3.5-turbo" # use "gpt-4" if you have access
 
 # Github
 GITHUB_CLIENT_SECRET="" # For fetching release notes
 
 # Settings related to Docker
 DOCKERIZED=1
-# set to 1 If using the pre-configured minio setup 
+# set to 1 If using the pre-configured minio setup
 USE_MINIO=1
 
 # Nginx Configuration
@@ -120,12 +113,56 @@ DEFAULT_PASSWORD="password123"
 
 # SignUps
 ENABLE_SIGNUP="1"
-# Auto generated and Required that will be generated from setup.sh
-NEXT_PUBLIC_API_BASE_URL=http://<your_ip|domain_name>
-SECRET_KEY="<redacted>"
-WEB_URL=http://<your_ip|domain_name>
+
+# Email Redirection URL
+WEB_URL="http://localhost"
+```
+
+#### .env
+
+```
+# Database Settings
+PGUSER="plane"
+PGPASSWORD="plane"
+PGHOST="plane-db"
+PGDATABASE="plane"
+DATABASE_URL=postgresql://${PGUSER}:${PGPASSWORD}@${PGHOST}/${PGDATABASE}
+
+# Redis Settings
+REDIS_HOST="plane-redis"
+REDIS_PORT="6379"
+REDIS_URL="redis://${REDIS_HOST}:6379/"
+
+# AWS Settings
+AWS_REGION=""
+AWS_ACCESS_KEY_ID="access-key"
+AWS_SECRET_ACCESS_KEY="secret-key"
+AWS_S3_ENDPOINT_URL="http://plane-minio:9000"
+# Changing this requires change in the nginx.conf for uploads if using minio setup
+AWS_S3_BUCKET_NAME="uploads"
+# Maximum file upload limit
+FILE_SIZE_LIMIT=5242880
+
+# GPT settings
+OPENAI_API_BASE="https://api.openai.com/v1" # change if using a custom endpoint
+OPENAI_API_KEY="sk-" # add your openai key here
+GPT_ENGINE="gpt-3.5-turbo" # use "gpt-4" if you have access
+
+# Settings related to Docker
+DOCKERIZED=1
+# set to 1 If using the pre-configured minio setup
+USE_MINIO=1
+
+# Nginx Configuration
+NGINX_PORT=80
 ```
 
+- The environment variable NEXT_PUBLIC_API_BASE_URL has been removed from both the web and space projects.
+- The naming convention for containers and images has been updated.
+- The plane-worker image will no longer be maintained, as it has been merged with plane-backend.
+- The Tiptap pro-extension dependency has been removed, eliminating the need for Tiptap API keys.
+- The image name for Plane deployment has been changed to plane-space.
+
 ### Bootstrap Plane with Docker Compose
 
 ```bash
@@ -137,11 +174,22 @@ docker compose -f docker-compose-hub.yml up
 Open your browser and navigate to `http://<your_ip|domain_name>/` to login onto your Plane instance.
 
 {% callout type="note" %}
-The Plane self-hosted setup has been updated with the release of version 0.7.1. If you are currently using an older version of Plane and encounter a database connection error after running the new containers, it is likely due to the username and password changes for the PostgreSQL containers in the 0.7.1 setup.
+For Version 0.7.1 Update:
 
-To resolve this error, you can follow these steps if you were using the default password and username:
+- The Plane self-hosted setup has been updated with version 0.7.1. If you encounter a database connection error after updating from an older version, it's likely due to PostgreSQL container username and password changes.
+
+- To resolve this error, if you were using default credentials, set `PGUSER=plane` as the username and `PGPASSWORD=xyzzyspoon` as the old password in your generated env file. Then, restart the containers.
 
-Set the username as `PGUSER=plane` and the old password as `PGPASSWORD=xyzzyspoon` in the generated env file.
-Restart the containers.
 {% /callout %}
 
+{% callout type="note" %}
+Version 0.12 and Above Setup:
+
+- Update your codebase by pulling the latest changes from the master branch.
+
+- Optionally, execute the setup.sh script to apply new default values.
+
+- Restart the containers using: docker compose -f docker-compose-hub.yml.
+
+These steps ensure your environment is up-to-date and configured correctly for version 0.12 and later.
+{% /callout %}
diff --git a/src/styles/docsearch.css b/src/styles/docsearch.css
index 70994b1..d45c0cd 100644
--- a/src/styles/docsearch.css
+++ b/src/styles/docsearch.css
@@ -508,10 +508,21 @@ svg.DocSearch-Hit-Select-Icon {
   }
 }
 
-.prose :where(code):not(:where([class~=not-prose] *)):before {
-  content: "" !important;
+.prose :where(code):not(:where([class~='not-prose'] *)):before {
+  content: '' !important;
 }
 
-.prose :where(code):not(:where([class~=not-prose] *)):after {
-  content: "" !important;
+.prose :where(code):not(:where([class~='not-prose'] *)):after {
+  content: '' !important;
+}
+
+/* Chrome, Safari and Opera */
+.scrollbar-hidden::-webkit-scrollbar {
+  display: none;
+}
+
+/* Hide scrollbar for IE, Edge add Firefox */
+.scrollbar-hidden {
+  -ms-overflow-style: none;
+  scrollbar-width: none; /* Firefox */
 }
