package httpapi import ( "crypto/rand" "encoding/hex" "encoding/json" "net" "net/http" "net/url" "os" "os/user" "path/filepath" "regexp" "strconv" "strings" "time" ) const pmaSSOMarker = "MiaoPanel phpMyAdmin SSO" // pmaDBRe matches the database names the panel itself creates. var pmaDBRe = regexp.MustCompile(`^[A-Za-z0-9_$@.-]{1,64}$`) const pmaConfigBlock = ` // MiaoPanel phpMyAdmin SSO - managed automatically, do not edit. $i = 1; $cfg['Servers'][$i]['auth_type'] = 'signon'; $cfg['Servers'][$i]['SignonSession'] = 'mp_pma_signon'; $cfg['Servers'][$i]['SignonURL'] = 'signon.php'; $cfg['Servers'][$i]['host'] = 'localhost'; $cfg['Servers'][$i]['port'] = '3306'; $cfg['Servers'][$i]['socket'] = '/run/mysqld/mysqld.sock'; $cfg['Servers'][$i]['AllowNoPassword'] = false; ` const pmaSignonPHP = `