Use modern installer & create strong temp password for admin
This commit is contained in:
18
installer.sh
18
installer.sh
@ -96,8 +96,7 @@ echo "[*] Generating LocalSettings.php..."
|
||||
|
||||
WIKI_NAME="My Wiki"
|
||||
ADMIN_USER="admin"
|
||||
# WARNING: Default admin password is 'changeme'. User must change it immediately.
|
||||
ADMIN_PASS="changeme"
|
||||
ADMIN_PASS=$(openssl rand -base64 12)
|
||||
|
||||
### APPEND ADDITIONAL SETTINGS ###
|
||||
LSETTINGS="$MW_DIR/LocalSettings.php"
|
||||
@ -116,21 +115,10 @@ cat >> "$LSETTINGS" <<EOF
|
||||
\$wgMainCacheType = CACHE_REDIS;
|
||||
\$wgMemCachedServers = ["127.0.0.1:6379"];
|
||||
|
||||
# Allow temporary simple admin password for first-run activation
|
||||
\$wgMinimalPasswordLength = 6;
|
||||
\$wgPasswordPolicy = [
|
||||
'policies' => [
|
||||
'default' => [
|
||||
'MinimalPasswordLength' => 6,
|
||||
'PasswordCannotBePopular' => false,
|
||||
],
|
||||
],
|
||||
];
|
||||
|
||||
EOF
|
||||
|
||||
cd "$MW_DIR"
|
||||
php maintenance/install.php \
|
||||
php maintenance/run.php install \
|
||||
--dbname="$DB_NAME" \
|
||||
--dbuser="$DB_USER" \
|
||||
--dbpass="$DB_PASS" \
|
||||
@ -272,6 +260,8 @@ echo "Admin login:"
|
||||
echo " Username: $ADMIN_USER"
|
||||
echo " Password: $ADMIN_PASS"
|
||||
echo
|
||||
echo "Change the password with /activate/"
|
||||
echo
|
||||
echo "File uploads enabled, Vector skin and core extensions preloaded."
|
||||
echo "Redis enabled for caching. PHP limits adjusted for media upload."
|
||||
echo "Self-signed cert installed. Let's Encrypt ready but not configured."
|
||||
|
Reference in New Issue
Block a user