carta-controller 3.0.0-beta.1d → 3.0.0-dev.20220301
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/config/config_schema.json +29 -3
- package/config/example_backend.json +7 -0
- package/config/preference_backend_schema_2.json +105 -0
- package/dist/auth/index.js +13 -10
- package/dist/auth/index.js.map +1 -1
- package/dist/auth/ldap.js +3 -3
- package/dist/auth/ldap.js.map +1 -1
- package/dist/auth/local.js +38 -17
- package/dist/auth/local.js.map +1 -1
- package/dist/auth/pam.js +1 -1
- package/dist/auth/pam.js.map +1 -1
- package/dist/config.js +2 -2
- package/dist/controllerTests.js +17 -17
- package/dist/database.js +9 -9
- package/dist/index.js +11 -10
- package/dist/serverHandlers.js +54 -17
- package/dist/types.js +7 -0
- package/docs/src/centos8_instructions.rst +248 -0
- package/docs/src/conf.py +1 -1
- package/docs/src/configuration.rst +58 -4
- package/docs/src/index.rst +7 -4
- package/docs/src/installation.rst +2 -2
- package/docs/src/introduction.rst +1 -1
- package/docs/src/schema_backend.rst +7 -0
- package/docs/src/ubuntu_focal_instructions.rst +2 -2
- package/package.json +3 -3
- package/public/dashboard.js +2 -2
- package/views/templated.pug +1 -1
|
@@ -8,7 +8,7 @@ Configuration
|
|
|
8
8
|
System Configuration
|
|
9
9
|
--------------------
|
|
10
10
|
|
|
11
|
-
.. _config-backend:
|
|
11
|
+
.. _config-backend-permissions:
|
|
12
12
|
|
|
13
13
|
CARTA backend permissions
|
|
14
14
|
~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
@@ -68,10 +68,10 @@ By default, the controller attempts to write log files to the ``/var/log/carta``
|
|
|
68
68
|
|
|
69
69
|
.. _config-controller:
|
|
70
70
|
|
|
71
|
-
Controller
|
|
71
|
+
Controller configuration
|
|
72
72
|
------------------------
|
|
73
73
|
|
|
74
|
-
Controller configuration is handled by a configuration file in JSONC (JSON with JavaScript style comments) format, adhering to the :ref:`CARTA configuration schema<schema>`. An `example configuration file <_static/config/example_config.json>`_ is provided:
|
|
74
|
+
Controller configuration is handled by a configuration file in JSONC (JSON with JavaScript style comments) format, adhering to the :ref:`CARTA controller configuration schema<schema>`. An `example controller configuration file <_static/config/example_config.json>`_ is provided:
|
|
75
75
|
|
|
76
76
|
.. literalinclude:: _static/config/example_config.json
|
|
77
77
|
:language: json
|
|
@@ -79,7 +79,11 @@ Controller configuration is handled by a configuration file in JSONC (JSON with
|
|
|
79
79
|
|
|
80
80
|
By default, the controller assumes the config file is located at ``/etc/carta/config.json``, but you can change this with the ``--config`` or ``-c`` command line argument when running the controller.
|
|
81
81
|
|
|
82
|
-
|
|
82
|
+
Configuration may also be added in separate files in a ``config.d`` directory in the same parent directory as the specified config file. Each file in this directory must be a valid configuration file. Any files found will be processed in alphabetical order, after the main configuration file.
|
|
83
|
+
|
|
84
|
+
The controller automatically executes the backend with the ``--no_http`` flag, to suppress the backend's built-in HTTP server. If the ``logFileTemplate`` configuration option is set, ``--no_log`` is also used to suppress user-level logs. ``--port`` is used to override the default port. ``--top_level_folder`` and a positional argument are used to set the top-level and starting data directories for the user, as specified in the ``rootFolderTemplate`` and ``baseFolderTemplate`` options, respectively.
|
|
85
|
+
|
|
86
|
+
To specify additional backend flags, we recommend editing a :ref:`global backend preferences<config-backend>` file. Most commandline arguments to the backend are also recognised as configuration options. The ``additionalArgs`` field in the controller configuration file can be used for any debug options which are not, and to disable the local or global configuration files.
|
|
83
87
|
|
|
84
88
|
If you use an external :ref:`authentication<authentication>` system, you may need to translate a unique ID (such as email or username) from the authenticated external user information to an internal system user. You can do this by providing a `user lookup table <_static/config/usertable.txt.stub>`_, which is watched by the controller and reloaded whenever it is updated:
|
|
85
89
|
|
|
@@ -87,3 +91,53 @@ If you use an external :ref:`authentication<authentication>` system, you may nee
|
|
|
87
91
|
:language: cfg
|
|
88
92
|
|
|
89
93
|
You can alter the controller's dashboard appearance by adjusting the ``dashboard`` field in the config file. You can change the banner image and background, and add login instructions or institutional notices.
|
|
94
|
+
|
|
95
|
+
The ``httpOnly`` flag can be used to disable secure signing of authentication tokens. This should only be used during initial deployment and testing, or debugging.
|
|
96
|
+
|
|
97
|
+
.. _config-backend:
|
|
98
|
+
|
|
99
|
+
Backend configuration
|
|
100
|
+
---------------------
|
|
101
|
+
|
|
102
|
+
The global configuration file for the CARTA backend is located at ``/etc/carta/backend.json``. A per-user configuration file can also be placed in each user's local CARTA preferences directory (typically ``.carta`` or ``.carta-beta`` in the user's home directory, depending on how the CARTA backend was installed). On a multi-user system, if users have write access to this location, you may wish to disable the use of per-user configuration files, to prevent users from bypassing the root directory configuration set by the controller. This must be done through the ``additionalArgs`` field in the :ref:`controller configuration<config-controller>`.
|
|
103
|
+
|
|
104
|
+
The backend configuration file must adhere to the :ref:`CARTA backend configuration schema<schema_backend>`. An `example backend configuration file <_static/config/example_backend.json>`_ is provided:
|
|
105
|
+
|
|
106
|
+
.. literalinclude:: _static/config/example_backend.json
|
|
107
|
+
:language: json
|
|
108
|
+
:name: example_backend
|
|
109
|
+
|
|
110
|
+
.. _test-config:
|
|
111
|
+
|
|
112
|
+
Testing the configuration
|
|
113
|
+
-------------------------
|
|
114
|
+
|
|
115
|
+
To test the configuration of the controller, you can use the built-in test feature. Run ``carta-controller --verbose --test <username>`` as the ``carta`` user (or whichever user has the :ref:`added sudoers permissions<config-backend-permissions>`). ``<username>`` should be a user in the ``carta-users`` group. The expected output looks like this:
|
|
116
|
+
|
|
117
|
+
.. code-block::
|
|
118
|
+
|
|
119
|
+
Checking config file /etc/carta/config.json
|
|
120
|
+
Adding additional config file config.d/pam.json
|
|
121
|
+
No top-level folder was specified. Reverting to default location
|
|
122
|
+
Testing configuration with user alice
|
|
123
|
+
Password for user alice:
|
|
124
|
+
✔ Checked PAM connection for user alice
|
|
125
|
+
✔ Verified uid (1000) for user alice
|
|
126
|
+
✔ Generated access token for user alice
|
|
127
|
+
✔ Checked database connection
|
|
128
|
+
✔ Checked log writing for user alice
|
|
129
|
+
✔ Read frontend index.html from /custom/frontend/path/build
|
|
130
|
+
[
|
|
131
|
+
'running sudo --preserve-env=CARTA_AUTH_TOKEN -n -u alice /usr/bin/carta_backend --no_http --debug_no_auth --port 3499 --top_level_folder /usr/share/carta --no_log /usr/share/carta'
|
|
132
|
+
]
|
|
133
|
+
[2021-11-30 12:28:48.207] [info] /usr/bin/carta_backend: Version 3.0.0-beta.2
|
|
134
|
+
[2021-11-30 12:28:48.209] [info] Listening on port 3499 with top level folder /usr/share/carta, starting folder /usr/share/carta. The number of OpenMP worker threads will be handled automatically.
|
|
135
|
+
✔ Backend process started successfully
|
|
136
|
+
[2021-11-30 12:28:50.169] [info] Session 1 [127.0.0.1] Connected. Num sessions: 1
|
|
137
|
+
✔ Backend process accepted connection
|
|
138
|
+
[ 'running sudo -u alice ./scripts/carta_kill_script.sh 54275' ]
|
|
139
|
+
✔ Backend process killed correctly
|
|
140
|
+
Controller tests with user alice succeeded
|
|
141
|
+
|
|
142
|
+
.. note::
|
|
143
|
+
If you run the controller from a source directory using ``npm``, use ``--`` to ensure that any commandline parameters are passed to the controller and not to ``npm``. For example: ``npm run start -- --verbose --test alice``.
|
package/docs/src/index.rst
CHANGED
|
@@ -10,7 +10,8 @@ CARTA Controller
|
|
|
10
10
|
|
|
11
11
|
CARTA is the Cube Analysis and Rendering Tool for Astronomy. This document describes the installation and configuration process for the controller component.
|
|
12
12
|
|
|
13
|
-
Detailed
|
|
13
|
+
Detailed step-by-step instructions are provided for :ref:`Ubuntu 20.04 (Focal Fossa)<focal_instructions>` and :ref:`CentOS 8<centos8_instructions>`.
|
|
14
|
+
We officially support Ubuntu 18.04 and 20.04, and RHEL 7 and 8 (and their freely distributed binary-compatible alternatives, such as CentOS or AlmaLinux), with all available standard updates applied.
|
|
14
15
|
|
|
15
16
|
.. toctree::
|
|
16
17
|
:maxdepth: 2
|
|
@@ -20,13 +21,15 @@ Detailed :ref:`step-by-step instructions<focal_instructions>` are provided for U
|
|
|
20
21
|
installation
|
|
21
22
|
configuration
|
|
22
23
|
ubuntu_focal_instructions
|
|
24
|
+
centos8_instructions
|
|
23
25
|
schema
|
|
26
|
+
schema_backend
|
|
24
27
|
|
|
25
|
-
.. |backend-github| image:: https://img.shields.io/badge/CARTA%20Version-3.0.0--beta.
|
|
28
|
+
.. |backend-github| image:: https://img.shields.io/badge/CARTA%20Version-3.0.0--beta.2-brightgreen
|
|
26
29
|
:alt: View this backend version on GitHub
|
|
27
|
-
:target: https://github.com/CARTAvis/carta-backend/releases/tag/v3.0.0-beta.
|
|
30
|
+
:target: https://github.com/CARTAvis/carta-backend/releases/tag/v3.0.0-beta.2
|
|
28
31
|
|
|
29
|
-
.. |npm-package| image:: https://img.shields.io/npm/v/carta-controller/
|
|
32
|
+
.. |npm-package| image:: https://img.shields.io/npm/v/carta-controller/beta.svg?style=flat
|
|
30
33
|
:alt: View this project on npm
|
|
31
34
|
:target: https://npmjs.org/package/carta-controller
|
|
32
35
|
|
|
@@ -8,7 +8,7 @@ Installation
|
|
|
8
8
|
Installing the backend
|
|
9
9
|
----------------------
|
|
10
10
|
|
|
11
|
-
We provide `binary Debian packages <https://launchpad.net/~cartavis-team/+archive/ubuntu/carta>`_ of the latest
|
|
11
|
+
We provide `binary Debian packages <https://launchpad.net/~cartavis-team/+archive/ubuntu/carta>`_ of the latest beta and release versions of the CARTA backend for Ubuntu 20.04 (Focal Fossa) and Ubuntu 18.04 (Bionic Beaver). You can install the beta version with all dependencies by adding our PPA to your system and running ``apt-get install carta-backend-beta``. Please refer to our :ref:`Ubuntu Focal instructions<focal_instructions>` for more details.
|
|
12
12
|
|
|
13
13
|
.. note::
|
|
14
14
|
|
|
@@ -28,7 +28,7 @@ If you install the controller from NPM, the corresponding packaged version of th
|
|
|
28
28
|
Installing the controller
|
|
29
29
|
-------------------------
|
|
30
30
|
|
|
31
|
-
You can install the
|
|
31
|
+
You can install the beta version of the CARTA controller from NPM by running ``npm install -g carta-controller@beta``, or from GitHub by cloning the `controller repository <https://github.com/CARTAvis/carta-controller/>`_ and running ``npm install``.
|
|
32
32
|
|
|
33
33
|
.. _run_controller:
|
|
34
34
|
|
|
@@ -10,7 +10,7 @@ The CARTA controller provides a simple dashboard which authenticates users and a
|
|
|
10
10
|
Dependencies
|
|
11
11
|
------------
|
|
12
12
|
|
|
13
|
-
To allow the controller to serve CARTA sessions, you must give it access to an executable CARTA backend, which can be either a compiled executable or a container. If you want to use a non-standard version of the CARTA frontend, you must also build it, and adjust the controller configuration to point to it. You should use the ``v3.0.0-beta.
|
|
13
|
+
To allow the controller to serve CARTA sessions, you must give it access to an executable CARTA backend, which can be either a compiled executable or a container. If you want to use a non-standard version of the CARTA frontend, you must also build it, and adjust the controller configuration to point to it. You should use the ``v3.0.0-beta.2`` tag of `the CARTA backend <https://github.com/CARTAvis/carta-backend>`_.
|
|
14
14
|
|
|
15
15
|
By default, the controller runs on port 8000. It should be run behind a proxy, so that it can be accessed via HTTP and HTTPS.
|
|
16
16
|
|
|
@@ -19,7 +19,7 @@ Install the CARTA backend and other required packages
|
|
|
19
19
|
sudo add-apt-repository ppa:cartavis-team/carta
|
|
20
20
|
sudo apt-get update
|
|
21
21
|
|
|
22
|
-
# Install the
|
|
22
|
+
# Install the beta backend package with all dependencies
|
|
23
23
|
sudo apt-get install carta-backend-beta
|
|
24
24
|
|
|
25
25
|
# Install additional packages
|
|
@@ -74,7 +74,7 @@ Install CARTA controller
|
|
|
74
74
|
sudo apt-get install -y nodejs build-essential
|
|
75
75
|
|
|
76
76
|
# Install carta-controller (includes frontend config)
|
|
77
|
-
sudo npm install -g --unsafe-perm carta-controller@
|
|
77
|
+
sudo npm install -g --unsafe-perm carta-controller@beta
|
|
78
78
|
|
|
79
79
|
# Install PM2 node service
|
|
80
80
|
sudo npm install -g pm2
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "carta-controller",
|
|
3
|
-
"version": "3.0.0-
|
|
3
|
+
"version": "3.0.0-dev.20220301",
|
|
4
4
|
"description": "NodeJS-based controller for CARTA",
|
|
5
5
|
"repository": "https://github.com/CARTAvis/carta-controller",
|
|
6
6
|
"homepage": "https://www.cartavis.org",
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
"ajv": "^8.2.0",
|
|
24
24
|
"ajv-formats": "^2.1.0",
|
|
25
25
|
"body-parser": "^1.19.0",
|
|
26
|
-
"carta-frontend": "^3.0.0-
|
|
27
|
-
"chalk": "^4.1.
|
|
26
|
+
"carta-frontend": "^3.0.0-dev.20220222",
|
|
27
|
+
"chalk": "^4.1.2",
|
|
28
28
|
"compression": "^1.7.4",
|
|
29
29
|
"cookie-parser": "^1.4.5",
|
|
30
30
|
"cors": "^2.8.5",
|
package/public/dashboard.js
CHANGED
|
@@ -25,7 +25,7 @@ apiCall = async (callName, jsonBody, method, authRequired) => {
|
|
|
25
25
|
const options = {
|
|
26
26
|
method: method || "get"
|
|
27
27
|
};
|
|
28
|
-
if (jsonBody) {
|
|
28
|
+
if (method !== "get" && jsonBody) {
|
|
29
29
|
options.body = JSON.stringify(jsonBody);
|
|
30
30
|
options.headers = {"Content-Type": "application/json"}
|
|
31
31
|
} else {
|
|
@@ -103,7 +103,7 @@ setButtonDisabled = (elementId, disabled) => {
|
|
|
103
103
|
updateServerStatus = async () => {
|
|
104
104
|
let hasServer = false;
|
|
105
105
|
try {
|
|
106
|
-
const res = await apiCall("server/status",
|
|
106
|
+
const res = await apiCall("server/status", {}, "get", true);
|
|
107
107
|
if (res.ok) {
|
|
108
108
|
const body = await res.json();
|
|
109
109
|
if (body.success && body.running) {
|
package/views/templated.pug
CHANGED