fixed path resolution
This commit is contained in:
+3
-2
@@ -15,6 +15,7 @@ import (
|
||||
"encoding/json"
|
||||
"net/http"
|
||||
"io/ioutil"
|
||||
"path/filepath"
|
||||
)
|
||||
|
||||
/* global API root URL placeholder */
|
||||
@@ -124,11 +125,11 @@ func oc_process_message(rawmsg map[string]interface{}) {
|
||||
|
||||
/* entry point */
|
||||
func owncast_run(config map[string]interface{}) {
|
||||
token_path := "auth/oc-token.txt"
|
||||
token_path := filepath.Join(APP_ROOT_DIR, "auth", "oc-token.txt")
|
||||
token, err := ioutil.ReadFile(token_path)
|
||||
token_err_msg := "[owncast] No Owncast token file provided or it is empty. "
|
||||
token_err_msg += "Please generate a token in your Owncast admin panel "
|
||||
token_err_msg += "and paste it into the auth/oc-token.txt file!"
|
||||
token_err_msg += "and paste it into the " + token_path + " file!"
|
||||
if err != nil {
|
||||
log.Fatal(token_err_msg + "\nDetailed error: ", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user