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

Fixes Render.com integration #44

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
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
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ HostedGPT is an open source project that provides all the same baseline function

1. Click Fork > Create New Fork at the top of this repository
2. Create an account on Render.com and login
2. View your newly created fork within github.com and click the button below.
2. View your newly created fork within github.com and click the button below:

[![Deploy to Render](https://render.com/images/deploy-to-render-button.svg)](https://render.com/deploy)

3. When you are taken to Render.com confirm that the title of the page says `You are deploying from a render.yaml file for _____` with your forked repo listed in the blank.
4. Provide a unique Blueprint name such as "hostedgpt-<yourname>".
5. Copy value from the file `config/master.key` and paste it as the value for the RAILS_MASTER_KEY on the page. Then click "Apply".
6. Wait for the hostedgpt database and web service to be deployed. After they are, click "Dashboard" at the top of the Render screen.
7. You should see two "Service Names" called **hostedgpt**, click the one that is of type "Web Service"
8. On the details screen, click the URL that looks something like _hostedgpt-XXX.onrender.com_
3. Find hostedgpt in the list of repositories and click **Connect**
5. Provide a unique Blueprint name such as "hostedgpt-<yourname>".
6. Click **Apply**
7. Wait for the hostedgpt database and web service to be deployed. After they are, click "Dashboard" at the top of the Render screen.
8. You should see two "Service Names" called **hostedgpt**, click the one that is of type "Web Service"
9. On the details screen, click the URL that looks something like _hostedgpt-XXX.onrender.com_
12 changes: 8 additions & 4 deletions render.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ databases:
user: hostedgpt
plan: free

envVarGroups:
- name: generated-secrets
envVars:
- key: rails_master_key
generateValue: true

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, interesting! @robacarp how does this make it so we don’t have to copy that master.key value?

My assumption was: the master.key value is important and the fix would involve telling the rails app to find the key within the master.key file, not within the ENV. But it seems like you’ve fixed it somehow by telling render to generate a new one? Is there a discrepancy between this newly generated value and the value already stored in master.key?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@krschacht gooooooood question. You're making me question what I did here. I assumed that RAILS_MASTER_KEY was something like SECRET_KEY_BASE but with a new name. Perhaps it is the encryption key for a .env file or something? I didn't do enough research into what this does before suggesting that it could be a randomly generated string.

I'll do some research and get back to it.

services:
- type: worker
name: soliqueue-worker
Expand All @@ -16,10 +22,9 @@ services:
fromDatabase:
name: hostedgpt
property: connectionString
- key: RAILS_MASTER_KEY
- fromGroup: generated-secrets
Copy link
Contributor

Choose a reason for hiding this comment

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

This is cool! Can you please also update the README.md file to remove that step of copy/pasting the key?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good call. I updated the instructions there a little. We should consider whether forking the repository is necessary for a render deploy -- if not, we can make the process even easier.

- key: WEB_CONCURRENCY
value: 2 # sensible default
sync: false
- type: web
name: hostedgpt
runtime: ruby
Expand All @@ -32,7 +37,6 @@ services:
fromDatabase:
name: hostedgpt
property: connectionString
- key: RAILS_MASTER_KEY
sync: false
- fromGroup: generated-secrets
- key: WEB_CONCURRENCY
value: 2 # sensible default
Loading