From f8fc3d926a93084e5506f9e3777aa6784e8284b7 Mon Sep 17 00:00:00 2001 From: tituspijean Date: Sat, 5 Mar 2022 12:10:54 +0100 Subject: [PATCH] Change web applications location policy --- package_linter.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/package_linter.py b/package_linter.py index 6dc8aee..f44babf 100755 --- a/package_linter.py +++ b/package_linter.py @@ -826,9 +826,11 @@ class App(TestSuite): @test() def bad_final_path_location(self): 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: - 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 'final_path=/opt' {self.path}/scripts/install {self.path}/scripts/_common.sh 2>/dev/null") == 0 \ + 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() def app_data_in_unofficial_dir(self):