revert: fix the wrong generation of our-root password and length

Due to last those commits, the password generation was modified incorrectly.
It gens the $_svn_ourroot_password_ to $_svn_certroot_password_. Must revert it.
According to the version from @vfleaking, the judger_socket password and the our-root password is 32 chars long.
This commit is contained in:
Masco Skray 2018-08-05 12:10:00 +08:00
parent 410fe66e46
commit 64b7f9296e

View File

@ -5,8 +5,9 @@ genRandStr(){
#Set some vars #Set some vars
_database_password_=root _database_password_=root
_judger_socket_port_=2333 _judger_socket_port_=2333
_judger_socket_password_=$(genRandStr 10) _judger_socket_password_=$(genRandStr 32)
_main_judger_password_=$(genRandStr 32) _main_judger_password_=$(genRandStr 32)
_svn_ourroot_password_=$(genRandStr 32)
_svn_certroot_password_=$(genRandStr 32) _svn_certroot_password_=$(genRandStr 32)
getAptPackage(){ getAptPackage(){
@ -111,7 +112,7 @@ password-db = passwd
EOD EOD
svnusr="our-root" svnusr="our-root"
svnpwd="$_svn_certroot_password_" svnpwd="$_svn_ourroot_password_"
cat >\$path/conf/passwd <<EOD cat >\$path/conf/passwd <<EOD
[users] [users]
@ -132,7 +133,7 @@ UOJEOF
cat >/var/svn/problem/post-commit.sh <<UOJEOF cat >/var/svn/problem/post-commit.sh <<UOJEOF
#!/bin/sh #!/bin/sh
svnusr="our-root" svnusr="our-root"
svnpwd="$_svn_certroot_password_" svnpwd="$_svn_ourroot_password_"
cd /var/svn/problem/\$1/cur/\$1 cd /var/svn/problem/\$1/cur/\$1
svn update --username \$svnusr --password \$svnpwd svn update --username \$svnusr --password \$svnpwd
chown www-data /var/svn/problem/\$1 -R chown www-data /var/svn/problem/\$1 -R
@ -163,7 +164,7 @@ setWebConf(){
\$config['security']['cookie']['checksum_salt']=['$(genRandStr 16)','$(genRandStr 16)','$(genRandStr 16)']; \$config['security']['cookie']['checksum_salt']=['$(genRandStr 16)','$(genRandStr 16)','$(genRandStr 16)'];
\$config['judger']['socket']['port']='$_judger_socket_port_'; \$config['judger']['socket']['port']='$_judger_socket_port_';
\$config['judger']['socket']['password']='$_judger_socket_password_'; \$config['judger']['socket']['password']='$_judger_socket_password_';
\$config['svn']['our-root']['password']='$_svn_certroot_password_'; \$config['svn']['our-root']['password']='$_svn_ourroot_password_';
file_put_contents('/var/www/uoj/app/.config.php', "<?php\nreturn ".str_replace('\'_httpHost_\'','UOJContext::httpHost()',var_export(\$config, true)).";\n"); file_put_contents('/var/www/uoj/app/.config.php', "<?php\nreturn ".str_replace('\'_httpHost_\'','UOJContext::httpHost()',var_export(\$config, true)).";\n");
UOJEOF UOJEOF
#Import MySQL database #Import MySQL database