- infos = Information about the curlget plugin is in keys below
- infos/author = Thomas Waser thomas.waser@libelektra.org
- infos/licence = BSD
- infos/needs =
- infos/provides =
- infos/recommends =
- infos/placements = getresolver setresolver commit rollback
- infos/status = configurable readonly preview unfinished nodoc
- infos/metadata =
- infos/description = mount remote config files via curl
The curlget plugin is a resolver using libcurl to upload and download files from/to remote hosts. When mounted with a URL as configuration file there will be no changes to the file system. When mounted with a (local) path to a configuration a copy of the remote configuration is kept and used as fallback in kdbGet() if fetching the remote file from the server fails.
See installation.
The package is called libelektra5-curl.
URL:
an URL has to be prefixed with the protocol. valid protocols: http://, https://, ftp://, ftps://, scp://, sftp://, smb:// (currently not supported)
Filename:
can bei either an URL or a local configuration file.
if the filename is an URL the plugin operates on temporary files only and keeps no local copy of the configuration. unless specified otherwise the URL is used for both upload and download.
-
url:URLused for both upload and download of the configuration. might be overwritten byurl/getandurl/put. -
url/get:the
URLof the remote configuration file. -
url/put:the
URLused to upload the configuration on kdbSet -
upload/method:only used for
HTTPrequests. usePOSTforPOST-requests, orPUTforPUT-requests. -
upload/postfield:for
HTTP POST-requests: the name of the field containing the file -
upload/filename:name of the uploaded file. if present it will be appended to
url/puton uploads except forHTTP POSTuploads where it overrides thefilenamefield of the header. if not specified the value defaults tourl/putis assumed to be a valid uploadURLalready containing the filename, except forHTTP POST-requests where thebasename(3)of the local mounted configuration file is used if present, or ofurl/get -
user:username for authentication
-
password:password for authentication
-
ssl/verify:if set
1enforce the use ofSSL.HOSTNAMEandPEERverifications are enabled but might be overwritten byssl/verify/hostandssl/verify/peer.if not set or set to
0the plugin will try to useSSLbut not fail if not possible. -
ssl/verify/host:if set to
1use hostname verification, if set to0, skip it. -
ssl/verify/peer:if set to
1verify the ssl certificate, if set to0, skip the verification. -
prefer:if set to
localdon't update the configuration if the remote version has changed within succeedingkdbGet()calls. -
ssh/auth:ssh authentication method for sftp and scp. possible values:
agentfor usingssh-agent,passwordfor password authentication,pubkeyfor public key authentication andpubkeypwfor public key + password authentication. -
ssh/key:path of the private key file for ssh public key authentication. if not set, default to
$HOME/.ssh/id_dsaor$HOME/.ssh/id_rsa -
ssh/key/passwd:password for the private key file
rm /tmp/curltest.ini || $(exit 0)
sudo kdb mount -R curlget -c url/get="http://127.0.0.1:8000/curltest.ini",url/put="http://127.0.0.1:8000",user="thomas",password="pass",upload/method="POST",upload/postfield="file" /tmp/curltest.ini system:/curl ini
kdb ls system:/curl
#> system:/curl/section1
#> system:/curl/section1/key1
stat /tmp/curltest.ini
# RET:0
kdb set system:/curl/section1/key2 val2
sudo kdb umount system:/curl
stat /tmp/curltest.ini
# RET:0
cat /tmp/curltest.ini
#> [section1]
#> key1=val1
#> key2=val2
rm /tmp/curltest.ini || $(exit 0)
sudo kdb mount -R curlget -c url/put="http://127.0.0.1:8000",user="thomas",password="pass",upload/method="POST",upload/postfield="file" "http://127.0.0.1:8000/curltest.ini" system:/curl ini
kdb ls system:/curl
#> system:/curl/section1
#> system:/curl/section1/key1
#> system:/curl/section1/key2
stat /tmp/curltest.ini
# RET:1
mv /tmp/httproot/curltest.ini /tmp/httproot/curltest.ini_moved
kdb ls system:/curl
# RET:5
mv /tmp/httproot/curltest.ini_moved /tmp/httproot/curltest.ini
kdb rm system:/curl/section1/key2
sudo kdb umount system:/curl
cat /tmp/httproot/curltest.ini
#> [section1]
#> key1=val1kdb mount -R curlget -c url/get="http://127.0.0.1:8000/curltest.ini",url/put="http://127.0.0.1:8000",user="thomas",password="pass",upload/method="POST",upload/postfield="file" /tmp/curltest.ini system:/curl ini
kdb mount -R curlget -c url/put="http://127.0.0.1:8000",user="thomas",password="pass",upload/method="POST",upload/postfield="file" "http://127.0.0.1:8000/curltest.ini" system:/curl ini
kdb mount -R curlget -c url/get="ftp://127.0.0.1:21/test.ini",url/put="ftp://127.0.0.1:21/test.ini",user="thomas",password="pass",upload/method="FTP" /tmp/curltest.ini system:/curl ini