0.12.8 : add activity and notification after user creation
All checks were successful
Build release Docker image / Build Docker Images (push) Successful in 6m47s
All checks were successful
Build release Docker image / Build Docker Images (push) Successful in 6m47s
This commit is contained in:
@@ -7,7 +7,7 @@ env:
|
||||
DOCKER_REGISTRY_URL: git.harmonylab.ovh
|
||||
DOCKER_REGISTRY_ORG: harmony
|
||||
RELEASE_VERSION: 1.2.0
|
||||
DOCKPLOY_WEBHOOK_URL: http://192.168.0.220:3000/api/deploy/DxPrQ9JtATe40vH4N35KB
|
||||
DOCKPLOY_WEBHOOK_URL: http://192.168.0.220:3000/api/deploy/HHWS7dR5rT-8vbXD6Zypv
|
||||
DISCORD_WEBHOOK_URL: https://discord.com/api/webhooks/1433240422901088339/GAvL79ESBRabkB6rvxN2DsWI74KJ_Szgp9W2_PycPIY113rMCT_9LvIv-iTLCMD9W9qH
|
||||
|
||||
jobs:
|
||||
@@ -33,22 +33,6 @@ jobs:
|
||||
username: admin
|
||||
password: Apslxnap12bn23
|
||||
|
||||
- name: Debug Docker and Registry
|
||||
run: |
|
||||
echo "=== Docker version ==="
|
||||
docker version
|
||||
|
||||
echo "=== Docker info ==="
|
||||
docker info
|
||||
|
||||
echo "=== Current tags ==="
|
||||
docker images | grep "$DOCKER_REGISTRY_URL"
|
||||
|
||||
echo "=== Test simple image push ==="
|
||||
docker pull busybox:latest
|
||||
docker tag busybox:latest $DOCKER_REGISTRY_URL/$DOCKER_REGISTRY_ORG/test-busybox:latest
|
||||
docker push $DOCKER_REGISTRY_URL/$DOCKER_REGISTRY_ORG/test-busybox:latest || echo "Test push failed"
|
||||
|
||||
# Build the Docker image
|
||||
- name: Build the Docker image
|
||||
run: docker build . --file Dockerfile --tag $DOCKER_REGISTRY_URL/$DOCKER_REGISTRY_ORG/$DOCKER_IMAGE_NAME:${{ steps.package-version.outputs.current-version}}
|
||||
|
||||
@@ -9,7 +9,6 @@ export default () => ({
|
||||
user: "admin@harmonychoral.com",
|
||||
pass: "Apslxnap12bn23",
|
||||
},
|
||||
// ... any custom nodemailer options
|
||||
},
|
||||
settings: {
|
||||
defaultFrom: "admin@harmonychoral.com",
|
||||
@@ -17,31 +16,29 @@ export default () => ({
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
upload: {
|
||||
config: {
|
||||
provider: "aws-s3",
|
||||
providerOptions: {
|
||||
//baseUrl: "http://192.168.0.211:9000/harmony",
|
||||
baseUrl: "https://container.harmonylab.ovh/harmony",
|
||||
s3Options: {
|
||||
credentials: {
|
||||
accessKeyId: "admin",
|
||||
secretAccessKey: "Apslxnap12bn23",
|
||||
},
|
||||
//endpoint: "http://192.168.0.211:9000",
|
||||
endpoint: "https://container.harmonylab.ovh",
|
||||
region: "eu-west-3",
|
||||
forcePathStyle: true,
|
||||
region: "eu-west-3",
|
||||
params: {
|
||||
Bucket: "harmony",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
"strapi-v5-plugin-populate-deep": {
|
||||
config: {
|
||||
defaultDepth: 3, // Default is 5
|
||||
defaultDepth: 3,
|
||||
skipCreatorFields: false,
|
||||
},
|
||||
},
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "harmony-back",
|
||||
"version": "0.12.7",
|
||||
"version": "0.12.8",
|
||||
"private": true,
|
||||
"description": "A Strapi application",
|
||||
"scripts": {
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
"name": "Apache 2.0",
|
||||
"url": "https://www.apache.org/licenses/LICENSE-2.0.html"
|
||||
},
|
||||
"x-generation-date": "2025-11-19T13:05:17.727Z"
|
||||
"x-generation-date": "2025-11-21T12:49:29.594Z"
|
||||
},
|
||||
"x-strapi-config": {
|
||||
"plugins": [
|
||||
|
||||
@@ -442,6 +442,45 @@ module.exports = (plugin) => {
|
||||
}
|
||||
};
|
||||
|
||||
plugin.contentTypes.user.lifecycles = {
|
||||
async afterCreate(event) {
|
||||
const { result } = event;
|
||||
|
||||
const newActivity = {
|
||||
activityMessage: `Bienvenue ${result.username}, Ton compte est maintenant activé.`,
|
||||
activityUser: result.username,
|
||||
activityDate: new Date(),
|
||||
activityType: "user" as const,
|
||||
};
|
||||
|
||||
await strapi.entityService.update(
|
||||
"plugin::users-permissions.user",
|
||||
result.id,
|
||||
{
|
||||
data: {
|
||||
activities: [newActivity],
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
// Appel du service de notification
|
||||
await strapi
|
||||
.service("api::notification.notification")
|
||||
?.createNotification({
|
||||
title: "Bienvenue !",
|
||||
message: `Ton compte est maintenant activé.`,
|
||||
type: "success",
|
||||
target_user: result.id,
|
||||
source: "system",
|
||||
payload: { email: result.email },
|
||||
});
|
||||
|
||||
strapi.log.info(
|
||||
`🔔 Notification envoyée pour l'utilisateur ${result.id}`
|
||||
);
|
||||
},
|
||||
};
|
||||
|
||||
plugin.routes["content-api"].routes.push({
|
||||
method: "PUT",
|
||||
path: "/users/me",
|
||||
|
||||
Reference in New Issue
Block a user