Skip to content

Commit

Permalink
Merge pull request #45 from YunoHost/warn_about_add_header
Browse files Browse the repository at this point in the history
Warn about the use of add_header in nginx conf
  • Loading branch information
alexAubin committed Feb 13, 2019
2 parents daee832 + 8a5083e commit f8bbccd
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions package_linter.py
Expand Up @@ -122,6 +122,11 @@ def check_files_exist(app_path):
if file_exists(app_path + "/conf/php-fpm.ini"):
print_warning("Using a separate php-fpm.ini file is deprecated. Please merge your php-fpm directives directly in the pool file. (c.f. https://github.com/YunoHost-Apps/nextcloud_ynh/issues/138 )")

for filename in os.listdir(app_path + "/conf"):
content = read_file_raw(app_path + "/conf/" + filename)
if "location" in content and "add_header" in content:
print_warning("Do not use 'add_header' in the nginx conf. Use 'more_set_headers' instead. (See https://www.peterbe.com/plog/be-very-careful-with-your-add_header-in-nginx and https://github.com/openresty/headers-more-nginx-module#more_set_headers )")


def check_source_management(app_path):
print_header("SOURCES MANAGEMENT")
Expand Down

4 comments on commit f8bbccd

@yalh76
Copy link
Contributor

@yalh76 yalh76 commented on f8bbccd Feb 13, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit make me an issue with rainloop_ynh.
In the rainloop_ynh package there is a folder in the conf folder. maybe it's not the only package with that.
And the script parse all conf folder content thinking that there are only files....

Old package_linter:
old

New package_linter:
new

@alexAubin
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ugh yea, sorry about that, didnt realize that might happen :P

Should be fixed now, thanks for finding and reporting the issue !

@yalh76
Copy link
Contributor

@yalh76 yalh76 commented on f8bbccd Feb 13, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, working perfectly ^^
So quick...

@alexAubin
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So quick...

I'm always quick when I have a good reason to procrastinate from my actual work 😅

Please sign in to comment.