Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion device-discovery-agent/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.0.5-dev
0.0.5
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sure to update the versions in ena-manifest file as well.

22 changes: 0 additions & 22 deletions device-discovery-agent/debian/config

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Wants=network-online.target

[Service]
Type=oneshot
EnvironmentFile=/etc/edge-node/node/agent_variables
ExecStart=/opt/edge-node/bin/device-discovery-agent -config /etc/edge-node/node/confs/device-discovery-agent.env
StandardOutput=journal
StandardError=journal
Expand Down
51 changes: 20 additions & 31 deletions device-discovery-agent/debian/postinst
Original file line number Diff line number Diff line change
@@ -1,59 +1,48 @@
#!/bin/bash -e

. /usr/share/debconf/confmodule

# Update onboarding service URL (OBM_SVC)
db_get device-discovery-agent/onboarding.serviceURL
if [ ! -z "$RET" ]; then
sed -i "s|^OBM_SVC=.*|OBM_SVC=$RET|" /etc/edge-node/node/confs/device-discovery-agent.env
if [ ! -z "$ONBOARDING_SVC_URL" ]; then
sed -i "s|^OBM_SVC=.*|OBM_SVC=$ONBOARDING_SVC_URL|" /etc/edge-node/node/confs/device-discovery-agent.env
fi

# Update onboarding service port (OBM_PORT)
db_get device-discovery-agent/onboarding.servicePort
if [ ! -z "$RET" ]; then
sed -i "s|^OBM_PORT=.*|OBM_PORT=$RET|" /etc/edge-node/node/confs/device-discovery-agent.env
if [ ! -z "$ONBOARDING_SVC_PORT" ]; then
sed -i "s|^OBM_PORT=.*|OBM_PORT=$ONBOARDING_SVC_PORT|" /etc/edge-node/node/confs/device-discovery-agent.env
fi

# Update discovery service URL (OBS_SVC)
db_get device-discovery-agent/discovery.serviceURL
if [ ! -z "$RET" ]; then
sed -i "s|^OBS_SVC=.*|OBS_SVC=$RET|" /etc/edge-node/node/confs/device-discovery-agent.env
# Update onboarding stream service URL (OBS_SVC)
if [ ! -z "$ONBOARDING_STREAM_SVC_URL" ]; then
sed -i "s|^OBS_SVC=.*|OBS_SVC=$ONBOARDING_STREAM_SVC_URL|" /etc/edge-node/node/confs/device-discovery-agent.env
fi

# Update Keycloak URL (KEYCLOAK_URL)
db_get device-discovery-agent/auth.keycloakURL
if [ ! -z "$RET" ]; then
sed -i "s|^KEYCLOAK_URL=.*|KEYCLOAK_URL=$RET|" /etc/edge-node/node/confs/device-discovery-agent.env
# Update keycloak URL (KEYCLOAK_URL)
if [ ! -z "$KEYCLOAK_URL" ]; then
sed -i "s|^KEYCLOAK_URL=.*|KEYCLOAK_URL=$KEYCLOAK_URL|" /etc/edge-node/node/confs/device-discovery-agent.env
fi

# Update CA certificate path (CA_CERT)
db_get device-discovery-agent/onboarding.caCertPath
if [ ! -z "$RET" ]; then
sed -i "s|^CA_CERT=.*|CA_CERT=$RET|" /etc/edge-node/node/confs/device-discovery-agent.env
if [ ! -z "$CA_PEM" ]; then
sed -i "s|^CA_CERT=.*|CA_CERT=$CA_PEM|" /etc/edge-node/node/confs/device-discovery-agent.env
fi

# Update auto-detect setting (AUTO_DETECT)
db_get device-discovery-agent/sysinfo.autoDetect
if [ ! -z "$RET" ]; then
sed -i "s|^AUTO_DETECT=.*|AUTO_DETECT=$RET|" /etc/edge-node/node/confs/device-discovery-agent.env
if [ ! -z "$AUTO_DETECT" ]; then
sed -i "s|^AUTO_DETECT=.*|AUTO_DETECT=$AUTO_DETECT|" /etc/edge-node/node/confs/device-discovery-agent.env
fi

# Update debug mode (DEBUG)
db_get device-discovery-agent/debug
if [ ! -z "$RET" ]; then
sed -i "s|^DEBUG=.*|DEBUG=$RET|" /etc/edge-node/node/confs/device-discovery-agent.env
if [ ! -z "$DEBUG" ]; then
sed -i "s|^DEBUG=.*|DEBUG=$DEBUG|" /etc/edge-node/node/confs/device-discovery-agent.env
fi

# Update disable interactive mode (DISABLE_INTERACTIVE)
db_get device-discovery-agent/disableInteractive
if [ ! -z "$RET" ]; then
sed -i "s|^DISABLE_INTERACTIVE=.*|DISABLE_INTERACTIVE=$RET|" /etc/edge-node/node/confs/device-discovery-agent.env
if [ ! -z "$DISABLE_INTERACTIVE" ]; then
sed -i "s|^DISABLE_INTERACTIVE=.*|DISABLE_INTERACTIVE=$DISABLE_INTERACTIVE|" /etc/edge-node/node/confs/device-discovery-agent.env
fi

# Update use kernel args (USE_KERNEL_ARGS)
db_get device-discovery-agent/useKernelArgs
if [ ! -z "$RET" ]; then
sed -i "s|^USE_KERNEL_ARGS=.*|USE_KERNEL_ARGS=$RET|" /etc/edge-node/node/confs/device-discovery-agent.env
if [ ! -z "$KERNEL_ARGS" ]; then
sed -i "s|^USE_KERNEL_ARGS=.*|USE_KERNEL_ARGS=$KERNEL_ARGS|" /etc/edge-node/node/confs/device-discovery-agent.env
fi

# Read hardware serial number and update config
Expand Down
64 changes: 0 additions & 64 deletions device-discovery-agent/debian/templates

This file was deleted.

2 changes: 1 addition & 1 deletion node-agent/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.10.4-dev
1.10.4
20 changes: 0 additions & 20 deletions node-agent/debian/config

This file was deleted.

1 change: 1 addition & 0 deletions node-agent/debian/node-agent.node-agent.service
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Documentation=https://github.com/open-edge-platform/edge-node-agents/blob/main/n

[Service]
EnvironmentFile=/etc/environment
EnvironmentFile=/etc/edge-node/node/agent_variables
ExecStart=/opt/edge-node/bin/node-agent -config /etc/edge-node/node/confs/node-agent.yaml
StandardOutput=journal
StandardError=journal
Expand Down
69 changes: 28 additions & 41 deletions node-agent/debian/postinst
Original file line number Diff line number Diff line change
@@ -1,25 +1,21 @@
#!/bin/bash -e

. /usr/share/debconf/confmodule
# Source agent variables from file created by Installer

db_get node-agent/onboarding.enabled
if [ ! -z "$RET" ]; then
sed -i -e '/^onboarding:$/{n' -e 's/enabled:.*/enabled: '"$RET"'/' -e '}' /etc/edge-node/node/confs/node-agent.yaml
if [ ! -z "$NODE_ONBOARDING_ENABLED" ]; then
sed -i -e '/^onboarding:$/{n' -e 's/enabled:.*/enabled: '"$NODE_ONBOARDING_ENABLED"'/' -e '}' /etc/edge-node/node/confs/node-agent.yaml
fi

db_get node-agent/onboarding.serviceURL
if [ ! -z "$RET" ]; then
sed -i -e '/^onboarding:$/{n' -e '/.*enabled:/{n' -e 's#serviceURL:.*#serviceURL: '"$RET"'#' -e '}}' /etc/edge-node/node/confs/node-agent.yaml
if [ ! -z "$NODE_ONBOARDING_URL" ]; then
sed -i -e '/^onboarding:$/{n' -e '/.*enabled:/{n' -e 's#serviceURL:.*#serviceURL: '"$NODE_ONBOARDING_URL"'#' -e '}}' /etc/edge-node/node/confs/node-agent.yaml
fi

db_get node-agent/onboarding.heartbeatInterval
if [ ! -z "$RET" ]; then
sed -i -e '/^onboarding:$/{n' -e '/.*enabled:/{n' -e '/.*serviceURL:/{n' -e 's/heartbeatInterval:.*/heartbeatInterval: '"$RET"'/' -e '}}}' /etc/edge-node/node/confs/node-agent.yaml
if [ ! -z "$NODE_ONBOARDING_HEARTBEAT" ]; then
sed -i -e '/^onboarding:$/{n' -e '/.*enabled:/{n' -e '/.*serviceURL:/{n' -e 's/heartbeatInterval:.*/heartbeatInterval: '"$NODE_ONBOARDING_HEARTBEAT"'/' -e '}}}' /etc/edge-node/node/confs/node-agent.yaml
fi

db_get node-agent/status.serviceClients
if [ ! -z "$RET" ]; then
IFS=',' read -r -a serviceClientArray <<< "$RET"
if [ ! -z "$NODE_SERVICE_CLIENTS" ]; then
IFS=',' read -r -a serviceClientArray <<< "$NODE_SERVICE_CLIENTS"
arrayLength=${#serviceClientArray[@]}
agentList=""
index=0
Expand All @@ -34,9 +30,8 @@ if [ ! -z "$RET" ]; then
sed -i -e '/^status:$/{n' -e '/.*endpoint:/{n' -e 's#serviceClients:.*#serviceClients: [ '"${agentList}"' ]#' -e '}}' /etc/edge-node/node/confs/node-agent.yaml
fi

db_get node-agent/status.outboundClients
if [ ! -z "$RET" ]; then
IFS=',' read -r -a outboundClientArray <<< "$RET"
if [ ! -z "$NODE_OUTBOUND_CLIENTS" ]; then
IFS=',' read -r -a outboundClientArray <<< "$NODE_OUTBOUND_CLIENTS"
arrayLength=${#outboundClientArray[@]}
agentList=""
index=0
Expand All @@ -51,24 +46,20 @@ if [ ! -z "$RET" ]; then
sed -i -e '/^status:$/{n' -e '/.*endpoint:/{n' -e '/.*serviceClients:/{n' -e 's#outboundClients:.*#outboundClients: [ '"${agentList}"' ]#' -e '}}}' /etc/edge-node/node/confs/node-agent.yaml
fi

db_get node-agent/metrics.enabled
if [ ! -z "$RET" ]; then
sed -i -e '/^metrics:$/{n' -e 's/enabled:.*/enabled: '"$RET"'/' -e '}' /etc/edge-node/node/confs/node-agent.yaml
if [ ! -z "$NODE_METRICS_ENABLED" ]; then
sed -i -e '/^metrics:$/{n' -e 's/enabled:.*/enabled: '"$NODE_METRICS_ENABLED"'/' -e '}' /etc/edge-node/node/confs/node-agent.yaml
fi

db_get node-agent/auth.accessTokenURL
if [ ! -z "$RET" ]; then
sed -i -e '/^auth:$/{n' -e 's#accessTokenURL:.*#accessTokenURL: '"$RET"'#' -e '}' /etc/edge-node/node/confs/node-agent.yaml
if [ ! -z "$NODE_ACCESS_URL" ]; then
sed -i -e '/^auth:$/{n' -e 's#accessTokenURL:.*#accessTokenURL: '"$NODE_ACCESS_URL"'#' -e '}' /etc/edge-node/node/confs/node-agent.yaml
fi

db_get node-agent/auth.rsTokenURL
if [ ! -z "$RET" ]; then
sed -i -e '/^auth:$/{n' -e '/.*accessTokenURL:/{n' -e 's#rsTokenURL:.*#rsTokenURL: '"$RET"'#' -e '}}' /etc/edge-node/node/confs/node-agent.yaml
if [ ! -z "$NODE_RS_URL" ]; then
sed -i -e '/^auth:$/{n' -e '/.*accessTokenURL:/{n' -e 's#rsTokenURL:.*#rsTokenURL: '"$NODE_RS_URL"'#' -e '}}' /etc/edge-node/node/confs/node-agent.yaml
fi

db_get node-agent/auth.tokenClients
if [ ! -z "$RET" ]; then
IFS=',' read -r -a tokenClientArray <<< "$RET"
if [ ! -z "$NODE_TOKEN_CLIENTS" ]; then
IFS=',' read -r -a tokenClientArray <<< "$NODE_TOKEN_CLIENTS"
arrayLength=${#tokenClientArray[@]}
agentList=""
index=0
Expand All @@ -83,29 +74,25 @@ if [ ! -z "$RET" ]; then
sed -i -e '/^auth:$/{n' -e '/.*accessTokenURL:/{n' -e '/.*rsTokenURL:/{n' -e '/.*accessTokenPath:/{n' -e '/.*clientCredsPath:/{n' -e 's#tokenClients:.*#tokenClients: [ '"${agentList}"' ]#' -e '}}}}}' /etc/edge-node/node/confs/node-agent.yaml
fi

db_get node-agent/proxy.aptSourceURL
if [ ! -z "$RET" ]; then
sed -i -e 's#reverse_proxy.*#reverse_proxy https://'"$RET"' {#' /etc/caddy/pua.caddy
if [ ! -z "$CADDY_APT_PROXY_URL" ]; then
sed -i -e 's#reverse_proxy.*#reverse_proxy https://'"$CADDY_APT_PROXY_URL"' {#' /etc/caddy/pua.caddy
fi

db_get node-agent/proxy.aptSourceProxyPort
if [ ! -z "$RET" ]; then
sed -i -e 's#localhost.*#localhost:'"$RET"' {#' /etc/caddy/pua.caddy
sed -i -E '/name: client-proxy/,/url:/ s|(http://[^:]+:)[0-9]+|\1'"$RET"'|' /etc/edge-node/node/confs/node-agent.yaml
if [ ! -z "$CADDY_APT_PROXY_PORT" ]; then
sed -i -e 's#localhost.*#localhost:'"$CADDY_APT_PROXY_PORT"' {#' /etc/caddy/pua.caddy
sed -i -E '/name: client-proxy/,/url:/ s|(http://[^:]+:)[0-9]+|\1'"$CADDY_APT_PROXY_PORT"'|' /etc/edge-node/node/confs/node-agent.yaml
fi

db_get node-agent/proxy.aptSourceFilesRSRoot
if [ ! -z "$RET" ]; then
sed -i -E '/name: client-proxy/,/url:/ s|(http://[^/]+/)[^/]+|\1'"$RET"'|' /etc/edge-node/node/confs/node-agent.yaml
if [ ! -z "$FILE_RS_ROOT" ]; then
sed -i -E '/name: client-proxy/,/url:/ s|(http://[^/]+/)[^/]+|\1'"$FILE_RS_ROOT"'|' /etc/edge-node/node/confs/node-agent.yaml
fi

if ! grep -q "EnvironmentFile" "/lib/systemd/system/caddy.service"; then
sed -i '/^\[Service\]$/a EnvironmentFile=\/etc\/environment' /lib/systemd/system/caddy.service
fi

db_get node-agent/auth.RSType
if [ ! -z "$RET" ]; then
if [ "$RET" == "no-auth" ]; then
if [ ! -z "$RS_TYPE" ]; then
if [ "$RS_TYPE" == "no-auth" ]; then
sed -i -e '/header_up Authorization.*/d' /etc/caddy/pua.caddy
fi
fi
Expand Down
64 changes: 0 additions & 64 deletions node-agent/debian/templates

This file was deleted.

2 changes: 1 addition & 1 deletion platform-manageability-agent/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.4.6-dev
0.4.6
Loading