1
0
mirror of https://github.com/bpatrik/pigallery2.git synced 2024-12-21 01:22:08 +02:00

adding config only mode

This commit is contained in:
Patrik J. Braun 2019-12-12 11:04:20 +01:00
parent 2ac0eaa57a
commit 2757af6bf0
4 changed files with 10 additions and 4 deletions

View File

@ -94,8 +94,9 @@ You can set up the app the following ways:
* Using the UI
* Manually editing the `config.json`
* Through switches
* Like: `node backend/index.js --Server-port=3000 --Client-authenticationRequired=false`
* Like: `node start -- --Server-port=3000 --Client-authenticationRequired=false`
* You can check the generated `config.json` for the config hierarchy
* Note: you can run the app to generate the config file only, by running `npm start -- --config-only`
* Through environmental variable
* like set env. variable `Server-port` to `3000`
@ -122,7 +123,7 @@ apt-get install build-essential libkrb5-dev gcc g++
```bash
npm run add-translation -- --fr
```
it creates a new `messages.fr.xls` file at `frontend/translate` folder,
it creates a new `messages.fr.xls` file at `src/frontend/translate` folder,
it will already contain dummy translation with google translate.
3. 'fix' the dummy translation
4. test if it works:

View File

@ -1,6 +1,6 @@
FROM arm32v7/node:10-stretch
LABEL maintainer="Patrik J. Braun"
# build tutorial: https://collabnix.com/building-arm-based-docker-images-on-docker-desktop-made-possible-using-buildx/
RUN git clone https://github.com/bpatrik/pigallery2.git && \
cd /pigallery2 && \

View File

@ -14,7 +14,7 @@
"build-backend": "tsc",
"pretest": "tsc",
"test": "ng test && mocha --recursive test/backend/unit && mocha --recursive test/backend/integration && mocha --recursive test/common/unit ",
"start": "node ./backend/index",
"start": "node ./src/backend/index",
"run-dev": "ng build --aot --watch --output-path=./dist --i18n-locale en --i18n-file src/frontend/translate/messages.en.xlf --i18n-missing-translation warning",
"build-stats": "ng build --aot --prod --stats-json --output-path=./dist --i18n-locale en --i18n-file src/frontend/translate/messages.en.xlf --i18n-missing-translation warning",
"merge-new-translation": "gulp merge-new-translation",

View File

@ -32,6 +32,11 @@ export class ConfigClass extends PrivateConfigDefaultsClass implements IPrivateC
['MYSQL_DATABASE', 'Server-Database-mysql-database']]);
this.removeComment();
if (process.argv.indexOf('--config-only')) {
console.log('started with \'--config-only\' flag. Saving config and exiting.');
process.exit();
}
if (Utils.enumToArray(UserRoles).map(r => r.key).indexOf(this.Client.unAuthenticatedUserRole) === -1) {
throw new Error('Unknown user role for Client.unAuthenticatedUserRole, found: ' + this.Client.unAuthenticatedUserRole);
}