linuxserver / docker-snipe-it

Alpine/Nginx container for the Asset Management software Snipe-IT
GNU General Public License v3.0
123 stars 26 forks source link

[Redirection to /setup] snipe-it behind traefik #54

Closed FKouhai closed 1 year ago

FKouhai commented 1 year ago

Is there an existing issue for this?

Current Behavior

Hello everyone,

After spending some hours trying to deploy snipe it behind traefik in a k8s cluster, I have detected that from time to time im getting redirected to the setup page when navigating between the different places in the web ui, i have set up an ingress route which is a k8s crd provisioned by traefik, I have other services like grafana running in the same cluster and with a similar ingress route and dont have any problem at all,

Probably I'm missing something, is there any recommended middleware for snipe it or any environment variable that disallows /setup ?

Kind regards

Fran

Expected Behavior

When accessing snipeit.redacted.com the access should be nominal same as with navigating through the web ui

Steps To Reproduce

  1. Deploy a kubernetes cluster on prem
  2. Deploy metallb
  3. Deploy traefik
  4. Deploy openebs
  5. Deploy snipe-it with the helm chart
  6. Edit the deployment to use the linux server image
  7. Try to access the web ui after a nominal installation

Environment

- OS:Ubuntu 22.04
- How docker service was installed:Firstly it was deployed with a helm chart using the default snipe-it image, then edited the service to use the linuxserver image

CPU architecture

x86-64

Docker creation

helm install snipeit t3n/snipeit --set config.snipeit.key="redacted" --set config.mysql.externalDatabase.pass="redacted" --set config.snipeit.url="https://snipeit.redacted" --set ingress.enabled="false" --set mysql.mysqlPassword="redacted" --set mysql.persistence.storageClass="openebs-jiva-csi-sc" --set mysql.persistence.size="20Gi" --set persistence.existingClaim="snipeit-pvc"

kubectl edit deployment snipeit 

Changed the container image for linuxserver

Container logs

the logs just point out the app key
github-actions[bot] commented 1 year ago

Thanks for opening your first issue here! Be sure to follow the relevant issue templates, or risk having this issue marked as invalid.

FKouhai commented 1 year ago

Hello,

I have created a middleware that stripes /setup from the request, although its more usable it still is unoperable since it constantly tries to redirect to /setup causing some request to be duplicated, is there any recommended middleware of traefik to handle snipe it correctly?

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. This might be due to missing feedback from OP. It will be closed if no further activity occurs. Thank you for your contributions.

FKouhai commented 1 year ago

is there any advance regarding this issue?

nemchik commented 1 year ago

You could add


    # deny access to setup after installation is complete
    location /setup {
        deny all;
    }

to the default site conf here https://github.com/linuxserver/docker-snipe-it/blob/02f6d22981d2e54b3230760e7ac1ac91dae526cb/root/defaults/nginx/site-confs/default.conf.sample#L36 after completing the initial setup.

We could include this config commented out with a note about uncommenting it after completing setup. I'll look into it.

FKouhai commented 1 year ago

@nemchik thanks for the solution i think the issue can be closed now :)