Skip to content

Commit

Permalink
Merge pull request #4820 from IQSS/revert-4809-4763_separate_secrets
Browse files Browse the repository at this point in the history
Revert "4763 separate secrets"
  • Loading branch information
scolapasta authored Jul 9, 2018
2 parents e324d3d + e64e69a commit 2cd8ec2
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 184 deletions.
171 changes: 10 additions & 161 deletions conf/openshift/openshift.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,59 +12,6 @@
}
},
"objects": [
{
"kind": "Secret",
"apiVersion": "v1",
"metadata": {
"name": "dataverse-admin-secret"
},
"stringData" : {
"admin-password" : "${ADMIN_PASSWORD}"
}
},
{
"kind": "Secret",
"apiVersion": "v1",
"metadata": {
"name": "dataverse-postgres-secret"
},
"stringData" : {
"postgres-user" : "${POSTGRES_USER}",
"postgres-password" : "${POSTGRES_PASSWORD}"
}
},
{
"kind": "Secret",
"apiVersion": "v1",
"metadata": {
"name": "dataverse-postgresql-secret"
},
"stringData" : {
"postgresql-user" : "${POSTGRESQL_USER}",
"postgresql-password" : "${POSTGRESQL_PASSWORD}"
}
},
{
"kind": "Secret",
"apiVersion": "v1",
"metadata": {
"name": "dataverse-postgresql-master-secret"
},
"stringData" : {
"postgresql-master-user" : "${POSTGRESQL_MASTER_USER}",
"postgresql-master-password" : "${POSTGRESQL_MASTER_PASSWORD}"
}
},
{
"kind": "Secret",
"apiVersion": "v1",
"metadata": {
"name": "dataverse-postgresql-admin-secret"
},
"stringData" : {
"postgresql-admin-password" : "${POSTGRESQL_ADMIN_PASSWORD}"
}
},
{
"kind": "Service",
"apiVersion": "v1",
Expand Down Expand Up @@ -206,7 +153,7 @@
"protocol": "TCP"
}
],
"resources": {"limits": {"memory": "2048Mi"
"resources": {"limits": {"memory": "1024Mi"
}

},
Expand All @@ -223,15 +170,6 @@
"name": "POSTGRES_SERVER",
"value": "dataverse-postgresql-0"
},
{
"name": "POSTGRESQL_ADMIN_PASSWORD",
"valueFrom": {
"secretKeyRef": {
"name" : "dataverse-postgresql-admin-secret",
"key" : "postgresql-admin-password"
}
}
},
{
"name": "POSTGRES_SERVICE_HOST",
"value": "dataverse-postgresql-service"
Expand All @@ -242,34 +180,19 @@
},
{
"name": "ADMIN_PASSWORD",
"valueFrom": {
"secretKeyRef": {
"name" : "dataverse-admin-secret",
"key" : "admin-password"
}
}
"value": "admin"
},
{
"name": "SMTP_HOST",
"value": "localhost"
},
{
"name": "POSTGRES_USER",
"valueFrom": {
"secretKeyRef": {
"name" : "dataverse-postgres-secret",
"key" : "postgres-user"
}
}
"value": "dvnapp"
},
{
"name": "POSTGRES_PASSWORD",
"valueFrom": {
"secretKeyRef": {
"name" : "dataverse-postgres-secret",
"key" : "postgres-password"
}
}
"value": "secret"
},
{
"name": "POSTGRES_DATABASE",
Expand Down Expand Up @@ -358,39 +281,19 @@
"env": [
{
"name": "POSTGRESQL_USER",
"valueFrom": {
"secretKeyRef": {
"name" : "dataverse-postgresql-secret",
"key" : "postgresql-user"
}
}
"value": "dvnapp"
},
{
"name": "POSTGRESQL_MASTER_USER",
"valueFrom": {
"secretKeyRef": {
"name" : "dataverse-postgresql-master-secret",
"key" : "postgresql-master-user"
}
}
"value": "master"
},
{
"name": "POSTGRESQL_PASSWORD",
"valueFrom": {
"secretKeyRef": {
"name" : "dataverse-postgresql-secret",
"key" : "postgresql-password"
}
}
"value": "secret"
},
{
"name": "POSTGRESQL_MASTER_PASSWORD",
"valueFrom": {
"secretKeyRef": {
"name" : "dataverse-postgresql-master-secret",
"key" : "postgresql-master-password"
}
}
"value": "master"
},
{
"name": "POSTGRESQL_MASTER_SERVICE_NAME",
Expand All @@ -414,13 +317,9 @@
},
{
"name": "POSTGRESQL_ADMIN_PASSWORD",
"valueFrom": {
"secretKeyRef": {
"name" : "dataverse-postgresql-admin-secret",
"key" : "postgresql-admin-password"
}
}
"value": "secret"
}

],
"resources": {
"limits": {
Expand Down Expand Up @@ -546,55 +445,5 @@
}
}
}
],
"parameters": [
{
"name": "ADMIN_PASSWORD",
"description": "admin password",
"generate": "expression",
"from": "[a-zA-Z0-9]{8}"
},
{
"name": "POSTGRES_USER",
"description": "postgres user",
"generate": "expression",
"from": "user[A-Z0-9]{3}"
},
{
"name": "POSTGRES_PASSWORD",
"description": "postgres password",
"generate": "expression",
"from": "[a-zA-Z0-9]{8}"
},
{
"name": "POSTGRESQL_USER",
"description": "postgresql user",
"generate": "expression",
"from": "user[A-Z0-9]{3}"
},
{
"name": "POSTGRESQL_MASTER_USER",
"description": "postgresql master user",
"generate": "expression",
"from": "user[A-Z0-9]{3}"
},
{
"name": "POSTGRESQL_PASSWORD",
"description": "postgresql password",
"generate": "expression",
"from": "[a-zA-Z0-9]{8}"
},
{
"name": "POSTGRESQL_MASTER_PASSWORD",
"description": "postgresql master password",
"generate": "expression",
"from": "[a-zA-Z0-9]{8}"
},
{
"name": "POSTGRESQL_ADMIN_PASSWORD",
"description": "postgresql admin password",
"generate": "expression",
"from": "[a-zA-Z0-9]{8}"
}
]
}
13 changes: 0 additions & 13 deletions doc/sphinx-guides/source/developers/containers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -150,19 +150,6 @@ If you are interested in changing the OpenShift config file for Dataverse at ``c

The slower way to iterate on the ``openshift.json`` file is to delete the project and re-create it.

Making Changes to the PostgreSQL Database from the Glassfish Pod
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

You can access and modify the PostgreSQL database via an interactive terminal called psql.

To log in to psql from the command line of the Glassfish pod, type the following command:

``PGPASSWORD=$POSTGRES_PASSWORD; export PGPASSWORD; /usr/bin/psql -h $POSTGRES_SERVER.$POSTGRES_SERVICE_HOST -U $POSTGRES_USER -d $POSTGRES_DATABASE``

To log in as an admin, type this command instead:

``PGPASSWORD=$POSTGRESQL_ADMIN_PASSWORD; export PGPASSWORD; /usr/bin/psql -h $POSTGRES_SERVER.$POSTGRES_SERVICE_HOST -U postgres -d $POSTGRES_DATABASE``

Scaling Dataverse by Increasing Replicas in a StatefulSet
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down
14 changes: 4 additions & 10 deletions scripts/installer/install
Original file line number Diff line number Diff line change
Expand Up @@ -180,14 +180,8 @@ if ( -e $config_default_file )
if ( 2 == @xs )
{
my $k = $xs[0];
my $v = trim($xs[1]);
if (defined $ENV{$k} && ($k eq "POSTGRES_USER" || $k eq "POSTGRES_PASSWORD")) {
$v = $ENV{$k};
}
if (defined $ENV{'POSTGRESQL_ADMIN_PASSWORD'} && $k eq "POSTGRES_ADMIN_PASSWORD") {
$v = $ENV{'POSTGRESQL_ADMIN_PASSWORD'};
}
$CONFIG_DEFAULTS{$k}=$v;
my $v = trim($xs[1]);
$CONFIG_DEFAULTS{$k}=$v;
}
}
}
Expand Down Expand Up @@ -769,7 +763,7 @@ else
# 4c. CHECK IF THIS DB ALREADY EXISTS:

my $psql_command_dbcheck =
$psql_admin_exec . "/psql -h " . $CONFIG_DEFAULTS{'POSTGRES_SERVER'} . " -U postgres -c '' -d " . $CONFIG_DEFAULTS{'POSTGRES_DATABASE'} . ">/dev/null 2>&1";
$psql_admin_exec . "/psql -h " . $CONFIG_DEFAULTS{'POSTGRES_SERVER'} . " -U postgres -c \"\" -d " . $CONFIG_DEFAULTS{'POSTGRES_DATABASE'} . ">/dev/null 2>&1";

if ( ( my $exitcode = system($psql_command_dbcheck) ) == 0 )
{
Expand Down Expand Up @@ -799,7 +793,7 @@ else
# 4d. CHECK IF THIS USER ALREADY EXISTS:

my $psql_command_rolecheck =
$psql_exec . "/psql -h " . $CONFIG_DEFAULTS{'POSTGRES_SERVER'} . " -c '' -d postgres " . $CONFIG_DEFAULTS{'POSTGRES_USER'} . " >/dev/null 2>&1";
$psql_exec . "/psql -h " . $CONFIG_DEFAULTS{'POSTGRES_SERVER'} . " -c \"\" -d postgres " . $CONFIG_DEFAULTS{'POSTGRES_USER'} . " >/dev/null 2>&1";
if ( ( my $exitcode = system($psql_command_rolecheck) ) == 0 )
{
print "User (role) " . $CONFIG_DEFAULTS{'POSTGRES_USER'} . " already exists;\n";
Expand Down

0 comments on commit 2cd8ec2

Please sign in to comment.