Change web applications location policy

This commit is contained in:
tituspijean 2022-03-05 12:10:54 +01:00
parent c0b225941f
commit f8fc3d926a
No known key found for this signature in database
GPG key ID: EF3B0D7CC0A94720

View file

@ -826,9 +826,11 @@ class App(TestSuite):
@test() @test()
def bad_final_path_location(self): def bad_final_path_location(self):
if os.system(f"grep -q -nr 'ynh_webpath_register' {self.path}/scripts/install 2>/dev/null") == 0 \ if os.system(f"grep -q -nr 'ynh_webpath_register' {self.path}/scripts/install 2>/dev/null") == 0 \
and os.system(f"grep -q -nr 'final_path=/opt' {self.path}/scripts/install {self.path}/scripts/_common.sh 2>/dev/null") == 0: and ( os.system(f"grep -q -nr 'final_path=/opt' {self.path}/scripts/install {self.path}/scripts/_common.sh 2>/dev/null") == 0 \
yield Info("Web applications are not supposed to be installed in /opt/ ... They are supposed to be installed in /var/www/$app :/") and os.system(f"grep -q -nr 'proxy_pass' {self.path}/conf/*nginx.conf 2>/dev/null") != 0 ) \
or os.system(f"grep -q -nr 'final_path=/var/www' {self.path}/scripts/install {self.path}/scripts/_common.sh 2>/dev/null") == 0 :
yield Info("Web applications relying on NGINX to serve static or PHP files should go in /var/www/$app, while \
web applications relying on their own web server proxied by NGINX should go in /opt/yunohost/$app.")
@test() @test()
def app_data_in_unofficial_dir(self): def app_data_in_unofficial_dir(self):