Croit offers a simple file server mechanism in case you want to serve some files to your croit nodes. Our API has 2 endpoints to serve files, one is unauthenticated and anyone that can connect to the API can download these files, and the other is authenticated using credentials of a croit user.
Unauthenticated endpoint extra-file
You can put files into the /config/extra-files
directory inside the docker container (you may need to create this directory). Those files are then accessible via the API endpoint api/extra-files/path/to/file
.
For example, create a file on the management node:
kdir /config/extra-files
echo "test" > /config/extra-files/example.txt
Then, on a croit node, you can load this file:
CROIT_API=$(cat /proc/cmdline | sed 's/.*croit-api=\([^ ]*\) .*/\1/')
curl http://$CROIT_API/api/extra-files/example.txt > example.txt
Authenticated endpoint extra-files-secure
(starting with croit v2201.1)
You can put files into the /config/extra-files-secure
directory inside the docker container (you may need to create this directory). Those files are then accessible via the authenticated API endpoint api/extra-files-secure/path/to/file
.
For example, create a file on the management node:
mkdir /config/extra-files-secure
echo "test" > /config/extra-files-secure/example.txt
And create a user under Settings > User management
with the Secure folder
role:
Then, on a croit node, you can load this file:
CROIT_API=$(cat /proc/cmdline | sed 's/.*croit-api=\([^ ]*\) .*/\1/')
curl --user readuser:password http://$CROIT_API/api/extra-files-secure/example.txt > example.txt
Contact us!
croit GmbH
Freseniusstrasse 31h
81247 Munich
Germany
croit North America Inc
150 North Michigan Avenue
35th Floor
Chicago
IL 60601