revert(server): remove .well-known/assetlinks.json (revert #1772) (#1789)

This commit is contained in:
hahaqwq
2026-05-08 21:14:01 +08:00
committed by RainbowBird
parent 99956014fa
commit eba047328a
4 changed files with 0 additions and 47 deletions
-5
View File
@@ -20,8 +20,3 @@ API_SERVER_URL=""
GATEWAY_BASE_URL="http://localhost:18080"
DEFAULT_CHAT_MODEL="openai/gpt-5-mini"
DEFAULT_TTS_MODEL="microsoft/v1"
ASSETLINKS_PACKAGE_NAME="ai.moeru.airi_pocket"
ASSETLINKS_SHA256_FINGERPRINTS="1D:E5:2D:DC:89:DA:C9:C1:4B:5F:4A:48:E4:2D:62:E5:52:82:B7:41:D3:96:73:13:91:C8:41:D2:84:DF:84:55"
-2
View File
@@ -50,7 +50,6 @@ import { createFluxRoutes } from './routes/flux'
import { createV1CompletionsRoutes } from './routes/openai/v1'
import { createProviderRoutes } from './routes/providers'
import { createStripeRoutes } from './routes/stripe'
import { createWellKnownRoutes } from './routes/well-known'
import { createFluxGrantBatchService } from './services/admin-flux-grant-batch/flux-grant-batch-service'
import { createBillingMq } from './services/billing/billing-events'
import { createBillingService } from './services/billing/billing-service'
@@ -195,7 +194,6 @@ export async function buildApp(deps: AppDeps) {
env: deps.env,
configKV: deps.configKV,
}))
.route('/.well-known', createWellKnownRoutes({ env: deps.env }))
/**
* Character routes are handled by the character service.
-6
View File
@@ -89,12 +89,6 @@ const EnvSchema = object({
OTEL_EXPORTER_OTLP_ENDPOINT: optional(string()),
OTEL_EXPORTER_OTLP_HEADERS: optional(string()),
OTEL_DEBUG: optional(string()),
// Asset Links (Android deep link delegation)
// Example: ASSETLINKS_PACKAGE_NAME=com.example.app
// ASSETLINKS_SHA256_FINGERPRINTS=AB:CD:... ,EF:12:...
ASSETLINKS_PACKAGE_NAME: optional(string(), 'ai.moeru.airi_pocket'),
ASSETLINKS_SHA256_FINGERPRINTS: optional(string(), ''),
// Admin allowlist for /api/admin/* routes. Comma-separated email addresses.
// Match is case-insensitive, but the user must also have `email_verified = true`
// — otherwise an attacker could register a fresh account with the admin email
@@ -1,34 +0,0 @@
import type { Env } from '../../libs/env'
import type { HonoEnv } from '../../types/hono'
import { Hono } from 'hono'
export interface WellKnownDeps {
env: Env
}
export function createWellKnownRoutes(deps: WellKnownDeps) {
return new Hono<HonoEnv>()
.get('/assetlinks.json', (c) => {
const pkg = deps.env.ASSETLINKS_PACKAGE_NAME
const fingerprintsRaw = deps.env.ASSETLINKS_SHA256_FINGERPRINTS
const fingerprints = fingerprintsRaw
.split(',')
.map(s => s.trim())
.filter(Boolean)
const payload = [
{
relation: ['delegate_permission/common.handle_all_urls'],
target: {
namespace: 'android_app',
package_name: pkg,
sha256_cert_fingerprints: fingerprints,
},
},
]
return c.json(payload)
})
}