Template Bounty: Convex

4 days ago

Template Bounty: Convex with Postgres

First successful post in this thread with:

  • Convex

  • Postgres

  • Private Network Use

Will earn the bounty

$100 Bounty

28 Replies

4 days ago

I've began working on it!


4 days ago

Alright well. I've been stuck on this one error for over an hour. If anyone knows, please.

Error: Error occurred while creating a new object: error performing TLS handshake: invalid peer certificate: Other(OtherError(CaUsedAsEndEntity))

SSL is completely disabled with the DO_NOT_USE_SSL=1 variable. I can connect totally fine with my device. I'm so lost.


4 days ago

Hmm. Apparently Convex requires that you put nothing in the envvars. Could try this

https://station.railway.com/questions/postgre-sql-connection-issue-with-convex-fb8a7f81#gx0n


4 days ago

Do you have one working with the public URL? Happy to pay out half for that!


jake

Do you have one working with the public URL? Happy to pay out half for that!

4 days ago

Public URL doesn't work either. I've already tried what was suggested in that other post. No avail.


arnochenfxFREE

4 days ago

looks it works

Attachments



arnochenfx

https://railway.com/deploy/PTm-L-?referralCode=PnLAIF

4 days ago

Please follow our best practices guide -

https://docs.railway.com/guides/templates-best-practices


arnochenfx

https://railway.com/deploy/PTm-L-?referralCode=PnLAIF

4 days ago

Hmm. Any reason to use PG vector vs vanilla postgres?


jake

Hmm. Any reason to use PG vector vs vanilla postgres?

arnochenfxFREE

4 days ago

It's a mistake, I have changed to vanilla postgres


loudbook

Alright well. I've been stuck on this one error for over an hour. If anyone knows, please.Error: Error occurred while creating a new object: error performing TLS handshake: invalid peer certificate: Other(OtherError(CaUsedAsEndEntity))SSL is completely disabled with the DO_NOT_USE_SSL=1 variable. I can connect totally fine with my device. I'm so lost.

AnonymousFREE

4 days ago

Look at debug or verbose output (if supported) to confirm whether TLS is still being attempted despite DO_NOT_USE_SSL=1.

Try explicitly disabling SSL in the configuration file or command line, not just through the environment variable.


arnochenfxFREE

4 days ago


brody

Please follow our best practices guide -https://docs.railway.com/guides/templates-best-practices

arnochenfxFREE

4 days ago


4 days ago

You got it. I was using 1 for disable SSL as per the documentation. Nice job lol.


arnochenfx

https://railway.com/deploy/convexHere is my template

4 days ago

Thank you for your submission, before we can accept your template, please read over the best practices guide I linked and implement the suggestions listed on that page.


brody

Thank you for your submission, before we can accept your template, please read over the best practices guide I linked and implement the suggestions listed on that page.

arnochenfxFREE

4 days ago

I have already made adjustments based on the templates-best-practices.


arnochenfx

I have already made adjustments based on the templates-best-practices.

4 days ago

You have left out several best practices, to name a few -

  • Missing service icons.

  • Incorrect service names (dash delimited instead of space delimited)

  • Incorrect name casing.

These, and more are mentioned in the docs page, please give it a read over and implemented the suggestions listed in the docs page.


brody

You have left out several best practices, to name a few -Missing service icons.Incorrect service names (dash delimited instead of space delimited)Incorrect name casing.These, and more are mentioned in the docs page, please give it a read over and implemented the suggestions listed in the docs page.

arnochenfxFREE

4 days ago

Thank you for your feedback. I have reviewed the documentation and updated the service icons, name casing, and naming conventions as suggested. Please let me know if any further adjustments are needed.


jamwtPRO

4 days ago

Just tried this out... it works! Thank you!

Two friction points:

  1. I found we still needed to do the step where we remove the initial domain from the convex-backend and re-add one mapped to port 3210. Not sure if this can be skipped somehow.

  2. In my test, CONVEX_CLOUD_ORIGIN was now using the internal name, which caused the dashboard to populate the wrong value. I had to manually change this to the public name after doing step 1.

When this is all landed, hit me up on discord, happy to throw in another $100.


jamwtPRO

4 days ago

Also, I see that Railway support durable volumes ( https://docs.railway.com/guides/volumes ).

1. The postgres image should be using one of those for postgres's data dir.

  1. The convex-backend /convex/data directory should also be using one. It contains file storage and other persistent blob data.

If we had postgres (as we do here), plus those two volumes, this is pretty close to a self-hosted convex that's unlikely to lose data for developers and will probably keep a decent HA.


jamwt

Also, I see that Railway support durable volumes ( https://docs.railway.com/guides/volumes ).1. The postgres image should be using one of those for postgres's data dir.The convex-backend /convex/data directory should also be using one. It contains file storage and other persistent blob data.If we had postgres (as we do here), plus those two volumes, this is pretty close to a self-hosted convex that's unlikely to lose data for developers and will probably keep a decent HA.

arnochenfxFREE

3 days ago

Thank you so much for your feedback and detailed suggestions! I've already made all the changes you mentioned.

Let me know if you notice anything else or if there’s any other improvement you'd like to see! Thanks again for your help.


arnochenfx

Thank you so much for your feedback and detailed suggestions! I've already made all the changes you mentioned.Let me know if you notice anything else or if there’s any other improvement you'd like to see! Thanks again for your help.

3 days ago

Rock on. Checking with Brody and then will hit the payout button tomorrow! Great stuff :D


3 days ago

Hey arnochenfx,

I've given it a closer look now that I'm at my laptop, and I can see some room for improvement -

1. Your pre-deploy command modifies the filesystem, since the pre-deploy command is run in a separate container, any changes made to the filesystem are not persisted in the runtime image. You would want to move that logic into the start command, make sure to exec ./run_backend.sh from within the shell wrapper as your final command.

2. Both the Dashboard and Backend services are missing health checks, / for the Dashboard and /version for the backend should be sufficient.


brody

Hey arnochenfx,I've given it a closer look now that I'm at my laptop, and I can see some room for improvement -1. Your pre-deploy command modifies the filesystem, since the pre-deploy command is run in a separate container, any changes made to the filesystem are not persisted in the runtime image. You would want to move that logic into the start command, make sure to exec ./run_backend.sh from within the shell wrapper as your final command.2. Both the Dashboard and Backend services are missing health checks, / for the Dashboard and /version for the backend should be sufficient.

arnochenfxFREE

3 days ago

Hey brody,

Thanks a lot for your feedback!

I've updated the configuration as you suggested. The health checks have now been added for both the Dashboard and Backend services, and I've also moved the pre-deploy logic into the Start Command.


3 days ago

Looks great, thank you for putting up with all my feedback!

We can't wait to see what templates you will make in the future!

(I've notified Jake so that he can pay you out)


Status changed to Solved jake 3 days ago


arnochenfx

https://railway.com/deploy/convexHere is my template

3 days ago

Payout completed! Only thing is it seems the admin key might be broken?

https://x.com/diblacksmith/status/1932104338408968618?s=46


Status changed to Open railway[bot] 3 days ago


3 days ago

Looks like you would want to use a template variable function for that?


jake

Payout completed! Only thing is it seems the admin key might be broken?https://x.com/diblacksmith/status/1932104338408968618?s=46

arnochenfxFREE

3 days ago

Needs to follow the guide to generate a Admin Key.
The Admin Key is generated by the program inside the container based on INSTANCE_SECRET and INSTANCE_NAME, so we cannot directly specify a random one through environment variables. And INSTANCE_SECRET is generated by the template variable function.

Attachments


Template Bounty: Convex - Railway Help Station