diff --git a/Vagrantfile b/Vagrantfile index 6e0dc3dd..0a3b30f7 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -12,5 +12,6 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| config.vm.provider "virtualbox" do |v| v.memory = 4096 v.cpus = 4 + v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"] end end diff --git a/database/schema.sql b/database/schema.sql index 3c80338e..97021497 100644 --- a/database/schema.sql +++ b/database/schema.sql @@ -90,6 +90,9 @@ CREATE TABLE `attachments` ( `created_ts` timestamp NOT NULL DEFAULT 0, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=latin1; + +-- Temp Fix by having a dummy row to prevent constant SELECT queries +INSERT INTO attachments (filename, type, level_id, created_ts) VALUES ("test", "text/plain", 0, NOW()); /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -257,8 +260,8 @@ INSERT INTO `configuration` (field, value, description) VALUES("login_strongpass INSERT INTO `configuration` (field, value, description) VALUES("login_facebook", "0", "(Boolean) Allow Facebook Login"); INSERT INTO `configuration` (field, value, description) VALUES("login_google", "0", "(Boolean) Allow Google Login"); INSERT INTO `configuration` (field, value, description) VALUES("password_type", "1", "(Integer) Type of passwords: See table password_types"); -INSERT INTO `configuration` (field, value, description) VALUES("default_bonus", "30", "(Integer) Default value for bonus in levels"); -INSERT INTO `configuration` (field, value, description) VALUES("default_bonusdec", "10", "(Integer) Default bonus decrement in levels"); +INSERT INTO `configuration` (field, value, description) VALUES("default_bonus", "0", "(Integer) Default value for bonus in levels"); +INSERT INTO `configuration` (field, value, description) VALUES("default_bonusdec", "0", "(Integer) Default bonus decrement in levels"); INSERT INTO `configuration` (field, value, description) VALUES("language", "en", "(String) Language of the system"); INSERT INTO `configuration` (field, value, description) VALUES("livesync", "0", "(Boolean) LiveSync functionality"); INSERT INTO `configuration` (field, value, description) VALUES("livesync_auth_key", "", "(String) Optional LiveSync Auth Key"); diff --git a/extra/lib.sh b/extra/lib.sh index 9dbeddca..6897239c 100755 --- a/extra/lib.sh +++ b/extra/lib.sh @@ -228,6 +228,7 @@ function install_hhvm() { local __multiservers=$3 package software-properties-common + package apt-transport-https log "Adding HHVM keys" sudo DEBIAN_FRONTEND=noninteractive apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0x5a16e7281be7a449 diff --git a/extra/nginx.conf b/extra/nginx.conf index c2a8b55a..dc3c4155 100644 --- a/extra/nginx.conf +++ b/extra/nginx.conf @@ -31,7 +31,7 @@ server { add_header X-Content-Type-Options nosniff; add_header Strict-Transport-Security "max-age=31536000; includeSubdomains;"; - add_header Cache-Control "no-cache, no-store"; + add_header Cache-Control "no-cache"; add_header Pragma "no-cache"; expires -1; diff --git a/extra/nginx/nginx.conf b/extra/nginx/nginx.conf index c5edb099..66636c94 100644 --- a/extra/nginx/nginx.conf +++ b/extra/nginx/nginx.conf @@ -31,7 +31,7 @@ server { add_header X-Content-Type-Options nosniff; add_header Strict-Transport-Security "max-age=31536000; includeSubdomains;"; - add_header Cache-Control "no-cache, no-store"; + add_header Cache-Control "no-cache"; add_header Pragma "no-cache"; expires -1; diff --git a/extra/provision.sh b/extra/provision.sh index 00b15291..a25e981e 100755 --- a/extra/provision.sh +++ b/extra/provision.sh @@ -215,6 +215,7 @@ package_repo_update package git package curl package rsync +package unzip # Check for available memory, should be over 1GB AVAILABLE_RAM=`free -mt | grep Total | awk '{print $2}'` diff --git a/package.json b/package.json index 5d9be93e..b2043931 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "d3": "^3.5.16", "dropkickjs": "2.1.10", "hoverintent-jqplugin": "^0.2.1", - "jquery": "^2.2.3", + "jquery": "^3.0.0", "keycode": "^2.1.1", "typed.js": "^1.1.1", "bxslider": "4.2.6" diff --git a/src/Router.php b/src/Router.php index bffaf9a9..6d23295e 100644 --- a/src/Router.php +++ b/src/Router.php @@ -81,7 +81,7 @@ class Router { case 'logout': // TODO: Make a confirmation modal? SessionUtils::sessionLogout(); - invariant(false, 'should not reach here'); + return await (new IndexController())->genRender(); default: throw new NotFoundRedirectException(); } diff --git a/src/SessionUtils.php b/src/SessionUtils.php index fe0d0301..26b9b15b 100644 --- a/src/SessionUtils.php +++ b/src/SessionUtils.php @@ -98,8 +98,6 @@ public static function sessionLogout(): void { $params["httponly"], ); session_destroy(); - - throw new IndexRedirectException(); } public static function sessionActive(): bool { diff --git a/src/controllers/AdminController.php b/src/controllers/AdminController.php index d8c002be..e8d860b4 100644 --- a/src/controllers/AdminController.php +++ b/src/controllers/AdminController.php @@ -251,7 +251,7 @@ class="fb--conf--language" $team = await MultiTeam::genTeam($token->getTeamId()); // TODO: Combine Awaits $token_status = - {tr('Used by')} {$team->getName()} + {tr('Used by')} {$team->getName()} ; } else { $token_status = @@ -410,11 +410,11 @@ class="fb-cta cta--yellow" if ($start_ts->getValue() !== '0' && $start_ts->getValue() !== 'NaN') { $game_start_ts = $start_ts->getValue(); $game_start_array = array(); - $game_start_array['year'] = gmdate('Y', $game_start_ts); - $game_start_array['mon'] = gmdate('m', $game_start_ts); - $game_start_array['mday'] = gmdate('d', $game_start_ts); - $game_start_array['hours'] = gmdate('H', $game_start_ts); - $game_start_array['minutes'] = gmdate('i', $game_start_ts); + $game_start_array['year'] = date('Y', $game_start_ts); + $game_start_array['mon'] = date('m', $game_start_ts); + $game_start_array['mday'] = date('d', $game_start_ts); + $game_start_array['hours'] = date('H', $game_start_ts); + $game_start_array['minutes'] = date('i', $game_start_ts); } else { $game_start_ts = '0'; $game_start_array['year'] = '0'; @@ -428,11 +428,11 @@ class="fb-cta cta--yellow" if ($end_ts->getValue() !== '0' && $end_ts->getValue() !== 'NaN') { $game_end_ts = $end_ts->getValue(); $game_end_array = array(); - $game_end_array['year'] = gmdate('Y', $game_end_ts); - $game_end_array['mon'] = gmdate('m', $game_end_ts); - $game_end_array['mday'] = gmdate('d', $game_end_ts); - $game_end_array['hours'] = gmdate('H', $game_end_ts); - $game_end_array['minutes'] = gmdate('i', $game_end_ts); + $game_end_array['year'] = date('Y', $game_end_ts); + $game_end_array['mon'] = date('m', $game_end_ts); + $game_end_array['mday'] = date('d', $game_end_ts); + $game_end_array['hours'] = date('H', $game_end_ts); + $game_end_array['minutes'] = date('i', $game_end_ts); } else { $game_end_ts = '0'; $game_end_array['year'] = '0'; @@ -1033,6 +1033,7 @@ class={strval($game_schedule_reset_class)} type="number" value={strval($game_start_array['year'])} name="fb--schedule--start_year" + tabindex="1" />