Skip to content

Commit

Permalink
Version 1.1.0 (#11)
Browse files Browse the repository at this point in the history
- Add a new endpoint that CI/CD can use to obtain the Github release of the latest comparison  /action/lastcomparegitrealase/{controlUuid}/
- add curl command for new route
- Add version in login page
- helmet configuration
- remove cors package
- Swagger documentation & links in UI
- Authorization refactoring
- security fix for logout
- update version shell & lint
  • Loading branch information
dhenry123 authored Jan 2, 2024
1 parent cdb3f6c commit 1d0d13b
Show file tree
Hide file tree
Showing 37 changed files with 1,320 additions and 532 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ test/data/**
!test/data/.gitkeep
test/devtest.test.ts
coverage/**

.envlocaldev
public
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ WORKDIR /app

# Server
COPY ./src/ ./src/
RUN rm -f ./genSwaggerJson.ts
COPY ./openapi.yaml .
COPY ./package.json .
COPY ./locales ./locales
COPY ./tsconfig.json .
Expand All @@ -22,7 +24,7 @@ RUN npm install && npm run build
RUN rm -rf node_modules && npm install --omit=dev
# Client
COPY ./client ./client
RUN rm -rf client/node_modules client/tools client/dist
RUN rm -rf client/node_modules client/tools client/dist client/.storybook
# Remove stories
RUN find ./client -name "*.stories.*" -exec rm -rf {} \;

Expand All @@ -46,6 +48,7 @@ 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
COPY --from=builder --chown=${RUNASUSERID}:${RUNASGROUP} /app/client/dist/ ./public

Expand All @@ -55,4 +58,3 @@ RUN mkdir data
EXPOSE 3015

CMD ["node","main.js"]

10 changes: 9 additions & 1 deletion README-en.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ As UTDON only works with applications whose source repository is located on "Git

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

## Use cases

- 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.

## UTDON Versioning

UDON follows the "semver" protocol (<https://semver.org/>), accessible via the "/api/v1/version" entrypoint, which returns a value in JSON format: {"version":"[\d+]\.[\d+]\.[\d+]} (3 groups of numbers separated by a dot).
Expand Down Expand Up @@ -66,6 +73,7 @@ s-->|update|mps
- React/Redux
- JSON databases: located in RAM, replacing files during execution has no effect. Database contents are saved after each modification and when the service receives the SGINT | SIGTERM | SIGUSR2 signal.
- RegExp and Jmespath filters for Json.
- Swagger.

## Security

Expand Down Expand Up @@ -94,7 +102,7 @@ Sessions are managed in RAM, so a simple service restart resets all sessions.
- Duplicate a control.
- Display filters.
- Controls sorted into groups.
- Multiple "Auth Bearer" per control to avoid providing admin authentication token.
- Multiple "Auth Token" per control to avoid providing admin authentication token.
- S3 storage.
- Entrypoint API metrics.
- LDAP authentication.
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ s-->|update|mps
- 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.
- Filtres RegExp et Jmespath pour Json.
- Swagger.

## Securité

Expand Down Expand Up @@ -103,7 +104,7 @@ Les sessions sont gérées en RAM, un simple redémarrage du service réinitiali
- Dupliquer un contrôle.
- Filtres pour l'affichage.
- Classement des contrôles par groupes.
- Plusieurs "Auth Bearer" par contrôle pour éviter de fournir le jeton d'authentification de l'admin.
- Plusieurs "Auth Token" par contrôle pour éviter de fournir le jeton d'authentification de l'admin.
- Stockage S3.
- Entrypoint API metrics.
- Authentification LDAP.
Expand Down
23 changes: 23 additions & 0 deletions build-dev.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash
# @author DHENRY for mytinydc.com
# @license AGPL3

set -e

# create this file and set env LOCALREGISTRY=[Your local container registry]
source .envlocaldev

# jq is needed
which jq >/dev/null 2>&1
if [ "$?" == "1" ]; then
echo "You have to install jq package"
exit 1
fi
TAG=$(jq '.version' package.json | sed -E 's/^"|"$//g')
#PROGRESS="--progress plain"
#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 .
echo "Pushing image $LOCALREGISTRY:$TAG"
sudo docker push "$LOCALREGISTRY":"$TAG"
10 changes: 7 additions & 3 deletions build-prod.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@
# @author DHENRY for mytinydc.com
# @license AGPL3

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

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

# jq is needed
which jq >/dev/null 2>&1
Expand All @@ -14,5 +18,5 @@ fi
NOCACHE="--no-cache"
PLATFORM="--platform=linux/arm64,linux/amd64"
TAG=$(jq '.version' package.json | sed -E 's/^"|"$//g')
#PROGRESS="--progress plain"
sudo docker buildx build --push $PROGRESS $NOCACHE $PLATFORM -t ghcr.io/dhenry123/utdon:$TAG -f Dockerfile .
PROGRESS="--progress plain"
sudo docker buildx build --push $PROGRESS $NOCACHE $PLATFORM -t ghcr.io/$USERNAME/utdon:$TAG -f Dockerfile .
Loading

0 comments on commit 1d0d13b

Please sign in to comment.