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

I can't disable index page #237

Closed
martonsz opened this issue Dec 20, 2021 · 10 comments
Closed

I can't disable index page #237

martonsz opened this issue Dec 20, 2021 · 10 comments
Assignees
Labels
no-issue-activity question Further information is requested

Comments

@martonsz
Copy link

Describe the bug
I am trying to disable the index page by configuring ListTargetsConfiguration

To Reproduce
I have tried the following configurations. But they all show the index page.

log:
  level: debug
  format: text
listTargets:
  enabled: false
  mount:
    path:
      - /
targets:
  first-bucket:
    mount:
      path:
        - /
    bucket:
      name: foo-common.example.com
      prefix:
      region: gra
      s3Endpoint: https://s3.gra.cloud.ovh.net
      disableSSL: false
      s3ListMaxKeys: 1000
      credentials:
        accessKey:
          value: testing
        secretKey:
          value: testing
log:
  level: debug
  format: text
listTargets:
  enabled: false
  mount:
    path:
      - /foo-common.example.com/
targets:
  first-bucket:
    mount:
      path:
        - /foo-common.example.com/
    bucket:
      name: foo-common.example.com
      prefix:
      region: gra
      s3Endpoint: https://s3.gra.cloud.ovh.net
      disableSSL: false
      s3ListMaxKeys: 1000
      credentials:
        accessKey:
          value: testing
        secretKey:
          value: testing
log:
  level: debug
  format: text
listTargets:
  enabled: false
  mount:
    path:
      - /
targets:
  first-bucket:
    mount:
      path:
        - /foo-common.example.com/
    bucket:
      name: foo-common.example.com
      prefix:
      region: gra
      s3Endpoint: https://s3.gra.cloud.ovh.net
      disableSSL: false
      s3ListMaxKeys: 1000
      credentials:
        accessKey:
          value: testing
        secretKey:
          value: testing

Expected behavior
Do not show and index page with files when I visit https://mys3proxy.example.com

Version and platform (please complete the following information):

  • Helm chart: 2.7.0
  • Image: oxynozeta/s3-proxy:4.1.0
  • Kubernetes 1.21.1 (created with kind, running in Docker Desktop on Windows using WSL 2)
@martonsz martonsz added the bug Something isn't working label Dec 20, 2021
@oxyno-zeta
Copy link
Owner

Hello,

Thanks for your bug. I supposed that what you are calling "index page" is the target list right ?
I'm sorry but I can't reproduce that issue.
When I put the enabled: false in the listTargets, everything is working well.

Maybe you should try with the version 4.1.3. Another possibility: Clean the configuration to remove completely the listTargets part.

Regards,

@martonsz
Copy link
Author

I missed that there was a new version. I just used the default image for the latest helm chart 2.7.0

I'm having the same issue with the latest version oxynozeta/s3-proxy:4.1.3

Here is my full config copied from the running pod using the command kubectl exec deploy/s3-proxy -- cat conf/config.yaml | sed '/^[[:space:]]*#/d'| sed '/^$/d'

log:
  level: debug
  format: text
targets:
  first-bucket:
    mount:
      path:
        - /
    bucket:
      name: foo-common.example.com
      prefix:
      region: gra
      s3Endpoint: https://s3.gra.cloud.ovh.net
      credentials:
        accessKey:
          path: /proxy/secret-files/s3-access-key-id.txt
        secretKey:
          path: /proxy/secret-files/s3-secret-access-key.txt

@oxyno-zeta
Copy link
Owner

Hello,

With that configuration, you should have the content of the bucket named "foo-common.example.com" displayed on /. No target list, just the list of files on selected key right ?

Regards,

@oxyno-zeta oxyno-zeta self-assigned this Dec 21, 2021
@martonsz
Copy link
Author

I think I know what I misunderstood. I thought that listTargetswas a way to enable or disable the listing of files when the key is a "folder". I thought the files were the targets.

But now I understand that it shows the "Target buckets list" page when enabled.

So my new question is. Is it possible to disable listing files when the key is a folder?

@oxyno-zeta oxyno-zeta added bug Something isn't working question Further information is requested and removed bug Something isn't working labels Dec 21, 2021
@oxyno-zeta
Copy link
Owner

I'm afraid that the only way to achieve that is to change the template used for the file listing. You can find it here as the "folderList" one.

@oxyno-zeta oxyno-zeta removed the bug Something isn't working label Dec 21, 2021
@duckie
Copy link

duckie commented Jan 12, 2022

I would also like to disable the listing and report a 404 whenever a "folder" is listed. Modifying the template wont cut it as it wont reply a proper 404. That would be a nice feature to be able to disable listing, ideal for static websites publishing.

@oxyno-zeta
Copy link
Owner

I see what you are looking for. But some servers are answering 403, others 404, others 401, ...
I think you can see where I'm going. I need to find a good way of doing all of that in the configuration.

In the meantime, you can override the list template and flush it no ? As a workaround for the moment I mean.

Regards,

@oxyno-zeta
Copy link
Owner

Hello,

I'm trying to implement a feature that will allow putting templates for status code.
It isn't finished yet but promising. Just wanted to keep you informed.

Regards,

oxyno-zeta added a commit that referenced this issue Feb 1, 2022
@oxyno-zeta oxyno-zeta mentioned this issue Feb 8, 2022
4 tasks
@oxyno-zeta
Copy link
Owner

Hello,

I've just released a new chart and application version (2.9.0 for the chart and 4.3.0 for the application). That new application version has support for custom status codes that can be templated.
That will allow you to customize the folder list with a fully customized answer!

Hope you will like it.

Regards,

Oxyno-zeta

@github-actions
Copy link

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 10 days

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-issue-activity question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants