diff --git a/ansible/inventories/dockers/group_vars/all.yml b/ansible/inventories/dockers/group_vars/all.yml index 855b8d656..ea509264c 100644 --- a/ansible/inventories/dockers/group_vars/all.yml +++ b/ansible/inventories/dockers/group_vars/all.yml @@ -73,10 +73,14 @@ pip: # - { name: "docker", version: "*", state: "present" } etchosts: | - 127.0.0.1 localhost - {{ipv4}} {{fqdn}} {{host_aliases}} - 10.0.0.254 vpn01 gw - 10.0.0.100 your.registry.com + 127.0.0.1 localhost + {{ipv4}} {{fqdn}} {{host_aliases}} + 10.0.0.254 vpn01 gw + 10.0.0.250 your.registry.com + {% if public_registries is defined and public_registries == false %} + 127.0.0.2 registry-1.docker.io auth.docker.io production.cloudflare.docker.com + {% endif %} + SYSTEM_CLEANUPS: # - /root/uploads diff --git a/ansible/runonce/db.yml b/ansible/runonce/db.yml index 2e087e5d2..581492d56 100755 --- a/ansible/runonce/db.yml +++ b/ansible/runonce/db.yml @@ -120,7 +120,12 @@ - { plugin_load_add: "ha_federatedx" } - { plugin_load: "ha_blackhole" } - { blackhole: "FORCE" } - + - { table_definition_cache: "420" } + - { performance_schema: "ON" } + - { innodb_buffer_pool_size: "384M" } + - { innodb_log_file_size: "96M" } + - { key_buffer_size: "512k" } + - { max_connections: "50" } tasks: - name: Sync date time raw: rdate pool.ntp.org diff --git a/ansible/templates/nginx.conf.j2 b/ansible/templates/nginx.conf.j2 index 5bd6c159c..ca9ed603f 100644 --- a/ansible/templates/nginx.conf.j2 +++ b/ansible/templates/nginx.conf.j2 @@ -337,7 +337,7 @@ http { } {% endif %} location /ws { - proxy_pass http://127.0.0.1:8888/ws; + proxy_pass {{ wsEndpoint | default("http://127.0.0.1:8888/ws") }}; # WebSocket-specific headers proxy_http_version 1.1; @@ -371,11 +371,7 @@ http { # let yii catch the calls to non-existing PHP files set $fsn /$yii_bootstrap; - set $yiiargs r=$request_uri; - #if (-f $document_root$fastcgi_script_name){ - # set $fsn $fastcgi_script_name; - set $yiiargs $query_string; - #} + set $yiiargs $query_string; fastcgi_pass {{item.fpm}}; include fastcgi_params; @@ -399,10 +395,6 @@ http { # let yii catch the calls to non-existing PHP files set $fsn /$yii_bootstrap; set $yiiargs r=$request_uri; - #if (-f $document_root$fastcgi_script_name){ - # set $fsn $fastcgi_script_name; - # set $yiiargs $query_string; - #} fastcgi_pass {{item.fpm}}; include fastcgi_params; diff --git a/backend/modules/settings/models/Sysconfig.php b/backend/modules/settings/models/Sysconfig.php index 605c17b87..e42a7faea 100644 --- a/backend/modules/settings/models/Sysconfig.php +++ b/backend/modules/settings/models/Sysconfig.php @@ -3,7 +3,7 @@ namespace app\modules\settings\models; use Yii; - +use yii\base\UserException; /** * This is the model class for table "sysconfig". * @@ -70,8 +70,12 @@ public function beforeSave($insert) $Q = sprintf("DROP EVENT IF EXISTS event_end_notification"); \Yii::$app->db->createCommand($Q)->execute(); if (!empty($this->val)) { - $Q = sprintf("CREATE EVENT event_end_notification ON SCHEDULE AT '%s' DO BEGIN INSERT INTO `notification`(player_id,category,title,body,archived) SELECT id,'swal:info',memc_get('sysconfig:event_end_notification_title'),memc_get('sysconfig:event_end_notification_body'),0 FROM player WHERE status=10; DO memc_set('event_finished',1); SELECT sleep(1) INTO OUTFILE '/tmp/event_finished';END", $this->val); - \Yii::$app->db->createCommand($Q)->execute(); + try { + $Q = sprintf("CREATE EVENT event_end_notification ON SCHEDULE AT '%s' DO BEGIN INSERT INTO `notification`(player_id,category,title,body,archived) SELECT id,'swal:info',memc_get('sysconfig:event_end_notification_title'),memc_get('sysconfig:event_end_notification_body'),0 FROM player WHERE status=10; DO memc_set('event_finished',1); SELECT sleep(1) INTO OUTFILE '/tmp/event_finished';END", $this->val); + \Yii::$app->db->createCommand($Q)->execute(); + } catch (\Throwable $e) { + throw new UserException('Failed to create event_end_notification EVENT: '.$e->getMessage()); + } $this->val = strtotime($this->val); } else { \Yii::$app->db->createCommand("DROP EVENT IF EXISTS event_end_notification")->execute();