dns-api.org icon indicating copy to clipboard operation
dns-api.org copied to clipboard

Define options with ENV variables

Open justb81 opened this issue 7 years ago • 7 comments

With Docker we have the ability to define options for the service via ENV vars.

I suggest exposing these options as ENV vars:

  • port (use 80 as default port)
  • logging to stdout instead a file (default for docker containers)
  • throttling_per_hour (200 as default, but should be able to deactivate)
  • public domain (for use in info / description pages)

justb81 avatar Oct 12 '17 12:10 justb81

  • Port 80 is a bad choice because it implies running as root, with Docker even a high port is fine because it will be forwarded to anyway, the internal and external ports do not need to match.
  • Logging could be conditional, and might be useful, good idea. Thanks.
  • Throttling is configurable already.
  • The code is not public domain, even if there is no license present.
    • I will add a license shortly. (Perl)

skx avatar Oct 15 '17 05:10 skx

Hi, thanks for your answers.

Throttling is configurable already.

how is this configurable via ENV? i havn't seen it in source. there is a fixed limit of 200req per hour.

public domain (for use in info / description pages)

The code is not public domain, even if there is no license present.

i meant: set an domain name that would be used in info-pages via ENV. if i start this as private service at my own domains, there is still an infopage saying i should use dns-api.org.

justb81 avatar Oct 15 '17 19:10 justb81

how is this configurable via ENV? i havn't seen it in source. there is a fixed limit of 200req per hour.

Sorry you're right I was sure that it was configurable. Bad memory.

As for the public-domain, thanks for clarification. That was confusing!

I should be able to fix most of these issues/suggestions in a day or two. :)

skx avatar Oct 16 '17 04:10 skx

If you setup a license, i can help with pull Requests ;-)

justb81 avatar Oct 16 '17 05:10 justb81

Added explicit LICENSE in 2aefe461efd4f9b9b43786eac34dcdb2a668918c which matches what was documented in lib/DNS/API.pm.

skx avatar Oct 16 '17 06:10 skx

Note to change mentions of dns-api.org in the public site content we'll need to change the contents of public/ from being raw-html to being HTML::Template, or similar. Shame.

skx avatar Oct 16 '17 06:10 skx

Note to change mentions of dns-api.org in the public site content we'll need to change the contents of public/ from being raw-html to being HTML::Template, or similar. Shame.

or you can sed the files at entrypoint level / your run script.

justb81 avatar Oct 16 '17 07:10 justb81