You have been redirected from an outdated version of the article. Below is the content available on this topic. To view the old article click here.

structr.com

https://structr.com

Search results for "structr.com"

Apple macOS

  1. Download the file ending with -dist.zip from https://structr.com/resources/download.

  2. Open a terminal, cd to the Download folder and extract the downloaded file:
    unzip structr-<version>-dist.zip

  3. Enter the directory which has been created
    cd structr-<version>

  4. Start Structr
    bin/start
    You should see the following console output:

User self-registration

Instead of creating users in the Structr backend manually in the Users and Groups section of Structr’s admin UI, you can allow users to sign-up/self-register. The registration process uses double-opt in by default. All you need is a simple page where new users can enter their e-mail address so Structr can send them an e-mail with a confirmation link.

The following pre-defined MailTemplate keys can be used to configure the self-registration process. In version 4.0 they have been renamed to have a more uniform structure.

Note: The Mail Configuration Settings have to be done for self-registration mails to be sent.

Name Old Name (removed as of v4.1) Used as Default
CONFIRM_REGISTRATION_SENDER_ADDRESS SENDER_ADDRESS The sender address of the registration mail structr-mail-daemon@localhost
CONFIRM_REGISTRATION_SENDER_NAME SENDER_NAME The sender name of the registration mail Structr Mail Daemon
CONFIRM_REGISTRATION_SUBJECT SUBJECT The subject of the registration mail Welcome to Structr, please finalize registration
CONFIRM_REGISTRATION_TEXT_BODY TEXT_BODY The plaintext body of the registration mail Go to ${link} to finalize registration.
CONFIRM_REGISTRATION_HTML_BODY HTML_BODY The HTML body of the registration mail <div>Click <a href='${link}'>here</a> to finalize registration.</div>
CONFIRM_REGISTRATION_BASE_URL BASE_URL Used to build the link variable ${base_url}
CONFIRM_REGISTRATION_TARGET_PAGE TARGET_PAGE the target parameter value for the redirection target page name register_thanks
CONFIRM_REGISTRATION_ERROR_PAGE ERROR_PAGE the error parameter value for the error redirection target page name register_error

Notes:

  • The visibility flags of these MailTemplates are ignored because the self-registration mail is created as a privileged user.
  • A special link variable is provided for the TEXT_BODY and HTML_BODY templates and can be output with the usual syntax: ${link}
    • Example link: https://support.structr.com/confirm_registration?key=<CONFIRM_KEY>&target=/dashboard&onerror=/register-error
  • From v4.1 scripting is enabled in two templates: CONFIRM_REGISTRATION_TEXT_BODY and CONFIRM_REGISTRATION_TEXT_BODY. The script is being run in the context of the user (me keyword points to the user).
  • In any version prior to 4.1 scripting can not be used and simple text replacement is done

Sandbox Service

To create a sandbox, go to https://structr.com and click on the button labeled “Try it out!” and follow the instructions.

400 Bad Request: User self-registration is not configured yet, cannot create new user.

You need to enable and configure user self-registration according to https://docs.structr.com/docs/handling-user-sessions#user-self-registration

Unable to log in - Too many failed login attempts

By default, Structr auto-locks an account after 4 incorrect login attempts. Further login attempts (even with the correct password) result in the error message “Too many failed login attempts”. This security setting can be configured via the configuration setting security.passwordpolicy.maxfailedattempts. The default is 4 and the functionality is disabled for any number less than or equal to 0.

The number of failed login attempts is stored in the user node in the attribute passwordAttempts. Setting this attribute to 0 enables the user to log in again.

This can be done using the superadmin credentials (or any other admin account) by sending a PUT request to the appropriate resource (/structr/rest/User/[UUID_OF_USER]) with the body {"passwordAttempts":0}. It can also be solved by temporarily changing the setting to 0 and logging in.

Password Reset

To allow users to regain access to their account when they forgot their password we need to enable them to reset their password.

Note: The Mail Configuration has to be done for password retrieval mails to be sent.

Name Used as Default
 RESET_PASSWORD_SENDER_ADDRESS Sender address structr-mail-daemon@localhost
 RESET_PASSWORD_SENDER_NAME Sender name Structr Mail Daemon
 RESET_PASSWORD_SUBJECT Subject line Request to reset your Structr password
 RESET_PASSWORD_TEXT_BODY Plaintext mail body Go to ${link} to reset your password.
 RESET_PASSWORD_HTML_BODY HTML mail body <div>Click <a href='${link}'>here</a> to reset your password.</div>
 RESET_PASSWORD_BASE_URL Used to build the link variable ${base_url}
 RESET_PASSWORD_TARGET_PAGE target parameter value in the link variable. Specifies the redirect page after successful login. /reset-password

Notes:

  • The visibility flags of these MailTemplates are ignored because the self-registration mail is created as a privileged user.
  • A special link variable is provided for the TEXT_BODY and HTML_BODY templates and can be output with the usual syntax: ${link}
    • Example link: https://support.structr.com/reset-password?key=<PASSWORD-RESET-KEY>&target=/reset-password
  • From v4.1 scripting is two templates: RESET_PASSWORD_TEXT_BODY and RESET_PASSWORD_HTML_BODY. The script is being run in the context of the user (me keyword points to the user).
  • In any version prior to 4.1 scripting can not be used and simple text replacement is done.

Kubernetes / Helm

helm repo add structr https://structr.com/helm
helm repo update

afterCreate

{
let self = Structr.get('this');

let subject = 'Node was created!';
let text = 'Node named ' + self.name + ' was created';

Structr.send_html_mail('info@structr.com', 'Structr', 'user@domain.com', 'Test User', subject, text, text);
}