diff --git a/src/assets/javascripts/services.js b/src/assets/javascripts/services.js index 3b58f71..6b2ea1b 100644 --- a/src/assets/javascripts/services.js +++ b/src/assets/javascripts/services.js @@ -29,7 +29,7 @@ function fetchFrontendInstanceList(service, frontend, redirects, options, config for (const network in config.networks) { tmp.push(...redirects[network], ...options[frontend][network].custom) } - } else if (config.services[service].frontends[frontend].singleInstance) tmp = config.services[service].frontends[frontend].singleInstance + } return tmp } @@ -69,7 +69,6 @@ function redirect(url, type, initiator, forceRedirection) { let randomInstance let frontend for (const service in config.services) { - if (!forceRedirection && !options[service].enabled) continue if (config.services[service].embeddable && type != options[service].redirectType && options[service].redirectType != "both") continue @@ -95,7 +94,7 @@ function redirect(url, type, initiator, forceRedirection) { } if (instanceList.length === 0) return randomInstance = utils.getRandomInstance(instanceList) - } else if (config.services[service].frontends[frontend].singleInstance) randomInstance = config.services[service].frontends[frontend].singleInstance + } break } if (!frontend || !randomInstance) return diff --git a/src/config/config.json b/src/config/config.json index cb0ed50..6c78a11 100644 --- a/src/config/config.json +++ b/src/config/config.json @@ -447,8 +447,7 @@ }, "osm": { "name": "OpenStreetMap", - "instanceList": false, - "singleInstance": "https://www.openstreetmap.org" + "instanceList": true } }, "targets": [ diff --git a/src/instances/get_instances.py b/src/instances/get_instances.py index 8121cea..e8b137d 100755 --- a/src/instances/get_instances.py +++ b/src/instances/get_instances.py @@ -117,6 +117,7 @@ def is_authenticate(url): return False return False + def fetchCache(frontend, name): try: with open('./src/instances/data.json') as file: @@ -436,13 +437,19 @@ def facil(): fetchFromFile('facil', 'FacilMap') +def osm(): + fetchFromFile('osm', 'OpenStreetMap') + + def libreTranslate(): fetchRegexList('libreTranslate', 'LibreTranslate', 'https://raw.githubusercontent.com/LibreTranslate/LibreTranslate/main/README.md', r"\[(?:[^\s\/]+\.)+[a-zA-Z0-9]+\]\((https?:\/{2}(?:[^\s\/]+\.)+[a-zA-Z0-9]+)\/?\)\|") def breezeWiki(): - fetchJsonList('breezeWiki', 'BreezeWiki', 'https://docs.breezewiki.com/files/instances.json', 'instance', False) + fetchJsonList('breezeWiki', 'BreezeWiki', + 'https://docs.breezewiki.com/files/instances.json', 'instance', False) + def privateBin(): fetchJsonList('privateBin', 'PrivateBin', @@ -499,6 +506,7 @@ neuters() beatbump() hyperpipe() facil() +osm() simpleertube() breezeWiki() privateBin() diff --git a/src/instances/osm.json b/src/instances/osm.json new file mode 100644 index 0000000..a072e19 --- /dev/null +++ b/src/instances/osm.json @@ -0,0 +1,5 @@ +{ + "clearnet": [ + "https://www.openstreetmap.org" + ] +} \ No newline at end of file