| Server IP : 193.86.120.172 / Your IP : 216.73.216.67 Web Server : Apache/2.4.63 (Unix) System : Linux JServices 3.10.108 #86003 SMP Wed Oct 22 13:20:46 CST 2025 x86_64 User : kubec ( 1026) PHP Version : 8.2.28 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/packages/phpMyAdmin/scripts/ |
Upload File : |
#!/bin/bash
# Copyright (c) 2000-2021 Synology Inc. All rights reserved.
GetPMAPrevWebsiteRoot()
{
local dsm7_website_root="$(GetWebsiteRootOfPreviousVersion)"
local legacy_website_root="$(dirname "${dsm7_website_root}")/phpMyAdmin"
if [ -d "$legacy_website_root" ]; then
echo "$legacy_website_root"
return
fi
echo "$dsm7_website_root"
}
CustomPreupgrade()
{
if [ -f ${BLOWFISHSECRET_PATH} ]; then
return;
fi
# migrate blowfish secret for upgraders from DSM6
local prev_website_root="$(GetPMAPrevWebsiteRoot)"
local config_php="$prev_website_root/config.inc.php"
local blowfish_secret=$(grep blowfish_secret $config_php)
if [ -z "$blowfish_secret" ]; then
echo "blowfish_secret does not exist in the old config"
return
fi
echo $blowfish_secret | awk '{print $3}' | sed "s/[^A-Za-z0-9+\/=]//g" > ${BLOWFISHSECRET_PATH}
}
CustomRestoreUpgrade()
{
if [ ! -f ${BLOWFISHSECRET_PATH} ]; then
echo "blowfish secret does not exist in ${BLOWFISHSECRET_PATH}"
return
fi
ApplyBlowfishSecret
}
ApplyBlowfishSecret()
{
# setup blowfish secret config
local blowfish_secret=$(cat "$BLOWFISHSECRET_PATH")
cp -a "$WEBSITE_ROOT/config.sample.inc.php" "$WEBSITE_ROOT/config.inc.php"
sed -i "s|__BLOWFISH_SECRET__|$blowfish_secret|" "$WEBSITE_ROOT/config.inc.php"
# apply setting
local service_choice_tool="/var/packages/$PKG_NAME/target/tool/serverchoicetool.php"
$service_choice_tool INIT
[ -f /var/packages/MariaDB10/enabled ] && $service_choice_tool ADDM10
}
InitializeBlowfishSecret()
{
/usr/bin/openssl rand -base64 32 | head -c 32 > "$BLOWFISHSECRET_PATH"
ApplyBlowfishSecret
}
CustomNewInst()
{
InitializeBlowfishSecret
}
CustomSetCleanNew()
{
InitializeBlowfishSecret
}