From 5200ad3611f7ed10da723f34d4facdbfe624625a Mon Sep 17 00:00:00 2001 From: Yarmo Mackenbach Date: Wed, 4 Oct 2023 14:49:53 +0200 Subject: [PATCH] feat: make Dicebear API domain configurable --- src/server/index.js | 3 ++- template.env | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/server/index.js b/src/server/index.js index b1c52cf..176196c 100644 --- a/src/server/index.js +++ b/src/server/index.js @@ -223,7 +223,8 @@ const processAspProfile = async (/** @type {import('doipjs').Profile */ profile) // Overwrite avatarUrl // TODO: don't overwrite avatarUrl once it's fully supported - profile.personas[profile.primaryPersonaIndex].avatarUrl = `https://api.dicebear.com/6.x/shapes/svg?seed=${profile.publicKey.fingerprint}&size=128` + profile.personas[profile.primaryPersonaIndex].avatarUrl = + `https://${process.env.DICEBEAR_API_HOSTNAME || "api.dicebear.com" }/7.x/shapes/svg?seed=${profile.publicKey.fingerprint}&size=128` return profile } diff --git a/template.env b/template.env index 488bf95..d9dadd3 100644 --- a/template.env +++ b/template.env @@ -16,6 +16,10 @@ # To host a Keyoxide Proxy server, refer to https://docs.keyoxide.org/self-hosting/ #PROXY_HOSTNAME= +# Domain for Dicebear API server +# Defaults to: api.dicebear.com +#DICEBEAR_API_HOSTNAME= + # Tor Onion URL # The full http:// onion url to add as an 'Onion-Location' header #ONION_URL=