Matthias Andreas Benkard | b382b10 | 2021-01-02 15:32:21 +0100 | [diff] [blame^] | 1 | <?php |
| 2 | $redis = new Redis(); |
| 3 | try { |
| 4 | if (!empty(getenv('REDIS_SLAVEOF_IP'))) { |
| 5 | $redis->connect(getenv('REDIS_SLAVEOF_IP'), getenv('REDIS_SLAVEOF_PORT')); |
| 6 | } |
| 7 | else { |
| 8 | $redis->connect('redis-mailcow', 6379); |
| 9 | } |
| 10 | } |
| 11 | catch (Exception $e) { |
| 12 | exit; |
| 13 | } |
| 14 | header('Content-Type: application/json'); |
| 15 | echo '{"error":"Unauthorized"}'; |
| 16 | error_log("Rspamd UI: Invalid password by " . $_SERVER['REMOTE_ADDR']); |
| 17 | $redis->publish("F2B_CHANNEL", "Rspamd UI: Invalid password by " . $_SERVER['REMOTE_ADDR']); |