Przeglądaj źródła

Merge tag 'v3.5.0-rc2' into staging

Owen Diffey 3 lat temu
rodzic
commit
4be1648e99

+ 15 - 1
.wiki/Configuration.md

@@ -119,4 +119,18 @@ The container port refers to the external docker container port, used to access
 | `REDIS_PASSWORD` | Redis password. |
 | `REDIS_PASSWORD` | Redis password. |
 | `REDIS_DATA_LOCATION` | The location where Redis stores its data. Usually the `.redis` folder inside the `Musare` folder. |
 | `REDIS_DATA_LOCATION` | The location where Redis stores its data. Usually the `.redis` folder inside the `Musare` folder. |
 | `BACKUP_LOCATION` | Directory to store musare.sh backups. Defaults to `/backups` in script location. |
 | `BACKUP_LOCATION` | Directory to store musare.sh backups. Defaults to `/backups` in script location. |
-| `BACKUP_NAME` | Name of musare.sh backup files. Defaults to `musare-$(date +"%Y-%m-%d-%s").dump`. |
+| `BACKUP_NAME` | Name of musare.sh backup files. Defaults to `musare-$(date +"%Y-%m-%d-%s").dump`. |
+
+## Docker-compose override
+You may want to override the docker-compose files in some specific cases. For this, you can create a `docker-compose.override.yml` file.  
+### Run backend on its own domain
+One example usecase for the override is to expose the backend port so you can run it separately from the frontend. An example file for this is as follows:
+
+```yml
+services:
+  backend:
+    ports:
+      - "${BACKEND_HOST}:${BACKEND_PORT}:8080"
+```
+
+This assumes that you have also set `BACKEND_PORT` inside your `.env` file.

+ 15 - 0
CHANGELOG.md

@@ -1,5 +1,20 @@
 # Changelog
 # Changelog
 
 
+## [v3.5.0-rc2] - 2022-04-24
+
+## Added
+- chore: Added docker-compose.override.yml documentation
+
+### Fixed
+- fix: Unable to compile frontend in production mode
+- fix: Homepage admin filter keyboard shortcut not always registering
+- fix: Docker will create folders if default.json files do not exist
+- fix: Station info box has white corners in dark mode
+- fix: Advanced Table filter operator label border-radius not squared on right
+- fix: Prevent migration 18 running once migration 20 has been run
+- fix: docker-compose.override.yml not included in musare.sh commands
+- fix: musare.sh reset container not passing full servicesString
+
 ## [v3.5.0-rc1] - 2022-04-14
 ## [v3.5.0-rc1] - 2022-04-14
 
 
 ### Added
 ### Added

+ 5 - 1
backend/Dockerfile

@@ -4,8 +4,12 @@ RUN npm install -g nodemon
 
 
 RUN mkdir -p /opt/app
 RUN mkdir -p /opt/app
 WORKDIR /opt/app
 WORKDIR /opt/app
-ADD ./ /opt/app
+
+COPY package.json /opt/app/package.json
+COPY package-lock.json /opt/app/package-lock.json
 
 
 RUN npm install
 RUN npm install
 
 
+COPY . /opt/app
+
 CMD npm run docker:dev
 CMD npm run docker:dev

+ 1 - 1
backend/logic/db/index.js

@@ -12,7 +12,7 @@ const REQUIRED_DOCUMENT_VERSIONS = {
 	punishment: 1,
 	punishment: 1,
 	queueSong: 1,
 	queueSong: 1,
 	report: 5,
 	report: 5,
-	song: 7,
+	song: 8,
 	station: 8,
 	station: 8,
 	user: 3
 	user: 3
 };
 };

+ 1 - 1
backend/logic/db/schemas/song.js

@@ -16,5 +16,5 @@ export default {
 	verifiedBy: { type: String },
 	verifiedBy: { type: String },
 	verifiedAt: { type: Date },
 	verifiedAt: { type: Date },
 	discogs: { type: Object },
 	discogs: { type: Object },
-	documentVersion: { type: Number, default: 7, required: true }
+	documentVersion: { type: Number, default: 8, required: true }
 };
 };

+ 16 - 1
backend/logic/migration/migrations/migration20.js

@@ -4,13 +4,14 @@ import mongoose from "mongoose";
 /**
 /**
  * Migration 20
  * Migration 20
  *
  *
- * Migration for station overhaul (WIP)
+ * Migration for station overhaul and preventing migration18 from always running
  *
  *
  * @param {object} MigrationModule - the MigrationModule
  * @param {object} MigrationModule - the MigrationModule
  * @returns {Promise} - returns promise
  * @returns {Promise} - returns promise
  */
  */
 export default async function migrate(MigrationModule) {
 export default async function migrate(MigrationModule) {
 	const stationModel = await MigrationModule.runJob("GET_MODEL", { modelName: "station" }, this);
 	const stationModel = await MigrationModule.runJob("GET_MODEL", { modelName: "station" }, this);
+	const songModel = await MigrationModule.runJob("GET_MODEL", { modelName: "song" }, this);
 
 
 	return new Promise((resolve, reject) => {
 	return new Promise((resolve, reject) => {
 		async.waterfall(
 		async.waterfall(
@@ -76,6 +77,20 @@ export default async function migrate(MigrationModule) {
 							}
 							}
 						}
 						}
 					);
 					);
+				},
+
+				next => {
+					songModel.updateMany({ documentVersion: 7 }, { $set: { documentVersion: 8 } }, (err, res) => {
+						if (err) next(err);
+						else {
+							this.log(
+								"INFO",
+								`Migration 20 (songs). Matched: ${res.matchedCount}, modified: ${res.modifiedCount}, ok: ${res.ok}.`
+							);
+
+							next();
+						}
+					});
 				}
 				}
 			],
 			],
 			err => {
 			err => {

+ 2 - 2
backend/package-lock.json

@@ -1,12 +1,12 @@
 {
 {
   "name": "musare-backend",
   "name": "musare-backend",
-  "version": "3.5.0-rc1",
+  "version": "3.5.0-rc2",
   "lockfileVersion": 2,
   "lockfileVersion": 2,
   "requires": true,
   "requires": true,
   "packages": {
   "packages": {
     "": {
     "": {
       "name": "musare-backend",
       "name": "musare-backend",
-      "version": "3.5.0-rc1",
+      "version": "3.5.0-rc2",
       "license": "GPL-3.0",
       "license": "GPL-3.0",
       "dependencies": {
       "dependencies": {
         "async": "^3.2.3",
         "async": "^3.2.3",

+ 1 - 1
backend/package.json

@@ -1,7 +1,7 @@
 {
 {
   "name": "musare-backend",
   "name": "musare-backend",
   "private": true,
   "private": true,
-  "version": "3.5.0-rc1",
+  "version": "3.5.0-rc2",
   "type": "module",
   "type": "module",
   "description": "An open-source collaborative music listening and catalogue curation application. Currently supporting YouTube based content.",
   "description": "An open-source collaborative music listening and catalogue curation application. Currently supporting YouTube based content.",
   "main": "index.js",
   "main": "index.js",

+ 2 - 2
docker-compose.yml

@@ -7,7 +7,7 @@ services:
     volumes:
     volumes:
       - ./.git:/opt/app/.parent_git:ro
       - ./.git:/opt/app/.parent_git:ro
       - /opt/app/node_modules
       - /opt/app/node_modules
-      - ./backend/config/default.json:/opt/app/config/default.json
+      - ./backend/config:/opt/app/config
     links:
     links:
       - mongo
       - mongo
       - redis
       - redis
@@ -22,7 +22,7 @@ services:
     volumes:
     volumes:
       - ./.git:/opt/app/.parent_git:ro
       - ./.git:/opt/app/.parent_git:ro
       - /opt/app/node_modules
       - /opt/app/node_modules
-      - ./frontend/dist/config/default.json:/opt/app/dist/config/default.json
+      - ./frontend/dist/config:/opt/app/dist/config
     environment:
     environment:
       - FRONTEND_MODE=${FRONTEND_MODE}
       - FRONTEND_MODE=${FRONTEND_MODE}
     links:
     links:

+ 7 - 2
frontend/Dockerfile

@@ -3,13 +3,18 @@ FROM node:16
 RUN apt-get update
 RUN apt-get update
 RUN apt-get install nginx -y
 RUN apt-get install nginx -y
 
 
+RUN npm install -g webpack@5.72.0 webpack-cli@4.9.2
+
 RUN mkdir -p /opt/app
 RUN mkdir -p /opt/app
 WORKDIR /opt/app
 WORKDIR /opt/app
-ADD ./ /opt/app
 
 
-RUN npm install -g webpack@5.72.0 webpack-cli@4.9.2
+COPY package.json /opt/app/package.json
+COPY package-lock.json /opt/app/package-lock.json
+
 RUN npm install
 RUN npm install
 
 
+COPY . /opt/app
+
 RUN mkdir -p /run/nginx
 RUN mkdir -p /run/nginx
 
 
 RUN chmod u+x bootstrap.sh
 RUN chmod u+x bootstrap.sh

+ 2 - 2
frontend/package-lock.json

@@ -1,12 +1,12 @@
 {
 {
   "name": "musare-frontend",
   "name": "musare-frontend",
-  "version": "3.5.0-rc1",
+  "version": "3.5.0-rc2",
   "lockfileVersion": 2,
   "lockfileVersion": 2,
   "requires": true,
   "requires": true,
   "packages": {
   "packages": {
     "": {
     "": {
       "name": "musare-frontend",
       "name": "musare-frontend",
-      "version": "3.5.0-rc1",
+      "version": "3.5.0-rc2",
       "license": "GPL-3.0",
       "license": "GPL-3.0",
       "dependencies": {
       "dependencies": {
         "@babel/runtime": "^7.17.9",
         "@babel/runtime": "^7.17.9",

+ 1 - 1
frontend/package.json

@@ -5,7 +5,7 @@
     "*.vue"
     "*.vue"
   ],
   ],
   "private": true,
   "private": true,
-  "version": "3.5.0-rc1",
+  "version": "3.5.0-rc2",
   "description": "An open-source collaborative music listening and catalogue curation application. Currently supporting YouTube based content.",
   "description": "An open-source collaborative music listening and catalogue curation application. Currently supporting YouTube based content.",
   "main": "main.js",
   "main": "main.js",
   "author": "Musare Team",
   "author": "Musare Team",

+ 0 - 1
frontend/src/components/AdvancedTable.vue

@@ -2317,7 +2317,6 @@ export default {
 			border: 1px solid var(--light-grey-2);
 			border: 1px solid var(--light-grey-2);
 			color: var(--dark-grey-2);
 			color: var(--dark-grey-2);
 			appearance: none;
 			appearance: none;
-			border-radius: @border-radius;
 			font-size: 14px;
 			font-size: 14px;
 			line-height: 34px;
 			line-height: 34px;
 			padding-left: 8px;
 			padding-left: 8px;

+ 13 - 11
frontend/src/pages/Home.vue

@@ -744,16 +744,19 @@ export default {
 			this.orderOfFavoriteStations = res.data.order;
 			this.orderOfFavoriteStations = res.data.order;
 		});
 		});
 
 
-		if (this.isAdmin()) {
-			// ctrl + alt + f
-			keyboardShortcuts.registerShortcut("home.toggleAdminFilter", {
-				keyCode: 70,
-				ctrl: true,
-				alt: true,
-				handler: () => {
+		// ctrl + alt + f
+		keyboardShortcuts.registerShortcut("home.toggleAdminFilter", {
+			keyCode: 70,
+			ctrl: true,
+			alt: true,
+			handler: () => {
+				if (this.isAdmin())
 					if (this.$route.query.adminFilter === undefined)
 					if (this.$route.query.adminFilter === undefined)
 						this.$router.push({
 						this.$router.push({
-							query: { ...this.$route.query, adminFilter: null }
+							query: {
+								...this.$route.query,
+								adminFilter: null
+							}
 						});
 						});
 					else
 					else
 						this.$router.push({
 						this.$router.push({
@@ -762,9 +765,8 @@ export default {
 								adminFilter: undefined
 								adminFilter: undefined
 							}
 							}
 						});
 						});
-				}
-			});
-		}
+			}
+		});
 	},
 	},
 	beforeUnmount() {
 	beforeUnmount() {
 		this.socket.dispatch("apis.leaveRoom", "home", () => {});
 		this.socket.dispatch("apis.leaveRoom", "home", () => {});

+ 1 - 0
frontend/src/pages/Station/index.vue

@@ -2326,6 +2326,7 @@ export default {
 	#currently-playing-container,
 	#currently-playing-container,
 	#next-up-container,
 	#next-up-container,
 	#control-bar-container,
 	#control-bar-container,
+	.quadrant:not(#sidebar-container),
 	.player-container {
 	.player-container {
 		background-color: var(--dark-grey-3) !important;
 		background-color: var(--dark-grey-3) !important;
 	}
 	}

+ 1 - 1
frontend/webpack.prod.js

@@ -32,7 +32,7 @@ module.exports = merge(common, {
 				ui: {
 				ui: {
 					name: false,
 					name: false,
 					test(module) {
 					test(module) {
-						return (
+						return module.resource && (
 							module.resource.includes("Modal.vue") ||
 							module.resource.includes("Modal.vue") ||
 							module.resource.includes(
 							module.resource.includes(
 								"AddToPlaylistDropdown.vue"
 								"AddToPlaylistDropdown.vue"

+ 15 - 9
musare.sh

@@ -40,6 +40,15 @@ if [[ ! -x "$(command -v ${docker})" || ! -x "$(command -v ${dockerCompose})" ]]
     exit 1
     exit 1
 fi
 fi
 
 
+composeFiles="-f docker-compose.yml"
+if [[ ${CONTAINER_MODE} == "dev" ]]; then
+    composeFiles="${composeFiles} -f docker-compose.dev.yml"
+fi
+if [[ -f docker-compose.override.yml ]]; then
+    composeFiles="${composeFiles} -f docker-compose.override.yml"
+fi
+dockerCompose="${dockerCompose} ${composeFiles}"
+
 handleServices()
 handleServices()
 {
 {
     validServices=(backend frontend mongo redis)
     validServices=(backend frontend mongo redis)
@@ -78,23 +87,20 @@ runDockerCommand()
             else
             else
                 servicesString=${servicesString:2}
                 servicesString=${servicesString:2}
             fi
             fi
-            if [[ ${CONTAINER_MODE} == "dev" ]]; then
-                composeFiles="-f docker-compose.yml -f docker-compose.dev.yml"
-            else
-                composeFiles="-f docker-compose.yml"
-            fi
+
             if [[ ${2} == "stop" || ${2} == "restart" ]]; then
             if [[ ${2} == "stop" || ${2} == "restart" ]]; then
                 # shellcheck disable=SC2086
                 # shellcheck disable=SC2086
-                ${dockerCompose} ${composeFiles} stop ${servicesString}
+                ${dockerCompose} stop ${servicesString}
             fi
             fi
             if [[ ${2} == "start" || ${2} == "restart" ]]; then
             if [[ ${2} == "start" || ${2} == "restart" ]]; then
                 # shellcheck disable=SC2086
                 # shellcheck disable=SC2086
-                ${dockerCompose} ${composeFiles} up -d ${servicesString}
+                ${dockerCompose} up -d ${servicesString}
             fi
             fi
             if [[ ${2} == "pull" || ${2} == "build" || ${2} == "ps" || ${2} == "logs" ]]; then
             if [[ ${2} == "pull" || ${2} == "build" || ${2} == "ps" || ${2} == "logs" ]]; then
                 # shellcheck disable=SC2086
                 # shellcheck disable=SC2086
-                ${dockerCompose} ${composeFiles} "${2}" ${servicesString}
+                ${dockerCompose} "${2}" ${servicesString}
             fi
             fi
+
             exitValue=$?
             exitValue=$?
             if [[ ${exitValue} -gt 0 ]]; then
             if [[ ${exitValue} -gt 0 ]]; then
                 exit ${exitValue}
                 exit ${exitValue}
@@ -185,7 +191,7 @@ case $1 in
                 # shellcheck disable=SC2086
                 # shellcheck disable=SC2086
                 runDockerCommand "$(basename "$0")" stop ${servicesString:2}
                 runDockerCommand "$(basename "$0")" stop ${servicesString:2}
                 # shellcheck disable=SC2086
                 # shellcheck disable=SC2086
-                ${dockerCompose} rm -v --force ${servicesString:2}
+                ${dockerCompose} rm -v --force ${servicesString}
                 if [[ "${servicesString:2}" == *redis* && -d $REDIS_DATA_LOCATION ]]; then
                 if [[ "${servicesString:2}" == *redis* && -d $REDIS_DATA_LOCATION ]]; then
                     rm -rf "${REDIS_DATA_LOCATION}"
                     rm -rf "${REDIS_DATA_LOCATION}"
                 fi
                 fi