From 70afd13376de88e294e8d316f55ff9a2842000eb Mon Sep 17 00:00:00 2001 From: "create-issue-branch[bot]" <53036503+create-issue-branch[bot]@users.noreply.github.com> Date: Sat, 11 May 2024 03:40:16 +0000 Subject: [PATCH 01/36] Create draft PR for #71 [skip ci] From c1b50c591a1250cc4f5262a19580213374d83f75 Mon Sep 17 00:00:00 2001 From: Adam Matthiesen Date: Sat, 11 May 2024 01:35:26 -0700 Subject: [PATCH 02/36] Update - New setup page and done page implemented. as well as some OptionsSchema cleanup --- packages/studioCMS/src/db/tables.ts | 5 +- .../integrations/studioCMSDashboard/index.ts | 93 ++++--- .../routes/dashboard/components/Footer.astro | 9 +- .../routes/databaseSetup/Setup.astro | 26 -- .../routes/databaseSetup/done.astro | 37 ++- .../routes/databaseSetup/main.astro | 191 +++++++++++++ .../routes/databaseSetup/setup.ts | 175 ++++++++++++ .../routes/databaseSetup/start.astro | 253 ------------------ packages/studioCMS/src/schemas/auth.ts | 12 +- packages/studioCMS/src/schemas/developer.ts | 2 + packages/studioCMS/src/schemas/index.ts | 3 +- .../studioCMS/src/schemas/integrations.ts | 3 +- packages/studioCMS/src/studioCMS.ts | 9 - playgrounds/cloudflare/.env.demo | 28 +- playgrounds/node/astro.config.mjs | 29 +- 15 files changed, 508 insertions(+), 367 deletions(-) delete mode 100644 packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/Setup.astro create mode 100644 packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro create mode 100644 packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/setup.ts delete mode 100644 packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/start.astro 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..530c7b119 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..a57ce1d29 --- /dev/null +++ b/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro @@ -0,0 +1,191 @@ +--- +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. +
+
+ +
+ + +
+
+ +
+ + +
Site Title
+

+ + +
Description
+

+ + +
OG Image URL
+

+ +
Setup Local Admin User?
+
+ + +
Local Admin Setup
+ +
Username for Primary Admin ( Just set one, You can add more later )
+

+ +
Displayname for Primary Admin
+

+ +
Password
+
+
+ + +
oAuth Admin Setup
+ +
Default Site Admin ( Just set one, You can add more later )
+
+

+ + +
+ Initialize Database!
+
+ +
+ +
+
+ + + + + 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..d6be0c461 --- /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("localsetup") + + if (setupLocalAdmin === "1") { + const username = formData.get("localadminname")?.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("localadminpassword"); + if (typeof password !== "string" || password.length < 6 || password.length > 255) { + return new Response( + JSON.stringify({ + error: "Invalid password" + }), + { + status: 400 + } + ); + } + const name = formData.get("localadmindisplayname"); + + + 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("oauthadminname"); + + 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, + }, + }, }), ], }); From 6b96eb9fa2266d92d4168c75052fc8b6bcea3c96 Mon Sep 17 00:00:00 2001 From: Adam Matthiesen <30383579+Adammatthiesen@users.noreply.github.com> Date: Sat, 11 May 2024 17:21:12 -0700 Subject: [PATCH 03/36] Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/done.astro Co-authored-by: Paul Valladares <85648028+dreyfus92@users.noreply.github.com> --- .../studioCMSDashboard/routes/databaseSetup/done.astro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/done.astro b/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/done.astro index 530c7b119..fbda30d55 100644 --- a/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/done.astro +++ b/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/done.astro @@ -33,7 +33,7 @@ export default defineConfig({ 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 + 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
From 6e8b93b1f1682a43a037d9dce6fbe69296ab82cc Mon Sep 17 00:00:00 2001 From: Adam Matthiesen <30383579+Adammatthiesen@users.noreply.github.com> Date: Sat, 11 May 2024 17:21:19 -0700 Subject: [PATCH 04/36] Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro Co-authored-by: Paul Valladares <85648028+dreyfus92@users.noreply.github.com> --- .../studioCMSDashboard/routes/databaseSetup/main.astro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro b/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro index a57ce1d29..4c73fa6f6 100644 --- a/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro +++ b/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro @@ -67,7 +67,7 @@ if (Config.includedIntegrations.useInoxSitemap) {
Date: Sat, 11 May 2024 17:21:25 -0700 Subject: [PATCH 05/36] Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro Co-authored-by: Paul Valladares <85648028+dreyfus92@users.noreply.github.com> --- .../studioCMSDashboard/routes/databaseSetup/main.astro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro b/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro index 4c73fa6f6..d7dfe38b6 100644 --- a/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro +++ b/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro @@ -68,7 +68,7 @@ if (Config.includedIntegrations.useInoxSitemap) { Date: Sat, 11 May 2024 17:21:32 -0700 Subject: [PATCH 06/36] Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro Co-authored-by: Paul Valladares <85648028+dreyfus92@users.noreply.github.com> --- .../studioCMSDashboard/routes/databaseSetup/main.astro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro b/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro index d7dfe38b6..01164d976 100644 --- a/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro +++ b/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro @@ -71,7 +71,7 @@ if (Config.includedIntegrations.useInoxSitemap) { id="local-setup" value="1" size="medium" - help-text="Would you like to setup a local Admin User or oAuth User?" + help-text="Would you like to setup a local Admin User or OAuth User?" >
Setup Local Admin User?
From 0a7f76f30e83a8ab44c81a5fbcb1092a59f47a1f Mon Sep 17 00:00:00 2001 From: Adam Matthiesen <30383579+Adammatthiesen@users.noreply.github.com> Date: Sat, 11 May 2024 17:21:40 -0700 Subject: [PATCH 07/36] Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro Co-authored-by: Paul Valladares <85648028+dreyfus92@users.noreply.github.com> --- .../studioCMSDashboard/routes/databaseSetup/main.astro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro b/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro index 01164d976..d6f0be236 100644 --- a/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro +++ b/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro @@ -75,7 +75,7 @@ if (Config.includedIntegrations.useInoxSitemap) { >
Setup Local Admin User?
- +
Local Admin Setup
Date: Sat, 11 May 2024 17:21:48 -0700 Subject: [PATCH 08/36] Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/setup.ts Co-authored-by: Paul Valladares <85648028+dreyfus92@users.noreply.github.com> --- .../studioCMSDashboard/routes/databaseSetup/setup.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/setup.ts b/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/setup.ts index d6be0c461..e8cb5cbd5 100644 --- a/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/setup.ts +++ b/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/setup.ts @@ -7,7 +7,7 @@ import type { APIContext } from "astro"; export async function POST(context: APIContext): Promise { const formData = await context.request.formData(); - const setupLocalAdmin = formData.get("localsetup") + const setupLocalAdmin = formData.get("local-setup") if (setupLocalAdmin === "1") { const username = formData.get("localadminname")?.toString(); From a4e7536a42d3df07f14e90df1f83e9cda01fc97c Mon Sep 17 00:00:00 2001 From: Adam Matthiesen <30383579+Adammatthiesen@users.noreply.github.com> Date: Sat, 11 May 2024 17:22:00 -0700 Subject: [PATCH 09/36] Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro Co-authored-by: Paul Valladares <85648028+dreyfus92@users.noreply.github.com> --- .../studioCMSDashboard/routes/databaseSetup/main.astro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro b/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro index d6f0be236..1ac162834 100644 --- a/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro +++ b/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro @@ -78,7 +78,7 @@ if (Config.includedIntegrations.useInoxSitemap) {
Local Admin Setup
Username for Primary Admin ( Just set one, You can add more later )

From 946f6726549b5972926e3ce9a071942711f6f211 Mon Sep 17 00:00:00 2001 From: Adam Matthiesen <30383579+Adammatthiesen@users.noreply.github.com> Date: Sat, 11 May 2024 17:22:06 -0700 Subject: [PATCH 10/36] Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/setup.ts Co-authored-by: Paul Valladares <85648028+dreyfus92@users.noreply.github.com> --- .../studioCMSDashboard/routes/databaseSetup/setup.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/setup.ts b/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/setup.ts index e8cb5cbd5..778c51794 100644 --- a/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/setup.ts +++ b/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/setup.ts @@ -10,7 +10,7 @@ export async function POST(context: APIContext): Promise { const setupLocalAdmin = formData.get("local-setup") if (setupLocalAdmin === "1") { - const username = formData.get("localadminname")?.toString(); + 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 ( From ea0d3d1944817df76be0e3c4c8a32483b590c07b Mon Sep 17 00:00:00 2001 From: Adam Matthiesen <30383579+Adammatthiesen@users.noreply.github.com> Date: Sat, 11 May 2024 17:22:12 -0700 Subject: [PATCH 11/36] Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/setup.ts Co-authored-by: Paul Valladares <85648028+dreyfus92@users.noreply.github.com> --- .../studioCMSDashboard/routes/databaseSetup/setup.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/setup.ts b/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/setup.ts index 778c51794..212e4a7bc 100644 --- a/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/setup.ts +++ b/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/setup.ts @@ -28,7 +28,7 @@ export async function POST(context: APIContext): Promise { } ); } - const password = formData.get("localadminpassword"); + const password = formData.get("local-admin-password"); if (typeof password !== "string" || password.length < 6 || password.length > 255) { return new Response( JSON.stringify({ From 0d42e2205efac9588c3d08ed6d092b676267a283 Mon Sep 17 00:00:00 2001 From: Adam Matthiesen <30383579+Adammatthiesen@users.noreply.github.com> Date: Sat, 11 May 2024 17:22:18 -0700 Subject: [PATCH 12/36] Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/setup.ts Co-authored-by: Paul Valladares <85648028+dreyfus92@users.noreply.github.com> --- .../studioCMSDashboard/routes/databaseSetup/setup.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/setup.ts b/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/setup.ts index 212e4a7bc..bb2c20ba7 100644 --- a/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/setup.ts +++ b/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/setup.ts @@ -39,7 +39,7 @@ export async function POST(context: APIContext): Promise { } ); } - const name = formData.get("localadmindisplayname"); + const name = formData.get("local-admin-display-name"); const existingUser = await db.select().from(User).where(eq(User.username, username)).get() From 50cdb42f75552a90fdd09fa3b5c01b804a962574 Mon Sep 17 00:00:00 2001 From: Adam Matthiesen <30383579+Adammatthiesen@users.noreply.github.com> Date: Sat, 11 May 2024 17:22:24 -0700 Subject: [PATCH 13/36] Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/setup.ts Co-authored-by: Paul Valladares <85648028+dreyfus92@users.noreply.github.com> --- .../studioCMSDashboard/routes/databaseSetup/setup.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/setup.ts b/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/setup.ts index bb2c20ba7..c340e0685 100644 --- a/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/setup.ts +++ b/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/setup.ts @@ -80,7 +80,7 @@ export async function POST(context: APIContext): Promise { }) } else { - const oAuthAdmin = formData.get("oauthadminname"); + const oAuthAdmin = formData.get("oauth-admin-name"); await db .insert(Permissions) From 57e8047a6d654b339c2d6af52f6d5b9cac0a0274 Mon Sep 17 00:00:00 2001 From: Adam Matthiesen <30383579+Adammatthiesen@users.noreply.github.com> Date: Sat, 11 May 2024 17:22:36 -0700 Subject: [PATCH 14/36] Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro Co-authored-by: Paul Valladares <85648028+dreyfus92@users.noreply.github.com> --- .../studioCMSDashboard/routes/databaseSetup/main.astro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro b/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro index 1ac162834..a0e811421 100644 --- a/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro +++ b/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro @@ -79,7 +79,7 @@ if (Config.includedIntegrations.useInoxSitemap) {
Local Admin Setup
+ id="local-admin-name">
Username for Primary Admin ( Just set one, You can add more later )

Date: Sat, 11 May 2024 17:22:47 -0700 Subject: [PATCH 15/36] Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro Co-authored-by: Paul Valladares <85648028+dreyfus92@users.noreply.github.com> --- .../studioCMSDashboard/routes/databaseSetup/main.astro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro b/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro index a0e811421..263d70b0e 100644 --- a/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro +++ b/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro @@ -83,7 +83,7 @@ if (Config.includedIntegrations.useInoxSitemap) {
Username for Primary Admin ( Just set one, You can add more later )

Displayname for Primary Admin

From df67135af25caffa51d259ae4abdb9f76af8c99a Mon Sep 17 00:00:00 2001 From: Adam Matthiesen <30383579+Adammatthiesen@users.noreply.github.com> Date: Sat, 11 May 2024 17:22:59 -0700 Subject: [PATCH 16/36] Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro Co-authored-by: Paul Valladares <85648028+dreyfus92@users.noreply.github.com> --- .../studioCMSDashboard/routes/databaseSetup/main.astro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro b/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro index 263d70b0e..fe976c324 100644 --- a/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro +++ b/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro @@ -84,7 +84,7 @@ if (Config.includedIntegrations.useInoxSitemap) {

+ id="local-admin-display-name">
Displayname for Primary Admin

Date: Sat, 11 May 2024 17:23:10 -0700 Subject: [PATCH 17/36] Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro Co-authored-by: Paul Valladares <85648028+dreyfus92@users.noreply.github.com> --- .../studioCMSDashboard/routes/databaseSetup/main.astro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro b/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro index fe976c324..fc0b9ec67 100644 --- a/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro +++ b/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro @@ -89,7 +89,7 @@ if (Config.includedIntegrations.useInoxSitemap) {
Password
From f0f76db4e5b1cef981b1488e4f37010084168b3f Mon Sep 17 00:00:00 2001 From: Adam Matthiesen <30383579+Adammatthiesen@users.noreply.github.com> Date: Sat, 11 May 2024 17:23:22 -0700 Subject: [PATCH 18/36] Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro Co-authored-by: Paul Valladares <85648028+dreyfus92@users.noreply.github.com> --- .../studioCMSDashboard/routes/databaseSetup/main.astro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro b/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro index fc0b9ec67..705953dcf 100644 --- a/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro +++ b/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro @@ -90,7 +90,7 @@ if (Config.includedIntegrations.useInoxSitemap) {
Password
From 9e3b1728f709213f44c4668fe68968d57d03f469 Mon Sep 17 00:00:00 2001 From: Adam Matthiesen <30383579+Adammatthiesen@users.noreply.github.com> Date: Sat, 11 May 2024 17:23:36 -0700 Subject: [PATCH 19/36] Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro Co-authored-by: Paul Valladares <85648028+dreyfus92@users.noreply.github.com> --- .../studioCMSDashboard/routes/databaseSetup/main.astro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro b/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro index 705953dcf..3d967da53 100644 --- a/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro +++ b/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro @@ -61,7 +61,7 @@ if (Config.includedIntegrations.useInoxSitemap) {

OG Image URL

From 503608aecd58170a21196a29347403326b9d5d2b Mon Sep 17 00:00:00 2001 From: Adam Matthiesen <30383579+Adammatthiesen@users.noreply.github.com> Date: Sat, 11 May 2024 17:23:49 -0700 Subject: [PATCH 20/36] Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro Co-authored-by: Paul Valladares <85648028+dreyfus92@users.noreply.github.com> --- .../studioCMSDashboard/routes/databaseSetup/main.astro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro b/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro index 3d967da53..95ff51fed 100644 --- a/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro +++ b/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro @@ -62,7 +62,7 @@ if (Config.includedIntegrations.useInoxSitemap) { + id="og-image" placeholder="Coming Soon" disabled>
OG Image URL

From 554281e5652d4353d037c4be44a6d9b9c8f65825 Mon Sep 17 00:00:00 2001 From: Adam Matthiesen <30383579+Adammatthiesen@users.noreply.github.com> Date: Sat, 11 May 2024 17:24:00 -0700 Subject: [PATCH 21/36] Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro Co-authored-by: Paul Valladares <85648028+dreyfus92@users.noreply.github.com> --- .../studioCMSDashboard/routes/databaseSetup/main.astro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro b/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro index 95ff51fed..802e291e2 100644 --- a/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro +++ b/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro @@ -99,7 +99,7 @@ if (Config.includedIntegrations.useInoxSitemap) {
oAuth Admin Setup
Default Site Admin ( Just set one, You can add more later )
From 484a3aa3cf03c7a940a7edaab976442cfe8b9ea1 Mon Sep 17 00:00:00 2001 From: Adam Matthiesen <30383579+Adammatthiesen@users.noreply.github.com> Date: Sat, 11 May 2024 17:24:12 -0700 Subject: [PATCH 22/36] Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro Co-authored-by: Paul Valladares <85648028+dreyfus92@users.noreply.github.com> --- .../studioCMSDashboard/routes/databaseSetup/main.astro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro b/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro index 802e291e2..d9cb9121d 100644 --- a/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro +++ b/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro @@ -100,7 +100,7 @@ if (Config.includedIntegrations.useInoxSitemap) {
oAuth Admin Setup
Default Site Admin ( Just set one, You can add more later )
From 3a6b484903b1dcea770993bbada74c98d0bee5dd Mon Sep 17 00:00:00 2001 From: Adam Matthiesen <30383579+Adammatthiesen@users.noreply.github.com> Date: Sat, 11 May 2024 17:24:29 -0700 Subject: [PATCH 23/36] Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro Co-authored-by: Paul Valladares <85648028+dreyfus92@users.noreply.github.com> --- .../studioCMSDashboard/routes/databaseSetup/main.astro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro b/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro index d9cb9121d..6ce7d2e18 100644 --- a/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro +++ b/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro @@ -137,7 +137,7 @@ if (Config.includedIntegrations.useInoxSitemap) { const errorMessageElement = document.getElementById("form-error-message")!; const successAlertElement = document.getElementById("form-success")!; const successMessageElement = document.getElementById("form-success-message")!; - const checkbox = document.getElementById('localsetup')!; + const checkbox = document.getElementById('local-setup')!; const localadmin = document.getElementById('localadmin')!; const oauthadmin = document.getElementById('oauthadmin')!; From f62faae9da712a3ef1491c9bfe7b00c318054892 Mon Sep 17 00:00:00 2001 From: Adam Matthiesen <30383579+Adammatthiesen@users.noreply.github.com> Date: Sat, 11 May 2024 17:24:43 -0700 Subject: [PATCH 24/36] Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro Co-authored-by: Paul Valladares <85648028+dreyfus92@users.noreply.github.com> --- .../studioCMSDashboard/routes/databaseSetup/main.astro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro b/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro index 6ce7d2e18..ce9e45750 100644 --- a/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro +++ b/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro @@ -138,7 +138,7 @@ if (Config.includedIntegrations.useInoxSitemap) { const successAlertElement = document.getElementById("form-success")!; const successMessageElement = document.getElementById("form-success-message")!; const checkbox = document.getElementById('local-setup')!; - const localadmin = document.getElementById('localadmin')!; + const localAdmin = document.getElementById('local-admin')!; const oauthadmin = document.getElementById('oauthadmin')!; // Update the disabled state of the localadmin and oauthadmin details based on the checkbox state From bc0cfa1efcd92f178bb9ce6efb659b9fb9d00ce2 Mon Sep 17 00:00:00 2001 From: Adam Matthiesen <30383579+Adammatthiesen@users.noreply.github.com> Date: Sat, 11 May 2024 17:25:00 -0700 Subject: [PATCH 25/36] Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro Co-authored-by: Paul Valladares <85648028+dreyfus92@users.noreply.github.com> --- .../studioCMSDashboard/routes/databaseSetup/main.astro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro b/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro index ce9e45750..6a821b912 100644 --- a/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro +++ b/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro @@ -139,7 +139,7 @@ if (Config.includedIntegrations.useInoxSitemap) { const successMessageElement = document.getElementById("form-success-message")!; const checkbox = document.getElementById('local-setup')!; const localAdmin = document.getElementById('local-admin')!; - const oauthadmin = document.getElementById('oauthadmin')!; + const oauthAdmin = document.getElementById('oauth-admin')!; // Update the disabled state of the localadmin and oauthadmin details based on the checkbox state checkbox.addEventListener('sl-change', () => { From b0d9ef4a37a350b7494d889b1c08c2dd5684eade Mon Sep 17 00:00:00 2001 From: Adam Matthiesen <30383579+Adammatthiesen@users.noreply.github.com> Date: Sat, 11 May 2024 17:25:16 -0700 Subject: [PATCH 26/36] Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro Co-authored-by: Paul Valladares <85648028+dreyfus92@users.noreply.github.com> --- .../studioCMSDashboard/routes/databaseSetup/main.astro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro b/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro index 6a821b912..fb6a82476 100644 --- a/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro +++ b/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro @@ -141,7 +141,7 @@ if (Config.includedIntegrations.useInoxSitemap) { const localAdmin = document.getElementById('local-admin')!; const oauthAdmin = document.getElementById('oauth-admin')!; - // Update the disabled state of the localadmin and oauthadmin details based on the checkbox state + // Update the disabled state of the local-admin and oauth-admin details based on the checkbox state checkbox.addEventListener('sl-change', () => { //@ts-expect-error - checkbox comes from sl-checkbox from `Shoelace.syle` if (checkbox.checked) { From 739b0f73ffc1e28ee055b1530a6a33c678b0ca87 Mon Sep 17 00:00:00 2001 From: Adam Matthiesen <30383579+Adammatthiesen@users.noreply.github.com> Date: Sat, 11 May 2024 17:25:35 -0700 Subject: [PATCH 27/36] Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro Co-authored-by: Paul Valladares <85648028+dreyfus92@users.noreply.github.com> --- .../studioCMSDashboard/routes/databaseSetup/main.astro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro b/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro index fb6a82476..287519baa 100644 --- a/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro +++ b/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro @@ -145,7 +145,7 @@ if (Config.includedIntegrations.useInoxSitemap) { checkbox.addEventListener('sl-change', () => { //@ts-expect-error - checkbox comes from sl-checkbox from `Shoelace.syle` if (checkbox.checked) { - localadmin.removeAttribute("disabled") + localAdmin.removeAttribute("disabled") //@ts-expect-error - show is not a standard method on HTMLElement it comes from `Shoelace.syle` localadmin.show(); //@ts-expect-error - hide is not a standard method on HTMLElement it comes from `Shoelace.syle` From f6f67ed401a6f2359ddd1fa03b66ec6f869fc6af Mon Sep 17 00:00:00 2001 From: Adam Matthiesen <30383579+Adammatthiesen@users.noreply.github.com> Date: Sat, 11 May 2024 17:25:50 -0700 Subject: [PATCH 28/36] Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro Co-authored-by: Paul Valladares <85648028+dreyfus92@users.noreply.github.com> --- .../studioCMSDashboard/routes/databaseSetup/main.astro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro b/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro index 287519baa..6216f7f01 100644 --- a/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro +++ b/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro @@ -147,7 +147,7 @@ if (Config.includedIntegrations.useInoxSitemap) { if (checkbox.checked) { localAdmin.removeAttribute("disabled") //@ts-expect-error - show is not a standard method on HTMLElement it comes from `Shoelace.syle` - localadmin.show(); + localAdmin.show(); //@ts-expect-error - hide is not a standard method on HTMLElement it comes from `Shoelace.syle` oauthadmin.hide(); oauthadmin.setAttribute("disabled", "true") From f2f4ebc91cedefffbedeb1ca839d437c2e66f23f Mon Sep 17 00:00:00 2001 From: Adam Matthiesen <30383579+Adammatthiesen@users.noreply.github.com> Date: Sat, 11 May 2024 17:26:04 -0700 Subject: [PATCH 29/36] Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro Co-authored-by: Paul Valladares <85648028+dreyfus92@users.noreply.github.com> --- .../studioCMSDashboard/routes/databaseSetup/main.astro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro b/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro index 6216f7f01..afdd8fb7f 100644 --- a/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro +++ b/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro @@ -149,7 +149,7 @@ if (Config.includedIntegrations.useInoxSitemap) { //@ts-expect-error - show is not a standard method on HTMLElement it comes from `Shoelace.syle` localAdmin.show(); //@ts-expect-error - hide is not a standard method on HTMLElement it comes from `Shoelace.syle` - oauthadmin.hide(); + oauthAdmin.hide(); oauthadmin.setAttribute("disabled", "true") } else { //@ts-expect-error - hide is not a standard method on HTMLElement it comes from `Shoelace.syle` From 11fe60778d87e93d93015467a58ce7125c998bb9 Mon Sep 17 00:00:00 2001 From: Adam Matthiesen <30383579+Adammatthiesen@users.noreply.github.com> Date: Sat, 11 May 2024 17:26:21 -0700 Subject: [PATCH 30/36] Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro Co-authored-by: Paul Valladares <85648028+dreyfus92@users.noreply.github.com> --- .../studioCMSDashboard/routes/databaseSetup/main.astro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro b/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro index afdd8fb7f..fe1ce39bf 100644 --- a/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro +++ b/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro @@ -150,7 +150,7 @@ if (Config.includedIntegrations.useInoxSitemap) { localAdmin.show(); //@ts-expect-error - hide is not a standard method on HTMLElement it comes from `Shoelace.syle` oauthAdmin.hide(); - oauthadmin.setAttribute("disabled", "true") + oauthAdmin.setAttribute("disabled", "true") } else { //@ts-expect-error - hide is not a standard method on HTMLElement it comes from `Shoelace.syle` localadmin.hide(); From bdb9ef7a019b1a5f95b549227607eb726fd633c3 Mon Sep 17 00:00:00 2001 From: Adam Matthiesen <30383579+Adammatthiesen@users.noreply.github.com> Date: Sat, 11 May 2024 17:26:36 -0700 Subject: [PATCH 31/36] Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro Co-authored-by: Paul Valladares <85648028+dreyfus92@users.noreply.github.com> --- .../studioCMSDashboard/routes/databaseSetup/main.astro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro b/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro index fe1ce39bf..85498becd 100644 --- a/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro +++ b/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro @@ -153,7 +153,7 @@ if (Config.includedIntegrations.useInoxSitemap) { oauthAdmin.setAttribute("disabled", "true") } else { //@ts-expect-error - hide is not a standard method on HTMLElement it comes from `Shoelace.syle` - localadmin.hide(); + localAdmin.hide(); localadmin.setAttribute("disabled", "true") oauthadmin.removeAttribute("disabled") //@ts-expect-error - show is not a standard method on HTMLElement it comes from `Shoelace.syle` From 520af67bd706fff897f70013b31afb44f2cf4b41 Mon Sep 17 00:00:00 2001 From: Adam Matthiesen <30383579+Adammatthiesen@users.noreply.github.com> Date: Sat, 11 May 2024 17:26:53 -0700 Subject: [PATCH 32/36] Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro Co-authored-by: Paul Valladares <85648028+dreyfus92@users.noreply.github.com> --- .../studioCMSDashboard/routes/databaseSetup/main.astro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro b/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro index 85498becd..a96e75d2d 100644 --- a/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro +++ b/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro @@ -154,7 +154,7 @@ if (Config.includedIntegrations.useInoxSitemap) { } else { //@ts-expect-error - hide is not a standard method on HTMLElement it comes from `Shoelace.syle` localAdmin.hide(); - localadmin.setAttribute("disabled", "true") + localAdmin.setAttribute("disabled", "true") oauthadmin.removeAttribute("disabled") //@ts-expect-error - show is not a standard method on HTMLElement it comes from `Shoelace.syle` oauthadmin.show(); From 146e9726cad2843cb4483615932c0341436c483f Mon Sep 17 00:00:00 2001 From: Adam Matthiesen <30383579+Adammatthiesen@users.noreply.github.com> Date: Sat, 11 May 2024 17:27:11 -0700 Subject: [PATCH 33/36] Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro Co-authored-by: Paul Valladares <85648028+dreyfus92@users.noreply.github.com> --- .../studioCMSDashboard/routes/databaseSetup/main.astro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro b/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro index a96e75d2d..211b3d92e 100644 --- a/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro +++ b/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro @@ -157,7 +157,7 @@ if (Config.includedIntegrations.useInoxSitemap) { localAdmin.setAttribute("disabled", "true") oauthadmin.removeAttribute("disabled") //@ts-expect-error - show is not a standard method on HTMLElement it comes from `Shoelace.syle` - oauthadmin.show(); + oauthAdmin.show(); } }); From b3ed6619c9bff366edb9ca2d3202c0176e6283ee Mon Sep 17 00:00:00 2001 From: Adam Matthiesen Date: Sat, 11 May 2024 21:32:57 -0700 Subject: [PATCH 34/36] update as per dreyfus's comment --- .../studioCMSDashboard/routes/databaseSetup/main.astro | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro b/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro index 211b3d92e..9393bcf15 100644 --- a/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro +++ b/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro @@ -115,7 +115,6 @@ if (Config.includedIntegrations.useInoxSitemap) {
- From cb43f60227f8e92e1db7f736c35e4fc662fb630b Mon Sep 17 00:00:00 2001 From: Adam Matthiesen <30383579+Adammatthiesen@users.noreply.github.com> Date: Mon, 13 May 2024 15:18:07 -0700 Subject: [PATCH 35/36] Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro Co-authored-by: Jacob Jenkins --- .../studioCMSDashboard/routes/databaseSetup/main.astro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro b/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro index 9393bcf15..853cd8e63 100644 --- a/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro +++ b/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro @@ -85,7 +85,7 @@ if (Config.includedIntegrations.useInoxSitemap) { -
Displayname for Primary Admin
+
Display name for Primary Admin

Date: Mon, 13 May 2024 15:18:21 -0700 Subject: [PATCH 36/36] Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro Co-authored-by: Jacob Jenkins --- .../studioCMSDashboard/routes/databaseSetup/main.astro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro b/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro index 853cd8e63..4f00edaf6 100644 --- a/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro +++ b/packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro @@ -124,7 +124,7 @@ if (Config.includedIntegrations.useInoxSitemap) { Success!
-
+