DomainsProject.org HTTP worker - Docker image
- Create
.env
file with contents like this:FREYA=123
where123
is your API key. - Run
./start.sh
(will invoke docker-compose and start1
containers) - Run
docker ps
to get container id - Run
docker logs -f container_id
to 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/idun
docker 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