From 775179294298fa950d749b6ad576247724516fcd Mon Sep 17 00:00:00 2001 From: pictuga Date: Fri, 24 Dec 2021 18:03:55 +0100 Subject: [PATCH] Shift htaccess to README --- README.md | 26 ++++++++++++++++++++++++-- setup.py | 1 - www/.htaccess | 15 --------------- www/cgi/.htaccess | 9 --------- 4 files changed, 24 insertions(+), 27 deletions(-) delete mode 100644 www/.htaccess delete mode 100644 www/cgi/.htaccess diff --git a/README.md b/README.md index a17cb9c..62ab30a 100644 --- a/README.md +++ b/README.md @@ -274,8 +274,30 @@ For this, you need to make sure your host allows python script execution. This method uses HTTP calls to fetch the RSS feeds, which will be handled through `mod_cgi` for example on Apache severs. -Please pay attention to `main.py` permissions for it to be executable. Also -ensure that the provided `/www/.htaccess` works well with your server. +Please pay attention to `main.py` permissions for it to be executable. See below +some tips for the `.htaccess` file. + +```htaccess +Options -Indexes + +ErrorDocument 404 /cgi/main.py + +# Turn debug on for all requests +SetEnv DEBUG 1 + +# Turn debug on for requests with :debug in the url +SetEnvIf Request_URI :debug DEBUG=1 + + + deny from all + + + + allow from all + AddHandler cgi-script .py + Options +ExecCGI + +``` ### As a CLI application diff --git a/setup.py b/setup.py index 5490aaf..b284995 100644 --- a/setup.py +++ b/setup.py @@ -30,7 +30,6 @@ setup( data_files = [ ('share/' + package_name, ['README.md', 'LICENSE']), ('share/' + package_name + '/www', glob('www/*.*')), - ('share/' + package_name + '/www/cgi', []) ], entry_points = { 'console_scripts': [package_name + '=' + package_name + '.__main__:main'] diff --git a/www/.htaccess b/www/.htaccess deleted file mode 100644 index dec4307..0000000 --- a/www/.htaccess +++ /dev/null @@ -1,15 +0,0 @@ -Options -Indexes - -ErrorDocument 403 "Access forbidden" -ErrorDocument 404 /cgi/main.py -ErrorDocument 500 "A very nasty bug found his way onto this very server" - -# Uncomment below line to turn debug on for all requests -#SetEnv DEBUG 1 - -# Uncomment below line to turn debug on for requests with :debug in the url -#SetEnvIf Request_URI :debug DEBUG=1 - - - deny from all - diff --git a/www/cgi/.htaccess b/www/cgi/.htaccess deleted file mode 100644 index b966e7d..0000000 --- a/www/cgi/.htaccess +++ /dev/null @@ -1,9 +0,0 @@ -order allow,deny - -deny from all - - - allow from all - AddHandler cgi-script .py - Options +ExecCGI -