rapidscada-admin 1.0.0__py3-none-any.whl
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.
- rapidscada_admin-1.0.0.dist-info/METADATA +187 -0
- rapidscada_admin-1.0.0.dist-info/RECORD +6 -0
- rapidscada_admin-1.0.0.dist-info/WHEEL +5 -0
- rapidscada_admin-1.0.0.dist-info/entry_points.txt +2 -0
- rapidscada_admin-1.0.0.dist-info/licenses/LICENSE +21 -0
- rapidscada_admin-1.0.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: rapidscada-admin
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Linux CLI for administering Rapid SCADA BaseDAT configuration files
|
|
5
|
+
Author: rapidscada-admin contributors
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/Shadow21AR/rapidscada-admin
|
|
8
|
+
Project-URL: Repository, https://github.com/Shadow21AR/rapidscada-admin
|
|
9
|
+
Project-URL: Issues, https://github.com/Shadow21AR/rapidscada-admin/issues
|
|
10
|
+
Keywords: rapidscada,scada,basdat,industrial,admin
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Environment :: Console
|
|
13
|
+
Classifier: Intended Audience :: System Administrators
|
|
14
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
19
|
+
Classifier: Topic :: System :: Systems Administration
|
|
20
|
+
Requires-Python: >=3.11
|
|
21
|
+
Description-Content-Type: text/markdown
|
|
22
|
+
License-File: LICENSE
|
|
23
|
+
Dynamic: license-file
|
|
24
|
+
|
|
25
|
+
# rapidscada-admin
|
|
26
|
+
|
|
27
|
+
[](https://github.com/Shadow21AR/rapidscada-admin/actions/workflows/ci.yml)
|
|
28
|
+
[](https://pypi.org/project/rapidscada-admin/)
|
|
29
|
+
[](https://pypi.org/project/rapidscada-admin/)
|
|
30
|
+
[](LICENSE)
|
|
31
|
+
|
|
32
|
+
A Linux command-line utility for administering [Rapid SCADA](https://rapidscada.org/) v6 BaseDAT configuration files.
|
|
33
|
+
|
|
34
|
+
## What is Rapid SCADA?
|
|
35
|
+
|
|
36
|
+
[Rapid SCADA](https://rapidscada.org/) is an open-source industrial automation and SCADA system. It stores configuration — users, roles, rights, and other tables — in binary BaseDAT (`.dat`) files. Editing these files normally requires the Windows Administrator application. This tool fills the gap for Linux environments.
|
|
37
|
+
|
|
38
|
+
## Why this tool?
|
|
39
|
+
|
|
40
|
+
- Automate user management from shell scripts and Ansible playbooks
|
|
41
|
+
- Inspect and modify `user.dat` without the Windows GUI
|
|
42
|
+
- Validate file integrity before and after changes
|
|
43
|
+
- Export/import user data as JSON for backup and migration
|
|
44
|
+
- No third-party dependencies — pure Python standard library
|
|
45
|
+
|
|
46
|
+
## Supported platforms
|
|
47
|
+
|
|
48
|
+
- **Linux** (primary target)
|
|
49
|
+
- macOS / Windows (should work, but untested)
|
|
50
|
+
|
|
51
|
+
Requires **Python 3.11+**.
|
|
52
|
+
|
|
53
|
+
## Installation
|
|
54
|
+
|
|
55
|
+
### From PyPI
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
pip install rapidscada-admin
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Or with [pipx](https://pypa.github.io/pipx/) (recommended for CLI tools):
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
pipx install rapidscada-admin
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### From source
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
git clone https://github.com/Shadow21AR/rapidscada-admin.git
|
|
71
|
+
cd rapidscada-admin
|
|
72
|
+
pip install .
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
For development:
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
pip install -e ".[dev]"
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Verify installation
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
rapidscada-admin --version
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## Usage
|
|
88
|
+
|
|
89
|
+
Every command takes the `.dat` file path as a positional argument. No files are hardcoded.
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
rapidscada-admin <command> <subcommand> <file> [options]
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### User management
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
# List all users
|
|
99
|
+
rapidscada-admin users list user.dat
|
|
100
|
+
|
|
101
|
+
# Show one user
|
|
102
|
+
rapidscada-admin users show user.dat --user admin
|
|
103
|
+
|
|
104
|
+
# Add a user
|
|
105
|
+
rapidscada-admin users add user.dat \
|
|
106
|
+
--name operator \
|
|
107
|
+
--password 'S3cur3P@ss!' \
|
|
108
|
+
--role 2 \
|
|
109
|
+
--description "Shift operator"
|
|
110
|
+
|
|
111
|
+
# Delete a user
|
|
112
|
+
rapidscada-admin users delete user.dat --user operator
|
|
113
|
+
|
|
114
|
+
# Rename a user
|
|
115
|
+
rapidscada-admin users rename user.dat --old-name operator --new-name op2
|
|
116
|
+
|
|
117
|
+
# Change password
|
|
118
|
+
rapidscada-admin users passwd user.dat --user admin --password 'NewP@ssw0rd!'
|
|
119
|
+
|
|
120
|
+
# Enable / disable account
|
|
121
|
+
rapidscada-admin users enable user.dat --user admin
|
|
122
|
+
rapidscada-admin users disable user.dat --user admin
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### Export and import
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
# Export all users to JSON
|
|
129
|
+
rapidscada-admin users export user.dat > users.json
|
|
130
|
+
|
|
131
|
+
# Import users from JSON
|
|
132
|
+
rapidscada-admin users import user.dat --input users.json
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
### Password hashing
|
|
136
|
+
|
|
137
|
+
Compute a Rapid SCADA password hash without modifying any file:
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
rapidscada-admin hash --password secret
|
|
141
|
+
rapidscada-admin hash --user-id 11 --password scada
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
### Validation
|
|
145
|
+
|
|
146
|
+
Check a BaseDAT file for corruption, schema errors, and duplicate entries:
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
rapidscada-admin verify user.dat
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
Exit code `0` means valid, `1` means errors found.
|
|
153
|
+
|
|
154
|
+
## Safety
|
|
155
|
+
|
|
156
|
+
Every mutating command follows a 7-step safety protocol:
|
|
157
|
+
|
|
158
|
+
1. **Verify schema** — required fields (`UserID`, `Enabled`, `Name`, `Password`, `RoleID`) must be present
|
|
159
|
+
2. **Create backup** — timestamped `.bak` file alongside the original
|
|
160
|
+
3. **Write temporary file** — changes go to a temp file first
|
|
161
|
+
4. **Re-read temporary file** — parse the file we just wrote
|
|
162
|
+
5. **Validate** — check schema, duplicates, integrity
|
|
163
|
+
6. **Atomic replace** — `os.replace()` ensures no partial writes
|
|
164
|
+
7. **Report** — print the backup location
|
|
165
|
+
|
|
166
|
+
A malformed `.dat` file can prevent Rapid SCADA from starting. **Always verify before and after operations.**
|
|
167
|
+
|
|
168
|
+
## Limitations
|
|
169
|
+
|
|
170
|
+
- Only supports BaseDAT format version 4.x (Rapid SCADA v6)
|
|
171
|
+
- Does not support editing the Windows Administrator application's in-memory state
|
|
172
|
+
- Password hashing uses MD5 (matching the Rapid SCADA protocol — not a general security recommendation)
|
|
173
|
+
- Does not validate RoleID values against `role.dat` (role table is not yet supported)
|
|
174
|
+
|
|
175
|
+
## Contributing
|
|
176
|
+
|
|
177
|
+
Contributions are welcome. Please:
|
|
178
|
+
|
|
179
|
+
1. Fork the repository
|
|
180
|
+
2. Create a feature branch
|
|
181
|
+
3. Add tests for new functionality
|
|
182
|
+
4. Run `pytest` and `ruff check` before submitting
|
|
183
|
+
5. Open a pull request
|
|
184
|
+
|
|
185
|
+
## License
|
|
186
|
+
|
|
187
|
+
[MIT](LICENSE)
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
rapidscada_admin-1.0.0.dist-info/licenses/LICENSE,sha256=3ZPzquMbZUuiegoHIeYq0GPaivDKVingxiEsd-lWWfI,1086
|
|
2
|
+
rapidscada_admin-1.0.0.dist-info/METADATA,sha256=s98fZWUJQxpTVaWYsXksrlyRA2jF35KQM4goBMV7ISA,5548
|
|
3
|
+
rapidscada_admin-1.0.0.dist-info/WHEEL,sha256=K260EYznzXsJYBQGqmI8VTxEdiZYNvDZwW9cBh9-_MA,91
|
|
4
|
+
rapidscada_admin-1.0.0.dist-info/entry_points.txt,sha256=x7pRkEEhI2cHMJg3JrnRt6zA5s9b1UoSvAFeqU2tqjc,63
|
|
5
|
+
rapidscada_admin-1.0.0.dist-info/top_level.txt,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
|
6
|
+
rapidscada_admin-1.0.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 rapidscada-admin contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|