Skip to content

Stub Solver  #545

@mageddo

Description

@mageddo

Summary & Motivation

  • Create a basic local solver without the need of an additional config file.
  • Be a local, offline, out of the box suitable alternative for nip.io and sslip.io

Alternatives

Local Solver DB feature can be used, I consider the only difference is that you will need to create the DNS records config file previously.

Description

A new solver will be created

  • Named Stub because the hostname itself has the information it needs, then this solver is working as an adapter.
  • Only hostnames with a specific hostname name suffix will match to Stub solver
  • A configuration will be created to configure the hostname to match
  • If none is configured, .docker will be used
  • The solvers priority order will be: SolverSystem, SolverStub, SolverDocker, SolverLocalDB, SolverRemote
  • New Docs will be created to learn how to use the solver.

Without the need of create a DNS record file, satisfy the following usecases:

1. Offline solution

No internet dependency, no confidential information will be exposed as DPS will be running locally and don´t expose information to the internet.

2. Gain a domain where you can't use IPs directly

3. Be able to assign different certificate to every domain name using a same IP

you can’t register SSL certificates directly to an IP address so you can’t register a different certificate against your server’s IP address. [1]

4. No need of previous DNS record registration

You won't need to create a DNS record previously as in LocalSolverDB, it can be usefull in some cases

5. Memorability and Readability

A domain name like myapp.192.168.1.100.acme.com is easier to recognize, search and share compared to just an IP address. [1]

References

Requested at #544

Inspired on

nip.io

nip.io maps [.-].nip.io in "dot", "dash" or "hexadecimal" notation to the corresponding :

dot notation: magic.127.0.0.1.nip.io
dash notation: magic-127-0-0-1.nip.io
hexadecimal notation: magic-7f000001.nip.io

The "dash" and "hexadecimal" notation is especially useful when using services like LetsEncrypt as it's just a regular sub-domain of nip.io

sslip.io

Like nip.io plus it's supports ipv6

Changes (Optional)

  • Algoritmo de extrção do IP do hostname
  • Criar docs
  • Expor configuração do domínio a ser utilizado
  • Ligar o solver respeitando a prioridade

Algoritmo de extrção do IP do hostname

OK - Forma 1

Ler de trás pra frente até que o texto seja ou deixe de ser um ip

Forma 2

Obs: Não implementei pois a forma 1 é mais simples e já resolveu os usecases, se necessário posso criar um strategy que usa as várias formas.

  • Ler a string de trás pra frente e ler todo o texto até mudar o separador
  • Caso hexadecimal: se o separador não mudar e a palavra tiver 4 bytes ou mais, é um endereço em hexadecimal

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureDefinition of a feature to be implemented

    Projects

    Status

    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions