suvi 2.7.0__tar.gz

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 (93) hide show
  1. suvi-2.7.0/.gitignore +10 -0
  2. suvi-2.7.0/.gitlab-ci.yml +70 -0
  3. suvi-2.7.0/.vscode/.ropeproject/config.py +123 -0
  4. suvi-2.7.0/.vscode/launch.json +47 -0
  5. suvi-2.7.0/.vscode/settings.json +19 -0
  6. suvi-2.7.0/MANIFEST.in +3 -0
  7. suvi-2.7.0/Makefile +12 -0
  8. suvi-2.7.0/PKG-INFO +203 -0
  9. suvi-2.7.0/README.md +190 -0
  10. suvi-2.7.0/deadTasks/curl.json +10 -0
  11. suvi-2.7.0/deadTasks/dd.json +12 -0
  12. suvi-2.7.0/deadTasks/dd10000.json +11 -0
  13. suvi-2.7.0/deadTasks/dirbs.json +9 -0
  14. suvi-2.7.0/deadTasks/env_test.json +11 -0
  15. suvi-2.7.0/deadTasks/env_test_python.json +9 -0
  16. suvi-2.7.0/deadTasks/ls.json +8 -0
  17. suvi-2.7.0/deadTasks/notepad-od.json +8 -0
  18. suvi-2.7.0/deadTasks/notepad-shed.json +9 -0
  19. suvi-2.7.0/deadTasks/notepad.json +8 -0
  20. suvi-2.7.0/deadTasks/print_env.json +8 -0
  21. suvi-2.7.0/deadTasks/scheduled-kill-without-real-target.json +9 -0
  22. suvi-2.7.0/deadTasks/scheduled-kill.json +9 -0
  23. suvi-2.7.0/deadTasks/scheduled.json +10 -0
  24. suvi-2.7.0/deadTasks/sleeper50.json +15 -0
  25. suvi-2.7.0/deadTasks/tailf.json +14 -0
  26. suvi-2.7.0/deadTasks/talend-demo-job-with-subtask.zip +0 -0
  27. suvi-2.7.0/deadTasks/talend-demo-job.zip +0 -0
  28. suvi-2.7.0/deadTasks/talend-with-subtask.json +9 -0
  29. suvi-2.7.0/deadTasks/talend.json +10 -0
  30. suvi-2.7.0/deadTasks/windows-folder-test.json +8 -0
  31. suvi-2.7.0/pyproject.toml +52 -0
  32. suvi-2.7.0/setup.cfg +4 -0
  33. suvi-2.7.0/suvi/__init__.py +0 -0
  34. suvi-2.7.0/suvi/app.py +998 -0
  35. suvi-2.7.0/suvi/multiuser_basic_auth.py +69 -0
  36. suvi-2.7.0/suvi/static/_variables.scss +8 -0
  37. suvi-2.7.0/suvi/static/dependencies/bootstrap.bundle.js +7 -0
  38. suvi-2.7.0/suvi/static/dependencies/bootstrap.bundle.min.js +7 -0
  39. suvi-2.7.0/suvi/static/dependencies/bootstrap.min.css +6 -0
  40. suvi-2.7.0/suvi/static/dependencies/htmx.min.js +1 -0
  41. suvi-2.7.0/suvi/static/dependencies/jquery.min.js +2 -0
  42. suvi-2.7.0/suvi/static/img/code.png +0 -0
  43. suvi-2.7.0/suvi/static/img/download.png +0 -0
  44. suvi-2.7.0/suvi/static/img/ecmind-logo-dark.svg +69 -0
  45. suvi-2.7.0/suvi/static/img/ecmind-logo-light.svg +69 -0
  46. suvi-2.7.0/suvi/static/img/exec/shell.png +0 -0
  47. suvi-2.7.0/suvi/static/img/exec/stop.png +0 -0
  48. suvi-2.7.0/suvi/static/img/exec/system.png +0 -0
  49. suvi-2.7.0/suvi/static/img/exec/talend.png +0 -0
  50. suvi-2.7.0/suvi/static/img/favicon.ico +0 -0
  51. suvi-2.7.0/suvi/static/img/info.png +0 -0
  52. suvi-2.7.0/suvi/static/img/log.png +0 -0
  53. suvi-2.7.0/suvi/static/img/recycle.png +0 -0
  54. suvi-2.7.0/suvi/static/img/reload.png +0 -0
  55. suvi-2.7.0/suvi/static/img/remove.png +0 -0
  56. suvi-2.7.0/suvi/static/img/shutdown.png +0 -0
  57. suvi-2.7.0/suvi/static/img/start.png +0 -0
  58. suvi-2.7.0/suvi/static/img/stop.png +0 -0
  59. suvi-2.7.0/suvi/static/img/suvi-dark.svg +43 -0
  60. suvi-2.7.0/suvi/static/img/suvi-light.svg +43 -0
  61. suvi-2.7.0/suvi/static/img/talend.svg +21 -0
  62. suvi-2.7.0/suvi/static/img/text.png +0 -0
  63. suvi-2.7.0/suvi/static/site.css +22 -0
  64. suvi-2.7.0/suvi/task.py +172 -0
  65. suvi-2.7.0/suvi/templates/about.html +33 -0
  66. suvi-2.7.0/suvi/templates/base.html +20 -0
  67. suvi-2.7.0/suvi/templates/log.html +10 -0
  68. suvi-2.7.0/suvi/templates/log_inner.html +29 -0
  69. suvi-2.7.0/suvi/templates/manage.html +39 -0
  70. suvi-2.7.0/suvi/templates/nav.html +29 -0
  71. suvi-2.7.0/suvi/templates/osslic.html +10 -0
  72. suvi-2.7.0/suvi/templates/ps.html +14 -0
  73. suvi-2.7.0/suvi/templates/ps_inner.html +35 -0
  74. suvi-2.7.0/suvi/templates/taskinfo.html +11 -0
  75. suvi-2.7.0/suvi/templates/tasklog.html +10 -0
  76. suvi-2.7.0/suvi/templates/tasklog_inner.html +47 -0
  77. suvi-2.7.0/suvi/templates/tasklogs.html +14 -0
  78. suvi-2.7.0/suvi/templates/tasklogs_inner.html +30 -0
  79. suvi-2.7.0/suvi/templates/tasks.html +14 -0
  80. suvi-2.7.0/suvi/templates/tasks_inner.html +132 -0
  81. suvi-2.7.0/suvi.egg-info/PKG-INFO +203 -0
  82. suvi-2.7.0/suvi.egg-info/SOURCES.txt +91 -0
  83. suvi-2.7.0/suvi.egg-info/dependency_links.txt +1 -0
  84. suvi-2.7.0/suvi.egg-info/entry_points.txt +2 -0
  85. suvi-2.7.0/suvi.egg-info/requires.txt +15 -0
  86. suvi-2.7.0/suvi.egg-info/top_level.txt +1 -0
  87. suvi-2.7.0/suvi.systemd.example +11 -0
  88. suvi-2.7.0/suvi.toml +13 -0
  89. suvi-2.7.0/suvi.winsw.example +32 -0
  90. suvi-2.7.0/tasks/cat.json +8 -0
  91. suvi-2.7.0/tasks/sleeper10.json +8 -0
  92. suvi-2.7.0/tasks/stoptest.json +5 -0
  93. suvi-2.7.0/tasks/wc.json +7 -0
suvi-2.7.0/.gitignore ADDED
@@ -0,0 +1,10 @@
1
+ __pycache__/
2
+ /build
3
+ /serve.spec
4
+ .vscode/.ropeproject/objectdb
5
+ log/
6
+ env/
7
+ suvi.egg-info/
8
+ dist/
9
+ .vscode/*.log
10
+ exe/
@@ -0,0 +1,70 @@
1
+ stages:
2
+ - build
3
+ - deploy
4
+
5
+ build:
6
+ stage: build
7
+ image: python:3.11
8
+ variables:
9
+ GIT_DEPTH: 0
10
+ script:
11
+ - python -m venv .venv
12
+ - source .venv/bin/activate
13
+ - pip install --upgrade pip
14
+ - pip install -e ".[dev]"
15
+ - python -m build --no-isolation --sdist --wheel
16
+ artifacts:
17
+ paths:
18
+ - dist/*
19
+
20
+ deploy_gitlab:
21
+ stage: deploy
22
+ image: python:3.11
23
+ variables:
24
+ TWINE_USERNAME: gitlab-ci-token
25
+ TWINE_PASSWORD: $CI_JOB_TOKEN
26
+ script:
27
+ - python -m venv .venv
28
+ - source .venv/bin/activate
29
+ - pip install --upgrade pip
30
+ - pip install -e ".[dev]"
31
+ - python -m twine upload --verbose --skip-existing --repository-url ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/pypi dist/*
32
+ needs:
33
+ - build
34
+
35
+ deploy_pypi_test:
36
+ stage: deploy
37
+ image: python:3.11
38
+ variables:
39
+ TWINE_USERNAME: __token__
40
+ TWINE_PASSWORD: $PYPI_TEST_TOKEN
41
+ script:
42
+ - python -m venv .venv
43
+ - source .venv/bin/activate
44
+ - pip install -e ".[dev]"
45
+ - python3 -m twine upload --verbose --skip-existing --repository testpypi dist/*
46
+ needs:
47
+ - build
48
+ only:
49
+ - tags
50
+ except:
51
+ - branches
52
+
53
+ deploy_pypi:
54
+ stage: deploy
55
+ image: python:3.11
56
+ variables:
57
+ TWINE_USERNAME: __token__
58
+ TWINE_PASSWORD: $PYPI_TOKEN
59
+ script:
60
+ - python -m venv .venv
61
+ - source .venv/bin/activate
62
+ - pip install -e ".[dev]"
63
+ - python3 -m twine upload --verbose --skip-existing --repository pypi dist/*
64
+ needs:
65
+ - build
66
+ - deploy_pypi_test
67
+ only:
68
+ - tags
69
+ except:
70
+ - branches
@@ -0,0 +1,123 @@
1
+ # The default ``config.py``
2
+ # flake8: noqa
3
+
4
+
5
+ def set_prefs(prefs):
6
+ """This function is called before opening the project"""
7
+
8
+ # Specify which files and folders to ignore in the project.
9
+ # Changes to ignored resources are not added to the history and
10
+ # VCSs. Also they are not returned in `Project.get_files()`.
11
+ # Note that ``?`` and ``*`` match all characters but slashes.
12
+ # '*.pyc': matches 'test.pyc' and 'pkg/test.pyc'
13
+ # 'mod*.pyc': matches 'test/mod1.pyc' but not 'mod/1.pyc'
14
+ # '.svn': matches 'pkg/.svn' and all of its children
15
+ # 'build/*.o': matches 'build/lib.o' but not 'build/sub/lib.o'
16
+ # 'build//*.o': matches 'build/lib.o' and 'build/sub/lib.o'
17
+ prefs["ignored_resources"] = [
18
+ "*.pyc",
19
+ "*~",
20
+ ".ropeproject",
21
+ ".hg",
22
+ ".svn",
23
+ "_svn",
24
+ ".git",
25
+ ".tox",
26
+ ]
27
+
28
+ # Specifies which files should be considered python files. It is
29
+ # useful when you have scripts inside your project. Only files
30
+ # ending with ``.py`` are considered to be python files by
31
+ # default.
32
+ # prefs['python_files'] = ['*.py']
33
+
34
+ # Custom source folders: By default rope searches the project
35
+ # for finding source folders (folders that should be searched
36
+ # for finding modules). You can add paths to that list. Note
37
+ # that rope guesses project source folders correctly most of the
38
+ # time; use this if you have any problems.
39
+ # The folders should be relative to project root and use '/' for
40
+ # separating folders regardless of the platform rope is running on.
41
+ # 'src/my_source_folder' for instance.
42
+ # prefs.add('source_folders', 'src')
43
+
44
+ # You can extend python path for looking up modules
45
+ # prefs.add('python_path', '~/python/')
46
+
47
+ # Should rope save object information or not.
48
+ prefs["save_objectdb"] = True
49
+ prefs["compress_objectdb"] = False
50
+
51
+ # If `True`, rope analyzes each module when it is being saved.
52
+ prefs["automatic_soa"] = True
53
+ # The depth of calls to follow in static object analysis
54
+ prefs["soa_followed_calls"] = 0
55
+
56
+ # If `False` when running modules or unit tests "dynamic object
57
+ # analysis" is turned off. This makes them much faster.
58
+ prefs["perform_doa"] = True
59
+
60
+ # Rope can check the validity of its object DB when running.
61
+ prefs["validate_objectdb"] = True
62
+
63
+ # How many undos to hold?
64
+ prefs["max_history_items"] = 32
65
+
66
+ # Shows whether to save history across sessions.
67
+ prefs["save_history"] = True
68
+ prefs["compress_history"] = False
69
+
70
+ # Set the number spaces used for indenting. According to
71
+ # :PEP:`8`, it is best to use 4 spaces. Since most of rope's
72
+ # unit-tests use 4 spaces it is more reliable, too.
73
+ prefs["indent_size"] = 4
74
+
75
+ # Builtin and c-extension modules that are allowed to be imported
76
+ # and inspected by rope.
77
+ prefs["extension_modules"] = []
78
+
79
+ # Add all standard c-extensions to extension_modules list.
80
+ prefs["import_dynload_stdmods"] = True
81
+
82
+ # If `True` modules with syntax errors are considered to be empty.
83
+ # The default value is `False`; When `False` syntax errors raise
84
+ # `rope.base.exceptions.ModuleSyntaxError` exception.
85
+ prefs["ignore_syntax_errors"] = False
86
+
87
+ # If `True`, rope ignores unresolvable imports. Otherwise, they
88
+ # appear in the importing namespace.
89
+ prefs["ignore_bad_imports"] = False
90
+
91
+ # If `True`, rope will insert new module imports as
92
+ # `from <package> import <module>` by default.
93
+ prefs["prefer_module_from_imports"] = False
94
+
95
+ # If `True`, rope will transform a comma list of imports into
96
+ # multiple separate import statements when organizing
97
+ # imports.
98
+ prefs["split_imports"] = False
99
+
100
+ # If `True`, rope will remove all top-level import statements and
101
+ # reinsert them at the top of the module when making changes.
102
+ prefs["pull_imports_to_top"] = True
103
+
104
+ # If `True`, rope will sort imports alphabetically by module name instead
105
+ # of alphabetically by import statement, with from imports after normal
106
+ # imports.
107
+ prefs["sort_imports_alphabetically"] = False
108
+
109
+ # Location of implementation of
110
+ # rope.base.oi.type_hinting.interfaces.ITypeHintingFactory In general
111
+ # case, you don't have to change this value, unless you're an rope expert.
112
+ # Change this value to inject you own implementations of interfaces
113
+ # listed in module rope.base.oi.type_hinting.providers.interfaces
114
+ # For example, you can add you own providers for Django Models, or disable
115
+ # the search type-hinting in a class hierarchy, etc.
116
+ prefs[
117
+ "type_hinting_factory"
118
+ ] = "rope.base.oi.type_hinting.factory.default_type_hinting_factory"
119
+
120
+
121
+ def project_opened(project):
122
+ """This function is called after opening the project"""
123
+ # Do whatever you like here!
@@ -0,0 +1,47 @@
1
+ {
2
+ // Use IntelliSense to learn about possible attributes.
3
+ // Hover to view descriptions of existing attributes.
4
+ // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5
+ "version": "0.2.0",
6
+ "configurations": [
7
+ {
8
+ "name": "with config options",
9
+ "type": "python",
10
+ "request": "launch",
11
+ "program": "${workspaceFolder}/suvi/app.py",
12
+ "args": [
13
+ "--bind",
14
+ "127.0.0.1",
15
+ "--enforce",
16
+ "--admin-login",
17
+ "admin",
18
+ "--admin-password",
19
+ "ecmind",
20
+ "--user-login",
21
+ "user",
22
+ "--user-password",
23
+ "test",
24
+ ],
25
+ "console": "integratedTerminal",
26
+ "cwd": "${workspaceFolder}"
27
+ },
28
+ {
29
+ "name": "suvi without config options",
30
+ "type": "python",
31
+ "request": "launch",
32
+ "program": "${workspaceFolder}/suvi/app.py",
33
+ "args": [],
34
+ "console": "integratedTerminal",
35
+ "cwd": "${workspaceFolder}"
36
+ },
37
+ {
38
+ "name": "suvi --help",
39
+ "type": "python",
40
+ "request": "launch",
41
+ "program": "${workspaceFolder}/suvi/app.py",
42
+ "args": ["--help"],
43
+ "console": "integratedTerminal",
44
+ "cwd": "${workspaceFolder}"
45
+ }
46
+ ]
47
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "cSpell.words": [
3
+ "ABOUT",
4
+ "Mind",
5
+ "Switzerland",
6
+ "configparser",
7
+ "deque",
8
+ "flask",
9
+ "flaskext",
10
+ "hashlib",
11
+ "jsonify",
12
+ "pathlib",
13
+ "psutil",
14
+ "threading",
15
+ "uptime",
16
+ "waitress"
17
+ ],
18
+ "python.formatting.provider": "black"
19
+ }
suvi-2.7.0/MANIFEST.in ADDED
@@ -0,0 +1,3 @@
1
+ recursive-include suvi/templates *
2
+ recursive-include suvi/static *
3
+ global-exclude *.pyc
suvi-2.7.0/Makefile ADDED
@@ -0,0 +1,12 @@
1
+ build:
2
+ pip install build
3
+ python -m build
4
+
5
+
6
+ pull_dependencies:
7
+ - mkdir -p suvi/static/dependencies
8
+ curl -o suvi/static/dependencies/bootstrap.min.css https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css
9
+ curl -o suvi/static/dependencies/bootstrap.bundle.min.js https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js
10
+ curl -o suvi/static/dependencies/htmx.min.js https://unpkg.com/htmx.org@1.9.12/dist/htmx.min.js
11
+ curl -o suvi/static/dependencies/jquery.min.js https://code.jquery.com/jquery-3.7.1.min.js
12
+
suvi-2.7.0/PKG-INFO ADDED
@@ -0,0 +1,203 @@
1
+ Metadata-Version: 2.1
2
+ Name: suvi
3
+ Version: 2.7.0
4
+ Summary: ECMind Supervisor
5
+ Author-email: ECMind GmbH <info@ecmind.ch>
6
+ Project-URL: Homepage, https://gitlab.ecmind.ch/open/suvi
7
+ Classifier: Programming Language :: Python :: 3.11
8
+ Classifier: License :: Other/Proprietary License
9
+ Classifier: Operating System :: OS Independent
10
+ Requires-Python: >=3.11
11
+ Description-Content-Type: text/markdown
12
+ Provides-Extra: dev
13
+
14
+ ## Documentation source
15
+
16
+ This README.md is just boilerplate for the [wiki](https://gitlab.ecmind.ch/open/suvi/-/wikis/home).
17
+
18
+ ## Parameters
19
+
20
+ `--bind`: The ip/interface where suvi listens at. [default: 0.0.0.0]
21
+ `--port`: The listening port. [default: 8080]
22
+ `--enforce` / `--no-enforce`: Require a basic auth login [default: no-enforce]
23
+ `--admin-login`: Username for the admin user [default: admin]
24
+ `--admin-password`: Password for the admin user
25
+ `--user-login`: Username for the standard user [default: user]
26
+ `--user-password`: Password for the standard user
27
+ `--tasks`: Where to look for task config files (`.json` files) [default: ./tasks]
28
+ `--cycle`: Update interval in seconds to look for new/deleted task config files [default: 10]
29
+ `--logs`: Directory where to store suvi and task log files. [default: ./log]
30
+ `--log-rotate-when`: When to rotate log files (`H` for hours, `D` for days or `midnight`) [default: midnight]
31
+ `--log-rotate-interval`: How many instances fo `when` have to pass before rotating the log file [default: 1]
32
+ `--log-backup-count`: How many file rollovers should be stored [default: 5]
33
+ `--help`: Show help message and exit.
34
+
35
+ ### Using environment vars to configure suvi
36
+
37
+ Parameters can be set via environment vars, example:
38
+
39
+ ```bash
40
+ #/bin/bash
41
+
42
+ PW1=$(pwmake 80)
43
+ PW2=$(pwmake 80)
44
+
45
+ echo Setting admin password to "$PW1" and user password to "$PW2".
46
+
47
+ SUVI_ENFORCE=True \
48
+ SUVI_ADMIN_LOGIN=admin \
49
+ SUVI_ADMIN_PASSWORD="$PW1" \
50
+ SUVI_USER_LOGIN=user \
51
+ SUVI_USER_PASSWORD="$PW2" \
52
+ suvi
53
+ ```
54
+
55
+ ### Using `suvi.toml` to configure suvi
56
+
57
+ Parameters can also be set by a `suvi.toml` file:
58
+
59
+ ```toml
60
+ bind = "0.0.0.0"
61
+ port = 8080
62
+ enforce = true
63
+ admin_login = "admin"
64
+ admin_password = "RamesesII"
65
+ user_login = "user"
66
+ user_password = "TrustNo1"
67
+ tasks = "./tasks"
68
+ cycle = 5
69
+ logs = "./log"
70
+ log_rotate_when = "midnight"
71
+ log_rotate_interval = 1
72
+ log_backup_count = 5
73
+ ```
74
+
75
+ The values of the configuration file are overwritten by console values. For windows service deployments, `suvi.toml` is expected at `%WINDIR%\system32`.
76
+
77
+ ## Task config files (`.json`)
78
+
79
+ - `type`: Defines the startup strategy
80
+ - `"type": "ondemand"`: Run the task on user interaction/get call.
81
+ - `"type": "keepalive"`: Automatically start the task with suvi and restart if necessary.
82
+ - `"type": "schedule"`: Automatically start the task with suvi and restart if necessary.
83
+ - `exec`: Defines how to start the task
84
+ - `"exec": "system"`: Starts an external executable via `popen`
85
+ - `"exec": "shell"`: Starts an external executable via `popen` in the current system shell.
86
+ - The "`args`" list should be joined and instead just separated by spaces for the shell to interpret the command.
87
+ - `"exec": "stop"`: Stops (= kill & reload) tasks by config file name i. e. on a schedule
88
+ - Example: `{ "type": "schedule", "schedule": "* 0 * * *", "exec": "stop", "args": [ "has-to-restart-sometimes" ], "cwd": "/tmp" }`
89
+ - `"args"` may contain one or more config files names without the json extension
90
+ - `"exec": "talend"`: Deflates & starts a talend job build to a zip package
91
+ - When using `"talend"` for `"exec"`, this additional config parameters exist:
92
+ - `"package"`: Path to the talend build zip file.
93
+ - `"java"`: Optional path to the java binary. When this path to the `java` binary is omitted, the system default will be used.
94
+ - The `cwd` parameter is used as base path for deflated jobs. When `cmd` is omitted, the system default temp path is used instead.
95
+ - Example: `{ "type": "keepalive", "exec": "talend", "package": "/jobs/talend-demo-job-with-subtask.zip", "args": ["--context=Test", "-Xms256M", "-Xmx1024M"], "cwd": "/tmp", "info": "deflate and keepalive talend demo job" }`
96
+ - `args`: Array of startup params or an array of arrays it multiple programs should be started if the previous job succeeded
97
+ - `"args": ["notepad.exe", "test.txt"]`
98
+ - `"args": [ ["notepad.exe", "test.txt"], ["calc.exe"] ]`
99
+ - `cwd`: Optional startup path for the task
100
+ - `"cwd": "C:/temp"`
101
+ - `env`: Optional dictionary that extends/overwrites suvis environment variables
102
+ - `"env": {"TAIL_FILE": "/tmp/test"}, "args": ["bash", "-c", "tail -f $TAIL_FILE"]`
103
+ - `schedule`: Read when `"type": "schedule"` is set to launch an instance of the task if not already running.
104
+ - minutes, hours, days, month, weekdays
105
+ - `"schedule": "0 0,4,8,12,16,20 * * 1-5"`: Start Monday to Friday on every four hours.
106
+ - The crontab syntax element `/` is not supported at the moment.
107
+ - Minutes range from `0` to `59`
108
+ - Hours range from `0` to `23`
109
+ - Days range from `1` to `31`
110
+ - Month range from `1` (Jan) to `12` (Dec)
111
+ - Weekdays range from `1` (Mon) to `7` (Sun) including `0` (also Sun)
112
+ - `tokens`: Optional list of secret tokens to start a tasks without a password via HTTP GET or POST at `/run/hook/<token>`
113
+ - Example: `"tokens": ["30d827f9-e22f-4b6a-85f1-bcb9977c6155", "69f541f8-614a-45f4-950b-67998c819ee0"]`
114
+ - When POSTing to a webhook of `"exec": "system"`, the raw body gets redirected to STDIN of the (first) `"args"` command.
115
+ - `info`: Optional markdown text to provide task info.
116
+ - Line breaks have to be encoded as `\n` in JSON.
117
+
118
+ ## Environment variables of tasks
119
+
120
+ The environment variables for the runtime of a task consist of:
121
+
122
+ - `SUVI_TASK_NAME` set to the task name.
123
+ - `SUVI_EXEC_UUID` set to a unique uuid for each task execution. This uuid is unchanged between executions of subtasks (when `args` is a list is lists).
124
+ - Variables set by the OS
125
+ - Variables set by `env` task configuration.
126
+
127
+ ## Change log
128
+
129
+ - Version 1.20
130
+ - Allow task args to be an array of arrays to run subsequent programs (and break if one fails).
131
+ - `requirements.txt` added.
132
+ - Version 1.21
133
+ - Removed push monitoring in favor of `/telemetry.json` endpoint.
134
+ - Version 1.22
135
+ - Require user auth for telemetry endpoint.
136
+ - Version 2.0.0
137
+ - Remove `ini` file in favour of command line arguments.
138
+ - Make installable.
139
+ - Version scheme change to be compatible with pip.
140
+ - Version 2.0.1/2.0.2
141
+ - Fixed base dir for installed app.
142
+ - Fixed package data for templates/static files.
143
+ - Version 2.1.0
144
+ - Remove `psutils` dependency;
145
+ - therefore remove `/top` and memory overview in `/manage/`.
146
+ - Version 2.2.0
147
+ - Redesign & Licencing infos.
148
+ - `config.toml`, command line options.
149
+ - Version 2.2.1
150
+ - Also log outputs with invalid UTF-8 chars
151
+ - Version 2.2.2
152
+ - Recursively kill child processes when stopping a task.
153
+ - Version 2.3.0
154
+ - Send POST message body of webhooks to STDIN.
155
+ - Version 2.3.1/2.3.2
156
+ - Set cycle default to `5` seconds.
157
+ - Design updates (i.e. allow to start/stop task from task log).
158
+ - Version 2.3.3
159
+ - Add `shell` setting.
160
+ - Version 2.3.4
161
+ - Add suvi specific ENV variables `SUVI_TASK_NAME` and `SUVI_EXEC_UUID`.
162
+ - Fix exec type to ondemand for unknown types.
163
+ - Version 2.4.0
164
+ - Refactoring of task internals.
165
+ - Version 2.4.1
166
+ - Python 3.6 compatibility.
167
+ - Version 2.4.2
168
+ - View global and tasks logs in plain text.
169
+ - Set log queues to 1000 lines (from 500).
170
+ - Add action buttons in task log list.
171
+ - Version 2.4.3
172
+ - Set task queues to 1000 lines (from 500).
173
+ - Version 2.4.4
174
+ - Fix token handling regression.
175
+ - Version 2.4.5
176
+ - Fix task listing for ondemand talend tasks.
177
+ - Version 2.4.6
178
+ - Fix talend infos in task list for non-running ondemand tasks.
179
+ - Version 2.4.7/2.4.8
180
+ - Fix suvi no more loading tasks after first parsing error.
181
+ - Refactor `"shell": "true"` field to `"exec": "shell"`.
182
+ - Print missing file/directory on File Not Found errors in suvi log.
183
+ - Version 2.5.8
184
+ - Update to Bootstrap 5.3, htmx 1.92. and JQuery 3.7.0
185
+ - Version 2.5.9
186
+ - Update minium Python version to 3.9.
187
+ - Fix stop tasks bug.
188
+ - Version 2.6.0
189
+ - Switch Markdown parser to `python-markdown`.
190
+ - Version 2.6.1
191
+ - Windows service stops will try to stop tasks before shutdown.
192
+ - Terminate frontend process on shutdown.
193
+ - Admin interface shutdown will shutdown suvi (service) itself.
194
+ - Change Windows service temp path to be consistent between starts.
195
+ - Version 2.6.2/2.6.3
196
+ - Update HTMX to 2.0.4.
197
+ - Allow filtering configured tasks, running tasks and task logs list.
198
+ - Version 2.6.4
199
+ - Upgrade to Pyton >= 3.12
200
+ - Version 2.7.0
201
+ - Open Source release
202
+ - Cleanups
203
+ - Remove build targets for old closed source edition
suvi-2.7.0/README.md ADDED
@@ -0,0 +1,190 @@
1
+ ## Documentation source
2
+
3
+ This README.md is just boilerplate for the [wiki](https://gitlab.ecmind.ch/open/suvi/-/wikis/home).
4
+
5
+ ## Parameters
6
+
7
+ `--bind`: The ip/interface where suvi listens at. [default: 0.0.0.0]
8
+ `--port`: The listening port. [default: 8080]
9
+ `--enforce` / `--no-enforce`: Require a basic auth login [default: no-enforce]
10
+ `--admin-login`: Username for the admin user [default: admin]
11
+ `--admin-password`: Password for the admin user
12
+ `--user-login`: Username for the standard user [default: user]
13
+ `--user-password`: Password for the standard user
14
+ `--tasks`: Where to look for task config files (`.json` files) [default: ./tasks]
15
+ `--cycle`: Update interval in seconds to look for new/deleted task config files [default: 10]
16
+ `--logs`: Directory where to store suvi and task log files. [default: ./log]
17
+ `--log-rotate-when`: When to rotate log files (`H` for hours, `D` for days or `midnight`) [default: midnight]
18
+ `--log-rotate-interval`: How many instances fo `when` have to pass before rotating the log file [default: 1]
19
+ `--log-backup-count`: How many file rollovers should be stored [default: 5]
20
+ `--help`: Show help message and exit.
21
+
22
+ ### Using environment vars to configure suvi
23
+
24
+ Parameters can be set via environment vars, example:
25
+
26
+ ```bash
27
+ #/bin/bash
28
+
29
+ PW1=$(pwmake 80)
30
+ PW2=$(pwmake 80)
31
+
32
+ echo Setting admin password to "$PW1" and user password to "$PW2".
33
+
34
+ SUVI_ENFORCE=True \
35
+ SUVI_ADMIN_LOGIN=admin \
36
+ SUVI_ADMIN_PASSWORD="$PW1" \
37
+ SUVI_USER_LOGIN=user \
38
+ SUVI_USER_PASSWORD="$PW2" \
39
+ suvi
40
+ ```
41
+
42
+ ### Using `suvi.toml` to configure suvi
43
+
44
+ Parameters can also be set by a `suvi.toml` file:
45
+
46
+ ```toml
47
+ bind = "0.0.0.0"
48
+ port = 8080
49
+ enforce = true
50
+ admin_login = "admin"
51
+ admin_password = "RamesesII"
52
+ user_login = "user"
53
+ user_password = "TrustNo1"
54
+ tasks = "./tasks"
55
+ cycle = 5
56
+ logs = "./log"
57
+ log_rotate_when = "midnight"
58
+ log_rotate_interval = 1
59
+ log_backup_count = 5
60
+ ```
61
+
62
+ The values of the configuration file are overwritten by console values. For windows service deployments, `suvi.toml` is expected at `%WINDIR%\system32`.
63
+
64
+ ## Task config files (`.json`)
65
+
66
+ - `type`: Defines the startup strategy
67
+ - `"type": "ondemand"`: Run the task on user interaction/get call.
68
+ - `"type": "keepalive"`: Automatically start the task with suvi and restart if necessary.
69
+ - `"type": "schedule"`: Automatically start the task with suvi and restart if necessary.
70
+ - `exec`: Defines how to start the task
71
+ - `"exec": "system"`: Starts an external executable via `popen`
72
+ - `"exec": "shell"`: Starts an external executable via `popen` in the current system shell.
73
+ - The "`args`" list should be joined and instead just separated by spaces for the shell to interpret the command.
74
+ - `"exec": "stop"`: Stops (= kill & reload) tasks by config file name i. e. on a schedule
75
+ - Example: `{ "type": "schedule", "schedule": "* 0 * * *", "exec": "stop", "args": [ "has-to-restart-sometimes" ], "cwd": "/tmp" }`
76
+ - `"args"` may contain one or more config files names without the json extension
77
+ - `"exec": "talend"`: Deflates & starts a talend job build to a zip package
78
+ - When using `"talend"` for `"exec"`, this additional config parameters exist:
79
+ - `"package"`: Path to the talend build zip file.
80
+ - `"java"`: Optional path to the java binary. When this path to the `java` binary is omitted, the system default will be used.
81
+ - The `cwd` parameter is used as base path for deflated jobs. When `cmd` is omitted, the system default temp path is used instead.
82
+ - Example: `{ "type": "keepalive", "exec": "talend", "package": "/jobs/talend-demo-job-with-subtask.zip", "args": ["--context=Test", "-Xms256M", "-Xmx1024M"], "cwd": "/tmp", "info": "deflate and keepalive talend demo job" }`
83
+ - `args`: Array of startup params or an array of arrays it multiple programs should be started if the previous job succeeded
84
+ - `"args": ["notepad.exe", "test.txt"]`
85
+ - `"args": [ ["notepad.exe", "test.txt"], ["calc.exe"] ]`
86
+ - `cwd`: Optional startup path for the task
87
+ - `"cwd": "C:/temp"`
88
+ - `env`: Optional dictionary that extends/overwrites suvis environment variables
89
+ - `"env": {"TAIL_FILE": "/tmp/test"}, "args": ["bash", "-c", "tail -f $TAIL_FILE"]`
90
+ - `schedule`: Read when `"type": "schedule"` is set to launch an instance of the task if not already running.
91
+ - minutes, hours, days, month, weekdays
92
+ - `"schedule": "0 0,4,8,12,16,20 * * 1-5"`: Start Monday to Friday on every four hours.
93
+ - The crontab syntax element `/` is not supported at the moment.
94
+ - Minutes range from `0` to `59`
95
+ - Hours range from `0` to `23`
96
+ - Days range from `1` to `31`
97
+ - Month range from `1` (Jan) to `12` (Dec)
98
+ - Weekdays range from `1` (Mon) to `7` (Sun) including `0` (also Sun)
99
+ - `tokens`: Optional list of secret tokens to start a tasks without a password via HTTP GET or POST at `/run/hook/<token>`
100
+ - Example: `"tokens": ["30d827f9-e22f-4b6a-85f1-bcb9977c6155", "69f541f8-614a-45f4-950b-67998c819ee0"]`
101
+ - When POSTing to a webhook of `"exec": "system"`, the raw body gets redirected to STDIN of the (first) `"args"` command.
102
+ - `info`: Optional markdown text to provide task info.
103
+ - Line breaks have to be encoded as `\n` in JSON.
104
+
105
+ ## Environment variables of tasks
106
+
107
+ The environment variables for the runtime of a task consist of:
108
+
109
+ - `SUVI_TASK_NAME` set to the task name.
110
+ - `SUVI_EXEC_UUID` set to a unique uuid for each task execution. This uuid is unchanged between executions of subtasks (when `args` is a list is lists).
111
+ - Variables set by the OS
112
+ - Variables set by `env` task configuration.
113
+
114
+ ## Change log
115
+
116
+ - Version 1.20
117
+ - Allow task args to be an array of arrays to run subsequent programs (and break if one fails).
118
+ - `requirements.txt` added.
119
+ - Version 1.21
120
+ - Removed push monitoring in favor of `/telemetry.json` endpoint.
121
+ - Version 1.22
122
+ - Require user auth for telemetry endpoint.
123
+ - Version 2.0.0
124
+ - Remove `ini` file in favour of command line arguments.
125
+ - Make installable.
126
+ - Version scheme change to be compatible with pip.
127
+ - Version 2.0.1/2.0.2
128
+ - Fixed base dir for installed app.
129
+ - Fixed package data for templates/static files.
130
+ - Version 2.1.0
131
+ - Remove `psutils` dependency;
132
+ - therefore remove `/top` and memory overview in `/manage/`.
133
+ - Version 2.2.0
134
+ - Redesign & Licencing infos.
135
+ - `config.toml`, command line options.
136
+ - Version 2.2.1
137
+ - Also log outputs with invalid UTF-8 chars
138
+ - Version 2.2.2
139
+ - Recursively kill child processes when stopping a task.
140
+ - Version 2.3.0
141
+ - Send POST message body of webhooks to STDIN.
142
+ - Version 2.3.1/2.3.2
143
+ - Set cycle default to `5` seconds.
144
+ - Design updates (i.e. allow to start/stop task from task log).
145
+ - Version 2.3.3
146
+ - Add `shell` setting.
147
+ - Version 2.3.4
148
+ - Add suvi specific ENV variables `SUVI_TASK_NAME` and `SUVI_EXEC_UUID`.
149
+ - Fix exec type to ondemand for unknown types.
150
+ - Version 2.4.0
151
+ - Refactoring of task internals.
152
+ - Version 2.4.1
153
+ - Python 3.6 compatibility.
154
+ - Version 2.4.2
155
+ - View global and tasks logs in plain text.
156
+ - Set log queues to 1000 lines (from 500).
157
+ - Add action buttons in task log list.
158
+ - Version 2.4.3
159
+ - Set task queues to 1000 lines (from 500).
160
+ - Version 2.4.4
161
+ - Fix token handling regression.
162
+ - Version 2.4.5
163
+ - Fix task listing for ondemand talend tasks.
164
+ - Version 2.4.6
165
+ - Fix talend infos in task list for non-running ondemand tasks.
166
+ - Version 2.4.7/2.4.8
167
+ - Fix suvi no more loading tasks after first parsing error.
168
+ - Refactor `"shell": "true"` field to `"exec": "shell"`.
169
+ - Print missing file/directory on File Not Found errors in suvi log.
170
+ - Version 2.5.8
171
+ - Update to Bootstrap 5.3, htmx 1.92. and JQuery 3.7.0
172
+ - Version 2.5.9
173
+ - Update minium Python version to 3.9.
174
+ - Fix stop tasks bug.
175
+ - Version 2.6.0
176
+ - Switch Markdown parser to `python-markdown`.
177
+ - Version 2.6.1
178
+ - Windows service stops will try to stop tasks before shutdown.
179
+ - Terminate frontend process on shutdown.
180
+ - Admin interface shutdown will shutdown suvi (service) itself.
181
+ - Change Windows service temp path to be consistent between starts.
182
+ - Version 2.6.2/2.6.3
183
+ - Update HTMX to 2.0.4.
184
+ - Allow filtering configured tasks, running tasks and task logs list.
185
+ - Version 2.6.4
186
+ - Upgrade to Pyton >= 3.12
187
+ - Version 2.7.0
188
+ - Open Source release
189
+ - Cleanups
190
+ - Remove build targets for old closed source edition