mirror of
https://github.com/xuthus83/pigallery2.git
synced 2025-01-14 14:43:17 +08:00
upgrading to recommend node v16, making min version to be v14
This commit is contained in:
parent
e607ae810a
commit
b72788456b
4
.github/workflows/build.yml
vendored
4
.github/workflows/build.yml
vendored
@ -17,7 +17,7 @@ jobs:
|
|||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
node-version: [12.x, 13.x, 14.x]
|
node-version: [14.x, 15.x, 16.x, 17.x]
|
||||||
|
|
||||||
services:
|
services:
|
||||||
mariadb:
|
mariadb:
|
||||||
@ -77,7 +77,7 @@ jobs:
|
|||||||
name: Setup Node.js for use with actions
|
name: Setup Node.js for use with actions
|
||||||
uses: actions/setup-node@v2
|
uses: actions/setup-node@v2
|
||||||
with:
|
with:
|
||||||
node-version: 12
|
node-version: 14
|
||||||
-
|
-
|
||||||
name: Install Deps
|
name: Install Deps
|
||||||
run: npm install --unsafe-perm
|
run: npm install --unsafe-perm
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
dist: xenial
|
dist: xenial
|
||||||
language: node_js
|
language: node_js
|
||||||
node_js:
|
node_js:
|
||||||
- '12'
|
|
||||||
- '13'
|
|
||||||
- '14'
|
- '14'
|
||||||
|
- '16'
|
||||||
|
- '17'
|
||||||
env:
|
env:
|
||||||
- PORT=35000 MYSQL_HOST='localhost' MYSQL_PASSWORD='' MYSQL_USERNAME='root' MYSQL_DATABASE='pigallery2_test'
|
- PORT=35000 MYSQL_HOST='localhost' MYSQL_PASSWORD='' MYSQL_USERNAME='root' MYSQL_DATABASE='pigallery2_test'
|
||||||
services:
|
services:
|
||||||
|
@ -296,7 +296,7 @@ export class BenchmarkRunner {
|
|||||||
private resetDB = async (): Promise<void> => {
|
private resetDB = async (): Promise<void> => {
|
||||||
Config.Server.Threading.enabled = false;
|
Config.Server.Threading.enabled = false;
|
||||||
await ObjectManagers.reset();
|
await ObjectManagers.reset();
|
||||||
await fs.promises.rmdir(ProjectPath.DBFolder, {recursive: true});
|
await fs.promises.rm(ProjectPath.DBFolder, {recursive: true});
|
||||||
Config.Server.Database.type = DatabaseType.sqlite;
|
Config.Server.Database.type = DatabaseType.sqlite;
|
||||||
Config.Server.Jobs.scheduled = [];
|
Config.Server.Jobs.scheduled = [];
|
||||||
await ObjectManagers.InitSQLManagers();
|
await ObjectManagers.InitSQLManagers();
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#-----------------BUILDER-----------------
|
#-----------------BUILDER-----------------
|
||||||
#-----------------------------------------
|
#-----------------------------------------
|
||||||
FROM node:14-alpine3.13 AS builder
|
FROM node:16-alpine3.15 AS builder
|
||||||
RUN apk add --update-cache --repository https://alpine.global.ssl.fastly.net/alpine/v3.13/community/ \
|
RUN apk add --update-cache --repository https://alpine.global.ssl.fastly.net/alpine/v3.13/community/ \
|
||||||
python3 build-base sqlite-dev sqlite-libs vips-dev fftw-dev gcc g++ make libc6-compat && ln -snf /usr/bin/python3 /usr/bin/python
|
python3 build-base sqlite-dev sqlite-libs vips-dev fftw-dev gcc g++ make libc6-compat && ln -snf /usr/bin/python3 /usr/bin/python
|
||||||
COPY pigallery2-release /app
|
COPY pigallery2-release /app
|
||||||
@ -14,7 +14,7 @@ RUN mkdir -p /app/data/config && \
|
|||||||
|
|
||||||
#-----------------MAIN--------------------
|
#-----------------MAIN--------------------
|
||||||
#-----------------------------------------
|
#-----------------------------------------
|
||||||
FROM node:14-alpine3.13 AS main
|
FROM node:16-alpine3.15 AS main
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
ENV NODE_ENV=production \
|
ENV NODE_ENV=production \
|
||||||
# overrides only the default value of the settings (the actualy value can be overwritten through config.json)
|
# overrides only the default value of the settings (the actualy value can be overwritten through config.json)
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#-----------------BUILDER-----------------
|
#-----------------BUILDER-----------------
|
||||||
#-----------------------------------------
|
#-----------------------------------------
|
||||||
FROM node:14-buster AS builder
|
FROM node:16-buster AS builder
|
||||||
COPY pigallery2-release /app
|
COPY pigallery2-release /app
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
RUN npm install --unsafe-perm
|
RUN npm install --unsafe-perm
|
||||||
@ -12,7 +12,7 @@ RUN mkdir -p /app/data/config && \
|
|||||||
|
|
||||||
#-----------------MAIN--------------------
|
#-----------------MAIN--------------------
|
||||||
#-----------------------------------------
|
#-----------------------------------------
|
||||||
FROM node:14-buster-slim AS main
|
FROM node:16-buster-slim AS main
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
ENV NODE_ENV=production \
|
ENV NODE_ENV=production \
|
||||||
# overrides only the default value of the settings (the actualy value can be overwritten through config.json)
|
# overrides only the default value of the settings (the actualy value can be overwritten through config.json)
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#-----------------BUILDER-----------------
|
#-----------------BUILDER-----------------
|
||||||
#-----------------------------------------
|
#-----------------------------------------
|
||||||
FROM node:14-stretch AS builder
|
FROM node:16-stretch AS builder
|
||||||
COPY pigallery2-release /app
|
COPY pigallery2-release /app
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
RUN npm install --unsafe-perm
|
RUN npm install --unsafe-perm
|
||||||
@ -12,7 +12,7 @@ RUN mkdir -p /app/data/config && \
|
|||||||
|
|
||||||
#-----------------MAIN--------------------
|
#-----------------MAIN--------------------
|
||||||
#-----------------------------------------
|
#-----------------------------------------
|
||||||
FROM node:14-stretch-slim AS main
|
FROM node:16-stretch-slim AS main
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
ENV NODE_ENV=production \
|
ENV NODE_ENV=production \
|
||||||
# overrides only the default value of the settings (the actualy value can be overwritten through config.json)
|
# overrides only the default value of the settings (the actualy value can be overwritten through config.json)
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#-----------------BUILDER-----------------
|
#-----------------BUILDER-----------------
|
||||||
#-----------------------------------------
|
#-----------------------------------------
|
||||||
FROM node:14-buster AS builder
|
FROM node:16-buster AS builder
|
||||||
# LABEL maintainer="Patrik J. Braun"
|
# LABEL maintainer="Patrik J. Braun"
|
||||||
# copying only package{-lock}.json to make node_modules cachable
|
# copying only package{-lock}.json to make node_modules cachable
|
||||||
RUN git clone https://github.com/bpatrik/pigallery2.git /build
|
RUN git clone https://github.com/bpatrik/pigallery2.git /build
|
||||||
@ -16,7 +16,7 @@ RUN npm install --unsafe-perm \
|
|||||||
|
|
||||||
#-----------------MAIN--------------------
|
#-----------------MAIN--------------------
|
||||||
#-----------------------------------------
|
#-----------------------------------------
|
||||||
FROM node:14-buster-slim AS main
|
FROM node:16-buster-slim AS main
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
ENV NODE_ENV=production \
|
ENV NODE_ENV=production \
|
||||||
# overrides only the default value of the settings (the actualy value can be overwritten through config.json)
|
# overrides only the default value of the settings (the actualy value can be overwritten through config.json)
|
||||||
|
@ -14,7 +14,7 @@ services:
|
|||||||
restart: always
|
restart: always
|
||||||
|
|
||||||
pigallery2:
|
pigallery2:
|
||||||
image: bpatrik/pigallery2:latest-debian-buster # TODO: change it back to latest once relese workflow gets fixed
|
image: bpatrik/pigallery2:latest-debian-buster # TODO: change it back to latest once release workflow gets fixed
|
||||||
container_name: pigallery2
|
container_name: pigallery2
|
||||||
environment:
|
environment:
|
||||||
- NODE_ENV=production
|
- NODE_ENV=production
|
||||||
|
27664
package-lock.json
generated
27664
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -155,6 +155,6 @@
|
|||||||
"mysql": "2.18.1"
|
"mysql": "2.18.1"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=12.0 <15.0"
|
"node": ">=14.0 <18.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -57,7 +57,7 @@ export class TempFolderCleaningJob extends Job {
|
|||||||
this.Progress.log('processing: ' + file);
|
this.Progress.log('processing: ' + file);
|
||||||
this.Progress.Processed++;
|
this.Progress.Processed++;
|
||||||
if ((await fs.promises.stat(file)).isDirectory()) {
|
if ((await fs.promises.stat(file)).isDirectory()) {
|
||||||
await fs.promises.rmdir(file, {recursive: true});
|
await fs.promises.rm(file, {recursive: true});
|
||||||
} else {
|
} else {
|
||||||
await fs.promises.unlink(file);
|
await fs.promises.unlink(file);
|
||||||
}
|
}
|
||||||
@ -83,7 +83,7 @@ export class TempFolderCleaningJob extends Job {
|
|||||||
if (await this.isValidDirectory(filePath) === false) {
|
if (await this.isValidDirectory(filePath) === false) {
|
||||||
this.Progress.log('processing: ' + filePath);
|
this.Progress.log('processing: ' + filePath);
|
||||||
this.Progress.Processed++;
|
this.Progress.Processed++;
|
||||||
await fs.promises.rmdir(filePath, {recursive: true});
|
await fs.promises.rm(filePath, {recursive: true});
|
||||||
} else {
|
} else {
|
||||||
this.Progress.log('skipping: ' + filePath);
|
this.Progress.log('skipping: ' + filePath);
|
||||||
this.Progress.Skipped++;
|
this.Progress.Skipped++;
|
||||||
|
@ -171,7 +171,7 @@ export class DBTestHelper {
|
|||||||
Config.Server.Database.dbFolder = this.tempDir;
|
Config.Server.Database.dbFolder = this.tempDir;
|
||||||
ProjectPath.reset();
|
ProjectPath.reset();
|
||||||
await ObjectManagers.reset();
|
await ObjectManagers.reset();
|
||||||
await fs.promises.rmdir(this.tempDir, {recursive: true});
|
await fs.promises.rm(this.tempDir, {recursive: true, force: true});
|
||||||
await ObjectManagers.InitSQLManagers();
|
await ObjectManagers.InitSQLManagers();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -180,7 +180,7 @@ export class DBTestHelper {
|
|||||||
Config.Server.Database.dbFolder = this.tempDir;
|
Config.Server.Database.dbFolder = this.tempDir;
|
||||||
ProjectPath.reset();
|
ProjectPath.reset();
|
||||||
await ObjectManagers.reset();
|
await ObjectManagers.reset();
|
||||||
await fs.promises.rmdir(this.tempDir, {recursive: true});
|
await fs.promises.rm(this.tempDir, {recursive: true, force: true});
|
||||||
}
|
}
|
||||||
|
|
||||||
private async clearUpMemory(): Promise<void> {
|
private async clearUpMemory(): Promise<void> {
|
||||||
|
@ -24,7 +24,7 @@ describe('Typeorm integration', () => {
|
|||||||
|
|
||||||
const tempDir = path.join(__dirname, '../../tmp');
|
const tempDir = path.join(__dirname, '../../tmp');
|
||||||
const setUpSqlDB = async () => {
|
const setUpSqlDB = async () => {
|
||||||
await fs.promises.rmdir(tempDir, {recursive: true});
|
await fs.promises.rm(tempDir, {recursive: true});
|
||||||
|
|
||||||
Config.Server.Database.type = DatabaseType.sqlite;
|
Config.Server.Database.type = DatabaseType.sqlite;
|
||||||
Config.Server.Database.dbFolder = tempDir;
|
Config.Server.Database.dbFolder = tempDir;
|
||||||
@ -34,7 +34,7 @@ describe('Typeorm integration', () => {
|
|||||||
|
|
||||||
const teardownUpSqlDB = async () => {
|
const teardownUpSqlDB = async () => {
|
||||||
await SQLConnection.close();
|
await SQLConnection.close();
|
||||||
await fs.promises.rmdir(tempDir, {recursive: true});
|
await fs.promises.rm(tempDir, {recursive: true});
|
||||||
};
|
};
|
||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
|
@ -29,7 +29,7 @@ describe('GalleryRouter', (sqlHelper: DBTestHelper) => {
|
|||||||
let server: Server;
|
let server: Server;
|
||||||
const setUp = async () => {
|
const setUp = async () => {
|
||||||
await sqlHelper.initDB();
|
await sqlHelper.initDB();
|
||||||
await fs.promises.rmdir(tempDir, {recursive: true});
|
await fs.promises.rm(tempDir, {recursive: true});
|
||||||
Config.Client.authenticationRequired = false;
|
Config.Client.authenticationRequired = false;
|
||||||
Config.Server.Threading.enabled = false;
|
Config.Server.Threading.enabled = false;
|
||||||
Config.Client.Media.Video.enabled = true;
|
Config.Client.Media.Video.enabled = true;
|
||||||
|
@ -33,7 +33,7 @@ describe('SharingRouter', () => {
|
|||||||
const tempDir = path.join(__dirname, '../../tmp');
|
const tempDir = path.join(__dirname, '../../tmp');
|
||||||
let server: Server;
|
let server: Server;
|
||||||
const setUp = async () => {
|
const setUp = async () => {
|
||||||
await fs.promises.rmdir(tempDir, {recursive: true});
|
await fs.promises.rm(tempDir, {recursive: true});
|
||||||
Config.Client.authenticationRequired = true;
|
Config.Client.authenticationRequired = true;
|
||||||
Config.Server.Threading.enabled = false;
|
Config.Server.Threading.enabled = false;
|
||||||
Config.Client.Sharing.enabled = true;
|
Config.Client.Sharing.enabled = true;
|
||||||
@ -49,7 +49,7 @@ describe('SharingRouter', () => {
|
|||||||
};
|
};
|
||||||
const tearDown = async () => {
|
const tearDown = async () => {
|
||||||
await SQLConnection.close();
|
await SQLConnection.close();
|
||||||
await fs.promises.rmdir(tempDir, {recursive: true});
|
await fs.promises.rm(tempDir, {recursive: true});
|
||||||
};
|
};
|
||||||
|
|
||||||
const shouldBeValidUser = (result: any, user: any) => {
|
const shouldBeValidUser = (result: any, user: any) => {
|
||||||
|
@ -34,7 +34,7 @@ describe('UserRouter', () => {
|
|||||||
const tempDir = path.join(__dirname, '../../tmp');
|
const tempDir = path.join(__dirname, '../../tmp');
|
||||||
let server: Server;
|
let server: Server;
|
||||||
const setUp = async () => {
|
const setUp = async () => {
|
||||||
await fs.promises.rmdir(tempDir, {recursive: true});
|
await fs.promises.rm(tempDir, {recursive: true});
|
||||||
Config.Server.Threading.enabled = false;
|
Config.Server.Threading.enabled = false;
|
||||||
Config.Server.Database.type = DatabaseType.sqlite;
|
Config.Server.Database.type = DatabaseType.sqlite;
|
||||||
Config.Server.Database.dbFolder = tempDir;
|
Config.Server.Database.dbFolder = tempDir;
|
||||||
@ -49,7 +49,7 @@ describe('UserRouter', () => {
|
|||||||
};
|
};
|
||||||
const tearDown = async () => {
|
const tearDown = async () => {
|
||||||
await SQLConnection.close();
|
await SQLConnection.close();
|
||||||
await fs.promises.rmdir(tempDir, {recursive: true});
|
await fs.promises.rm(tempDir, {recursive: true});
|
||||||
};
|
};
|
||||||
|
|
||||||
const checkUserResult = (result: any, user: any) => {
|
const checkUserResult = (result: any, user: any) => {
|
||||||
|
@ -16,7 +16,7 @@ describe('SettingsRouter', () => {
|
|||||||
|
|
||||||
const tempDir = path.join(__dirname, '../../tmp');
|
const tempDir = path.join(__dirname, '../../tmp');
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
await fs.promises.rmdir(tempDir, {recursive: true});
|
await fs.promises.rm(tempDir, {recursive: true});
|
||||||
Config.Server.Threading.enabled = false;
|
Config.Server.Threading.enabled = false;
|
||||||
Config.Server.Database.type = DatabaseType.sqlite;
|
Config.Server.Database.type = DatabaseType.sqlite;
|
||||||
Config.Server.Database.dbFolder = tempDir;
|
Config.Server.Database.dbFolder = tempDir;
|
||||||
@ -26,7 +26,7 @@ describe('SettingsRouter', () => {
|
|||||||
|
|
||||||
afterEach(async () => {
|
afterEach(async () => {
|
||||||
await SQLConnection.close();
|
await SQLConnection.close();
|
||||||
await fs.promises.rmdir(tempDir, {recursive: true});
|
await fs.promises.rm(tempDir, {recursive: true});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('/GET settings', () => {
|
describe('/GET settings', () => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user