ACME compatibility fix for /.well-known/

+ Updated acme well known take-over regrex
+ Added experimental config export and import
+ Added unit test for location rewrite in dpcore
+ Moved all config files to ./conf and original proxy files to ./conf/proxy
+ Minor optimization on UI regarding TLS verification logo on subdomain and vdir list
This commit is contained in:
Toby Chui
2023-07-12 21:42:09 +08:00
parent 12c1118af9
commit 153d056bdf
19 changed files with 455 additions and 57 deletions

View File

@@ -111,7 +111,7 @@ func handleListCertificate(w http.ResponseWriter, r *http.Request) {
// List all certificates and map all their domains to the cert filename
func handleListDomains(w http.ResponseWriter, r *http.Request) {
filenames, err := os.ReadDir("./certs/")
filenames, err := os.ReadDir("./conf/certs/")
if err != nil {
utils.SendErrorResponse(w, err.Error())
@@ -123,7 +123,7 @@ func handleListDomains(w http.ResponseWriter, r *http.Request) {
if filename.IsDir() {
continue
}
certFilepath := filepath.Join("./certs/", filename.Name())
certFilepath := filepath.Join("./conf/certs/", filename.Name())
certBtyes, err := os.ReadFile(certFilepath)
if err != nil {
@@ -273,8 +273,8 @@ func handleCertUpload(w http.ResponseWriter, r *http.Request) {
defer file.Close()
// create file in upload directory
os.MkdirAll("./certs", 0775)
f, err := os.Create(filepath.Join("./certs", overWriteFilename))
os.MkdirAll("./conf/certs", 0775)
f, err := os.Create(filepath.Join("./conf/certs", overWriteFilename))
if err != nil {
http.Error(w, "Failed to create file", http.StatusInternalServerError)
return