Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 1.7.0 #21

Merged
merged 58 commits into from
Oct 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
1b45bec
Gitea repo integration
Sep 16, 2024
b3ceddd
fix
Sep 16, 2024
444b7c9
Gitea repo integration
Sep 17, 2024
867876b
Gitea repo integration
Sep 17, 2024
ae31494
Gitea repo integration
Sep 17, 2024
43ab5bc
Gitea repo integration
Sep 17, 2024
455f8d6
Gitea repo integration
Sep 17, 2024
846baff
Dark UI/controls displayed as table
Sep 17, 2024
3907ec0
UI/controls displayed as table
Sep 17, 2024
3cbc3b3
refactoring css dark in progress
Sep 18, 2024
303407b
UI improvement in progress
Sep 19, 2024
7134694
UI improvement in progress
Sep 19, 2024
0ac8534
UI improvement in progress
Sep 19, 2024
602ad4f
UI improvement in progress
Sep 19, 2024
c39c8c8
UI improvement in progress
Sep 19, 2024
483df10
UI improvement in progress
Sep 19, 2024
44cb430
UI improvement in progress
Sep 21, 2024
822ef90
UI improvement in progress
Sep 21, 2024
9686f69
UI improvement in progress
Sep 21, 2024
070f0d0
UI improvement in progress
Sep 21, 2024
0f110d2
UI improvement in progress
Sep 21, 2024
4c679a2
UI improvement in progress
Sep 21, 2024
7120f4d
UI improvement in progress
Sep 21, 2024
8e7c0a1
UI improvement in progress
Sep 21, 2024
dd3a0ae
Tests
Sep 21, 2024
85e8fe3
UI
Sep 21, 2024
c15b1b5
UI
Sep 21, 2024
11b98b0
UI
Sep 21, 2024
d732884
compare
Sep 22, 2024
a185186
compare
Sep 22, 2024
afcbe73
compare
Sep 22, 2024
9a193eb
compare UI
Sep 22, 2024
68a5ac6
server
Sep 22, 2024
d65b1fb
UI - fixed response analysis to control deletion
Sep 22, 2024
b5328b3
server
Sep 22, 2024
72c13b9
refactcoring auth token
Sep 22, 2024
8a55aeb
Ui - control summary
Sep 22, 2024
996210d
UI - translations
Sep 22, 2024
2790c79
server
Sep 23, 2024
c20f76d
UI
Sep 23, 2024
772d4ca
UI
Sep 24, 2024
0d2466f
server
Sep 24, 2024
c3ec118
server
Sep 24, 2024
5e33465
Global github token
Sep 24, 2024
972bb56
Global github token
Sep 26, 2024
83488b1
UI
Sep 26, 2024
482505a
UI
Sep 26, 2024
54976d2
UI
Sep 26, 2024
6f59876
UI
Sep 26, 2024
df25592
Global Github Token
Sep 27, 2024
dbe8134
UI
Sep 27, 2024
b017d8e
Fixed production version implementation
Sep 29, 2024
1f0ac68
UI
Sep 29, 2024
77cd9de
Stories: update
Sep 29, 2024
ec39865
UI-server
Sep 29, 2024
04015d8
Documentation
Oct 2, 2024
1dc556f
typo
Oct 2, 2024
8a2da7b
builder
Oct 2, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading