hoarder-app / hoarder

A self-hostable bookmark-everything app (links, notes and images) with AI-based automatic tagging and full text search
https://hoarder.app
GNU Affero General Public License v3.0
6.57k stars 236 forks source link

Having ODIC issues / Authelia #550

Closed Zipties closed 1 month ago

Zipties commented 1 month ago

Hey there, I am having some issues getting SSO to work.

  image: ghcr.io/hoarder-app/hoarder:release
  restart: unless-stopped
  volumes:
    - data:/data
  # ports:
  #   - 3000:3000
  environment:
    OPENAI_API_KEY: "REDACTED"
    MEILI_ADDR: http://meilisearch:7700
    BROWSER_WEB_URL: http://chrome:9222
    DATA_DIR: /data
    HOARDER_VERSION: release
    NEXTAUTH_SECRET: "REDACTED"
    MEILI_MASTER_KEY: "REDACTED"
    NEXTAUTH_URL: https://notes.example.com
    DISABLE_PASSWORD_AUTH: "true"
    DISABLE_SIGNUPS: "true"
    OAUTH_WELLKNOWN_URL: https://auth.example.com/.well-known/openid-configuration
    OAUTH_PROVIDER_NAME: Authelia
    OAUTH_CLIENT_SECRET: "REDACTED"
    # OAUTH_ALLOW_DANGEROUS_EMAIL_ACCOUNT_LINKING: "true"
    OAUTH_SCOPE: "openid email profile"
    OAUTH_CLIENT_ID: hoarder

Authelia config

- client_id: 'hoarder'
  client_name: 'hoarder'
  client_secret: 'REDACTED'  
  public: false
  authorization_policy: 'two_factor'
  redirect_uris:
    - 'https://notes.example.com/api/auth/callback/custom'
  scopes:
    - 'openid'
    - 'profile'
    - 'groups'
    - 'email'
  userinfo_signed_response_alg: 'none'

When I click the "authelia" button in Hoarder it times out after 3 seconds with

[next-auth][error][SIGNIN_OAUTH_ERROR] 

https://next-auth.js.org/errors#signin_oauth_error outgoing request timed out after 3500ms {

  error: {

    message: 'outgoing request timed out after 3500ms',

    stack: 's: outgoing request timed out after 3500ms\n' +

      '    at /app/apps/web/.next/server/chunks/109.js:34:37444\n' +

      '    at async m.discover (/app/apps/web/.next/server/chunks/109.js:34:42113)\n' +

      '    at async n (/app/apps/web/.next/server/chunks/109.js:1:69529)\n' +

      '    at async o (/app/apps/web/.next/server/chunks/109.js:1:61874)\n' +

      '    at async Object.o (/app/apps/web/.next/server/chunks/109.js:25:8629)\n' +

      '    at async m (/app/apps/web/.next/server/chunks/109.js:1:47231)\n' +

      '    at async a (/app/apps/web/.next/server/chunks/109.js:25:19587)\n' +

      '    at async e.length.t (/app/apps/web/.next/server/chunks/109.js:25:20997)\n' +

      '    at async /app/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:6:36938\n' +

      '    at async eC.execute (/app/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:6:27552)',

    name: 's'

  },

  providerId: 'custom',

  message: 'outgoing request timed out after 3500ms'

}
kamtschatka commented 1 month ago

looks like this: https://github.com/nextauthjs/next-auth/discussions/3186 so probably your authelia endpoint is not reachable or too slow

Zipties commented 1 month ago

looks like this: nextauthjs/next-auth#3186 so probably your authelia endpoint is not reachable or too slow

Thanks! I was having an issue with the first DNS server in /etc/resolv.conf and by the time it timed out so had the container

kamtschatka commented 1 month ago

so it is fixed?

Zipties commented 1 month ago

Yes!