diff --git a/packages/studioCMS/src/db/tables.ts b/packages/studioCMS/src/db/tables.ts
index f40f010b0..09d44b43d 100644
--- a/packages/studioCMS/src/db/tables.ts
+++ b/packages/studioCMS/src/db/tables.ts
@@ -1,6 +1,6 @@
// @ts-expect-error - This is a missing type definition for the `astro:db` import since its a virtual module during Astro Runtime
import { NOW, column, defineTable, sql } from 'astro:db';
-import { randomUUID } from 'crypto';
+import { randomUUID } from 'node:crypto';
export const Session = defineTable({
columns: {
@@ -48,6 +48,7 @@ export const Blog = defineTable({
export const Pages = defineTable({
columns: {
id: column.number({ primaryKey: true }),
+ content: column.text({ multiline: true }),
title: column.text(),
description: column.text(),
publishedAt: column.date({ default: NOW }),
@@ -56,10 +57,10 @@ export const Pages = defineTable({
default:
'https://images.unsplash.com/photo-1707343843982-f8275f3994c5?q=80&w=1032&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDF8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D',
}),
- content: column.text({ multiline: true }),
},
});
+
export const SiteConfig = defineTable({
columns: {
id: column.number({ primaryKey: true }),
diff --git a/packages/studioCMS/src/integrations/studioCMSDashboard/index.ts b/packages/studioCMS/src/integrations/studioCMSDashboard/index.ts
index 817536127..a10950b9d 100644
--- a/packages/studioCMS/src/integrations/studioCMSDashboard/index.ts
+++ b/packages/studioCMS/src/integrations/studioCMSDashboard/index.ts
@@ -200,11 +200,58 @@ export default defineIntegration({
content: studioCMSDTS.text(),
});
+ // Add Dashboard Integrations
+ integrationLogger(logger, verbose, 'info', 'Adding Dashboard Integrations');
+
+ // CSS Management
+ addIntegration(params, {
+ integration: UnoCSSAstroIntegration({
+ configFile: false,
+ injectReset: injectReset,
+ injectEntry: injectEntry,
+ presets: [
+ presetUno(),
+ presetDaisy({
+ themes: themes,
+ darkTheme: darkTheme,
+ }),
+ presetWind(),
+ presetTypography(),
+ presetIcons({
+ collections: {
+ mdi: () => import('@iconify-json/mdi/icons.json').then(i => i.default),
+ google: FileSystemIconLoader(resolve('./icons/google')),
+ discord: FileSystemIconLoader(resolve('./icons/discord')),
+ github: FileSystemIconLoader(resolve('./icons/github')),
+ auth0: FileSystemIconLoader(resolve('./icons/auth0')),
+ }
+ }),
+ presetScrollbar({
+ }),
+ presetWebFonts({
+ provider: 'google',
+ fonts: {
+ // Required Fonts for Google Icons
+ sans: 'Roboto',
+ mono: ['Fira Code', 'Fira Mono:400,700'],
+ },
+ }),
+ ],
+ transformers: [
+ transformerDirectives()
+ ],
+ }),
+ });
+
// In the case of First time Setup run the Start Pages
if ( dbStartPage ) {
injectRoute({
pattern: 'start/',
- entrypoint: resolve('./routes/databaseSetup/start.astro'),
+ entrypoint: resolve('./routes/databaseSetup/main.astro'),
+ });
+ injectRoute({
+ pattern: 'api/setup',
+ entrypoint: resolve('./routes/databaseSetup/setup.ts'),
});
injectRoute({
pattern: 'done/',
@@ -212,6 +259,7 @@ export default defineIntegration({
});
}
+
// Check if the Dashboard is enabled
if ( dashboardEnabled && !dbStartPage ) {
@@ -229,49 +277,6 @@ export default defineIntegration({
// Log that the Dashboard is enabled
integrationLogger(logger, verbose, 'info', 'Dashboard is Enabled');
- // Add Dashboard Integrations
- integrationLogger(logger, verbose, 'info', 'Adding Dashboard Integrations');
-
- // CSS Management
- addIntegration(params, {
- integration: UnoCSSAstroIntegration({
- configFile: false,
- injectReset: injectReset,
- injectEntry: injectEntry,
- presets: [
- presetUno(),
- presetDaisy({
- themes: themes,
- darkTheme: darkTheme,
- }),
- presetWind(),
- presetTypography(),
- presetIcons({
- collections: {
- mdi: () => import('@iconify-json/mdi/icons.json').then(i => i.default),
- google: FileSystemIconLoader(resolve('./icons/google')),
- discord: FileSystemIconLoader(resolve('./icons/discord')),
- github: FileSystemIconLoader(resolve('./icons/github')),
- auth0: FileSystemIconLoader(resolve('./icons/auth0')),
- }
- }),
- presetScrollbar({
- }),
- presetWebFonts({
- provider: 'google',
- fonts: {
- // Required Fonts for Google Icons
- sans: 'Roboto',
- mono: ['Fira Code', 'Fira Mono:400,700'],
- },
- }),
- ],
- transformers: [
- transformerDirectives()
- ],
- }),
- });
-
// Setup the Dashboard Routes
injectRoute({
pattern: makeRoute("/"),
diff --git a/packages/studioCMS/src/integrations/studioCMSDashboard/routes/dashboard/components/Footer.astro b/packages/studioCMS/src/integrations/studioCMSDashboard/routes/dashboard/components/Footer.astro
index 96066ce28..8c2d6c4de 100644
--- a/packages/studioCMS/src/integrations/studioCMSDashboard/routes/dashboard/components/Footer.astro
+++ b/packages/studioCMS/src/integrations/studioCMSDashboard/routes/dashboard/components/Footer.astro
@@ -4,10 +4,11 @@ const today = new Date();
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/Setup.astro b/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/Setup.astro
deleted file mode 100644
index be44ab457..000000000
--- a/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/Setup.astro
+++ /dev/null
@@ -1,26 +0,0 @@
----
-import BaseHead from '../../../../components/BaseHead.astro';
----
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/done.astro b/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/done.astro
index 0d1cfde11..fbda30d55 100644
--- a/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/done.astro
+++ b/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/done.astro
@@ -1,6 +1,6 @@
---
import { Code } from 'astro:components';
-import SetupLayout from './Setup.astro';
+import { Layout } from 'studiocms-dashboard:components';
import Config from 'virtual:studiocms/config';
if (Config.includedIntegrations.useInoxSitemap) {
@@ -8,27 +8,40 @@ if (Config.includedIntegrations.useInoxSitemap) {
sitemap.default(false)
})
}
----
-
-
- Setup Done!
-
-
- You can now stop your dev server and add the following option in your astro.config to start using StudioCMS then start back up to see your new CMS data
-
+});`
+---
+
+
+
+
+
Setup Done!
+
+
+ Next Step
+
+ You can now stop your dev server and add the following option in your astro.config to start using StudioCMS then start back up to see your new CMS data
+
+
+
+
+
+
+
+
+
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro b/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro
new file mode 100644
index 000000000..4f00edaf6
--- /dev/null
+++ b/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro
@@ -0,0 +1,190 @@
+---
+import { Layout } from 'studiocms-dashboard:components';
+import Config from 'virtual:studiocms/config';
+
+if (Config.includedIntegrations.useInoxSitemap) {
+ import('sitemap-ext:config').then((sitemap) => {
+ sitemap.default(false)
+ })
+}
+
+---
+
+
+
+
+
Welcome to StudioCMS
+
+
+ What is StudioCMS?
+
+ StudioCMS is a simple, easy to use, and fast CMS for Astro. It's built with the latest technologies and is designed to be as simple as possible. It's also open source and free to use.
+
+
+
+ How do I use it?
+
+ To use StudioCMS, you need to have a basic understanding of Astro and how it works. As well as StudioCMS. You can use the CMS to create, edit, and delete posts. You can also use it to manage your site's settings and more.
+
+
+
+ What's next?
+
+ The next step is to start by filling in your site details below!
+
+
+
+ Problems? or Need Help?
+
+ If you have any problems or need help, you can visit the GitHub Repository or join the Discord Server for help.
+
+
+
+
+
+
+
+
+
+
+ Something went wrong!
+
+
+
+
+ Success!
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/setup.ts b/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/setup.ts
new file mode 100644
index 000000000..c340e0685
--- /dev/null
+++ b/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/setup.ts
@@ -0,0 +1,175 @@
+// @ts-expect-error - Some types can only be imported from the Astro runtime
+import { Blog, Permissions, Pages, SiteConfig, User, db, eq } from 'astro:db';
+import { scryptAsync } from "@noble/hashes/scrypt";
+
+import type { APIContext } from "astro";
+
+export async function POST(context: APIContext): Promise {
+ const formData = await context.request.formData();
+
+ const setupLocalAdmin = formData.get("local-setup")
+
+ if (setupLocalAdmin === "1") {
+ const username = formData.get("local-admin-name")?.toString();
+ // username must be between 3 ~ 31 characters, and only consists of lowercase letters, 0-9, -, and _
+ // keep in mind some database (e.g. mysql) are case insensitive
+ if (
+ typeof username !== "string" ||
+ username.length < 3 ||
+ username.length > 31 ||
+ !/^[a-z0-9_-]+$/.test(username)
+ ) {
+ return new Response(
+ JSON.stringify({
+ error: "Invalid username"
+ }),
+ {
+ status: 400
+ }
+ );
+ }
+ const password = formData.get("local-admin-password");
+ if (typeof password !== "string" || password.length < 6 || password.length > 255) {
+ return new Response(
+ JSON.stringify({
+ error: "Invalid password"
+ }),
+ {
+ status: 400
+ }
+ );
+ }
+ const name = formData.get("local-admin-display-name");
+
+
+ const existingUser = await db.select().from(User).where(eq(User.username, username)).get()
+
+ if (existingUser) {
+ return new Response(
+ JSON.stringify({
+ error: "User Error"
+ }),
+ {
+ status: 400
+ }
+ );
+
+ }
+ await db
+ .insert(User)
+ .values({
+ name: name as string,
+ username,
+ })
+
+ const newUser = await db.select().from(User).where(eq(User.username, username)).get();
+ const hashedPassword = await scryptAsync(password, newUser.id, { N: 2 ** 12, r: 8, p: 1, dkLen: 32 })
+ const hashedPasswordString = Buffer.from(hashedPassword.buffer).toString();
+ await db
+ .update(User)
+ .set({
+ password: hashedPasswordString
+ })
+ .where(eq(User.id, newUser.id))
+
+ await db
+ .insert(Permissions)
+ .values({
+ username: username,
+ rank: 'admin',
+ })
+
+ } else {
+ const oAuthAdmin = formData.get("oauth-admin-name");
+
+ await db
+ .insert(Permissions)
+ .values({
+ username: oAuthAdmin as string,
+ rank: 'admin',
+ })
+ }
+
+ const title = formData.get('title');
+ const description = formData.get('description');
+ // const ogImage = formData.get('ogImage'); // TODO: Implement this
+
+ const Config = await db.select().from(SiteConfig).where(eq(SiteConfig.id, 1)).get();
+
+ if (Config) {
+ return new Response(
+ JSON.stringify({
+ error: "Config Error: Already Exists"
+ }),
+ {
+ status: 400
+ }
+ );
+ }
+
+ const dbBatchQueries = [];
+
+ // Insert Site Config
+ dbBatchQueries.push(
+ await db
+ .insert(SiteConfig)
+ .values({
+ title: title as string,
+ description: description as string,
+ })
+ );
+
+ const LOREM_IPSUM =
+ '## Hello World \nLorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.';
+
+ // Insert Default Pages
+ dbBatchQueries.push(await db
+ .insert(Pages)
+ .values([
+ {
+ title: 'Home',
+ slug: 'index',
+ description: 'Index page',
+ heroImage:
+ 'https://images.unsplash.com/photo-1707343843982-f8275f3994c5?q=80&w=1032&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDF8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D',
+ content: LOREM_IPSUM,
+ },
+ {
+ title: 'About',
+ slug: 'about',
+ description: 'About page',
+ heroImage:
+ 'https://images.unsplash.com/photo-1661174585122-83a2909163ad?q=80&w=1169&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D',
+ content: LOREM_IPSUM,
+ },
+ ])
+ );
+
+ // Insert Default Blog Post // TODO: Remove This
+ dbBatchQueries.push(await db
+ .insert(Blog)
+ .values([
+ {
+ title: 'Hello, World!',
+ slug: 'hello-world',
+ description: 'Lorem ipsum dolor sit amet',
+ publishedAt: new Date('2024-03-12T07:00:00Z'),
+ heroImage:
+ 'https://images.unsplash.com/photo-1707343843982-f8275f3994c5?q=80&w=1032&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDF8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D',
+ content: LOREM_IPSUM,
+ },
+ ])
+ );
+
+ // Execute Batch Queries
+ await db
+ .batch(dbBatchQueries)
+ .then(() => {
+ return new Response('Successfully Seeded Database', { status: 200 });
+ })
+ .catch(() => {
+ return new Response('Error Seeding Database', { status: 500 });
+ });
+
+ return new Response();
+}
\ No newline at end of file
diff --git a/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/start.astro b/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/start.astro
deleted file mode 100644
index 58015e1bb..000000000
--- a/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/start.astro
+++ /dev/null
@@ -1,253 +0,0 @@
----
-// @ts-expect-error - Some types can only be imported from the Astro runtime
-import { Blog, Pages, Permissions, SiteConfig, db, eq } from 'astro:db';
-import SetupLayout from './Setup.astro';
-import Config from 'virtual:studiocms/config';
-
-if (Config.includedIntegrations.useInoxSitemap) {
- import('sitemap-ext:config').then((sitemap) => {
- sitemap.default(false)
- })
-}
-
-function redirectToPath(path: string) {
- return Astro.redirect(import.meta.env.BASE_URL + path);
-}
-
-const LOREM_IPSUM =
- '## Hello World \nLorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.';
-
-export const getAstroBaseURL = () => {
- return import.meta.env.BASE_URL;
-};
-
-if (Astro.request.method === 'POST') {
- const formData = await new Request(Astro.request.url, {
- method: Astro.request.method,
- headers: Astro.request.headers,
- body: Buffer.from(await Astro.request.arrayBuffer()),
- }).formData();
-
- const title = formData.get('title');
- const description = formData.get('description');
- const admin = formData.get('admin');
- const ConfigArrayed = await db.select().from(SiteConfig).where(eq(SiteConfig.id, 1));
- const existingConfig = ConfigArrayed[0];
-
- if (existingConfig) {
- await db
- .update(SiteConfig)
- .set({
- title: title as string,
- description: description as string,
- })
- .where(eq(SiteConfig.id, 1))
- .then(() => {
- return new Response('Success', { status: 200 });
- })
- .catch(() => {
- return new Response('Error setting SiteConfig', { status: 500 });
- });
- } else {
- await db
- .insert(SiteConfig)
- .values({
- title: title as string,
- description: description as string,
- })
- .then(() => {
- return new Response('Success', { status: 200 });
- })
- .catch(() => {
- return new Response('Error setting SiteConfig', { status: 500 });
- });
- }
-
- await db
- .insert(Permissions)
- .values({
- username: admin as string,
- rank: 'admin',
- })
- .then(() => {
- return new Response('Success', { status: 200 });
- })
- .catch(() => {
- console.log(`Admin ${admin} may already exist... continuing without adding`);
- return new Response('Error setting Admin', { status: 500 });
- });
-
- await db
- .insert(Pages)
- .values([
- {
- title: 'Home',
- slug: 'index',
- description: 'Index page',
- heroImage:
- 'https://images.unsplash.com/photo-1707343843982-f8275f3994c5?q=80&w=1032&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDF8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D',
- content: LOREM_IPSUM,
- },
- {
- title: 'About',
- slug: 'about',
- description: 'About page',
- heroImage:
- 'https://images.unsplash.com/photo-1661174585122-83a2909163ad?q=80&w=1169&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D',
- content: LOREM_IPSUM,
- },
- ])
- .then(() => {
- return new Response('Success', { status: 200 });
- })
- .catch(() => {
- return new Response('Error Adding Pages data', { status: 500 });
- });
-
- await db
- .insert(Blog)
- .values([
- {
- title: 'Hello, World!',
- slug: 'hello-world',
- description: 'Lorem ipsum dolor sit amet',
- publishedAt: new Date('2024-03-12T07:00:00Z'),
- heroImage:
- 'https://images.unsplash.com/photo-1707343843982-f8275f3994c5?q=80&w=1032&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDF8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D',
- content: LOREM_IPSUM,
- },
- ])
- .then(() => {
- return new Response('Success', { status: 200 });
- })
- .catch(() => {
- return new Response('Error Adding Blog Data', { status: 500 });
- });
-
- return redirectToPath('done/');
-}
----
-
-
-
- Welcome to StudioCMS
-
-
-
- What is StudioCMS?
- StudioCMS is a simple, easy to use, and fast CMS for Astro. It's built with the latest technologies and is designed to be as simple as possible. It's also open source and free to use.
- How do I use it?
- To use StudioCMS, you need to have a basic understanding of Astro and how it works. As well as StudioCMS. You can use the CMS to create, edit, and delete posts. You can also use it to manage your site's settings and more.
- What's next?
- The next step is to start by filling in your site details below!
-
-
-
-
-
- Site Configuration
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/packages/studioCMS/src/schemas/auth.ts b/packages/studioCMS/src/schemas/auth.ts
index 6f2014eb5..c347a8efe 100644
--- a/packages/studioCMS/src/schemas/auth.ts
+++ b/packages/studioCMS/src/schemas/auth.ts
@@ -4,9 +4,9 @@ const localUsernameAndPasswordConfig = z.object({
/**
* Allow User Registration - Allows users to register an account
*
- * @default false - Temporarily set to true for testing
+ * @default false
*/
- allowUserRegistration: z.boolean().optional().default(true),
+ allowUserRegistration: z.boolean().optional().default(false),
}).optional().default({});
//
@@ -26,15 +26,15 @@ export const authProviderSchema = z.object({
*
* Requires a Discord OAuth App to be created and configured using ENV Variables
*
- * @default false - Temporarily set to true for testing
+ * @default false
*/
- discord: z.boolean().optional().default(true),
+ discord: z.boolean().optional().default(false),
/**
* Google Auth Provider - Powered by Lucia
*
* Requires a Google OAuth App to be created and configured using ENV Variables
*
- * @default false - Temporarily set to true for testing
+ * @default false
*/
google: z.boolean().optional().default(false),
/**
@@ -42,7 +42,7 @@ export const authProviderSchema = z.object({
*
* Requires an Auth0 Application to be created and configured using ENV Variables
*
- * @default false - Temporarily set to true for testing
+ * @default false
*/
auth0: z.boolean().optional().default(false),
/**
diff --git a/packages/studioCMS/src/schemas/developer.ts b/packages/studioCMS/src/schemas/developer.ts
index 154b9b223..e9cafa1fb 100644
--- a/packages/studioCMS/src/schemas/developer.ts
+++ b/packages/studioCMS/src/schemas/developer.ts
@@ -5,6 +5,8 @@ export const developerConfigSchema = z.object({
* Allows the user to enable Astro's View Transition API for the Astro Studio CMS Dashboard
*
* Disabled do to the fact that the View Transition API is still in development and is not ready for production use.
+ *
+ * **NOT YET IMPLEMENTED** - There is a bug with the View Transition API that causes this feature to not work as expected.
*/
viewTransitionAPI: z.boolean().optional().default(false),
/**
diff --git a/packages/studioCMS/src/schemas/index.ts b/packages/studioCMS/src/schemas/index.ts
index 56497d7bc..0c186145a 100644
--- a/packages/studioCMS/src/schemas/index.ts
+++ b/packages/studioCMS/src/schemas/index.ts
@@ -11,7 +11,8 @@ import { overridesSchema } from './componentoverrides';
export const optionsSchema = z
.object({
/**
- * Project Initialization Page - Used during First Time Setup
+ * Project Initialization Page - Used during First Time Setup to initialize the database
+ *
* @default true
*/
dbStartPage: z.boolean().optional().default(true),
diff --git a/packages/studioCMS/src/schemas/integrations.ts b/packages/studioCMS/src/schemas/integrations.ts
index 94d786779..ecf9bd8d1 100644
--- a/packages/studioCMS/src/schemas/integrations.ts
+++ b/packages/studioCMS/src/schemas/integrations.ts
@@ -8,8 +8,7 @@ export const includedIntegrationsSchema = z
.object({
/**
* Allows the user to enable/disable the use of the Astro Robots Plugin
- * For more information on the Astro Robots Plugin, visit:
- * @see https://www.npmjs.com/package/astro-robots
+ *
* @default true
*/
useAstroRobots: z.boolean().optional().default(true),
diff --git a/packages/studioCMS/src/studioCMS.ts b/packages/studioCMS/src/studioCMS.ts
index dedee46d1..0bc4249ea 100644
--- a/packages/studioCMS/src/studioCMS.ts
+++ b/packages/studioCMS/src/studioCMS.ts
@@ -41,7 +41,6 @@ export default defineIntegration({
injectRoute,
logger,
config: { output, site, root },
- updateConfig,
} = params;
// Destructure Options
@@ -245,14 +244,6 @@ export default defineIntegration({
}
}
- updateConfig({
- vite: {
- optimizeDeps: {
- exclude: ["oslo", "@node-rs/argon2", "@node-rs/bcrypt"]
- }
- }
- })
-
integrationLogger(logger, verbose, 'info', 'StudioCMS Core Setup Complete.');
},
'astro:server:start': ({ logger }) => {
diff --git a/playgrounds/cloudflare/.env.demo b/playgrounds/cloudflare/.env.demo
index 7dadeef65..966fb2f7c 100644
--- a/playgrounds/cloudflare/.env.demo
+++ b/playgrounds/cloudflare/.env.demo
@@ -1,10 +1,24 @@
# credentials for GitHub OAuth
-CMS-GITHUB_CLIENT_ID=
-CMS-GITHUB_CLIENT_SECRET=
+CMS_GITHUB_CLIENT_ID=
+CMS_GITHUB_CLIENT_SECRET=
+# Github Callback URL `http://localhost:4321/dashboard/login/github/callback`
+# Github callback URL is NOT AN ENV VARIABLE!
-# OPTIONALS
-## Cloudinary Javascript SDK
-CMS_CLOUDINARY_CLOUDNAME="demo"
+# credentials for Discord OAuth
+CMS_DISCORD_CLIENT_ID=
+CMS_DISCORD_CLIENT_SECRET=
+CMS_DISCORD_REDIRECT_URI=http://localhost:4321/dashboard/login/discord/callback
+
+# credentials for Google OAuth
+CMS_GOOGLE_CLIENT_ID=
+CMS_GOOGLE_CLIENT_SECRET=
+CMS_GOOGLE_REDIRECT_URI=http://localhost:4321/dashboard/login/google/callback
-# Used for internal development * To be removed *
-CMS_WATCH_INTEGRATION_HOOK=true
\ No newline at end of file
+# credentials for auth0 OAuth
+CMS_AUTH0_CLIENT_ID=
+CMS_AUTH0_CLIENT_SECRET=
+CMS_AUTH0_DOMAIN=
+CMS_AUTH0_REDIRECT_URI=http://localhost:4321/dashboard/login/auth0/callback
+
+## Cloudinary Javascript SDK
+CMS_CLOUDINARY_CLOUDNAME="demo"
\ No newline at end of file
diff --git a/playgrounds/node/astro.config.mjs b/playgrounds/node/astro.config.mjs
index 672f838e6..423b90059 100644
--- a/playgrounds/node/astro.config.mjs
+++ b/playgrounds/node/astro.config.mjs
@@ -13,12 +13,39 @@ export default defineConfig({
studioCMS({
dbStartPage: false,
contentRenderer: 'marked',
+ verbose: true,
+ dateLocale: 'en-us',
+ includedIntegrations: {
+ useAstroRobots: true,
+ useInoxSitemap: true,
+ },
+ imageService: {
+ useUnpic: true,
+ },
markedConfig: {
highlighterConfig: {
highlighter: 'disabled',
},
},
- verbose: true,
+ dashboardConfig: {
+ AuthConfig: {
+ enabled: true,
+ providers: {
+ auth0: false,
+ discord: true,
+ github: true,
+ google: false,
+ usernameAndPassword: true,
+ usernameAndPasswordConfig: {
+ allowUserRegistration: true,
+ },
+ },
+ },
+ dashboardEnabled: true,
+ developerConfig: {
+ testingAndDemoMode: false,
+ },
+ },
}),
],
});