Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

disable feature flags for selfhosted

Blue Mousea13e73847e4e
diff --git a/web/app/routes/feature-flags.tsx b/web/app/routes/feature-flags.tsx
index 5849cea0a..c1ce5037f 100644
--- a/web/app/routes/feature-flags.tsx
+++ b/web/app/routes/feature-flags.tsx
@@ -2,14 +2,29 @@ import { Switch } from '@headlessui/react'
import cx from 'clsx'
import { useEffect, useState } from 'react'
import { useTranslation } from 'react-i18next'
+import { redirect } from 'react-router'
+import { SitemapFunction } from 'remix-sitemap'
import { toast } from 'sonner'
import { setFeatureFlags } from '~/api'
import { withAuthentication, auth } from '~/hoc/protected'
+import { isSelfhosted } from '~/lib/constants'
import { FeatureFlag } from '~/lib/models/User'
import { useAuth } from '~/providers/AuthProvider'
import Loader from '~/ui/Loader'
+export const sitemap: SitemapFunction = () => ({
+ exclude: true,
+})
+
+export async function loader() {
+ if (isSelfhosted) {
+ return redirect('/login', 302)
+ }
+
+ return null
+}
+
const FeatureFlagsPage = () => {
const { t } = useTranslation('common')
const { user, isLoading, mergeUser } = useAuth()