Skip to content

πŸ“š The open-source, offline-first Notion, Obsidian & Confluence alternative. Advanced Markdown, multi-tenant teams, OIDC/SSO, and local S3 backups. Deploy in one command.

feat: Add env variables to disable landing page or login page

Smaug6739321d8570f244
diff --git a/frontend/.env b/frontend/.env
index 4466d368..5ccdeed8 100644
--- a/frontend/.env
+++ b/frontend/.env
@@ -1,2 +1,5 @@
NUXT_PUBLIC_BASE_API=http://localhost:8201
-NUXT_PUBLIC_BASE_CDN=http://localhost:9000/alexandrie
\ No newline at end of file
+NUXT_PUBLIC_BASE_CDN=http://localhost:9000/alexandrie
+
+NUXT_PUBLIC_CONFIG_DISABLE_LANDING_PAGE=false
+NUXT_PUBLIC_CONFIG_DISABLE_SIGNUP_PAGE=false
\ No newline at end of file
diff --git a/frontend/app/pages/(public)/index.vue b/frontend/app/pages/(public)/index.vue
index 20ca4331..4d71d111 100644
--- a/frontend/app/pages/(public)/index.vue
+++ b/frontend/app/pages/(public)/index.vue
@@ -48,6 +48,17 @@ import ContributorsMarquee from './_components/ContributorsMarquee.vue';
import FeaturesFAQ from './_components/features/FeaturesFAQ.vue';
import AppCTA from './_components/AppCTA.vue';
+definePageMeta({
+ middleware: [
+ function redirectLandingDisabled() {
+ const config = useRuntimeConfig();
+ if (config.public.configDisableLandingPage) {
+ return navigateTo('/login');
+ }
+ },
+ ],
+});
+
const heroEl = ref<HTMLElement | null>(null);
function handleParallax(e: MouseEvent) {
diff --git a/frontend/app/pages/(public)/login/index.vue b/frontend/app/pages/(public)/login/index.vue
index e63cae12..4bb15e43 100644
--- a/frontend/app/pages/(public)/login/index.vue
+++ b/frontend/app/pages/(public)/login/index.vue
@@ -48,7 +48,6 @@ const password = ref('');
const errors = ref({ username: '', password: '', general: '' });
const { showPassword, togglePassword } = usePasswordField();
const userStore = useUserStore();
-
function login() {
errors.value.username = !username.value ? 'Username is required' : '';
errors.value.password = !password.value ? 'Password is required' : '';
diff --git a/frontend/app/pages/(public)/signup.vue b/frontend/app/pages/(public)/signup.vue
index d6081663..61d22329 100644
--- a/frontend/app/pages/(public)/signup.vue
+++ b/frontend/app/pages/(public)/signup.vue
@@ -69,6 +69,17 @@ import AppFooter from './_components/AppFooter.vue';
const router = useRouter();
const userStore = useUserStore();
+definePageMeta({
+ middleware: [
+ function redirectSignupDisabled() {
+ const config = useRuntimeConfig();
+ if (config.public.configDisableSignupPage) {
+ return navigateTo('/login');
+ }
+ },
+ ],
+});
+
// Form fields
const username = ref('');
const email = ref('');
@@ -115,7 +126,6 @@ async function createAccount(username: string, email: string, password: string)
.container {
display: flex;
width: 95%;
- height: 100%;
margin: 0 auto;
flex-direction: column;
justify-content: space-between;
diff --git a/frontend/nuxt.config.ts b/frontend/nuxt.config.ts
index fa2b6344..54233ae9 100644
--- a/frontend/nuxt.config.ts
+++ b/frontend/nuxt.config.ts
@@ -6,8 +6,12 @@ export default defineNuxtConfig({
devtools: { enabled: process.env.NODE_ENV !== 'production' },
runtimeConfig: {
public: {
+ // Base URLs
baseApi: '',
baseCdn: '',
+ // Feature flags
+ configDisableSignupPage: '',
+ configDisableLandingPage: '',
},
},
vite: {