mirror of https://github.com/sc0tfree/updog.git
Merge 1df84b2ad7
into 28a1ac1612
This commit is contained in:
commit
c25586453c
23
README.md
23
README.md
|
@ -23,16 +23,17 @@ Install using pip:
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
`updog [-d DIRECTORY] [-p PORT] [--password PASSWORD] [--ssl]`
|
`updog [-d DIRECTORY] [-b ADDRESS] [-p PORT] [--password PASSWORD] [--ssl]`
|
||||||
|
|
||||||
| Argument | Description |
|
| Argument | Description |
|
||||||
|-------------------------------------|--------------------------------------------------|
|
|-------------------------------------|---------------------------------------------------------|
|
||||||
| -d DIRECTORY, --directory DIRECTORY | Root directory [Default=.] |
|
| -d DIRECTORY, --directory DIRECTORY | Root directory [Default=.] |
|
||||||
| -p PORT, --port PORT | Port to serve [Default=9090] |
|
| -b ADDRESS, --bind ADDRESS | Specify alternate bind address [Default=0.0.0.0] |
|
||||||
| --password PASSWORD | Use a password to access the page. (No username) |
|
| -p PORT, --port PORT | Port to serve [Default=9090] |
|
||||||
| --ssl | Enable transport encryption via SSL |
|
| --password PASSWORD | Use a password to access the page. (No username) |
|
||||||
| --version | Show version |
|
| --ssl | Enable transport encryption via SSL |
|
||||||
| -h, --help | Show help |
|
| --version | Show version |
|
||||||
|
| -h, --help | Show help |
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
|
@ -48,6 +49,10 @@ Install using pip:
|
||||||
|
|
||||||
`updog -p 1234`
|
`updog -p 1234`
|
||||||
|
|
||||||
|
**Serve from 192.168.1.11 IP address and port 1234:**
|
||||||
|
|
||||||
|
`updog -b 192.168.1.11 -p 1234`
|
||||||
|
|
||||||
**Password protect the page:**
|
**Password protect the page:**
|
||||||
|
|
||||||
`updog --password examplePassword123!`
|
`updog --password examplePassword123!`
|
||||||
|
|
|
@ -29,6 +29,8 @@ def parse_arguments():
|
||||||
parser.add_argument('-d', '--directory', metavar='DIRECTORY', type=read_write_directory, default=cwd,
|
parser.add_argument('-d', '--directory', metavar='DIRECTORY', type=read_write_directory, default=cwd,
|
||||||
help='Root directory\n'
|
help='Root directory\n'
|
||||||
'[Default=.]')
|
'[Default=.]')
|
||||||
|
parser.add_argument('-b', '--bind', metavar='ADDRESS', type=str, default='0.0.0.0',
|
||||||
|
help='Specify alternate bind address [Default=0.0.0.0]')
|
||||||
parser.add_argument('-p', '--port', type=int, default=9090,
|
parser.add_argument('-p', '--port', type=int, default=9090,
|
||||||
help='Port to serve [Default=9090]')
|
help='Port to serve [Default=9090]')
|
||||||
parser.add_argument('--password', type=str, default='', help='Use a password to access the page. (No username)')
|
parser.add_argument('--password', type=str, default='', help='Use a password to access the page. (No username)')
|
||||||
|
@ -166,7 +168,7 @@ def main():
|
||||||
return True
|
return True
|
||||||
|
|
||||||
# Inform user before server goes up
|
# Inform user before server goes up
|
||||||
success('Serving {}...'.format(args.directory, args.port))
|
success('Serving {} from {}:{}...'.format(args.directory, args.bind, args.port))
|
||||||
|
|
||||||
def handler(signal, frame):
|
def handler(signal, frame):
|
||||||
print()
|
print()
|
||||||
|
@ -177,7 +179,7 @@ def main():
|
||||||
if args.ssl:
|
if args.ssl:
|
||||||
ssl_context = 'adhoc'
|
ssl_context = 'adhoc'
|
||||||
|
|
||||||
run_simple("0.0.0.0", int(args.port), app, ssl_context=ssl_context)
|
run_simple(args.bind, int(args.port), app, ssl_context=ssl_context)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
Loading…
Reference in New Issue