From f673cae2865e7dd5a4b72ac134ac94a3c52ce4f5 Mon Sep 17 00:00:00 2001 From: Angelos Tzotsos Date: Wed, 21 Jun 2017 14:50:41 +0300 Subject: [PATCH] Added oauth geonode settings, not enabled yet until we install the geoserver plugin --- app-conf/geonode/default_oauth_apps.json | 18 ++++++++++++++++++ bin/install_geonode.sh | 11 +++++++++-- 2 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 app-conf/geonode/default_oauth_apps.json diff --git a/app-conf/geonode/default_oauth_apps.json b/app-conf/geonode/default_oauth_apps.json new file mode 100644 index 00000000..6c76143b --- /dev/null +++ b/app-conf/geonode/default_oauth_apps.json @@ -0,0 +1,18 @@ +[ +{ + "model": "oauth2_provider.application", + "pk": 1001, + "fields": { + "skip_authorization": true, + "redirect_uris": "http://localhost:8082/geoserver", + "name": "GeoServer", + "authorization_grant_type": "authorization-code", + "client_type": "confidential", + "client_id": "Jrchz2oPY3akmzndmgUTYrs9gczlgoV20YPSvqaV", + "client_secret": "rCnp5txobUo83EpQEblM8fVj3QT5zb5qRfxNsuPzCqZaiRyIoxM4jdgMiZKFfePBHYXCLd7B8NlkfDBY9HKeIQPcy5Cp08KQNpRHQbjpLItDHv12GvkSeXp6OxaUETv3", + "user": [ + "admin" + ] + } +} +] \ No newline at end of file diff --git a/bin/install_geonode.sh b/bin/install_geonode.sh index ed01d716..45ea0690 100755 --- a/bin/install_geonode.sh +++ b/bin/install_geonode.sh @@ -111,6 +111,10 @@ sudo cp -f "$BUILD_DIR/../app-conf/geonode/local_settings.py.sample" \ "$GEONODE_DIR/local_settings.py" sudo cp -f "$BUILD_DIR/../app-conf/geonode/sample_admin.json" \ "$GEONODE_DIR/base/fixtures/sample_admin.json" +sudo cp -f "$BUILD_DIR/../app-conf/geonode/default_oauth_apps.json" \ + "$GEONODE_DIR/base/fixtures/default_oauth_apps.json" +sudo cp -f "$BUILD_DIR/../app-conf/geonode/create_db_store.py" \ + "$GEONODE_DIR/create_db_store.py" #Change GeoServer port in settings.py sed -i -e 's|http://localhost:8080/geoserver/|http://localhost:8082/geoserver/|' \ @@ -135,6 +139,9 @@ django-admin loaddata "$GEONODE_DIR/base/fixtures/initial_data.json" --settings= # Install sample admin. Username:admin password:admin django-admin loaddata "$GEONODE_DIR/base/fixtures/sample_admin.json" --settings=geonode.settings +#TODO: Import oauth settings +#django-admin loaddata "$GEONODE_DIR/base/fixtures/default_oauth_apps.json" --settings=geonode.settings + # Collect static files django-admin collectstatic --noinput --settings=geonode.settings --verbosity=0 echo "Done" @@ -149,8 +156,8 @@ echo "Starting GeoServer to update layers in the geonode db" sleep 90; echo "Done" -#TODO: python create_db_store.py -#TODO: import oauth settings +#TODO: Create GeoServer store +#python "$GEONODE_DIR"/create_db_store.py # run updatelayers echo "Updating GeoNode layers..."