Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

Cloudron Forum

Apps - Status | Demo | Docs | Install
  1. Cloudron Forum
  2. Matrix (Synapse/Element)
  3. OIDC customization settings not persistent

OIDC customization settings not persistent

Scheduled Pinned Locked Moved Matrix (Synapse/Element)
6 Posts 3 Posters 47 Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mononym
    wrote last edited by
    #1

    Hello,
    I want to comment out the following entries in homeserver.yaml so that users can define their matrix usernames.

    user_mapping_provider:
          config:
            #localpart_template: '{{ user.sub }}'
            #display_name_template: '{{ user.name }}'
            email_template: '{{ user.email }}'
    

    But when restarting the app, the two lines are added again, uncommented, overwriting my changes.

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mononym
      wrote last edited by mononym
      #2

      Guess it has something to do with app/pkg/start.sh

      # oidc
      if [[ -n "${CLOUDRON_OIDC_ISSUER:-}" ]]; then
          echo " ==> Configuring OIDC auth"
          yq eval -i ".oidc_providers[0].idp_id=\"cloudron\"" /app/data/configs/homeserver.yaml
          yq eval -i ".oidc_providers[0].idp_name=\"${CLOUDRON_OIDC_PROVIDER_NAME:-Cloudron}\"" /app/data/configs/homeserver.yaml
          yq eval -i ".oidc_providers[0].issuer=\"${CLOUDRON_OIDC_ISSUER}\"" /app/data/configs/homeserver.yaml
          yq eval -i ".oidc_providers[0].client_id=\"${CLOUDRON_OIDC_CLIENT_ID}\"" /app/data/configs/homeserver.yaml
          yq eval -i ".oidc_providers[0].client_secret=\"${CLOUDRON_OIDC_CLIENT_SECRET}\"" /app/data/configs/homeserver.yaml
      
          yq eval -i ".oidc_providers[0].scopes=[\"openid\", \"email\", \"profile\"]" /app/data/configs/homeserver.yaml
          yq eval -i ".oidc_providers[0].authorization_endpoint=\"${CLOUDRON_OIDC_AUTH_ENDPOINT}\"" /app/data/configs/homeserver.yaml
          yq eval -i ".oidc_providers[0].token_endpoint=\"${CLOUDRON_OIDC_TOKEN_ENDPOINT}\"" /app/data/configs/homeserver.yaml
          yq eval -i ".oidc_providers[0].userinfo_endpoint=\"${CLOUDRON_OIDC_PROFILE_ENDPOINT}\"" /app/data/configs/homeserver.yaml
          # https://s3lph.me/ldap-to-oidc-migration-3-matrix.html
          yq eval -i ".oidc_providers[0].allow_existing_users=true" /app/data/configs/homeserver.yaml
          yq eval -i ".oidc_providers[0].skip_verification=true" /app/data/configs/homeserver.yaml
          yq eval -i ".oidc_providers[0].user_mapping_provider.config.localpart_template=\"{{ user.sub }}\"" /app/data/configs/homeserver.yaml
          yq eval -i ".oidc_providers[0].user_mapping_provider.config.display_name_template=\"{{ user.name }}\"" /app/data/configs/homeserver.yaml
          yq eval -i ".oidc_providers[0].user_mapping_provider.config.email_template=\"{{ user.email }}\"" /app/data/configs/homeserver.yaml
      else
      

      Basically, the script should not update the homeserver.yaml localpart_template key, if its value was set (manually) to null (changing it to null is maybe easier to detect than just commenting it out).

      1 Reply Last reply
      0
      • jamesJ Online
        jamesJ Online
        james
        Staff
        wrote last edited by
        #3

        Hello @mononym

        When packaging a Cloudron app with OIDC support we make the app start up always handle the OIDC set up to ensure it is working.
        You would like a change to the Matrix/Synapse app that if the /app/data/configs/homeserver.yaml was initially set up it should not be touched again to prevent reverting changes by the user.
        Is that correct?

        M 1 Reply Last reply
        0
        • jamesJ james

          Hello @mononym

          When packaging a Cloudron app with OIDC support we make the app start up always handle the OIDC set up to ensure it is working.
          You would like a change to the Matrix/Synapse app that if the /app/data/configs/homeserver.yaml was initially set up it should not be touched again to prevent reverting changes by the user.
          Is that correct?

          M Offline
          M Offline
          mononym
          wrote last edited by
          #4

          @james Yes, that would be perfect. The upper part of the start.sh script is checking if homeserver.yaml exists but the OIDC settings are not in that block.

          1 Reply Last reply
          1
          • nebulonN Offline
            nebulonN Offline
            nebulon
            Staff
            wrote last edited by
            #5

            Since the OIDC settings like the endpoint origin may change, if an app was installed with OIDC through Cloudron enabled, we always have to ensure this.

            If the user management should be left to the admin to configure, an app has to be installed without Cloudron usermanagement.

            Unless we make this a post-install setting, reinstallation is the only way to persistently change those bits. Think of it similarily like the database setup of an app. Either Cloudron ensures the setup or it would require each admin to manually tweak those if changed by the platform or through an app update.

            1 Reply Last reply
            0
            • M Offline
              M Offline
              mononym
              wrote last edited by mononym
              #6

              Yes, this makes perfect sense to me. That's also why I only want to change two specific parameters (localpart_template and display_name_template) and not the whole OIDC setup, which should be unmutable so to say. And in my case, I also wanted to ensure that email_template is kept in sync with the Cloudron account email, only giving freedom to set a desired handle and display name (although that one can be modified afterwards by the user).

              P.S.: I did not test yet if other settings are persistent or not, as I intend to set a retention policy for synapse as well.

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Bookmarks
              • Search