Skip to content

Commit f230fe4

Browse files
authored
Develop (#226)
* Removed `linkeddatahub-` prefix from version in CI workflow * Moved `MAX_CONTENT_LENGTH` to .env * Default config with `varnish-frontend` Fixed proxied return URL in `post.sh` * If using proxy, CLI scripts rewrite the effective URL back to original hostname * Fixed object blocks for non-RDF resources (e.g. images) `rdf:value` cardinality constraint * Tunnel the `$proxy` param in CLI scripts * Show chart form actions only when the agent has write access * Web-Client bump * Changelog update
1 parent 7869fb7 commit f230fe4

File tree

17 files changed

+216
-195
lines changed

17 files changed

+216
-195
lines changed

.env_sample

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,6 @@ OWNER_ORG_UNIT=My unit
1515
OWNER_ORGANIZATION=My org
1616
OWNER_LOCALITY=Copenhagen
1717
OWNER_STATE_OR_PROVINCE=Denmark
18-
OWNER_COUNTRY_NAME=DK
18+
OWNER_COUNTRY_NAME=DK
19+
20+
MAX_CONTENT_LENGTH=2097152

CHANGELOG.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,20 @@
1-
[5.0.17] - 2025-06-23
1+
## [5.0.18] - 2025-06-30
2+
### Added
3+
- Proxy parameter tunneling in CLI scripts (`add-object-block.sh`, `add-xhtml-block.sh`)
4+
5+
### Changed
6+
- Web-Client dependency version bump
7+
- Chart form actions now only display when agent has write access
8+
- CLI scripts now rewrite effective URLs back to original hostname when using proxy
9+
- Default configuration now uses `varnish-frontend`
10+
- `MAX_CONTENT_LENGTH` environment variable moved to `.env` file
11+
12+
### Fixed
13+
- Fixed object blocks rendering for non-RDF resources (e.g. images)
14+
- Fixed `rdf:value` cardinality constraint
15+
- Fixed proxied return URL in `post.sh`
16+
17+
## [5.0.17] - 2025-06-23
218
### Changed
319
- Replaced `xsl:value-of` usage in XSLT stylesheets
420
- Removed debug output for cleaner production logs

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ ENV UPLOAD_CONTAINER_PATH=$UPLOAD_CONTAINER_PATH
101101

102102
ENV OIDC_REFRESH_TOKENS=/var/linkeddatahub/oidc/refresh_tokens.properties
103103

104-
ENV MAX_CONTENT_LENGTH=
104+
ENV MAX_CONTENT_LENGTH=2097152
105105

106106
ENV MAX_CONN_PER_ROUTE=20
107107

bin/add-object-block.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,8 @@ args+=("-p")
116116
args+=("$cert_password")
117117
args+=("-t")
118118
args+=("text/turtle") # content type
119+
args+=("--proxy")
120+
args+=("$proxy") # tunnel the proxy param
119121

120122
if [ -n "$fragment" ] ; then
121123
# relative URI that will be resolved against the request URI

bin/add-xhtml-block.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ args+=("-p")
110110
args+=("$cert_password")
111111
args+=("-t")
112112
args+=("text/turtle") # content type
113+
args+=("--proxy")
114+
args+=("$proxy") # tunnel the proxy param
113115

114116
if [ -n "$fragment" ] ; then
115117
# relative URI that will be resolved against the request URI

bin/imports/create-file.sh

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,5 +175,14 @@ if [ -n "$proxy" ]; then
175175
target="${target/$target_host/$proxy_host}"
176176
fi
177177

178-
# POST RDF/POST multipart form from stdin to the server
179-
echo -e "$rdf_post" | curl -w '%{url_effective}\n' -v -s -k -X PUT -H "Accept: text/turtle" -E "$cert_pem_file":"$cert_password" -o /dev/null --config - "$target"
178+
# POST RDF/POST multipart form and capture the effective URL
179+
effective_url=$(echo -e "$rdf_post" | curl -w '%{url_effective}' -v -s -k -X PUT -H "Accept: text/turtle" -E "$cert_pem_file":"$cert_password" -o /dev/null --config - "$target")
180+
181+
# If using proxy, rewrite the effective URL back to original hostname
182+
if [ -n "$proxy" ]; then
183+
# Replace proxy host with original host in the effective URL
184+
rewritten_url="${effective_url/$proxy_host/$target_host}"
185+
echo "$rewritten_url"
186+
else
187+
echo "$effective_url"
188+
fi

bin/post.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,4 +80,13 @@ else
8080
fi
8181

8282
# resolve RDF document from stdin against base URL and POST to the server and print request URL
83-
cat - | turtle --base="$url" | curl -w '%{url_effective}\n' -v -k -E "$cert_pem_file":"$cert_password" -d @- -H "Content-Type: ${content_type}" -H "Accept: text/turtle" -o /dev/null "$final_url"
83+
effective_url=$(cat - | turtle --base="$url" | curl -w '%{url_effective}' -v -k -E "$cert_pem_file":"$cert_password" -d @- -H "Content-Type: ${content_type}" -H "Accept: text/turtle" -o /dev/null "$final_url")
84+
85+
# If using proxy, rewrite the effective URL back to original hostname
86+
if [ -n "$proxy" ]; then
87+
# Replace proxy host with original host in the effective URL
88+
rewritten_url="${effective_url/$proxy_host/$url_host}"
89+
echo "$rewritten_url"
90+
else
91+
echo "$effective_url"
92+
fi

bin/put.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,4 +80,13 @@ else
8080
fi
8181

8282
# resolve RDF document from stdin against base URL and PUT to the server and print request URL
83-
cat - | turtle --base="$url" | curl -w '%{url_effective}\n' -v -k -E "$cert_pem_file":"$cert_password" -d @- -X PUT -H "Content-Type: ${content_type}" -H "Accept: text/turtle" -o /dev/null "$final_url"
83+
effective_url=$(cat - | turtle --base="$url" | curl -w '%{url_effective}' -v -k -E "$cert_pem_file":"$cert_password" -d @- -X PUT -H "Content-Type: ${content_type}" -H "Accept: text/turtle" -o /dev/null "$final_url")
84+
85+
# If using proxy, rewrite the effective URL back to original hostname
86+
if [ -n "$proxy" ]; then
87+
# Replace proxy host with original host in the effective URL
88+
rewritten_url="${effective_url/$proxy_host/$url_host}"
89+
echo "$rewritten_url"
90+
else
91+
echo "$effective_url"
92+
fi

config/system-varnish.trig

Lines changed: 0 additions & 51 deletions
This file was deleted.

config/system.trig

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,17 @@
2020
ldt:ontology <https://w3id.org/atomgraph/linkeddatahub/admin#> ;
2121
ldt:service <urn:linkeddatahub:services/admin> ;
2222
ac:stylesheet <static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/admin/layout.xsl> ;
23-
lapp:endUserApplication <urn:linkeddatahub:apps/end-user> .
23+
lapp:endUserApplication <urn:linkeddatahub:apps/end-user> ;
24+
lapp:frontendProxy <http://varnish-frontend:6060/> .
2425

2526
<urn:linkeddatahub:services/admin> a sd:Service ;
2627
dct:title "LinkedDataHub admin service" ;
2728
sd:supportedLanguage sd:SPARQL11Query, sd:SPARQL11Update ;
2829
sd:endpoint <http://fuseki-admin:3030/ds/> ;
2930
a:graphStore <http://fuseki-admin:3030/ds/> ;
30-
a:quadStore <http://fuseki-admin:3030/ds/> .
31-
31+
a:quadStore <http://fuseki-admin:3030/ds/> ;
32+
lapp:backendProxy <http://varnish-admin/> .
33+
3234
# root end-user
3335

3436
<urn:linkeddatahub:apps/end-user> a lapp:Application, lapp:EndUserApplication ;
@@ -37,11 +39,13 @@
3739
ldt:ontology <ns#> ;
3840
ldt:service <urn:linkeddatahub:services/end-user> ;
3941
lapp:adminApplication <urn:linkeddatahub:apps/admin> ;
42+
lapp:frontendProxy <http://varnish-frontend:6060/> ;
4043
lapp:public true .
4144

4245
<urn:linkeddatahub:services/end-user> a sd:Service ;
4346
dct:title "LinkedDataHub service" ;
4447
sd:supportedLanguage sd:SPARQL11Query, sd:SPARQL11Update ;
4548
sd:endpoint <http://fuseki-end-user:3030/ds/> ;
4649
a:graphStore <http://fuseki-end-user:3030/ds/> ;
47-
a:quadStore <http://fuseki-end-user:3030/ds/> .
50+
a:quadStore <http://fuseki-end-user:3030/ds/> ;
51+
lapp:backendProxy <http://varnish-end-user/> .

0 commit comments

Comments
 (0)