]> git.sesse.net Git - remoteglot/blob - config.pm
Handle streaming PGNs, like from Lichess (although this might break non-streaming...
[remoteglot] / config.pm
1 # Default configuration. Copy this file to config.local.pm if you want
2 # to change anything instead of modifying this (so you won't have to make
3 # changes in git).
4
5 package remoteglotconf;
6
7 # Set to non-undef to pick out one specific game from a PGN file with many games.
8 # See example.
9 our $pgn_filter = undef;
10 #our $pgn_filter = sub {
11 #       my $pgn = shift;
12 #       return $pgn->round() eq '7' && $pgn->white eq 'Carlsen,M';
13 #};
14
15 # Set to non-undef to override the clock information with our own calculations.
16 # The example implements a simple 60+60 (with bonus added before the move).
17 # FIXME(sesse): We might not see all moves in a PGN individually, so this might
18 # skip some moves for bonus.
19 our $adjust_clocks_before_move = undef;
20 #our $adjust_clocks_before_move = sub {
21 #        my ($white_clock_left, $black_clock_left, $move, $toplay) = @_;
22 #
23 #        if (!defined($$white_clock_left) || !defined($$black_clock_left)) {
24 #                $$white_clock_left = 3600;
25 #                $$black_clock_left = 3600;
26 #        }
27 #        if ($toplay eq 'W') {
28 #                $$white_clock_left += 60;
29 #        } else {
30 #                $$black_clock_left += 60;
31 #        }
32 #};
33
34 our $json_output = "/srv/analysis.sesse.net/www/analysis.json";
35 our $json_history_dir = "/srv/analysis.sesse.net/www/history/";  # undef for none.
36
37 our $engine_cmdline = "./stockfish";
38 our %engine_config = (
39 #       'NalimovPath' => '/srv/tablebase',
40         'NalimovUsage' => 'Rarely',
41         'Hash' => '1024',
42 #       'MultiPV' => '2'
43 );
44 our $engine_grpc_backend = undef;  # Not used by us, but will be communicated to serve-analysis.js.
45
46 # Separate engine for multi-PV; can be undef for none.
47 our $engine2_cmdline = undef;
48 our %engine2_config = (
49 #       'NalimovPath' => '/srv/tablebase',
50         'NalimovUsage' => 'Rarely',
51         'Hash' => '1024',
52         'Threads' => '8',
53 );
54 our $engine2_grpc_backend = undef;  # Not used by us, but will be communicated to serve-analysis.js.
55
56 our $update_max_interval = 1.0;
57 our $update_force_after_move = 0.2;
58 our @masters = (
59         'Sesse',
60 );
61
62 # Command line to run the Fathom tablebase lookup program, if installed,
63 # including the --path= argument.
64 our $fathom_cmdline = undef;
65
66 # Credits to show in the footer.
67 our $engine_url = "http://www.stockfishchess.org/";
68 our $engine_details = undef;  # For hardware.
69 our $move_source = "FICS";
70 our $move_source_url = "http://www.freechess.org/";
71
72 # Postgres configuration.
73 our $dbistr = "dbi:Pg:dbname=remoteglot";
74 our $dbiuser = undef;
75 our $dbipass = undef;
76
77 # For manual moves made from the web interface.
78 our $adminpass = undef;
79
80 # How often to poll the target, in seconds.
81 our $poll_frequency = 1.0;
82
83 eval {
84         my $config_filename = $ENV{'REMOTEGLOT_CONFIG'} // 'config.local.pm';
85         require $config_filename;
86 };