Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions ansible/inventories/dockers/group_vars/all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 6 additions & 1 deletion ansible/runonce/db.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 2 additions & 10 deletions ansible/templates/nginx.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand Down
10 changes: 7 additions & 3 deletions backend/modules/settings/models/Sysconfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace app\modules\settings\models;

use Yii;

use yii\base\UserException;
/**
* This is the model class for table "sysconfig".
*
Expand Down Expand Up @@ -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();
Expand Down