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
  • 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 | Demo | Docs | Install
  1. Cloudron Forum
  2. Feature Requests
  3. automated user registration

automated user registration

Scheduled Pinned Locked Moved Feature Requests
registration
10 Posts 5 Posters 1.8k Views 5 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.
    • F Offline
      F Offline
      fair
      wrote on last edited by girish
      #1

      Hi,

      We have a lot of users and don't always know who needs access to our cloudron setup. Is there a way to automate user registration or that registration is open, but for instance moderated?

      A setup that would work well for us:

      • user registers their account on cloudron
      • (optionally, but nice) if their email isn't in the whitelist, continue, else decline registration
      • add to moderation queue
      • moderator approves or declines, this could even be that the user already exists but needs adding to groups.

      If that isn't possible, which would be sad, being able to mass invite a list of e-mail addresses or sent a single invite link to a mailinglist would also work.

      Setting the registration deadline would also be quite helpful here, very few people respond to their invite within a day.

      Thanks!

      marcusquinnM ? 2 Replies Last reply
      3
      • girishG Offline
        girishG Offline
        girish
        Staff
        wrote on last edited by girish
        #2

        @fair Currently, there is no way to have self-registration. I guess this request is similar to https://forum.cloudron.io/topic/2068/is-it-possible-to-have-open-registation . You can use the API to implement bulk invites - https://cloudron.io/documentation/api/#/paths/~1users/post . Would that work?

        jdaviescoatesJ 1 Reply Last reply
        3
        • F fair

          Hi,

          We have a lot of users and don't always know who needs access to our cloudron setup. Is there a way to automate user registration or that registration is open, but for instance moderated?

          A setup that would work well for us:

          • user registers their account on cloudron
          • (optionally, but nice) if their email isn't in the whitelist, continue, else decline registration
          • add to moderation queue
          • moderator approves or declines, this could even be that the user already exists but needs adding to groups.

          If that isn't possible, which would be sad, being able to mass invite a list of e-mail addresses or sent a single invite link to a mailinglist would also work.

          Setting the registration deadline would also be quite helpful here, very few people respond to their invite within a day.

          Thanks!

          marcusquinnM Offline
          marcusquinnM Offline
          marcusquinn
          wrote on last edited by marcusquinn
          #3

          @fair Use a Mailtrain List & Subscription Form in the meantime maybe?

          At least it would capture the interest, has no time limit, and should be easy enough to send reminders to those not subscribed.

          Web Design https://www.evergreen.je
          Development https://brandlight.org
          Life https://marcusquinn.com

          1 Reply Last reply
          2
          • girishG girish

            @fair Currently, there is no way to have self-registration. I guess this request is similar to https://forum.cloudron.io/topic/2068/is-it-possible-to-have-open-registation . You can use the API to implement bulk invites - https://cloudron.io/documentation/api/#/paths/~1users/post . Would that work?

            jdaviescoatesJ Offline
            jdaviescoatesJ Offline
            jdaviescoates
            wrote on last edited by
            #4

            @girish said in automated user registration:

            I guess this request is similar to https://forum.cloudron.io/topic/2068/is-it-possible-to-have-open-registation

            You beat me to it 🙂

            Perhaps move that and this thread to feature requests?

            I use Cloudron with Gandi & Hetzner

            F 1 Reply Last reply
            1
            • girishG Offline
              girishG Offline
              girish
              Staff
              wrote on last edited by
              #5

              @jdaviescoates Done!

              @fair For now, I can write a script and publish it here. Let's take it from there.

              1 Reply Last reply
              3
              • F fair

                Hi,

                We have a lot of users and don't always know who needs access to our cloudron setup. Is there a way to automate user registration or that registration is open, but for instance moderated?

                A setup that would work well for us:

                • user registers their account on cloudron
                • (optionally, but nice) if their email isn't in the whitelist, continue, else decline registration
                • add to moderation queue
                • moderator approves or declines, this could even be that the user already exists but needs adding to groups.

                If that isn't possible, which would be sad, being able to mass invite a list of e-mail addresses or sent a single invite link to a mailinglist would also work.

                Setting the registration deadline would also be quite helpful here, very few people respond to their invite within a day.

                Thanks!

                ? Offline
                ? Offline
                A Former User
                wrote on last edited by
                #6

                @fair said in automated user registration:

                if their email isn't in the whitelist, continue, else decline registration

                for "isn't" read "is" (?)

                1 Reply Last reply
                2
                • jdaviescoatesJ jdaviescoates

                  @girish said in automated user registration:

                  I guess this request is similar to https://forum.cloudron.io/topic/2068/is-it-possible-to-have-open-registation

                  You beat me to it 🙂

                  Perhaps move that and this thread to feature requests?

                  F Offline
                  F Offline
                  fair
                  wrote on last edited by
                  #7

                  @jdaviescoates This looks quite interesting, I'm currently trying to make a script that will make users. But I think I'm missing bits and/or the docs are out of date. I manage to login, but get these fields back:

                  • accessToken
                  • tokenScopes
                  • identifier
                  • clientId
                  • expires

                  What I'm missing is what to do with those fields. Having them as cookies doesn't seem to work 🙂

                  F 1 Reply Last reply
                  0
                  • F fair

                    @jdaviescoates This looks quite interesting, I'm currently trying to make a script that will make users. But I think I'm missing bits and/or the docs are out of date. I manage to login, but get these fields back:

                    • accessToken
                    • tokenScopes
                    • identifier
                    • clientId
                    • expires

                    What I'm missing is what to do with those fields. Having them as cookies doesn't seem to work 🙂

                    F Offline
                    F Offline
                    fair
                    wrote on last edited by
                    #8

                    Got authentication working, requesting status works, but when I want to get a list of users with /api/v1/users

                    I get:

                    {
                    "status": "Unauthorized",
                    "message": "Unauthorized"
                    }

                    I also get this when trying to use this from the browser, but this is using the admin user.

                    1 Reply Last reply
                    0
                    • girishG Offline
                      girishG Offline
                      girish
                      Staff
                      wrote on last edited by
                      #9

                      @fair The status call doesn't require auth which is why maybe you think it work (but it doesn't). I tried quickly, this is how it should work:

                      $ curl https://my.demo.cloudron.io/api/v1/users?access_token=0c65ac11c01b894f29ae24e47023982b2e81413f45324af8b5be22cc65a4c61d
                      {
                        "users": [
                          {
                            "id": "uid-519b3541-7f42-4132-b1fc-225361b7c4a7",
                            "username": "ahoruz",
                            "email": "removed",
                            "displayName": "Ali",
                            "active": true
                          },
                          {
                            "id": "uid-d9e1bd2b-1214-4fec-9cac-d6cdeaf62bcd",
                            "username": "cloudron",
                            "email": "admin@cloudron.io",
                            "displayName": "cloudron",
                            "active": true
                          }
                        ]
                      }
                      
                      1 Reply Last reply
                      2
                      • girishG Offline
                        girishG Offline
                        girish
                        Staff
                        wrote on last edited by
                        #10

                        @fair Here's a script to create a user and invite them.

                        #!/bin/bash
                        
                        set -eu
                        
                        # fill these in
                        cloudron=my.domain.com
                        token=a803859d40c9ec4e111ccb111111111111111111111
                        
                        # the user to add and invite
                        username=test
                        email=test@cloudron.io
                        displayName="Test User"
                        
                        function urlencode() {
                            # https://unix.stackexchange.com/questions/159253/decoding-url-encoding-percent-encoding
                            python2.7 -c "import sys, urllib as ul; print(ul.quote_plus(sys.argv[1]))" $1
                        }
                        
                        # add user
                        if ! out=$(curl -sS --fail -H 'Content-Type: application/json' -X POST -d "{ \"email\": \"${email}\", \"username\": \"${username}\", \"displayName\": \"${displayName}\" }" https://${cloudron}/api/v1/users?access_token=${token}); then
                            echo "Failed to add user"
                            exit 1
                        fi
                        userid=$(echo ${out} | jq -r .id)
                        echo "User added: ${userid}"
                        
                        # create an invite. this does not send the email. if you like you can share the invite link using other channels
                        if ! out=$(curl -sS --fail -H 'Content-Type: application/json' -X POST https://${cloudron}/api/v1/users/${userid}/create_invite?access_token=${token}); then
                            echo "Failed to create invitation"
                            exit 1
                        fi
                        resetToken=$(echo ${out} | jq -r .resetToken)
                        encodedEmail=$(urlencode "${email}")
                        encodedDisplayName=$(urlencode "${displayName}")
                        echo "reset token: ${resetToken} . URL for user to sign up: https://${cloudron}/setupaccount.html?resetToken=${resetToken}&email=${encodedEmail}&displayName=${encodedDisplayName}&username=${username}&profileLocked=true"
                        
                        # tell cloudron to send the invite by mail. invite links are only valid for a day from when they were created
                        if ! out=$(curl -sS --fail -H 'Content-Type: application/json' -X POST https://${cloudron}/api/v1/users/${userid}/send_invite?access_token=${token}); then
                            echo "Failed to send invitation"
                            exit 1
                        fi
                        echo "Invitation sent"
                        
                        
                        1 Reply Last reply
                        3
                        • fbartelsF fbartels referenced this topic on
                        • fbartelsF fbartels referenced this topic on
                        • jdaviescoatesJ jdaviescoates referenced this topic on
                        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