forked from Mirrors/keyoxide-web
Make sure default scheme is set here too
This commit is contained in:
parent
21bae8df69
commit
223e39209c
1 changed files with 8 additions and 4 deletions
|
@ -32,6 +32,10 @@ import * as doipjs from 'doipjs'
|
|||
import { fetchWKD, fetchHKP, fetchSignature, fetchKeybase } from './keys.js'
|
||||
import libravatar from 'libravatar'
|
||||
|
||||
const scheme = process.env.PROXY_SCHEME ? process.env.PROXY_SCHEME
|
||||
: process.env.SCHEME ? process.env.SCHEME
|
||||
: 'https'
|
||||
|
||||
const generateWKDProfile = async (id) => {
|
||||
logger.debug('Generating a WKD profile',
|
||||
{ component: 'wkd_profile_generator', action: 'start', profile_id: id })
|
||||
|
@ -46,7 +50,7 @@ const generateWKDProfile = async (id) => {
|
|||
keyData = processKeyData(keyData)
|
||||
|
||||
const keyoxideData = {}
|
||||
keyoxideData.url = `${process.env.SCHEME}://${process.env.DOMAIN}/wkd/${id}`
|
||||
keyoxideData.url = `${scheme}://${process.env.DOMAIN}/wkd/${id}`
|
||||
|
||||
logger.debug('Generating a WKD profile',
|
||||
{ component: 'wkd_profile_generator', action: 'done', profile_id: id })
|
||||
|
@ -88,9 +92,9 @@ const generateHKPProfile = async (id, keyserverDomain) => {
|
|||
|
||||
const keyoxideData = {}
|
||||
if (!keyserverDomain || keyserverDomain === 'keys.openpgp.org') {
|
||||
keyoxideData.url = `${process.env.SCHEME}://${process.env.DOMAIN}/hkp/${id}`
|
||||
keyoxideData.url = `${scheme}://${process.env.DOMAIN}/hkp/${id}`
|
||||
} else {
|
||||
keyoxideData.url = `${process.env.SCHEME}://${process.env.DOMAIN}/hkp/${keyserverDomain}/${id}`
|
||||
keyoxideData.url = `${scheme}://${process.env.DOMAIN}/hkp/${keyserverDomain}/${id}`
|
||||
}
|
||||
|
||||
logger.debug('Generating a HKP profile',
|
||||
|
@ -196,7 +200,7 @@ const generateKeybaseProfile = async (username, fingerprint) => {
|
|||
keyData = processKeyData(keyData)
|
||||
|
||||
const keyoxideData = {}
|
||||
keyoxideData.url = `${process.env.SCHEME}://${process.env.DOMAIN}/keybase/${username}/${fingerprint}`
|
||||
keyoxideData.url = `${scheme}://${process.env.DOMAIN}/keybase/${username}/${fingerprint}`
|
||||
|
||||
logger.debug('Generating a Keybase profile',
|
||||
{ component: 'keybase_profile_generator', action: 'done', username, fingerprint })
|
||||
|
|
Loading…
Reference in a new issue