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


    Cloudron Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular

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

    Feature Requests
    5
    11
    366
    Loading More Posts
    • 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.
    • Lonkle
      Lonkle last edited by

      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?

      robi 1 Reply Last reply Reply Quote 2
      • robi
        robi @Lonkle last edited by

        @lonkle Yeah, VPN

        Life of Advanced Technology

        1 Reply Last reply Reply Quote 0
        • nebulon
          nebulon Staff last edited by

          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?

          Lonkle 1 Reply Last reply Reply Quote 0
          • Lonkle
            Lonkle @nebulon last edited by Lonkle

            @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 Reply Quote 1
            • Lonkle
              Lonkle last edited by

              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 Reply Quote 1
              • girish
                girish Staff last edited by

                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.

                Lonkle robi 2 Replies Last reply Reply Quote 2
                • marcusquinn
                  marcusquinn last edited by

                  👍 from here - save me swearing at DBeaver periodically.

                  We're not here for a long time - but we are here for a good time :)
                  Jersey/UK
                  Work & Ecommerce Advice: https://brandlight.org
                  Personal & Software Tips: https://marcusquinn.com

                  1 Reply Last reply Reply Quote 1
                  • Lonkle
                    Lonkle @girish last edited by

                    @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 Reply Quote 0
                    • robi
                      robi @girish last edited by robi

                      @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

                      Life of Advanced Technology

                      1 Reply Last reply Reply Quote 0
                      • girish
                        girish Staff last edited by

                        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.

                        robi 1 Reply Last reply Reply Quote 0
                        • robi
                          robi @girish last edited by

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

                          Life of Advanced Technology

                          1 Reply Last reply Reply Quote 0
                          • First post
                            Last post
                          Powered by NodeBB