diff --git a/api/src/index.js b/api/src/index.js index 79bca00..2870902 100644 --- a/api/src/index.js +++ b/api/src/index.js @@ -35,6 +35,7 @@ expressWs(app); } } }); + fss.chmodSync(path.join(config.data_directory, globals.data_directories.jobs), 0o711) logger.info('Loading packages'); const pkgdir = path.join( diff --git a/api/src/job.js b/api/src/job.js index d561036..2150279 100644 --- a/api/src/job.js +++ b/api/src/job.js @@ -343,6 +343,9 @@ class Job { const [_1, state, user_friendly] = state_line.split(/\s+/); const proc_id_int = parse_int(proc_id); + + // Skip over any processes that aren't ours. + if(ruid != this.uid && euid != this.uid) return -1; if (state == 'Z'){ // Zombie process, just needs to be waited, regardless of the user id @@ -353,8 +356,7 @@ class Job { } // We should kill in all other state (Sleep, Stopped & Running) - if (ruid == this.uid || euid == this.uid) - return proc_id_int; + return proc_id_int; } catch { return -1; } diff --git a/docker-compose.dev.yaml b/docker-compose.dev.yaml index 25d8fe6..8a0d385 100644 --- a/docker-compose.dev.yaml +++ b/docker-compose.dev.yaml @@ -10,11 +10,11 @@ services: ports: - 2000:2000 volumes: - - ./data/piston:/piston + - ./data/piston/packages:/piston/packages environment: - PISTON_REPO_URL=http://repo:8000/index tmpfs: - - /piston/jobs:exec + - /piston/jobs:exec,uid=1000,gid=1000,mode=711 repo: # Local testing of packages build: repo diff --git a/docker-compose.yaml b/docker-compose.yaml index 83a1383..839b340 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -8,7 +8,7 @@ services: ports: - 2000:2000 volumes: - - ./data/piston:/piston + - ./data/piston/packages:/piston/packages tmpfs: - - /piston/jobs:exec,uid=1000,gid=1000,mode=700 + - /piston/jobs:exec,uid=1000,gid=1000,mode=711 - /tmp:exec diff --git a/packages/smalltalk/3.2.3/run b/packages/smalltalk/3.2.3/run index 7553905..a1ac6fa 100644 --- a/packages/smalltalk/3.2.3/run +++ b/packages/smalltalk/3.2.3/run @@ -4,5 +4,5 @@ code_file=`pwd`/"$1" shift cd $SMALLTALK_PATH -$SMALLTALK_PATH/gst "$code_file" "$@" +$SMALLTALK_PATH/gst "$code_file" -a "$@" diff --git a/piston b/piston index fbd256d..fd83727 100755 --- a/piston +++ b/piston @@ -14,13 +14,6 @@ docker_compose(){ fi } -init_precommit() { - if [ $PISTON_ENV == "dev" ]; then - rm -f .git/hooks/pre-commit - ln -s "$PISTON_PATH/pre-commit" "$PISTON_PATH/.git/hooks/pre-commit" - fi -} - case $1 in help) echo "=== Piston Management ===" @@ -66,14 +59,12 @@ case $1 in restart) docker_compose restart ;; start) - init_precommit docker_compose up -d ;; stop) docker_compose down ;; bash) docker_compose exec api /bin/bash ;; rebuild) - init_precommit docker_compose build && docker_compose up -d ;; diff --git a/readme.md b/readme.md index a65ec87..6dc36f7 100644 --- a/readme.md +++ b/readme.md @@ -71,6 +71,7 @@ The following are approved and endorsed extensions/utilities to the core Piston - [Pyston](https://github.com/ffaanngg/pyston), a Python wrapper for accessing the Piston API. - [Go-Piston](https://github.com/milindmadhukar/go-piston), a Golang wrapper for accessing the Piston API. - [piston_rs](https://github.com/Jonxslays/piston_rs), a Rust wrapper for accessing the Piston API. +- [piston_rspy](https://github.com/Jonxslays/piston_rspy), Python bindings for accessing the Piston API via `piston_rs`.