Skip to content

Instantly share code, notes, and snippets.

@rkasigi
Last active April 16, 2020 05:27
Show Gist options
  • Save rkasigi/8dd5382e4cb6f4af520507941243ae69 to your computer and use it in GitHub Desktop.
Save rkasigi/8dd5382e4cb6f4af520507941243ae69 to your computer and use it in GitHub Desktop.
Dokku Hack for Centos 7.x

Dokku ACL Plugin troubleshoot and configuration

Dokku Acl Config

config file at /home/dokku/.dokkurc/acl

export DOKKU_SUPER_USER=root
export DOKKU_ACL_USER_COMMANDS="help version mariadb:connect"
export DOKKU_ACL_PER_APP_COMMANDS="logs urls enter ps:rebuild ps:restart ps:stop ps:start git-upload-pack git-upload-archive config config:set git-receive-pack git-hook storage:list"

Dokku run using dokku acl

always add -t command on ssh commandline. for example

ssh -t dokku@dokku.me -p 22 logs appname

Failed git push with dokku acl plugin on Centos 7

when do git push. It always failed, even after we add the permission. maybe this is dirty hack. edit file /var/lib/dokku/plugins/available/acl/user-auth

find the code

...
SSH_USER=$1
SSH_NAME=$2
shift 2
...

after above code, add the code:

set -- "$1" $(echo $2 | sed "s/^'\(.*\)'$/\1/")
set -- "$1" $(echo $2 | sed "s/^\/\(.*\)/\1/")

dokku user can not execute command

There is a momment on centos 7, while user dokku can not execute dokku command. For example, we want to run command dokku apps:list then it will produce:

User default does not have permissions to run apps:list
Access denied

to resolve this issue is add environment variable NAME add the line below at file ~dokku/.bashrc

export NAME=$USER

Dokku troubleshoot list

the error from dokku issue #3841

got an error below when running any dokku command:

/tmp/bashenv.563765662: line 51: syntax error near unexpected token `('
/tmp/bashenv.563765662: line 51: `export BASH_FUNC_module()=$'() {  eval `/usr/bin/modulecmd bash $*`'
/root/.basher/bash: main: command not found
Access denied

how to solve the issue:

Option 1: run the command below, evertime before run dokku command

unset `env | sed -n 's/^BASH_FUNC_\([a-z]*\)()=.*/\1/p'`

Option 2: remove file /usr/share/Modules/init/bash or rename it to another file name

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment