Skip to content

Commit

Permalink
fix: add http env to workers execution
Browse files Browse the repository at this point in the history
This commit adds:
yggdrasil proxy related env variable when starts the worker.
How to send data messages to echo workers added in HACKING file.

Signed-off-by: Alba Hita Catala <[email protected]>
  • Loading branch information
ahitacat committed Nov 15, 2023
1 parent b75da0d commit 9e31707
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
7 changes: 7 additions & 0 deletions HACKING.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@ export CONSUMER_ID=$(openssl x509 -in cert.pem -subject -nocert | cut -f3 -d" ")
mosquitto_pub --host 127.0.0.1 --port 1883 --topic "yggdrasil/${CONSUMER_ID}/control/in" --message "{\"type\":\"command\",\"message_id\":\"$(uuidgen | tr -d '\n')\",\"version\":1,\"sent\":\"$(date --iso-8601=seconds --utc | tr -d '\n')\",\"content\":{\"command\":\"ping\"}}"
```

Send a data message to `echo worker`
```
export CONSUMER_ID=$(openssl x509 -in cert.pem -subject -nocert | cut -f3 -d" ")
echo "{\"type\":\"data\",\"message_id\":\"$(uuidgen | tr -d '\n')\", \"response_to\":\" \",\"version\":1,\"sent\":\"$(date --iso-8601=seconds --utc | tr -d '\n')\",\"directive\":\"echo\",\"metadata\":\"{}\",\"content\":{\"hello world\"}}" | pub -broker tcp://test.mosquitto.org:1883 -topic yggdrasil/${CONSUMER_ID}/data/in
```


# Call Graphs

Call graphs can be generated to provide a high-level overview of the
Expand Down
4 changes: 4 additions & 0 deletions cmd/yggd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,10 @@ func main() {
env := []string{
"YGG_SOCKET_ADDR=unix:" + c.String("socket-addr"),
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"HTTP_PROXY=" + os.Getenv("HTTP_PROXY"),
"http_proxy=" + os.Getenv("http_proxy"),
"HTTPS_PROXY=" + os.Getenv("HTTPS_PROXY"),
"NO_PROXY=" + os.Getenv("NO_PROXY"),
}
for _, info := range fileInfos {
if strings.HasSuffix(info.Name(), "worker") {
Expand Down

0 comments on commit 9e31707

Please sign in to comment.