diff --git a/dotfiles/.local/bin/commands b/dotfiles/.local/bin/commands index 584b201..e41484c 100755 --- a/dotfiles/.local/bin/commands +++ b/dotfiles/.local/bin/commands @@ -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: