Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
RunOnFluxBot committed Jan 4, 2025
1 parent 6113c85 commit b30d5f8
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
9 changes: 7 additions & 2 deletions services/fluxService.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,13 @@ function lockStreamLock() {
* @returns {Promise<object>} Message.
*/
async function fluxBackendFolder(req, res) {
const fluxBackFolder = path.join(__dirname, '../../');
const message = messageHelper.createDataMessage(fluxBackFolder);
const projectRoot = process.env.FLUXOS_PATH;

const backendDir = projectRoot
? path.join(projectRoot, 'ZelBack')
: path.join(__dirname, '../../');

const message = messageHelper.createDataMessage(backendDir);
return res.json(message);
}

Expand Down
13 changes: 10 additions & 3 deletions services/systemService.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ const serviceHelper = require('./serviceHelper');
const fifoQueue = require('./utils/fifoQueue');
const daemonServiceUtils = require('./daemonService/daemonServiceUtils');

const isArcane = Boolean(process.env.FLUXOS_PATH);

/**
* The running interval to check when syncthing was updated
*/
Expand Down Expand Up @@ -498,6 +500,8 @@ async function monitorAptCache(event) {
* @returns {Promise<void>}
*/
async function monitorSystem() {
if (isArcane) return;

try {
aptQueue.addWorker(aptRunner);
aptQueue.on('failed', monitorAptCache);
Expand All @@ -518,13 +522,12 @@ async function monitorSystem() {
}

async function mongoDBConfig() {
if (isArcane) return;

log.info('MongoDB file config verification...');
try {
const hashCurrent = hash(await fs.readFile('/etc/mongod.conf'));
// 6a6fa is latest fluxOS image config
// other 2 ar existing fluxOS config files
const vailidHashes = [
'6a6fa72bf83ee5d8f665bed2119e649366f47645',
'4646c649230b8125c7894d618313039f20d1901b',
'1b20cbacf63c4400d0bf90188615db78b9a7602e',
];
Expand Down Expand Up @@ -576,6 +579,8 @@ async function mongoDBConfig() {

// eslint-disable-next-line consistent-return
async function mongodGpgKeyVeryfity() {
if (isArcane) return true;

log.info('MongoDB GPG verification...');
try {
const { stdout, stderr, error } = await serviceHelper.runCommand('gpg', { runAsRoot: false, params: ['--no-default-keyring', '--keyring', '/usr/share/keyrings/mongodb-archive-keyring.gpg', '--list-keys'] });
Expand Down Expand Up @@ -633,6 +638,8 @@ async function restartSystemdService(service) {
}

async function enableFluxdZmq(zmqEndpoint) {
if (isArcane) return true;

if (typeof zmqEndpoint !== 'string') return false;

const fluxConfigDir = daemonServiceUtils.getFluxdDir();
Expand Down

0 comments on commit b30d5f8

Please sign in to comment.