Skip to content

Commit e767e98

Browse files
committed
Merge branch 'main' into change-password
2 parents 7690cbb + 1c7d71b commit e767e98

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+2230
-3632
lines changed

.github/workflows/docker-image.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Configures this workflow to run every time a change is pushed to the branch called `release`.
2+
on:
3+
push:
4+
branches:
5+
- main
6+
paths:
7+
- ".github/workflows/docker-image.yml"
8+
- "package.json"
9+
- "tsconfig.json"
10+
- "configs/**"
11+
- "defaults/**"
12+
- "src/**"
13+
14+
env:
15+
REGISTRY: ghcr.io
16+
IMAGE_NAME: ${{ github.repository }}
17+
18+
jobs:
19+
build-and-push-image:
20+
runs-on: ubuntu-latest
21+
permissions:
22+
contents: read
23+
packages: write
24+
25+
steps:
26+
- name: Checkout repository
27+
uses: actions/checkout@v4
28+
29+
- name: Log in to the Container registry
30+
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
31+
with:
32+
registry: ${{ env.REGISTRY }}
33+
username: ${{ github.actor }}
34+
password: ${{ secrets.GITHUB_TOKEN }}
35+
36+
- name: Extract metadata (tags, labels) for Docker
37+
id: meta
38+
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
39+
with:
40+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
41+
42+
- name: Build and push Docker image
43+
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
44+
with:
45+
context: .
46+
push: true
47+
tags: ${{ steps.meta.outputs.tags }}
48+
labels: ${{ steps.meta.outputs.labels }}
49+
platforms: linux/amd64

.github/workflows/lint.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ jobs:
99
lint-app:
1010
runs-on: ubuntu-latest
1111

12+
strategy:
13+
matrix:
14+
node-version: [20.x]
15+
1216
steps:
1317
- name: Checkout code
1418
uses: actions/checkout@v2

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ on:
2020
latest:
2121
description: "Tagger l'image docker avec le tag 'latest' ?"
2222
required: true
23-
default: true
23+
default: false
2424
type: boolean
2525

2626
jobs:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# compiled output
22
/dist
33
/node_modules
4+
/certificates
45
.env
56
docker-compose.yml
67
# Logs

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,5 +77,6 @@ RUN yarn install \
7777
COPY --from=builder /data/dist ./dist
7878

7979
EXPOSE 4000
80+
EXPOSE 4443
8081

8182
CMD ["yarn", "run", "start:prod"]

Makefile

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
11
APP_PORT = 4002
2+
APP_PORT_SECURE = 4443
23
IMG_NAME = "ghcr.io/libertech-fr/sesame-orchestrator"
34
BASE_NAME = "sesame"
45
APP_NAME = "sesame-orchestrator"
56
PLATFORM = "linux/amd64"
67
include .env
78

9+
CERT_DIR = ./certificates
10+
COMMON_NAME = localhost
11+
DAYS_VALID = 365
12+
13+
$(shell mkdir -p $(CERT_DIR))
14+
15+
816
.DEFAULT_GOAL := help
917
help:
1018
@printf "\033[33mUsage:\033[0m\n make [target] [arg=\"val\"...]\n\n\033[33mTargets:\033[0m\n"
@@ -23,6 +31,7 @@ prod: ## Start production environment
2331
--network dev \
2432
--name $(APP_NAME) \
2533
-p $(APP_PORT):4000 \
34+
-p $(APP_PORT_SECURE):4443 \
2635
-p 9229:9229 \
2736
-v $(CURDIR):/data \
2837
$(IMG_NAME) yarn start:prod
@@ -36,6 +45,7 @@ dev: ## Start development environment
3645
--network dev \
3746
--name $(APP_NAME) \
3847
-p $(APP_PORT):4000 \
48+
-p $(APP_PORT_SECURE):4443 \
3949
-p 9229:9229 \
4050
-v $(CURDIR):/data \
4151
$(IMG_NAME) yarn start:dev
@@ -49,6 +59,7 @@ debug: ## Start debug environment
4959
--network dev \
5060
--name $(APP_NAME) \
5161
-p $(APP_PORT):4000 \
62+
-p $(APP_PORT_SECURE):4443 \
5263
-p 9229:9229 \
5364
-v $(CURDIR):/data \
5465
$(IMG_NAME) yarn start:debug
@@ -120,3 +131,29 @@ run-test: ## Run tests
120131

121132
gen-doc:
122133
@npx @compodoc/compodoc -p tsconfig.json -s -d docs --includes ./markdowns -n "Sesame Orchestrator"
134+
135+
ncu: ## Check latest versions of all project dependencies
136+
@npx npm-check-updates
137+
138+
ncu-upgrade: ## Upgrade all project dependencies to the latest versions
139+
@npx npm-check-updates -u
140+
141+
generate-ssl-cert: ## Générer les certificats HTTPS auto-signés
142+
@echo "Génération des certificats HTTPS auto-signés..."
143+
@openssl req -x509 \
144+
-newkey rsa:4096 \
145+
-keyout $(CERT_DIR)/server.key \
146+
-out $(CERT_DIR)/server.crt \
147+
-days $(DAYS_VALID) \
148+
-nodes \
149+
-subj "/CN=$(COMMON_NAME)"
150+
@chmod 600 $(CERT_DIR)/server.key
151+
@chmod 644 $(CERT_DIR)/server.crt
152+
@echo "Certificats générés avec succès dans $(CERT_DIR)"
153+
154+
clean-ssl-cert: ## Nettoyer les certificats HTTPS
155+
@rm -rf $(CERT_DIR)
156+
@echo "Certificats supprimés"
157+
158+
show-cert-info: ## Afficher les informations du certificat
159+
@openssl x509 -in $(CERT_DIR)/server.crt -text -noout

docs/Filtres_API.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Filtres API
2+
3+
## Usages
4+
### Filters
5+
#### Syntax
6+
`filters[PREFIX + FIELD]=SEARCH`
7+
#### Example
8+
`filters[=subject]=53`
9+
subject field equal to 53
10+
#### Usage
11+
```bash
12+
curl --request GET \
13+
--url 'http://localhost/search?limit=9999&filters%5B%5Esequence%5D=%2F53%2F&sort%5Bmetadata.createdAt%5D=-1&sort%5Bsubject%5D=1'
14+
15+
# limit=9999
16+
# filters[^sequence]=/53/
17+
# sort[metadata.createdAt]=-1
18+
# sort[subject]=1
19+
```
20+
#### List
21+
| Filter | Description |
22+
|--------|-----------------------|
23+
| : | Equal |
24+
| # | Number Equal |
25+
| !# | Number Not Equal |
26+
| !: | Not Equal |
27+
| \> | Greater Than |
28+
| \>| | Greater Than or Equal |
29+
| \< | Less Than |
30+
| \<| | Less Than or Equal |
31+
| @ | in |
32+
| !@ | not in |
33+
| @# | number in |
34+
| !@# | number not in |
35+
| \^ | regex |

docs/summary.json

Lines changed: 48 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,50 @@
11
[
2-
{
3-
"title": "Cahier des charges",
4-
"file": "Specifications.md"
5-
},
6-
{
7-
"title": "Documentation technique",
8-
"file": "Documentation_technique.md",
9-
"children": [
10-
{
11-
"title": "Demon",
12-
"file": "./technical/DAEMON.md"
13-
},
14-
{
15-
"title": "Queue processor service",
16-
"file": "./technical/QueueProcessorService.md"
17-
},
18-
{
19-
"title": "Ecriture des test et utilisation des utilitaires",
20-
"file": "./technical/Tests.md"
21-
},
22-
{
23-
"title": "Validation des identités",
24-
"file": "./technical/IdentitiesValidation.md"
25-
},
26-
{
27-
"title": "Formulaires customs",
28-
"file": "./technical/CustomForms.md"
29-
}
30-
]
31-
},
32-
{
33-
"title": "Documentation utilisateur",
34-
"file": "Documentation_utilisateur.md",
35-
"children": [
36-
{
37-
"title": "Création et modification d'une identité",
38-
"file": "./user/IdentitiesCreation.md"
39-
},
40-
{
41-
"title": "Validation des schemas complémentaires de l'identité",
42-
"file": "./user/IdentitiesValidation.md"
43-
}
44-
]
45-
}
2+
{
3+
"title": "Cahier des charges",
4+
"file": "Specifications.md"
5+
},
6+
{
7+
"title": "Filtres API",
8+
"file": "Filtres_API.md"
9+
},
10+
{
11+
"title": "Documentation technique",
12+
"file": "Documentation_technique.md",
13+
"children": [
14+
{
15+
"title": "Demon",
16+
"file": "./technical/DAEMON.md"
17+
},
18+
{
19+
"title": "Queue processor service",
20+
"file": "./technical/QueueProcessorService.md"
21+
},
22+
{
23+
"title": "Ecriture des test et utilisation des utilitaires",
24+
"file": "./technical/Tests.md"
25+
},
26+
{
27+
"title": "Validation des identités",
28+
"file": "./technical/IdentitiesValidation.md"
29+
},
30+
{
31+
"title": "Formulaires customs",
32+
"file": "./technical/CustomForms.md"
33+
}
34+
]
35+
},
36+
{
37+
"title": "Documentation utilisateur",
38+
"file": "Documentation_utilisateur.md",
39+
"children": [
40+
{
41+
"title": "Création et modification d'une identité",
42+
"file": "./user/IdentitiesCreation.md"
43+
},
44+
{
45+
"title": "Validation des schemas complémentaires de l'identité",
46+
"file": "./user/IdentitiesValidation.md"
47+
}
48+
]
49+
}
4650
]

0 commit comments

Comments
 (0)