From 9c34914f5f21f8e6879c95972ee1c53a63366bbd Mon Sep 17 00:00:00 2001 From: Ruel Tmeizeh - RuhNet Date: Wed, 9 Apr 2025 12:12:42 -0400 Subject: [PATCH] README update, more detailed cert error logging. --- README.md | 5 ++++- main.go | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e48f8c5..97824b8 100644 --- a/README.md +++ b/README.md @@ -35,9 +35,12 @@ LEAPI operates in a multi-master configuration. When you add or delete a server - Download the LEAPI binary, or build from source. - Copy it to ```/opt/leapi``` - You may use the included SystemD service file if you use a SystemD based distribution. -- Edit the ```leapi_config.json``` file for your needs, leaving ```production``` set to ```false``` until setup is complete. Set the ```sync_type``` to either ```ssh``` or ```https```. If you choose ```ssh``` you must create and copy keys and verify you can login to all servers that need to share files between each other. Note: if you enable ```https_server_port``` in the config file, LEAPI needs a certificate to be able to start (it requires the ```tls_chain_path``` and ```tls_key_path```). You can generate a temporary self signed certificate and key with openssl: +- Edit the ```leapi_config.json``` file for your needs, leaving ```production``` set to ```false``` until setup is complete. Set the ```sync_type``` to either ```ssh``` or ```https```. If you choose ```ssh``` you must create and copy keys and verify you can login to all servers that need to share files between each other. Note: if you enable ```https_server_port``` in the config file, LEAPI needs a certificate to be able to start (it requires the ```tls_chain_path_prefix``` and ```tls_key_path_prefix```). You can generate a temporary self signed certificate and key with OpenSSL: ``` openssl req -x509 -nodes -newkey rsa:4096 -keyout privkey.key -out cert.crt -sha256 -days 365 + +cp cert.crt {tls_chain_path_prefix}00.crt # example: 'cp cert.crt /etc/ssl/leapi/chain00.crt' +cp privkey.key {tls_key_path_prefix}00.key ``` - Copy the config file to ```/opt/leapi``` or ```/etc```. - Install getssl diff --git a/main.go b/main.go index 15a8f0f..f65d800 100644 --- a/main.go +++ b/main.go @@ -315,8 +315,8 @@ func main() { //certPair, err := tls.LoadX509KeyPair(appconf.TLSCertificateFile, appconf.TLSKeyPath) if !fileExists(certPath) || !fileExists(keyPath) { - fmt.Println("Provided certificate and/or key file does not exist! Terminating.") - log.Fatal("Provided certificate and/or key file does not exist! Terminating.") + fmt.Println("Provided certificate " + appconf.TLSChainPath + "00.crt and/or key file " + appconf.TLSKeyPath + "00.key does not exist! Terminating.") + log.Fatal("Provided certificate " + appconf.TLSChainPath + "00.crt and/or key file " + appconf.TLSKeyPath + "00.key does not exist! Terminating.") } //Create loader for cert files