Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions api/handlers/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ import (

// PublicConfig holds configuration that is safe to expose to the frontend
type PublicConfig struct {
GoogleClientID string `json:"googleClientId,omitempty"`
SentryDSN string `json:"sentryDsn,omitempty"`
SentryEnvironment string `json:"sentryEnvironment,omitempty"`
GoogleClientID string `json:"googleClientId,omitempty"`
SentryDSN string `json:"sentryDsn,omitempty"`
SentryEnvironment string `json:"sentryEnvironment,omitempty"`
InternalDomains []string `json:"internalDomains,omitempty"`
}

// GetConfig returns public configuration for the frontend
Expand All @@ -20,10 +21,14 @@ func GetConfig(w http.ResponseWriter, r *http.Request) {
sentryEnv = "development"
}

// Use the same allowed domains as authentication (AUTH_ALLOWED_DOMAINS)
internalDomains := getAllowedDomains()

config := PublicConfig{
GoogleClientID: os.Getenv("GOOGLE_CLIENT_ID"),
SentryDSN: os.Getenv("SENTRY_DSN_WEB"),
SentryEnvironment: sentryEnv,
InternalDomains: internalDomains,
}

w.Header().Set("Content-Type", "application/json")
Expand Down
2 changes: 2 additions & 0 deletions web/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ import { ContributorsPage } from '@/components/contributors-page'
import { UsersPage } from '@/components/users-page'
import { ValidatorsPage } from '@/components/validators-page'
import { GossipNodesPage } from '@/components/gossip-nodes-page'
import { MomentumPage } from '@/components/momentum-page'
import { DeviceDetailPage } from '@/components/device-detail-page'
import { LinkDetailPage } from '@/components/link-detail-page'
import { MetroDetailPage } from '@/components/metro-detail-page'
Expand Down Expand Up @@ -654,6 +655,7 @@ function AppContent() {
<Route path="/solana/validators/:vote_pubkey" element={<ValidatorDetailPage />} />
<Route path="/solana/gossip-nodes" element={<GossipNodesPage />} />
<Route path="/solana/gossip-nodes/:pubkey" element={<GossipNodeDetailPage />} />
<Route path="/solana/momentum" element={<MomentumPage />} />

{/* Default redirect */}
<Route path="*" element={<Navigate to="/" replace />} />
Expand Down
Loading