Skip to content
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

[bitnami/mediawiki] Upgrade mediawiki helm package 20.0.2 and having a file permission denied issue #25374

Closed
iain-ilearner opened this issue Apr 24, 2024 · 5 comments
Assignees
Labels
mediawiki solved tech-issues The user has a technical issue about an application

Comments

@iain-ilearner
Copy link

iain-ilearner commented Apr 24, 2024

Name and Version

bitnami/mediawiki 20.0.2

What architecture are you using?

amd64

What steps will reproduce the bug?

There seems to be an equivalent issue for mediawiki that affected wordpress in issue #24590

helm upgrade wiki oci://registry-1.docker.io/bitnamicharts/mediawiki 

Are you using any custom parameters or values?

values.yaml:

    extraVolumes:
      - name: custom-htaccess
        configMap:
          name: wiki-htaccess-configmap
          items:
            - key: mediawiki-htaccess.conf
              path: mediawiki-htaccess.conf

What do you see instead?

cp: cannot create regular file '/opt/bitnami/apache/conf/./vhosts/00_status-vhost.conf': Permission denied
cp: cannot create regular file '/opt/bitnami/apache/conf/./vhosts/mediawiki-https-vhost.conf': Permission denied
cp: cannot create regular file '/opt/bitnami/apache/conf/./vhosts/mediawiki-vhost.conf': Permission denied
@iain-ilearner iain-ilearner added the tech-issues The user has a technical issue about an application label Apr 24, 2024
@github-actions github-actions bot added the triage Triage is needed label Apr 24, 2024
@github-actions github-actions bot assigned juan131 and unassigned carrodher Apr 25, 2024
@github-actions github-actions bot removed the triage Triage is needed label Apr 25, 2024
@juan131
Copy link
Contributor

juan131 commented Apr 29, 2024

Hi @iain-ilearner

As you can see in the link below, new major version of the Mediawiki chart includes some security enhancements:

The new security defaults for Mediawiki containers set restrictive rules such as using read-only filesystems. This is a great feature to prevent a series of attacks but it also sets some challenges for the application to work on such a restrictive environment.

Could you please share the extraVolumeMounts section you're using? It's very likely that you're overwriting volume mount below that it's required for providing to Bitnami Mediawiki initializations scripts capabilities to write in the /opt/bitnami/apache/conf directory.

@iain-ilearner
Copy link
Author

iain-ilearner commented Apr 29, 2024

Could you please share the extraVolumeMounts section you're using?

Sure thing, it's here:

extraVolumeMounts:
  - mountPath: /opt/bitnami/apache/conf/vhosts/htaccess
    name: custom-htaccess

Is this not the supported way to add supplemental apache conf?

I guess I was trying to replicate bitmani/vms style config.

@juan131
Copy link
Contributor

juan131 commented Apr 29, 2024

Hi @iain-ilearner

Could you try mounting your custom mediawiki-htaccess.conf at /opt/bitnami/apache/conf.default/vhosts/htaccess instead? Check these values as example:

extraVolumes:
  - name: custom-htaccess
    configMap:
      name: wiki-htaccess-configmap
      items:
        - key: mediawiki-htaccess.conf
          path: mediawiki-htaccess.conf
extraVolumeMounts:
  - mountPath: /opt/bitnami/apache/conf.default/vhosts/htaccess
    name: custom-htaccess
extraDeploy:
  - apiVersion: v1
    kind: ConfigMap
    metadata:
      name: wiki-htaccess-configmap
    data:
      mediawiki-htaccess.conf: |
        <Directory "/opt/bitnami/mediawiki/cache">
          Require all denied
        </Directory>
        <Directory "/opt/bitnami/mediawiki/images">
          <IfModule headers_module>
          Header set X-Content-Type-Options nosniff
          </IfModule>
          <IfModule php7_module>
          php_flag engine off
          </IfModule>
          <IfModule php_module>
          php_flag engine off
          </IfModule>
        </Directory>

@iain-ilearner
Copy link
Author

Thanks very much for the suggestion. I have now had time to test the new config and can confirm putting the htaccess file at /opt/bitnami/apache/conf.default/vhosts/htaccess works and allows the pod to start without any issues.

@juan131
Copy link
Contributor

juan131 commented May 2, 2024

Awesome @iain-ilearner ! I proceed to close the issue but please don't hesitate to let us know if you require further help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mediawiki solved tech-issues The user has a technical issue about an application
Projects
None yet
Development

No branches or pull requests

3 participants