beatufitull front end for ozone modration ,, wit catpucoin and ebergarden !
ozone moderation
5
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix env vars

+28 -21
+3 -3
nix/module.nix
··· 53 53 wantedBy = [ "multi-user.target" ]; 54 54 55 55 environment = { 56 - VITE_LABELER_DID = cfg.serverDid; 57 - VITE_LABELER_URL = cfg.labelerUrl; 58 - VITE_PDS_URL = cfg.pdsUrl; 56 + PUBLIC_LABELER_DID = cfg.serverDid; 57 + PUBLIC_LABELER_URL = cfg.labelerUrl; 58 + PUBLIC_PDS_URL = cfg.pdsUrl; 59 59 PORT = toString cfg.port; 60 60 HOST = cfg.host; 61 61 NODE_ENV = "production";
+1
package.json
··· 16 16 }, 17 17 "dependencies": { 18 18 "@atcute/did-plc": "^0.3.2", 19 + "@atcute/identity": "^1.1.3", 19 20 "@atproto/api": "^0.18.20", 20 21 "@atproto/crypto": "^0.4.5", 21 22 "@atproto/dev-env": "^0.3.208",
+3
pnpm-lock.yaml
··· 11 11 '@atcute/did-plc': 12 12 specifier: ^0.3.2 13 13 version: 0.3.2 14 + '@atcute/identity': 15 + specifier: ^1.1.3 16 + version: 1.1.3 14 17 '@atproto/api': 15 18 specifier: ^0.18.20 16 19 version: 0.18.20
+21 -17
src/lib/api/ozone.ts
··· 1 - const DEFAULT_LABELER_DID = import.meta.env.VITE_LABELER_DID 2 - const DEFAULT_PLC_URL = import.meta.env.VITE_PLC_URL || 'https://plc.directory' 3 - const DEFAULT_PDS_URL = import.meta.env.VITE_PDS_URL || 'https://tngl.sh' 1 + import { env } from '$env/dynamic/public' 2 + import { isDidPlc } from '@atproto/oauth-client-browser' 4 3 5 - export function getPlcUrl(override?: string) { 6 - return override ?? DEFAULT_PLC_URL 7 - } 4 + const DEFAULT_LABELER_DID = env.PUBLIC_LABELER_DID 5 + const DEFAULT_PLC_URL = env.PUBLIC_PLC_URL || 'https://plc.directory' 6 + const DEFAULT_PDS_URL = env.PUBLIC_PDS_URL || 'https://tngl.sh' 8 7 9 - export function getPdsUrl(override?: string) { 10 - return override ?? DEFAULT_PDS_URL 8 + export function getPlcUrl() { 9 + return DEFAULT_PLC_URL 11 10 } 12 - 13 - export function getLabelerDid(override?: string) { 14 - const labelerDid = override ?? DEFAULT_LABELER_DID 11 + export function getPdsUrl() { 12 + return DEFAULT_PDS_URL 13 + } 14 + export function getLabelerDid() { 15 + const labelerDid = DEFAULT_LABELER_DID 15 16 if (!labelerDid) { 16 - throw new Error('Missing labeler DID. Set VITE_LABELER_DID or pass labelerDid.') 17 + throw new Error('Missing labeler DID. Set PUBLIC_LABELER_DID or pass labelerDid.') 17 18 } 19 + if (!isDidPlc(labelerDid)) { 20 + throw new Error('Invalid labeler DID. Ensure PUBLIC_LABELER_DID is a valid DID or pass a valid labelerDid.') 21 + } 22 + 18 23 return labelerDid 19 24 } 20 - 21 - export function getLabelerUrl(override?: string) { 22 - const labelerUrl = override ?? import.meta.env.VITE_LABELER_URL 25 + export function getLabelerUrl() { 26 + const labelerUrl = env.PUBLIC_LABELER_URL 23 27 if (!labelerUrl) { 24 - throw new Error('Missing labeler URL. Set VITE_LABELER_URL or pass labelerUrl.') 28 + throw new Error('Missing labeler URL. Set PUBLIC_LABELER_URL or pass labelerUrl.') 25 29 } 26 30 return labelerUrl 27 - } 31 + }
-1
src/routes/+layout.svelte
··· 70 70 </div> 71 71 </div> 72 72 {:else if !labelerConfig.data?.plcLabeler || !labelerConfig.data?.moderatorRecord} 73 - <p>{JSON.stringify(labelerConfig.data)}</p> 74 73 <LabelerSetup /> 75 74 {:else if !redirecting} 76 75 {@render children()}