hardcore the admin password to make this test environment easier to use

This commit is contained in:
Rui Lopes 2020-03-28 12:26:41 +00:00
parent bee567c81e
commit 0155038ad7
5 changed files with 17 additions and 4 deletions

View File

@ -39,9 +39,10 @@ Add the following entry to your `/etc/hosts` file:
Install Vagrant 2.1+.
Run `vagrant up --provider=virtualbox # or --provider=libvirt` to launch the environment.
See its output to known how to login at the
[local Nexus home page](https://nexus.example.com) as `admin` (you can also login with
one of the example accounts, e.g. `alice.doe` and password `password`).
Access the [Nexus home page](https://nexus.example.com) and login as the `admin` user and password `admin`.
You can also login with one of the example accounts, e.g. `alice.doe` and password `password`.
**NB** nginx is setup with a self-signed certificate that you have to trust before being
able to access the local Nexus home page.

View File

@ -5,6 +5,10 @@ nexus_domain=$(hostname --fqdn)
. /vagrant/provision/nexus-groovy.sh
# NB this is the default nexus password, which will be changed to
# 'admin' by the provision.groovy script that we run bellow.
admin_password='admin123'
# list existing scripts.
#http -a "$admin_username:$admin_password" https://$nexus_domain/service/rest/v1/script | jq .

View File

@ -2,7 +2,7 @@
set -eux
admin_username=${admin_username:-admin}
admin_password=${admin_password:-$(cat /opt/nexus/sonatype-work/nexus3/admin.password)}
admin_password=${admin_password:-admin}
# see https://help.sonatype.com/display/NXRM3/REST+and+Integration+API
# see https://nexus.example.com/swagger-ui/

View File

@ -54,6 +54,9 @@ sed -i -E 's,nexus-pro-,nexus-oss-,g' sonatype-work/nexus3/etc/nexus.properties
cat >>sonatype-work/nexus3/etc/nexus.properties <<'EOF'
# disable the wizard.
nexus.onboarding.enabled=false
# disable generating a random password for the admin user.
nexus.security.randompassword=false
EOF
diff -u $nexus_home/etc/nexus-default.properties sonatype-work/nexus3/etc/nexus.properties || true
popd

View File

@ -101,6 +101,11 @@ realmManager.enableRealm("NuGetApiKey")
// enable the npm Bearer Token Realm.
realmManager.enableRealm("NpmToken")
// set the admin password.
// NB we set it to something different than the default (admin123) to get
// rid of the "Default Admin Credentials" warning... and because this
// password is easier to remember.
security.securitySystem.changePassword('admin', 'admin')
// the intent is to get or create an NuGet API Key like the one we can see on the user page:
// http://nexus.example.com:8081/#user/nugetapitoken.