Skip to content

Commit

Permalink
Version 1.7.0 (#21)
Browse files Browse the repository at this point in the history
* Gitea repo integration

- [X] change database model
- [X]  change ui
- [X]  change scrap method including authentication with header
- [X]  tested on gitea and codeberg (gitea clone)
- [X ] authentication git repo encrypted
- [ ] css fix
- [ ] tests features

* fix

* Gitea repo integration

- Bump update server:
  see package-lock.json
- Bump update client:
  see client/package-lock.json
- fix storybook ScrapGitHubReleaseTags
- fix scss

* Gitea repo integration

- [ ] update API documentation

* Gitea repo integration

- [X] UI -exclude stories from build

* Gitea repo integration

- [X] Dockerfile cleaning
- [X] Dockerfile for dev (UI must be built by developer)
- [X] build prod load (no direct push)

* Gitea repo integration

- [X] update version

* Dark UI/controls displayed as table

- [ ] detect browser user-pref
- [-] add toggle button dark/bright
- [ ] refactoring colors
- [ ] Create table component
- [ ] add toggle button table/card

* UI/controls displayed as table

- [ ] refactoring css bright/dark
- [ ] add toggle button dark/bright

* refactoring css dark in progress

* UI improvement in progress

* UI improvement in progress

* UI improvement in progress

- [X] light
- [X] typo

* UI improvement in progress

- [X] remove toggle theme featyre, useless, managed by browser-prefs (light/dark)
- [X] typo

* UI improvement in progress

- [X] light

* UI improvement in progress

- [X] light

* UI improvement in progress

- [X] light

* UI improvement in progress

- [X] Controls view as table implementation

* UI improvement in progress

- [X] Controls view as table implementation

* UI improvement in progress

- [X] Controls view as table implementation

* UI improvement in progress

- [X] Controls view as table implementation

* UI improvement in progress

- [X] Controls view as table implementation

* UI improvement in progress

- [X] Update stories
- [ ] Controls view as table implementation (url display)
- [ ] duplicate a control

* UI improvement in progress

- [X] Controls view as table implementation (url display)
- [X] duplicate a control

* Tests

- [X] duplicate a control

* UI

- [X] duplicate a control
- [X] Controls cards/table
- [X] Refactoring DisplayControls
- [X] fix curl

* UI

- [X] duplicate a control - no state

* UI

- [X] curl -k

* compare

- [X] API: modifying specifications GET=>PUT (API: modify specifications, data is altered in reality)

* compare

- [X] UI

* compare

- [X] UI

* compare UI

- [X] API: modifying specifications GET=>PUT (API: modify specifications, data is altered in reality)

* server

- [X] test: add remote ip in server log

* UI - fixed response analysis to control deletion

* server

- [X] test: add remote ip in server log

* refactcoring auth token

* Ui - control summary

* UI - translations

* server

- [ ] log system improvements

* UI

- [X] search by uuid

* UI

- [X] usermanager disable username when editmode is true

* server

[X] login/logout refactorin session.regenerate after login

* server

[X] login/logout refactorin session.regenerate after login

* Global github token

- [ ] inprogress, Github authentication to remove rate limit barrier, use for public repositories. With the implementation of gitea, it is now possible to retrieve private repositories from Github. If not present, use global if provided...

* Global github token

- [ ] inprogress, Github authentication to remove rate limit barrier, use for public repositories. With the implementation of gitea, it is now possible to retrieve private repositories from Github. If not present, use global if provided...

* UI

- [X] remove sticky toasts, keep only on error

* UI

- [X] creating component to display versions
- [X] adding component to table

* UI

Explainations & typo

* UI

Explainations & typo

* Global Github Token

- [X] server integration
- [X] UI

* UI

- [X] toast default life time

* Fixed production version implementation

- [X] server
- [X] UI

* UI

- [X] header: global github token only for admin
- [X] index.html: disable cache to get always fresh js
- [X] remove unexpected toast on login page loading

* Stories: update

* UI-server

- Typo
- remove log isauthenticated
- dark theme

* Documentation

* typo

* builder

---------
  • Loading branch information
dhenry123 authored Oct 2, 2024
1 parent 9c746e2 commit 50863d9
Show file tree
Hide file tree
Showing 122 changed files with 5,203 additions and 9,444 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ test/devtest.test.ts
coverage/**
.envlocaldev
public
src/data
17 changes: 17 additions & 0 deletions Change.log.fr.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[English Changelog](./Change.log.md)

# Changelogs

# 1.7.0

- **BREAKING CHANGE**: Changement de la méthode HTTP pour l'entrée API: "compare". La méthode originale n'était pas appropriée, car la fonction appelée altère les données, par conséquent elle a été remplacée par "PUT". Si vous utiliser utdon dans une tâche "cron" avec curl, ajouter le paramètre: '-X PUT'
- **BREAKING CHANGE**: Harmonisation et amélioration des logs serveur, **le contenu des logs a changé**.
- Refactorisation login/logout, le login retourne un nouveau cookie (corrige session fixation).
- Correction de plusieurs bugs et refactorisation de méthodes.
- Rechercher par uuid ou partie d'uuid.
- UserManager: Le champs username est inactif en mode "Edition".
- Présentation des contrôles sous la forme d'un tableau.
- Duplication d'un contrôle.
- Support des dépôts git de type "Gitea" avec authentification, permet ainsi l'authentification Github pour les projets privés, valeur (HTTP HEADER) Key: Authorization value: Bearer <You token>
- Authentification Github globale pour supprimer la barrière "rate-limit". La valeur est prise seulement dans le cas où le contrôle ne dispose pas déjà d'une authentification spécifique.
- Pour les applications n'offrant pas de point d'entrée de niveau de version, possibilité de saisir la valeur de la version utilisée, ceci peut aussi permettre de suivre l'évolution d'une application qui n'est pas en production.
17 changes: 17 additions & 0 deletions Change.log.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[Changelog en Français](./Change.log.fr.md)

# Changelogs

# 1.7.0

- **BREAKING CHANGE**: Changed the HTTP method for API input to "compare". The original method was not appropriate, as the function called alters the data, so it has been replaced by "PUT". If you use utdon in a "cron" task with curl, add the parameter: '-X PUT'.
- **BREAKING CHANGE**: Harmonization and improvement of server logs, **log content has changed**.
- Refactor login/logout, login returns a new cookie (fix session fixation).
- Several bugs fixed and methods refactored.
- Search by uuid or part of uuid.
- UserManager: The username field is inactive in "Edit" mode.
- Presentation of controls as table.
- Control duplication.
- Support for "Gitea" git repositories with authentication, enabling Github authentication for private projects, value (HTTP HEADER) Key: Authorization value: Bearer <You token>.
- Global Github authentication to remove the "rate-limit" barrier. The value is taken only if the control does not already have a specific authentication.
- For applications that don't offer a version level entry point, it is possible to enter the value of the version in use. This can also be used to track the evolution of an application that is not in production.
1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ WORKDIR /app

# Server
COPY ./src/ ./src/
RUN rm -f ./genSwaggerJson.ts
COPY ./openapi.yaml .
COPY ./package.json .
COPY ./locales ./locales
Expand Down
53 changes: 53 additions & 0 deletions Dockerfile-dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# @author DHENRY for mytinydc.com
# @license AGPL3

ARG RUNASUSER="utdon"
ARG RUNASUSERID="1001"
ARG RUNASGROUP="1001"

FROM node:20.10.0-alpine3.19 as base

# build
FROM base AS builder

WORKDIR /app

# Server
COPY ./src/ ./src/
RUN rm -f ./genSwaggerJson.ts
COPY ./openapi.yaml .
COPY ./package.json .
COPY ./locales ./locales
COPY ./tsconfig.json .
# Building server, final dest is /dist
RUN npm install && npm run build
RUN rm -rf node_modules && npm install --omit=dev

FROM base AS runner
LABEL org.opencontainers.image.source=https://github.com/dhenry123/utdon
LABEL org.opencontainers.image.description="Multi arch image"
LABEL org.opencontainers.image.licenses=AGPLV3

ARG RUNASUSER
ARG RUNASUSERID
ARG RUNASGROUP

# Creating user & group
RUN addgroup -S ${RUNASUSER} --gid "${RUNASGROUP}" && adduser -S ${RUNASUSER} -s /bin/sh --uid "${RUNASUSERID}" -G ${RUNASUSER}

USER ${RUNASUSERID}

WORKDIR /app

COPY --from=builder --chown=${RUNASUSERID}:${RUNASGROUP} /app/dist/ ./
COPY --from=builder --chown=${RUNASUSERID}:${RUNASGROUP} /app/openapi.yaml ./
COPY --from=builder --chown=${RUNASUSERID}:${RUNASGROUP} /app/node_modules/ ./node_modules
# UI must be built by developer
COPY --chown=${RUNASUSERID}:${RUNASGROUP} ./client/dist/ ./public

# data directory for mount point
RUN mkdir data

EXPOSE 3015

CMD ["node","main.js"]
39 changes: 30 additions & 9 deletions README-fr.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ Vos applications FOSS (Free and open-source software) en production, sont-elles
UTDON est né d'un shell qui compare :

- la version d'une application en cours d'exécution (production)
- à la dernière version disponible (dépôt GITHUB).
- à la dernière version disponible (dépôt GITHUB ou compatible Gitea).

N'ayant que des applications dont le dépôt des sources est situé sur "GitHub", UTDON ne fonctionne pour l'instant qu'avec GitHub.
N'ayant que des applications dont le dépôt des sources est situé sur "GitHub" ou "CodeBerg", **UTDON ne fonctionne** pour l'instant qu'avec **GitHub** et des **dépôts compatibles "Gitea"**.

![dashboard](./doc/assets/utdon-dashboard-mytinydc.com.png)

Expand All @@ -20,7 +20,9 @@ N'ayant que des applications dont le dépôt des sources est situé sur "GitHub"
- Surveillance par UI.
- Surveillance par appel API.
- Surveillance par appel API et mise à jour d'un service de monitoring (type ping).
- Appel API pour déclencher la mise à jour par une action sur la chaine CI/CD.
- Appel API de la chaîne CI/CD pour déclencher le processus de mise à jour de l'application.
- Surveillance d'applications qui ne proposent pas de point d'entrée API permettant d'obtenir la version.
- Authentification possible pour Github, dépôts compatibles Gitea, et applications (parfois nécessaire pour obtenir la version).

## Versioning UTDON

Expand Down Expand Up @@ -58,6 +60,7 @@ lr(last release)
cp(compare)
res(result as JSON)
mps(monitoring ping service)
cicd(CI/CD)
s-->|call|ag
ag-->|apply expression and get|lr
s-->|call|ps
Expand All @@ -68,13 +71,14 @@ s-->cp
cp-->|give|res
res-->|update internal state|s
s-->|update|mps
s-->|call|cicd
```

## Stack

- Nodejs
- React/Redux
- Base de données JSON : Situées en RAM, si vous remplacer les fichiers en cours d'exécution, ceci n'aura aucun effet. Le contenu des bases est enregistré après chaque modification et lorsque le service reçoit le signal SGINT | SIGTERM | SIGUSR2.
- Bases de données JSON : Situées en RAM, si vous remplacer les fichiers en cours d'exécution, ceci n'aura aucun effet. Le contenu des bases est enregistré après chaque modification et lorsque le service reçoit le signal SGINT | SIGTERM | SIGUSR2.
- Filtres RegExp et Jmespath pour Json.
- Swagger.

Expand All @@ -88,10 +92,11 @@ Ne jamais exposer UTDON directement sur internet (utilisez un VPN si nécessaire

Le contenu des deux bases de données est chiffré partiellement :

- user.json: Le mot de passe de l'administrateur (non réversible) et le jeton d'authentification (réversible)
- user.json: Le mot de passe (non réversible) et le jeton d'authentification (réversible) des utilisateurs
- database.json:
- Les chaînes d'authentification pour les "urls" de monitoring et de la chaine CI/CD (réversibles).
- HTTP header associé au processus de "production scrap".
- les "HTTP header" (production et dépôt git) associés au processus de "production scrap".
- globalGithubToken: jeton d'authentification Github global (réversible)

### Si vous avez perdu le mot de passe admin

Expand All @@ -101,10 +106,22 @@ Arréter le service, supprimer le fichier "user.json", puis redémarrer. Connect

Les sessions sont gérées en RAM, un simple redémarrage du service réinitialise l'intégralité des sessions.

### Logs

Les logs sont limités au strict nécessaire pour éviter le stockage inutile:

- [x] Connexion utilisateur
- [x] Déconnexion utilisateur
- [x] Ajout d'un contrôle
- [x] suppression d'un contrôle
- [x] Modification d'un contrôle
- [x] Exécution d'une comparaison
- [x] Appel dernière comparaison
- [x] Exécution d'un appel externe du service ping (monitoring externe)
- [x] Exécution d'un appel externe de la chaîne CI/CD

## Roadmap

- Authentification Github pour supprimer la barrière "rate-limit".
- Dupliquer un contrôle.
- Ajout d'un token "readonly" par utilisateur pour utilisation à partir d'une chaîne CI/CD
- Stockage S3.
- Entrypoint API metrics.
Expand All @@ -114,6 +131,8 @@ Les sessions sont gérées en RAM, un simple redémarrage du service réinitiali

- image de la page de connexion: générée par l'AI <https://www.artguru.ai/fr/>

- Icons: <https://tabler.io/icons>

- Radioactive button : <https://zurb.com/playground/radioactive-buttons>

- Multiselect component https://github.com/hc-oss/react-multi-select-component?tab=readme-ov-file
Expand All @@ -124,4 +143,6 @@ Les sessions sont gérées en RAM, un simple redémarrage du service réinitiali

## Si vous appréciez cette application

Donnez lui une étoile...
**Donnez lui une étoile...**

## [CHANGELOG](./Change.log.fr.md)
37 changes: 30 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ Are your FOSS (Free and open-source software) applications in production up to d
UTDON was born from a shell that compares :

- the version of an application currently running (production)
- the latest version available (GITHUB repository).
- to the latest available version (GITHUB or Gitea-compatible repository).

As UTDON only works with applications whose source repository is located on "GitHub", it currently only works with GitHub.
As we only have applications whose source repository is located on "GitHub" or "CodeBerg", **UTDON** currently only works with **GitHub** and **"Gitea "** compatible repositories.

![dashboard](./doc/assets/utdon-dashboard-mytinydc.com.png)

Expand All @@ -20,7 +20,9 @@ As UTDON only works with applications whose source repository is located on "Git
- Monitoring by UI.
- Monitoring by API call.
- Monitoring by API call and update of a monitoring service (ping type).
- API call to trigger update by action on CI/CD chain.
- API call to the CI/CD chain to trigger the application update process.
- Monitoring applications that don't offer an API entry point for versioning.
- Authentication possible for Github, Gitea-compatible repositories and applications (sometimes required to obtain version).

## UTDON Versioning

Expand Down Expand Up @@ -58,6 +60,7 @@ lr(last release)
cp(compare)
res(result as JSON)
mps(monitoring ping service)
cicd(CI/CD)
s-->|call|ag
ag-->|apply expression and get|lr
s-->|call|ps
Expand All @@ -68,8 +71,11 @@ s-->cp
cp-->|give|res
res-->|update internal state|s
s-->|update|mps
s-->|call|cicd
```

## Logs

## Stack

- Nodejs
Expand All @@ -92,6 +98,7 @@ The contents of both databases are partially encrypted:
- database.json:
- Authentication strings for monitoring urls and CI/CD chain (reversible).
- HTTP header associated with the production scrap process
- globalGithubToken: global Github authentication token (reversible)

### If you've lost the admin password

Expand All @@ -101,11 +108,23 @@ Stop the service, delete the "user.json" file, then restart. Then log in with th

Sessions are managed in RAM, so a simple service restart resets all sessions.

### Logs

Logs are kept to a minimum to avoid unnecessary storage:

- [x] User login
- [x] User logout
- [x] Add control
- [x] Deleting a control
- [x] Control modification
- [x] Run comparison
- [x] Call last comparison
- [x] Execute external ping call (external monitoring)
- [x] Execute external call to CI/CD chain

## Roadmap

- Github authentication to remove rate-limit barrier.
- Duplicate a control.
- Addition of a "readonly" token per user for use with a CI/CD chain
- Add one "readonly" token per user for use from a CI/CD chain.
- S3 storage.
- Entrypoint API metrics.
- LDAP authentication.
Expand All @@ -114,6 +133,8 @@ Sessions are managed in RAM, so a simple service restart resets all sessions.

- login page image: generated by AI <https://www.artguru.ai/fr/>

- Icons: <https://tabler.io/icons>

- Radioactive button: <https://zurb.com/playground/radioactive-buttons>

- Multiselect component https://github.com/hc-oss/react-multi-select-component?tab=readme-ov-file
Expand All @@ -124,4 +145,6 @@ Sessions are managed in RAM, so a simple service restart resets all sessions.

## If you like this application

Give it a star...
**Give it a star...**

## [CHANGELOG](./Change.log.md)
2 changes: 1 addition & 1 deletion build-dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ TAG=$(jq '.version' package.json | sed -E 's/^"|"$//g')
#NOCACHE="--no-cache"
PLATFORM="--platform=linux/arm64"
echo "Building image $LOCALREGISTRY:$TAG"
sudo docker buildx build --load $PROGRESS $NOCACHE $PLATFORM -t $LOCALREGISTRY:$TAG -f Dockerfile .
sudo docker buildx build --load $PROGRESS $NOCACHE $PLATFORM -t $LOCALREGISTRY:$TAG -f Dockerfile-dev .
echo "Pushing image $LOCALREGISTRY:$TAG"
sudo docker push "$LOCALREGISTRY":"$TAG"
3 changes: 3 additions & 0 deletions build-prod.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@
# @author DHENRY for mytinydc.com
# @license AGPL3

set -e

source .envlocaldev
# login to github
echo $CR_PAT | sudo docker login ghcr.io -u $USERNAME --password-stdin

# Prepare buildx multiarch
sudo docker buildx rm multiarch
sudo docker buildx create --name multiarch --use

# jq is needed
Expand Down
2 changes: 2 additions & 0 deletions client/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
<meta charset="UTF-8" />
<link rel="icon" type="image/ico" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" />
<title>UPTODATE OR NOT [UTDON]</title>
</head>
<body>
Expand Down
Loading

0 comments on commit 50863d9

Please sign in to comment.