Atheos / Atheos

A self-hosted browser-based cloud IDE, updated from Codiad IDE
https://www.atheos.io/
492 stars 76 forks source link

Deleting a project does not delete the workspace subdirectory #126

Closed ScrumpyJack closed 3 years ago

ScrumpyJack commented 4 years ago

Deleting a Project using the Project UI does not delete the workspace subdirectory, and results in:

2020/09/07 16:53:42 [error] 12012#12012: *1210 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught ErrorException: Undefined variable: projectName in /var/www/Atheos-4.3.0/components/project/class.project.php:110
Stack trace:
#0 /var/www/Atheos-4.3.0/components/project/class.project.php(110): {closure}(8, 'Undefined varia...', '/var/www/Atheos...', 110, Array)
#1 /var/www/Atheos-4.3.0/components/project/controller.php(60): Project->delete('MyProject')
#2 /var/www/Atheos-4.3.0/controller.php(44): require('/var/www/Atheos...')
#3 {main}
  thrown in /var/www/Atheos-4.3.0/components/project/class.project.php on line 110" while reading response header from upstream, client: XXX.XXX.XXX.XXX, server: XXXXXXXX.com, request: "POST /controller.php HTTP/1.1", upstream: "fastcgi://unix:/run/php7-fpm.sock:", host: "XXXXXXXX.com

The project does however get deleted from "data/projects.json"

php7-7.4.9 Atheos 4.3 nginx with fastcgi over a unix socket.

HLSiira commented 4 years ago

Currently, when deleting the project, it does not delete the actual files on the server. The implementation for this was a mild mess in the original Codiad and I removed it all in order to readd it later and it's been on my list for quite a while now.

The error message is interesting though and I'll look into it today and I'll implement the server file deletion as well since it shouldn't be too difficult.