bapteme
is a go http server who can be used to named server with a random name.
Bapteme
is mainly used in conjonction with "static" deployment script (preseed, bash, chef, puppet, whatever).
$ ./bapteme -h
Usage of ./bapteme:
-bind="": Address to bind. Format IP:PORT
-d=false: turn on debug info
-size=10: Default final hostname size
HTTP Parameter | Description | default |
---|---|---|
size | size of hostname | size server command line option |
prefix | prefix to add on hostname | if User-Agent:win for windowslin for linuxelse srv |
instance | service to add after prefix | |
id | Unique identifier to generate same hostname Can be MAC address etc. |
$ ./bapteme -bind="127.0.0.1:8086" -size="15"
2014/08/28 16:32:41 INFO Bind to 127.0.0.1:8086
$ curl -X GET 'http://127.0.0.1:8086?size=42'
srvIuKHEt3Kg5ES88kWx8WDCplhzvBM2xEkfRWcNXE
$ curl -X GET 'http://127.0.0.1:8086?size=42'
srvBzi2mhH6y4fKOWXEH9v7EwpYMM4NesXPHY1tseW
$ curl -X GET 'http://127.0.0.1:8086?prefix=rhel&instance=bind&id=01:02:03:04:05:06'
rhelbindMDE6MDI
$ curl -X GET 'http://127.0.0.1:8086?prefix=rhel&instance=bind&id=01:02:03:04:05:06'
rhelbindMDE6MDI
$ curl -X GET 'http://127.0.0.1:8086?prefix=AZERTY&size=2'
name too long
# HTTP 500
# len(AZERTY) >> 2