Skip to content

Commit 25eabad

Browse files
author
Hans Hörberg
committed
Added the possibility to change host and port.
Added the possibility to change host and port in the configuration file. This is needed for the raspberry install scripts.
1 parent 7382061 commit 25eabad

File tree

5 files changed

+17
-13
lines changed

5 files changed

+17
-13
lines changed

example/idp2/idp.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/usr/bin/env python
2+
import importlib
23
import argparse
34
import base64
45
import re
@@ -983,7 +984,7 @@ def application(environ, start_response):
983984
"http://%s" % socket.gethostname())
984985
AUTHN_BROKER.add(authn_context_class_ref(UNSPECIFIED),
985986
"", 0, "http://%s" % socket.gethostname())
986-
987+
CONFIG = importlib.import_module(args.config)
987988
IDP = server.Server(args.config, cache=Cache())
988989
IDP.ticket = {}
989990

@@ -1013,8 +1014,8 @@ def application(environ, start_response):
10131014
module_directory=_rot + 'modules',
10141015
input_encoding='utf-8', output_encoding='utf-8')
10151016

1016-
HOST = '127.0.0.1'
1017-
PORT = 8088
1017+
HOST = CONFIG.HOST
1018+
PORT = CONFIG.PORT
10181019

10191020
SRV = make_server(HOST, PORT, application)
10201021
print "IdP listening on %s:%s" % (HOST, PORT)

example/idp2/idp_conf.py.example

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,10 @@ BASEDIR = os.path.abspath(os.path.dirname(__file__))
2525
def full_path(local_file):
2626
return os.path.join(BASEDIR, local_file)
2727

28-
#BASE = "http://lingon.ladok.umu.se:8088"
29-
#BASE = "http://lingon.catalogix.se:8088"
30-
BASE = "http://localhost:8088"
28+
HOST = 'localhost'
29+
PORT = 8088
30+
31+
BASE = "http://%s:%s" % (HOST, PORT)
3132

3233
CONFIG = {
3334
"entityid": "%s/idp.xml" % BASE,

example/idp2/idp_user.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@
3434
#Uncomment to use a LDAP directory instead.
3535
#USERS = LDAPDict(**ldap_settings)
3636

37-
USERS_ = {
37+
USERS = {
3838
"haho0032": {
3939
"sn": "Hoerberg",
4040
"givenName": "Hasse",
4141
"eduPersonAffiliation": "student",
4242
"eduPersonScopedAffiliation": "[email protected]",
4343
"eduPersonPrincipalName": "[email protected]",
44-
"uid": "haho",
44+
"uid": "haho0032",
4545
"eduPersonTargetedID": "one!for!all",
4646
"c": "SE",
4747
"o": "Example Co.",

example/sp-repoze/sp.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from Cookie import SimpleCookie
33
import logging
44
import os
5-
5+
import sp_conf
66
from sp_conf import CONFIG
77
import re
88
import subprocess
@@ -268,8 +268,8 @@ def application(environ, start_response):
268268
log_file="repoze_who.log")
269269

270270
# ----------------------------------------------------------------------------
271-
HOST = '127.0.0.1'
272-
PORT = 8087
271+
HOST = sp_conf.HOST
272+
PORT = sp_conf.PORT
273273

274274
# allow uwsgi or gunicorn mount
275275
# by moving some initialization out of __name__ == '__main__' section.

example/sp-repoze/sp_conf.example

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
from saml2 import BINDING_HTTP_REDIRECT
22
from saml2.saml import NAME_FORMAT_URI
33

4-
BASE= "http://localhost:8087"
5-
#BASE= "http://lingon.catalogix.se:8087"
4+
HOST = 'localhost'
5+
PORT = 8087
6+
7+
BASE = "http://%s:%s" % (HOST, PORT)
68

79
CONFIG = {
810
"entityid": "%s/sp.xml" % BASE,

0 commit comments

Comments
 (0)