Commit e4b2f714 authored by James Kermode's avatar James Kermode Committed by Markus Scheidgen
Browse files

Doc fix and additional options for nomad oasis conf

parent 65560b7a
......@@ -95,7 +95,7 @@ pip install -e .[all] --prefer-binary
The NOMAD GUI requires static artifacts that are generated from the NOMAD Python codes.
```sh
nomad dev metainfo > gui/src/metainfo.json
nomad dev searchQuantities > gui/src/searchQuantities.json
nomad dev search-quantities > gui/src/searchQuantities.json
nomad dev units > gui/src/units.js
./gitinfo.sh
```
......
......@@ -538,7 +538,8 @@ class UploadCommandResource(Resource):
def get(self):
''' Get url and example command for shell based uploads. '''
token = generate_upload_token(g.user)
upload_url = '%s/uploads/?token=%s' % (config.api_url(ssl=False), token)
upload_url = ('%s/uploads/?token=%s' %
(config.api_url(ssl=config.services.https_upload), token))
upload_url_with_name = upload_url + '&name=<name>'
# upload_command = 'curl -X PUT "%s" -F file=@<local_file>' % upload_url
......
......@@ -615,16 +615,20 @@ def restore(path_to_dump):
@click.option('--prefix', type=str, default=config.services.api_base_path, help='Alter the url path prefix.')
@click.option('--host', type=str, default=config.services.api_host, help='Alter the NOMAD app host.')
@click.option('--port', type=str, default=config.services.api_port, help='Alter the NOMAD port host.')
def nginx_conf(prefix, host, port):
@click.option('--server/--no-server', default=True, help='Control writing of the outer server {} block. '
'Useful when conf file is included within another nginx.conf.')
def nginx_conf(prefix, host, port, server):
prefix = prefix.rstrip('/')
prefix = '/%s' % prefix.lstrip('/')
print('''\
server {{
if server:
print('''server {
listen 80;
server_name www.example.com;
proxy_set_header Host $host;
''')
print('''
location / {{
proxy_pass http://{1}:{2};
}}
......@@ -680,7 +684,9 @@ server {{
rewrite ^ {0}/encyclopedia/index.html break;
proxy_pass http://{1}:{2};
}}
}}'''.format(prefix, host, port))
'''.format(prefix, host, port))
if server:
print('}')
@ops.command(help='Updates the AFLOW prototype information using the latest online version and writes the results to a python module in the given FILEPATH.')
......
......@@ -156,6 +156,7 @@ services = NomadConfig(
not_processed_value='not processed',
unavailable_value='unavailable',
https=False,
https_upload=False,
upload_limit=10,
force_raw_file_decoding=False,
download_scan_size=500,
......@@ -204,7 +205,7 @@ def check_config():
"--matches-only'."
)
if not os.path.exists(normalize.springer_db_path):
if normalize.springer_db_path and not os.path.exists(normalize.springer_db_path):
normalize.springer_db_path = None
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment