528252c5b46cd55f8eab447434db29d8ac2c7518 max Fri Aug 20 06:57:10 2021 -0700 making GBIC script work on centos7 again, refs #27795 diff --git src/product/installer/browserSetup.sh src/product/installer/browserSetup.sh index 605cbb9..b178bc8 100755 --- src/product/installer/browserSetup.sh +++ src/product/installer/browserSetup.sh @@ -1246,64 +1246,67 @@ $MYSQL -e 'CREATE DATABASE IF NOT EXISTS hgTemp;' $MYSQL -e 'CREATE DATABASE IF NOT EXISTS hgFixed;' # empty db needed for gencode tracks updateBlatServers echo2 echo2 "Will now grant permissions to browser database access users:" echo2 "User: 'browser', password: 'genome' - full database access permissions" echo2 "User: 'readonly', password: 'access' - read only access for CGI binaries" echo2 "User: 'readwrite', password: 'update' - readwrite access for hgcentral DB" waitKey # Full access to all databases for the user 'browser' # This would be for browser developers that need read/write access # to all database tables. - $MYSQL -e "DROP USER IF EXISTS browser@localhost" + # $MYSQL -e "DROP USER IF EXISTS browser@localhost" # centos7 uses mysql 5.6 which doesn't have IF EXISTS so work around that here + # $MYSQL -e "DROP USER IF EXISTS readonly@localhost" + # $MYSQL -e "DROP USER IF EXISTS ctdbuser@localhost" + # $MYSQL -e "DROP USER IF EXISTS readwrite@localhost" + $MYSQL -e 'DELETE from mysql.user where User="browser" or User="readonly" or User="readwrite" or User="ctdbuser"' + $MYSQL -e "FLUSH PRIVILEGES;" + $MYSQL -e "CREATE USER browser@localhost IDENTIFIED BY 'genome'" $MYSQL -e "GRANT SELECT, INSERT, UPDATE, DELETE, FILE, "\ "CREATE, DROP, ALTER, CREATE TEMPORARY TABLES on *.* TO browser@localhost" # FILE permission for this user to all databases to allow DB table loading with # statements such as: "LOAD DATA INFILE file.tab" # For security details please read: # http://dev.mysql.com/doc/refman/5.1/en/load-data.html # http://dev.mysql.com/doc/refman/5.1/en/load-data-local.html $MYSQL -e "GRANT FILE on *.* TO browser@localhost;" # Read only access to genome databases for the browser CGI binaries - $MYSQL -e "DROP USER IF EXISTS readonly@localhost" $MYSQL -e "CREATE USER readonly@localhost IDENTIFIED BY 'access';" $MYSQL -e "GRANT SELECT, CREATE TEMPORARY TABLES on "\ "*.* TO readonly@localhost;" $MYSQL -e "GRANT SELECT, INSERT, CREATE TEMPORARY TABLES on hgTemp.* TO "\ "readonly@localhost;" # Readwrite access to hgcentral for browser CGI binaries to keep session state - $MYSQL -e "DROP USER IF EXISTS readwrite@localhost" $MYSQL -e "CREATE USER readwrite@localhost IDENTIFIED BY 'update';" $MYSQL -e "GRANT SELECT, INSERT, UPDATE, "\ "DELETE, CREATE, DROP, ALTER on hgcentral.* TO readwrite@localhost; " # create /gbdb and let the apache user write to it # hgConvert will download missing liftOver files on the fly and needs write # write access mkdir -p $GBDBDIR chown $APACHEUSER:$APACHEUSER $GBDBDIR # the custom track database needs it own user and permissions - $MYSQL -e "DROP USER IF EXISTS ctdbuser@localhost" $MYSQL -e "CREATE USER ctdbuser@localhost IDENTIFIED BY 'ctdbpassword';" $MYSQL -e "GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,ALTER,INDEX "\ "on customTrash.* TO ctdbuser@localhost;" # removed these now for the new hgGateway page, Apr 2016 # by default hgGateway needs an empty hg19 database, will crash otherwise # $MYSQL -e 'CREATE DATABASE IF NOT EXISTS hg19' # mm9 needs an empty hg18 database $MYSQL -e 'CREATE DATABASE IF NOT EXISTS hg18' $MYSQL -e "FLUSH PRIVILEGES;" } # main function, installs the browser on Redhat/Debian and potentially even on OSX function installBrowser ()