|
|
|
|
@@ -244,27 +244,45 @@ def run_argparse(argv, formatter):
|
|
|
|
|
)
|
|
|
|
|
# fmt: off
|
|
|
|
|
ap.add_argument("-c", metavar="PATH", type=str, action="append", help="add config file")
|
|
|
|
|
ap.add_argument("-i", metavar="IP", type=str, default="0.0.0.0", help="ip to bind (comma-sep.)")
|
|
|
|
|
ap.add_argument("-p", metavar="PORT", type=str, default="3923", help="ports to bind (comma/range)")
|
|
|
|
|
ap.add_argument("-nc", metavar="NUM", type=int, default=64, help="max num clients")
|
|
|
|
|
ap.add_argument("-j", metavar="CORES", type=int, default=1, help="max num cpu cores")
|
|
|
|
|
ap.add_argument("-a", metavar="ACCT", type=str, action="append", help="add account")
|
|
|
|
|
ap.add_argument("-v", metavar="VOL", type=str, action="append", help="add volume")
|
|
|
|
|
ap.add_argument("-q", action="store_true", help="quiet")
|
|
|
|
|
ap.add_argument("-ed", action="store_true", help="enable ?dots")
|
|
|
|
|
ap.add_argument("-emp", action="store_true", help="enable markdown plugins")
|
|
|
|
|
ap.add_argument("-mcr", metavar="SEC", type=int, default=60, help="md-editor mod-chk rate")
|
|
|
|
|
ap.add_argument("-nw", action="store_true", help="disable writes (benchmark)")
|
|
|
|
|
ap.add_argument("-nih", action="store_true", help="no info hostname")
|
|
|
|
|
ap.add_argument("-nid", action="store_true", help="no info disk-usage")
|
|
|
|
|
ap.add_argument("--dotpart", action="store_true", help="dotfile incomplete uploads")
|
|
|
|
|
ap.add_argument("--no-zip", action="store_true", help="disable download as zip/tar")
|
|
|
|
|
ap.add_argument("--sparse", metavar="MiB", type=int, default=4, help="up2k min.size threshold (mswin-only)")
|
|
|
|
|
ap.add_argument("--urlform", metavar="MODE", type=str, default="print,get", help="how to handle url-forms")
|
|
|
|
|
ap.add_argument("--salt", type=str, default="hunter2", help="up2k file-hash salt")
|
|
|
|
|
|
|
|
|
|
ap2 = ap.add_argument_group('appearance options')
|
|
|
|
|
ap2.add_argument("--css-browser", metavar="L", help="URL to additional CSS to include")
|
|
|
|
|
ap2 = ap.add_argument_group('network options')
|
|
|
|
|
ap2.add_argument("-i", metavar="IP", type=str, default="0.0.0.0", help="ip to bind (comma-sep.)")
|
|
|
|
|
ap2.add_argument("-p", metavar="PORT", type=str, default="3923", help="ports to bind (comma/range)")
|
|
|
|
|
ap2.add_argument("--rproxy", metavar="DEPTH", type=int, default=0, help="number of proxies; 0 = direct http(s), 1 = nginx, 2 = nginx + cloudflare, -1 = trust origin (unsafe)")
|
|
|
|
|
|
|
|
|
|
ap2 = ap.add_argument_group('SSL/TLS options')
|
|
|
|
|
ap2.add_argument("--http-only", action="store_true", help="disable ssl/tls")
|
|
|
|
|
ap2.add_argument("--https-only", action="store_true", help="disable plaintext")
|
|
|
|
|
ap2.add_argument("--ssl-ver", metavar="LIST", type=str, help="ssl/tls versions to allow")
|
|
|
|
|
ap2.add_argument("--ciphers", metavar="LIST", help="set allowed ciphers")
|
|
|
|
|
ap2.add_argument("--ssl-dbg", action="store_true", help="dump some tls info")
|
|
|
|
|
ap2.add_argument("--ssl-log", metavar="PATH", help="log master secrets")
|
|
|
|
|
|
|
|
|
|
ap2 = ap.add_argument_group('opt-outs')
|
|
|
|
|
ap2.add_argument("-nw", action="store_true", help="disable writes (benchmark)")
|
|
|
|
|
ap2.add_argument("-nih", action="store_true", help="no info hostname")
|
|
|
|
|
ap2.add_argument("-nid", action="store_true", help="no info disk-usage")
|
|
|
|
|
ap2.add_argument("--no-zip", action="store_true", help="disable download as zip/tar")
|
|
|
|
|
|
|
|
|
|
ap2 = ap.add_argument_group('safety options')
|
|
|
|
|
ap2.add_argument("--ls", metavar="U[,V[,F]]", help="scan all volumes")
|
|
|
|
|
ap2.add_argument("--salt", type=str, default="hunter2", help="up2k file-hash salt")
|
|
|
|
|
|
|
|
|
|
ap2 = ap.add_argument_group('logging options')
|
|
|
|
|
ap2.add_argument("-q", action="store_true", help="quiet")
|
|
|
|
|
ap2.add_argument("--log-conn", action="store_true", help="print tcp-server msgs")
|
|
|
|
|
ap2.add_argument("--ihead", metavar="HEADER", action='append', help="dump incoming header")
|
|
|
|
|
ap2.add_argument("--lf-url", metavar="RE", type=str, default=r"^/\.cpr/|\?th=[wj]$", help="dont log URLs matching")
|
|
|
|
|
|
|
|
|
|
ap2 = ap.add_argument_group('admin panel options')
|
|
|
|
|
ap2.add_argument("--no-rescan", action="store_true", help="disable ?scan (volume reindexing)")
|
|
|
|
|
@@ -299,22 +317,13 @@ def run_argparse(argv, formatter):
|
|
|
|
|
ap2.add_argument("-mtp", metavar="M=[f,]bin", action="append", type=str, help="read tag M using bin")
|
|
|
|
|
ap2.add_argument("--srch-time", metavar="SEC", type=int, default=30, help="search deadline")
|
|
|
|
|
|
|
|
|
|
ap2 = ap.add_argument_group('SSL/TLS options')
|
|
|
|
|
ap2.add_argument("--http-only", action="store_true", help="disable ssl/tls")
|
|
|
|
|
ap2.add_argument("--https-only", action="store_true", help="disable plaintext")
|
|
|
|
|
ap2.add_argument("--ssl-ver", metavar="LIST", type=str, help="ssl/tls versions to allow")
|
|
|
|
|
ap2.add_argument("--ciphers", metavar="LIST", help="set allowed ciphers")
|
|
|
|
|
ap2.add_argument("--ssl-dbg", action="store_true", help="dump some tls info")
|
|
|
|
|
ap2.add_argument("--ssl-log", metavar="PATH", help="log master secrets")
|
|
|
|
|
ap2 = ap.add_argument_group('appearance options')
|
|
|
|
|
ap2.add_argument("--css-browser", metavar="L", help="URL to additional CSS to include")
|
|
|
|
|
|
|
|
|
|
ap2 = ap.add_argument_group('debug options')
|
|
|
|
|
ap2.add_argument("--ls", metavar="U[,V[,F]]", help="scan all volumes")
|
|
|
|
|
ap2.add_argument("--log-conn", action="store_true", help="print tcp-server msgs")
|
|
|
|
|
ap2.add_argument("--no-sendfile", action="store_true", help="disable sendfile")
|
|
|
|
|
ap2.add_argument("--no-scandir", action="store_true", help="disable scandir")
|
|
|
|
|
ap2.add_argument("--no-fastboot", action="store_true", help="wait for up2k indexing")
|
|
|
|
|
ap2.add_argument("--ihead", metavar="HEADER", action='append', help="dump incoming header")
|
|
|
|
|
ap2.add_argument("--lf-url", metavar="RE", type=str, default=r"^/\.cpr/|\?th=[wj]$", help="dont log URLs matching")
|
|
|
|
|
|
|
|
|
|
return ap.parse_args(args=argv[1:])
|
|
|
|
|
# fmt: on
|
|
|
|
|
|