Skip to content

Commit

Permalink
fix(docker registry): fix change tls
Browse files Browse the repository at this point in the history
Signed-off-by: devopstales <42894256+devopstales@users.noreply.github.com>
  • Loading branch information
devopstales committed Jun 5, 2023
1 parent 498e6d0 commit 03b66f5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
3 changes: 2 additions & 1 deletion src/kubedash/functions/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,12 +434,13 @@ def RegistryServerUpdate(registry_server_url, registry_server_url_old, registry_
if registry:
registry.registry_server_url = registry_server_url
registry.registry_server_port = registry_server_port
registry.registry_server_auth = registry_server_auth
registry.registry_server_tls = registry_server_tls
registry.insecure_tls = insecure_tls
if registry_server_auth:
registry.registry_server_auth = registry_server_auth
usrPass = registry_server_auth_user + ":" + registry_server_auth_pass
registry.registry_server_auth_token = str(base64_encode(usrPass), "UTF-8")
print(registry.insecure_tls)
db.session.commit()

def RegistryServerListGet():
Expand Down
13 changes: 7 additions & 6 deletions src/kubedash/templates/registry.html.j2
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,12 @@
<div class="custom-control custom-switch">
<input type="checkbox" class="custom-control-input" id="registry_server_tls_register" onclick="checkbox('registry_server_tls_register')" checked>
<label class="custom-control-label" for="registry_server_tls_register">TLS</label>
<input type="text" name="registry_server_tls_register_value" id="registry_server_tls_register_value" value="True">
<input type="hidden" name="registry_server_tls_register_value" id="registry_server_tls_register_value" value="True">
</div>
<div class="custom-control custom-switch">
<input type="checkbox" class="custom-control-input" id="insecure_tls_register" onclick="checkbox('insecure_tls_register')">
<label class="custom-control-label" for="insecure_tls_register">Insecure TLS</label>
<input type="text" name="insecure_tls_register_value" id="insecure_tls_register_value" value="False">
<input type="hidden" name="insecure_tls_register_value" id="insecure_tls_register_value" value="False">
</div>
<div class="modal-footer">
<div class="form-group mt-2">
Expand Down Expand Up @@ -151,6 +151,7 @@
<form action="/registry" method="POST">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
<input type="hidden" name="request_type" value="edit" />
<input type="hidden" name="registry_server_url_old" value="{{ server.registry_server_url }}" />
<div class="form-group">
<label for="registry_server_url">Registry Hostname</label>
<input type="text" class="form-control" id="registry_server_url" name="registry_server_url" value="{{ server.registry_server_url }}">
Expand All @@ -168,14 +169,14 @@
<input type="password" class="form-control" id="registry_server_auth_pass" name="registry_server_auth_pass" value="{{ server.registry_server_auth_pass|replace('None','') }}">
</div>
<div class="custom-control custom-switch">
<input type="checkbox" class="custom-control-input" id="registry_server_tls_edit" onclick="checkbox('registry_server_tls_edit')" checked>
<input type="checkbox" class="custom-control-input" id="registry_server_tls_edit" onclick="checkbox('registry_server_tls_edit')" {% if server.registry_server_tls %}checked{% endif %}>
<label class="custom-control-label" for="registry_server_tls_edit">TLS</label>
<input type="hidden" name="registry_server_tls_edit_value" id="registry_server_tls_edit_value" value="True">
<input type="hidden" name="registry_server_tls_edit_value" id="registry_server_tls_edit_value" value="{{ server.registry_server_tls }}">
</div>
<div class="custom-control custom-switch">
<input type="checkbox" class="custom-control-input" id="insecure_tls_edit" onclick="checkbox('insecure_tls_edit')">
<input type="checkbox" class="custom-control-input" id="insecure_tls_edit" onclick="checkbox('insecure_tls_edit')" {% if server.insecure_tls %}checked{% endif %}>
<label class="custom-control-label" for="insecure_tls_edit">Insecure TLS</label>
<input type="hidden" name="insecure_tls_edit_value" id="insecure_tls_edit_value" value="False">
<input type="hidden" name="insecure_tls_edit_value" id="insecure_tls_edit_value" value="{{ server.insecure_tls }}">
</div>
<div class="modal-footer">
<div class="form-group mt-2">
Expand Down

0 comments on commit 03b66f5

Please sign in to comment.