Islandora-Devops/isle-site-template

Generate Secrets script throwing errors on Debian

Closed this issue · 2 comments

On Debian 11 (bullseye), running generate-secrets.sh creates the secrets OK, then asks for a sudo password and outputs this:

chcon: can't apply partial context to unlabeled file 'DRUPAL_DEFAULT_DB_PASSWORD'
chcon: can't apply partial context to unlabeled file 'JWT_ADMIN_TOKEN'
chcon: can't apply partial context to unlabeled file 'MATOMO_DB_PASSWORD'
chcon: can't apply partial context to unlabeled file '.gitignore'
chcon: can't apply partial context to unlabeled file 'JWT_PRIVATE_KEY'
chcon: can't apply partial context to unlabeled file 'DB_ROOT_PASSWORD'
chcon: can't apply partial context to unlabeled file 'DRUPAL_DEFAULT_SALT'
chcon: can't apply partial context to unlabeled file 'ACTIVEMQ_WEB_ADMIN_PASSWORD'
chcon: can't apply partial context to unlabeled file 'JWT_PUBLIC_KEY'
chcon: can't apply partial context to unlabeled file 'DRUPAL_DEFAULT_ACCOUNT_PASSWORD'
chcon: can't apply partial context to unlabeled file 'ACTIVEMQ_PASSWORD'
chcon: can't apply partial context to unlabeled file 'MATOMO_USER_PASS'
chcon: can't apply partial context to unlabeled file 'FCREPO_DB_PASSWORD'
chcon: can't apply partial context to unlabeled file '/path/to/secrets'

I've done a bit more digging and it looks like I don't have SELinux enabled, but I do have chcon. I suspect this if statement (https://github.com/Islandora-Devops/isle-site-template/blob/main/generate-secrets.sh#L65) is causing it to run chcon when it shouldn't be.

Fixed by commit: 720e250