Skip to content

Commit 5d66736

Browse files
committed
Updated debian/postinst to adjust schema URL in openapi document
1 parent ad7459b commit 5d66736

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

debian/changelog

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
woudc-api (0.11.1) jammy; urgency=medium
22

33
* Updated openapi document that was causing refererce errors from incorrect paths/URLs
4+
* Updated debian/postinst to adjust schema path/URLs in openapi document per deployment
45
* Removed old properties from openapi document
56
* Set additionalProperties to false, which was causing errors by default in Swagger UI try it out
67
* Fixed provider type to record for discovery_metadata

debian/postinst

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,19 @@
22

33
set -e
44

5+
# setup default vars
56
USERNAME="woudcuser"
67
GROUP="www-data"
8+
WOUDC_API_URL="https://api.woudc.org"
79

8-
chown -R $USERNAME.$GROUP /opt/woudc-api
10+
# Attempt to read in env defined specifics
11+
if [ -f /home/$USERNAME/.profile ]; then
12+
. /home/$USERNAME/.profile
13+
else
14+
echo "Warning: Profile not found for user $USERNAME" >&2
15+
fi
16+
17+
chown -R $USERNAME:$GROUP /opt/woudc-api
18+
19+
# point schema URLs to correct domain in openapi doc
20+
sed -i "s#https://api.woudc.org#${WOUDC_API_URL}#" /opt/woudc-api/conf/woudc-api-openapi.yml

0 commit comments

Comments
 (0)