1
0
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:
Patrik J. Braun 2022-01-14 16:27:08 +01:00
parent e607ae810a
commit b72788456b
17 changed files with 27660 additions and 60 deletions

View File

@ -17,7 +17,7 @@ jobs:
strategy:
matrix:
node-version: [12.x, 13.x, 14.x]
node-version: [14.x, 15.x, 16.x, 17.x]
services:
mariadb:
@ -77,7 +77,7 @@ jobs:
name: Setup Node.js for use with actions
uses: actions/setup-node@v2
with:
node-version: 12
node-version: 14
-
name: Install Deps
run: npm install --unsafe-perm

View File

@ -1,9 +1,9 @@
dist: xenial
language: node_js
node_js:
- '12'
- '13'
- '14'
- '16'
- '17'
env:
- PORT=35000 MYSQL_HOST='localhost' MYSQL_PASSWORD='' MYSQL_USERNAME='root' MYSQL_DATABASE='pigallery2_test'
services:

View File

@ -296,7 +296,7 @@ export class BenchmarkRunner {
private resetDB = async (): Promise<void> => {
Config.Server.Threading.enabled = false;
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.Jobs.scheduled = [];
await ObjectManagers.InitSQLManagers();

View File

@ -1,6 +1,6 @@
#-----------------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/ \
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
@ -14,7 +14,7 @@ RUN mkdir -p /app/data/config && \
#-----------------MAIN--------------------
#-----------------------------------------
FROM node:14-alpine3.13 AS main
FROM node:16-alpine3.15 AS main
WORKDIR /app
ENV NODE_ENV=production \
# overrides only the default value of the settings (the actualy value can be overwritten through config.json)

View File

@ -1,6 +1,6 @@
#-----------------BUILDER-----------------
#-----------------------------------------
FROM node:14-buster AS builder
FROM node:16-buster AS builder
COPY pigallery2-release /app
WORKDIR /app
RUN npm install --unsafe-perm
@ -12,7 +12,7 @@ RUN mkdir -p /app/data/config && \
#-----------------MAIN--------------------
#-----------------------------------------
FROM node:14-buster-slim AS main
FROM node:16-buster-slim AS main
WORKDIR /app
ENV NODE_ENV=production \
# overrides only the default value of the settings (the actualy value can be overwritten through config.json)

View File

@ -1,6 +1,6 @@
#-----------------BUILDER-----------------
#-----------------------------------------
FROM node:14-stretch AS builder
FROM node:16-stretch AS builder
COPY pigallery2-release /app
WORKDIR /app
RUN npm install --unsafe-perm
@ -12,7 +12,7 @@ RUN mkdir -p /app/data/config && \
#-----------------MAIN--------------------
#-----------------------------------------
FROM node:14-stretch-slim AS main
FROM node:16-stretch-slim AS main
WORKDIR /app
ENV NODE_ENV=production \
# overrides only the default value of the settings (the actualy value can be overwritten through config.json)

View File

@ -1,6 +1,6 @@
#-----------------BUILDER-----------------
#-----------------------------------------
FROM node:14-buster AS builder
FROM node:16-buster AS builder
# LABEL maintainer="Patrik J. Braun"
# copying only package{-lock}.json to make node_modules cachable
RUN git clone https://github.com/bpatrik/pigallery2.git /build
@ -16,7 +16,7 @@ RUN npm install --unsafe-perm \
#-----------------MAIN--------------------
#-----------------------------------------
FROM node:14-buster-slim AS main
FROM node:16-buster-slim AS main
WORKDIR /app
ENV NODE_ENV=production \
# overrides only the default value of the settings (the actualy value can be overwritten through config.json)

View File

@ -14,7 +14,7 @@ services:
restart: always
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
environment:
- NODE_ENV=production

27664
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -155,6 +155,6 @@
"mysql": "2.18.1"
},
"engines": {
"node": ">=12.0 <15.0"
"node": ">=14.0 <18.0"
}
}

View File

@ -57,7 +57,7 @@ export class TempFolderCleaningJob extends Job {
this.Progress.log('processing: ' + file);
this.Progress.Processed++;
if ((await fs.promises.stat(file)).isDirectory()) {
await fs.promises.rmdir(file, {recursive: true});
await fs.promises.rm(file, {recursive: true});
} else {
await fs.promises.unlink(file);
}
@ -83,7 +83,7 @@ export class TempFolderCleaningJob extends Job {
if (await this.isValidDirectory(filePath) === false) {
this.Progress.log('processing: ' + filePath);
this.Progress.Processed++;
await fs.promises.rmdir(filePath, {recursive: true});
await fs.promises.rm(filePath, {recursive: true});
} else {
this.Progress.log('skipping: ' + filePath);
this.Progress.Skipped++;

View File

@ -171,7 +171,7 @@ export class DBTestHelper {
Config.Server.Database.dbFolder = this.tempDir;
ProjectPath.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();
}
@ -180,7 +180,7 @@ export class DBTestHelper {
Config.Server.Database.dbFolder = this.tempDir;
ProjectPath.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> {

View File

@ -24,7 +24,7 @@ describe('Typeorm integration', () => {
const tempDir = path.join(__dirname, '../../tmp');
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.dbFolder = tempDir;
@ -34,7 +34,7 @@ describe('Typeorm integration', () => {
const teardownUpSqlDB = async () => {
await SQLConnection.close();
await fs.promises.rmdir(tempDir, {recursive: true});
await fs.promises.rm(tempDir, {recursive: true});
};
beforeEach(async () => {

View File

@ -29,7 +29,7 @@ describe('GalleryRouter', (sqlHelper: DBTestHelper) => {
let server: Server;
const setUp = async () => {
await sqlHelper.initDB();
await fs.promises.rmdir(tempDir, {recursive: true});
await fs.promises.rm(tempDir, {recursive: true});
Config.Client.authenticationRequired = false;
Config.Server.Threading.enabled = false;
Config.Client.Media.Video.enabled = true;

View File

@ -33,7 +33,7 @@ describe('SharingRouter', () => {
const tempDir = path.join(__dirname, '../../tmp');
let server: Server;
const setUp = async () => {
await fs.promises.rmdir(tempDir, {recursive: true});
await fs.promises.rm(tempDir, {recursive: true});
Config.Client.authenticationRequired = true;
Config.Server.Threading.enabled = false;
Config.Client.Sharing.enabled = true;
@ -49,7 +49,7 @@ describe('SharingRouter', () => {
};
const tearDown = async () => {
await SQLConnection.close();
await fs.promises.rmdir(tempDir, {recursive: true});
await fs.promises.rm(tempDir, {recursive: true});
};
const shouldBeValidUser = (result: any, user: any) => {

View File

@ -34,7 +34,7 @@ describe('UserRouter', () => {
const tempDir = path.join(__dirname, '../../tmp');
let server: Server;
const setUp = async () => {
await fs.promises.rmdir(tempDir, {recursive: true});
await fs.promises.rm(tempDir, {recursive: true});
Config.Server.Threading.enabled = false;
Config.Server.Database.type = DatabaseType.sqlite;
Config.Server.Database.dbFolder = tempDir;
@ -49,7 +49,7 @@ describe('UserRouter', () => {
};
const tearDown = async () => {
await SQLConnection.close();
await fs.promises.rmdir(tempDir, {recursive: true});
await fs.promises.rm(tempDir, {recursive: true});
};
const checkUserResult = (result: any, user: any) => {

View File

@ -16,7 +16,7 @@ describe('SettingsRouter', () => {
const tempDir = path.join(__dirname, '../../tmp');
beforeEach(async () => {
await fs.promises.rmdir(tempDir, {recursive: true});
await fs.promises.rm(tempDir, {recursive: true});
Config.Server.Threading.enabled = false;
Config.Server.Database.type = DatabaseType.sqlite;
Config.Server.Database.dbFolder = tempDir;
@ -26,7 +26,7 @@ describe('SettingsRouter', () => {
afterEach(async () => {
await SQLConnection.close();
await fs.promises.rmdir(tempDir, {recursive: true});
await fs.promises.rm(tempDir, {recursive: true});
});
describe('/GET settings', () => {