configuration.md 8.19 KB
Newer Older
Benoit Lavenier's avatar
Benoit Lavenier committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
# Configuration

On a web server or local installation, Cesium use a configuration to set default settings, like default peer, timeout, ...
   
## Deployment configuration

When deploying Cesium (on web server or locally for a standalone use), you need to change this default configuration :

- Edit the file `config.js`:  
```js
angular.module("cesium.config", [])
.constant("csConfig", {
  "cacheTimeMs": 60000,
  "fallbackLanguage": "en",
  "rememberMe": false,
  "showUDHistory": false,
  "timeout": 10000,
  "timeWarningExpireMembership": 5184000,
  "timeWarningExpire": 7776000,
  "useLocalStorage": true,
21
  "useRelative": false,
Benoit Lavenier's avatar
Benoit Lavenier committed
22
  "expertMode": false,
23
  "decimalCount": 2,
24
  "httpsMode": false,
25
  "shareBaseUrl": "https://g1.duniter.fr",
Benoit Lavenier's avatar
Benoit Lavenier committed
26 27 28 29 30
  "helptip": {
    "enable": true,
    "installDocUrl": "https://github.com/duniter/duniter/blob/master/doc/install-a-node.md"
  },
  "node": {
31 32
    "host": "g1-test.duniter.org",
    "port": 10900
Benoit Lavenier's avatar
Benoit Lavenier committed
33
  },
34 35 36 37 38 39
  "fallbackNodes": [
    {
      "host": "g1-test.cgeek.fr",
      "port": 443
    }
  ],
Benoit Lavenier's avatar
Benoit Lavenier committed
40 41
	"plugins": {
		"es": {
42 43 44
			"enable": "true",
			"host": "g1-test.data.duniter.fr",
			"port": 443
Benoit Lavenier's avatar
Benoit Lavenier committed
45 46 47 48
		}
	},
	"version": "...",
	"build": "...",
49 50
	"newIssueUrl": "https://git.duniter.org/clients/cesium/cesium/issues/new",
  "userForumUrl": "https://forum.duniter.org"
Benoit Lavenier's avatar
Benoit Lavenier committed
51 52 53
});
```

54 55 56 57 58 59 60 61 62
## Minimal configuration file

Because of default options values (see details below), the minimal configuration file should be:

- without any extension:
  ```js
  angular.module("cesium.config", [])
  .constant("csConfig", {
  	"node": {
63
  		"host": "g1-test.duniter.org",
64 65
  		"port": "10900"
  	},
66 67
  	"version": "...",
  	"build": "..."
68 69 70 71 72 73 74 75
  });
  ```

- with ES (Cesium+) extension:
  ```js
    angular.module("cesium.config", [])
    .constant("csConfig", {
    	"node": {
76
    		"host": "g1-test.duniter.org",
77
    		"port": 10900
78 79 80
    	},
    	"plugins": {
    	   "es": {
81 82
           "host": "g1-test.data.duniter.fr",
           "port": 443
83 84
         }
      },
85 86
    	"version": "...",
    	"build": "..."
87 88 89 90 91 92 93 94 95 96 97 98 99
    });
    ```
  
## Core options

### Technical and mandatory options 

This technical options are mandatory in the configuration file. User can NOT changed them.

Option                      | Description
--------------------------- | -------------------------------------------
version                     | Build version. Filled at compilation time.
build                       | Build date. Filled at compilation time.
Benoit Lavenier's avatar
Benoit Lavenier committed
100 101


102
### Technical and optional options 
Benoit Lavenier's avatar
Benoit Lavenier committed
103

104
This technical options are optional (default values will be applied if not set). User can NOT changed them.
Benoit Lavenier's avatar
Benoit Lavenier committed
105

106 107
Option                      | Description                                                                                    | Default value
--------------------------- | ---------------------------------------------------------------------------------------------- | -----------------
108
fallbackNodes               | Fallback nodes, when default node is unreacheable (array of object with host+port properties)  | no fallback nodes
109 110 111
cacheTimeMs                 | Default network request cache time, in millisecond.                                            | `60000` (1 min).
fallbackLanguage            | Default locale, if browser default language not exists in Cesium                               | `en`
defaultLanguage             | Used to force the default language (ignore browser's language), on user first connection.      | =`fallbackLanguage`
Benoit Lavenier's avatar
Benoit Lavenier committed
112
decimalCount                | Number of decimal to display, on float value (when using relative unit)                        | `4`
113
shareBaseUrl                | Used in share buttons, to reference another web site.                                          | not defined (will use navigator's window location) 
114 115 116
helptip.installDocUrl       | Used in features tour, for the link 'How-to install my own node'.                              | URL of [Duniter installation node](https://duniter.org/en/wiki/duniter/install/)
newIssueUrl                 | Used for link in the About screen, to submit new issue                                         | URL of [Cesium issues](https://git.duniter.org/clients/cesium/cesium/issues/new)
userForumUrl                | Link to the user forum, show in the About screen                                               | URL of [forum.monnaie-libre.fr](forum.monnaie-libre.fr)
117 118 119
timeout                     | Default network request timeout, in millisecond.                                               | `4000`
timeWarningExpire           | Delay (in second) before expiration of certifications, use to warn the user that there will soon be a lack of certifications | `5184000` (2 mois)
timeWarningExpireMembership | Delay (in second) before membership expiration, use to warns user that he should renew his membership.  | `7776000` (3 mois)
120 121
logoutIdle                  | Duration (in second) of inactivity, before logout                                              | `600` (10 minutes)
logoutTimout                | Duration (in second) of a warning message, before logout                                       | `15` (15s)
122 123 124 125
walletHistoryTimeSecond     | Default transaction history to load (in second), in 'My account' screen.                       | `86400` (30 days) 
walletHistorySliceSecond    | Slice size (in second) for downloading transaction history (need for cache optimization)       | `432000` (5 days)
wallet.alertIfUnusedWallet  | Should warn user if account seems to be used ?                                                 | `true`

Benoit Lavenier's avatar
Benoit Lavenier committed
126 127 128
> This default values are defined in [this code](../www/js/services/settings-services.js#L44)


129 130 131
### User options

This options can be changed by user action (generally using Settings screen, or action buttons).
Benoit Lavenier's avatar
Benoit Lavenier committed
132 133


134 135 136 137
Options                     | Description                                                                        | Default value
--------------------------- | ---------------------------------------------------------------------------------- | ------------------------------------------
expertMode                  | Enable the expert mode (display more technical details)                            | `false`
helptip.enable              | Should open help tips (contextual tips) ?                                          | `true`
138 139 140 141
node.host                   | Duniter peer host to use by default (DNS name or IP)                               | No default value (mandatory in `config.js` file)
node.port                   | Duniter peer port to use by default                                                | No default value (mandatory in `config.js` file)
node.useSsl                 | Duniter peer port to use by default                                                | `true` if `node.port=443` or if Cesium URL starts with `https://`, `false` otherwise
rememberMe                  | Default value of the 'Remember me' button, in the login popup                      | `true` on Android  build, `false` otherwise
142 143 144
showUDHistory               | Should display UD history in the transaction history ?                             | `false`
showLoginSalt               | Should display salt value (pass phrase) in the login screen. If `false`, masked.   | `false`
useLocalStorage             | Enable data storage (settings, credentials, cache) in the browser local storage ?  | `true`
145
useRelative                 | Should use relative unit (UD) by default ?                                         | `false`
146 147
wallet.showPubkey           | Should display pubkey and uid in 'My account' screen ?                             | `true`
wallet.notificationReadTime | Time (in second) since the last notification read.                                 | `0` (never read)
Benoit Lavenier's avatar
Benoit Lavenier committed
148 149


150
## Plugin options
Benoit Lavenier's avatar
Benoit Lavenier committed
151

152 153
### ES API (for Cesium +)

Benoit Lavenier's avatar
fix doc  
Benoit Lavenier committed
154 155
This options should be defined in `config.js`, to enable Cesium+ extension.
Then user can change this default values (generally using the Settings screen).
Benoit Lavenier's avatar
Benoit Lavenier committed
156 157

Options                     | Description
Benoit Lavenier's avatar
fix doc  
Benoit Lavenier committed
158 159
--------------------------- | -------------------------------------------- 
plugins.es.enable           | Enable or not Cesium+ extension, by default.
160 161
plugins.es.host             | Default ES node host (DNS name or IP)
plugins.es.port             | Default ES node port
Benoit Lavenier's avatar
Benoit Lavenier committed
162 163


164 165
> To **remove** the extension (and not only disable by default): remove all content inside the `plugins` attribute.
> Users will NOT be able to enable the extension.