create settings
This commit is contained in:
parent
20ea3b7be9
commit
112dec11d2
@ -20,7 +20,7 @@ packages, like django, python3-saml, etc.
|
|||||||
mkdir rugwebsite && cd rugwebsite
|
mkdir rugwebsite && cd rugwebsite
|
||||||
virtualenv --python=/usr/bin/python3.5 venv
|
virtualenv --python=/usr/bin/python3.5 venv
|
||||||
source venv/bin/activate
|
source venv/bin/activate
|
||||||
pip3 install git+ssh://git@git.webhosting.rug.nl:222/p253591/rug-website.git
|
pip3 install -U gunicorn git+ssh://git@git.webhosting.rug.nl:222/p253591/rug-website.git
|
||||||
|
|
||||||
## Settings and X509 certificate
|
## Settings and X509 certificate
|
||||||
|
|
||||||
|
@ -1 +1 @@
|
|||||||
__version__ = '0.1.20'
|
__version__ = '0.1.21'
|
@ -22,8 +22,8 @@ class Command(BaseCommand):
|
|||||||
parser.add_argument('--city', required=True, nargs=1, type=str, dest='city', help='For example: London or Groningen')
|
parser.add_argument('--city', required=True, nargs=1, type=str, dest='city', help='For example: London or Groningen')
|
||||||
parser.add_argument('--state', required=True, nargs=1, type=str, dest='state', help='For example: State or province, for example California or Groningen.')
|
parser.add_argument('--state', required=True, nargs=1, type=str, dest='state', help='For example: State or province, for example California or Groningen.')
|
||||||
parser.add_argument('--organisation', required=True, nargs=1, type=str, dest='organisation', help='Typically \'University of Groningen\'')
|
parser.add_argument('--organisation', required=True, nargs=1, type=str, dest='organisation', help='Typically \'University of Groningen\'')
|
||||||
parser.add_argument('--organisation-unit', required=True, nargs=1, type=str, dest='organisation-unit', help='For example: \'Research and Innovation\' Support or \'Faculty of smart people\'')
|
parser.add_argument('--organisation-unit', required=True, nargs=1, type=str, dest='organisation_unit', help='For example: \'Research and Innovation\' Support or \'Faculty of smart people\'')
|
||||||
parser.add_argument('--common-name', required=True, nargs=1, type=str, dest='common-name')
|
parser.add_argument('--common-name', required=True, nargs=1, type=str, dest='common_name')
|
||||||
parser.add_argument('--alternative', nargs='*', type=str, dest='alternatives')
|
parser.add_argument('--alternative', nargs='*', type=str, dest='alternatives')
|
||||||
parser.add_argument('--support-name', required=True, nargs=1, type=str, dest='support_name')
|
parser.add_argument('--support-name', required=True, nargs=1, type=str, dest='support_name')
|
||||||
parser.add_argument('--support-email', required=True, nargs=1, type=str, dest='support_email')
|
parser.add_argument('--support-email', required=True, nargs=1, type=str, dest='support_email')
|
||||||
@ -34,9 +34,11 @@ class Command(BaseCommand):
|
|||||||
parser.add_argument('--expires-after-days', nargs='?', type=int, default=10 * 365, dest='expires')
|
parser.add_argument('--expires-after-days', nargs='?', type=int, default=10 * 365, dest='expires')
|
||||||
|
|
||||||
def handle(self, *args, **options):
|
def handle(self, *args, **options):
|
||||||
for option in {'country', 'city', 'state', 'organisation', 'organisation-unit', 'common-name', 'support-name',
|
print('=' * 100)
|
||||||
'support-email', 'technical-name', 'technical-email', 'entity-id', 'base-url'}:
|
print(options)
|
||||||
assert option in options and options[option] is not None and len(options[option]) == 1, "Exepecte one " \
|
for option in {'country', 'city', 'state', 'organisation', 'organisation_unit', 'common_name', 'support_name',
|
||||||
|
'support_email', 'technical_name', 'technical_email', 'entity_id', 'base_url'}:
|
||||||
|
assert option in options and options[option] is not None and len(options[option]) == 1, "Expected one " \
|
||||||
"value for option" \
|
"value for option" \
|
||||||
": " + option
|
": " + option
|
||||||
options[option] = options[option][0]
|
options[option] = options[option][0]
|
||||||
@ -47,8 +49,8 @@ class Command(BaseCommand):
|
|||||||
x509.NameAttribute(NameOID.STATE_OR_PROVINCE_NAME, options['state']),
|
x509.NameAttribute(NameOID.STATE_OR_PROVINCE_NAME, options['state']),
|
||||||
x509.NameAttribute(NameOID.LOCALITY_NAME, options['city']),
|
x509.NameAttribute(NameOID.LOCALITY_NAME, options['city']),
|
||||||
x509.NameAttribute(NameOID.ORGANIZATION_NAME, options['organisation']),
|
x509.NameAttribute(NameOID.ORGANIZATION_NAME, options['organisation']),
|
||||||
x509.NameAttribute(NameOID.ORGANIZATIONAL_UNIT_NAME, options['organisation-unit']),
|
x509.NameAttribute(NameOID.ORGANIZATIONAL_UNIT_NAME, options['organisation_unit']),
|
||||||
x509.NameAttribute(NameOID.COMMON_NAME, options['common-name']),
|
x509.NameAttribute(NameOID.COMMON_NAME, options['common_name']),
|
||||||
])
|
])
|
||||||
cert = (
|
cert = (
|
||||||
x509.CertificateBuilder()
|
x509.CertificateBuilder()
|
||||||
|
@ -17,6 +17,7 @@ SUPPORT_NAME = '{support_name}'
|
|||||||
SUPPORT_EMAIL = '{support_email}'
|
SUPPORT_EMAIL = '{support_email}'
|
||||||
|
|
||||||
ORGANISATION = '{organisation}'
|
ORGANISATION = '{organisation}'
|
||||||
|
ORGANISATION_UNIT = '{organisation_unit}'
|
||||||
|
|
||||||
|
|
||||||
SAML_ROUTE = BASE_URL + 'sso/saml/'
|
SAML_ROUTE = BASE_URL + 'sso/saml/'
|
||||||
|
Loading…
Reference in New Issue
Block a user