Fix package installation

This commit is contained in:
Omar Brikaa 2024-09-06 20:38:00 +03:00
parent 409f7a1318
commit 9a4ea72043
3 changed files with 6 additions and 2 deletions

View File

@ -239,7 +239,6 @@ router.post('/execute', async (req, res) => {
try {
job = await get_job(req.body);
} catch (error) {
logger.error({ error });
return res.status(400).json(error);
}
try {

View File

@ -9,4 +9,5 @@ mkdir init && \
echo 1 > init/cgroup.procs && \
echo '+cpuset +memory' > cgroup.subtree_control && \
echo "Initialized cgroup" && \
chown -R piston:piston /piston && \
exec su -- piston -c 'ulimit -n 65536 && node /piston_api/src'

View File

@ -145,7 +145,11 @@ class Package {
await fs.write_file(path.join(this.install_path, '.env'), filtered_env);
logger.debug('Changing Ownership of package directory');
await util.promisify(chownr)(this.install_path, 0, 0);
await util.promisify(chownr)(
this.install_path,
process.getuid(),
process.getgid()
);
logger.debug('Writing installed state to disk');
await fs.write_file(