Skip to content

Commit 95beec0

Browse files
kahoona77cesmarvin
authored andcommitted
Merge branch 'release/v1.0.0'
2 parents a7caeb4 + 50acde8 commit 95beec0

15 files changed

+469
-12
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [Unreleased]
88

9+
## [v1.0.0] - 2025-09-23
10+
### Added
11+
- [#4] documentation for asset usecases
12+
913
## [v0.1.0] - 2025-09-12
1014
### Added
1115
- [#1] initial project structure

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ ENV WARP_MENU_VERSION=2.0.3 \
4545
CES_ABOUT_VERSION="0.7.0" \
4646
CES_ABOUT_TAR_SHA256="fcfdfb86dac75d5ae751cc0e8c3436ecee12f0d5ed830897c4f61029ae1df27e" \
4747
# Used in template to invalidate caches - do not remove. The release script will auto update this line
48-
VERSION="0.1.0"
48+
VERSION="1.0.0"
4949

5050
# Install required packages
5151
RUN apk upgrade \

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
ARTIFACT_ID=k8s-ces-assets
33
ARTIFACT_ID_WARP=${ARTIFACT_ID}-warp
44
ARTIFACT_ID_MAINTENANCE=${ARTIFACT_ID}-maintenance
5-
VERSION=0.1.0
5+
VERSION=1.0.0
66
IMAGE=cloudogu/${ARTIFACT_ID}:${VERSION}
77

88
MAKEFILES_VERSION=10.2.0
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Hinzufügen einer neuen Resource
2+
3+
Diese Komponente liefert einige Dateien direkt in `/etc/nginx` bzw. `/var/www/html` aus.
4+
5+
Einige dieser Dateien sind zusätzlich noch getemplatet und werden von `helm` bei der Installation erstellt bzw. bearbeitet. \
6+
All diese Dateien werden als Config-Map von der Komponente bereitgestellt und in den manager-Container gemountet.
7+
8+
Um nicht jede Datei einzeln in eine Config-Map mounten zu müssen, wird beim rendern des Deployment-Templates
9+
der Ordner `./k8s/helm/resources` durchsucht. Die Dateien und Ordner in dieser Quelle werden so behandelt, als ob sie sich unter dem `root` Pfad befinden.
10+
11+
`./k8s/helm/resources/etc/nginx/include.d/subfilters.conf` -> `/etc/nginx/include.d/subfilters.conf`
12+
13+
Innerhalb der Dateien unterhalb des Resources-Ordners kann die helm-Template-Syntax verwendet werden gemeinsam mit allen
14+
Werten, die in der `values.yaml` konfiguriert wurden.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Adding a New Resource
2+
3+
This component delivers some files directly into `/etc/nginx` or `/var/www/html`.
4+
5+
Some of these files are additionally templated and created or modified by `helm` during installation. \
6+
All of these files are provided by the component as a config map and mounted into the manager container.
7+
8+
To avoid having to mount each file individually into a config map, the `./k8s/helm/resources` folder is scanned when rendering the deployment template.
9+
The files and folders in this source are treated as if they were located under the `root` path.
10+
11+
`./k8s/helm/resources/etc/nginx/include.d/subfilters.conf` -> `/etc/nginx/include.d/subfilters.conf`
12+
13+
Within the files under the resources folder, the helm template syntax can be used together with all values configured in the `values.yaml`.

docs/development/ces-theme_de.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# CES-Theme-Integration
2+
3+
In der Ces-Assets-Komponente wird das [CES-Theme-Tailwind][ces-theme-tailwind] an eingebunden um die allgemeine CES-Styles bereitzustellen.
4+
5+
## Templating
6+
Im Ordner [theme-build](../../theme-build) ist eine NodeJS-projekt definiert, das das [CES-Theme-Tailwind][ces-theme-tailwind] inkludiert. <!-- markdown-link-check-disable-line -->
7+
8+
### Default-Styles
9+
Die Default-Styles werden vom nginx als `default.css` in jede HTML-Seite eingebunden.
10+
Diese Styles sind in der Datei [default.css.tpl](../../resources/var/www/html/styles/default.css.tpl) definiert. <!-- markdown-link-check-disable-line -->
11+
Dabei werden die Farb-Variablen als CSS-Custom-Properties aus dem [CES-Theme-Tailwind][ces-theme-tailwind] inkludiert.
12+
13+
Mit `yarn template-default-css` wird aus der Template-Datei die `default.css` mit allen Farb-Variablen generiert.
14+
15+
16+
### Error-Pages
17+
Die Error-Pages in der Ces-Assets-Komponente sind alle gleich aufgebaut und unterscheiden sich nur durch einzelne Texte und Bilder.
18+
Aus diesem Grund gibt es auch nur ein Template für die Error-Pages: [error-page.html.tpl](../../resources/var/www/html/errors/error-page.html.tpl). <!-- markdown-link-check-disable-line -->
19+
20+
Aus diesem Template werden mit `yarn template-error-pages` die error-pages generiert.
21+
22+
Die Konfiguration der einzelnen Error-Pages ist in der Datei [error-pages.json](../../theme-build/error-pages.json) zu finden. <!-- markdown-link-check-disable-line -->
23+
24+
25+
[ces-theme-tailwind]: https://github.com/cloudogu/ces-theme-tailwind/

docs/development/ces-theme_en.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# CES Theme Integration
2+
3+
In the Ces Assets component, the [CES Theme Tailwind][ces-theme-tailwind] is integrated to provide the general CES styles.
4+
5+
## Templating
6+
In the [theme-build](../../theme-build) folder, a NodeJS project is defined that includes the [CES Theme Tailwind][ces-theme-tailwind]. <!-- markdown-link-check-disable-line -->
7+
8+
### Default Styles
9+
The default styles are embedded by nginx as `default.css` into every HTML page.
10+
These styles are defined in the file [default.css.tpl](../../resources/var/www/html/styles/default.css.tpl). <!-- markdown-link-check-disable-line -->
11+
The color variables are included as CSS custom properties from the [CES Theme Tailwind][ces-theme-tailwind].
12+
13+
With `yarn template-default-css`, the `default.css` is generated from the template file with all color variables.
14+
15+
### Error Pages
16+
The error pages in the Ces Assets component all follow the same structure and differ only in certain texts and images.
17+
For this reason, there is only one template for the error pages: [error-page.html.tpl](../../resources/var/www/html/errors/error-page.html.tpl). <!-- markdown-link-check-disable-line -->
18+
19+
From this template, the error pages are generated using `yarn template-error-pages`.
20+
21+
The configuration of the individual error pages can be found in the file [error-pages.json](../../theme-build/error-pages.json). <!-- markdown-link-check-disable-line -->
22+
23+
24+
[ces-theme-tailwind]: https://github.com/cloudogu/ces-theme-tailwind

docs/development/containers_de.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Container-Zugehörigkeit
2+
3+
Die `k8s-ces-assets`-Komponente besteht im Ganzen aus 4 Containern.
4+
5+
* Init-Container zum Kopieren der custom-HTML-Resourcen und zum Sichern der Warp-Html-Resourcen.
6+
* nginx-manager für das eigentliche Ausbringen der statischen Resourcen
7+
* maintenance-Mode-Container zum Erzeugen der Error-Page für den Maintenance-Mode
8+
* warp-Container zum generischen Erzeugen der warp-menu-Einträge
9+
10+
Der Init-Container und der nginx-manger verwenden beide das Image, welches aus dieser Komponente erstellt wird. \
11+
Dies ist notwendig, da sich der Maintenance- un der Manager-Container eine Datei `503.html.tpl` teilen,
12+
diese aber in einem Ordner liegt der Dateien bereitstellt, die Image enthalten sind.
13+
14+
Um eine gemeinsame Nutzung des gesamten Ordners mit den Inhalten aus dem Image und darin einer gemeinsam gemounteten Datei in den Containern zu erreichen,
15+
muss der Image-Ordner zunächst kopiert und nach dem Mounten wieder synchronisiert werden. Das Hochkopieren aus den Quellen übernimmt dabei der Init-Container.
16+
17+
Eine Bearbeitung der `503.html` über das entsprechende Template erfolgt in einer Go-Applikation (siehe `./maintenance`) im Maintenance-Container.
18+
Dieser liest die Maintenance-Konfiguration aus der global-config aus und erzeugt aus dem Template die Fehlerseite, die dann über ein gemeinsames VolumnMount
19+
mit dem Manager geteilt wird, der diese via nginx ausliefert.
20+
21+
Der Warp-Container erzeugt bei Änderungen an den Dogus eine Warp.json Datei, welche vom manager-Container verwendet und bereitgestellt wird.

docs/development/containers_en.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Container Affiliation
2+
3+
The `k8s-ces-assets` component consists of 4 containers in total.
4+
5+
* Init container for copying the custom HTML resources and backing up the Warp HTML resources.
6+
* nginx manager for serving the static resources
7+
* maintenance mode container for generating the error page for maintenance mode
8+
* warp container for generically generating the warp menu entries
9+
10+
Both the init container and the nginx manager use the image that is built from this component. \
11+
This is necessary because the maintenance and manager containers share a file `503.html.tpl`,
12+
which is located in a folder that serves files contained within the image.
13+
14+
To enable shared usage of the entire folder with the image contents, along with a commonly mounted file in the containers,
15+
the image folder must first be copied and then synchronized again after mounting. Uploading from the sources is handled by the init container.
16+
17+
Editing of the `503.html` via the corresponding template is done in a Go application (see `./maintenance`) inside the maintenance container.
18+
This container reads the maintenance configuration from the global config and generates the error page from the template, which is then shared through a common VolumeMount with the manager, who serves it via nginx.
19+
20+
The warp container generates a Warp.json file whenever Dogus are changed, which is then used and served by the manager container.
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Adding Custom HTML Content
2+
3+
This document describes how custom HTML content can be delivered as `customhtml` via nginx.
4+
5+
## Creating a ConfigMap with Content
6+
7+
The content must be provided as a ConfigMap.
8+
9+
The keys within the ConfigMap serve as filenames.
10+
11+
```yaml
12+
apiVersion: v1
13+
kind: ConfigMap
14+
metadata:
15+
name: "my-customhtml"
16+
data:
17+
sample.html: |-
18+
<html><body>Sample</body></html>
19+
```
20+
21+
Multiple ConfigMaps can also be created and used. However, you must ensure that files are not duplicated across ConfigMaps.
22+
If they are, it is non-deterministic which file will take precedence.
23+
24+
## Making the ConfigMaps Available via values.yaml
25+
26+
The custom HTML content is copied into the application by an InitContainer.
27+
Therefore, the configuration takes place in the initContainer section.
28+
29+
```yaml
30+
initContainer:
31+
customHtmlMountPath: "/var/www/html/customhtml/"
32+
configMaps:
33+
- "my-customhtml"
34+
- "your-customhtml"
35+
```
36+
37+
The `initContainer.configMaps` entry is a list, which may be empty by default.
38+
39+
## Accessing Custom Content
40+
41+
By default, access to the content is provided through the route`/static`.
42+
43+
This can, however, be overridden using the values.yaml.
44+
For this, the value nginx.manager.config.htmlContentUrl must be set.

0 commit comments

Comments
 (0)