feat: implement checking of /.well-known/gorb.txt for api url, remove old localStorage lines
All checks were successful
ci/woodpecker/push/build-and-publish Pipeline was successful
ci/woodpecker/pr/build-and-publish Pipeline was successful
ci/woodpecker/pull_request_closed/build-and-publish Pipeline was successful

This commit is contained in:
SauceyRed 2025-05-31 01:19:31 +02:00
parent f39ff00b3b
commit bc8e84b75d
Signed by: sauceyred
GPG key ID: 2BF92EB6D8A5CCA7
2 changed files with 29 additions and 13 deletions

11
utils/parseWellKnown.ts Normal file
View file

@ -0,0 +1,11 @@
export default (wellKnownText: string): Record<string, string> => {
const lines = wellKnownText.trim().replaceAll(" ", "").split("\n");
const settings: Record<string, string> = {};
for (const line of lines) {
const separatorIndex = line.search(":");
const key = line.slice(0, separatorIndex);
const value = line.slice(separatorIndex + 1, line.length);
settings[key] = value;
}
return settings;
}