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

docs: Update Redis connection string instructions for Railway #10246

Merged
merged 7 commits into from
Nov 26, 2024

Conversation

qbitdoge
Copy link
Contributor

@qbitdoge qbitdoge commented Nov 24, 2024

What

Updated the Railway Redis and Postgres connection string instructions:

  • Changed DATABASE_URL to use ${{Postgres.RAILWAY_PRIVATE_DOMAIN}}
  • Updated REDIS_URL to use ?family=0 to support both IPv6 and IPv4 connections.
  • Adjusted instructions to reflect the new REDIS_URL configuration

Why

Railway does not support IPv4 private networking, so users need clearer guidance to enable IPv6. Additionally, the egress fee note ensures users are aware of potential costs when using public endpoints.

How

Edited the relevant section in the documentation for clarity and conciseness.

Testing

Changes are text-only and have been reviewed for accuracy.

@qbitdoge qbitdoge requested a review from a team as a code owner November 24, 2024 22:35
Copy link

changeset-bot bot commented Nov 24, 2024

⚠️ No Changeset found

Latest commit: 62cb853

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

vercel bot commented Nov 24, 2024

@qbitdoge is attempting to deploy a commit to the medusajs Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Member

@shahednasser shahednasser left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution!

Referring to this documentation, it says setting family=0 supports both IPv6 and IPv4 connections, so I think we should set it to that. Then we don't need to add the note about Redis.REDIS_PUBLIC_URL

Another thing: the REDIS_URL is set in two places (for worker and server environments). Can you update it there?

Also, it would be great if you can update DATABASE_URL as well to be ${{Postgres.RAILWAY_PRIVATE_DOMAIN}} as this Railway change (regarding fees) seem to apply to it as well.

- Clarified instructions for enabling IPv6 by adding the ?family=0 suffix due to lack of IPv4 private networking support
@qbitdoge
Copy link
Contributor Author

@shahednasser thanks so much for the feedback and suggestions.
I’ve addressed all the changes as requested.
Let me know if there’s anything else that needs adjustment.

@qbitdoge
Copy link
Contributor Author

@shahednasser done! anything else?

Copy link
Member

@shahednasser shahednasser left a comment

Choose a reason for hiding this comment

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

LGTM thanks!

@shahednasser shahednasser merged commit a7a7541 into medusajs:develop Nov 26, 2024
22 of 30 checks passed
@qbitdoge qbitdoge deleted the patch-1 branch November 26, 2024 17:47
@waptik
Copy link

waptik commented Nov 27, 2024

Putting this here as there was some error with postgres.
DATABASE_URL value should be changed to ${{Postgres.DATABASE_URL}} instead of ${{Postgres.RAILWAY_PRIVATE_DOMAIN}} because its value remains postgres.railway.internal instead of postgresql://postgres:xxxxxx@postgres.railway.internal:5432/railway
Another PR must be created to fix it

@shahednasser
Copy link
Member

You're correct @waptik , when I used it in Railway's dashboard it showed me that the value was the full address but it wasn't. I'll open another PR to make the update

@waptik
Copy link

waptik commented Nov 28, 2024

You're correct @waptik , when I used it in Railway's dashboard it showed me that the value was the full address but it wasn't. I'll open another PR to make the update

Can you turn your working architecture into template because i followed the guide and my server instance has been crashing because of index.html
image

My variables

ADMIN_CORS="https://${{RAILWAY_PUBLIC_DOMAIN}},https://${{RAILWAY_PRIVATE_DOMAIN}}"
AUTH_CORS="https://${{RAILWAY_PUBLIC_DOMAIN}},https://${{RAILWAY_PRIVATE_DOMAIN}}"
STORE_CORS="http://localhost:8000,https://docs.medusajs.com"
DATABASE_URL="${{Postgres.DATABASE_URL}}"
REDIS_URL="${{Redis.REDIS_URL}}?family=0"
JWT_SECRET="****************"
COOKIE_SECRET="****************"
PAYSTACK_API_KEY="****************"
NODE_ENV="production"
PORT="9000"
MEDUSA_ADMIN_EMAIL="me@email.xyz"
MEDUSA_ADMIN_PASSWORD="****************"
MEDUSA_ADMIN_ONBOARDING_TYPE="default"
RAILWAY_PUBLIC_DOMAIN_VALUE="https://${{RAILWAY_PUBLIC_DOMAIN}}"
DISABLE_MEDUSA_ADMIN="false"
MEDUSA_WORKER_MODE="server"

@shahednasser
Copy link
Member

Thank you for your feedback, I would double check that you've followed every step, and if the error is still happening you can open an issue describing your error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants