Skip to content

Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.

🔧 Add `LANDING_PAGE` config option

Luke Vellaa661630e1f9e
diff --git a/declarations/environment.d.ts b/declarations/environment.d.ts
index 3a55989da..8150b9e90 100644
--- a/declarations/environment.d.ts
+++ b/declarations/environment.d.ts
@@ -1,20 +1,61 @@
declare global {
namespace NodeJS {
interface ProcessEnv {
+ /**
+ * Full database connection string
+ */
DATABASE_URL: string;
+ /**
+ * "development" or "production"
+ */
NODE_ENV: "development" | "production";
+ /**
+ * Can be "false" or a relative path eg. "/new"
+ */
+ LANDING_PAGE: string;
+ /**
+ * Must be 32 characters long
+ */
SECRET_PASSWORD: string;
- NEXT_PUBLIC_LEGACY_POLLS?: string;
+ /**
+ * "1" to turn on maintenance mode
+ */
NEXT_PUBLIC_MAINTENANCE_MODE?: string;
+ /**
+ * Posthog API key
+ */
NEXT_PUBLIC_POSTHOG_API_KEY?: string;
+ /**
+ * Posthog API host
+ */
NEXT_PUBLIC_POSTHOG_API_HOST?: string;
+ /**
+ * Crisp website ID
+ */
NEXT_PUBLIC_CRISP_WEBSITE_ID?: string;
- LEGACY_MONGODB_URI?: string;
+ /**
+ * Users of your instance will see this as their support email
+ */
SUPPORT_EMAIL: string;
+ /**
+ * Host address of the SMTP server
+ */
SMTP_HOST: string;
+ /**
+ * Email address or user if authentication is required
+ */
SMTP_USER: string;
+ /**
+ * Password if authentication is required
+ */
SMTP_PWD: string;
+ /**
+ * "true" to use SSL
+ */
SMTP_SECURE: string;
+ /**
+ * Port number of the SMTP server
+ */
SMTP_PORT: string;
}
}
diff --git a/src/pages/home.tsx b/src/pages/home.tsx
index d43e4e482..b2859eb98 100644
--- a/src/pages/home.tsx
+++ b/src/pages/home.tsx
@@ -10,6 +10,25 @@ export default function Page() {
export const getServerSideProps: GetServerSideProps = async ({
locale = "en",
}) => {
+ if (process.env.LANDING_PAGE) {
+ if (process.env.LANDING_PAGE === "false") {
+ return {
+ redirect: {
+ destination: "/new",
+ permanent: false,
+ },
+ };
+ }
+ // if starts with /, it's a relative path
+ if (process.env.LANDING_PAGE.startsWith("/")) {
+ return {
+ redirect: {
+ destination: process.env.LANDING_PAGE,
+ permanent: false,
+ },
+ };
+ }
+ }
return {
props: {
...(await serverSideTranslations(locale, ["common", "homepage"])),