fix(striker-ui-api): consolidate config-able constants

main
Tsu-ba-me 2 years ago
parent dc6eb4a6d2
commit 408e3ba78e
  1. 35
      striker-ui-api/src/lib/consts/ENV.ts
  2. 5
      striker-ui-api/src/lib/consts/PROCESS_OWNER.ts
  3. 1
      striker-ui-api/src/lib/consts/SERVER_PORT.ts
  4. 3
      striker-ui-api/src/lib/consts/index.ts

@ -0,0 +1,35 @@
import { resolveGid, resolveUid } from '../shell';
/**
* The fallback job progress value when queuing jobs.
*
* Ignore jobs by setting this to `100`.
*
* @default 0
*/
export const DEFAULT_JOB_PROGRESS: number = Number.parseInt(
process.env.DEFAULT_JOB_PROGRESS ?? '0',
);
/**
* Port to use by the express app.
*
* @default 8080
*/
export const PORT = Number.parseInt(process.env.PORT ?? '8080');
/**
* Process user identifier. Also used to set ownership on the access daemon.
*
* @default 'striker-ui-api'
*/
export const PUID = resolveUid(process.env.PUID ?? 'striker-ui-api');
/**
* Process group identifier. Also used to set ownership on the access daemon.
*
* Defaults to the value set in process user identifier.
*
* @default PUID
*/
export const PGID = resolveGid(process.env.PGID ?? PUID);

@ -1,5 +0,0 @@
import { resolveGid, resolveUid } from '../shell';
export const PUID = resolveUid(process.env.PUID ?? 'striker-ui-api');
export const PGID = resolveGid(process.env.PGID ?? PUID);

@ -1 +0,0 @@
export const PORT = process.env.PORT ?? 8080;

@ -4,10 +4,9 @@ export { SERVER_PATHS };
export * from './AN_VARIABLE_NAME_LIST';
export * from './DELETED';
export * from './ENV';
export * from './EXIT_CODE_LIST';
export * from './LOCAL';
export * from './NODE_AND_DR_RESERVED_MEMORY_SIZE';
export * from './OS_LIST';
export * from './PROCESS_OWNER';
export * from './REG_EXP_PATTERNS';
export * from './SERVER_PORT';

Loading…
Cancel
Save