hardcore the admin password to make this test environment easier to use
This commit is contained in:
parent
bee567c81e
commit
0155038ad7
|
|
@ -39,9 +39,10 @@ Add the following entry to your `/etc/hosts` file:
|
||||||
Install Vagrant 2.1+.
|
Install Vagrant 2.1+.
|
||||||
|
|
||||||
Run `vagrant up --provider=virtualbox # or --provider=libvirt` to launch the environment.
|
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
|
Access the [Nexus home page](https://nexus.example.com) and login as the `admin` user and password `admin`.
|
||||||
one of the example accounts, e.g. `alice.doe` and password `password`).
|
|
||||||
|
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
|
**NB** nginx is setup with a self-signed certificate that you have to trust before being
|
||||||
able to access the local Nexus home page.
|
able to access the local Nexus home page.
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,10 @@ nexus_domain=$(hostname --fqdn)
|
||||||
|
|
||||||
. /vagrant/provision/nexus-groovy.sh
|
. /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.
|
# list existing scripts.
|
||||||
#http -a "$admin_username:$admin_password" https://$nexus_domain/service/rest/v1/script | jq .
|
#http -a "$admin_username:$admin_password" https://$nexus_domain/service/rest/v1/script | jq .
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
set -eux
|
set -eux
|
||||||
|
|
||||||
admin_username=${admin_username:-admin}
|
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://help.sonatype.com/display/NXRM3/REST+and+Integration+API
|
||||||
# see https://nexus.example.com/swagger-ui/
|
# see https://nexus.example.com/swagger-ui/
|
||||||
|
|
|
||||||
|
|
@ -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'
|
cat >>sonatype-work/nexus3/etc/nexus.properties <<'EOF'
|
||||||
# disable the wizard.
|
# disable the wizard.
|
||||||
nexus.onboarding.enabled=false
|
nexus.onboarding.enabled=false
|
||||||
|
|
||||||
|
# disable generating a random password for the admin user.
|
||||||
|
nexus.security.randompassword=false
|
||||||
EOF
|
EOF
|
||||||
diff -u $nexus_home/etc/nexus-default.properties sonatype-work/nexus3/etc/nexus.properties || true
|
diff -u $nexus_home/etc/nexus-default.properties sonatype-work/nexus3/etc/nexus.properties || true
|
||||||
popd
|
popd
|
||||||
|
|
|
||||||
|
|
@ -101,6 +101,11 @@ realmManager.enableRealm("NuGetApiKey")
|
||||||
// enable the npm Bearer Token Realm.
|
// enable the npm Bearer Token Realm.
|
||||||
realmManager.enableRealm("NpmToken")
|
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:
|
// 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.
|
// http://nexus.example.com:8081/#user/nugetapitoken.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue