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

Support the creation of servers with only private networks #129

Open
eedugon opened this issue Jul 18, 2022 · 1 comment
Open

Support the creation of servers with only private networks #129

eedugon opened this issue Jul 18, 2022 · 1 comment

Comments

@eedugon
Copy link

eedugon commented Jul 18, 2022

Recently Hetzner has added the support of servers belonging only to private networks, without any public interface, thank to the following options:

image

This is a great achievement for security and architectural purposes, and the driver https://github.com/JonasProgrammer/docker-machine-driver-hetzner has implemented the support for this in version 3.8.0 (see this issue for more information).

It would be great if we supported this from the UI driver too.

In order to implement this we should offer a new option called disable-public (includes both ipv4 & ipv6), only applicable when at least one private network is selected. This option would use the new flag implemented in the driver, called --hetzner-disable-public.

The usage of --hetzner-disable-public should also imply the usage of --hetzner-use-private-network and the association of at least one private network to the server.

Another option would be to include 2 extra checkboxes to disablePublic4 and disablePublic6 independently (associated with machine driver parameters --hetzner-disable-public-4 and --hetzner-disable-public-6.

@eedugon
Copy link
Author

eedugon commented Jul 19, 2022

Due to #130 I haven't been able to do the change directly in the code (because the builds I create from the main branch don't work with Rancher 2.6).

Taking the official component.js I was able to make it working in the described way:

image

I added in component.js the disablePublic boolean in the hetznerConfig object:

    bootstrap: function bootstrap() {
      var config = get(this, 'globalStore').createRecord({
        type: 'hetznerConfig',
        additionalKey: [],
        serverType: 'cx21',
        serverLocation: 'nbg1',
        imageId: "168855",
        userData: '',
        networks: [],
        firewalls: [],
        usePrivateNetwork: false,
        disablePublic: false,
        serverLabel: [''],
        placementGroup: ''
      });
      set(this, 'model.hetznerConfig', config);
    },

And then I also changed the base64 layout to include a section for the new checkbox:

      <div class="col-md-2">
        <div class="checkbox">
          <label class="acc-label">{{input type="checkbox" checked=model.hetznerConfig.usePrivateNetwork}}
            EEDUGON: Use private network (first private network which is attached will be used for communication)
          </label>
        </div>
      </div>
      <div class="col-md-2">
        <div class="checkbox">
          <label class="acc-label">{{input type="checkbox" checked=model.hetznerConfig.disablePublic}}
            EEDUGON: Disable public IPv4 and IPv6 addresses (this implies "use private network" for communication).
          </label>
        </div>
      </div>

If anyone likes the change I have no issues raising a PR, but the current github code doesn't generate a valid component.js in my case (and it looks very different than the published one as mentioned here

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

No branches or pull requests

1 participant