Convos::Core::Settings - Convos settings

  1. DESCRIPTION
  2. ATTRIBUTES
    1. contact
    2. core
    3. default_connection
    4. forced_connection
    5. local_secret
    6. open_to_public
    7. organization_name
    8. organization_url
    9. public_attributes
    10. rtc
    11. session_secrets
    12. uri
  3. METHODS
    1. defaults
    2. id
    3. load_p
    4. save_p
  4. SEE ALSO

DESCRIPTION

Convos::Core::Settings is a class used to model Convos server settings.

ATTRIBUTES

contact

$str = $settings->contact;
$settings = $settings->contact("mailto:[email protected]");

Holds a string with an URL to where the Convos admin can be contacted.

core

$obj = $settings->core;

Holds a Convos::Core object.

default_connection

$url = $settings->default_connection;
$settings = $settings->default_connection(Mojo::URL->new("irc://..."));

Holds a Mojo::URL object with the default connection URL. Default value is "irc://chat.freenode.net:6697/%23convos". (Subject to change)

forced_connection

$bool = $settings->forced_connection;
$settings = $settings->forced_connection(Mojo::JSON::true);

True if this instance of Convos can only connect to the "default_connection".

local_secret

$str = $settings->local_secret;

Holds a local password/secret that can be used to run admin actions from localhost.

open_to_public

$bool = $settings->open_to_public;
$settings = $settings->open_to_public(Mojo::JSON::true);

True if users can register without an invite link.

organization_name

$str = $settings->organization_name;
$settings = $settings->organization_name("Convos");

Can be used to customize the title and sidebars.

organization_url

$url = $settings->organization_url;
$settings = $settings->organization_url(Mojo::URL->new("https://..."));

Will be used together with a custom "organization_name" to add links to your organization in the Convos UI.

public_attributes

$array_ref = $settings->public_attributes;

Returns a list of "ATTRIBUTES" that are considered open_to_public. Currently that is: "contact", "default_connection", "forced_connection", "open_to_public", "organization_name" and "organization_url".

rtc

$hash_ref = $settings->rtc;

Holds information about how to set up a https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection. For now, it can be configured with an environment variable. Example:

# Required for signalling
CONVOS_STUN=stun://superwoman:[email protected]:3478?&bundlePolicy=balanced&credentialType=password&iceTransportPolicy=all&rtcpMuxPolicy=require

# Required for audio/video if NAT traversing is impossible
CONVOS_TURN=turn://superwoman:[email protected]:3478

The URL above will result in the RTCPeerConnection object with the following parameters:

new RTCPeerConnection({
  bundlePolicy: "balanced",   // optional
  iceTransportPolicy: "all",  // optional
  rtcpMuxPolicy: "require",   // optional
  iceServers: [
    {
      urls: "stun:stun.example.com:3478",  // required
      credential: "kryptonite",            // optional
      credentialType: "password",          // optional
      username: "superwoman",              // optional
    },
    {
      urls            => 'turn:turn.example.com:3478',
      credential      => 'k2',
      credential_type => 'password',
      username        => 'superman',
    },
  ],
})

The simplest version of CONVOS_RTC can be seen below, meaning all the query parameters and credentials are optional:

CONVOS_RTC=stun://stun.example.com:3478

IMPORTANT! The username and password will be visible inside the browser's developer tools, but you have to be logged in to see it.

session_secrets

$array_ref = $settings->session_secrets;

A list of strings used to make the session cookie safe. See also "secrets" in Mojolicious for a longer description.

uri

$path = $settings->uri;

Holds a Mojo::Path object, with the URI to where this object should be stored.

METHODS

defaults

$hash_ref = $settings->defaults;

Returns default settings.

id

$str = $settings->id;

Always returns "settings". Used by Convos::Core::Backend::File and friends.

load_p

$p = $settings->load_p;

Will save "ATTRIBUTES" to persistent storage. See "save_object" in Convos::Core::Backend for details.

save_p

$p = $settings->save_p(\%attributes);

Will save "ATTRIBUTES" to persistent storage. %attributes is optional, but willl be used to change the public "ATTRIBUTES".

See "save_object" in Convos::Core::Backend for details.

SEE ALSO

Convos.