TeamPiped / Piped-Kubernetes

GNU Affero General Public License v3.0
7 stars 6 forks source link

[piped] Empty page / No videos shown in Trending #105

Closed IngwiePhoenix closed 1 week ago

IngwiePhoenix commented 1 month ago

Helm chart name

piped

Helm chart version

Latest (left unspecified)

Container name

Left to default

Container tag

Left to default

Description

Hello!

I used to run Piped on a Docker Compose setup on a VPS - but since most DC IPs are now goners, I attempted to write my own k3s deployment untill I found out that you had a helm chart already.

So I went by k3s' way of doing things and provisioned it:

apiVersion: v1
kind: Namespace
metadata:
  name: piped
---
apiVersion: helm.cattle.io/v1
kind: HelmChart
metadata:
  name: piped
  namespace: kube-system
spec:
  repo: https://helm.piped.video
  chart: piped
  targetNamespace: piped
  valuesContent: |-
    config:
      secret:
        name: piped.piped.default-cluster.creds.zalando-postgres
        username: username
        password: password
    ingress:
      backend:
        ingressClassName: "traefik"
        hosts:
          - host: pipedapi.birb.it
            paths:
              - path: "/"
      main:
        ingressClassName: "traefik"
        hosts:
          - host: piped.birb.it
            paths:
              - path: "/"
      ytproxy:
        ingressClassName: "traefik"
        hosts:
          - host: pipedproxy.birb.it
            paths:
              - path: "/"
      postgres:
        enabled: false

Putting aside the fact that it still provisioned a Postgres instance and probably isn't actually using my postgres cluster via the Zalando operator, it also isn't showing anything.

Expected result

Upon visiting https://piped.birb.it I was expecting to see the typical view with trending videos and friends. Instead, all I see is...

image

While digging around in the dev tools, I found this: image

It appears that one of the hostnames was not applied correctly - but I am not too sure...

Helm values to reproduce

As above, see `.spec.valuesContent`

Additional Information

This runs in k3s on arm64. Dissecting the configs in use:

root@cluserboi /m/b/W/Homelab# kubectl get -n piped configmaps
NAME                   DATA   AGE
kube-root-ca.crt       1      21m
piped-backend-config   1      12m
root@cluserboi /m/b/W/Homelab# kubectl get -n piped configmaps/piped-backend-config -o yaml
apiVersion: v1
data:
  config.properties: |
    PORT: 8080
    HTTP_WORKERS: 2
    PROXY_PART: http://pipedproxy.birb.it
    API_URL: http://pipedapi.birb.it
    FRONTEND_URL: piped.birb.it
    COMPROMISED_PASSWORD_CHECK: true
    DISABLE_REGISTRATION: false
    FEED_RETENTION: 30
    hibernate.connection.url: jdbc:postgresql://piped-postgresql/piped
    hibernate.connection.driver_class: org.postgresql.Driver
    hibernate.connection.username: piped
    hibernate.connection.password: changemepiped
    SENTRY_DSN:
    MATRIX_SERVER: https://matrix-client.matrix.org
kind: ConfigMap
metadata:
  annotations:
    meta.helm.sh/release-name: piped
    meta.helm.sh/release-namespace: piped
  creationTimestamp: "2024-09-25T14:47:59Z"
  labels:
    app.kubernetes.io/instance: piped
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: piped
    app.kubernetes.io/version: latest
    helm.sh/chart: piped-6.0.2
  name: piped-backend-config
  namespace: piped
  resourceVersion: "79567281"
  uid: 165419e2-f583-4b66-9fe9-48eaf1a80c15

As for secrets:

root@cluserboi /m/b/W/Homelab# kubectl get -n piped secrets
NAME                                                 TYPE                 DATA   AGE
piped-postgresql                                     Opaque               2      14m
piped.piped.default-cluster.creds.zalando-postgres   Opaque               2      21m
sh.helm.release.v1.piped.v1                          helm.sh/release.v1   1      14m
root@cluserboi /m/b/W/Homelab# kubectl get -n piped secrets/piped-postgres -o yaml
Error from server (NotFound): secrets "piped-postgres" not found
root@cluserboi /m/b/W/Homelab [1]# kubectl get -n piped secrets/piped-postgresql -o yaml
apiVersion: v1
data:
  password: <snip>
  postgres-password: <snip>
kind: Secret
metadata:
  annotations:
    meta.helm.sh/release-name: piped
    meta.helm.sh/release-namespace: piped
  creationTimestamp: "2024-09-25T14:47:59Z"
  labels:
    app.kubernetes.io/instance: piped
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: postgresql
    app.kubernetes.io/version: 16.4.0
    helm.sh/chart: postgresql-15.5.27
  name: piped-postgresql
  namespace: piped
  resourceVersion: "79567279"
  uid: 6d700c5c-c76a-47ee-a205-5807020f9d29
type: Opaque
root@cluserboi /m/b/W/Homelab# kubectl get -n piped secrets/piped.piped.default-cluster.creds.zalando-postgres -o yaml
apiVersion: v1
data:
  password:<snip>
  username: <snip>
kind: Secret
metadata:
  creationTimestamp: "2024-09-25T14:41:35Z"
  labels:
    application: spilo
    cluster-name: default-cluster
    team: my-default
  name: piped.piped.default-cluster.creds.zalando-postgres
  namespace: piped
  resourceVersion: "79562070"
  uid: 70eff43b-a164-47e4-9a59-a0bc1dcb6d0b
type: Opaque

so... yeah, that's all I've got. ^^'

Repo link

No response

samip5 commented 1 month ago

FRONTEND_URL: piped.birb.it is wrong so that's why frontend is not using the right URL so if using HTTPS, it should also include it.

The another problem is that you're not specifying the details for backend's database connection, despite having postgres sub-chart disabled whilist the way you specified the value is not right.

Disabling postgresql sub-chart should be done with:

postgresql:
 enabled: false

instead of the way you have it defined it as it does matter.

samip5 commented 1 month ago

This for example works fine.


    frontend:
      image:
        # Pull-though cache
        repository: registry.<snip>.fi/docker.io/1337kavin/piped-frontend
        tag: latest
        pullPolicy: Always

      env:
        BACKEND_HOSTNAME: api.<snip>.fi

    backend:
      podAnnotations:
        configmap.reloader.stakater.com/reload: "piped-backend-config"
      additionalContainers:
        gluetun:
          image: registry.<snip>.fi/docker.io/qmcgaw/gluetun:v3.39.0
          imagePullPolicy: IfNotPresent
          env:
            VPN_TYPE: wireguard
            VPN_SERVICE_PROVIDER: airvpn
            VPN_INTERFACE: wg0
            FIREWALL: "off"
            DOT: "off"
            FIREWALL_VPN_INPUT_PORTS: 51820
            FIREWALL_OUTBOUND_SUBNETS: 10.51.0.0/16,10.50.0.0/16
            DNS_KEEP_NAMESERVER: "on"
            SERVER_REGIONS: Europe
            HTTPPROXY: "on"
            HTTPPROXY_LISTENING_ADDRESS: ":8888"
            HTTPPROXY_STEALTH: "on"
          envFrom:
            - secretRef:
                name: piped-vpnconfig
          securityContext:
            capabilities:
              add:
                - NET_ADMIN
      image:
        #repository: registry.<snip>.fi/library/piped
        #tag: "2024-04-06-2de41b6"
        repository: registry.<snip>.fi/docker.io/1337kavin/piped
        tag: latest@sha256:e9938cdda0745c4986d4add0f255777d3989849b851f290d94a4ab2b21c25384
        pullPolicy: Always

      config:
        PORT: 8080
        HTTP_WORKERS: 4
        PROXY_PART: https://proxy.<snip>.fi
        HTTP_PROXY: 127.0.0.1:8888
        #REQWEST_PROXY: http://127.0.0.1:8888
        #DISABLE_REGISTRATION: true
        database:
          connection_url: jdbc:postgresql://postgres-default-rw.database.svc.cluster.local/piped
          secret:
           name: *secret
           username: DB_USERNAME
           password: DB_PASSWORD

    ytproxy:
      enabled: true
      image:
        # Pull-though cache
        repository: registry.<snip>.fi/docker.io/1337kavin/piped-proxy
        tag: latest@sha256:ee6cb961f26c7018dab3046892ab388d185b72b53e45674a8110c8fae256f52b
        pullPolicy: Always
      env:
        RUST_BACKTRACE: 1

    ingress:
      main:
        enabled: true
        ingressClassName: nginx
        hosts:
          - host: &host <snip>
            paths:
              - path: "/"
        tls:
          - hosts:
              - *host
            secretName: piped-production-tls

      backend:
        enabled: true
        ingressClassName: nginx
        annotations:
          external-dns.alpha.kubernetes.io/target: "ingress.${SECRET_DOMAIN_2}"
        hosts:
          - host: &api_host api.<snip>
            paths:
              - path: "/"
        tls:
          - hosts:
              - *api_host
            secretName: piped-production-tls

      ytproxy:
        enabled: true
        ingressClassName: nginx
        annotations:
          external-dns.alpha.kubernetes.io/target: "ingress.${SECRET_DOMAIN_2}"
        hosts:
          - host: &proxy proxy.<snip>
            paths:
              - path: "/"
        tls:
          - hosts:
              - *proxy
            secretName: piped-production-tls
    postgresql:
      enabled: false
IngwiePhoenix commented 1 month ago

Haven't seen someone make use of YAML in-document references - totally forgot that they could be used here. That alone was very helpful!

Welp, seems like I forgor to add the database section within config - and went right to the secret. That one is on me, will try and see if things work out now!

samip5 commented 1 week ago

No activity, closing as fixed.