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.
Files changed (143) hide show
  1. package/.readthedocs.yaml +22 -0
  2. package/README.md +2 -2
  3. package/dist/controllerTests.js +2 -1
  4. package/dist/serverHandlers.js +2 -1
  5. package/dist/util.js +3 -20
  6. package/docs/src/conf.py +3 -3
  7. package/docs/src/configuration.rst +4 -3
  8. package/docs/src/index.rst +3 -3
  9. package/docs/src/introduction.rst +1 -1
  10. package/package.json +2 -2
  11. package/docs/_build/doctrees/almalinux8_instructions.doctree +0 -0
  12. package/docs/_build/doctrees/centos8_instructions.doctree +0 -0
  13. package/docs/_build/doctrees/configuration.doctree +0 -0
  14. package/docs/_build/doctrees/environment.pickle +0 -0
  15. package/docs/_build/doctrees/index.doctree +0 -0
  16. package/docs/_build/doctrees/installation.doctree +0 -0
  17. package/docs/_build/doctrees/introduction.doctree +0 -0
  18. package/docs/_build/doctrees/schema.doctree +0 -0
  19. package/docs/_build/doctrees/schema_backend.doctree +0 -0
  20. package/docs/_build/doctrees/ubuntu_focal_instructions.doctree +0 -0
  21. package/docs/_build/html/.buildinfo +0 -4
  22. package/docs/_build/html/_sources/almalinux8_instructions.rst.txt +0 -255
  23. package/docs/_build/html/_sources/centos8_instructions.rst.txt +0 -247
  24. package/docs/_build/html/_sources/configuration.rst.txt +0 -160
  25. package/docs/_build/html/_sources/index.rst.txt +0 -40
  26. package/docs/_build/html/_sources/installation.rst.txt +0 -38
  27. package/docs/_build/html/_sources/introduction.rst.txt +0 -48
  28. package/docs/_build/html/_sources/schema.rst.txt +0 -7
  29. package/docs/_build/html/_sources/schema_backend.rst.txt +0 -7
  30. package/docs/_build/html/_sources/ubuntu_focal_instructions.rst.txt +0 -108
  31. package/docs/_build/html/_static/_sphinx_javascript_frameworks_compat.js +0 -134
  32. package/docs/_build/html/_static/basic.css +0 -899
  33. package/docs/_build/html/_static/config/config_schema.json +0 -766
  34. package/docs/_build/html/_static/config/example_backend.json +0 -7
  35. package/docs/_build/html/_static/config/example_config.json +0 -28
  36. package/docs/_build/html/_static/config/example_nginx.conf.stub +0 -26
  37. package/docs/_build/html/_static/config/example_sudoers_conf.stub +0 -7
  38. package/docs/_build/html/_static/config/layout_schema_2.json +0 -427
  39. package/docs/_build/html/_static/config/preference_backend_schema_2.json +0 -105
  40. package/docs/_build/html/_static/config/preference_schema_1.json +0 -270
  41. package/docs/_build/html/_static/config/preference_schema_2.json +0 -273
  42. package/docs/_build/html/_static/config/snippet_schema.json +0 -44
  43. package/docs/_build/html/_static/config/usertable.txt.stub +0 -5
  44. package/docs/_build/html/_static/config/workspace_schema_1.json +0 -255
  45. package/docs/_build/html/_static/css/badge_only.css +0 -1
  46. package/docs/_build/html/_static/css/custom.css +0 -16
  47. package/docs/_build/html/_static/css/fonts/Roboto-Slab-Bold.woff +0 -0
  48. package/docs/_build/html/_static/css/fonts/Roboto-Slab-Bold.woff2 +0 -0
  49. package/docs/_build/html/_static/css/fonts/Roboto-Slab-Regular.woff +0 -0
  50. package/docs/_build/html/_static/css/fonts/Roboto-Slab-Regular.woff2 +0 -0
  51. package/docs/_build/html/_static/css/fonts/fontawesome-webfont.eot +0 -0
  52. package/docs/_build/html/_static/css/fonts/fontawesome-webfont.svg +0 -2671
  53. package/docs/_build/html/_static/css/fonts/fontawesome-webfont.ttf +0 -0
  54. package/docs/_build/html/_static/css/fonts/fontawesome-webfont.woff +0 -0
  55. package/docs/_build/html/_static/css/fonts/fontawesome-webfont.woff2 +0 -0
  56. package/docs/_build/html/_static/css/fonts/lato-bold-italic.woff +0 -0
  57. package/docs/_build/html/_static/css/fonts/lato-bold-italic.woff2 +0 -0
  58. package/docs/_build/html/_static/css/fonts/lato-bold.woff +0 -0
  59. package/docs/_build/html/_static/css/fonts/lato-bold.woff2 +0 -0
  60. package/docs/_build/html/_static/css/fonts/lato-normal-italic.woff +0 -0
  61. package/docs/_build/html/_static/css/fonts/lato-normal-italic.woff2 +0 -0
  62. package/docs/_build/html/_static/css/fonts/lato-normal.woff +0 -0
  63. package/docs/_build/html/_static/css/fonts/lato-normal.woff2 +0 -0
  64. package/docs/_build/html/_static/css/theme.css +0 -4
  65. package/docs/_build/html/_static/doctools.js +0 -264
  66. package/docs/_build/html/_static/documentation_options.js +0 -14
  67. package/docs/_build/html/_static/file.png +0 -0
  68. package/docs/_build/html/_static/fonts/FontAwesome.otf +0 -0
  69. package/docs/_build/html/_static/fonts/Lato/lato-bold.eot +0 -0
  70. package/docs/_build/html/_static/fonts/Lato/lato-bold.ttf +0 -0
  71. package/docs/_build/html/_static/fonts/Lato/lato-bold.woff +0 -0
  72. package/docs/_build/html/_static/fonts/Lato/lato-bold.woff2 +0 -0
  73. package/docs/_build/html/_static/fonts/Lato/lato-bolditalic.eot +0 -0
  74. package/docs/_build/html/_static/fonts/Lato/lato-bolditalic.ttf +0 -0
  75. package/docs/_build/html/_static/fonts/Lato/lato-bolditalic.woff +0 -0
  76. package/docs/_build/html/_static/fonts/Lato/lato-bolditalic.woff2 +0 -0
  77. package/docs/_build/html/_static/fonts/Lato/lato-italic.eot +0 -0
  78. package/docs/_build/html/_static/fonts/Lato/lato-italic.ttf +0 -0
  79. package/docs/_build/html/_static/fonts/Lato/lato-italic.woff +0 -0
  80. package/docs/_build/html/_static/fonts/Lato/lato-italic.woff2 +0 -0
  81. package/docs/_build/html/_static/fonts/Lato/lato-regular.eot +0 -0
  82. package/docs/_build/html/_static/fonts/Lato/lato-regular.ttf +0 -0
  83. package/docs/_build/html/_static/fonts/Lato/lato-regular.woff +0 -0
  84. package/docs/_build/html/_static/fonts/Lato/lato-regular.woff2 +0 -0
  85. package/docs/_build/html/_static/fonts/Roboto-Slab-Bold.woff +0 -0
  86. package/docs/_build/html/_static/fonts/Roboto-Slab-Bold.woff2 +0 -0
  87. package/docs/_build/html/_static/fonts/Roboto-Slab-Light.woff +0 -0
  88. package/docs/_build/html/_static/fonts/Roboto-Slab-Light.woff2 +0 -0
  89. package/docs/_build/html/_static/fonts/Roboto-Slab-Regular.woff +0 -0
  90. package/docs/_build/html/_static/fonts/Roboto-Slab-Regular.woff2 +0 -0
  91. package/docs/_build/html/_static/fonts/Roboto-Slab-Thin.woff +0 -0
  92. package/docs/_build/html/_static/fonts/Roboto-Slab-Thin.woff2 +0 -0
  93. package/docs/_build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.eot +0 -0
  94. package/docs/_build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.ttf +0 -0
  95. package/docs/_build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff +0 -0
  96. package/docs/_build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff2 +0 -0
  97. package/docs/_build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.eot +0 -0
  98. package/docs/_build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.ttf +0 -0
  99. package/docs/_build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff +0 -0
  100. package/docs/_build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff2 +0 -0
  101. package/docs/_build/html/_static/fonts/fontawesome-webfont.eot +0 -0
  102. package/docs/_build/html/_static/fonts/fontawesome-webfont.svg +0 -2671
  103. package/docs/_build/html/_static/fonts/fontawesome-webfont.ttf +0 -0
  104. package/docs/_build/html/_static/fonts/fontawesome-webfont.woff +0 -0
  105. package/docs/_build/html/_static/fonts/fontawesome-webfont.woff2 +0 -0
  106. package/docs/_build/html/_static/fonts/lato-bold-italic.woff +0 -0
  107. package/docs/_build/html/_static/fonts/lato-bold-italic.woff2 +0 -0
  108. package/docs/_build/html/_static/fonts/lato-bold.woff +0 -0
  109. package/docs/_build/html/_static/fonts/lato-bold.woff2 +0 -0
  110. package/docs/_build/html/_static/fonts/lato-normal-italic.woff +0 -0
  111. package/docs/_build/html/_static/fonts/lato-normal-italic.woff2 +0 -0
  112. package/docs/_build/html/_static/fonts/lato-normal.woff +0 -0
  113. package/docs/_build/html/_static/fonts/lato-normal.woff2 +0 -0
  114. package/docs/_build/html/_static/jquery-3.5.1.js +0 -10872
  115. package/docs/_build/html/_static/jquery-3.6.0.js +0 -10881
  116. package/docs/_build/html/_static/jquery.js +0 -2
  117. package/docs/_build/html/_static/js/badge_only.js +0 -1
  118. package/docs/_build/html/_static/js/html5shiv-printshiv.min.js +0 -4
  119. package/docs/_build/html/_static/js/html5shiv.min.js +0 -4
  120. package/docs/_build/html/_static/js/modernizr.min.js +0 -4
  121. package/docs/_build/html/_static/js/theme.js +0 -1
  122. package/docs/_build/html/_static/language_data.js +0 -199
  123. package/docs/_build/html/_static/minus.png +0 -0
  124. package/docs/_build/html/_static/plus.png +0 -0
  125. package/docs/_build/html/_static/pygments.css +0 -74
  126. package/docs/_build/html/_static/scripts/carta_kill_script.sh +0 -17
  127. package/docs/_build/html/_static/searchtools.js +0 -530
  128. package/docs/_build/html/_static/underscore-1.13.1.js +0 -2042
  129. package/docs/_build/html/_static/underscore-1.3.1.js +0 -999
  130. package/docs/_build/html/_static/underscore.js +0 -6
  131. package/docs/_build/html/almalinux8_instructions.html +0 -341
  132. package/docs/_build/html/centos8_instructions.html +0 -331
  133. package/docs/_build/html/configuration.html +0 -320
  134. package/docs/_build/html/genindex.html +0 -108
  135. package/docs/_build/html/index.html +0 -168
  136. package/docs/_build/html/installation.html +0 -138
  137. package/docs/_build/html/introduction.html +0 -147
  138. package/docs/_build/html/objects.inv +0 -0
  139. package/docs/_build/html/schema.html +0 -1585
  140. package/docs/_build/html/schema_backend.html +0 -348
  141. package/docs/_build/html/search.html +0 -123
  142. package/docs/_build/html/searchindex.js +0 -1
  143. 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
- [![carta version](https://img.shields.io/badge/CARTA%20Version-4.0.0--rc.0-brightgreen)](https://github.com/CARTAvis/carta-backend/releases/tag/v4.0.0-rc.0)
4
- [![npm version](https://img.shields.io/npm/v/carta-controller/rc.svg?style=flat)](https://npmjs.org/package/carta-controller "View this project on npm")
3
+ [![carta version](https://img.shields.io/badge/CARTA%20Version-4.1.0-brightgreen)](https://github.com/CARTAvis/carta-backend/releases/tag/v4.1.0)
4
+ [![npm version](https://img.shields.io/npm/v/carta-controller?style=flat)](https://npmjs.org/package/carta-controller "View this project on npm")
5
5
  ![last commit](https://img.shields.io/github/last-commit/CARTAvis/carta-controller)
6
6
  ![commit activity](https://img.shields.io/github/commit-activity/m/CARTAvis/carta-controller)
7
7
 
@@ -188,7 +188,8 @@ function testBackendStartup(username) {
188
188
  "-u",
189
189
  `${username}`,
190
190
  config_1.ServerConfig.processCommand,
191
- "--no_http",
191
+ "--no_frontend",
192
+ "--no_database",
192
193
  "--debug_no_auth",
193
194
  "--port",
194
195
  `${port}`,
@@ -185,7 +185,8 @@ function startServer(username) {
185
185
  "-u",
186
186
  `${username}`,
187
187
  config_1.ServerConfig.processCommand,
188
- "--no_http",
188
+ "--no_frontend",
189
+ "--no_database",
189
190
  "--port",
190
191
  `${port}`,
191
192
  "--top_level_folder",
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
- let usernameRegex = undefined;
49
- if (process.env.NAME_REGEX) {
50
- try {
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.0.0-rc.0'
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
- [2021-11-30 12:28:48.207] [info] /usr/bin/carta_backend: Version 4.0.0-rc.0
151
- [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.
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
- [2021-11-30 12:28:50.169] [info] Session 1 [127.0.0.1] Connected. Num sessions: 1
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
@@ -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.0.0--rc.0-brightgreen
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.0.0-rc.0
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/rc.svg?style=flat
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.0.0-rc.0`` tag of `the CARTA backend <https://github.com/CARTAvis/carta-backend>`_.
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.0.0-rc.0",
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.0.0-rc.0",
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
@@ -1,4 +0,0 @@
1
- # Sphinx build info version 1
2
- # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
3
- config: da393b3be735681649122eea563dee26
4
- tags: 645f666f9bcd5a90fca523b33c5a78b7
@@ -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
-