Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cmd/frontend/auth/non_public.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ var (
router.ResetPasswordInit: {},
router.ResetPasswordCode: {},
router.CheckUsernameTaken: {},
router.AppUpdateCheck: {},
}
anonymousAccessibleUIRoutes = map[string]struct{}{
uirouter.RouteSignIn: {},
Expand Down
1 change: 1 addition & 0 deletions cmd/frontend/internal/app/router/BUILD.bazel

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions cmd/frontend/internal/app/router/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ package router
import (
"github.com/gorilla/mux"

"github.com/sourcegraph/sourcegraph/cmd/frontend/internal/app/updatecheck"
"github.com/sourcegraph/sourcegraph/cmd/frontend/internal/routevar"
)

Expand Down Expand Up @@ -54,6 +55,8 @@ const (
GopherconLiveBlog = "gophercon.live.blog"

UI = "ui"

AppUpdateCheck = updatecheck.RouteAppUpdateCheck
)

// Router returns the frontend app router.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ func (checker *AppUpdateChecker) Handler() http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
appClientVersion := readClientAppVersion(r.URL)
if err := appClientVersion.validate(); err != nil {
checker.logger.Error("app client version failed validation", log.Error(err))
w.WriteHeader(http.StatusBadRequest)
return
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/frontend/internal/httpapi/httpapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ func NewHandler(
m.Get(apirouter.CodeInsightsDataExport).Handler(trace.Route(handlers.CodeInsightsDataExportHandler))

if envvar.SourcegraphDotComMode() {
m.Path("/app/check/update").Handler(trace.Route(updatecheck.AppUpdateHandler(logger)))
m.Path("/app/check/update").Name(updatecheck.RouteAppUpdateCheck).Handler(trace.Route(updatecheck.AppUpdateHandler(logger)))
m.Path("/updates").Methods("GET", "POST").Name("updatecheck").Handler(trace.Route(http.HandlerFunc(updatecheck.HandlerWithLog(logger))))
}

Expand Down
2 changes: 1 addition & 1 deletion src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"updater": {
"active": true,
"endpoints": [
"https://sourcegraph.com/.api/update/app?target={{target}}&current_version={{current_version}}&arch={{arch}}"
"https://sourcegraph.com/.api/app/check/update?target={{target}}&current_version={{current_version}}&arch={{arch}}"
],
"dialog": true,
"pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IDhGNTY0NDBFMkYwN0NGMzUKUldRMXp3Y3ZEa1JXanllL3ozNVBFaGIyd1NQcEg1T3BucHRrWGJSYmFFZ1hYRWkwT24yM3NrWUcK"
Expand Down