From 883ced3ebfdd3470d6af42da0a23342494136b70 Mon Sep 17 00:00:00 2001 From: raclim Date: Sat, 13 Jul 2024 16:53:55 -0400 Subject: [PATCH 1/5] warnings in dockerfile" --- Dockerfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4e25bed7c5..ac21908220 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM node:16.14.2 as base +FROM node:16.14.2 AS base ENV APP_HOME=/usr/src/app \ TERM=xterm RUN mkdir -p $APP_HOME @@ -6,7 +6,7 @@ WORKDIR $APP_HOME EXPOSE 8000 EXPOSE 8002 -FROM base as development +FROM base AS development ENV NODE_ENV development COPY package.json package-lock.json ./ RUN npm install @@ -18,11 +18,11 @@ COPY translations/locales ./translations/locales COPY public ./public CMD ["npm", "start"] -FROM development as build +FROM development AS build ENV NODE_ENV production RUN npm run build -FROM base as production +FROM base AS production ENV NODE_ENV=production COPY package.json package-lock.json index.js ./ RUN npm install --production From ac08fe8134457ec583f16182a4460f7224c224cc Mon Sep 17 00:00:00 2001 From: raclim Date: Sat, 13 Jul 2024 16:54:11 -0400 Subject: [PATCH 2/5] update mongo version --- docker-compose-development.yml | 3 +-- docker-compose.yml | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/docker-compose-development.yml b/docker-compose-development.yml index c2d7b91323..921a8fbe8b 100644 --- a/docker-compose-development.yml +++ b/docker-compose-development.yml @@ -1,7 +1,6 @@ -version: '3.4' services: mongo: - image: mongo:4.4 + image: mongo:5.0 volumes: - dbdata:/data/db app: diff --git a/docker-compose.yml b/docker-compose.yml index ab4721788f..a68311a8f2 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,6 @@ -version: '3.4' services: mongo: - image: mongo:4.4 + image: mongo:5.0 volumes: - dbdata:/data/db app: From 6b555d802e920ebc46332244a756bdc29fcef7dc Mon Sep 17 00:00:00 2001 From: raclim Date: Sat, 13 Jul 2024 16:54:31 -0400 Subject: [PATCH 3/5] temp connect to legacy site examples --- server/scripts/examples.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/server/scripts/examples.js b/server/scripts/examples.js index 2c3a0fc345..39e974a873 100644 --- a/server/scripts/examples.js +++ b/server/scripts/examples.js @@ -30,7 +30,7 @@ async function getCategories() { const categories = []; const options = { url: - 'https://api.github.com/repos/processing/p5.js-website/contents/src/data/examples/en', + 'https://api.github.com/repos/processing/p5.js-website-legacy/contents/src/data/examples/en', method: 'GET', headers: { ...headers, @@ -205,7 +205,7 @@ async function addAssetsToProject(assets, response, project) { // for assets files that are not .vert or .frag extension project.files.push({ name: assetName, - url: `https://cdn.jsdelivr.net/gh/processing/p5.js-website@main/src/data/examples/assets/${assetName}`, + url: `https://cdn.jsdelivr.net/gh/processing/p5.js-website-legacy@main/src/data/examples/assets/${assetName}`, id: fileID, _id: fileID, children: [], @@ -223,7 +223,7 @@ async function addAssetsToProject(assets, response, project) { async function createProjectsInP5user(projectsInAllCategories) { const options = { url: - 'https://api.github.com/repos/processing/p5.js-website/contents/src/data/examples/assets', + 'https://api.github.com/repos/processing/p5.js-website-legacy/contents/src/data/examples/assets', method: 'GET', headers: { ...headers, @@ -364,7 +364,7 @@ async function getp5User() { const categories = await getCategories(); const sketchesInCategories = await getSketchesInCategories(categories); const sketchContent = await getSketchContent(sketchesInCategories); - const projectsInUser = createProjectsInP5user(sketchContent); + const projectsInUser = await createProjectsInP5user(sketchContent); return projectsInUser; } From 45d4795c155f6bf59844d100d65378b3d9fc24f9 Mon Sep 17 00:00:00 2001 From: raclim Date: Mon, 15 Jul 2024 09:56:22 -0400 Subject: [PATCH 4/5] undo changes to generating slugs in project and user model --- server/models/collection.js | 2 +- server/models/project.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/server/models/collection.js b/server/models/collection.js index 1633c03847..1fbd15676a 100644 --- a/server/models/collection.js +++ b/server/models/collection.js @@ -48,7 +48,7 @@ collectionSchema.set('toJSON', { }); collectionSchema.pre('save', function generateSlug(next) { - this.slug = slugify(this.name, { lower: true, strict: true }); + this.slug = slugify(this.name, '_'); next(); }); diff --git a/server/models/project.js b/server/models/project.js index 30b506fa4d..a909591f1f 100644 --- a/server/models/project.js +++ b/server/models/project.js @@ -53,7 +53,7 @@ projectSchema.set('toJSON', { projectSchema.pre('save', function generateSlug(next) { if (!this.slug) { - this.slug = slugify(this.name, { lower: true, strict: true }); + this.slug = slugify(this.name, '_'); } next(); }); From 2f092efae3f2e73daedb945a9e298e28e5093de5 Mon Sep 17 00:00:00 2001 From: raclim Date: Mon, 15 Jul 2024 10:20:54 -0400 Subject: [PATCH 5/5] update docs with docker-compose changes --- contributor_docs/installation.md | 1 + 1 file changed, 1 insertion(+) diff --git a/contributor_docs/installation.md b/contributor_docs/installation.md index 8678002fa4..b461b075d9 100644 --- a/contributor_docs/installation.md +++ b/contributor_docs/installation.md @@ -50,6 +50,7 @@ Note that this takes up a significant amount of space on your machine. Make sure 2. Install [Docker Desktop](https://www.docker.com/products/docker-desktop/) 3. Clone this repository and cd into it 4. `$ docker-compose -f docker-compose-development.yml build` + * Note: Depending on which version of Docker Compose you are using, the base command will be either `docker-compose` or `docker compose`. More information about it can be found in Docker Compose's documentation for their [V1 to V2 transition](https://github.com/docker/compose/tree/v1?tab=readme-ov-file#v1-vs-v2-transition-hourglass_flowing_sand). 5. `$ cp .env.example .env` 6. (Optional) Update `.env` with necessary keys to enable certain app behaviors, i.e. add Github ID and Github Secret if you want to be able to log in with Github. * See the [GitHub API Configuration](#github-api-configuration) section for information on how to authenticate with Github.