From 4cdfa2d1f0725618b7495f9720927226b3810226 Mon Sep 17 00:00:00 2001 From: Ephraim Atta-Duncan Date: Fri, 11 Aug 2023 20:38:41 +0000 Subject: [PATCH 1/3] Add gitpod config files --- .env.gitpod | 29 +++++++++++++++++++++++++ .gitpod.yml | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 90 insertions(+) create mode 100644 .env.gitpod create mode 100644 .gitpod.yml diff --git a/.env.gitpod b/.env.gitpod new file mode 100644 index 000000000..fcb274047 --- /dev/null +++ b/.env.gitpod @@ -0,0 +1,29 @@ +DATABASE_URL="postgres://documenso:password@127.0.0.1:54320/documenso" +NEXT_PUBLIC_WEBAPP_URL="" + +# AUTH +NEXTAUTH_SECRET='lorem ipsum sit dolor random string for encryption this could literally be anything' +NEXTAUTH_URL="" + +# SIGNING +CERT_FILE_PATH="" +CERT_PASSPHRASE="" +CERT_FILE_ENCODING="" + +# EMAIL +SMTP_MAIL_HOST='127.0.0.1' +SMTP_MAIL_PORT='2500' +SMTP_MAIL_USER='documenso' +SMTP_MAIL_PASSWORD='documenso' +MAIL_FROM='documenso@gitpod.io' + +# STRIPE +STRIPE_API_KEY="" +STRIPE_WEBHOOK_SECRET="" +NEXT_PUBLIC_STRIPE_COMMUNITY_PLAN_MONTHLY_PRICE_ID="" +NEXT_PUBLIC_STRIPE_COMMUNITY_PLAN_YEARLY_PRICE_ID="" + +#FEATURE FLAGS +# Allow users to register via the /signup page. Otherwise they will be redirect to the home page. +NEXT_PUBLIC_ALLOW_SIGNUP=true +NEXT_PUBLIC_ALLOW_SUBSCRIPTIONS=false \ No newline at end of file diff --git a/.gitpod.yml b/.gitpod.yml new file mode 100644 index 000000000..40d736788 --- /dev/null +++ b/.gitpod.yml @@ -0,0 +1,61 @@ +tasks: + - name: Dependencies & Database + init: | + npm install && + npm run docker:compose-up && + cp .env.gitpod .env && + next_auth_secret=$(openssl rand -base64 32) && + sed -i -e "s|^NEXTAUTH_SECRET=.*|NEXTAUTH_SECRET=$next_auth_secret|" .env && + sed -i "s|NEXTAUTH_URL=\"\"|NEXTAUTH_URL=https://3000-${HOSTNAME}.${GITPOD_WORKSPACE_CLUSTER_HOST}|" .env && + sed -i "s|NEXT_PUBLIC_WEBAPP_URL=\"\"|NEXT_PUBLIC_WEBAPP_URL=https://3000-${HOSTNAME}.${GITPOD_WORKSPACE_CLUSTER_HOST}|" .env + command: npm run d + + - name: Database Studio + command: | + gp ports await 3000 + npm run db-studio + +ports: + - name: App + port: 3000 + visibility: public + onOpen: open-browser + + - name: Mailbox + port: 9000 + visibility: public + onOpen: open-browser + + - name: Database + port: 54320 + visibility: private + onOpen: ignore + + - name: Mailserver + port: 2500 + visibility: private + onOpen: ignore + + - name: Database Studio + port: 5555 + visibility: public + onOpen: open-browser + + - port: 1100 + visibility: private + onOpen: ignore + +github: + prebuilds: + master: true + pullRequests: true + pullRequestsFromForks: true + addCheck: true + addComment: true + addBadge: true + +vscode: + extensions: + - esbenp.prettier-vscode + - bradlc.vscode-tailwindcss + - Prisma.prisma From 40db5baa179c38a1dfbd88ea0b5c866fa384e729 Mon Sep 17 00:00:00 2001 From: Ephraim Atta-Duncan Date: Fri, 11 Aug 2023 20:44:09 +0000 Subject: [PATCH 2/3] Add gitpod button to readme --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 0df02bc0c..f6dbefe7f 100644 --- a/README.md +++ b/README.md @@ -135,6 +135,8 @@ Your database will also be available on port `54320`. You can connect to it usin ## Developer Setup +### Manual Setup + Follow these steps to setup documenso on you local machine: - [Clone the repository](https://help.github.com/articles/cloning-a-repository/) it to your local device. @@ -165,6 +167,12 @@ Follow these steps to setup documenso on you local machine: - A demo certificate is provided in `/app/web/resources/certificate.p12` - To generate your own using these steps and a Linux Terminal or Windows Subsystem for Linux (WSL) see **[Create your own signing certificate](#creating-your-own-signing-certificate)**. +### Run in Gitpod + +- Click below to launch a ready-to-use Gitpod workspace in your browser. + +[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/documenso/documenso) + ## Updating - If you pull the newest version from main, using `git pull`, it may be necessary to regenerate your database client From 652951ed7f49df415d25fb6eb1284f10758f9b9f Mon Sep 17 00:00:00 2001 From: Ephraim Atta-Duncan Date: Fri, 11 Aug 2023 20:48:42 +0000 Subject: [PATCH 3/3] Fix prisma studio opening twice --- .gitpod.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitpod.yml b/.gitpod.yml index 40d736788..cf05d485a 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -39,7 +39,6 @@ ports: - name: Database Studio port: 5555 visibility: public - onOpen: open-browser - port: 1100 visibility: private