Skip to content

Commit d882ed4

Browse files
authored
Drop TLS on caddy internal endpoint (#81)
Signed-off-by: Rajeev Ranjan <rajeev2.ranjan@intel.com>
1 parent c9ab59e commit d882ed4

17 files changed

+29
-46
lines changed

dkam/pkg/curation/curation.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,6 @@ func GetCommonInfraTemplateVariables(infraConfig config.InfraConfig, osType osv1
151151
"RELEASE_FQDN": strings.Split(infraConfig.ReleaseServiceURL, ":")[0],
152152
"RELEASE_TOKEN_URL": infraConfig.ReleaseServiceURL,
153153
"ORCH_APT_PORT": strings.Split(infraConfig.FileServerURL, ":")[1],
154-
"ORCH_IMG_PORT": strings.Split(infraConfig.RegistryURL, ":")[1],
155154
"FILE_SERVER": strings.Split(infraConfig.FileServerURL, ":")[0],
156155
"IMG_REGISTRY_URL": strings.Split(infraConfig.RegistryURL, ":")[0],
157156
"NTP_SERVERS": strings.Join(infraConfig.NTPServers, ","),

dkam/pkg/script/Installer

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,7 @@ NODE_RS_URL={{ .RELEASE_TOKEN_URL }}
7878
RELEASE_FQDN={{ .RELEASE_FQDN }}
7979
CADDY_APT_PROXY_URL={{ .FILE_SERVER }}
8080
CADDY_APT_PROXY_PORT={{ .ORCH_APT_PORT }}
81-
CADDY_REGISTRY_PROXY_URL={{ .IMG_REGISTRY_URL }}
82-
CADDY_REGISTRY_PROXY_PORT={{ .ORCH_IMG_PORT }}
81+
REGISTRY_URL={{ .IMG_REGISTRY_URL }}
8382
DEB_PACKAGES_REPO={{ .DEB_PACKAGES_REPO }}
8483
FILE_RS_ROOT={{ .FILE_RS_ROOT }}
8584

@@ -252,8 +251,7 @@ install_node_agent(){
252251
echo "node-agent node-agent/auth.rsTokenURL string ${NODE_RS_URL}" | debconf-set-selections
253252
echo "node-agent node-agent/proxy.aptSourceURL string ${CADDY_APT_PROXY_URL}" | debconf-set-selections
254253
echo "node-agent node-agent/proxy.aptSourceProxyPort string ${CADDY_APT_PROXY_PORT}" | debconf-set-selections
255-
echo "node-agent node-agent/proxy.imgRegistryURL string ${CADDY_REGISTRY_PROXY_URL}" | debconf-set-selections
256-
echo "node-agent node-agent/proxy.imgRegistryProxyPort string ${CADDY_REGISTRY_PROXY_PORT}" | debconf-set-selections
254+
echo "node-agent node-agent/proxy.aptSourceFilesRSRoot string ${FILE_RS_ROOT}" | debconf-set-selections
257255
echo "node-agent node-agent/auth.RSType string ${RS_TYPE}" | debconf-set-selections
258256

259257
echo "Install caddy for node agent..."
@@ -262,9 +260,9 @@ install_node_agent(){
262260
CADDY_VERSION={{ index . "caddy-VERSION" }}
263261
CADDY_PKGFILE="./caddy_${CADDY_VERSION}_linux_amd64.deb"
264262
if [ "$RS_TYPE" == "auth" ]; then
265-
echo "${RS_AT}" | oras pull "${CADDY_REGISTRY_PROXY_URL}/${DEB_PACKAGES_REPO}/caddy:$CADDY_VERSION" --password-stdin
263+
echo "${RS_AT}" | oras pull "${REGISTRY_URL}/${DEB_PACKAGES_REPO}/caddy:$CADDY_VERSION" --password-stdin
266264
else
267-
oras pull "${CADDY_REGISTRY_PROXY_URL}/${DEB_PACKAGES_REPO}/caddy:$CADDY_VERSION"
265+
oras pull "${REGISTRY_URL}/${DEB_PACKAGES_REPO}/caddy:$CADDY_VERSION"
268266
fi
269267
if [ ! -f "${CADDY_PKGFILE}" ]; then
270268
echo "caddy debian package could not be downloaded. Aborting installation"
@@ -285,9 +283,9 @@ install_node_agent(){
285283

286284
echo "download node agent"
287285
if [ "$RS_TYPE" == "auth" ]; then
288-
echo "${RS_AT}" | oras pull "${CADDY_REGISTRY_PROXY_URL}/${DEB_PACKAGES_REPO}/node-agent:$VERSION" --password-stdin
286+
echo "${RS_AT}" | oras pull "${REGISTRY_URL}/${DEB_PACKAGES_REPO}/node-agent:$VERSION" --password-stdin
289287
else
290-
oras pull "${CADDY_REGISTRY_PROXY_URL}/${DEB_PACKAGES_REPO}/node-agent:$VERSION"
288+
oras pull "${REGISTRY_URL}/${DEB_PACKAGES_REPO}/node-agent:$VERSION"
291289
fi
292290

293291
if [ ! -f "${PKGFILE}" ]; then
@@ -303,7 +301,7 @@ install_node_agent(){
303301

304302
echo "wait for node agent and client proxy to start"
305303
while true; do
306-
http_status=$(curl -s -o /dev/null -w "%{http_code}" "https://localhost:$CADDY_APT_PROXY_PORT/${FILE_RS_ROOT}/edge-node.asc")
304+
http_status=$(curl -s -o /dev/null -w "%{http_code}" "http://localhost:$CADDY_APT_PROXY_PORT/${FILE_RS_ROOT}/edge-node.asc")
307305
if [ "$http_status" -eq 200 ]; then
308306
echo "Client proxy is active"
309307
break
@@ -319,7 +317,7 @@ install_node_agent(){
319317
else
320318
curl -kfsSL "https://$CADDY_APT_PROXY_URL/${FILE_RS_ROOT}/edge-node.asc" -o /etc/apt/trusted.gpg.d/edge-node.asc
321319
fi
322-
echo "deb https://localhost:$CADDY_APT_PROXY_PORT/${FILE_RS_ROOT}/repository ${APT_DISTRO} main" | tee /etc/apt/sources.list.d/edge-node.list
320+
echo "deb http://localhost:$CADDY_APT_PROXY_PORT/${FILE_RS_ROOT}/repository ${APT_DISTRO} main" | tee /etc/apt/sources.list.d/edge-node.list
323321

324322
apt-get update
325323
echo "install_node_agent done" | tee -a "$SCRIPT_DIR"/$STATUS_FILENAME

dkam/testing/testing_utils.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ func PrepareTestInfraConfig(_ *testing.T) {
179179
MetricsObservabilityURL: "metrics.test:443",
180180
KeycloakURL: "keycloak.test:443",
181181
TelemetryURL: "telemetry.test:443",
182-
RegistryURL: "registry.test:443",
182+
RegistryURL: "registry.test",
183183
FileServerURL: "fs.test:443",
184184
ProvisioningService: "provisioning.test:443",
185185
ProvisioningServerURL: "provisioning.test:443",

onboarding-manager/pkg/cloudinit/infra.cfg

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,7 @@ datasource:
114114
NODE_RS_URL={{ .RELEASE_TOKEN_URL }}
115115
CADDY_APT_PROXY_URL={{ .FILE_SERVER }}
116116
CADDY_APT_PROXY_PORT={{ .ORCH_APT_PORT }}
117-
CADDY_REGISTRY_PROXY_URL={{ .IMG_REGISTRY_URL }}
118-
CADDY_REGISTRY_PROXY_PORT={{ .ORCH_IMG_PORT }}
117+
REGISTRY_URL={{ .IMG_REGISTRY_URL }}
119118
OBSERVABILITY_LOGGING_URL={{ .ORCH_PLATFORM_OBS_HOST }}
120119
OBSERVABILITY_LOGGING_PORT={{ .ORCH_PLATFORM_OBS_PORT }}
121120
OBSERVABILITY_METRICS_URL={{ .ORCH_PLATFORM_OBS_METRICS_HOST }}

onboarding-manager/pkg/cloudinit/testout/expected-installer-01.cfg

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,7 @@ datasource:
7070
NODE_RS_URL=rs.test:443
7171
CADDY_APT_PROXY_URL=fs.test
7272
CADDY_APT_PROXY_PORT=443
73-
CADDY_REGISTRY_PROXY_URL=registry.test
74-
CADDY_REGISTRY_PROXY_PORT=443
73+
REGISTRY_URL=registry.test
7574
OBSERVABILITY_LOGGING_URL=logs.test
7675
OBSERVABILITY_LOGGING_PORT=443
7776
OBSERVABILITY_METRICS_URL=metrics.test

onboarding-manager/pkg/cloudinit/testout/expected-installer-02.cfg

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,7 @@ datasource:
7070
NODE_RS_URL=rs.test:443
7171
CADDY_APT_PROXY_URL=fs.test
7272
CADDY_APT_PROXY_PORT=443
73-
CADDY_REGISTRY_PROXY_URL=registry.test
74-
CADDY_REGISTRY_PROXY_PORT=443
73+
REGISTRY_URL=registry.test
7574
OBSERVABILITY_LOGGING_URL=logs.test
7675
OBSERVABILITY_LOGGING_PORT=443
7776
OBSERVABILITY_METRICS_URL=metrics.test

onboarding-manager/pkg/cloudinit/testout/expected-installer-03.cfg

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,7 @@ datasource:
7070
NODE_RS_URL=rs.test:443
7171
CADDY_APT_PROXY_URL=fs.test
7272
CADDY_APT_PROXY_PORT=443
73-
CADDY_REGISTRY_PROXY_URL=registry.test
74-
CADDY_REGISTRY_PROXY_PORT=443
73+
REGISTRY_URL=registry.test
7574
OBSERVABILITY_LOGGING_URL=logs.test
7675
OBSERVABILITY_LOGGING_PORT=443
7776
OBSERVABILITY_METRICS_URL=metrics.test

onboarding-manager/pkg/cloudinit/testout/expected-installer-04.cfg

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,7 @@ datasource:
6262
NODE_RS_URL=rs.test:443
6363
CADDY_APT_PROXY_URL=fs.test
6464
CADDY_APT_PROXY_PORT=443
65-
CADDY_REGISTRY_PROXY_URL=registry.test
66-
CADDY_REGISTRY_PROXY_PORT=443
65+
REGISTRY_URL=registry.test
6766
OBSERVABILITY_LOGGING_URL=logs.test
6867
OBSERVABILITY_LOGGING_PORT=443
6968
OBSERVABILITY_METRICS_URL=metrics.test

onboarding-manager/pkg/cloudinit/testout/expected-installer-05.cfg

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,7 @@ datasource:
6262
NODE_RS_URL=rs.test:443
6363
CADDY_APT_PROXY_URL=fs.test
6464
CADDY_APT_PROXY_PORT=443
65-
CADDY_REGISTRY_PROXY_URL=registry.test
66-
CADDY_REGISTRY_PROXY_PORT=443
65+
REGISTRY_URL=registry.test
6766
OBSERVABILITY_LOGGING_URL=logs.test
6867
OBSERVABILITY_LOGGING_PORT=443
6968
OBSERVABILITY_METRICS_URL=metrics.test

onboarding-manager/pkg/cloudinit/testout/expected-installer-06.cfg

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,7 @@ datasource:
6262
NODE_RS_URL=rs.test:443
6363
CADDY_APT_PROXY_URL=fs.test
6464
CADDY_APT_PROXY_PORT=443
65-
CADDY_REGISTRY_PROXY_URL=registry.test
66-
CADDY_REGISTRY_PROXY_PORT=443
65+
REGISTRY_URL=registry.test
6766
OBSERVABILITY_LOGGING_URL=logs.test
6867
OBSERVABILITY_LOGGING_PORT=443
6968
OBSERVABILITY_METRICS_URL=metrics.test

onboarding-manager/pkg/cloudinit/testout/expected-installer-07.cfg

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,7 @@ datasource:
6262
NODE_RS_URL=rs.test:443
6363
CADDY_APT_PROXY_URL=fs.test
6464
CADDY_APT_PROXY_PORT=443
65-
CADDY_REGISTRY_PROXY_URL=registry.test
66-
CADDY_REGISTRY_PROXY_PORT=443
65+
REGISTRY_URL=registry.test
6766
OBSERVABILITY_LOGGING_URL=logs.test
6867
OBSERVABILITY_LOGGING_PORT=443
6968
OBSERVABILITY_METRICS_URL=metrics.test

onboarding-manager/pkg/cloudinit/testout/expected-installer-08.cfg

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,7 @@ datasource:
6262
NODE_RS_URL=rs.test:443
6363
CADDY_APT_PROXY_URL=fs.test
6464
CADDY_APT_PROXY_PORT=443
65-
CADDY_REGISTRY_PROXY_URL=registry.test
66-
CADDY_REGISTRY_PROXY_PORT=443
65+
REGISTRY_URL=registry.test
6766
OBSERVABILITY_LOGGING_URL=logs.test
6867
OBSERVABILITY_LOGGING_PORT=443
6968
OBSERVABILITY_METRICS_URL=metrics.test

onboarding-manager/pkg/cloudinit/testout/expected-installer-09.cfg

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,7 @@ datasource:
8888
NODE_RS_URL=rs.test:443
8989
CADDY_APT_PROXY_URL=fs.test
9090
CADDY_APT_PROXY_PORT=443
91-
CADDY_REGISTRY_PROXY_URL=registry.test
92-
CADDY_REGISTRY_PROXY_PORT=443
91+
REGISTRY_URL=registry.test
9392
OBSERVABILITY_LOGGING_URL=logs.test
9493
OBSERVABILITY_LOGGING_PORT=443
9594
OBSERVABILITY_METRICS_URL=metrics.test

onboarding-manager/pkg/cloudinit/testout/expected-installer-10.cfg

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,7 @@ datasource:
8888
NODE_RS_URL=rs.test:443
8989
CADDY_APT_PROXY_URL=fs.test
9090
CADDY_APT_PROXY_PORT=443
91-
CADDY_REGISTRY_PROXY_URL=registry.test
92-
CADDY_REGISTRY_PROXY_PORT=443
91+
REGISTRY_URL=registry.test
9392
OBSERVABILITY_LOGGING_URL=logs.test
9493
OBSERVABILITY_LOGGING_PORT=443
9594
OBSERVABILITY_METRICS_URL=metrics.test

onboarding-manager/pkg/cloudinit/testout/expected-installer-11.cfg

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,7 @@ datasource:
7171
NODE_RS_URL=rs.test:443
7272
CADDY_APT_PROXY_URL=fs.test
7373
CADDY_APT_PROXY_PORT=443
74-
CADDY_REGISTRY_PROXY_URL=registry.test
75-
CADDY_REGISTRY_PROXY_PORT=443
74+
REGISTRY_URL=registry.test
7675
OBSERVABILITY_LOGGING_URL=logs.test
7776
OBSERVABILITY_LOGGING_PORT=443
7877
OBSERVABILITY_METRICS_URL=metrics.test

onboarding-manager/pkg/cloudinit/testout/expected-installer-12.cfg

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,7 @@ datasource:
7777
NODE_RS_URL=rs.test:443
7878
CADDY_APT_PROXY_URL=fs.test
7979
CADDY_APT_PROXY_PORT=443
80-
CADDY_REGISTRY_PROXY_URL=registry.test
81-
CADDY_REGISTRY_PROXY_PORT=443
80+
REGISTRY_URL=registry.test
8281
OBSERVABILITY_LOGGING_URL=logs.test
8382
OBSERVABILITY_LOGGING_PORT=443
8483
OBSERVABILITY_METRICS_URL=metrics.test

onboarding-manager/pkg/platformbundle/ubuntu-22.04/Installer

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -177,18 +177,17 @@ install_node_agent(){
177177
echo "node-agent node-agent/auth.rsTokenURL string ${NODE_RS_URL}" | debconf-set-selections
178178
echo "node-agent node-agent/proxy.aptSourceURL string ${CADDY_APT_PROXY_URL}" | debconf-set-selections
179179
echo "node-agent node-agent/proxy.aptSourceProxyPort string ${CADDY_APT_PROXY_PORT}" | debconf-set-selections
180-
echo "node-agent node-agent/proxy.imgRegistryURL string ${CADDY_REGISTRY_PROXY_URL}" | debconf-set-selections
181-
echo "node-agent node-agent/proxy.imgRegistryProxyPort string ${CADDY_REGISTRY_PROXY_PORT}" | debconf-set-selections
180+
echo "node-agent node-agent/proxy.aptSourceFilesRSRoot string ${FILE_RS_ROOT}" | debconf-set-selections
182181
echo "node-agent node-agent/auth.RSType string ${RS_TYPE}" | debconf-set-selections
183182

184183
echo "Install caddy for node agent..."
185184

186185
echo "download caddy deb package..."
187186
CADDY_PKGFILE="./caddy_${CADDY_VERSION}_linux_amd64.deb"
188187
if [ "$RS_TYPE" == "auth" ]; then
189-
echo "${RS_AT}" | oras pull "${CADDY_REGISTRY_PROXY_URL}/${DEB_PACKAGES_REPO}/caddy:$CADDY_VERSION" --password-stdin
188+
echo "${RS_AT}" | oras pull "${REGISTRY_URL}/${DEB_PACKAGES_REPO}/caddy:$CADDY_VERSION" --password-stdin
190189
else
191-
oras pull "${CADDY_REGISTRY_PROXY_URL}/${DEB_PACKAGES_REPO}/caddy:$CADDY_VERSION"
190+
oras pull "${REGISTRY_URL}/${DEB_PACKAGES_REPO}/caddy:$CADDY_VERSION"
192191
fi
193192

194193
if [ ! -f "${CADDY_PKGFILE}" ]; then
@@ -209,9 +208,9 @@ install_node_agent(){
209208

210209
echo "download node agent"
211210
if [ "$RS_TYPE" == "auth" ]; then
212-
echo "${RS_AT}" | oras pull "${CADDY_REGISTRY_PROXY_URL}/${DEB_PACKAGES_REPO}/node-agent:$NODE_AGENT_VERSION" --password-stdin
211+
echo "${RS_AT}" | oras pull "${REGISTRY_URL}/${DEB_PACKAGES_REPO}/node-agent:$NODE_AGENT_VERSION" --password-stdin
213212
else
214-
oras pull "${CADDY_REGISTRY_PROXY_URL}/${DEB_PACKAGES_REPO}/node-agent:$NODE_AGENT_VERSION"
213+
oras pull "${REGISTRY_URL}/${DEB_PACKAGES_REPO}/node-agent:$NODE_AGENT_VERSION"
215214
fi
216215

217216
if [ ! -f "${PKGFILE}" ]; then
@@ -227,7 +226,7 @@ install_node_agent(){
227226

228227
echo "wait for node agent and client proxy to start"
229228
while true; do
230-
http_status=$(curl -s -o /dev/null -w "%{http_code}" "https://localhost:$CADDY_APT_PROXY_PORT/${FILE_RS_ROOT}/edge-node.asc")
229+
http_status=$(curl -s -o /dev/null -w "%{http_code}" "http://localhost:$CADDY_APT_PROXY_PORT/${FILE_RS_ROOT}/edge-node.asc")
231230
if [ "$http_status" -eq 200 ]; then
232231
echo "Client proxy is active"
233232
break
@@ -243,7 +242,7 @@ install_node_agent(){
243242
else
244243
curl -kfsSL "https://$CADDY_APT_PROXY_URL/${FILE_RS_ROOT}/edge-node.asc" -o /etc/apt/trusted.gpg.d/edge-node.asc
245244
fi
246-
echo "deb https://localhost:$CADDY_APT_PROXY_PORT/${FILE_RS_ROOT}/repository ${APT_DISTRO} main" | tee /etc/apt/sources.list.d/edge-node.list
245+
echo "deb http://localhost:$CADDY_APT_PROXY_PORT/${FILE_RS_ROOT}/repository ${APT_DISTRO} main" | tee /etc/apt/sources.list.d/edge-node.list
247246

248247
apt-get update
249248
echo "install_node_agent done" | tee -a "$SCRIPT_DIR"/$STATUS_FILENAME

0 commit comments

Comments
 (0)