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

Allow to set path to INI file in the WSGI script #5987

Merged
merged 1 commit into from
May 4, 2021
Merged

Conversation

amercader
Copy link
Member

The wsgi script that we include as example to be used with uwsgi or gunicorn expects a ckan.ini file in the same folder. This adds support for the CKAN_INI env var which is already supported when running the CLI.

Features:

  • includes bugfix for possible backport

The wsgi script that we include as example to be used with uwsgi or
gunicorn expects a `ckan.ini` file in the same folder. This adds support
for the `CKAN_INI` env var which is already supported when running the
CLI.
@kowh-ai
Copy link
Contributor

kowh-ai commented Mar 26, 2021

@amercader - This change seems to work OK when I run /usr/lib/ckan/default/bin/uwsgi -i /etc/ckan/default/ckan-uwsgi.ini after setting the CKAN_INI environment to "somewhere else"...and in my case /tmp/ckan.ini. However it then has a problem trying to find who.ini in /tmp which I presume is fine (and expected). I'm just wondering if the uwsgi server is started via supervisor, the CKAN_INI environment variable would need to be included (somehow) in the shell running the command...Perhaps this should be included in the documentation somewhere also

Copy link
Contributor

@kowh-ai kowh-ai left a comment

Choose a reason for hiding this comment

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

Looks good to go!

@amercader
Copy link
Member Author

Thanks @kowh-ai

However it then has a problem trying to find who.ini in /tmp which I presume is fine (and expected).

The path to who.ini is defined using %(here)s by default so you need to move the who.ini next to the ckan.ini file location or modify the path in the ini file

if the uwsgi server is started via supervisor, the CKAN_INI environment variable would need to be included

If you need to pass an env var to the supervisor process you can do so using the environment supervisor setting.

environment=CKAN_INI=/etc/ckan/ckan.ini

We can definitely add this to the deploy docs

@amercader amercader merged commit eb56819 into master May 4, 2021
@amercader amercader deleted the wsgi-file-config branch May 4, 2021 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants