diff --git a/api/src/api/v2.js b/api/src/api/v2.js index b454272..f8e2b57 100644 --- a/api/src/api/v2.js +++ b/api/src/api/v2.js @@ -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 { diff --git a/api/src/docker-entrypoint.sh b/api/src/docker-entrypoint.sh index 8f32986..7cf37e3 100755 --- a/api/src/docker-entrypoint.sh +++ b/api/src/docker-entrypoint.sh @@ -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' diff --git a/api/src/package.js b/api/src/package.js index 11e4f34..8edb008 100644 --- a/api/src/package.js +++ b/api/src/package.js @@ -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(