Giter Site home page Giter Site logo

Comments (6)

teon avatar teon commented on June 19, 2024

@almulalic could you share any details about the configuration so we could replicate/try to. find what's wrong? If you don't want to post them here publicly you can email us at: [email protected].
We need:

  • name of the VPN
  • name of the device
  • first, ast name & username of the user for which the device was configured
  • VPN server IP
  • port
  • VPN network address

Also can you go to the "core" logs and post them?

Based on that we will replicate and have the ability to fix.

from defguard.

almulalic avatar almulalic commented on June 19, 2024

Sure, I can publish it here. I managed to get a video for this which I sent to support email.
Most of the questions are answered in the video, however I can't share the IP and port.

However I could share my deployment info:
deployment.yaml

apiVersion: apps/v1
kind: Deployment
metadata:
  name: defguard
  namespace: infra
spec:
  replicas: 1
  selector:
    matchLabels:
      app: defguard
  template:
    metadata:
      labels:
        app: defguard
    spec:
      containers:
        - name: core
          image: ghcr.io/defguard/defguard:sha-db61513
          envFrom:
            - secretRef:
                name: defguard-secret
          ports:
            - containerPort: 8000
              protocol: TCP
            - containerPort: 50055
              protocol: TCP
          volumeMounts:
            - name: ssl-certs
              mountPath: /ssl
        - name: proxy
          image: ghcr.io/defguard/defguard-proxy:latest
          envFrom:
            - secretRef:
                name: defguard-secret
          ports:
            - containerPort: 8080
              protocol: TCP
            - containerPort: 50052
              protocol: TCP
          volumeMounts:
            - name: ssl-certs
              mountPath: /ssl
      volumes:
        - name: ssl-certs
          hostPath:
            path: /opt/defguard/ssl

---
apiVersion: v1
kind: Service
metadata:
  name: defguard-tcp
  namespace: infra
spec:
  selector:
    app: defguard
  ports:
    - name: defguard-grpc
      protocol: TCP
      port: 50055
      targetPort: 50055
    - name: defguard-proxy
      protocol: TCP
      port: 50052
      targetPort: 50052
    - name: defguard-main-ui
      protocol: TCP
      port: 8000
      targetPort: 8000
    - name: defguard-enroll-ui
      protocol: TCP
      port: 8080
      targetPort: 8080

---
apiVersion: v1
kind: Service
metadata:
  name: defguard-udp
  namespace: infra
spec:
  externalTrafficPolicy: Local
  type: NodePort
  selector:
    app: defguard
  ports:
    - protocol: UDP
      port: 50051
      targetPort: 50051
      name: wireguard-def

---
apiVersion: traefik.io/v1alpha1
kind: IngressRoute
metadata:
  name: defguard-grpc
  namespace: infra
spec:
  entryPoints:
    - websecure
  routes:
    - match: Host(`grpc.defguard.X.cloud`)
      kind: Rule
      services:
        - name: defguard-tcp
          port: 50055

---
apiVersion: traefik.io/v1alpha1
kind: IngressRoute
metadata:
  name: defguard-main-ui
  namespace: infra
spec:
  entryPoints:
    - websecure
  routes:
    - match: Host(`defguard.X.cloud`)
      kind: Rule
      services:
        - name: defguard-tcp
          port: 8000

---
apiVersion: traefik.io/v1alpha1
kind: IngressRoute
metadata:
  name: defguard-proxy
  namespace: infra
spec:
  entryPoints:
    - websecure
  routes:
    - match: Host(`proxy.defguard.X.cloud`)
      kind: Rule
      services:
        - name: defguard-tcp
          port: 50052

---
apiVersion: traefik.io/v1alpha1
kind: IngressRoute
metadata:
  name: defguard-enroll-ui
  namespace: infra
spec:
  entryPoints:
    - websecure
  routes:
    - match: Host(`enroll.defguard.X.cloud`)
      kind: Rule
      services:
        - name: defguard-tcp
          port: 8080

---
apiVersion: traefik.io/v1alpha1
kind: IngressRouteUDP
metadata:
  name: defguard-wireguard
  namespace: infra
spec:
  entryPoints:
    - wireguard-def
  routes:
    - services:
      - name: wireguard-defguard
        port: 50051
        weight: 9
        nativeLB: true

gateway

apiVersion: apps/v1
kind: Deployment
metadata:
  name: defguard-homeserver-gateway
  namespace: infra
spec:
  replicas: 1
  selector:
    matchLabels:
      app: defguard-homeserver-gateway
  template:
    metadata:
      labels:
        app: defguard-homeserver-gateway
    spec:
      containers:
        - name: gateway
          image: ghcr.io/defguard/gateway:latest
          securityContext:
            capabilities:
              add:
                - NET_ADMIN
          ports:
            - containerPort: 50051
              protocol: UDP
          envFrom:
            - secretRef:
                name: defguard-homeserver-gateway-secret
          volumeMounts:
            - name: ssl-certs
              mountPath: /ssl
      dnsPolicy: "None"
      dnsConfig:
        nameservers:
          - 192.168.98.6
          - 8.8.8.8
      volumes:
        - name: ssl-certs
          hostPath:
            path: /opt/defguard/ssl

---
apiVersion: v1
kind: Service
metadata:
  name: defguard-homeserver-gateway
  namespace: infra
spec:
  externalTrafficPolicy: Local
  type: NodePort
  selector:
    app: defguard-homeserver-gateway
  ports:
    - protocol: UDP
      port: 50051
      targetPort: 50051
      name: wireguard-def

---
apiVersion: traefik.io/v1alpha1
kind: IngressRouteUDP
metadata:
  name: defguard-homeserver-gateway
  namespace: infra
spec:
  entryPoints:
    - wireguard-def
  routes:
    - services:
      - name: defguard-homeserver-gateway
        port: 50051
        weight: 9
        nativeLB: true

.env

# Databse
DEFGUARD_DB_HOST=postgresql.data.svc.cluster.local
DEFGUARD_DB_PORT=5432
DEFGUARD_DB_USER=defguard
DEFGUARD_DB_PASSWORD=X
DEFGUARD_DB_NAME=defguard

# Core
DEFGUARD_LOG_LEVEL=DEBUG
DEFGUARD_AUTH_SECRET=X
DEFGUARD_YUBIBRIDGE_SECRET=X
DEFGUARD_GATEWAY_SECRET=X
DEFGUARD_SECRET_KEY=X
DEFGUARD_URL=https://defguard.X.cloud
DEFGUARD_WEBAUTHN_RP_ID=defguard.X.cloud
DEFGUARD_COOKIE_INSECURE=false
DEFGUARD_ENROLLMENT_URL=https://enroll.defguard.X.cloud
DEFGUARD_PROXY_URL=http://defguard-tcp.infra.svc.cluster.local:50052
DEFGUARD_DEFAULT_ADMIN_PASSWORD=X

# Proxy
DEFGUARD_PROXY_GRPC_PORT=50052
DEFGUARD_PROXY_HTTP_PORT=8080

gateway .env

DEFGUARD_GRPC_URL=http://defguard-tcp.infra.svc.cluster.local:50055
DEFGUARD_STATS_PERIOD=30
DEFGUARD_TOKEN=X
POSTUP=iptables -A FORWARD -i %i -j ACCEPT; iptables -A FORWARD -o %i -j ACCEPT; iptables -t nat -A POSTROUTING -o eth+ -j MASQUERADE
POSTDOWN=iptables -D FORWARD -i %i -j ACCEPT; iptables -D FORWARD -o %i -j ACCEPT; iptables -t nat -D POSTROUTING -o eth+ -j MASQUERADE

from defguard.

teon avatar teon commented on June 19, 2024

@almulalic from what I see you are not using official release images (sha-xxx). That may be the case.

Can you user 0.9.0 image tag (latest release)?

from defguard.

almulalic avatar almulalic commented on June 19, 2024

Tried to migrate but got some SQL migration errors which are fine for now as I used this cluster for testing. I created a fresh new database with the :latest tag on core and the same issue still persists.

  1. Create a network
  2. Assign it to admin group
  3. Create a new user that doesen't have admin group
  4. Log in as the user, go to add device and go through the wizard
  5. Wizard will crash after the key setup
  6. (Optional) go back to his profile, same behaviour is present on Show configuration option
  7. Go back to admin account
  8. Add admin group to user
  9. Go back to user
  10. Show configuration should work now and the wizard for adding new devices should complete

Also the behaviour should be present when you visit https://domain.com/add-device and refresh the page.

The code is minified so I didn't get much info from digging through references in console, but the error is same
Screenshot 2024-03-16 at 13 07 52

from defguard.

almulalic avatar almulalic commented on June 19, 2024

Also, I tested out the scenario where there are 2 locations one is admin only and the other one is public so it seems that as long as there is one location that user has access to everything works.

My best guess would be that QR code generation is done under the assumption that there is at least one network/location, and then when 0 networks are returned it tries to find property netowrkId on nothing.
Screenshot 2024-03-16 at 13 08 45

from defguard.

teon avatar teon commented on June 19, 2024

@j-chmielewski I've replicated this on our DEV:

  1. New account (not admin)
  2. Logged in to this account
  3. Added a new device
  4. Named the device -> NEXT

ERROR IN CONSOLE:

Screenshot 2024-03-19 at 10 56 22

from defguard.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.