From f909307d58eeb55eabca4b84d9785fb9335b0889 Mon Sep 17 00:00:00 2001 From: Romain H Date: Thu, 2 Jul 2020 16:39:14 +0200 Subject: [PATCH] add serviceinfo generator --- serviceinfo/_serviceinfo.json | 45 ++++++++++++++++++++++++++++++++++ serviceinfo/update_serviceinfo | 16 ++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 serviceinfo/_serviceinfo.json create mode 100755 serviceinfo/update_serviceinfo diff --git a/serviceinfo/_serviceinfo.json b/serviceinfo/_serviceinfo.json new file mode 100644 index 0000000..5059dbc --- /dev/null +++ b/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": [ + + ] +} diff --git a/serviceinfo/update_serviceinfo b/serviceinfo/update_serviceinfo new file mode 100755 index 0000000..77a2307 --- /dev/null +++ b/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}