[~] Refactor
This commit is contained in:
parent
af343a1dd1
commit
b5dc2e1d01
@ -1117,6 +1117,15 @@ def http_server(argv):
|
||||
options.docker = True
|
||||
|
||||
index_section = 'autoindex on;'
|
||||
|
||||
if options.public:
|
||||
options.token = 'public'
|
||||
|
||||
location_section = 'location / {%s}' % index_section
|
||||
else:
|
||||
if options.token is None:
|
||||
options.token = os.urandom(16).hex()
|
||||
|
||||
if options.docker:
|
||||
DATA_DIR = '/usr/share/nginx'
|
||||
APP_DIR = '/app'
|
||||
@ -1126,12 +1135,7 @@ def http_server(argv):
|
||||
CONF_DIR = '/opt/nginx/%s/conf/' % options.token
|
||||
APP_DIR = os.path.abspath(os.path.curdir)
|
||||
|
||||
if options.public:
|
||||
location_section = 'location / {%s}' % index_section
|
||||
else:
|
||||
if options.token is None:
|
||||
options.token = os.urandom(16).hex()
|
||||
|
||||
if not options.public:
|
||||
if not options.prefix is None:
|
||||
path = options.prefix + options.token
|
||||
else:
|
||||
|
Loading…
Reference in New Issue
Block a user