Skip to content

Conversation

@azam-ismail
Copy link
Collaborator

No description provided.

@azam-ismail azam-ismail changed the base branch from master to feat/auth January 15, 2026 07:52

const adminLogger = createLogger('Admin');

export const createAdminRouter = (): express.Router => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

those endpoints can be called by smartflows, can we make separate http server for it? We need to consider additional security layer here so no one can randomly stop instance

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

});

// Perform graceful shutdown after response is sent
setTimeout(() => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really dislike this setTimeout. Can you send SIGTERM and add event handler on it?

};
};

const getOperatorInfo = async (timeoutMs: number = 5000): Promise<OperatorInfo | undefined> => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move it to different place and export as public method

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

docs/env-vars.md Outdated
| `LOCAL_SOLUTIONS_PATH` | Path to locally hosted NodeRed solution flow files to be used when installing solutions using "local" prefix within WorkLogic field. | `string` | |
| `SS58_FORMAT` | SS58 Key Format. | `number` (_>0_) | `42` |
| `PRETTY_PRINT` | Should pretty print logs. If you plan to use Grafana or any other log tooling it's recommended to set it to false. | `'true' \| 'false'` | `'false'` |
| `LOG_FILE_PATH` | Full path to log file (e.g., /var/log/app.log or ./logs/app.log) | `string` | |
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If value is not provided it means that log file transport is disabled

};
};

const getOperatorInfo = async (timeoutMs: number = 5000): Promise<OperatorInfo | undefined> => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of undefined please use null, it's more explicit

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

return {
id: solution.solutionId,
name,
status: 'Active', // Assume active if installed
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use enum

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

solutionGroups,
};
} catch {
return undefined;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

at least print error so we know what is going on

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

export const getAllInstalledSolutionsWithGroups = async (): Promise<InstalledSolutionDetails[]> => {
const tabNodes = await getTabNodes();

const solutions: Array<InstalledSolutionDetails | null> = await Promise.all(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why you need Promise.all ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

return logPath;
};

const ensureLogDir = (logPath: string): void => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ensureLogDirExists

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

@@ -0,0 +1,46 @@
import express from 'express';
import { createLogger } from '../util/logger';
import { getIsShuttingDown } from '../shutdown';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you create a middleware that will not accept new requests?

It can be even applied to submit vote endpoint so we don't accept new votes in case

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

@azam-ismail azam-ismail requested a review from hejkerooo January 19, 2026 07:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants