Skip to content

Commit

Permalink
Fix package installation
Browse files Browse the repository at this point in the history
  • Loading branch information
Brikaa committed Sep 6, 2024
1 parent 409f7a1 commit 9a4ea72
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
1 change: 0 additions & 1 deletion api/src/api/v2.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
1 change: 1 addition & 0 deletions api/src/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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'
6 changes: 5 additions & 1 deletion api/src/package.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 9a4ea72

Please sign in to comment.