broken assets when running on k3s #392

Closed
opened 2023-01-05 21:53:12 +00:00 by ronssm · 3 comments

I am installing gitea in k3s with this helm chart.
The ingress is being configured like this:

ingress:
  enabled: true
  # className: nginx
  className:
  annotations: {}
    # kubernetes.io/ingress.class: nginx
    # kubernetes.io/tls-acme: "true"
  hosts:
    - host: "homelab.internal"
      paths:
        - path: /gitea
          pathType: Prefix

when i try to enter the gitea url i get the following message:

Failed to load asset files from https://homelab.internal/gitea/assets/js/index.js?v=1.17.4, please make sure the asset files can be accessed and the ROOT_URL setting in app.ini is correct.

i`ve already tried to set root_url, domain, static_url_prefix in many different ways but the problem persists.
Couldnt find anything in the docs related to this scenario.
Am i missing something?

I am installing gitea in k3s with this helm chart. The ingress is being configured like this: ``` ingress: enabled: true # className: nginx className: annotations: {} # kubernetes.io/ingress.class: nginx # kubernetes.io/tls-acme: "true" hosts: - host: "homelab.internal" paths: - path: /gitea pathType: Prefix ``` when i try to enter the gitea url i get the following message: ``` Failed to load asset files from https://homelab.internal/gitea/assets/js/index.js?v=1.17.4, please make sure the asset files can be accessed and the ROOT_URL setting in app.ini is correct. ``` i`ve already tried to set root_url, domain, static_url_prefix in many different ways but the problem persists. Couldnt find anything in the docs related to this scenario. Am i missing something?
Member
You need to remove the subpath prefix (/gitea) when pass the request to backend. https://graphicsunplugged.com/2021/12/18/removing-url-prefixes-in-nginx-kubernetes-ingress/ https://stackoverflow.com/questions/52923298/remove-routing-path-from-kubernetes-ingress
Member

The following definition worked for me some time ago when I was running the chart in a subpath

ingress:
  enabled: true
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: "/$2"

  hosts:
    - host: subdomain.domain.com
      paths:
        - path: "/gitea(/|$)(.*)"
          pathType: Prefix

with ROOT_URL: subdomain.domain.com.

I am aware of the /assets change which happened in 1.16 or 1.17. If this causes further trouble we should add an example definition to the values.yml file.

The following definition worked for me some time ago when I was running the chart in a subpath ```yml ingress: enabled: true annotations: nginx.ingress.kubernetes.io/rewrite-target: "/$2" hosts: - host: subdomain.domain.com paths: - path: "/gitea(/|$)(.*)" pathType: Prefix ``` with `ROOT_URL: subdomain.domain.com`. I am aware of the `/assets` change which happened in 1.16 or 1.17. If this causes further trouble we should add an example definition to the `values.yml` file.
Member

Closing due to no response from OP.

Closing due to no response from OP.
pat-s closed this issue 2023-02-26 12:57:14 +00:00
Sign in to join this conversation.
No Milestone
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: gitea/helm-chart#392
No description provided.