Skip to content

Commit

Permalink
Support setting custom admin email on creation (#13)
Browse files Browse the repository at this point in the history
* Set proper permissions to directories holding authorized_keys

* More permission fixes and install sftp server

* Support setting custom admin email on creation
  • Loading branch information
akariv authored and OriHoch committed Nov 19, 2018
1 parent 7fdef76 commit 972b8df
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cca-operator/update-instance.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ import yaml;
print(yaml.load(open("'${CKAN_VALUES_FILE}'")).get("domain", ""))
' 2>/dev/null`

CKAN_ADMIN_EMAIL=`python3 -c '
import yaml;
print(yaml.load(open("'${CKAN_VALUES_FILE}'")).get("ckanAdminEmail", "admin@${INSTANCE_ID}"))
'`

WITH_SANS_SSL=`python3 -c '
import yaml;
print("1" if yaml.load(open("'${CKAN_VALUES_FILE}'")).get("withSansSSL", False) else "0")
Expand Down Expand Up @@ -145,7 +150,7 @@ else
! kubectl $KUBECTL_GLOBAL_ARGS -n "${INSTANCE_NAMESPACE}" create secret generic ckan-admin-password "--from-literal=CKAN_ADMIN_PASSWORD=${CKAN_ADMIN_PASSWORD}" && exit 1
echo y \
| kubectl $KUBECTL_GLOBAL_ARGS -n ${INSTANCE_NAMESPACE} exec -it ${CKAN_POD_NAME} -- bash -c \
"ckan-paster --plugin=ckan sysadmin -c /etc/ckan/production.ini add admin password=${CKAN_ADMIN_PASSWORD} email=admin@${INSTANCE_ID}" \
"ckan-paster --plugin=ckan sysadmin -c /etc/ckan/production.ini add admin password=${CKAN_ADMIN_PASSWORD} email=${CKAN_ADMIN_EMAIL}" \
> /dev/stderr
[ "$?" != "0" ] && exit 1
fi
Expand Down

0 comments on commit 972b8df

Please sign in to comment.