Skip to content

Commit 2a022dc

Browse files
n0tooseearl-warren
authored andcommitted
[FEAT] Use OpenStreetMap in USER_LOCATION_MAP_URL by default
Follow-up to d58c542 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 - go-gitea#26214 (cherry picked from commit bb187d5f617f8efceb41810d6ff9adcaa60450bb) (cherry picked from commit ce02ef9078a8731921caa4f7b0c1b0ac3b59a784) (cherry picked from commit 6b75c40e2575e23810880ee8e368dc1781e2b4e4) (cherry picked from commit 6bc8e9f5737f5721ddcd1ef5926a778a7f66a4a3) (cherry picked from commit 063f8afdf7c2cca014c60dcc3d78d270fd236f8f) (cherry picked from commit c5cc736b72e1ba980519e9258686f41e4eb78b42) (cherry picked from commit 7b1bb4bedc6196fb6e8516d9a34092b16d7fab05)
1 parent 19ec0a5 commit 2a022dc

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

custom/conf/app.example.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -836,12 +836,12 @@ LEVEL = Info
836836
;;
837837
;; Default map service. No external API support has been included. A service has to allow
838838
;; searching using URL parameters, the location will be appended to the URL as escaped query parameter.
839-
;; Disabled by default, some example values are:
839+
;; Some example values are:
840840
;; - OpenStreetMap: https://www.openstreetmap.org/search?query=
841841
;; - Google Maps: https://www.google.com/maps/place/
842842
;; - MapQuest: https://www.mapquest.com/search/
843843
;; - Bing Maps: https://www.bing.com/maps?where1=
844-
; USER_LOCATION_MAP_URL =
844+
; USER_LOCATION_MAP_URL = https://www.openstreetmap.org/search?query=
845845
;;
846846
;; Enable heatmap on users profiles.
847847
;ENABLE_USER_HEATMAP = true

modules/setting/service.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ func loadServiceFrom(rootCfg ConfigProvider) {
188188
Service.AllowCrossRepositoryDependencies = sec.Key("ALLOW_CROSS_REPOSITORY_DEPENDENCIES").MustBool(true)
189189
Service.DefaultAllowOnlyContributorsToTrackTime = sec.Key("DEFAULT_ALLOW_ONLY_CONTRIBUTORS_TO_TRACK_TIME").MustBool(true)
190190
Service.NoReplyAddress = sec.Key("NO_REPLY_ADDRESS").MustString("noreply." + Domain)
191-
Service.UserLocationMapURL = sec.Key("USER_LOCATION_MAP_URL").String()
191+
Service.UserLocationMapURL = sec.Key("USER_LOCATION_MAP_URL").MustString("https://www.openstreetmap.org/search?query=")
192192
Service.EnableUserHeatmap = sec.Key("ENABLE_USER_HEATMAP").MustBool(true)
193193
Service.AutoWatchNewRepos = sec.Key("AUTO_WATCH_NEW_REPOS").MustBool(true)
194194
Service.AutoWatchOnChanges = sec.Key("AUTO_WATCH_ON_CHANGES").MustBool(false)

0 commit comments

Comments
 (0)