Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

Cloudron Forum

Apps | Demo | Docs | Install
  1. Cloudron Forum
  2. Feature Requests
  3. Request: Map the internal SQL IP address to something like my.sql.domain.tld

Request: Map the internal SQL IP address to something like my.sql.domain.tld

Scheduled Pinned Locked Moved Feature Requests
14 Posts 5 Posters 2.5k Views 5 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • LonkleL Offline
    LonkleL Offline
    Lonkle
    wrote on last edited by
    #1

    I only ask this because I have to change my remote SQL settings to match the internal SQL IP address every time Cloudron reboots. Unless there is a better way here?

    robiR 1 Reply Last reply
    2
    • LonkleL Lonkle

      I only ask this because I have to change my remote SQL settings to match the internal SQL IP address every time Cloudron reboots. Unless there is a better way here?

      robiR Offline
      robiR Offline
      robi
      wrote on last edited by
      #2

      @lonkle Yeah, VPN

      Conscious tech

      1 Reply Last reply
      0
      • nebulonN Offline
        nebulonN Offline
        nebulon
        Staff
        wrote on last edited by
        #3

        on the Cloudron within the docker containers, the mysql IP is actually mapped to mysql as the hostname. Since we don't really see exposing the addons to the public as a big use-case, what is the purpose for you to require the internal mysql IP?

        LonkleL 1 Reply Last reply
        0
        • nebulonN nebulon

          on the Cloudron within the docker containers, the mysql IP is actually mapped to mysql as the hostname. Since we don't really see exposing the addons to the public as a big use-case, what is the purpose for you to require the internal mysql IP?

          LonkleL Offline
          LonkleL Offline
          Lonkle
          wrote on last edited by Lonkle
          #4

          @nebulon said in Request: Map the internal SQL IP address to something like my.sql.domain.tld:

          the mysql IP is actually mapped to mysql as the hostname.

          That only works in a "docker specific" context a la: docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' mysql -> 172.18.0.8

          we don't really see exposing the addons to the public as a big use-case, what is the purpose for you to require the internal mysql IP?

          Okay, so I don't want or need it to be public. I just need internal SSH to be able to access the container via DNS since the IP address changes every restart it seems. Making my SQL Client fail to connect without doing a docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' mysql to get the IP address after SSHing in every time.

          I checked /etc/hosts and /etc/resolv.conf and neither of them could help. And neither can mysql.internal.docker which I was hoping would work. So I have to find and change this IP address all the time.

          Screen Shot 2021-06-29 at 5.58.54 PM.jpg

          1 Reply Last reply
          1
          • LonkleL Offline
            LonkleL Offline
            Lonkle
            wrote on last edited by
            #5

            Thinking about it, maybe @girish might have an answer for me. He taught me the tunneling technique that it appears all SQL Clients have that I just never knew about 🤣 - last fall: https://forum.cloudron.io/post/13959

            So maybe, Girish, do you have a solution that doesn't involve me manually changing the IP address of the "Internal MySQL Host" in my Remote SQL client every time mysql gets a new IP address (often)? 🤞

            1 Reply Last reply
            1
            • girishG Offline
              girishG Offline
              girish
              Staff
              wrote on last edited by
              #6

              Good request. The only way I can think of is to give static IPs to all the addon containers. This is entirely doable and we haven't had a reason to hard code IPs so far. I will let this sit a bit to understand the implications of hardcoding the IPs.

              LonkleL robiR 2 Replies Last reply
              2
              • marcusquinnM Offline
                marcusquinnM Offline
                marcusquinn
                wrote on last edited by
                #7

                👍 from here - save me swearing at DBeaver periodically.

                Web Design https://www.evergreen.je
                Development https://brandlight.org
                Life https://marcusquinn.com

                1 Reply Last reply
                1
                • girishG girish

                  Good request. The only way I can think of is to give static IPs to all the addon containers. This is entirely doable and we haven't had a reason to hard code IPs so far. I will let this sit a bit to understand the implications of hardcoding the IPs.

                  LonkleL Offline
                  LonkleL Offline
                  Lonkle
                  wrote on last edited by
                  #8

                  @girish You can also simply add + update a local DNS query to "point to IP address of mySQL". Since that would only need to be local cause the desktop client is SSHed in already and can use a local dns query from there.

                  1 Reply Last reply
                  0
                  • girishG girish

                    Good request. The only way I can think of is to give static IPs to all the addon containers. This is entirely doable and we haven't had a reason to hard code IPs so far. I will let this sit a bit to understand the implications of hardcoding the IPs.

                    robiR Offline
                    robiR Offline
                    robi
                    wrote on last edited by robi
                    #9

                    @girish said in Request: Map the internal SQL IP address to something like my.sql.domain.tld:

                    Good request. The only way I can think of is to give static IPs to all the addon containers. This is entirely doable and we haven't had a reason to hard code IPs so far. I will let this sit a bit to understand the implications of hardcoding the IPs.

                    Perhaps hardcoding isn't necessary, but simply using an internal DNS mapping, internal resolver for known service containers like you have in docker

                    OR

                    If you do hardcode it, use xip.io as explained here
                    https://forum.cloudron.io/topic/3574/xip-io-access-any-dev-app-via-internal-ip-using-a-magic-domain

                    Alternatively, see here:
                    https://sslip.io/

                    which includes a noteworthy mention of LocalTLS

                    Conscious tech

                    1 Reply Last reply
                    0
                    • girishG Offline
                      girishG Offline
                      girish
                      Staff
                      wrote on last edited by
                      #10

                      Not 100% sure but I don't think the DNS resolution will work from inside the SSH tunnel. For example, you cannot add an entry in /etc/hosts (on Cloudron server) and don't think the connection will pick that up.

                      robiR 1 Reply Last reply
                      0
                      • girishG girish

                        Not 100% sure but I don't think the DNS resolution will work from inside the SSH tunnel. For example, you cannot add an entry in /etc/hosts (on Cloudron server) and don't think the connection will pick that up.

                        robiR Offline
                        robiR Offline
                        robi
                        wrote on last edited by
                        #11

                        @girish Any tunnel uses the DNS resolution of the source host connection, hence Mac or Windows hosts file.

                        Conscious tech

                        1 Reply Last reply
                        0
                        • LonkleL Offline
                          LonkleL Offline
                          Lonkle
                          wrote on last edited by
                          #12

                          Any further knowledge gained in the past couple years on the ability to make this happen?

                          marcusquinnM 1 Reply Last reply
                          0
                          • girishG Offline
                            girishG Offline
                            girish
                            Staff
                            wrote on last edited by
                            #13

                            @Lonkle The internal IP addresses are now hardcoded in 7.4 - https://docs.cloudron.io/networking/#internal-network for exactly this reason.

                            1 Reply Last reply
                            1
                            • LonkleL Lonkle

                              Any further knowledge gained in the past couple years on the ability to make this happen?

                              marcusquinnM Offline
                              marcusquinnM Offline
                              marcusquinn
                              wrote on last edited by
                              #14

                              @Lonkle He's alive! Where you been for 2 years?

                              Web Design https://www.evergreen.je
                              Development https://brandlight.org
                              Life https://marcusquinn.com

                              1 Reply Last reply
                              1
                              Reply
                              • Reply as topic
                              Log in to reply
                              • Oldest to Newest
                              • Newest to Oldest
                              • Most Votes


                              • Login

                              • Don't have an account? Register

                              • Login or register to search.
                              • First post
                                Last post
                              0
                              • Categories
                              • Recent
                              • Tags
                              • Popular
                              • Bookmarks
                              • Search