mirror of
https://github.com/rclone/rclone.git
synced 2024-11-25 18:04:55 +01:00
3e1cb8302a
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
26 lines
607 B
Python
Executable File
26 lines
607 B
Python
Executable File
#!/usr/bin/env python3
|
|
"""
|
|
A demo proxy for rclone serve sftp/webdav/ftp, etc.
|
|
|
|
This takes the incoming user/pass and converts it into an sftp backend
|
|
running on localhost.
|
|
"""
|
|
|
|
import sys
|
|
import json
|
|
|
|
def main():
|
|
i = json.load(sys.stdin)
|
|
o = {
|
|
"type": "sftp", # type of backend
|
|
"_root": "", # root of the fs
|
|
"_obscure": "pass", # comma sep list of fields to obscure
|
|
"user": i["user"],
|
|
"pass": i["pass"],
|
|
"host": "127.0.0.1",
|
|
}
|
|
json.dump(o, sys.stdout, indent="\t")
|
|
|
|
if __name__ == "__main__":
|
|
main()
|