-
Notifications
You must be signed in to change notification settings - Fork 22
/
cloudforecast_web
executable file
·42 lines (37 loc) · 1022 Bytes
/
cloudforecast_web
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/usr/bin/env perl
use FindBin;
use lib "$FindBin::Bin/lib";
use lib "$FindBin::Bin/extlib/lib/perl5";
use local::lib "$FindBin::Bin/extlib";
use lib "$FindBin::Bin/site-lib";
use CloudForecast::Web;
use Getopt::Long;
my $root_dir = $FindBin::Bin;
my $config = $root_dir . '/cloudforecast.yaml';
my $server_list = $root_dir .'/server_list.yaml';
my $restarter = 0;
my $port = 5000;
my $host = 0;
my @allowfrom;
my @front_proxy;
GetOptions(
'o|host=s' => \$host,
'p|port=s' => \$port,
'allow-from=s' => \@allowfrom,
'front-proxy=s' => \@front_proxy,
'r|restarter' => \$restarter,
'c|config=s' => \$config,
'l|server-list=s' => \$server_list,
);
die 'config not found' unless $config;
die 'server_list not found' unless $server_list;
CloudForecast::Web->new({
host => $host,
port => $port,
allowfrom => \@allowfrom,
front_proxy => \@front_proxy,
restarter => $restarter,
root_dir => $root_dir,
global_config => $config,
server_list => $server_list,
})->run;