Update ENV handling
This commit is contained in:
parent
748551a353
commit
2588356ab8
|
@ -45,6 +45,7 @@ class FD {
|
|||
this.env = {
|
||||
DISPLAY: display
|
||||
};
|
||||
this.log.info(`Using DISPLAY=${display} for fd`);
|
||||
}
|
||||
this.shell = new shell_1.Shell([
|
||||
this.bin,
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -82,6 +82,13 @@ async function createTemplate(filePath) {
|
|||
async function settings() {
|
||||
let sequencesExists = false;
|
||||
let videosExists = false;
|
||||
if ((0, env_1.envString)('FFMPEG', null) === null) {
|
||||
log.error('Please include an FFMPEG value containing the path to your ffmpeg binary in .env');
|
||||
process.exit(1);
|
||||
}
|
||||
else {
|
||||
log.info(`FFMPEG=${process.env['FFMPEG']}`);
|
||||
}
|
||||
if ((0, env_1.envString)('FD', null) === null) {
|
||||
log.error('Please include an FD value containing the path to your fd binary in .env');
|
||||
process.exit(1);
|
||||
|
@ -89,12 +96,22 @@ async function settings() {
|
|||
else {
|
||||
log.info(`FD=${process.env['FD']}`);
|
||||
}
|
||||
if ((0, env_1.envString)('FFMPEG', null) === null) {
|
||||
log.error('Please include an FFMPEG value containing the path to your ffmpeg binary in .env');
|
||||
process.exit(1);
|
||||
if ((0, env_1.envString)('FD_DISPLAY', null) !== null) {
|
||||
log.info(`FD_DISPLAY=${(0, env_1.envString)('FD_DISPLAY', null)}`);
|
||||
}
|
||||
if ((0, env_1.envString)('FD_HOST', null) === null) {
|
||||
log.error('Please include a FD_HOST value with the host that the fd socket server is hosted on in .env');
|
||||
process.exit(4);
|
||||
}
|
||||
else {
|
||||
log.info(`FFMPEG=${process.env['FFMPEG']}`);
|
||||
log.info(`FD_HOST=${process.env['FD_HOST']}`);
|
||||
}
|
||||
if ((0, env_1.envInt)('FD_PORT', null) === null) {
|
||||
log.error('Please include a FD_PORT value with the port that the fd socket server is hosted on in .env');
|
||||
process.exit(5);
|
||||
}
|
||||
else {
|
||||
log.info(`FD_PORT=${process.env['FD_PORT']}`);
|
||||
}
|
||||
if ((0, env_1.envInt)('WIDTH', null) === null) {
|
||||
log.error('Please include a WIDTH value containing the width of the screen you are using in .env');
|
||||
|
@ -112,20 +129,6 @@ async function settings() {
|
|||
height = (0, env_1.envInt)('HEIGHT', 0);
|
||||
log.info(`HEIGHT=${height}`);
|
||||
}
|
||||
if ((0, env_1.envString)('FD_HOST', null) === null) {
|
||||
log.error('Please include a FD_HOST value with the host that the fd socket server is hosted on in .env');
|
||||
process.exit(4);
|
||||
}
|
||||
else {
|
||||
log.info(`FD_HOST=${process.env['FD_HOST']}`);
|
||||
}
|
||||
if ((0, env_1.envInt)('FD_PORT', null) === null) {
|
||||
log.error('Please include a FD_PORT value with the port that the fd socket server is hosted on in .env');
|
||||
process.exit(5);
|
||||
}
|
||||
else {
|
||||
log.info(`FD_PORT=${process.env['FD_PORT']}`);
|
||||
}
|
||||
if ((0, env_1.envInt)('PORT', null) === null) {
|
||||
log.error('Please include a PORT value with the port that the HTTP web process is hosted on in .env');
|
||||
process.exit(6);
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -79,6 +79,7 @@ export class FD {
|
|||
this.env = {
|
||||
DISPLAY : display
|
||||
}
|
||||
this.log.info(`Using DISPLAY=${display} for fd`);
|
||||
}
|
||||
this.shell = new Shell([
|
||||
this.bin,
|
||||
|
|
36
src/index.ts
36
src/index.ts
|
@ -78,17 +78,32 @@ async function createTemplate (filePath : string) : Promise<HandlebarsTemplateDe
|
|||
async function settings () {
|
||||
let sequencesExists : boolean = false;
|
||||
let videosExists : boolean = false;
|
||||
if (envString('FFMPEG', null) === null) {
|
||||
log.error('Please include an FFMPEG value containing the path to your ffmpeg binary in .env');
|
||||
process.exit(1);
|
||||
} else {
|
||||
log.info(`FFMPEG=${process.env['FFMPEG']}`);
|
||||
}
|
||||
if (envString('FD', null) === null) {
|
||||
log.error('Please include an FD value containing the path to your fd binary in .env');
|
||||
process.exit(1);
|
||||
} else {
|
||||
log.info(`FD=${process.env['FD']}`);
|
||||
}
|
||||
if (envString('FFMPEG', null) === null) {
|
||||
log.error('Please include an FFMPEG value containing the path to your ffmpeg binary in .env');
|
||||
process.exit(1);
|
||||
if (envString('FD_DISPLAY', null) !== null) {
|
||||
log.info(`FD_DISPLAY=${envString('FD_DISPLAY', null)}`);
|
||||
}
|
||||
if (envString('FD_HOST', null) === null) {
|
||||
log.error('Please include a FD_HOST value with the host that the fd socket server is hosted on in .env');
|
||||
process.exit(4);
|
||||
} else {
|
||||
log.info(`FFMPEG=${process.env['FFMPEG']}`);
|
||||
log.info(`FD_HOST=${process.env['FD_HOST']}`);
|
||||
}
|
||||
if (envInt('FD_PORT', null) === null) {
|
||||
log.error('Please include a FD_PORT value with the port that the fd socket server is hosted on in .env')
|
||||
process.exit(5);
|
||||
} else {
|
||||
log.info(`FD_PORT=${process.env['FD_PORT']}`);
|
||||
}
|
||||
if (envInt('WIDTH', null) === null) {
|
||||
log.error('Please include a WIDTH value containing the width of the screen you are using in .env');
|
||||
|
@ -104,18 +119,6 @@ async function settings () {
|
|||
height = envInt('HEIGHT', 0);
|
||||
log.info(`HEIGHT=${height}`);
|
||||
}
|
||||
if (envString('FD_HOST', null) === null) {
|
||||
log.error('Please include a FD_HOST value with the host that the fd socket server is hosted on in .env');
|
||||
process.exit(4);
|
||||
} else {
|
||||
log.info(`FD_HOST=${process.env['FD_HOST']}`);
|
||||
}
|
||||
if (envInt('FD_PORT', null) === null) {
|
||||
log.error('Please include a FD_PORT value with the port that the fd socket server is hosted on in .env')
|
||||
process.exit(5);
|
||||
} else {
|
||||
log.info(`FD_PORT=${process.env['FD_PORT']}`);
|
||||
}
|
||||
if (envInt('PORT', null) === null) {
|
||||
log.error('Please include a PORT value with the port that the HTTP web process is hosted on in .env');
|
||||
process.exit(6);
|
||||
|
@ -167,6 +170,7 @@ async function settings () {
|
|||
mock = false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function onWssConnection (ws : WebSocketExtended, req : Request) {
|
||||
|
|
Loading…
Reference in New Issue