DomainsProject.org HTTP worker - Docker image
- Create
.envfile with contents like this:FREYA=123where123is your API key. - Run
./start.sh(will invoke docker-compose and start1containers) - Run
docker psto get container id - Run
docker logs -f container_idto confirm proper functioning
Consul is available at http://host_ip:8500/
Prometheus is available at http://host_ip:9090/
Grafana is available at http://host_ip:3000/dashboards -> Idun workers
Default credentials: admin:admin
docker pull tb0hdan/idundocker run --env FREYA=123 --rm tb0hdan/idun
Server has to implement following methods:
r.HandleFunc("/api/vo/ua", server.UserAgent).Methods(http.MethodGet)
r.HandleFunc("/api/vo/domains", server.GetDomains).Methods(http.MethodGet)
r.HandleFunc("/api/vo/filter", server.Filter).Methods(http.MethodPost)server.UserAgent handler:
type JSONResponse struct {
Code int64 `json:"code"`
Message string `json:"message"`
}with message containing User Agent. Code has to be http.StatusOK (i.e. 200)
server.GetDomains handler should marshal following structure:
type DomainsJSON struct {
Domains []string `json:"domains"`
}server.Filter handler should accept DomainsJSON structure and return filtered out domains in DomainsJSON structure.
Running idun using custom server URL:
./idun -apiBase http://192.168.1.2:1234/api/vo