Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Get nimbusrest url, key, and secret from web conf.

  • Loading branch information...
commit 820cfecf0f2a5b8b5ffe032816e117e4f8a4408a 1 parent 906cafe
@labisso labisso authored
View
4 web/nimbusweb.conf
@@ -33,6 +33,10 @@ webserver.host: 0.0.0.0
print.url: https://localhost:1443/nimbus/
+# Nimbus REST url and credentials
+nimbusrest.url: https://localhost:4443/nimbus
+nimbusrest.key: testadmin
+nimbusrest.secret: secret
# Text that you want displayed on the (public) welcome screen, after the
# "If you do not have an account, " text on the "/nimbus/" web page.
View
2  web/src/python/nimbusweb/portal/nimbus/remote.py
@@ -9,7 +9,7 @@ def nimbus_user_create_remote(user_instance, nimbus_key=None, nimbus_secret=None
`user_instance` is a `Django User` instance.
"""
- service_uri = getattr(settings, "NIMBUS_SERVICE_URI", None)
+ service_uri = getattr(settings, "NIMBUS_SERVICE_URL", None)
conn = AdminConnection(service_uri, nimbus_key, nimbus_secret)
nimbus_user = conn.add_user(user_instance)
return nimbus_user
View
6 web/src/python/nimbusweb/portal/usercreate/create.py
@@ -57,9 +57,9 @@ def nimbus_user_create_remote(user_instance):
`user_instance` is a `Django User` instance.
"""
- nimbus_key = getattr(settings, "NIMBUS_KEY", "testadmin")
- nimbus_secret = getattr(settings, "NIMBUS_SECRET", "secret")
- service_uri = getattr(settings, "NIMBUS_SERVICE_URI", "https://localhost:4443/admin")
+ nimbus_key = getattr(settings, "NIMBUS_KEY")
+ nimbus_secret = getattr(settings, "NIMBUS_SECRET")
+ service_uri = getattr(settings, "NIMBUS_SERVICE_URL")
conn = AdminConnection(service_uri, nimbus_key, nimbus_secret)
nimbus_user = conn.add_user(user_instance)
return nimbus_user
View
7 web/src/python/nimbusweb/setup/newconf.py
@@ -3,7 +3,8 @@
from setuperrors import *
import string
-def run(basedir, timezone, accountprompt, log, debug, insecuremode, printurl, expire_hours, cadir):
+def run(basedir, timezone, accountprompt, log, debug, insecuremode, printurl,
+ expire_hours, cadir, rest_url, rest_key, rest_secret):
log.debug("Installing new configurations to django and cherrypy")
if not accountprompt:
@@ -52,6 +53,10 @@ def run(basedir, timezone, accountprompt, log, debug, insecuremode, printurl, ex
lines.append("NIMBUS_PRINT_URL = '%s'" % printurl)
lines.append("NIMBUS_TOKEN_EXPIRE_HOURS = %d" % expire_hours)
+
+ lines.append("NIMBUS_SERVICE_URL = '%s'" % rest_uri)
+ lines.append("NIMBUS_KEY = '%s'" % rest_key)
+ lines.append("NIMBUS_SECRET = '%s'" % rest_secret)
generated_text = "\n"
for line in lines:
View
7 web/src/python/nimbusweb/setup/setup.py
@@ -320,6 +320,9 @@ def main(argv=None):
timezone = config_from_key(config, "timezone")
port = config_from_key(config, "webserver.port")
host = config_from_key(config, "webserver.host")
+ rest_url = config_from_key(config, "nimbusrest.url")
+ rest_key = config_from_key(config, "nimbusrest.key")
+ rest_secret = config_from_key(config, "nimbusrest.secret")
printurl = config_from_key(config, "print.url")
accountprompt = config_from_key(config, "account.prompt")
expire_hours = config_from_key(config, "token.expire_hours")
@@ -341,7 +344,9 @@ def main(argv=None):
checkssl.run(basedir, certconf, keyconf, log)
if opts.newconf:
- newconf.run(basedir, timezone, accountprompt, log, printdebugoutput, insecuremode, printurl, expire_hours, cadir)
+ newconf.run(basedir, timezone, accountprompt, log,
+ printdebugoutput, insecuremode, printurl, expire_hours,
+ cadir, rest_url, rest_key, rest_secret)
if opts.printport:
if not port:
Please sign in to comment.
Something went wrong with that request. Please try again.