I have tried to run zrok as a systemd service:
systemctl enable zrok-share.service
systemctl start zrok-share.service
Unfortunately, it was unsuccessful. Because there is no target for the socks share. So I have modified zrok-share.service file.
Q1: Is there a working version for socks service somewhere?
Q2: I am curious about the ZROK_INSTANCE variable. How I could set it in the zrok-share.service script?
Here is my configuration:
/opt/openziti/etc/zrok/zrok-share.env :
ZROK_ENABLE_TOKEN="alphanums"
ZROK_ENVIRONMENT_NAME="hostname"
ZROK_BACKEND_MODE="socks"
ZROK_TARGET=""
ZROK_UNIQUE_NAME="xyz"
ZROK_FRONTENDS="private"
ZROK_FRONTEND_MODE="reserved-private"
Here is my modifications, diff -u /opt/openziti/bin/zrok-share.bash /opt/openziti/bin/zrok-socks5.bash :
exec_share_reserved(){
local token="$1"
- local target="$2"
- shift 2
+ shift 1
local opts="${*:-}"
- local zrok_cmd="share reserved ${token} ${opts} --override-endpoint ${target}"
+ local zrok_cmd="share reserved ${token} ${opts}"
exec_with_common_opts ${zrok_cmd}
}
@@ -49,12 +48,9 @@
fi
done
-ZROK_RESERVATION_FILE="${HOME}/.zrok/reserved${ZROK_INSTANCE:+@${ZROK_INSTANCE}}.json"
+#ZROK_RESERVATION_FILE="${HOME}/.zrok/reserved${ZROK_INSTANCE:+@${ZROK_INSTANCE}}.json"
+ZROK_RESERVATION_FILE="${HOME}/.zrok/reserved-socks5.json"
-[[ -n "${ZROK_TARGET:-}" ]] || {
- echo "ERROR: ZROK_TARGET is not defined." >&2
- exit 1
-}