-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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 custom script execution on installation #1260
Conversation
prevents volumes from being mounted executable
one could e.g. do #!/bin/sh
occ() {
php /var/www/html/occ $@
}
# loginname, display name, email, password
createuser() {
export OC_PASS="$4"
occ user:add --password-from-env --display-name="$2" "$1"
unset OC_PASS
occ user:setting "$1" email "$3"
}
for app in contacts calendar; do
occ app:install -n $app
done
createuser user1 "User 1" "user@domain.com" "secrets-mounted-as-docker-or-k8s-secret" mount this to |
@@ -168,6 +168,10 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP | |||
NC_TRUSTED_DOMAIN_IDX=$(($NC_TRUSTED_DOMAIN_IDX+1)) | |||
done | |||
fi | |||
|
|||
if [ -n "${NEXTCLOUD_CUSTOM_INSTALL_SCRIPT+x}" ]; then | |||
run_as "/bin/sh ${NEXTCLOUD_CUSTOM_INSTALL_SCRIPT}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine with this but are there any common use cases where you don't want to run_as
limited user?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only use case I see may be adding distrib packages, but I think that building a custom image is better here.
@mgerhardy would you like to rebase this? |
Hi, Any news @mgerhardy ? |
Hi, @mgerhardy, do you need any help ? Thank ! ;) |
See #1683 |
Should fix issues
This allows a custom script to be mounted as docker or kubernetes volume to be executed. This can be used to execute all kind of occ commands.
Alternative and more customizable to the PR #1259