Port cor-title and add file check endpoint
Fix some FA5 regressions Fix uploading cert files Add fix some icons
This commit is contained in:
parent
b5f630ba29
commit
561522c6d3
24 changed files with 159 additions and 56 deletions
|
@ -1,4 +1,3 @@
|
|||
import os
|
||||
import logging
|
||||
import pathvalidate
|
||||
from flask import request, jsonify
|
||||
|
@ -6,7 +5,7 @@ from flask import request, jsonify
|
|||
from config_app.config_endpoints.exception import InvalidRequest
|
||||
from config_app.config_endpoints.api import resource, ApiResource, nickname
|
||||
from config_app.config_util.ssl import load_certificate, CertInvalidException
|
||||
from config_app.c_app import app, config_provider
|
||||
from config_app.c_app import config_provider
|
||||
|
||||
from config_app.config_endpoints.api.superuser_models_pre_oci import pre_oci_model
|
||||
|
||||
|
@ -37,8 +36,8 @@ class SuperUserCustomCertificate(ApiResource):
|
|||
# Validate the certificate.
|
||||
try:
|
||||
logger.debug('Loading custom certificate %s', certpath)
|
||||
with config_provider.get_volume_file(cert_full_path) as f:
|
||||
load_certificate(f.read())
|
||||
cert = config_provider.get_volume_file(cert_full_path)
|
||||
load_certificate(cert)
|
||||
except CertInvalidException:
|
||||
logger.exception('Got certificate invalid error for cert %s', certpath)
|
||||
return '', 204
|
||||
|
@ -46,14 +45,6 @@ class SuperUserCustomCertificate(ApiResource):
|
|||
logger.exception('Got IO error for cert %s', certpath)
|
||||
return '', 204
|
||||
|
||||
# Call the update script to install the certificate immediately.
|
||||
if not app.config['TESTING']:
|
||||
logger.debug('Calling certs_install.sh')
|
||||
if os.system('/conf/init/certs_install.sh') != 0:
|
||||
raise Exception('Could not install certificates')
|
||||
|
||||
logger.debug('certs_install.sh completed')
|
||||
|
||||
return '', 204
|
||||
|
||||
@nickname('deleteCustomCertificate')
|
||||
|
@ -79,7 +70,7 @@ class SuperUserCustomCertificates(ApiResource):
|
|||
cert_views = []
|
||||
for extra_cert_path in extra_certs_found:
|
||||
try:
|
||||
cert = config_provider.get_volume_path(EXTRA_CA_DIRECTORY, extra_cert_path)
|
||||
cert = config_provider.get_volume_file(extra_cert_path)
|
||||
certificate = load_certificate(cert)
|
||||
cert_views.append({
|
||||
'path': extra_cert_path,
|
||||
|
|
Reference in a new issue