mirror of
https://github.com/pockethost/pockethost.git
synced 2025-11-23 22:15:49 +00:00
enh: add PUBLIC_EDGE_APEX_DOMAIN to daemon
This commit is contained in:
parent
473bd17dd8
commit
9418d899e0
@ -13,6 +13,9 @@ PUBLIC_APP_DOMAIN=app.pockethost.lvh.me
|
||||
# The domain name for the marketing/blog domain
|
||||
PUBLIC_BLOG_DOMAIN=pockethost.lvh.me
|
||||
|
||||
# The apex domain for the daemon
|
||||
PUBLIC_EDGE_APEX_DOMAIN=pockethost.io
|
||||
|
||||
# The name of the central PocketHost database. This is both a subdomain and a file name.
|
||||
PUBLIC_APP_DB=pockethost-central
|
||||
|
||||
|
||||
@ -3,6 +3,10 @@ import { join } from 'path'
|
||||
import { env, envb, envi } from './util/env'
|
||||
export const PUBLIC_HTTP_PROTOCOL = env('PUBLIC_HTTP_PROTOCOL', 'https')
|
||||
export const PUBLIC_APP_DOMAIN = env('PUBLIC_APP_DOMAIN', `pockethost.test`)
|
||||
export const PUBLIC_EDGE_APEX_DOMAIN = env(
|
||||
'PUBLIC_EDGE_APEX_DOMAIN',
|
||||
`pockethost.test`,
|
||||
)
|
||||
export const PUBLIC_APP_DB = env('PUBLIC_APP_DB', `pockethost-central`)
|
||||
|
||||
export const DAEMON_PB_USERNAME = (() => {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { DAEMON_PORT, PUBLIC_APP_DOMAIN } from '$constants'
|
||||
import { DAEMON_PORT, PUBLIC_EDGE_APEX_DOMAIN } from '$constants'
|
||||
import { Logger, SingletonBaseConfig, mkSingleton } from '@pockethost/common'
|
||||
import { isFunction } from '@s-libs/micro-dash'
|
||||
import {
|
||||
@ -43,9 +43,9 @@ export const proxyService = mkSingleton(async (config: ProxyServiceConfig) => {
|
||||
const server = createServer(async (req, res) => {
|
||||
try {
|
||||
dbg(`Incoming request ${req.method} ${req.headers.host}/${req.url}`)
|
||||
if (!req.headers.host?.endsWith(PUBLIC_APP_DOMAIN)) {
|
||||
if (!req.headers.host?.endsWith(PUBLIC_EDGE_APEX_DOMAIN)) {
|
||||
warn(
|
||||
`Request for ${req.headers.host} rejected because host does not end in ${PUBLIC_APP_DOMAIN}`,
|
||||
`Request for ${req.headers.host} rejected because host does not end in ${PUBLIC_EDGE_APEX_DOMAIN}`,
|
||||
)
|
||||
res.writeHead(502, {
|
||||
'Content-Type': `text/plain`,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user