[FEAT] Use OpenStreetMap in USER_LOCATION_MAP_URL by default

Follow-up to d58c542579 for Forgejo.

By default, Gitea does not select any map service that can be used
to introduce a 'Show this place on a map' button in the location
field of a user profile. Before I tried upstreaming this change to
Gitea, this was the case in Forgejo. This patch essentially recovers
this functionality, which is nice for public-facing instances and
communities.

Links to original PRs:
- https://codeberg.org/forgejo/forgejo/pulls/1076
- https://github.com/go-gitea/gitea/pull/26214

(cherry picked from commit bb187d5f61)
(cherry picked from commit ce02ef9078)
(cherry picked from commit 6b75c40e25)
(cherry picked from commit 6bc8e9f573)
(cherry picked from commit 063f8afdf7)
(cherry picked from commit c5cc736b72)
(cherry picked from commit 7b1bb4bedc)
(cherry picked from commit 2a022dceb4)
(cherry picked from commit a946c142d2)
(cherry picked from commit 8a4ea0c7ab)
(cherry picked from commit 37bfb05b34)
(cherry picked from commit 28fdcd95a5)
This commit is contained in:
Panagiotis "Ivory" Vasilopoulos 2023-08-02 17:18:34 +02:00 committed by Earl Warren
parent 6d6971b6d6
commit 65743be85d
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00
2 changed files with 3 additions and 3 deletions

View file

@ -836,12 +836,12 @@ LEVEL = Info
;; ;;
;; Default map service. No external API support has been included. A service has to allow ;; Default map service. No external API support has been included. A service has to allow
;; searching using URL parameters, the location will be appended to the URL as escaped query parameter. ;; searching using URL parameters, the location will be appended to the URL as escaped query parameter.
;; Disabled by default, some example values are: ;; Some example values are:
;; - OpenStreetMap: https://www.openstreetmap.org/search?query= ;; - OpenStreetMap: https://www.openstreetmap.org/search?query=
;; - Google Maps: https://www.google.com/maps/place/ ;; - Google Maps: https://www.google.com/maps/place/
;; - MapQuest: https://www.mapquest.com/search/ ;; - MapQuest: https://www.mapquest.com/search/
;; - Bing Maps: https://www.bing.com/maps?where1= ;; - Bing Maps: https://www.bing.com/maps?where1=
; USER_LOCATION_MAP_URL = ; USER_LOCATION_MAP_URL = https://www.openstreetmap.org/search?query=
;; ;;
;; Enable heatmap on users profiles. ;; Enable heatmap on users profiles.
;ENABLE_USER_HEATMAP = true ;ENABLE_USER_HEATMAP = true

View file

@ -188,7 +188,7 @@ func loadServiceFrom(rootCfg ConfigProvider) {
Service.AllowCrossRepositoryDependencies = sec.Key("ALLOW_CROSS_REPOSITORY_DEPENDENCIES").MustBool(true) Service.AllowCrossRepositoryDependencies = sec.Key("ALLOW_CROSS_REPOSITORY_DEPENDENCIES").MustBool(true)
Service.DefaultAllowOnlyContributorsToTrackTime = sec.Key("DEFAULT_ALLOW_ONLY_CONTRIBUTORS_TO_TRACK_TIME").MustBool(true) Service.DefaultAllowOnlyContributorsToTrackTime = sec.Key("DEFAULT_ALLOW_ONLY_CONTRIBUTORS_TO_TRACK_TIME").MustBool(true)
Service.NoReplyAddress = sec.Key("NO_REPLY_ADDRESS").MustString("noreply." + Domain) Service.NoReplyAddress = sec.Key("NO_REPLY_ADDRESS").MustString("noreply." + Domain)
Service.UserLocationMapURL = sec.Key("USER_LOCATION_MAP_URL").String() Service.UserLocationMapURL = sec.Key("USER_LOCATION_MAP_URL").MustString("https://www.openstreetmap.org/search?query=")
Service.EnableUserHeatmap = sec.Key("ENABLE_USER_HEATMAP").MustBool(true) Service.EnableUserHeatmap = sec.Key("ENABLE_USER_HEATMAP").MustBool(true)
Service.AutoWatchNewRepos = sec.Key("AUTO_WATCH_NEW_REPOS").MustBool(true) Service.AutoWatchNewRepos = sec.Key("AUTO_WATCH_NEW_REPOS").MustBool(true)
Service.AutoWatchOnChanges = sec.Key("AUTO_WATCH_ON_CHANGES").MustBool(false) Service.AutoWatchOnChanges = sec.Key("AUTO_WATCH_ON_CHANGES").MustBool(false)