Skip to content

Use coder tunnel in production #1176

Closed
Closed

Description

@bpmct

What is your suggestion?

Ability to use the https://hardcore-saha2.try.coder.app domains (including wildcards for dev URLs) without the in-memory DB. Currently, you have to use coder start --dev which is not suited for production use

For example:

CODER_PG_CONNECTION_URL=postgresql://... coder start --tunnel

    ▄█▀    ▀█▄
     ▄▄ ▀▀▀  █▌   ██▀▀█▄          ▐█
 ▄▄██▀▀█▄▄▄  ██  ██      █▀▀█ ▐█▀▀██ ▄█▀▀█ █▀▀
█▌   ▄▌   ▐█ █▌  ▀█▄▄▄█▌ █  █ ▐█  ██ ██▀▀  █
     ██████▀▄█    ▀▀▀▀   ▀▀▀▀  ▀▀▀▀▀  ▀▀▀▀ ▀
     
coder_1     |   > Started in  production  mode. All data is stored in the 
coder_1     |   PostgreSQL provided! Press  ctrl+c  to gracefully         
coder_1     |   shutdown.                                                 
coder_1     |                                                             
coder_1     |   > Run  coder login access-url: https://hardcore-saha2.try.coder.app  in a new        
coder_1     |   terminal to get started.   

Why do you want this feature?

This would be great to deploy Coder without owning a domain.

Are there any workarounds to get this functionality today?

ngrok or adding a custom domain

Are you interested in submitting a PR for this?

Probably not, I'm not great at go yet.

Activity

  1. changed the title [-]Feat: use coder tunnel without `--dev`[/-] [+]Feat: use coder tunnel in production[/+] on Apr 25, 2022
  2. coadler commented on Apr 25, 2022

    @coadler
    Contributor

    I'm not sure I really want this to be a valid use case. Maintenance of the proxy is best effort, and there's no way to reserve names. Every time you restart coderd you get a new URL.

  3. bpmct commented on Apr 26, 2022

    @bpmct
    MemberAuthor

    That makes sense, I figured I'd ask. 👍🏼

  4. added this to the Enterprise MVP milestone on Apr 26, 2022
  5. tjcran commented on May 7, 2022

    @tjcran

    Closing this issue until we have evidence this is a use-case people would want.

  6. im-coder-lg commented on May 8, 2022

    @im-coder-lg
    Contributor

    Well I would like this. We could ask people to give a DNS, probably from DuckDNS, then authorize it and then save it as a stored variable. It would be read every time coderd starts so you could have fixed URLs.

  7. tjcran commented on May 9, 2022

    @tjcran

    Well I would like this. We could ask people to give a DNS, probably from DuckDNS, then authorize it and then save it as a stored variable. It would be read every time coderd starts so you could have fixed URLs.

    @coadler what do you think of this idea?

  8. im-coder-lg commented on May 9, 2022

    @im-coder-lg
    Contributor

    All you could do is give the proxy DNS on the first prod run and then just start as usual if it ends. It can give a call to the stored string variable that has the DNS name and then get the value for the DNS part. You can try adding a flag for that to happen.

  9. coadler commented on May 9, 2022

    @coadler
    Contributor

    DDNS is something better implemented outside of our development proxy. It's not geo-distributed or highly-available, and we don't monitor it as a production instance. I'd recommend using ngrok or similar for production deployments if reverse tunnels are necessary.

  10. 4 remaining items

  11. tjcran commented on May 24, 2022

    @tjcran

    We need to revisit this for a smooth install experience. Here's the criteria for the README-suggested install:

    • It's local: no one wants to set up a cloud VM just to try a cool github thingy
    • No Postgres required: for most, this adds a few minutes of googling and will be a major source of drop off
    • It's persistent: users will be pissed off if their resources disappear because they restart the application

    Some options:

    • SQLite
    • Add ngrok to docker-compose path
    • Allow coder.app in docker-compose installs

    We should revisit the SQLite issue as well #1417 but @coadler @bpmct what do you think about reconsidering this item? Is there a way we could handle this that also mitigates the concerns you surfaced?

  12. bpmct commented on May 24, 2022

    @bpmct
    MemberAuthor

    I think there can still be a warning that the tunnel isn't "prod ready", but still works with sqllite or postgres to persist data. As long as that works, option 3 is possible. SQLite support with the tunnel naturally allows 3 to work too.

    Unsure how ngrok would work. Their free plan is very limiting, but if there is a way to pass the ngrok URL as an access URL, I'm game as well

  13. ammario commented on May 25, 2022

    @ammario
    Member

    @kylecarbs seems to have all the technical context on the solution space so he'll follow up here...

  14. tjcran commented on May 25, 2022

    @tjcran

    Assigning @kylecarbs for now just so we don't lose track of this one

  15. ketang commented on May 25, 2022

    @ketang
    Contributor

    Some offline discussion earlier suggested that SQLite may be too hard to use to maintain compatibility, at least given the way our database layer is designed right now and potential future features we want to implement.

  16. coadler commented on May 26, 2022

    @coadler
    Contributor

    I'm currently looking into making a more production grade proxy.

  17. changed the title [-]Feat: use coder tunnel in production[/-] [+]Use coder tunnel in production[/+] on Jun 7, 2022
  18. bpmct commented on Jul 22, 2022

    @bpmct
    MemberAuthor

    This was done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    apiArea: HTTP API

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions