Skip to content

auth-basic runs by default even when not needed #1271

@michaelstingl

Description

@michaelstingl

Is your feature request related to a problem? Please describe.

When configuring OpenCloud with external authentication and excluding the idm service, the auth-basic service still tries to access the IDM's LDAP certificate at /var/lib/opencloud/idm/ldap.crt, causing startup failures:

"CA cert file is not ready yet. Waiting 2 seconds for it to appear."
"Error reading LDAP CA Cert '/var/lib/opencloud/idm/ldap.crt.': open /var/lib/opencloud/idm/ldap.crt: no such file or directory"

This forces users to manually exclude auth-basic from the services list, which is not documented and not intuitive.

Describe the solution you'd like

The auth-basic service should be more intelligent about its dependencies:

  1. Check for IDM exclusion: When starting, check if idm is in OC_EXCLUDE_RUN_SERVICES

  2. Adapt behavior: If IDM is excluded and no AUTH_BASIC_LDAP_* configuration is provided, either:

    • Skip looking for the IDM certificate
    • Auto-disable itself with a clear log message
    • Use the main OC_LDAP_* configuration if available
  3. Better error messages: Replace generic "CA cert file is not ready" with:

    "IDM service is excluded but auth-basic is configured to use IDM's LDAP certificate. 
     Either configure AUTH_BASIC_LDAP_* variables for external LDAP or exclude auth-basic service."
    

Describe alternatives you've considered

  1. Documentation only: Document that users need to exclude auth-basic when using external auth (current workaround)
  2. Remove auth-basic dependency: Refactor so auth-basic doesn't depend on IDM certificate location

Additional context

This issue was discovered when setting up HA deployments with external Keycloak/LDAP where the current behavior is:

  • Users exclude idm,idp as documented
  • OpenCloud fails to start due to auth-basic looking for IDM certificate
  • Users have to discover through trial and error that auth-basic also needs exclusion

Related discussion: opencloud-eu/helm#102 (comment)

The ideal solution would make OpenCloud "just work" with external authentication without requiring deep knowledge of internal service dependencies.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions