diff --git a/handlers/api.go b/handlers/api.go index eddcdb56..16c1450d 100644 --- a/handlers/api.go +++ b/handlers/api.go @@ -36,7 +36,7 @@ type apiResponse struct { } func apiIndexHandler(w http.ResponseWriter, r *http.Request) { - if !IsAuthenticated(r) { + if !IsFullAuthenticated(r) { sendUnauthorizedJson(w, r) return } @@ -45,7 +45,7 @@ func apiIndexHandler(w http.ResponseWriter, r *http.Request) { } func apiRenewHandler(w http.ResponseWriter, r *http.Request) { - if !IsAuthenticated(r) { + if !IsFullAuthenticated(r) { sendUnauthorizedJson(w, r) return } diff --git a/handlers/checkin.go b/handlers/checkin.go index 1739ac77..e7711504 100644 --- a/handlers/checkin.go +++ b/handlers/checkin.go @@ -28,7 +28,7 @@ import ( ) func apiAllCheckinsHandler(w http.ResponseWriter, r *http.Request) { - if !IsAuthenticated(r) { + if !IsFullAuthenticated(r) { sendUnauthorizedJson(w, r) return } @@ -42,7 +42,7 @@ func apiAllCheckinsHandler(w http.ResponseWriter, r *http.Request) { } func apiCheckinHandler(w http.ResponseWriter, r *http.Request) { - if !IsAuthenticated(r) { + if !IsFullAuthenticated(r) { sendUnauthorizedJson(w, r) return } @@ -59,7 +59,7 @@ func apiCheckinHandler(w http.ResponseWriter, r *http.Request) { } func checkinCreateHandler(w http.ResponseWriter, r *http.Request) { - if !IsAuthenticated(r) { + if !IsFullAuthenticated(r) { http.Redirect(w, r, "/", http.StatusSeeOther) return } @@ -115,7 +115,7 @@ func checkinHitHandler(w http.ResponseWriter, r *http.Request) { } func checkinDeleteHandler(w http.ResponseWriter, r *http.Request) { - if !IsAuthenticated(r) { + if !IsFullAuthenticated(r) { http.Redirect(w, r, "/", http.StatusSeeOther) return } diff --git a/handlers/dashboard.go b/handlers/dashboard.go index 8bac17f6..e5b4abc3 100644 --- a/handlers/dashboard.go +++ b/handlers/dashboard.go @@ -27,7 +27,7 @@ import ( ) func dashboardHandler(w http.ResponseWriter, r *http.Request) { - if !IsAuthenticated(r) { + if !IsFullAuthenticated(r) { err := core.ErrorResponse{} ExecuteResponse(w, r, "login.gohtml", err, nil) } else { @@ -63,7 +63,7 @@ func logoutHandler(w http.ResponseWriter, r *http.Request) { } func helpHandler(w http.ResponseWriter, r *http.Request) { - if !IsAuthenticated(r) { + if !IsFullAuthenticated(r) { http.Redirect(w, r, "/", http.StatusSeeOther) return } @@ -72,7 +72,7 @@ func helpHandler(w http.ResponseWriter, r *http.Request) { } func logsHandler(w http.ResponseWriter, r *http.Request) { - if !IsAuthenticated(r) { + if !IsFullAuthenticated(r) { http.Redirect(w, r, "/", http.StatusSeeOther) return } @@ -88,7 +88,7 @@ func logsHandler(w http.ResponseWriter, r *http.Request) { } func logsLineHandler(w http.ResponseWriter, r *http.Request) { - if !IsAuthenticated(r) { + if !IsReadAuthenticated(r) { w.WriteHeader(http.StatusInternalServerError) return } @@ -100,7 +100,7 @@ func logsLineHandler(w http.ResponseWriter, r *http.Request) { } func exportHandler(w http.ResponseWriter, r *http.Request) { - if !IsAuthenticated(r) { + if !IsFullAuthenticated(r) { w.WriteHeader(http.StatusInternalServerError) return } diff --git a/handlers/handlers.go b/handlers/handlers.go index eb8dacec..8bd1ded2 100644 --- a/handlers/handlers.go +++ b/handlers/handlers.go @@ -96,9 +96,28 @@ func RunHTTPServer(ip string, port int) error { return nil } -// IsAuthenticated returns true if the HTTP request is authenticated. You can set the environment variable GO_ENV=test +// IsReadAuthenticated will allow Read Only authentication for some routes +func IsReadAuthenticated(r *http.Request) bool { + var token string + query := r.URL.Query() + key := query.Get("api") + if key == core.CoreApp.ApiKey { + return true + } + tokens, ok := r.Header["Authorization"] + if ok && len(tokens) >= 1 { + token = tokens[0] + token = strings.TrimPrefix(token, "Bearer ") + if token == core.CoreApp.ApiKey { + return true + } + } + return IsFullAuthenticated(r) +} + +// IsFullAuthenticated returns true if the HTTP request is authenticated. You can set the environment variable GO_ENV=test // to bypass the admin authenticate to the dashboard features. -func IsAuthenticated(r *http.Request) bool { +func IsFullAuthenticated(r *http.Request) bool { if os.Getenv("GO_ENV") == "test" { return true } @@ -139,7 +158,7 @@ var handlerFuncs = func(w http.ResponseWriter, r *http.Request) template.FuncMap return template.URL(u) }, "Auth": func() bool { - return IsAuthenticated(r) + return IsFullAuthenticated(r) }, "VERSION": func() string { return core.VERSION diff --git a/handlers/messages.go b/handlers/messages.go index 22c8ee44..35de6376 100644 --- a/handlers/messages.go +++ b/handlers/messages.go @@ -26,7 +26,7 @@ import ( ) func messagesHandler(w http.ResponseWriter, r *http.Request) { - if !IsAuthenticated(r) { + if !IsFullAuthenticated(r) { http.Redirect(w, r, "/", http.StatusSeeOther) return } @@ -35,7 +35,7 @@ func messagesHandler(w http.ResponseWriter, r *http.Request) { } func viewMessageHandler(w http.ResponseWriter, r *http.Request) { - if !IsAuthenticated(r) { + if !IsFullAuthenticated(r) { http.Redirect(w, r, "/", http.StatusSeeOther) return } @@ -50,7 +50,7 @@ func viewMessageHandler(w http.ResponseWriter, r *http.Request) { } func apiAllMessagesHandler(w http.ResponseWriter, r *http.Request) { - if !IsAuthenticated(r) { + if !IsReadAuthenticated(r) { sendUnauthorizedJson(w, r) return } @@ -64,7 +64,7 @@ func apiAllMessagesHandler(w http.ResponseWriter, r *http.Request) { } func apiMessageCreateHandler(w http.ResponseWriter, r *http.Request) { - if !IsAuthenticated(r) { + if !IsFullAuthenticated(r) { sendUnauthorizedJson(w, r) return } @@ -85,7 +85,7 @@ func apiMessageCreateHandler(w http.ResponseWriter, r *http.Request) { } func apiMessageGetHandler(w http.ResponseWriter, r *http.Request) { - if !IsAuthenticated(r) { + if !IsReadAuthenticated(r) { sendUnauthorizedJson(w, r) return } @@ -100,7 +100,7 @@ func apiMessageGetHandler(w http.ResponseWriter, r *http.Request) { } func apiMessageDeleteHandler(w http.ResponseWriter, r *http.Request) { - if !IsAuthenticated(r) { + if !IsFullAuthenticated(r) { sendUnauthorizedJson(w, r) return } @@ -119,7 +119,7 @@ func apiMessageDeleteHandler(w http.ResponseWriter, r *http.Request) { } func apiMessageUpdateHandler(w http.ResponseWriter, r *http.Request) { - if !IsAuthenticated(r) { + if !IsFullAuthenticated(r) { sendUnauthorizedJson(w, r) return } diff --git a/handlers/notifications.go b/handlers/notifications.go index df728176..3bdf8fd2 100644 --- a/handlers/notifications.go +++ b/handlers/notifications.go @@ -27,7 +27,7 @@ import ( ) func apiNotifiersHandler(w http.ResponseWriter, r *http.Request) { - if !IsAuthenticated(r) { + if !IsFullAuthenticated(r) { sendUnauthorizedJson(w, r) return } @@ -41,7 +41,7 @@ func apiNotifiersHandler(w http.ResponseWriter, r *http.Request) { } func apiNotifierGetHandler(w http.ResponseWriter, r *http.Request) { - if !IsAuthenticated(r) { + if !IsFullAuthenticated(r) { sendUnauthorizedJson(w, r) return } @@ -56,7 +56,7 @@ func apiNotifierGetHandler(w http.ResponseWriter, r *http.Request) { } func apiNotifierUpdateHandler(w http.ResponseWriter, r *http.Request) { - if !IsAuthenticated(r) { + if !IsFullAuthenticated(r) { sendUnauthorizedJson(w, r) return } @@ -83,7 +83,7 @@ func apiNotifierUpdateHandler(w http.ResponseWriter, r *http.Request) { func testNotificationHandler(w http.ResponseWriter, r *http.Request) { var err error - if !IsAuthenticated(r) { + if !IsFullAuthenticated(r) { http.Redirect(w, r, "/", http.StatusSeeOther) return } diff --git a/handlers/plugins.go b/handlers/plugins.go index aaf4053c..6da869c5 100644 --- a/handlers/plugins.go +++ b/handlers/plugins.go @@ -27,7 +27,7 @@ type PluginSelect struct { } func pluginSavedHandler(w http.ResponseWriter, r *http.Request) { - if !IsAuthenticated(r) { + if !IsFullAuthenticated(r) { http.Redirect(w, r, "/", http.StatusSeeOther) return } @@ -43,7 +43,7 @@ func pluginSavedHandler(w http.ResponseWriter, r *http.Request) { } func pluginsDownloadHandler(w http.ResponseWriter, r *http.Request) { - auth := IsAuthenticated(r) + auth := IsFullAuthenticated(r) if !auth { http.Redirect(w, r, "/", http.StatusSeeOther) return diff --git a/handlers/prometheus.go b/handlers/prometheus.go index 3e2d9969..8acee7ea 100644 --- a/handlers/prometheus.go +++ b/handlers/prometheus.go @@ -33,7 +33,7 @@ import ( // func prometheusHandler(w http.ResponseWriter, r *http.Request) { - if !IsAuthenticated(r) { + if !IsReadAuthenticated(r) { http.Redirect(w, r, "/", http.StatusSeeOther) return } diff --git a/handlers/routes.go b/handlers/routes.go index 369dd0e8..2feaaab8 100644 --- a/handlers/routes.go +++ b/handlers/routes.go @@ -93,7 +93,7 @@ func Router() *mux.Router { r.Handle("/api/services", http.HandlerFunc(apiAllServicesHandler)).Methods("GET") r.Handle("/api/services", http.HandlerFunc(apiCreateServiceHandler)).Methods("POST") r.Handle("/api/services/{id}", http.HandlerFunc(apiServiceHandler)).Methods("GET") - r.Handle("/api/services/reorder", http.HandlerFunc(reorderServiceHandler)).Methods("POST") + r.Handle("/api/reorder", http.HandlerFunc(reorderServiceHandler)).Methods("POST") r.Handle("/api/services/{id}/data", cached("30s", "application/json", http.HandlerFunc(apiServiceDataHandler))).Methods("GET") r.Handle("/api/services/{id}/ping", http.HandlerFunc(apiServicePingDataHandler)).Methods("GET") r.Handle("/api/services/{id}", http.HandlerFunc(apiServiceUpdateHandler)).Methods("POST") diff --git a/handlers/services.go b/handlers/services.go index cb1f2bb7..262ee225 100644 --- a/handlers/services.go +++ b/handlers/services.go @@ -47,7 +47,7 @@ func renderServiceChartsHandler(w http.ResponseWriter, r *http.Request) { } func servicesHandler(w http.ResponseWriter, r *http.Request) { - if !IsAuthenticated(r) { + if !IsFullAuthenticated(r) { http.Redirect(w, r, "/", http.StatusSeeOther) return } @@ -60,7 +60,7 @@ type serviceOrder struct { } func reorderServiceHandler(w http.ResponseWriter, r *http.Request) { - if !IsAuthenticated(r) { + if !IsFullAuthenticated(r) { http.Redirect(w, r, "/", http.StatusSeeOther) return } @@ -119,7 +119,7 @@ func servicesViewHandler(w http.ResponseWriter, r *http.Request) { } func apiServiceHandler(w http.ResponseWriter, r *http.Request) { - if !IsAuthenticated(r) { + if !IsReadAuthenticated(r) { sendUnauthorizedJson(w, r) return } @@ -134,7 +134,7 @@ func apiServiceHandler(w http.ResponseWriter, r *http.Request) { } func apiCreateServiceHandler(w http.ResponseWriter, r *http.Request) { - if !IsAuthenticated(r) { + if !IsFullAuthenticated(r) { sendUnauthorizedJson(w, r) return } @@ -155,7 +155,7 @@ func apiCreateServiceHandler(w http.ResponseWriter, r *http.Request) { } func apiServiceUpdateHandler(w http.ResponseWriter, r *http.Request) { - if !IsAuthenticated(r) { + if !IsFullAuthenticated(r) { sendUnauthorizedJson(w, r) return } @@ -219,7 +219,7 @@ func apiServicePingDataHandler(w http.ResponseWriter, r *http.Request) { } func apiServiceDeleteHandler(w http.ResponseWriter, r *http.Request) { - if !IsAuthenticated(r) { + if !IsFullAuthenticated(r) { sendUnauthorizedJson(w, r) return } @@ -238,7 +238,7 @@ func apiServiceDeleteHandler(w http.ResponseWriter, r *http.Request) { } func apiAllServicesHandler(w http.ResponseWriter, r *http.Request) { - if !IsAuthenticated(r) { + if !IsReadAuthenticated(r) { sendUnauthorizedJson(w, r) return } @@ -248,7 +248,7 @@ func apiAllServicesHandler(w http.ResponseWriter, r *http.Request) { } func servicesDeleteFailuresHandler(w http.ResponseWriter, r *http.Request) { - if !IsAuthenticated(r) { + if !IsFullAuthenticated(r) { http.Redirect(w, r, "/", http.StatusSeeOther) return } diff --git a/handlers/settings.go b/handlers/settings.go index 2a52d950..1551f6da 100644 --- a/handlers/settings.go +++ b/handlers/settings.go @@ -28,7 +28,7 @@ import ( ) func settingsHandler(w http.ResponseWriter, r *http.Request) { - if !IsAuthenticated(r) { + if !IsFullAuthenticated(r) { http.Redirect(w, r, "/", http.StatusSeeOther) return } @@ -36,7 +36,7 @@ func settingsHandler(w http.ResponseWriter, r *http.Request) { } func saveSettingsHandler(w http.ResponseWriter, r *http.Request) { - if !IsAuthenticated(r) { + if !IsFullAuthenticated(r) { http.Redirect(w, r, "/", http.StatusSeeOther) return } @@ -77,7 +77,7 @@ func saveSettingsHandler(w http.ResponseWriter, r *http.Request) { } func saveSASSHandler(w http.ResponseWriter, r *http.Request) { - if !IsAuthenticated(r) { + if !IsFullAuthenticated(r) { http.Redirect(w, r, "/", http.StatusSeeOther) return } @@ -94,7 +94,7 @@ func saveSASSHandler(w http.ResponseWriter, r *http.Request) { } func saveAssetsHandler(w http.ResponseWriter, r *http.Request) { - if !IsAuthenticated(r) { + if !IsFullAuthenticated(r) { http.Redirect(w, r, "/", http.StatusSeeOther) return } @@ -115,7 +115,7 @@ func saveAssetsHandler(w http.ResponseWriter, r *http.Request) { } func deleteAssetsHandler(w http.ResponseWriter, r *http.Request) { - if !IsAuthenticated(r) { + if !IsFullAuthenticated(r) { http.Redirect(w, r, "/", http.StatusSeeOther) return } diff --git a/handlers/users.go b/handlers/users.go index b92f9dd9..c2a875c3 100644 --- a/handlers/users.go +++ b/handlers/users.go @@ -28,7 +28,7 @@ import ( ) func usersHandler(w http.ResponseWriter, r *http.Request) { - if !IsAuthenticated(r) { + if !IsFullAuthenticated(r) { http.Redirect(w, r, "/", http.StatusSeeOther) return } @@ -37,7 +37,7 @@ func usersHandler(w http.ResponseWriter, r *http.Request) { } func usersEditHandler(w http.ResponseWriter, r *http.Request) { - if !IsAuthenticated(r) { + if !IsFullAuthenticated(r) { http.Redirect(w, r, "/", http.StatusSeeOther) return } @@ -48,7 +48,7 @@ func usersEditHandler(w http.ResponseWriter, r *http.Request) { } func apiUserHandler(w http.ResponseWriter, r *http.Request) { - if !IsAuthenticated(r) { + if !IsFullAuthenticated(r) { sendUnauthorizedJson(w, r) return } @@ -64,7 +64,7 @@ func apiUserHandler(w http.ResponseWriter, r *http.Request) { } func apiUserUpdateHandler(w http.ResponseWriter, r *http.Request) { - if !IsAuthenticated(r) { + if !IsFullAuthenticated(r) { sendUnauthorizedJson(w, r) return } @@ -88,7 +88,7 @@ func apiUserUpdateHandler(w http.ResponseWriter, r *http.Request) { } func apiUserDeleteHandler(w http.ResponseWriter, r *http.Request) { - if !IsAuthenticated(r) { + if !IsFullAuthenticated(r) { sendUnauthorizedJson(w, r) return } @@ -112,7 +112,7 @@ func apiUserDeleteHandler(w http.ResponseWriter, r *http.Request) { } func apiAllUsersHandler(w http.ResponseWriter, r *http.Request) { - if !IsAuthenticated(r) { + if !IsFullAuthenticated(r) { sendUnauthorizedJson(w, r) return } @@ -126,7 +126,7 @@ func apiAllUsersHandler(w http.ResponseWriter, r *http.Request) { } func apiCreateUsersHandler(w http.ResponseWriter, r *http.Request) { - if !IsAuthenticated(r) { + if !IsFullAuthenticated(r) { sendUnauthorizedJson(w, r) return } diff --git a/notifiers/mobile.go b/notifiers/mobile.go index 3816a997..6bd74ac2 100644 --- a/notifiers/mobile.go +++ b/notifiers/mobile.go @@ -16,12 +16,13 @@ package notifiers import ( + "bytes" + "encoding/json" "fmt" "github.com/hunterlong/statping/core/notifier" "github.com/hunterlong/statping/types" "github.com/hunterlong/statping/utils" - "github.com/oliveroneill/exponent-server-sdk-golang/sdk" - "strings" + "os" "time" ) @@ -44,6 +45,12 @@ var mobile = &mobilePush{¬ifier.Notification{ Placeholder: "A list of your mobile device push notification ID's.", DbField: "var1", IsHidden: true, + }, { + Type: "number", + Title: "Array of device numbers", + Placeholder: "1 for iphone 2 for android", + DbField: "var2", + IsHidden: true, }}}, } @@ -59,7 +66,7 @@ func (u *mobilePush) Select() *notifier.Notification { return u.Notification } -func dataJson(s *types.Service, f *types.Failure) map[string]string { +func dataJson(s *types.Service, f *types.Failure) map[string]interface{} { serviceId := "0" if s != nil { serviceId = utils.ToString(s.Id) @@ -73,7 +80,7 @@ func dataJson(s *types.Service, f *types.Failure) map[string]string { issue = f.Issue } link := fmt.Sprintf("statup://service?id=%v", serviceId) - out := map[string]string{ + out := map[string]interface{}{ "status": online, "id": serviceId, "issue": issue, @@ -85,12 +92,10 @@ func dataJson(s *types.Service, f *types.Failure) map[string]string { // OnFailure will trigger failing service func (u *mobilePush) OnFailure(s *types.Service, f *types.Failure) { data := dataJson(s, f) - msg := &expo.PushMessage{ - Body: fmt.Sprintf("Your service '%v' is currently failing! Reason: %v", s.Name, f.Issue), - Sound: "default", - Title: "Service Offline", - Data: data, - Priority: expo.DefaultPriority, + msg := &PushArray{ + Message: fmt.Sprintf("Your service '%v' is currently failing! Reason: %v", s.Name, f.Issue), + Title: "Service Offline", + Data: data, } u.AddQueue(s.Id, msg) u.Online = false @@ -101,12 +106,10 @@ func (u *mobilePush) OnSuccess(s *types.Service) { data := dataJson(s, nil) if !u.Online { u.ResetUniqueQueue(s.Id) - msg := &expo.PushMessage{ - Body: fmt.Sprintf("Your service '%v' is back online!", s.Name), - Sound: "default", - Title: "Service Online", - Data: data, - Priority: expo.DefaultPriority, + msg := &PushArray{ + Message: fmt.Sprintf("Your service '%v' is back online!", s.Name), + Title: "Service Online", + Data: data, } u.AddQueue(s.Id, msg) } @@ -115,11 +118,9 @@ func (u *mobilePush) OnSuccess(s *types.Service) { // OnSave triggers when this notifier has been saved func (u *mobilePush) OnSave() error { - msg := &expo.PushMessage{ - Body: "The Mobile Notifier has been saved", - Sound: "default", - Title: "Notification Saved", - Priority: expo.DefaultPriority, + msg := &PushArray{ + Message: "The Mobile Notifier has been saved", + Title: "Notification Saved", } u.AddQueue(0, msg) return nil @@ -130,26 +131,45 @@ func (u *mobilePush) OnTest() error { return nil } -// Send will send message to expo mobile push notifications endpoint +// Send will send message to Statping push notifications endpoint func (u *mobilePush) Send(msg interface{}) error { - pushMessage := msg.(*expo.PushMessage) - client := expo.NewPushClient(nil) - splitIds := strings.Split(u.Var1, ",") - - for _, id := range splitIds { - pushToken, err := expo.NewExponentPushToken(expo.ExponentPushToken(id)) - if err != nil { - return err - } - pushMessage.To = pushToken - response, err := client.Publish(pushMessage) - if err != nil { - return err - } - if response.ValidateResponse() != nil { - fmt.Println(response.PushMessage.To, "failed") - } + pushMessage := msg.(*PushArray) + pushMessage.Tokens = []string{u.Var1} + pushMessage.Platform = utils.ToInt(u.Var2) + err := pushRequest(pushMessage) + if err != nil { + return err } - return nil } + +func pushRequest(msg *PushArray) error { + if msg.Platform == 1 { + msg.Title = "" + } + body, _ := json.Marshal(&PushNotification{[]*PushArray{msg}}) + url := "https://push.statping.com/api/push" + if os.Getenv("GO_ENV") == "test" { + url = "https://pushdev.statping.com/api/push" + } + _, _, err := utils.HttpRequest(url, "POST", "application/json", nil, bytes.NewBuffer(body), time.Duration(10*time.Second)) + return err +} + +type PushNotification struct { + Array []*PushArray `json:"notifications"` +} + +type PushArray struct { + Tokens []string `json:"tokens"` + Platform int64 `json:"platform"` + Message string `json:"message"` + Title string `json:"title,omitempty"` + Data map[string]interface{} `json:"data,omitempty"` +} + +type MobileResponse struct { + Counts int `json:"counts"` + Logs []interface{} `json:"logs"` + Success string `json:"success"` +} diff --git a/notifiers/mobile_test.go b/notifiers/mobile_test.go index ae0cbf93..c43111c7 100644 --- a/notifiers/mobile_test.go +++ b/notifiers/mobile_test.go @@ -24,17 +24,20 @@ import ( ) var ( - MOBILE_ID string + MOBILE_ID string + MOBILE_NUMBER string ) func init() { MOBILE_ID = os.Getenv("MOBILE_ID") + MOBILE_NUMBER = os.Getenv("MOBILE_NUMBER") mobile.Var1 = MOBILE_ID } func TestMobileNotifier(t *testing.T) { t.Parallel() mobile.Var1 = MOBILE_ID + mobile.Var2 = os.Getenv("MOBILE_NUMBER") if MOBILE_ID == "" { t.Log("mobile notifier testing skipped, missing MOBILE_ID environment variable") t.SkipNow() @@ -43,12 +46,14 @@ func TestMobileNotifier(t *testing.T) { t.Run("Load mobile", func(t *testing.T) { mobile.Var1 = MOBILE_ID + mobile.Var2 = MOBILE_NUMBER mobile.Delay = time.Duration(100 * time.Millisecond) mobile.Limits = 3 err := notifier.AddNotifier(mobile) assert.Nil(t, err) assert.Equal(t, "Hunter Long", mobile.Author) assert.Equal(t, MOBILE_ID, mobile.Var1) + assert.Equal(t, MOBILE_NUMBER, mobile.Var2) }) t.Run("Load mobile Notifier", func(t *testing.T) { diff --git a/source/tmpl/services.gohtml b/source/tmpl/services.gohtml index 432087c3..ea5c8d4d 100644 --- a/source/tmpl/services.gohtml +++ b/source/tmpl/services.gohtml @@ -61,7 +61,7 @@ newOrder.push(o); }); $.ajax({ - url: "/api/services/reorder", + url: "/api/reorder", type: 'POST', data: JSON.stringify(newOrder), contentType: "application/json", diff --git a/source/tmpl/settings.gohtml b/source/tmpl/settings.gohtml index e1b3a23a..c0e6edc6 100644 --- a/source/tmpl/settings.gohtml +++ b/source/tmpl/settings.gohtml @@ -106,6 +106,7 @@
+ API Key can be used for read only routes
@@ -113,6 +114,7 @@
+ API Secret is used for read, create, update and delete routes You can Regenerate API Keys if you need to.
diff --git a/version.txt b/version.txt index 8c273553..a28b7d15 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -0.80.1 \ No newline at end of file +0.80.2 \ No newline at end of file