fyos-installer 0.1.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.
- fyos_installer-0.1.0/LICENSE +202 -0
- fyos_installer-0.1.0/NOTICE +4 -0
- fyos_installer-0.1.0/PKG-INFO +219 -0
- fyos_installer-0.1.0/README.md +200 -0
- fyos_installer-0.1.0/fyos_installer/__init__.py +3 -0
- fyos_installer-0.1.0/fyos_installer/__main__.py +5 -0
- fyos_installer-0.1.0/fyos_installer/abnahme.py +263 -0
- fyos_installer-0.1.0/fyos_installer/ausfuehren.py +182 -0
- fyos_installer-0.1.0/fyos_installer/bilder/agent-1.svg +37 -0
- fyos_installer-0.1.0/fyos_installer/bilder/beispiel_app-1.svg +31 -0
- fyos_installer-0.1.0/fyos_installer/bilder/betrieb-1.svg +34 -0
- fyos_installer-0.1.0/fyos_installer/bilder/eigenes_modell-1.svg +33 -0
- fyos_installer-0.1.0/fyos_installer/bilder/finanzen-1.svg +33 -0
- fyos_installer-0.1.0/fyos_installer/bilder/haus-1.svg +36 -0
- fyos_installer-0.1.0/fyos_installer/bilder/kern-1.svg +52 -0
- fyos_installer-0.1.0/fyos_installer/bilder/kern-2.svg +39 -0
- fyos_installer-0.1.0/fyos_installer/bilder/konten-1.svg +34 -0
- fyos_installer-0.1.0/fyos_installer/bilder/leitstand-1.svg +31 -0
- fyos_installer-0.1.0/fyos_installer/cli.py +147 -0
- fyos_installer-0.1.0/fyos_installer/erzeugen.py +631 -0
- fyos_installer-0.1.0/fyos_installer/katalog.py +496 -0
- fyos_installer-0.1.0/fyos_installer/katalog.yaml +305 -0
- fyos_installer-0.1.0/fyos_installer/reife.py +132 -0
- fyos_installer-0.1.0/fyos_installer/tui.py +353 -0
- fyos_installer-0.1.0/fyos_installer/vorlagen/ANLEITUNG.md +26 -0
- fyos_installer-0.1.0/fyos_installer/vorlagen/Dockerfile.hub +5 -0
- fyos_installer-0.1.0/fyos_installer/vorlagen/docker-compose.yml +59 -0
- fyos_installer-0.1.0/fyos_installer/vorlagen/kustomization.yaml +47 -0
- fyos_installer-0.1.0/fyos_installer/web/app.js +457 -0
- fyos_installer-0.1.0/fyos_installer/web/favicon.svg +1 -0
- fyos_installer-0.1.0/fyos_installer/web/index.html +22 -0
- fyos_installer-0.1.0/fyos_installer/web/stil.css +133 -0
- fyos_installer-0.1.0/fyos_installer/web.py +346 -0
- fyos_installer-0.1.0/fyos_installer.egg-info/PKG-INFO +219 -0
- fyos_installer-0.1.0/fyos_installer.egg-info/SOURCES.txt +47 -0
- fyos_installer-0.1.0/fyos_installer.egg-info/dependency_links.txt +1 -0
- fyos_installer-0.1.0/fyos_installer.egg-info/entry_points.txt +2 -0
- fyos_installer-0.1.0/fyos_installer.egg-info/requires.txt +10 -0
- fyos_installer-0.1.0/fyos_installer.egg-info/top_level.txt +1 -0
- fyos_installer-0.1.0/pyproject.toml +31 -0
- fyos_installer-0.1.0/setup.cfg +4 -0
- fyos_installer-0.1.0/tests/test_abnahme.py +474 -0
- fyos_installer-0.1.0/tests/test_cli.py +212 -0
- fyos_installer-0.1.0/tests/test_erzeugen.py +247 -0
- fyos_installer-0.1.0/tests/test_katalog.py +128 -0
- fyos_installer-0.1.0/tests/test_reife.py +187 -0
- fyos_installer-0.1.0/tests/test_seiten.py +33 -0
- fyos_installer-0.1.0/tests/test_tui.py +54 -0
- fyos_installer-0.1.0/tests/test_web.py +179 -0
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: fyos-installer
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Installer der Distribution FYOS (For Your Own Sake): Auswahl, Erklärung mit Bildern, Erzeugung der Auslieferung
|
|
5
|
+
Author: sirfyyn and FYOS CONTRIBUTORS
|
|
6
|
+
License-Expression: Apache-2.0
|
|
7
|
+
Requires-Python: >=3.11
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
License-File: NOTICE
|
|
11
|
+
Requires-Dist: PyYAML>=6
|
|
12
|
+
Provides-Extra: tui
|
|
13
|
+
Requires-Dist: textual>=0.80; extra == "tui"
|
|
14
|
+
Provides-Extra: bilder
|
|
15
|
+
Requires-Dist: textual-image>=0.6; extra == "bilder"
|
|
16
|
+
Provides-Extra: test
|
|
17
|
+
Requires-Dist: pytest>=8; extra == "test"
|
|
18
|
+
Dynamic: license-file
|
|
19
|
+
|
|
20
|
+
# FYOS-Installer
|
|
21
|
+
|
|
22
|
+
Der Installer der Distribution **FYOS — For Your Own Sake**: eine Auswahl von Bausteinen, die auf dem Bildschirm
|
|
23
|
+
erklärt (mit Bildern), was daraus wird, und danach die Auslieferung erzeugt (Docker Compose oder Kubernetes).
|
|
24
|
+
|
|
25
|
+
```sh
|
|
26
|
+
pip install ./installer # Python 3.11 oder neuer
|
|
27
|
+
pip install "./installer[tui]" # optional: Textoberfläche
|
|
28
|
+
pip install "./installer[tui,bilder]" # optional: Screenshots (PNG/JPG) im Terminal
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Drei Bedienarten
|
|
32
|
+
|
|
33
|
+
### 1. Web-Assistent (Standard)
|
|
34
|
+
|
|
35
|
+
```sh
|
|
36
|
+
fyos-install
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Startet einen Server nur auf `127.0.0.1` (zufälliger Port, Zugangstoken im Link) und öffnet den Browser. Läuft
|
|
40
|
+
offline, ohne CDN. Schritte: Willkommen, Ziel, Bausteine, Einrichten, Zusammenfassung, Installieren (Live-Protokoll).
|
|
41
|
+
Bedienung per Tastatur: Tab, Leertaste (Baustein wählen), Pfeiltasten in der Bildgalerie, Enter für Weiter.
|
|
42
|
+
`--kein-browser` gibt nur den Link aus, `--port N` legt den Port fest.
|
|
43
|
+
|
|
44
|
+
| Schritt | Bild |
|
|
45
|
+
|---|---|
|
|
46
|
+
| Willkommen |  |
|
|
47
|
+
| Ziel wählen |  |
|
|
48
|
+
| Bausteine mit Bildgalerie und »Was daraus wird« |  |
|
|
49
|
+
| Einrichten (Agent, Modell, Felder der Bausteine) |  |
|
|
50
|
+
| Zusammenfassung mit Vorschau, was entsteht |  |
|
|
51
|
+
| Installieren mit Live-Protokoll (hier Ziel »Nur Dateien«) |  |
|
|
52
|
+
|
|
53
|
+
Die Bilder in der Galerie der Bausteine sind Skizzen unter `fyos_installer/bilder/` (zum Beispiel
|
|
54
|
+
[kern-1.svg](fyos_installer/bilder/kern-1.svg), [agent-1.svg](fyos_installer/bilder/agent-1.svg),
|
|
55
|
+
[finanzen-1.svg](fyos_installer/bilder/finanzen-1.svg), [haus-1.svg](fyos_installer/bilder/haus-1.svg));
|
|
56
|
+
liegt daneben eine `.png` gleichen Namens, zeigt der Installer sie.
|
|
57
|
+
|
|
58
|
+
API (alle Aufrufe brauchen das Token): `GET /api/katalog`, `POST /api/plan`, `POST /api/installieren`,
|
|
59
|
+
`GET /api/protokoll` (Server-Sent Events).
|
|
60
|
+
|
|
61
|
+
### 2. Textoberfläche
|
|
62
|
+
|
|
63
|
+
```sh
|
|
64
|
+
fyos-install --tui
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Dieselben Schritte mit Textual. Tasten: `n` weiter, `b` zurück, `q` beenden (`Strg+n` / `Strg+b` auch im Textfeld).
|
|
68
|
+
PNG/JPG-Bilder zeigt `textual-image` (Extra `bilder`), SVG-Skizzen erscheinen als Textbeschreibung mit Pfad.
|
|
69
|
+
Ohne Textual erscheint eine Meldung mit dem passenden `pip`-Befehl.
|
|
70
|
+
|
|
71
|
+
### 3. Ohne Oberfläche
|
|
72
|
+
|
|
73
|
+
```sh
|
|
74
|
+
fyos-install --auswahl kern,agent,finanzen --ziel compose --antworten antworten.yaml --verzeichnis ./fyos --trocken
|
|
75
|
+
fyos-install --auswahl kern,agent --ziel k8s --verzeichnis ./fyos-k8s --ja
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
`--ziel compose|k8s|dateien`; `--trocken` zeigt Dateien und Befehle und schreibt nichts; `--ja` fragt nicht nach;
|
|
79
|
+
ohne Terminal ist `--ja` Pflicht. Abhängigkeiten und Pflichtbausteine werden ergänzt. `--liste` zeigt den Katalog.
|
|
80
|
+
`--abnahme ADRESSE` führt nur die [Abnahme](#abnahme) gegen eine laufende Installation aus.
|
|
81
|
+
|
|
82
|
+
Rückgabewerte: `0` gut, `1` Installation oder Start gescheitert, `2` falsche Eingabe, `3` FYOS läuft, aber die
|
|
83
|
+
Abnahme ist nicht bestanden.
|
|
84
|
+
|
|
85
|
+
`antworten.yaml` (alles optional, Vorgaben siehe `erzeugen.py`):
|
|
86
|
+
|
|
87
|
+
```yaml
|
|
88
|
+
persona: {agent_name: Fy, wesen: ruhig und direkt, besitzer_name: Alex, sprache: Deutsch}
|
|
89
|
+
modell: {basis_url: "http://host.docker.internal:11434/v1", name: "mein-modell", schluessel: ""}
|
|
90
|
+
felder:
|
|
91
|
+
kern: {port: 8080}
|
|
92
|
+
haus: {ha_url: "http://homeassistant.example.com:8123", ha_token: "…"}
|
|
93
|
+
optionen: {plugin_quelle: "https://git.example.com/fyos", namespace: fyos}
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Vorgaben aus der Umgebung:
|
|
97
|
+
|
|
98
|
+
| Variable | Wirkung |
|
|
99
|
+
|---|---|
|
|
100
|
+
| `FYOS_PAKETINDEX` | PyPI-kompatibler Index (zum Beispiel `https://git.example.com/api/packages/org/pypi/simple`); Plugins werden per Paketname installiert, der Index geht als `--build-arg FYOS_INDEX_URL` ins Hub-Dockerfile und steht dort vor PyPI |
|
|
101
|
+
| `FYOS_PLUGIN_QUELLE` | Git-Adresse der Plugin-Repos (`optionen.bezug: git`) |
|
|
102
|
+
| `FYOS_REGISTRY` | zum Beispiel `registry.example.com/org`; ergibt `<reg>/fyos-os/web:main`, `<reg>/fyos-os/hub:main`, `<reg>/fyos-agent/openclaw:main` |
|
|
103
|
+
|
|
104
|
+
`optionen.bezug` ist `index` (Vorgabe) oder `git`; ist nur eine Plugin-Quelle gesetzt, gilt `git`. Die Bilder
|
|
105
|
+
(`bild_web`, `hub_bild`, `bild_agent`) sind in den Antworten und im Assistenten editierbar.
|
|
106
|
+
|
|
107
|
+
#### Warum uv, und warum der eigene Index Vorrang hat
|
|
108
|
+
|
|
109
|
+
Das erzeugte Hub-Dockerfile installiert die Plugin-Pakete mit `uv pip install` statt mit `pip`. Der eigene Paketindex
|
|
110
|
+
kommt als Bau-Argument `FYOS_INDEX_URL` (Compose reicht dafür `FYOS_PAKETINDEX` aus der `.env` durch, bei Kubernetes
|
|
111
|
+
steht es im Bau-Befehl) und steht per `--index` vor PyPI. Dazu steht `--index-strategy first-index` ausdrücklich im
|
|
112
|
+
Befehl: uv nimmt ein Paket nur aus dem ersten Index, der es führt. Ein Paket gleichen Namens auf PyPI kann das eigene
|
|
113
|
+
deshalb nicht verdrängen (Dependency Confusion). Mit `pip --extra-index-url` nähme pip dagegen die höchste Version aus
|
|
114
|
+
allen Indizes, und ein fremdes Paket mit höherer Versionsnummer gewänne. `unsafe-best-match` gehört nirgends in den
|
|
115
|
+
Befehl; ein Test hält das fest. Die Version von uv ist fest gewählt (`UV_BILD` in `fyos_installer/erzeugen.py`, dieselbe
|
|
116
|
+
wie im Hub-Bild der Distribution; ein Test hält beide gleich). Der frühere Bau-Argument-Name `PIP_EXTRA_INDEX_URL` entfällt:
|
|
117
|
+
uv liest ihn nicht. Ein alter Bau-Befehl mit diesem Namen lässt den eigenen Index deshalb aus (Docker warnt vor dem nicht
|
|
118
|
+
verbrauchten Bau-Argument); Pakete, die nur im eigenen Index liegen, findet der Bau dann nicht und bricht ab. Ist der
|
|
119
|
+
eigene Index selbst nicht erreichbar, bricht uv ebenfalls ab, statt auf PyPI auszuweichen.
|
|
120
|
+
|
|
121
|
+
## Was entsteht
|
|
122
|
+
|
|
123
|
+
Compose (`compose`, `dateien`): `docker-compose.yml` (Hub mit `build: ./hub`), `.env` (Geheimnisse, Rechte 0600),
|
|
124
|
+
`fyos.yaml` (Persona), `hub-config.yaml` (Format des Hubs, Plugins per Entry-Point-Name), `hub/Dockerfile`
|
|
125
|
+
(`FROM <Hub-Bild>` plus `uv pip install` der Plugin-Quellen), `.gitignore`, `ANLEITUNG.md`. Bei `compose` folgen
|
|
126
|
+
`docker compose build`, `up -d` und eine Gesundheitsprüfung (web `/`, hub `/health`).
|
|
127
|
+
|
|
128
|
+
Kubernetes (`k8s`): Kustomize-Overlay mit `kustomization.yaml` (Basis `deploy/k8s/base` als Pfad oder Git-URL,
|
|
129
|
+
`optionen.k8s_basis`), ConfigMaps für `fyos.yaml` und Hub-Konfiguration, `secrets.yaml` (0600) und
|
|
130
|
+
`secrets.example.yaml`, `hub/Dockerfile`, `ANLEITUNG.md`. Angewendet wird mit `kubectl`, vom Nutzer. Vorhandene
|
|
131
|
+
Dateien werden als `<name>.vorher` gesichert.
|
|
132
|
+
|
|
133
|
+
## Reifegrad
|
|
134
|
+
|
|
135
|
+
FYOS hat vier Schichten mit je drei Stufen. Vor dem Schreiben zeigt der Installer, auf welcher Stufe jede Schicht mit
|
|
136
|
+
der gewählten Konfiguration steht, woran man die Stufe im laufenden System erkennt und was die nächste Stufe wäre
|
|
137
|
+
(Zusammenfassung im Web-Assistenten und in der Textoberfläche; ohne Oberfläche nach dem Zielordner, auch bei `--trocken`).
|
|
138
|
+
|
|
139
|
+
| Schicht | Stufe 1 | Stufe 2 | Stufe 3 |
|
|
140
|
+
|---|---|---|---|
|
|
141
|
+
| Gedächtnis | Persona | Wissen aus Bausteinen | Verlauf und Vorgänge |
|
|
142
|
+
| Agent | Chat | Werkzeuge | Vorgänge |
|
|
143
|
+
| Takte | Von Hand | Routinen | Routinen mit Grenzen |
|
|
144
|
+
| Oberfläche | Desktop | Apps | Zentrale |
|
|
145
|
+
|
|
146
|
+
Zu jeder Stufe gehört ein Satz »woran erkennbar« (`LEITER` in `fyos_installer/reife.py`), etwas, das man im laufenden
|
|
147
|
+
System nachsehen kann: zum Beispiel für Takte Stufe 3, dass `mcp.zeitplan` zu jeder Routine Tageslimit und Zeitfenster
|
|
148
|
+
samt Laufprotokoll zeigt.
|
|
149
|
+
|
|
150
|
+
Herleitung: Jede Schicht beginnt auf Stufe 1, das leisten Kern und Agent (beide Pflicht). Ein Baustein hebt sie über
|
|
151
|
+
`reife` in seinem Katalogeintrag; es zählt die höchste Stufe unter den gewählten Bausteinen. Für Takte kommt eine Regel
|
|
152
|
+
aus der erzeugten Hub-Konfiguration dazu: Trägt ein gewähltes Hub-Plugin `takt_grenzen` (Tageslimit und Zeitfenster der
|
|
153
|
+
Takte, `docs/ERWEITERN.md` 2.12), steht die Schicht auf Stufe 3. Das ist eine Auskunft über die Konfiguration, kein
|
|
154
|
+
Messwert: Ob die Dienste antworten, prüft die Gesundheitsprüfung, ob der Hub Verbotenes ablehnt, die Abnahme.
|
|
155
|
+
|
|
156
|
+
## Abnahme
|
|
157
|
+
|
|
158
|
+
Ein System, das läuft, ist noch nicht abgenommen. Die Abnahme stellt vier Anfragen an die Adresse der Shell (dort, wo
|
|
159
|
+
auch der Browser anklopft): eine erlaubte und drei verbotene. Die verbotenen muss FYOS ablehnen.
|
|
160
|
+
|
|
161
|
+
| Anfrage | Was geschieht | Erwartet |
|
|
162
|
+
|---|---|---|
|
|
163
|
+
| Gegenprobe | `POST /hub-api/app-call` für `werkstatt.suchen` | beantwortet (200, `ok`) |
|
|
164
|
+
| Probe 1 | `POST /hub-api/call` für `audit.stats`: der volle Aufruf-Endpunkt, den die Shell nicht durchreicht | abgelehnt (403 oder 404) |
|
|
165
|
+
| Probe 2 | `POST /hub-api/app-call` mit `Origin` einer fremden Webseite und `Sec-Fetch-Site: cross-site` | 403 mit `kind: fremde_herkunft` |
|
|
166
|
+
| Probe 3 | `POST /hub-api/app-call` für `audit.stats`, ein Werkzeug ohne Oberfläche | 403 mit `kind: not_an_app` |
|
|
167
|
+
|
|
168
|
+
Nur Ablehnungen gelten. Antwortet FYOS auf eine verbotene Anfrage mit Erfolg, ist die Abnahme **nicht bestanden**; eine
|
|
169
|
+
andere Antwort als erwartet, eine Antwort ohne `kind` oder gar keine Antwort gilt als nicht nachgewiesen und besteht
|
|
170
|
+
ebenso nicht. Besteht die Gegenprobe nicht (falsche Adresse, Hub dahinter nicht erreichbar), sind die Ablehnungen nichts
|
|
171
|
+
wert; die Abnahme sagt das ausdrücklich. Die Anfragen sind harmlos, auch wenn die Ablehnung ausbleibt: Sie rufen nur
|
|
172
|
+
lesende Werkzeuge (`audit.stats` liefert Zahlen, `werkstatt.suchen` liest die Liste der Skripte), schreiben nichts und
|
|
173
|
+
lösen nichts aus. Sie brauchen weder Anmeldung noch Docker und laufen ohne Proxy und ohne Weiterleitungen zu folgen.
|
|
174
|
+
|
|
175
|
+
Beim Ziel Docker Compose läuft die Abnahme nach der Gesundheitsprüfung von selbst. Das Ergebnis steht im Protokoll und
|
|
176
|
+
in der Meldung des Assistenten; besteht sie nicht, heißt es »Gestartet, aber nicht abgenommen« (FYOS läuft trotzdem,
|
|
177
|
+
Rückgabewert `3`). Bei jedem anderen Ziel und zum Wiederholen:
|
|
178
|
+
|
|
179
|
+
```sh
|
|
180
|
+
fyos-install --abnahme http://localhost:8080 # 0 bestanden, 3 nicht bestanden, 2 unbrauchbare Adresse
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
Bei Kubernetes läuft dafür der Port-Forward aus der Anleitung (`kubectl -n <namespace> port-forward svc/web 8080:80`). Die
|
|
184
|
+
`ANLEITUNG.md` im Zielordner nennt den Abnahme-Befehl mit dem Port der Installation.
|
|
185
|
+
|
|
186
|
+
## Katalog
|
|
187
|
+
|
|
188
|
+
`fyos_installer/katalog.yaml`, Schema in `katalog.py`. Je Baustein: `id`, `titel`, `kurz`, `was_daraus_wird`
|
|
189
|
+
(Markdown, 3 bis 8 Sätze), `bilder` (Dateinamen unter `bilder/`, Schema `<id>-<n>.svg`; liegt daneben eine
|
|
190
|
+
`.png`, nimmt der Installer sie), `art` (`kern|agent|plugin`), `pflicht`, `abhaengig_von`, `voraussetzungen`,
|
|
191
|
+
`quelle` (`{paket: fyos-plugin-x, repo: fyos-plugin-x}`: Paketname im Index und Git-Repo-Name), `konfiguration`
|
|
192
|
+
(Felder mit `name` als Schlüssel, `titel` als Beschriftung (Pflicht), `typ` text|geheim|url|zahl|wahl,
|
|
193
|
+
`beschreibung`, `standard`, `pflicht`, optional `umgebung` und `optionen`),
|
|
194
|
+
`hub_plugins` (Einträge der Hub-Konfiguration: `name`, optional `config`, `secrets`, `enabled`),
|
|
195
|
+
optional `reife` (`{gedaechtnis|agent|takte|oberflaeche: 1 bis 3}`: auf welche Stufe der Baustein welche Schicht hebt,
|
|
196
|
+
siehe [Reifegrad](#reifegrad); fehlt eine Schicht, hebt er sie nicht).
|
|
197
|
+
|
|
198
|
+
Eigene Kataloge: ein Plugin-Paket bringt `fyos-katalog.yaml` mit (Entry-Point-Gruppe `fyos.katalog` mit Pfad,
|
|
199
|
+
Katalog oder Funktion, die eines davon liefert; oder die Datei im Paket). Fremde Kataloge: `--katalog URL|DATEI`.
|
|
200
|
+
Gleiche `id` in einem späteren Katalog ersetzt den früheren Eintrag; nennt der Ersatz kein `reife`, behält er das
|
|
201
|
+
des ersetzten Eintrags.
|
|
202
|
+
|
|
203
|
+
## Tests
|
|
204
|
+
|
|
205
|
+
```sh
|
|
206
|
+
pip install -e "installer[test]"
|
|
207
|
+
python -m pytest installer/tests -q
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
Docker wird nie gestartet; der Ablauf ist gemockt. Der Test `test_k8s_kustomize_baut` nutzt `kubectl kustomize`,
|
|
211
|
+
wenn vorhanden. Der Seitentest (`test_seiten.py`) braucht Node.
|
|
212
|
+
|
|
213
|
+
Die Abnahme prüft `test_abnahme.py` auf drei Ebenen: die Urteile mit einem Sender ohne Netz, `senden` gegen einen
|
|
214
|
+
lokalen Server (keine Weiterleitung, kein Proxy, nur http und https) und die ganze Kette gegen den echten Hub (Paket
|
|
215
|
+
`fyos-hub` im selben Python, sonst übersprungen) hinter einer Weiche, die aus `web/nginx/default.conf.template` gelesen
|
|
216
|
+
wird. Zu jeder Ablehnung gehört ein Sabotagetest: Lässt die Weiche den vollen Endpunkt durch, entfernt sie die
|
|
217
|
+
Herkunftsköpfe oder öffnet sie jedes Werkzeug, muss die Abnahme »durchgelassen« melden. Die Probewerkzeuge müssen im Hub
|
|
218
|
+
als `read` ausgezeichnet sein. `test_reife.py` hält die Leiter, die Herleitung und das Schema von `reife` fest, auch
|
|
219
|
+
diese Tabelle der Stufen.
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
# FYOS-Installer
|
|
2
|
+
|
|
3
|
+
Der Installer der Distribution **FYOS — For Your Own Sake**: eine Auswahl von Bausteinen, die auf dem Bildschirm
|
|
4
|
+
erklärt (mit Bildern), was daraus wird, und danach die Auslieferung erzeugt (Docker Compose oder Kubernetes).
|
|
5
|
+
|
|
6
|
+
```sh
|
|
7
|
+
pip install ./installer # Python 3.11 oder neuer
|
|
8
|
+
pip install "./installer[tui]" # optional: Textoberfläche
|
|
9
|
+
pip install "./installer[tui,bilder]" # optional: Screenshots (PNG/JPG) im Terminal
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## Drei Bedienarten
|
|
13
|
+
|
|
14
|
+
### 1. Web-Assistent (Standard)
|
|
15
|
+
|
|
16
|
+
```sh
|
|
17
|
+
fyos-install
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Startet einen Server nur auf `127.0.0.1` (zufälliger Port, Zugangstoken im Link) und öffnet den Browser. Läuft
|
|
21
|
+
offline, ohne CDN. Schritte: Willkommen, Ziel, Bausteine, Einrichten, Zusammenfassung, Installieren (Live-Protokoll).
|
|
22
|
+
Bedienung per Tastatur: Tab, Leertaste (Baustein wählen), Pfeiltasten in der Bildgalerie, Enter für Weiter.
|
|
23
|
+
`--kein-browser` gibt nur den Link aus, `--port N` legt den Port fest.
|
|
24
|
+
|
|
25
|
+
| Schritt | Bild |
|
|
26
|
+
|---|---|
|
|
27
|
+
| Willkommen |  |
|
|
28
|
+
| Ziel wählen |  |
|
|
29
|
+
| Bausteine mit Bildgalerie und »Was daraus wird« |  |
|
|
30
|
+
| Einrichten (Agent, Modell, Felder der Bausteine) |  |
|
|
31
|
+
| Zusammenfassung mit Vorschau, was entsteht |  |
|
|
32
|
+
| Installieren mit Live-Protokoll (hier Ziel »Nur Dateien«) |  |
|
|
33
|
+
|
|
34
|
+
Die Bilder in der Galerie der Bausteine sind Skizzen unter `fyos_installer/bilder/` (zum Beispiel
|
|
35
|
+
[kern-1.svg](fyos_installer/bilder/kern-1.svg), [agent-1.svg](fyos_installer/bilder/agent-1.svg),
|
|
36
|
+
[finanzen-1.svg](fyos_installer/bilder/finanzen-1.svg), [haus-1.svg](fyos_installer/bilder/haus-1.svg));
|
|
37
|
+
liegt daneben eine `.png` gleichen Namens, zeigt der Installer sie.
|
|
38
|
+
|
|
39
|
+
API (alle Aufrufe brauchen das Token): `GET /api/katalog`, `POST /api/plan`, `POST /api/installieren`,
|
|
40
|
+
`GET /api/protokoll` (Server-Sent Events).
|
|
41
|
+
|
|
42
|
+
### 2. Textoberfläche
|
|
43
|
+
|
|
44
|
+
```sh
|
|
45
|
+
fyos-install --tui
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Dieselben Schritte mit Textual. Tasten: `n` weiter, `b` zurück, `q` beenden (`Strg+n` / `Strg+b` auch im Textfeld).
|
|
49
|
+
PNG/JPG-Bilder zeigt `textual-image` (Extra `bilder`), SVG-Skizzen erscheinen als Textbeschreibung mit Pfad.
|
|
50
|
+
Ohne Textual erscheint eine Meldung mit dem passenden `pip`-Befehl.
|
|
51
|
+
|
|
52
|
+
### 3. Ohne Oberfläche
|
|
53
|
+
|
|
54
|
+
```sh
|
|
55
|
+
fyos-install --auswahl kern,agent,finanzen --ziel compose --antworten antworten.yaml --verzeichnis ./fyos --trocken
|
|
56
|
+
fyos-install --auswahl kern,agent --ziel k8s --verzeichnis ./fyos-k8s --ja
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
`--ziel compose|k8s|dateien`; `--trocken` zeigt Dateien und Befehle und schreibt nichts; `--ja` fragt nicht nach;
|
|
60
|
+
ohne Terminal ist `--ja` Pflicht. Abhängigkeiten und Pflichtbausteine werden ergänzt. `--liste` zeigt den Katalog.
|
|
61
|
+
`--abnahme ADRESSE` führt nur die [Abnahme](#abnahme) gegen eine laufende Installation aus.
|
|
62
|
+
|
|
63
|
+
Rückgabewerte: `0` gut, `1` Installation oder Start gescheitert, `2` falsche Eingabe, `3` FYOS läuft, aber die
|
|
64
|
+
Abnahme ist nicht bestanden.
|
|
65
|
+
|
|
66
|
+
`antworten.yaml` (alles optional, Vorgaben siehe `erzeugen.py`):
|
|
67
|
+
|
|
68
|
+
```yaml
|
|
69
|
+
persona: {agent_name: Fy, wesen: ruhig und direkt, besitzer_name: Alex, sprache: Deutsch}
|
|
70
|
+
modell: {basis_url: "http://host.docker.internal:11434/v1", name: "mein-modell", schluessel: ""}
|
|
71
|
+
felder:
|
|
72
|
+
kern: {port: 8080}
|
|
73
|
+
haus: {ha_url: "http://homeassistant.example.com:8123", ha_token: "…"}
|
|
74
|
+
optionen: {plugin_quelle: "https://git.example.com/fyos", namespace: fyos}
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Vorgaben aus der Umgebung:
|
|
78
|
+
|
|
79
|
+
| Variable | Wirkung |
|
|
80
|
+
|---|---|
|
|
81
|
+
| `FYOS_PAKETINDEX` | PyPI-kompatibler Index (zum Beispiel `https://git.example.com/api/packages/org/pypi/simple`); Plugins werden per Paketname installiert, der Index geht als `--build-arg FYOS_INDEX_URL` ins Hub-Dockerfile und steht dort vor PyPI |
|
|
82
|
+
| `FYOS_PLUGIN_QUELLE` | Git-Adresse der Plugin-Repos (`optionen.bezug: git`) |
|
|
83
|
+
| `FYOS_REGISTRY` | zum Beispiel `registry.example.com/org`; ergibt `<reg>/fyos-os/web:main`, `<reg>/fyos-os/hub:main`, `<reg>/fyos-agent/openclaw:main` |
|
|
84
|
+
|
|
85
|
+
`optionen.bezug` ist `index` (Vorgabe) oder `git`; ist nur eine Plugin-Quelle gesetzt, gilt `git`. Die Bilder
|
|
86
|
+
(`bild_web`, `hub_bild`, `bild_agent`) sind in den Antworten und im Assistenten editierbar.
|
|
87
|
+
|
|
88
|
+
#### Warum uv, und warum der eigene Index Vorrang hat
|
|
89
|
+
|
|
90
|
+
Das erzeugte Hub-Dockerfile installiert die Plugin-Pakete mit `uv pip install` statt mit `pip`. Der eigene Paketindex
|
|
91
|
+
kommt als Bau-Argument `FYOS_INDEX_URL` (Compose reicht dafür `FYOS_PAKETINDEX` aus der `.env` durch, bei Kubernetes
|
|
92
|
+
steht es im Bau-Befehl) und steht per `--index` vor PyPI. Dazu steht `--index-strategy first-index` ausdrücklich im
|
|
93
|
+
Befehl: uv nimmt ein Paket nur aus dem ersten Index, der es führt. Ein Paket gleichen Namens auf PyPI kann das eigene
|
|
94
|
+
deshalb nicht verdrängen (Dependency Confusion). Mit `pip --extra-index-url` nähme pip dagegen die höchste Version aus
|
|
95
|
+
allen Indizes, und ein fremdes Paket mit höherer Versionsnummer gewänne. `unsafe-best-match` gehört nirgends in den
|
|
96
|
+
Befehl; ein Test hält das fest. Die Version von uv ist fest gewählt (`UV_BILD` in `fyos_installer/erzeugen.py`, dieselbe
|
|
97
|
+
wie im Hub-Bild der Distribution; ein Test hält beide gleich). Der frühere Bau-Argument-Name `PIP_EXTRA_INDEX_URL` entfällt:
|
|
98
|
+
uv liest ihn nicht. Ein alter Bau-Befehl mit diesem Namen lässt den eigenen Index deshalb aus (Docker warnt vor dem nicht
|
|
99
|
+
verbrauchten Bau-Argument); Pakete, die nur im eigenen Index liegen, findet der Bau dann nicht und bricht ab. Ist der
|
|
100
|
+
eigene Index selbst nicht erreichbar, bricht uv ebenfalls ab, statt auf PyPI auszuweichen.
|
|
101
|
+
|
|
102
|
+
## Was entsteht
|
|
103
|
+
|
|
104
|
+
Compose (`compose`, `dateien`): `docker-compose.yml` (Hub mit `build: ./hub`), `.env` (Geheimnisse, Rechte 0600),
|
|
105
|
+
`fyos.yaml` (Persona), `hub-config.yaml` (Format des Hubs, Plugins per Entry-Point-Name), `hub/Dockerfile`
|
|
106
|
+
(`FROM <Hub-Bild>` plus `uv pip install` der Plugin-Quellen), `.gitignore`, `ANLEITUNG.md`. Bei `compose` folgen
|
|
107
|
+
`docker compose build`, `up -d` und eine Gesundheitsprüfung (web `/`, hub `/health`).
|
|
108
|
+
|
|
109
|
+
Kubernetes (`k8s`): Kustomize-Overlay mit `kustomization.yaml` (Basis `deploy/k8s/base` als Pfad oder Git-URL,
|
|
110
|
+
`optionen.k8s_basis`), ConfigMaps für `fyos.yaml` und Hub-Konfiguration, `secrets.yaml` (0600) und
|
|
111
|
+
`secrets.example.yaml`, `hub/Dockerfile`, `ANLEITUNG.md`. Angewendet wird mit `kubectl`, vom Nutzer. Vorhandene
|
|
112
|
+
Dateien werden als `<name>.vorher` gesichert.
|
|
113
|
+
|
|
114
|
+
## Reifegrad
|
|
115
|
+
|
|
116
|
+
FYOS hat vier Schichten mit je drei Stufen. Vor dem Schreiben zeigt der Installer, auf welcher Stufe jede Schicht mit
|
|
117
|
+
der gewählten Konfiguration steht, woran man die Stufe im laufenden System erkennt und was die nächste Stufe wäre
|
|
118
|
+
(Zusammenfassung im Web-Assistenten und in der Textoberfläche; ohne Oberfläche nach dem Zielordner, auch bei `--trocken`).
|
|
119
|
+
|
|
120
|
+
| Schicht | Stufe 1 | Stufe 2 | Stufe 3 |
|
|
121
|
+
|---|---|---|---|
|
|
122
|
+
| Gedächtnis | Persona | Wissen aus Bausteinen | Verlauf und Vorgänge |
|
|
123
|
+
| Agent | Chat | Werkzeuge | Vorgänge |
|
|
124
|
+
| Takte | Von Hand | Routinen | Routinen mit Grenzen |
|
|
125
|
+
| Oberfläche | Desktop | Apps | Zentrale |
|
|
126
|
+
|
|
127
|
+
Zu jeder Stufe gehört ein Satz »woran erkennbar« (`LEITER` in `fyos_installer/reife.py`), etwas, das man im laufenden
|
|
128
|
+
System nachsehen kann: zum Beispiel für Takte Stufe 3, dass `mcp.zeitplan` zu jeder Routine Tageslimit und Zeitfenster
|
|
129
|
+
samt Laufprotokoll zeigt.
|
|
130
|
+
|
|
131
|
+
Herleitung: Jede Schicht beginnt auf Stufe 1, das leisten Kern und Agent (beide Pflicht). Ein Baustein hebt sie über
|
|
132
|
+
`reife` in seinem Katalogeintrag; es zählt die höchste Stufe unter den gewählten Bausteinen. Für Takte kommt eine Regel
|
|
133
|
+
aus der erzeugten Hub-Konfiguration dazu: Trägt ein gewähltes Hub-Plugin `takt_grenzen` (Tageslimit und Zeitfenster der
|
|
134
|
+
Takte, `docs/ERWEITERN.md` 2.12), steht die Schicht auf Stufe 3. Das ist eine Auskunft über die Konfiguration, kein
|
|
135
|
+
Messwert: Ob die Dienste antworten, prüft die Gesundheitsprüfung, ob der Hub Verbotenes ablehnt, die Abnahme.
|
|
136
|
+
|
|
137
|
+
## Abnahme
|
|
138
|
+
|
|
139
|
+
Ein System, das läuft, ist noch nicht abgenommen. Die Abnahme stellt vier Anfragen an die Adresse der Shell (dort, wo
|
|
140
|
+
auch der Browser anklopft): eine erlaubte und drei verbotene. Die verbotenen muss FYOS ablehnen.
|
|
141
|
+
|
|
142
|
+
| Anfrage | Was geschieht | Erwartet |
|
|
143
|
+
|---|---|---|
|
|
144
|
+
| Gegenprobe | `POST /hub-api/app-call` für `werkstatt.suchen` | beantwortet (200, `ok`) |
|
|
145
|
+
| Probe 1 | `POST /hub-api/call` für `audit.stats`: der volle Aufruf-Endpunkt, den die Shell nicht durchreicht | abgelehnt (403 oder 404) |
|
|
146
|
+
| Probe 2 | `POST /hub-api/app-call` mit `Origin` einer fremden Webseite und `Sec-Fetch-Site: cross-site` | 403 mit `kind: fremde_herkunft` |
|
|
147
|
+
| Probe 3 | `POST /hub-api/app-call` für `audit.stats`, ein Werkzeug ohne Oberfläche | 403 mit `kind: not_an_app` |
|
|
148
|
+
|
|
149
|
+
Nur Ablehnungen gelten. Antwortet FYOS auf eine verbotene Anfrage mit Erfolg, ist die Abnahme **nicht bestanden**; eine
|
|
150
|
+
andere Antwort als erwartet, eine Antwort ohne `kind` oder gar keine Antwort gilt als nicht nachgewiesen und besteht
|
|
151
|
+
ebenso nicht. Besteht die Gegenprobe nicht (falsche Adresse, Hub dahinter nicht erreichbar), sind die Ablehnungen nichts
|
|
152
|
+
wert; die Abnahme sagt das ausdrücklich. Die Anfragen sind harmlos, auch wenn die Ablehnung ausbleibt: Sie rufen nur
|
|
153
|
+
lesende Werkzeuge (`audit.stats` liefert Zahlen, `werkstatt.suchen` liest die Liste der Skripte), schreiben nichts und
|
|
154
|
+
lösen nichts aus. Sie brauchen weder Anmeldung noch Docker und laufen ohne Proxy und ohne Weiterleitungen zu folgen.
|
|
155
|
+
|
|
156
|
+
Beim Ziel Docker Compose läuft die Abnahme nach der Gesundheitsprüfung von selbst. Das Ergebnis steht im Protokoll und
|
|
157
|
+
in der Meldung des Assistenten; besteht sie nicht, heißt es »Gestartet, aber nicht abgenommen« (FYOS läuft trotzdem,
|
|
158
|
+
Rückgabewert `3`). Bei jedem anderen Ziel und zum Wiederholen:
|
|
159
|
+
|
|
160
|
+
```sh
|
|
161
|
+
fyos-install --abnahme http://localhost:8080 # 0 bestanden, 3 nicht bestanden, 2 unbrauchbare Adresse
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
Bei Kubernetes läuft dafür der Port-Forward aus der Anleitung (`kubectl -n <namespace> port-forward svc/web 8080:80`). Die
|
|
165
|
+
`ANLEITUNG.md` im Zielordner nennt den Abnahme-Befehl mit dem Port der Installation.
|
|
166
|
+
|
|
167
|
+
## Katalog
|
|
168
|
+
|
|
169
|
+
`fyos_installer/katalog.yaml`, Schema in `katalog.py`. Je Baustein: `id`, `titel`, `kurz`, `was_daraus_wird`
|
|
170
|
+
(Markdown, 3 bis 8 Sätze), `bilder` (Dateinamen unter `bilder/`, Schema `<id>-<n>.svg`; liegt daneben eine
|
|
171
|
+
`.png`, nimmt der Installer sie), `art` (`kern|agent|plugin`), `pflicht`, `abhaengig_von`, `voraussetzungen`,
|
|
172
|
+
`quelle` (`{paket: fyos-plugin-x, repo: fyos-plugin-x}`: Paketname im Index und Git-Repo-Name), `konfiguration`
|
|
173
|
+
(Felder mit `name` als Schlüssel, `titel` als Beschriftung (Pflicht), `typ` text|geheim|url|zahl|wahl,
|
|
174
|
+
`beschreibung`, `standard`, `pflicht`, optional `umgebung` und `optionen`),
|
|
175
|
+
`hub_plugins` (Einträge der Hub-Konfiguration: `name`, optional `config`, `secrets`, `enabled`),
|
|
176
|
+
optional `reife` (`{gedaechtnis|agent|takte|oberflaeche: 1 bis 3}`: auf welche Stufe der Baustein welche Schicht hebt,
|
|
177
|
+
siehe [Reifegrad](#reifegrad); fehlt eine Schicht, hebt er sie nicht).
|
|
178
|
+
|
|
179
|
+
Eigene Kataloge: ein Plugin-Paket bringt `fyos-katalog.yaml` mit (Entry-Point-Gruppe `fyos.katalog` mit Pfad,
|
|
180
|
+
Katalog oder Funktion, die eines davon liefert; oder die Datei im Paket). Fremde Kataloge: `--katalog URL|DATEI`.
|
|
181
|
+
Gleiche `id` in einem späteren Katalog ersetzt den früheren Eintrag; nennt der Ersatz kein `reife`, behält er das
|
|
182
|
+
des ersetzten Eintrags.
|
|
183
|
+
|
|
184
|
+
## Tests
|
|
185
|
+
|
|
186
|
+
```sh
|
|
187
|
+
pip install -e "installer[test]"
|
|
188
|
+
python -m pytest installer/tests -q
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
Docker wird nie gestartet; der Ablauf ist gemockt. Der Test `test_k8s_kustomize_baut` nutzt `kubectl kustomize`,
|
|
192
|
+
wenn vorhanden. Der Seitentest (`test_seiten.py`) braucht Node.
|
|
193
|
+
|
|
194
|
+
Die Abnahme prüft `test_abnahme.py` auf drei Ebenen: die Urteile mit einem Sender ohne Netz, `senden` gegen einen
|
|
195
|
+
lokalen Server (keine Weiterleitung, kein Proxy, nur http und https) und die ganze Kette gegen den echten Hub (Paket
|
|
196
|
+
`fyos-hub` im selben Python, sonst übersprungen) hinter einer Weiche, die aus `web/nginx/default.conf.template` gelesen
|
|
197
|
+
wird. Zu jeder Ablehnung gehört ein Sabotagetest: Lässt die Weiche den vollen Endpunkt durch, entfernt sie die
|
|
198
|
+
Herkunftsköpfe oder öffnet sie jedes Werkzeug, muss die Abnahme »durchgelassen« melden. Die Probewerkzeuge müssen im Hub
|
|
199
|
+
als `read` ausgezeichnet sein. `test_reife.py` hält die Leiter, die Herleitung und das Schema von `reife` fest, auch
|
|
200
|
+
diese Tabelle der Stufen.
|