mirror of
https://github.com/KeyZox71/knl_meowscendence.git
synced 2025-10-14 02:54:44 +02:00
Merge remote-tracking branch 'origin/main' into user-management
This commit is contained in:
@ -15,3 +15,12 @@ GOOGLE_CALLBACK_URL=https://localhost:8443/api/v1
|
|||||||
GOOGLE_CLIENT_SECRET=susAF
|
GOOGLE_CLIENT_SECRET=susAF
|
||||||
GOOGLE_CLIENT_ID=Really
|
GOOGLE_CLIENT_ID=Really
|
||||||
|
|
||||||
|
AVAX_PRIVATE_KEY=<private-key>
|
||||||
|
AVAX_RPC_URL=<url>
|
||||||
|
AVAX_CONTRACT_ADDR=<pub key of contract>
|
||||||
|
|
||||||
|
SMTP_SMARTHOST=<the host of the smtp server>
|
||||||
|
SMTP_FROM=<the address to send from>
|
||||||
|
SMTP_AUTH_USERNAME=<smtp-user>
|
||||||
|
SMTP_AUTH_PASSWORD=<smtp pass>
|
||||||
|
EMAIL_TO=<mail to send to>
|
||||||
|
56
doc/scoreStore/README.md
Normal file
56
doc/scoreStore/README.md
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
# scoreStore
|
||||||
|
|
||||||
|
Available endpoints:
|
||||||
|
- GET `/:id`
|
||||||
|
- POST `/`
|
||||||
|
|
||||||
|
Common return:
|
||||||
|
- 500 with response
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"error": "Internal server error"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## GET `/:id`
|
||||||
|
|
||||||
|
Used to get an score from the blockchain (the id is the one returned when a score is added)
|
||||||
|
|
||||||
|
Inputs:
|
||||||
|
:id : the id of the score
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
- 200
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"score": {
|
||||||
|
"p1": "<the name of the p1>",
|
||||||
|
"p2": "<the name of the p2>",
|
||||||
|
"p1Score": "<the score of the p1>",
|
||||||
|
"p2Score": "<the score of the p2>"
|
||||||
|
},
|
||||||
|
"tx": "<the transcaction hash>"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## POST `/`
|
||||||
|
|
||||||
|
Used to add a new score (note that those can't be removed after added)
|
||||||
|
|
||||||
|
Inputs (this one need to be the same as the following otherwise you will have an error 500):
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"p1": "<name of the p1>",
|
||||||
|
"p2": "<name of the p2>",
|
||||||
|
"p1Score": "<score of the p1>",
|
||||||
|
"p2Score": "<score of the p2>"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
- 200
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"id": "<the id of the added score>"
|
||||||
|
}
|
||||||
|
```
|
@ -8,6 +8,7 @@ services:
|
|||||||
- log-user:/var/log/user-api
|
- log-user:/var/log/user-api
|
||||||
- log-auth:/var/log/auth-api
|
- log-auth:/var/log/auth-api
|
||||||
- log-nginx:/var/log/nginx
|
- log-nginx:/var/log/nginx
|
||||||
|
- log-scoreStore:/var/log/scoreStore
|
||||||
environment:
|
environment:
|
||||||
- LOG_LEVEL=info
|
- LOG_LEVEL=info
|
||||||
networks:
|
networks:
|
||||||
|
@ -19,6 +19,11 @@ input {
|
|||||||
start_position => "beginning"
|
start_position => "beginning"
|
||||||
tags => [ "nginx", "front", "error" ]
|
tags => [ "nginx", "front", "error" ]
|
||||||
}
|
}
|
||||||
|
file {
|
||||||
|
path => "/var/log/scoreStore/log.log"
|
||||||
|
start_position => "beginning"
|
||||||
|
tags => [ "api", "scoreStore" ]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
output {
|
output {
|
||||||
|
@ -6,7 +6,7 @@ COPY package.json pnpm-lock.yaml pnpm-workspace.yaml /app/
|
|||||||
# install all the dependency
|
# install all the dependency
|
||||||
RUN npm install -g pnpm
|
RUN npm install -g pnpm
|
||||||
RUN cd /app \
|
RUN cd /app \
|
||||||
&& pnpm install --prod
|
&& pnpm install --prod --frozen-lockfile
|
||||||
|
|
||||||
FROM node:lts-alpine AS base
|
FROM node:lts-alpine AS base
|
||||||
|
|
||||||
|
@ -10,7 +10,6 @@ services:
|
|||||||
networks:
|
networks:
|
||||||
- front
|
- front
|
||||||
- back
|
- back
|
||||||
- prom-exporter
|
|
||||||
environment:
|
environment:
|
||||||
- TZ=Europe/Paris
|
- TZ=Europe/Paris
|
||||||
- API_TARGET=user
|
- API_TARGET=user
|
||||||
@ -28,7 +27,6 @@ services:
|
|||||||
networks:
|
networks:
|
||||||
- front
|
- front
|
||||||
- back
|
- back
|
||||||
- prom-exporter
|
|
||||||
environment:
|
environment:
|
||||||
- TZ=Europe/Paris
|
- TZ=Europe/Paris
|
||||||
- GOOGLE_CALLBACK_URL=${GOOGLE_CALLBACK_URL}
|
- GOOGLE_CALLBACK_URL=${GOOGLE_CALLBACK_URL}
|
||||||
@ -38,3 +36,22 @@ services:
|
|||||||
- LOG_FILE_PATH=/var/log/log.log
|
- LOG_FILE_PATH=/var/log/log.log
|
||||||
- JWT_SECRET=${JWT_SECRET}
|
- JWT_SECRET=${JWT_SECRET}
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
scorestore-api:
|
||||||
|
container_name: transcendence-api-scoreStore
|
||||||
|
build:
|
||||||
|
dockerfile: docker/api-base/Dockerfile
|
||||||
|
context: ../../
|
||||||
|
volumes:
|
||||||
|
- db-scoreStore:/db
|
||||||
|
- log-scoreStore:/var/log
|
||||||
|
networks:
|
||||||
|
- front
|
||||||
|
- back
|
||||||
|
environment:
|
||||||
|
- TZ=Europe/Paris
|
||||||
|
- API_TARGET=scoreStore
|
||||||
|
- LOG_FILE_PATH=/var/log/log.log
|
||||||
|
- AVAX_PRIVATE_KEY=${AVAX_PRIVATE_KEY}
|
||||||
|
- AVAX_RPC_URL=${AVAX_RPC_URL}
|
||||||
|
- AVAX_CONTRACT_ADDR=${AVAX_CONTRACT_ADDR}
|
||||||
|
restart: unless-stopped
|
||||||
|
@ -5,9 +5,13 @@ volumes:
|
|||||||
name: transcendence-api-auth-db
|
name: transcendence-api-auth-db
|
||||||
db-user:
|
db-user:
|
||||||
name: transcendence-api-user-db
|
name: transcendence-api-user-db
|
||||||
|
db-scoreStore:
|
||||||
|
name: transcendence-api-scoreStore
|
||||||
log-auth:
|
log-auth:
|
||||||
name: transcendence-api-auth-log
|
name: transcendence-api-auth-log
|
||||||
log-user:
|
log-user:
|
||||||
name: transcendence-api-user-log
|
name: transcendence-api-user-log
|
||||||
log-nginx:
|
log-nginx:
|
||||||
name: transcendence-front-log
|
name: transcendence-front-log
|
||||||
|
log-scoreStore:
|
||||||
|
name: transcendence-scoreStore-log
|
||||||
|
@ -58,10 +58,10 @@ async function start() {
|
|||||||
servers.push(user);
|
servers.push(user);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (target === 'scoreScore' || target === 'all') {
|
if (target === 'scoreStore' || target === 'all') {
|
||||||
const score = Fastify({ logger: loggerOption('scoreStore') });
|
const score = Fastify({ logger: loggerOption('scoreStore') });
|
||||||
score.register(scoreApi);
|
score.register(scoreApi);
|
||||||
const port = target === 'all' ? 3002 : 3000;
|
const port = target === 'all' ? 3003 : 3000;
|
||||||
const host = target === 'all' ? '127.0.0.1' : '0.0.0.0';
|
const host = target === 'all' ? '127.0.0.1' : '0.0.0.0';
|
||||||
await score.listen({ port, host });
|
await score.listen({ port, host });
|
||||||
console.log(`ScoreStore API listening on http://${host}:${port}`);
|
console.log(`ScoreStore API listening on http://${host}:${port}`);
|
||||||
|
Reference in New Issue
Block a user