1
0
forked from apxtri/apxtri
This commit is contained in:
philc 2024-04-03 08:58:02 +02:00
parent 81917cedaf
commit 0a7cd6c12f
5 changed files with 45 additions and 9 deletions

View File

@ -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 /adminapx/index_lg.html administration webapp
/website/ /website/
/tribeName/ /tribeName/
/api/routes Specific web service https://.../api/tribename/routeName/endpoint /apxtri/routes Specific web service https://.../api/tribename/routeName/endpoint
/middlewares /middlewares
/models /models
/nginx/tribe_website.conf nginx conf per website /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 # Into your production machine
$ crontab -e $ crontab -e
# add a line at the end to update your IP in case you have a dynamic WAN IP # 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 $ ip -4 address # to get your (local) LAN IP of your server
``` ```

36
apidoc_adminapi.json Normal file
View File

@ -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"
}
}

View File

@ -42,7 +42,7 @@ All others object are managed by spécifics tribe. 
/schema/conf.json # list of schema and version /schema/conf.json # list of schema and version
/objectname.json # schema title and escription are in english /objectname.json # schema title and escription are in english
/lg/objectname_lg.json # title and description in lg /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 # 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          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"}   This contain a json {msg:"mustache template string to render with data"}  
## Accessrights: ## 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 Accessible with https://dns/api/tribename/routes
```plaintext ```plaintext
/tribes/tribename/api/routes /tribes/tribename/apxtri/routes
/tribes/tribename/api/middlewares /tribes/tribename/apxtri/middlewares
/tribes/tribename/api/models /tribes/tribename/apxtri/models
/tribes/tribename/schema /tribes/tribename/schema
/tribes/tribename/schema/lg /tribes/tribename/schema/lg
``` ```

View File

@ -19,7 +19,7 @@ Towns.create = () => {
`${conf.dirapi}/adminapi/www/adminapx/initconf.json` `${conf.dirapi}/adminapi/www/adminapx/initconf.json`
); );
// Synchronize nationchains/ // Synchronize nationchains/
const { updateobjectsfromfreshesttown } = require("./api/models/Nations.js"); const { updateobjectsfromfreshesttown } = require("./apxtri/models/Nations.js");
updateobjectsfromfreshesttown(initconf.towns, { updateobjectsfromfreshesttown(initconf.towns, {
pagans: "alias_all.json", pagans: "alias_all.json",
towns: "townId_all.json", towns: "townId_all.json",

View File

@ -22,7 +22,7 @@ see man adduser and file reference call skelet directory to set an env for apxtr
accessible by tribename/password accessible by tribename/password
then add group group me to phil to allow phil to ate a symlink /dirtown/tribes/tribename => to /home/tribename 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 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/ 2 => this create a user:group and a folder smatchit in /home/phil/dirtown/tribes/