commit 9cf5be4462e2492e6bf59fc8ec9c0bbb6ff81c5f Author: Cosmin Tanislav Date: Sun Mar 24 10:10:33 2024 +0200 Move brand name and wiki url to config diff --git a/README.md b/README.md index 8c8d5bd..fb16990 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,8 @@ Create a file named `.env.local`. Example: ``` VITE_API_HOSTNAME=http://192.168.100.25:5000/ +VITE_BRAND_NAME=LineageOS +VITE_WIKI_URL=https://wiki.lineageos.org ``` Replace `http://192.168.100.25:5000/` with the hostname of the updater server. Note: the trailing slash _is required_ diff --git a/fly/.env.production b/fly/.env.production index 088d988..b16c97d 100644 --- a/fly/.env.production +++ b/fly/.env.production @@ -1 +1,3 @@ VITE_API_HOSTNAME=/ +VITE_BRAND_NAME=LineageOS +VITE_WIKI_URL=https://wiki.lineageos.org diff --git a/index.html b/index.html index 9aea6fe..6a4751b 100644 --- a/index.html +++ b/index.html @@ -4,7 +4,7 @@ - LineageOS Downloads + %VITE_BRAND_NAME% Downloads
diff --git a/src/components/builds-tab/BuildsTab.vue b/src/components/builds-tab/BuildsTab.vue index c4060a3..12f1e50 100644 --- a/src/components/builds-tab/BuildsTab.vue +++ b/src/components/builds-tab/BuildsTab.vue @@ -37,7 +37,7 @@ This device doesn't have any builds available, please see FAQ @@ -54,6 +54,7 @@ import { ref, watch } from 'vue' import { useDeviceStore, type Build } from '@/stores/device' import { loadDeviceBuildsBeforeHook } from '@/hooks/loadBeforeHooks' import { useSeoMeta } from '@unhead/vue' +import { WIKI_URL } from '@/services/config' const props = defineProps<{ model: string diff --git a/src/services/CryptoService.worker.ts b/src/services/CryptoService.worker.ts index 29afeae..1762b18 100644 --- a/src/services/CryptoService.worker.ts +++ b/src/services/CryptoService.worker.ts @@ -1,6 +1,7 @@ import forge from 'node-forge' import { sha1, sha256 } from '@awasm/noble' import type { VerifyResult } from './CryptoService' +import { BRAND_NAME } from './config' const u8ArrayToString = (data: Uint8Array): string => String.fromCharCode.apply(null, Array.from(data)) @@ -132,7 +133,7 @@ const verifyPackage = async (blob: Blob): Promise => { default: return { status: false, - msg: 'Signature check failed (file is not signed by LineageOS)', + msg: `Signature check failed (file is not signed by ${BRAND_NAME})`, signInfo: signInfo } } diff --git a/src/services/config.ts b/src/services/config.ts new file mode 100644 index 0000000..36d78fb --- /dev/null +++ b/src/services/config.ts @@ -0,0 +1,3 @@ +export const API_HOSTNAME = import.meta.env.VITE_API_HOSTNAME +export const BRAND_NAME = import.meta.env.VITE_BRAND_NAME +export const WIKI_URL = import.meta.env.VITE_WIKI_URL