Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Environment Variable to specify configuration location for use in WGSI servers #61

Open
jdunn0 opened this issue Feb 7, 2023 · 1 comment
Labels
enhancement New feature or request someday Not planned to do in the near future, mostly due to limited resources

Comments

@jdunn0
Copy link

jdunn0 commented Feb 7, 2023

I was thinking of using mod_wsgi to host PyWebScrapBook via my Apache server but the only way to configure scripts in mod_wsgi is by using Environment Variables.

From looking at the documentation for PyWebScrapBook, it appears that the only places it supports for a configuration location is the script directory, the working directory or the user's home directory.

For security reasons, the script location and web server user home directory will usually only allow write access for the root user.
As for the working directory, as the mod_wsgi documentation on the working directory, says "When Apache is started it is typically run such that the current working directory for the application is the root directory, although the actual directory may vary dependent on the system or any extra security system in place." thus using the working directory is not a reliable way to specify a configuration location.

So it appears the best way of getting a configuration location when using a WSGI server like mod_wsgi would be allow setting the configuration location via an Environment Variable.

@danny0838
Copy link
Owner

I'm not quite familiar with mod_wsgi, but the config path is usually determined by the path of the WSGI script. Otherwise you should be able to configure it through the config file or environment variable of Apache.

You can also setup a reverse proxy for the PyWSB app, which is a popular way to setup web services.

@danny0838 danny0838 added the enhancement New feature or request label Feb 10, 2023
@danny0838 danny0838 added the someday Not planned to do in the near future, mostly due to limited resources label Mar 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request someday Not planned to do in the near future, mostly due to limited resources
Projects
None yet
Development

No branches or pull requests

2 participants