From 0a7cd6c12ff95fdcba586c5a5d85c93123629e7d Mon Sep 17 00:00:00 2001 From: philc Date: Wed, 3 Apr 2024 08:58:02 +0200 Subject: [PATCH] maj --- README.md | 4 ++-- apidoc_adminapi.json | 36 ++++++++++++++++++++++++++++++++++++ middlewares/header.md | 10 +++++----- models/Towns.js | 2 +- models/Tribes.js | 2 +- 5 files changed, 45 insertions(+), 9 deletions(-) create mode 100644 apidoc_adminapi.json diff --git a/README.md b/README.md index 743d7db..0473d20 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ All actors will have the same target to respect contracts and are free to leave /adminapx/index_lg.html administration webapp /website/ /tribeName/ - /api/routes Specific web service https://.../api/tribename/routeName/endpoint + /apxtri/routes Specific web service https://.../api/tribename/routeName/endpoint /middlewares /models /nginx/tribe_website.conf nginx conf per website @@ -107,7 +107,7 @@ You need a domain name, to get a free one [http://ydns.io](http://ydns.io) creat # Into your production machine $ crontab -e # add a line at the end to update your IP in case you have a dynamic WAN IP -1,6,11,16,21,26,31,36,41,46,51,56 * * * * sleep 38 ; wget --no-check-certificate -O - https://ydns.io/hosts/update/Tl7FDQAETmQre312edztgsIUy >> /tmp/apxtri_ydns.io.log 2>&1 +1,6,11,16,21,26,31,36,41,46,51,56 * * * * sleep 38 ; wget --no-check-certificate -O - https://ydns.io/hosts/update/Tl7FDQAETmQre312edztgsIUy >> /tmp/apxtri_ydns.io.log 2>&1 $ ip -4 address # to get your (local) LAN IP of your server ``` diff --git a/apidoc_adminapi.json b/apidoc_adminapi.json new file mode 100644 index 0000000..a1a3cc1 --- /dev/null +++ b/apidoc_adminapi.json @@ -0,0 +1,36 @@ + { + "comment": "specific api for tribes conf have to be in conf/apidoc/apidoc_{tribe}.json run: $ tribe=smatchit yarn apidoctribe", + "name": "apxtri.be", + "version": "1.0.0", + "title": "apiDoc for apxtri endpoint", + "description": "Core api documentation that manage nation objects (Pagans, Nations, Towns, Blockchain, Tracking, Notifications, Odmdb, Tribes (management), Wwws)", + "url": "https://testwall-ants.ndda.fr/api", + "outputcoment":"pour rappel l'option output ne fonctionne pas en fichier de config ajouté dans package.json", + "output":"../nationchains/tribes/adminapi/www/cdn/apidoc/", + "input":[ + "./middlewares", + "./routes" + ], + "order": [ + "Middlewares", + "Odmdb", + "Nationchains", + "Pagans", + "Notifications" + ], + "template": { + "forceLanguage": "en", + "showRequiredLabels": true, + "withCompare": true, + "withGenerator": true, + "aloneDisplay": false + }, + "header": { + "title": "Introduction", + "filename": "header.md" + }, + "footer": { + "title": "Best practices", + "filename": "footer.md" + } + } diff --git a/middlewares/header.md b/middlewares/header.md index 2d00cd8..dce9839 100644 --- a/middlewares/header.md +++ b/middlewares/header.md @@ -42,7 +42,7 @@ All others object are managed by spécifics tribe.  /schema/conf.json # list of schema and version /objectname.json # schema title and escription are in english /lg/objectname_lg.json # title and description in lg - /tribename/ # same than adminapi for a specific tribe but wit /api instead of /apxtri, + /tribename/ # same than adminapi for a specific trib, # we only have 1 node process that manage 1 town that manage many tribes api ``` @@ -105,7 +105,7 @@ C - a json multi answer **{status,multimsg:\[{ref,msg,data}\]}**          Each {ref,msg,data\] work the same way than B -To show feedback context message in a language lg => get /nationchains/models/{{ref}}\_{{lg}}.json +To show feedback context message in a language lg => get /api/adminapi/objects/tplstrings/{{model}}\_{{lg}}.json This contain a json {msg:"mustache template string to render with data"}   ## Accessrights: @@ -121,9 +121,9 @@ Each object has an apxaccessrights that is a list of profil and CRUD access per Accessible with https://dns/api/tribename/routes ```plaintext -/tribes/tribename/api/routes -/tribes/tribename/api/middlewares -/tribes/tribename/api/models +/tribes/tribename/apxtri/routes +/tribes/tribename/apxtri/middlewares +/tribes/tribename/apxtri/models /tribes/tribename/schema /tribes/tribename/schema/lg ``` diff --git a/models/Towns.js b/models/Towns.js index d396779..ea88627 100644 --- a/models/Towns.js +++ b/models/Towns.js @@ -19,7 +19,7 @@ Towns.create = () => { `${conf.dirapi}/adminapi/www/adminapx/initconf.json` ); // Synchronize nationchains/ - const { updateobjectsfromfreshesttown } = require("./api/models/Nations.js"); + const { updateobjectsfromfreshesttown } = require("./apxtri/models/Nations.js"); updateobjectsfromfreshesttown(initconf.towns, { pagans: "alias_all.json", towns: "townId_all.json", diff --git a/models/Tribes.js b/models/Tribes.js index ac8e0db..aeda51c 100755 --- a/models/Tribes.js +++ b/models/Tribes.js @@ -22,7 +22,7 @@ see man adduser and file reference call skelet directory to set an env for apxtr accessible by tribename/password then add group group me to phil to allow phil to ate a symlink /dirtown/tribes/tribename => to /home/tribename -At each reboot run a process to analyse /api/routes and api/models whre only js can be exexuted are safe (only write data into /home/tribename, never outside) +At each reboot run a process to analyse /apxtri/routes and api/models whre only js can be exexuted are safe (only write data into /home/tribename, never outside) 1- Create a user in linux with $ sudo useradd smatchit 2 => this create a user:group and a folder smatchit in /home/phil/dirtown/tribes/