Browse Source

add serviceinfo generator

master
Romain H 1 year ago
committed by root
parent
commit
f909307d58
  1. 45
      serviceinfo/_serviceinfo.json
  2. 16
      serviceinfo/update_serviceinfo

45
serviceinfo/_serviceinfo.json

@ -0,0 +1,45 @@
{
"version": "1.0",
"id": "https://drop.chapril.org/",
"name": "Partage de fichier Chapril",
"software": {
"name": "__SOFT_NAME__",
"version": "__SOFT_VERSION__",
"repository": "__SOFT_REPO__"
},
"organization": {
"name": "Chapril",
"contact": "https://www.chapril.org/contact.html"
},
"protocols": [
{
"name": "http",
"capabilities": [
{
"presence": false,
"mam": false,
"in-band-registration": false,
"web-registration": false,
"storage-quota": "1024",
"upload-autovaccum": "5d",
"irc-gateway": false
}
]
}
],
"otherServices": {
"outbound": [],
"inbound": []
},
"signups": "closed",
"visibilityPreferences": {
"allowCrawling": false,
"preferUnlisted": false
},
"metrics": [
],
"features": [
]
}

16
serviceinfo/update_serviceinfo

@ -0,0 +1,16 @@
#/bin/bash
set -e
TEMPLATE=/srv/drop/tools/serviceinfo/_serviceinfo.json
TARGET_FILE=/var/www/html/_serviceinfo.json
SOFT_NAME=$(jq -r .name /srv/drop/www/package.json)
SOFT_VERSION=$(jq -r .version /srv/drop/www/package.json)
SOFT_REPO=$(jq -r .homepage /srv/drop/www/package.json)
cat "${TEMPLATE}" \
| sed "s|__SOFT_NAME__|${SOFT_NAME}|" \
| sed "s|__SOFT_VERSION__|${SOFT_VERSION}|" \
| sed "s|__SOFT_REPO__|${SOFT_REPO}|" \
> ${TARGET_FILE}
Loading…
Cancel
Save