u
This commit is contained in:
@@ -15,7 +15,8 @@ COPY --from=syslibs /usr/lib/x86_64-linux-gnu/libfontconfig.so* /usr/lib/x86_64-
|
||||
COPY --from=syslibs /usr/lib/x86_64-linux-gnu/libfribidi.so* /usr/lib/x86_64-linux-gnu/
|
||||
|
||||
# Set production defaults: port 4208
|
||||
ENV NODE_ENV=production \
|
||||
ENV RUNNING_IN_DOCKER=true \
|
||||
NODE_ENV=production \
|
||||
HOST=0.0.0.0 \
|
||||
PORT=4208 \
|
||||
HTTPS_PORT=0 \
|
||||
|
||||
@@ -235,7 +235,7 @@ _none_
|
||||
- Returns: `200 { message: str }`
|
||||
#### Current user — `GET /auth/me`
|
||||
_none_
|
||||
- Returns: `200 { user: T32, googleClientId: str, schemaVersion: int }`
|
||||
- Returns: `200 { user: T32, googleClientId: str, schemaVersion: int, vhost: bool, vhostSettings: str }`
|
||||
#### Set selected company — `PUT /auth/selected-company`
|
||||
- Params: `body: { companyId: int }`
|
||||
- Returns: `200 { user: T32 }`
|
||||
|
||||
@@ -22,7 +22,9 @@ Authenticated
|
||||
"picture": "…"
|
||||
},
|
||||
"googleClientId": "…",
|
||||
"schemaVersion": 1
|
||||
"schemaVersion": 1,
|
||||
"vhost": true,
|
||||
"vhostSettings": "…"
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@ docker run -d \
|
||||
-e GOOGLE_CLIENT_ID=928121624463-m9du45ek2d5f6p9cke8qpnf89ii9no20.apps.googleusercontent.com \
|
||||
-e JWT_SECRET=dfhjkswezui32476sdjkhvbn347865 \
|
||||
-e IMPLICIT_CREATE=true \
|
||||
-e VHOST_SETTINGS="" \
|
||||
-e DB_PROVIDER=mssql \
|
||||
-e MSSQL_DATABASE=dashback \
|
||||
-e MSSQL_USER=sa \
|
||||
|
||||
@@ -12,5 +12,7 @@ export async function respondWithAuthenticatedUser(res, status, body) {
|
||||
...body,
|
||||
googleClientId: env.googleClientId,
|
||||
schemaVersion,
|
||||
vhost: env.vhost,
|
||||
vhostSettings: env.vhostSettings,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -36,6 +36,12 @@ export function register(app, basePath = '') {
|
||||
* schemaVersion:
|
||||
* type: integer
|
||||
* description: Current database schema version
|
||||
* vhost:
|
||||
* type: boolean
|
||||
* description: True when running in Docker (client may change feature set)
|
||||
* vhostSettings:
|
||||
* type: string
|
||||
* description: Pipelined settings string from VHOST_SETTINGS env
|
||||
* 401:
|
||||
* description: Unauthorized — still includes `googleClientId` and `schemaVersion` for the frontend
|
||||
* content:
|
||||
@@ -50,6 +56,12 @@ export function register(app, basePath = '') {
|
||||
* schemaVersion:
|
||||
* type: integer
|
||||
* description: Current database schema version
|
||||
* vhost:
|
||||
* type: boolean
|
||||
* description: True when running in Docker (client may change feature set)
|
||||
* vhostSettings:
|
||||
* type: string
|
||||
* description: Pipelined settings string from VHOST_SETTINGS env
|
||||
*/
|
||||
app.get(`${basePath}/auth/me`, async (req, res) => {
|
||||
try {
|
||||
|
||||
@@ -12,7 +12,12 @@ function parseHttpsPort(val) {
|
||||
return Number.isInteger(n) && n > 0 ? n : 8443;
|
||||
}
|
||||
|
||||
const isDocker = process.env.RUNNING_IN_DOCKER === 'true';
|
||||
|
||||
export default {
|
||||
isDocker,
|
||||
vhost: isDocker,
|
||||
vhostSettings: process.env.VHOST_SETTINGS || '',
|
||||
host: process.env.HOST || '127.0.0.1',
|
||||
port: Number(process.env.PORT) || 4208,
|
||||
httpsPort: parseHttpsPort(process.env.HTTPS_PORT),
|
||||
@@ -50,7 +55,7 @@ export default {
|
||||
storageDir: process.env.STORAGE_DIR || resolve(__dirname, '../../data/storage'),
|
||||
},
|
||||
backup: {
|
||||
enabled: process.env.BACKUP_ENABLED !== 'false',
|
||||
enabled: !isDocker && process.env.BACKUP_ENABLED !== 'false',
|
||||
dir: process.env.BACKUP_DIR ? resolve(process.env.BACKUP_DIR) : resolve(__dirname, '../../data/backups'),
|
||||
intervalMs: Number(process.env.BACKUP_INTERVAL_MS) || 60 * 60 * 1000,
|
||||
hourlyRetentionCount: Number(process.env.BACKUP_HOURLY_RETENTION) || 50,
|
||||
@@ -65,7 +70,7 @@ export default {
|
||||
key: process.env.REDIS_KEY || process.env.REDIS_HEALTH_KEY || 'healthcheck:latency_ms',
|
||||
},
|
||||
healthMonitor: {
|
||||
enabled: process.env.HEALTH_MONITOR_ENABLED !== 'false',
|
||||
enabled: !isDocker && process.env.HEALTH_MONITOR_ENABLED !== 'false',
|
||||
intervalMs: Number(process.env.HEALTH_MONITOR_INTERVAL_MS) || 60_000,
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user