ckan-docker icon indicating copy to clipboard operation
ckan-docker copied to clipboard

create sysadmin account from user-provided values

Open wardi opened this issue 1 year ago • 5 comments

Have users enter sysadmin name/password/email values in the .env file

wardi avatar Apr 29 '24 19:04 wardi

What about PR #76?

EricSoroos avatar Apr 30 '24 07:04 EricSoroos

@kowh-ai I've removed the feature instead and updated the README with instructions for creating a sysadmin account.

wardi avatar May 21 '24 19:05 wardi

@wardi - I’m having problems getting this PR to work on a fresh ckan-docker 2.10.4 environment

When docker compose builds the CKAN service container it runs the (CMD) start_ckan.sh script (which calls prerun.py which does not create the ckan_admin user as all 3 environment variables (CKAN_SYSADMIN_NAME, CKAN_SYSADMIN_PASSWORD and CKAN_SYSADMIN_EMAIL) are not set. When execution returns to start_ckan.sh the /docker-entrypoint.d/01_setup_datapusher.sh is called next which tries to set the ckan.datapusher.api_token using the ckan_admin user (who does not exist, so fails). This causes the CKAN container to fail as the ckan.datapusher.api_token is not set

I’m scratching my head as to how you got this PR to work?

I guess we will need to come up with a way of setting a value for ckan.datapusher.api_token in the CKAN config file without having to resort to using a hard-coded admin username

kowh-ai avatar May 29 '24 09:05 kowh-ai

@kowh-ai I'm generally not using datapusher, and when I do I've been copying a token into the .env manually.

datapusher could use a token generated against the site user instead of admin user, right? That might let us automatically generate the token without requiring a known sysadmin account name.

wardi avatar Jul 10 '24 18:07 wardi

@wardi - ah yes OK. This whole "needing a token before services are ready" has been one of the main issues affecting users in the last year or so. We need some sort of "seed" value that can be used as a token just to get the services to start but will need to change to a proper token (somehow) at some later stage...

kowh-ai avatar Jul 19 '24 12:07 kowh-ai