diff --git a/CHANGELOG.md b/CHANGELOG.md index 3cb23b0e..71ae65c9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - Fixed error page metadata title warning - Fixed telemetry - Await page render job to complete before resolving +- Fixed JSON fields for MariaDB ### Changed - Moved Insert Media button in Markdown editor diff --git a/Makefile b/Makefile index c212b8be..f3688748 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,5 @@ SHELL := /bin/bash +DEVDB := postgres start: ## Start Wiki.js in production mode node wiki start @@ -23,27 +24,30 @@ test: ## Run code linting tests pug-lint server/views && jest docker-dev-up: ## Run dockerized dev environment - docker-compose -f ./dev/docker/docker-compose.yml -p wiki --project-directory . up -d - docker-compose -f ./dev/docker/docker-compose.yml -p wiki --project-directory . exec wiki yarn dev + docker-compose -f ./dev/docker-${DEVDB}/docker-compose.yml -p wiki --project-directory . up -d + docker-compose -f ./dev/docker-${DEVDB}/docker-compose.yml -p wiki --project-directory . exec wiki yarn dev docker-dev-down: ## Shutdown dockerized dev environment - docker-compose -f ./dev/docker/docker-compose.yml -p wiki --project-directory . down + docker-compose -f ./dev/docker-${DEVDB}/docker-compose.yml -p wiki --project-directory . down docker-dev-rebuild: ## Rebuild dockerized dev image rm -rf ./node_modules - docker-compose -f ./dev/docker/docker-compose.yml -p wiki --project-directory . build --no-cache --force-rm + docker-compose -f ./dev/docker-${DEVDB}/docker-compose.yml -p wiki --project-directory . build --no-cache --force-rm docker-dev-clean: ## Clean DB, redis and data folders rm -rf ./data - docker-compose -f ./dev/docker/docker-compose.yml -p wiki --project-directory . exec db psql --dbname=wiki --username=wikijs --command='DROP SCHEMA IF EXISTS public CASCADE; CREATE SCHEMA public' - docker-compose -f ./dev/docker/docker-compose.yml -p wiki --project-directory . exec redis redis-cli flushall + [[ "${DEVDB}" == "postgres" ]] && docker-compose -f ./dev/docker-postgres/docker-compose.yml -p wiki --project-directory . exec db psql --dbname=wiki --username=wikijs --command='DROP SCHEMA IF EXISTS public CASCADE; CREATE SCHEMA public' || true + [[ "${DEVDB}" == "mysql" || "${DEVDB}" == "mariadb" ]] && docker-compose -f ./dev/docker-${DEVDB}/docker-compose.yml -p wiki --project-directory . exec db mysql -uroot -p'wikijsrocks' -e 'DROP SCHEMA IF EXISTS wiki; CREATE SCHEMA wiki;' || true + ## [[ "${DEVDB}" = "mssql" ]] && docker-compose -f ./dev/docker-mssql/docker-compose.yml -p wiki --project-directory . exec db ls + [[ "${DEVDB}" == "sqlite" ]] && docker-compose -f ./dev/docker-${DEVDB}/docker-compose.yml -p wiki --project-directory . exec wiki rm -rf /wiki/db.sqlite || true + docker-compose -f ./dev/docker-${DEVDB}/docker-compose.yml -p wiki --project-directory . exec redis redis-cli flushall docker-dev-bash: ## Rebuild dockerized dev image - docker-compose -f ./dev/docker/docker-compose.yml -p wiki --project-directory . exec wiki bash + docker-compose -f ./dev/docker-${DEVDB}/docker-compose.yml -p wiki --project-directory . exec wiki bash docker-build: ## Run assets generation build in docker - docker-compose -f ./dev/docker/docker-compose.yml -p wiki --project-directory . run wiki yarn build - docker-compose -f ./dev/docker/docker-compose.yml -p wiki --project-directory . down + docker-compose -f ./dev/docker-${DEVDB}/docker-compose.yml -p wiki --project-directory . run wiki yarn build + docker-compose -f ./dev/docker-${DEVDB}/docker-compose.yml -p wiki --project-directory . down help: ## Display help @echo '' diff --git a/dev/build/Dockerfile b/dev/build/Dockerfile index 0a9a0748..9e966f2b 100644 --- a/dev/build/Dockerfile +++ b/dev/build/Dockerfile @@ -29,7 +29,7 @@ FROM node:10.15-alpine LABEL maintainer="requarks.io" RUN apk update && \ - apk add bash curl git openssh gnupg supervisor --no-cache && \ + apk add bash curl git openssh gnupg sqlite --no-cache && \ rm -rf /var/cache/apk/* && \ mkdir -p /wiki && \ mkdir -p /logs diff --git a/dev/docker/wait.sh b/dev/docker-common/wait.sh similarity index 100% rename from dev/docker/wait.sh rename to dev/docker-common/wait.sh diff --git a/dev/docker-mariadb/Dockerfile b/dev/docker-mariadb/Dockerfile new file mode 100644 index 00000000..7d303558 --- /dev/null +++ b/dev/docker-mariadb/Dockerfile @@ -0,0 +1,21 @@ +# -- DEV DOCKERFILE -- +# -- DO NOT USE IN PRODUCTION! -- + +FROM node:10-alpine +LABEL maintainer "requarks.io" + +RUN apk update && \ + apk add bash curl git python make g++ nano openssh gnupg --no-cache && \ + mkdir -p /wiki + +WORKDIR /wiki +COPY package.json . +RUN yarn --silent +COPY ./dev/docker-mariadb/init.sh ./init.sh + +ENV dockerdev 1 +ENV DEVDB mariadb + +EXPOSE 3000 + +CMD ["tail", "-f", "/dev/null"] diff --git a/dev/docker-mariadb/config.yml b/dev/docker-mariadb/config.yml new file mode 100644 index 00000000..0dcd4528 --- /dev/null +++ b/dev/docker-mariadb/config.yml @@ -0,0 +1,14 @@ +port: 3000 +bindIP: 0.0.0.0 +db: + type: mariadb + host: db + port: 3306 + user: wikijs + pass: wikijsrocks + db: wiki +redis: + host: redis + port: 6379 + db: 0 +logLevel: info diff --git a/dev/docker-mariadb/docker-compose.yml b/dev/docker-mariadb/docker-compose.yml new file mode 100644 index 00000000..9ca820b7 --- /dev/null +++ b/dev/docker-mariadb/docker-compose.yml @@ -0,0 +1,61 @@ +# -- DEV DOCKER-COMPOSE -- +# -- DO NOT USE IN PRODUCTION! -- + +version: "3" +services: + + redis: + image: redis:4-alpine + ports: + - "16379:6379" + logging: + driver: "none" + networks: + - wikinet + + db: + image: mariadb:10.3 + environment: + MYSQL_DATABASE: wiki + MYSQL_PASSWORD: wikijsrocks + MYSQL_USER: wikijs + MYSQL_ROOT_PASSWORD: wikijsrocks + logging: + driver: "none" + volumes: + - db-data:/var/lib/mysql + networks: + - wikinet + ports: + - "13306:3306" + + adminer: + image: adminer:latest + logging: + driver: "none" + networks: + - wikinet + ports: + - "3001:8080" + + wiki: + build: + context: . + dockerfile: dev/docker-mariadb/Dockerfile + depends_on: + - db + - redis + networks: + - wikinet + ports: + - "3000:3000" + volumes: + - .:/wiki + - /wiki/node_modules + command: ["sh", "./dev/docker-mariadb/init.sh"] + +networks: + wikinet: + +volumes: + db-data: diff --git a/dev/docker-mariadb/init.sh b/dev/docker-mariadb/init.sh new file mode 100644 index 00000000..69d78eed --- /dev/null +++ b/dev/docker-mariadb/init.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +echo "Waiting for redis and mariadb to start up..." +bash ./dev/docker-common/wait.sh redis:6379 +bash ./dev/docker-common/wait.sh db:3306 +echo "=== READY ===" +tail -f /dev/null diff --git a/dev/docker/Dockerfile b/dev/docker-mssql/Dockerfile similarity index 85% rename from dev/docker/Dockerfile rename to dev/docker-mssql/Dockerfile index b05626f9..b8a9c56c 100644 --- a/dev/docker/Dockerfile +++ b/dev/docker-mssql/Dockerfile @@ -11,9 +11,10 @@ RUN apk update && \ WORKDIR /wiki COPY package.json . RUN yarn --silent -COPY ./dev/docker/init.sh ./init.sh +COPY ./dev/docker-mssql/init.sh ./init.sh ENV dockerdev 1 +ENV DEVDB mssql EXPOSE 3000 diff --git a/dev/docker-mssql/config.yml b/dev/docker-mssql/config.yml new file mode 100644 index 00000000..5ebedf09 --- /dev/null +++ b/dev/docker-mssql/config.yml @@ -0,0 +1,14 @@ +port: 3000 +bindIP: 0.0.0.0 +db: + type: mssql + host: db + port: 1433 + user: SA + pass: W1kiJSR0cks! + db: wiki +redis: + host: redis + port: 6379 + db: 0 +logLevel: info diff --git a/dev/docker-mssql/docker-compose.yml b/dev/docker-mssql/docker-compose.yml new file mode 100644 index 00000000..68ef4257 --- /dev/null +++ b/dev/docker-mssql/docker-compose.yml @@ -0,0 +1,60 @@ +# -- DEV DOCKER-COMPOSE -- +# -- DO NOT USE IN PRODUCTION! -- + +version: "3" +services: + + redis: + image: redis:4-alpine + ports: + - "16379:6379" + logging: + driver: "none" + networks: + - wikinet + + db: + image: mcr.microsoft.com/mssql/server:2017-latest + environment: + ACCEPT_EULA: 'Y' + MSSQL_PID: Developer + SA_PASSWORD: W1kiJSR0cks! + logging: + driver: "none" + volumes: + - db-data:/var/opt/mssql + networks: + - wikinet + ports: + - "11433:1433" + + adminer: + image: adminer:latest + logging: + driver: "none" + networks: + - wikinet + ports: + - "3001:8080" + + wiki: + build: + context: . + dockerfile: dev/docker-mssql/Dockerfile + depends_on: + - db + - redis + networks: + - wikinet + ports: + - "3000:3000" + volumes: + - .:/wiki + - /wiki/node_modules + command: ["sh", "./dev/docker-mssql/init.sh"] + +networks: + wikinet: + +volumes: + db-data: diff --git a/dev/docker-mssql/init.sh b/dev/docker-mssql/init.sh new file mode 100644 index 00000000..5dba84af --- /dev/null +++ b/dev/docker-mssql/init.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +echo "Waiting for redis and mssql to start up..." +bash ./dev/docker-common/wait.sh redis:6379 +bash ./dev/docker-common/wait.sh db:1433 +echo "=== READY ===" +tail -f /dev/null diff --git a/dev/docker-mysql/Dockerfile b/dev/docker-mysql/Dockerfile new file mode 100644 index 00000000..b3fa01b1 --- /dev/null +++ b/dev/docker-mysql/Dockerfile @@ -0,0 +1,21 @@ +# -- DEV DOCKERFILE -- +# -- DO NOT USE IN PRODUCTION! -- + +FROM node:10-alpine +LABEL maintainer "requarks.io" + +RUN apk update && \ + apk add bash curl git python make g++ nano openssh gnupg --no-cache && \ + mkdir -p /wiki + +WORKDIR /wiki +COPY package.json . +RUN yarn --silent +COPY ./dev/docker-mysql/init.sh ./init.sh + +ENV dockerdev 1 +ENV DEVDB mysql + +EXPOSE 3000 + +CMD ["tail", "-f", "/dev/null"] diff --git a/dev/docker-mysql/config.yml b/dev/docker-mysql/config.yml new file mode 100644 index 00000000..d83189ab --- /dev/null +++ b/dev/docker-mysql/config.yml @@ -0,0 +1,14 @@ +port: 3000 +bindIP: 0.0.0.0 +db: + type: mysql + host: db + port: 3306 + user: wikijs + pass: wikijsrocks + db: wiki +redis: + host: redis + port: 6379 + db: 0 +logLevel: info diff --git a/dev/docker-mysql/docker-compose.yml b/dev/docker-mysql/docker-compose.yml new file mode 100644 index 00000000..82a3eee0 --- /dev/null +++ b/dev/docker-mysql/docker-compose.yml @@ -0,0 +1,61 @@ +# -- DEV DOCKER-COMPOSE -- +# -- DO NOT USE IN PRODUCTION! -- + +version: "3" +services: + + redis: + image: redis:4-alpine + ports: + - "16379:6379" + logging: + driver: "none" + networks: + - wikinet + + db: + image: mysql:5.7 + environment: + MYSQL_DATABASE: wiki + MYSQL_PASSWORD: wikijsrocks + MYSQL_USER: wikijs + MYSQL_ROOT_PASSWORD: wikijsrocks + logging: + driver: "none" + volumes: + - db-data:/var/lib/mysql + networks: + - wikinet + ports: + - "13306:3306" + + adminer: + image: adminer:latest + logging: + driver: "none" + networks: + - wikinet + ports: + - "3001:8080" + + wiki: + build: + context: . + dockerfile: dev/docker-mysql/Dockerfile + depends_on: + - db + - redis + networks: + - wikinet + ports: + - "3000:3000" + volumes: + - .:/wiki + - /wiki/node_modules + command: ["sh", "./dev/docker-mysql/init.sh"] + +networks: + wikinet: + +volumes: + db-data: diff --git a/dev/docker-mysql/init.sh b/dev/docker-mysql/init.sh new file mode 100644 index 00000000..07f4ae3e --- /dev/null +++ b/dev/docker-mysql/init.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +echo "Waiting for redis and mysql to start up..." +bash ./dev/docker-common/wait.sh redis:6379 +bash ./dev/docker-common/wait.sh db:3306 +echo "=== READY ===" +tail -f /dev/null diff --git a/dev/docker-postgres/Dockerfile b/dev/docker-postgres/Dockerfile new file mode 100644 index 00000000..3a0f7113 --- /dev/null +++ b/dev/docker-postgres/Dockerfile @@ -0,0 +1,21 @@ +# -- DEV DOCKERFILE -- +# -- DO NOT USE IN PRODUCTION! -- + +FROM node:10-alpine +LABEL maintainer "requarks.io" + +RUN apk update && \ + apk add bash curl git python make g++ nano openssh gnupg --no-cache && \ + mkdir -p /wiki + +WORKDIR /wiki +COPY package.json . +RUN yarn --silent +COPY ./dev/docker-postgres/init.sh ./init.sh + +ENV dockerdev 1 +ENV DEVDB postgres + +EXPOSE 3000 + +CMD ["tail", "-f", "/dev/null"] diff --git a/dev/docker/config.yml b/dev/docker-postgres/config.yml similarity index 100% rename from dev/docker/config.yml rename to dev/docker-postgres/config.yml diff --git a/dev/docker/docker-compose.yml b/dev/docker-postgres/docker-compose.yml similarity index 89% rename from dev/docker/docker-compose.yml rename to dev/docker-postgres/docker-compose.yml index aabb96c5..aa5600a4 100644 --- a/dev/docker/docker-compose.yml +++ b/dev/docker-postgres/docker-compose.yml @@ -40,7 +40,7 @@ services: wiki: build: context: . - dockerfile: dev/docker/Dockerfile + dockerfile: dev/docker-postgres/Dockerfile depends_on: - db - redis @@ -51,7 +51,7 @@ services: volumes: - .:/wiki - /wiki/node_modules - command: ["sh", "./dev/docker/init.sh"] + command: ["sh", "./dev/docker-postgres/init.sh"] networks: wikinet: diff --git a/dev/docker/init.sh b/dev/docker-postgres/init.sh similarity index 54% rename from dev/docker/init.sh rename to dev/docker-postgres/init.sh index 7634bad8..96e6182c 100644 --- a/dev/docker/init.sh +++ b/dev/docker-postgres/init.sh @@ -1,7 +1,7 @@ #!/bin/sh echo "Waiting for redis and postgres to start up..." -bash ./dev/docker/wait.sh redis:6379 -bash ./dev/docker/wait.sh db:5432 +bash ./dev/docker-common/wait.sh redis:6379 +bash ./dev/docker-common/wait.sh db:5432 echo "=== READY ===" tail -f /dev/null diff --git a/dev/docker-sqlite/Dockerfile b/dev/docker-sqlite/Dockerfile new file mode 100644 index 00000000..26f32650 --- /dev/null +++ b/dev/docker-sqlite/Dockerfile @@ -0,0 +1,21 @@ +# -- DEV DOCKERFILE -- +# -- DO NOT USE IN PRODUCTION! -- + +FROM node:10-alpine +LABEL maintainer "requarks.io" + +RUN apk update && \ + apk add bash curl git python make g++ nano openssh gnupg sqlite --no-cache && \ + mkdir -p /wiki + +WORKDIR /wiki +COPY package.json . +RUN yarn --silent +COPY ./dev/docker-sqlite/init.sh ./init.sh + +ENV dockerdev 1 +ENV DEVDB sqlite + +EXPOSE 3000 + +CMD ["tail", "-f", "/dev/null"] diff --git a/dev/docker-sqlite/config.yml b/dev/docker-sqlite/config.yml new file mode 100644 index 00000000..5c04c370 --- /dev/null +++ b/dev/docker-sqlite/config.yml @@ -0,0 +1,10 @@ +port: 3000 +bindIP: 0.0.0.0 +db: + type: sqlite + storage: /wiki/db.sqlite +redis: + host: redis + port: 6379 + db: 0 +logLevel: info diff --git a/dev/docker-sqlite/docker-compose.yml b/dev/docker-sqlite/docker-compose.yml new file mode 100644 index 00000000..87c3de5e --- /dev/null +++ b/dev/docker-sqlite/docker-compose.yml @@ -0,0 +1,35 @@ +# -- DEV DOCKER-COMPOSE -- +# -- DO NOT USE IN PRODUCTION! -- + +version: "3" +services: + + redis: + image: redis:4-alpine + ports: + - "16379:6379" + logging: + driver: "none" + networks: + - wikinet + + wiki: + build: + context: . + dockerfile: dev/docker-sqlite/Dockerfile + depends_on: + - redis + networks: + - wikinet + ports: + - "3000:3000" + volumes: + - .:/wiki + - /wiki/node_modules + command: ["sh", "./dev/docker-sqlite/init.sh"] + +networks: + wikinet: + +volumes: + db-data: diff --git a/dev/docker-sqlite/init.sh b/dev/docker-sqlite/init.sh new file mode 100644 index 00000000..8cd23b81 --- /dev/null +++ b/dev/docker-sqlite/init.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +echo "Waiting for redis to start up..." +bash ./dev/docker-common/wait.sh redis:6379 +echo "=== READY ===" +tail -f /dev/null diff --git a/server/core/config.js b/server/core/config.js index 1bf4b68b..1aa059a8 100644 --- a/server/core/config.js +++ b/server/core/config.js @@ -19,7 +19,7 @@ module.exports = { } if (process.env.dockerdev) { - confPaths.config = path.join(WIKI.ROOTPATH, 'dev/docker/config.yml') + confPaths.config = path.join(WIKI.ROOTPATH, `dev/docker-${process.env.DEVDB}/config.yml`) } process.stdout.write(chalk.blue(`Loading configuration from ${confPaths.config}... `)) diff --git a/server/core/localization.js b/server/core/localization.js index dd6699e2..54466e23 100644 --- a/server/core/localization.js +++ b/server/core/localization.js @@ -84,7 +84,7 @@ module.exports = { throw new Error('No such locale in local store.') } - //-> Load dev locale files if present + // -> Load dev locale files if present if (WIKI.IS_DEBUG) { try { const devEntriesRaw = await fs.readFileAsync(path.join(WIKI.SERVERPATH, `locales/${locale}.yml`), 'utf8') diff --git a/server/models/authentication.js b/server/models/authentication.js index e4436839..80ec3ffb 100644 --- a/server/models/authentication.js +++ b/server/models/authentication.js @@ -22,14 +22,15 @@ module.exports = class Authentication extends Model { properties: { key: {type: 'string'}, isEnabled: {type: 'boolean'}, - config: {type: 'object'}, - selfRegistration: {type: 'boolean'}, - domainWhitelist: {type: 'object'}, - autoEnrollGroups: {type: 'object'} + selfRegistration: {type: 'boolean'} } } } + static get jsonAttributes() { + return ['config', 'domainWhitelist', 'autoEnrollGroups'] + } + static async getStrategy(key) { return WIKI.models.authentication.query().findOne({ key }) } diff --git a/server/models/editors.js b/server/models/editors.js index 0bc92f07..29e3db6c 100644 --- a/server/models/editors.js +++ b/server/models/editors.js @@ -21,12 +21,15 @@ module.exports = class Editor extends Model { properties: { key: {type: 'string'}, - isEnabled: {type: 'boolean'}, - config: {type: 'object'} + isEnabled: {type: 'boolean'} } } } + static get jsonAttributes() { + return ['config'] + } + static async getEditors() { return WIKI.models.editors.query() } diff --git a/server/models/groups.js b/server/models/groups.js index 242e8f1b..e3d1af4f 100644 --- a/server/models/groups.js +++ b/server/models/groups.js @@ -20,6 +20,10 @@ module.exports = class Group extends Model { } } + static get jsonAttributes() { + return ['permissions', 'pageRules'] + } + static get relationMappings() { return { users: { diff --git a/server/models/locales.js b/server/models/locales.js index f5d5a5fe..e4544dfd 100644 --- a/server/models/locales.js +++ b/server/models/locales.js @@ -3,7 +3,7 @@ const Model = require('objection').Model /** * Locales model */ -module.exports = class User extends Model { +module.exports = class Locale extends Model { static get tableName() { return 'locales' } static get idColumn() { return 'code' } @@ -14,7 +14,6 @@ module.exports = class User extends Model { properties: { code: {type: 'string'}, - strings: {type: 'object'}, isRTL: {type: 'boolean', default: false}, name: {type: 'string'}, nativeName: {type: 'string'}, @@ -24,6 +23,10 @@ module.exports = class User extends Model { } } + static get jsonAttributes() { + return ['strings'] + } + $beforeUpdate() { this.updatedAt = new Date().toISOString() } diff --git a/server/models/loggers.js b/server/models/loggers.js index 8de16ebb..cd6664c6 100644 --- a/server/models/loggers.js +++ b/server/models/loggers.js @@ -22,12 +22,15 @@ module.exports = class Logger extends Model { properties: { key: {type: 'string'}, isEnabled: {type: 'boolean'}, - level: {type: 'string'}, - config: {type: 'object'} + level: {type: 'string'} } } } + static get jsonAttributes() { + return ['config'] + } + static async getLoggers() { return WIKI.models.loggers.query() } diff --git a/server/models/renderers.js b/server/models/renderers.js index 58b51776..f88f609c 100644 --- a/server/models/renderers.js +++ b/server/models/renderers.js @@ -22,12 +22,15 @@ module.exports = class Renderer extends Model { properties: { key: {type: 'string'}, - isEnabled: {type: 'boolean'}, - config: {type: 'object'} + isEnabled: {type: 'boolean'} } } } + static get jsonAttributes() { + return ['config'] + } + static async getRenderers() { return WIKI.models.renderers.query() } diff --git a/server/models/searchEngines.js b/server/models/searchEngines.js index 963e5ffa..e827c998 100644 --- a/server/models/searchEngines.js +++ b/server/models/searchEngines.js @@ -22,12 +22,15 @@ module.exports = class SearchEngine extends Model { properties: { key: {type: 'string'}, isEnabled: {type: 'boolean'}, - level: {type: 'string'}, - config: {type: 'object'} + level: {type: 'string'} } } } + static get jsonAttributes() { + return ['config'] + } + static async getSearchEngines() { return WIKI.models.searchEngines.query() } diff --git a/server/models/settings.js b/server/models/settings.js index bf6fba24..14bc6506 100644 --- a/server/models/settings.js +++ b/server/models/settings.js @@ -13,17 +13,20 @@ module.exports = class Setting extends Model { static get jsonSchema () { return { type: 'object', - required: ['key', 'value'], + required: ['key'], properties: { key: {type: 'string'}, - value: {type: 'object'}, createdAt: {type: 'string'}, updatedAt: {type: 'string'} } } } + static get jsonAttributes() { + return ['value'] + } + $beforeUpdate() { this.updatedAt = new Date().toISOString() } diff --git a/server/models/storage.js b/server/models/storage.js index 9ed7d91d..959c9df9 100644 --- a/server/models/storage.js +++ b/server/models/storage.js @@ -24,12 +24,15 @@ module.exports = class Storage extends Model { properties: { key: {type: 'string'}, isEnabled: {type: 'boolean'}, - mode: {type: 'string'}, - config: {type: 'object'} + mode: {type: 'string'} } } } + static get jsonAttributes() { + return ['config'] + } + static async getTargets() { return WIKI.models.storage.query() }