carta-controller 4.0.0-rc.0 → 4.1.0
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/.readthedocs.yaml +22 -0
- package/README.md +2 -2
- package/dist/controllerTests.js +2 -1
- package/dist/serverHandlers.js +2 -1
- package/dist/util.js +3 -20
- package/docs/src/conf.py +3 -3
- package/docs/src/configuration.rst +4 -3
- package/docs/src/index.rst +3 -3
- package/docs/src/introduction.rst +1 -1
- package/package.json +2 -2
- package/docs/_build/doctrees/almalinux8_instructions.doctree +0 -0
- package/docs/_build/doctrees/centos8_instructions.doctree +0 -0
- package/docs/_build/doctrees/configuration.doctree +0 -0
- package/docs/_build/doctrees/environment.pickle +0 -0
- package/docs/_build/doctrees/index.doctree +0 -0
- package/docs/_build/doctrees/installation.doctree +0 -0
- package/docs/_build/doctrees/introduction.doctree +0 -0
- package/docs/_build/doctrees/schema.doctree +0 -0
- package/docs/_build/doctrees/schema_backend.doctree +0 -0
- package/docs/_build/doctrees/ubuntu_focal_instructions.doctree +0 -0
- package/docs/_build/html/.buildinfo +0 -4
- package/docs/_build/html/_sources/almalinux8_instructions.rst.txt +0 -255
- package/docs/_build/html/_sources/centos8_instructions.rst.txt +0 -247
- package/docs/_build/html/_sources/configuration.rst.txt +0 -160
- package/docs/_build/html/_sources/index.rst.txt +0 -40
- package/docs/_build/html/_sources/installation.rst.txt +0 -38
- package/docs/_build/html/_sources/introduction.rst.txt +0 -48
- package/docs/_build/html/_sources/schema.rst.txt +0 -7
- package/docs/_build/html/_sources/schema_backend.rst.txt +0 -7
- package/docs/_build/html/_sources/ubuntu_focal_instructions.rst.txt +0 -108
- package/docs/_build/html/_static/_sphinx_javascript_frameworks_compat.js +0 -134
- package/docs/_build/html/_static/basic.css +0 -899
- package/docs/_build/html/_static/config/config_schema.json +0 -766
- package/docs/_build/html/_static/config/example_backend.json +0 -7
- package/docs/_build/html/_static/config/example_config.json +0 -28
- package/docs/_build/html/_static/config/example_nginx.conf.stub +0 -26
- package/docs/_build/html/_static/config/example_sudoers_conf.stub +0 -7
- package/docs/_build/html/_static/config/layout_schema_2.json +0 -427
- package/docs/_build/html/_static/config/preference_backend_schema_2.json +0 -105
- package/docs/_build/html/_static/config/preference_schema_1.json +0 -270
- package/docs/_build/html/_static/config/preference_schema_2.json +0 -273
- package/docs/_build/html/_static/config/snippet_schema.json +0 -44
- package/docs/_build/html/_static/config/usertable.txt.stub +0 -5
- package/docs/_build/html/_static/config/workspace_schema_1.json +0 -255
- package/docs/_build/html/_static/css/badge_only.css +0 -1
- package/docs/_build/html/_static/css/custom.css +0 -16
- package/docs/_build/html/_static/css/fonts/Roboto-Slab-Bold.woff +0 -0
- package/docs/_build/html/_static/css/fonts/Roboto-Slab-Bold.woff2 +0 -0
- package/docs/_build/html/_static/css/fonts/Roboto-Slab-Regular.woff +0 -0
- package/docs/_build/html/_static/css/fonts/Roboto-Slab-Regular.woff2 +0 -0
- package/docs/_build/html/_static/css/fonts/fontawesome-webfont.eot +0 -0
- package/docs/_build/html/_static/css/fonts/fontawesome-webfont.svg +0 -2671
- package/docs/_build/html/_static/css/fonts/fontawesome-webfont.ttf +0 -0
- package/docs/_build/html/_static/css/fonts/fontawesome-webfont.woff +0 -0
- package/docs/_build/html/_static/css/fonts/fontawesome-webfont.woff2 +0 -0
- package/docs/_build/html/_static/css/fonts/lato-bold-italic.woff +0 -0
- package/docs/_build/html/_static/css/fonts/lato-bold-italic.woff2 +0 -0
- package/docs/_build/html/_static/css/fonts/lato-bold.woff +0 -0
- package/docs/_build/html/_static/css/fonts/lato-bold.woff2 +0 -0
- package/docs/_build/html/_static/css/fonts/lato-normal-italic.woff +0 -0
- package/docs/_build/html/_static/css/fonts/lato-normal-italic.woff2 +0 -0
- package/docs/_build/html/_static/css/fonts/lato-normal.woff +0 -0
- package/docs/_build/html/_static/css/fonts/lato-normal.woff2 +0 -0
- package/docs/_build/html/_static/css/theme.css +0 -4
- package/docs/_build/html/_static/doctools.js +0 -264
- package/docs/_build/html/_static/documentation_options.js +0 -14
- package/docs/_build/html/_static/file.png +0 -0
- package/docs/_build/html/_static/fonts/FontAwesome.otf +0 -0
- package/docs/_build/html/_static/fonts/Lato/lato-bold.eot +0 -0
- package/docs/_build/html/_static/fonts/Lato/lato-bold.ttf +0 -0
- package/docs/_build/html/_static/fonts/Lato/lato-bold.woff +0 -0
- package/docs/_build/html/_static/fonts/Lato/lato-bold.woff2 +0 -0
- package/docs/_build/html/_static/fonts/Lato/lato-bolditalic.eot +0 -0
- package/docs/_build/html/_static/fonts/Lato/lato-bolditalic.ttf +0 -0
- package/docs/_build/html/_static/fonts/Lato/lato-bolditalic.woff +0 -0
- package/docs/_build/html/_static/fonts/Lato/lato-bolditalic.woff2 +0 -0
- package/docs/_build/html/_static/fonts/Lato/lato-italic.eot +0 -0
- package/docs/_build/html/_static/fonts/Lato/lato-italic.ttf +0 -0
- package/docs/_build/html/_static/fonts/Lato/lato-italic.woff +0 -0
- package/docs/_build/html/_static/fonts/Lato/lato-italic.woff2 +0 -0
- package/docs/_build/html/_static/fonts/Lato/lato-regular.eot +0 -0
- package/docs/_build/html/_static/fonts/Lato/lato-regular.ttf +0 -0
- package/docs/_build/html/_static/fonts/Lato/lato-regular.woff +0 -0
- package/docs/_build/html/_static/fonts/Lato/lato-regular.woff2 +0 -0
- package/docs/_build/html/_static/fonts/Roboto-Slab-Bold.woff +0 -0
- package/docs/_build/html/_static/fonts/Roboto-Slab-Bold.woff2 +0 -0
- package/docs/_build/html/_static/fonts/Roboto-Slab-Light.woff +0 -0
- package/docs/_build/html/_static/fonts/Roboto-Slab-Light.woff2 +0 -0
- package/docs/_build/html/_static/fonts/Roboto-Slab-Regular.woff +0 -0
- package/docs/_build/html/_static/fonts/Roboto-Slab-Regular.woff2 +0 -0
- package/docs/_build/html/_static/fonts/Roboto-Slab-Thin.woff +0 -0
- package/docs/_build/html/_static/fonts/Roboto-Slab-Thin.woff2 +0 -0
- package/docs/_build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.eot +0 -0
- package/docs/_build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.ttf +0 -0
- package/docs/_build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff +0 -0
- package/docs/_build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff2 +0 -0
- package/docs/_build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.eot +0 -0
- package/docs/_build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.ttf +0 -0
- package/docs/_build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff +0 -0
- package/docs/_build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff2 +0 -0
- package/docs/_build/html/_static/fonts/fontawesome-webfont.eot +0 -0
- package/docs/_build/html/_static/fonts/fontawesome-webfont.svg +0 -2671
- package/docs/_build/html/_static/fonts/fontawesome-webfont.ttf +0 -0
- package/docs/_build/html/_static/fonts/fontawesome-webfont.woff +0 -0
- package/docs/_build/html/_static/fonts/fontawesome-webfont.woff2 +0 -0
- package/docs/_build/html/_static/fonts/lato-bold-italic.woff +0 -0
- package/docs/_build/html/_static/fonts/lato-bold-italic.woff2 +0 -0
- package/docs/_build/html/_static/fonts/lato-bold.woff +0 -0
- package/docs/_build/html/_static/fonts/lato-bold.woff2 +0 -0
- package/docs/_build/html/_static/fonts/lato-normal-italic.woff +0 -0
- package/docs/_build/html/_static/fonts/lato-normal-italic.woff2 +0 -0
- package/docs/_build/html/_static/fonts/lato-normal.woff +0 -0
- package/docs/_build/html/_static/fonts/lato-normal.woff2 +0 -0
- package/docs/_build/html/_static/jquery-3.5.1.js +0 -10872
- package/docs/_build/html/_static/jquery-3.6.0.js +0 -10881
- package/docs/_build/html/_static/jquery.js +0 -2
- package/docs/_build/html/_static/js/badge_only.js +0 -1
- package/docs/_build/html/_static/js/html5shiv-printshiv.min.js +0 -4
- package/docs/_build/html/_static/js/html5shiv.min.js +0 -4
- package/docs/_build/html/_static/js/modernizr.min.js +0 -4
- package/docs/_build/html/_static/js/theme.js +0 -1
- package/docs/_build/html/_static/language_data.js +0 -199
- package/docs/_build/html/_static/minus.png +0 -0
- package/docs/_build/html/_static/plus.png +0 -0
- package/docs/_build/html/_static/pygments.css +0 -74
- package/docs/_build/html/_static/scripts/carta_kill_script.sh +0 -17
- package/docs/_build/html/_static/searchtools.js +0 -530
- package/docs/_build/html/_static/underscore-1.13.1.js +0 -2042
- package/docs/_build/html/_static/underscore-1.3.1.js +0 -999
- package/docs/_build/html/_static/underscore.js +0 -6
- package/docs/_build/html/almalinux8_instructions.html +0 -341
- package/docs/_build/html/centos8_instructions.html +0 -331
- package/docs/_build/html/configuration.html +0 -320
- package/docs/_build/html/genindex.html +0 -108
- package/docs/_build/html/index.html +0 -168
- package/docs/_build/html/installation.html +0 -138
- package/docs/_build/html/introduction.html +0 -147
- package/docs/_build/html/objects.inv +0 -0
- package/docs/_build/html/schema.html +0 -1585
- package/docs/_build/html/schema_backend.html +0 -348
- package/docs/_build/html/search.html +0 -123
- package/docs/_build/html/searchindex.js +0 -1
- package/docs/_build/html/ubuntu_focal_instructions.html +0 -218
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# .readthedocs.yaml
|
|
2
|
+
# Read the Docs configuration file
|
|
3
|
+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
|
|
4
|
+
|
|
5
|
+
# Required
|
|
6
|
+
version: 2
|
|
7
|
+
|
|
8
|
+
# Set the version of Python and other tools you might need
|
|
9
|
+
build:
|
|
10
|
+
os: ubuntu-22.04
|
|
11
|
+
tools:
|
|
12
|
+
python: "3.11"
|
|
13
|
+
|
|
14
|
+
# Build documentation in the docs/ directory with Sphinx
|
|
15
|
+
sphinx:
|
|
16
|
+
configuration: docs/src/conf.py
|
|
17
|
+
|
|
18
|
+
# We recommend specifying your dependencies to enable reproducible builds:
|
|
19
|
+
# https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
|
|
20
|
+
python:
|
|
21
|
+
install:
|
|
22
|
+
- requirements: docs/requirements.txt
|
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# CARTA Controller
|
|
2
2
|
|
|
3
|
-
[](https://github.com/CARTAvis/carta-backend/releases/tag/v4.1.0)
|
|
4
|
+
[](https://npmjs.org/package/carta-controller "View this project on npm")
|
|
5
5
|

|
|
6
6
|

|
|
7
7
|
|
package/dist/controllerTests.js
CHANGED
package/dist/serverHandlers.js
CHANGED
package/dist/util.js
CHANGED
|
@@ -41,29 +41,12 @@ function verboseError(...args) {
|
|
|
41
41
|
}
|
|
42
42
|
exports.verboseError = verboseError;
|
|
43
43
|
function getUserId(username) {
|
|
44
|
-
var _a;
|
|
45
44
|
if (!username) {
|
|
46
45
|
throw new Error("Missing argument for username");
|
|
47
46
|
}
|
|
48
|
-
|
|
49
|
-
if (
|
|
50
|
-
|
|
51
|
-
usernameRegex = new RegExp(process.env.NAME_REGEX);
|
|
52
|
-
}
|
|
53
|
-
catch (err) {
|
|
54
|
-
console.warn(err);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
if (!usernameRegex) {
|
|
58
|
-
// As specified in useradd manpage
|
|
59
|
-
usernameRegex = /^[a-z_][a-z0-9_-]*[$]?$/gm;
|
|
60
|
-
}
|
|
61
|
-
if (!username.match(usernameRegex)) {
|
|
62
|
-
throw new Error("Malformed argument for username");
|
|
63
|
-
}
|
|
64
|
-
const result = (_a = (0, child_process_1.spawnSync)("id", ["-u", username])) === null || _a === void 0 ? void 0 : _a.stdout;
|
|
65
|
-
if (result) {
|
|
66
|
-
const uid = Number.parseInt(result);
|
|
47
|
+
const result = (0, child_process_1.spawnSync)("id", ["-u", username]);
|
|
48
|
+
if (!result.status && (result === null || result === void 0 ? void 0 : result.stdout)) {
|
|
49
|
+
const uid = Number.parseInt(result.stdout);
|
|
67
50
|
if (isFinite(uid)) {
|
|
68
51
|
return uid;
|
|
69
52
|
}
|
package/docs/src/conf.py
CHANGED
|
@@ -18,11 +18,11 @@
|
|
|
18
18
|
# -- Project information -----------------------------------------------------
|
|
19
19
|
|
|
20
20
|
project = 'CARTA Controller'
|
|
21
|
-
copyright = '2021, Angus Comrie, Adrianna Pińska and Robert Simmonds'
|
|
22
|
-
author = 'Angus Comrie, Adrianna Pińska and Robert Simmonds'
|
|
21
|
+
copyright = '2021, Angus Comrie, Adrianna Pińska, David Aikema and Robert Simmonds'
|
|
22
|
+
author = 'Angus Comrie, Adrianna Pińska, David Aikema and Robert Simmonds'
|
|
23
23
|
|
|
24
24
|
# The full version, including alpha/beta/rc tags
|
|
25
|
-
release = '4.
|
|
25
|
+
release = '4.1.0'
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
# -- General configuration ---------------------------------------------------
|
|
@@ -147,10 +147,11 @@ To test the configuration of the controller, you can use the built-in test featu
|
|
|
147
147
|
[
|
|
148
148
|
'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'
|
|
149
149
|
]
|
|
150
|
-
[
|
|
151
|
-
[
|
|
150
|
+
[2024-01-19 08:30:05.888Z] [CARTA] [info] /usr/bin/carta_backend: Version 4.1.0
|
|
151
|
+
[2024-01-19 08:30:05.888Z] [CARTA] [info] Listening on port 3499 with top level folder /usr/share/carta, starting folder /usr/share/carta, and 8 OpenMP worker threads
|
|
152
152
|
✔ Backend process started successfully
|
|
153
|
-
[
|
|
153
|
+
[2024-01-19 08:30:07.850Z] [CARTA] [info] 0x561f1a635180 ::Session (1235524527:1)
|
|
154
|
+
[2024-01-19 08:30:07.850Z] [CARTA] [info] Session 1235524527 [127.0.0.1] Connected. Num sessions: 1
|
|
154
155
|
✔ Backend process accepted connection
|
|
155
156
|
[ 'running sudo -u alice ./scripts/carta_kill_script.sh 54275' ]
|
|
156
157
|
✔ Backend process killed correctly
|
package/docs/src/index.rst
CHANGED
|
@@ -25,11 +25,11 @@ We officially support Ubuntu 18.04 and 20.04, and RHEL 7 and 8 (and their freely
|
|
|
25
25
|
schema
|
|
26
26
|
schema_backend
|
|
27
27
|
|
|
28
|
-
.. |backend-github| image:: https://img.shields.io/badge/CARTA%20Version-4.
|
|
28
|
+
.. |backend-github| image:: https://img.shields.io/badge/CARTA%20Version-4.1.0-brightgreen
|
|
29
29
|
:alt: View this backend version on GitHub
|
|
30
|
-
:target: https://github.com/CARTAvis/carta-backend/releases/tag/v4.
|
|
30
|
+
:target: https://github.com/CARTAvis/carta-backend/releases/tag/v4.1.0
|
|
31
31
|
|
|
32
|
-
.. |npm-package| image:: https://img.shields.io/npm/v/carta-controller
|
|
32
|
+
.. |npm-package| image:: https://img.shields.io/npm/v/carta-controller?style=flat
|
|
33
33
|
:alt: View this project on npm
|
|
34
34
|
:target: https://npmjs.org/package/carta-controller
|
|
35
35
|
|
|
@@ -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 ``v4.
|
|
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 ``v4.1.0`` 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
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "carta-controller",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.1.0",
|
|
4
4
|
"description": "NodeJS-based controller for CARTA",
|
|
5
5
|
"repository": "https://github.com/CARTAvis/carta-controller",
|
|
6
6
|
"homepage": "https://www.cartavis.org",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"ajv-formats": "^2.1.0",
|
|
25
25
|
"axios": "^0.27.2",
|
|
26
26
|
"body-parser": "^1.19.0",
|
|
27
|
-
"carta-frontend": "4.
|
|
27
|
+
"carta-frontend": "^4.1.0",
|
|
28
28
|
"chalk": "^4.1.2",
|
|
29
29
|
"compression": "^1.7.4",
|
|
30
30
|
"cookie-parser": "^1.4.5",
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,255 +0,0 @@
|
|
|
1
|
-
.. _almalinux8_instructions:
|
|
2
|
-
|
|
3
|
-
Step-by-step instructions for AlmaLinux 8
|
|
4
|
-
=========================================
|
|
5
|
-
|
|
6
|
-
.. note::
|
|
7
|
-
|
|
8
|
-
These instructions should also work for RHEL 8 and Rocky Linux 8. Some changes may be necessary for RHEL 7 / CentOS 7.
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
1. Install Node.js
|
|
12
|
-
~~~~~~~~~~~~~~~~~~
|
|
13
|
-
|
|
14
|
-
The CARTA controller uses `Node.js <https://nodejs.org/>`_ and supports v12, v14, and v16. Node.js can easily be installed from the AlmaLinux 8 AppStream repository. Here we install v14, as well as the ``npm`` package manager.
|
|
15
|
-
|
|
16
|
-
.. code-block:: shell
|
|
17
|
-
|
|
18
|
-
# Install Node.js v14:
|
|
19
|
-
sudo dnf module enable nodejs:14
|
|
20
|
-
sudo dnf install -y nodejs npm
|
|
21
|
-
|
|
22
|
-
# Check it is installed and working:
|
|
23
|
-
node --version
|
|
24
|
-
npm --version
|
|
25
|
-
|
|
26
|
-
2. Install MongoDB
|
|
27
|
-
~~~~~~~~~~~~~~~~~~
|
|
28
|
-
|
|
29
|
-
The CARTA controller uses `MongoDB <https://www.mongodb.com/>`_ to store user preferences, etc.. MongoDB is not available through the default AlmaLinux 8 repositories, but we can add a custom repository to install it more easily.
|
|
30
|
-
|
|
31
|
-
.. code-block:: shell
|
|
32
|
-
|
|
33
|
-
# Create a custom MongoDB repo file:
|
|
34
|
-
sudo cat <<EOT >> /etc/yum.repos.d/mongodb-org.repo
|
|
35
|
-
[mongodb-org-4.4]
|
|
36
|
-
name=MongoDB Repository
|
|
37
|
-
baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/4.4/x86_64/
|
|
38
|
-
gpgcheck=1
|
|
39
|
-
enabled=1
|
|
40
|
-
gpgkey=https://www.mongodb.org/static/pgp/server-4.4.asc
|
|
41
|
-
EOT
|
|
42
|
-
|
|
43
|
-
# Install MongoDB:
|
|
44
|
-
sudo dnf update
|
|
45
|
-
sudo dnf install -y mongodb-org
|
|
46
|
-
|
|
47
|
-
# Start and enable MongoDB to run on startup:
|
|
48
|
-
sudo systemctl start mongod
|
|
49
|
-
sudo systemctl enable mongod
|
|
50
|
-
|
|
51
|
-
# Check that it is working
|
|
52
|
-
sudo systemctl status mongod
|
|
53
|
-
|
|
54
|
-
.. note::
|
|
55
|
-
|
|
56
|
-
On RHEL7/CentOS7, MongoDB v14 can be installed as follows:
|
|
57
|
-
``curl -fsSL https://rpm.nodesource.com/setup_14.x | bash - && yum install -y nodejs``
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
3. Install the CARTA controller
|
|
61
|
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
62
|
-
|
|
63
|
-
The easiest way to install the CARTA controller is using ``npm``.
|
|
64
|
-
|
|
65
|
-
.. code-block:: shell
|
|
66
|
-
|
|
67
|
-
sudo dnf install -y python3 make gcc-c++
|
|
68
|
-
sudo npm install -g --unsafe-perm carta-controller
|
|
69
|
-
|
|
70
|
-
.. note::
|
|
71
|
-
|
|
72
|
-
The CARTA controller executable will be installed at ``/usr/local/lib/node_modules/carta-controller``.
|
|
73
|
-
The CARTA frontend will be installed at ``/usr/local/lib/node_modules/carta-controller/node_modules/carta-frontend/build``.
|
|
74
|
-
|
|
75
|
-
.. note::
|
|
76
|
-
|
|
77
|
-
Do not pass the ``--unsafe-perm`` flag to ``npm`` if using a local install.
|
|
78
|
-
|
|
79
|
-
.. note::
|
|
80
|
-
|
|
81
|
-
On RHEL7/CentOS7 the CARTA controller package can not run with the default gcc version 4.8.5 (there would be an error due to ``node-linux-pam``).
|
|
82
|
-
A work around is to install a newer GCC version from source in order to get a newer ``libstdc++.so.6``, then add the location of the newer
|
|
83
|
-
``libstdc++.so.6`` to the LD_LIBRARY_PATH. After that, the CARTA controller can run on RHEL7/CentOS7.
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
4. Install the CARTA backend
|
|
88
|
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
89
|
-
|
|
90
|
-
The easiest way is to install the CARTA backend is from our `cartavis/carta Copr <https://copr.fedorainfracloud.org/coprs/cartavis/carta/>`_ repository.
|
|
91
|
-
|
|
92
|
-
.. code-block:: shell
|
|
93
|
-
|
|
94
|
-
# Install the CARTA backend
|
|
95
|
-
sudo dnf -y install 'dnf-command(copr)'
|
|
96
|
-
sudo dnf -y copr enable cartavis/carta
|
|
97
|
-
sudo dnf -y install epel-release
|
|
98
|
-
sudo dnf -y install carta-backend
|
|
99
|
-
|
|
100
|
-
# Check that the backend can run and matches the major version number of the controller.
|
|
101
|
-
# Please note, we currently install the version of carta_backend in a non-standard location.
|
|
102
|
-
/opt/carta/bin/carta_backend --version
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
5. Install Nginx
|
|
106
|
-
~~~~~~~~~~~~~~~~
|
|
107
|
-
|
|
108
|
-
The CARTA controller requires a webserver. Here we use `NGINX <https://www.nginx.com/>`_, but Apache should work too.
|
|
109
|
-
|
|
110
|
-
.. code-block:: shell
|
|
111
|
-
|
|
112
|
-
# Install nginx:
|
|
113
|
-
sudo dnf install -y nginx
|
|
114
|
-
sudo systemctl start nginx
|
|
115
|
-
sudo systemctl enable nginx
|
|
116
|
-
sudo setsebool -P httpd_can_network_connect 1
|
|
117
|
-
sudo firewall-cmd --permanent --zone=public --add-service=http
|
|
118
|
-
sudo firewall-cmd --permanent --zone=public --add-service=https
|
|
119
|
-
sudo firewall-cmd --reload
|
|
120
|
-
|
|
121
|
-
# Set up the nginx configuration file using our sample configuration file linked below:
|
|
122
|
-
sudo cd /etc/nginx/conf.d/
|
|
123
|
-
sudo vi /etc/nginx/conf.d/carta.conf
|
|
124
|
-
sudo systemctl restart nginx
|
|
125
|
-
|
|
126
|
-
# Check it is running:
|
|
127
|
-
sudo systemctl status nginx
|
|
128
|
-
|
|
129
|
-
A :ref:`sample configuration file<example_nginx>` is provided in the configuration section. This should be adapted to your server configuration.
|
|
130
|
-
|
|
131
|
-
.. note::
|
|
132
|
-
If there are problems, you can debug with ``journactl -xe`` and by checking log files in ``/var/log/nginx/``.
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
6. Create the 'carta' user and modify sudoers
|
|
136
|
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
137
|
-
|
|
138
|
-
For security, we recommend not to run the CARTA controller as the root user. Therefore we create a new user called ``carta``.
|
|
139
|
-
|
|
140
|
-
We will assign the group ``carta-users`` to every user account and enable them to run ``/usr/bin/carta_backend`` and the script to close the CARTA backend, ``/usr/local/bin/carta-kill-script``, by adding a custom entry to the ``sudoers`` file.
|
|
141
|
-
|
|
142
|
-
.. code-block:: shell
|
|
143
|
-
|
|
144
|
-
# Create the carta user:
|
|
145
|
-
sudo adduser carta
|
|
146
|
-
# Check everything is OK
|
|
147
|
-
id carta
|
|
148
|
-
# It should show 'uid=1000(carta) gid=1000(carta) groups=1000(carta)'
|
|
149
|
-
|
|
150
|
-
# So that log files can be written:
|
|
151
|
-
sudo mkdir -p /var/log/carta
|
|
152
|
-
sudo chown -R carta /var/log/carta
|
|
153
|
-
|
|
154
|
-
# Add the custom sudoers file entry using our sample linked below
|
|
155
|
-
sudo visudo -f /etc/sudoers.d/carta_controller
|
|
156
|
-
|
|
157
|
-
An :ref:`example sudoers configuration<example_sudoers>` is provided in the configuration section.
|
|
158
|
-
|
|
159
|
-
.. note::
|
|
160
|
-
The only safe way to modify sudoers is using ``visudo``. Any syntax errors from directly editing sudoers could make your system unusable.
|
|
161
|
-
|
|
162
|
-
.. note::
|
|
163
|
-
The ``carta`` user should not be in the ``carta-users`` group. ``carta-users`` should only be assigned to the normal user accounts.
|
|
164
|
-
|
|
165
|
-
.. note::
|
|
166
|
-
As we install the version of the carta_backend in a non-standard location, please remember to change the path to the carta_backend executable in the custom sudoers file:
|
|
167
|
-
|
|
168
|
-
.. code-block:: bash
|
|
169
|
-
|
|
170
|
-
carta ALL=(%carta-users) NOPASSWD:SETENV: /opt/carta/bin/carta_backend
|
|
171
|
-
|
|
172
|
-
7. Set up the user authentication method
|
|
173
|
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
174
|
-
|
|
175
|
-
This is the most difficult step and depends on how you authenticate users at your institute. In this step-by-step guide we use PAM local authentication and a local user, ``bob``, on the server running the CARTA controller. The user ``bob`` needs to be part of the ``carta-users`` group.
|
|
176
|
-
|
|
177
|
-
With PAM authentication, the ``carta`` user that runs the CARTA controller requires access to the ``/etc/shadow`` file in order to authenticate other users. We can enable this by creating a new group called ``shadow`` and assigning the ``/etc/shadow`` file to that group.
|
|
178
|
-
|
|
179
|
-
.. note::
|
|
180
|
-
Only PAM with local authentication requires ``/etc/shadow`` access. PAM using LDAP, and Google OAuth, do not require ``/etc/shadow`` access.
|
|
181
|
-
|
|
182
|
-
.. code-block:: shell
|
|
183
|
-
|
|
184
|
-
# Create the test user 'bob':
|
|
185
|
-
sudo useradd -G carta-users bob
|
|
186
|
-
sudo passwd bob
|
|
187
|
-
|
|
188
|
-
# A new group called 'shadow' needs to be assinged to the /etc/shadow file and user 'carta':
|
|
189
|
-
sudo groupadd shadow
|
|
190
|
-
sudo chgrp shadow /etc/shadow
|
|
191
|
-
sudo chmod g+r /etc/shadow
|
|
192
|
-
sudo usermod -a -G shadow carta
|
|
193
|
-
ls -l /etc/shadow
|
|
194
|
-
# It should show permissions as ----r-----. 1 root shadow
|
|
195
|
-
# It could be helpful to reboot the server at this point
|
|
196
|
-
sudo reboot
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
8. Configure the CARTA controller
|
|
200
|
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
201
|
-
|
|
202
|
-
Create and fill in the ``config.json`` using our :ref:`sample configuration file<example_config>`.
|
|
203
|
-
Also generate private/public keys as they are used by the CARTA controller to sign/verify/refresh access tokens.
|
|
204
|
-
|
|
205
|
-
.. code-block:: shell
|
|
206
|
-
|
|
207
|
-
sudo mkdir /etc/carta
|
|
208
|
-
sudo chown -R carta /etc/carta
|
|
209
|
-
vi /etc/carta/config.json
|
|
210
|
-
|
|
211
|
-
# Generate private/public keys:
|
|
212
|
-
cd /etc/carta
|
|
213
|
-
sudo openssl genrsa -out carta_private.pem 4096
|
|
214
|
-
sudo openssl rsa -in carta_private.pem -outform PEM -pubout -out carta_public.pem
|
|
215
|
-
|
|
216
|
-
Please check the `CARTA Configuration Schema <https://carta-controller.readthedocs.io/en/latest/schema.html#schema>`_ for all available options.
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
9. Check everything is working
|
|
220
|
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
221
|
-
|
|
222
|
-
Here we switch to the ``carta`` user and test the CARTA controller with our test user ``bob``:
|
|
223
|
-
|
|
224
|
-
.. code-block:: shell
|
|
225
|
-
|
|
226
|
-
su - carta
|
|
227
|
-
carta-controller -verbose -test bob
|
|
228
|
-
|
|
229
|
-
If the test is successful, the CARTA controller should be ready to deploy.
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
10. Start the CARTA controller
|
|
233
|
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
234
|
-
|
|
235
|
-
.. code-block:: shell
|
|
236
|
-
|
|
237
|
-
su - carta
|
|
238
|
-
carta-controller
|
|
239
|
-
|
|
240
|
-
Now your users should be able to access your server's URL and log into CARTA.
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
Optional: Set up the CARTA controller to run with pm2
|
|
244
|
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
245
|
-
|
|
246
|
-
`pm2 <https://pm2.keymetrics.io/>`_ is a very convenient tool to keep the CARTA controller service running in the background, and even start it up automatically after a reboot.
|
|
247
|
-
|
|
248
|
-
.. code-block:: shell
|
|
249
|
-
|
|
250
|
-
sudo npm install -g pm2
|
|
251
|
-
su -carta
|
|
252
|
-
pm2 start carta-controller
|
|
253
|
-
|
|
254
|
-
Please refer to the `pm2 documentation <https://pm2.keymetrics.io/docs/usage/startup/>`_ for detailed instructions.
|
|
255
|
-
|