From 4c6fab10e8d4beffeb50ad4ae0abffbdf4c03a5a Mon Sep 17 00:00:00 2001 From: Unknown Date: Tue, 27 Feb 2018 11:45:37 +0100 Subject: Update documentation After 0.10 release there were some updates and fixes, including how to upgrade to 0.10. Pulling all changes in, fixes https://0xacab.org/leap/leap_se/merge_requests/21 --- docs/en/services/webapp/index.html | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) (limited to 'docs/en/services/webapp/index.html') diff --git a/docs/en/services/webapp/index.html b/docs/en/services/webapp/index.html index acdc098c..0ae8b90e 100644 --- a/docs/en/services/webapp/index.html +++ b/docs/en/services/webapp/index.html @@ -199,7 +199,6 @@ webapp - LEAP Platform Documentation @@ -218,33 +217,38 @@ webapp - LEAP Platform Documentation

Invite codes

-

Enabling the invite code functionality will require new users to provide a valid invite code while signing up for a new account. This is turned off by default, allowing all new users to create an account.

+

The invite code functionality will require new users to provide a valid invite code while signing up for a new account. This is turned on by default since platform version 0.10. When switching it off, anyone will be able to create a new account.

-

Set the invite_code option to true in services/webapp.json:

+

Because even the first (admin) user that registers needs to have an invite code at hand, you´ll have to generate one:

-
{
-  "webapp": {
-    "invite_required": true
-  }
-}
+
workstation$ leap run invite
+  = [bumblebee] running `cd /srv/leap/webapp; RAILS_ENV=production bundle exec rake "generate_invites[1,1]"`
+  = [bumblebee] pgae-aaub
+  = [bumblebee] complete in 5.031s.
 
-

This only works with LEAP platform 0.8 or higher.

+

Where bumblebee should be replaced with the name of your webapp node. You can now browse to https://example.com (replace with your domain) and register your first user, by using the invite code you just generated. If you added your user as an admin user (see above), you can now also generate new invite codes from within the web application.

-

Run leap deploy to enable the option.

+

It is possible to specify both NUM, the amount of codes to generate and USES: an optional parameter: by default all new invite codes can be used once and will then become invalid. If you provide another value, you can set how often it can be used before they’re invalidated. To generate 2 codes that can be both reused 3 times you can run this:

-

You can then generate invite codes by logging into the web application with an admin user.

+
workstation$ leap run invite 2,3 prodcution
+  = [bumblebee] running `cd /srv/leap/webapp; RAILS_ENV=production bundle exec rake "generate_invites[2,3]"`
+  = [bumblebee] pgae-aaub
+
+ +

psau-2qwbs + = [bumblebee] complete in 5.031s.

-

Alternately, you can also generate invite codes with the command line:

+

If you want to open up registration to the world, you can set the enrollment_policy option to open in provider.json:

-
workstation$ leap ssh bumblebee
-bumblebee# cd /srv/leap/webapp/
-bumblebee# sudo -u leap-webapp RAILS_ENV=production bundle exec rake "generate_invites[NUM,USES]"
+
{
+  "enrollment_policy": "open"
+}
 
-

Where bumblebee should be replaced with the name of your webapp node.

+

This only works with LEAP platform 0.8 or higher. The default enrollment policy changed from open to invite with the platform 0.10.

-

The NUM specifies the amount of codes to generate. The USES parameter is optional: By default, all new invite codes can be used once and will then become invalid. If you provide another value for USES, you can set a different amount of maximum uses for the codes you generate.

+

Run leap deploy to disable the option.

Customization

-- cgit v1.2.3