@@ -214,6 +214,21 @@ def prepare(ctx):
214
214
client_secret = os .environ ['OAUTH2_CLIENT_SECRET' ],
215
215
oauth_config = oauth_config
216
216
), pty = True )
217
+ ctx .run (
218
+ 'sed -i "s|<userAuthorizationUri>.*</userAuthorizationUri>|<userAuthorizationUri>{new_ext_ip}o/authorize/</userAuthorizationUri>|g" {oauth_config}' .format (
219
+ new_ext_ip = os .environ ['SITEURL' ],
220
+ oauth_config = oauth_config
221
+ ), pty = True )
222
+ ctx .run (
223
+ 'sed -i "s|<redirectUri>.*</redirectUri>|<redirectUri>{new_ext_ip}geoserver/index.html</redirectUri>|g" {oauth_config}' .format (
224
+ new_ext_ip = os .environ ['SITEURL' ],
225
+ oauth_config = oauth_config
226
+ ), pty = True )
227
+ ctx .run (
228
+ 'sed -i "s|<logoutUri>.*</logoutUri>|<logoutUri>{new_ext_ip}account/logout/</logoutUri>|g" {oauth_config}' .format (
229
+ new_ext_ip = os .environ ['SITEURL' ],
230
+ oauth_config = oauth_config
231
+ ), pty = True )
217
232
218
233
219
234
@task
@@ -474,13 +489,23 @@ def _prepare_monitoring_fixture():
474
489
print ("Public Hostname or IP is {0}" .format (pub_ip ))
475
490
pub_port = _geonode_public_port ()
476
491
print ("Public PORT is {0}" .format (pub_port ))
477
- # d = str(datetime.datetime.now())
492
+ geonode_ip = pub_ip
493
+ try :
494
+ geonode_ip = socket .gethostbyname ('geonode' )
495
+ except Exception :
496
+ pass
497
+ geoserver_ip = pub_ip
498
+ try :
499
+ geoserver_ip = socket .gethostbyname ('geoserver' )
500
+ except Exception :
501
+ pass
502
+ #d = str(datetime.datetime.now())
478
503
d = '1970-01-01 00:00:00'
479
504
default_fixture = [
480
505
{
481
506
"fields" : {
482
507
"active" : True ,
483
- "ip" : "{0}" .format (socket . gethostbyname ( 'geonode' ) ),
508
+ "ip" : "{0}" .format (geonode_ip ),
484
509
"name" : "{0}" .format (os .environ ['MONITORING_HOST_NAME' ])
485
510
},
486
511
"model" : "monitoring.host" ,
@@ -489,7 +514,7 @@ def _prepare_monitoring_fixture():
489
514
{
490
515
"fields" : {
491
516
"active" : True ,
492
- "ip" : "{0}" .format (socket . gethostbyname ( 'geoserver' ) ),
517
+ "ip" : "{0}" .format (geoserver_ip ),
493
518
"name" : "geoserver"
494
519
},
495
520
"model" : "monitoring.host" ,
@@ -564,22 +589,22 @@ def _prepare_admin_fixture(admin_password, admin_email):
564
589
mdext_date = d .isoformat ()[:23 ] + "Z"
565
590
default_fixture = [
566
591
{
567
- "fields" : {
568
- "date_joined" : mdext_date ,
569
- "email" : admin_email ,
570
- "first_name" : "" ,
571
- "groups" : [],
572
- "is_active" : True ,
573
- "is_staff" : True ,
574
- "is_superuser" : True ,
575
- "last_login" : mdext_date ,
576
- "last_name" : "" ,
577
- "password" : make_password (admin_password ),
578
- "user_permissions" : [],
579
- "username" : "admin"
580
- },
581
- "model" : "people.Profile" ,
582
- "pk" : 1000
592
+ "fields" : {
593
+ "date_joined" : mdext_date ,
594
+ "email" : admin_email ,
595
+ "first_name" : "" ,
596
+ "groups" : [],
597
+ "is_active" : True ,
598
+ "is_staff" : True ,
599
+ "is_superuser" : True ,
600
+ "last_login" : mdext_date ,
601
+ "last_name" : "" ,
602
+ "password" : make_password (admin_password ),
603
+ "user_permissions" : [],
604
+ "username" : "admin"
605
+ },
606
+ "model" : "people.Profile" ,
607
+ "pk" : 1000
583
608
}
584
609
]
585
610
with open ('/tmp/django_admin_docker.json' , 'w' ) as fixturefile :
0 commit comments