From d3a6c3830de469c0174889e837cb91db40274efc Mon Sep 17 00:00:00 2001 From: Natalie Rose Date: Tue, 8 Sep 2026 11:06:38 +1000 Subject: [PATCH] Removing AWS S3 stuff --- .gitignore | 4 +- Dockerfile | 5 +- bin/deploy.pl | 226 -------------------------- bin/deploy.psgi | 58 ------- bin/generate_news_feeds.pl | 31 ++-- bin/generate_stars_csv.pl | 26 +-- bin/init_sched.sh | 8 - bin/lacuna.logrotate | 34 ---- bin/mission_check.pl | 1 - bin/restart_starman.sh | 5 - bin/run_daily.sh | 1 - bin/run_four_hourly.sh | 1 - bin/run_hourly.sh | 1 - bin/run_two_hourly.sh | 1 - bin/run_weekly.sh | 1 - bin/setup/install-pm.sh | 43 ----- bin/setup/server/build.sh | 47 ------ bin/setup/server/dataapps.sh | 4 - bin/setup/server/download.sh | 26 --- bin/start_all.sh | 5 - bin/start_beanstalk.sh | 1 - bin/start_deploy.sh | 5 - bin/start_lacuna.sh | 15 +- bin/start_memcached.sh | 5 - bin/start_pt.sh | 13 -- bin/startqa.sh | 22 --- bin/stop_memcached.sh | 4 - bin/stop_starman.sh | 4 - bin/summarize_server.pl | 56 ++----- bin/summarize_spies.pl | 44 +---- bin/util/push_assets.pl | 107 ------------ bin/util/swap_bodies.pl | 1 - cpanfile | 1 - cpanfile.snapshot | 204 ----------------------- docker/server/Dockerfile | 3 +- docker/server/docker-compose.yml | 3 + docker/server/etc-dev/lacuna.conf | 8 +- docker/server/etc-homelab/lacuna.conf | 8 +- docker/server/etc-test/lacuna.conf | 8 +- lib/Lacuna/DB/Result/Mission.pm | 2 +- lib/Lacuna/DB/Result/News.pm | 2 +- lib/Lacuna/Web.pm | 2 +- t/370_Medals.t | 2 +- var/wrapper.html | 2 +- 44 files changed, 70 insertions(+), 980 deletions(-) delete mode 100755 bin/deploy.pl delete mode 100644 bin/deploy.psgi delete mode 100644 bin/init_sched.sh delete mode 100644 bin/lacuna.logrotate delete mode 100755 bin/restart_starman.sh delete mode 100755 bin/setup/install-pm.sh delete mode 100755 bin/setup/server/build.sh delete mode 100755 bin/setup/server/dataapps.sh delete mode 100755 bin/setup/server/download.sh delete mode 100755 bin/start_all.sh delete mode 100755 bin/start_beanstalk.sh delete mode 100755 bin/start_deploy.sh delete mode 100755 bin/start_memcached.sh delete mode 100755 bin/start_pt.sh delete mode 100755 bin/startqa.sh delete mode 100755 bin/stop_memcached.sh delete mode 100755 bin/stop_starman.sh delete mode 100644 bin/util/push_assets.pl diff --git a/.gitignore b/.gitignore index edd2ad8f..752ba61f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,13 +1,11 @@ bin/schedule_building.pid bin/schedule_ship_arrival.pid bin/schedule_captcha.pid -bin/setup/server/*.gz -bin/setup/server/*.rpm -bin/setup/server/*/ etc/ var/www/public/local.html var/www/public/server_overview.json var/www/public/starmap.json +var/www/public/network19/ var/www/public/api var/www/public/captcha data/ diff --git a/Dockerfile b/Dockerfile index 220434fd..5d6b6f9b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -52,7 +52,6 @@ ENV PATH="/home/lacuna/server/local/bin:${PATH}" \ # which redirects LACUNA_LOG_DIR elsewhere). RUN mkdir -p /home/lacuna/server/log/server \ /home/lacuna/server/log/scheduler \ - /home/lacuna/server/log/cron \ - /home/lacuna/server/log/deploy + /home/lacuna/server/log/cron -ENTRYPOINT ["/bin/bash", "./bin/start_lacuna.sh"] +CMD ["/bin/bash", "./bin/start_lacuna.sh"] diff --git a/bin/deploy.pl b/bin/deploy.pl deleted file mode 100755 index 20719a7b..00000000 --- a/bin/deploy.pl +++ /dev/null @@ -1,226 +0,0 @@ -#!/data/apps/bin/perl -use strict; -use warnings; -use 5.010; - -use constant SECINDAY => 60 * 60 * 24; -sub CACHECONTROL { sprintf 'max-age=%d, public', SECINDAY * (shift()||7) } - -use POSIX (); -BEGIN { - # want to check if we're running under the debugger, - # and not fork off in that case. - no warnings 'once'; - if (!defined $DB::single) - { - fork && POSIX::_exit(0); - POSIX::setsid(); - fork && POSIX::_exit(0); - } -} - -use FindBin; -use Config::JSON; -use Symbol; -use IPC::Open3; -use Net::Amazon::S3; -use DateTime; -use DateTime::Format::HTTP; -use Path::Class::Dir; -use Git::Wrapper; -use AnyEvent::Util; -use DateTime; -$ENV{PATH} = '/data/apps/bin:' . $ENV{PATH}; -my $log_dir = $ENV{LACUNA_LOG_DIR} || '/home/lacuna/server/log'; -open(STDOUT, '>>', "$log_dir/deploy/deploy.log") - or open(STDOUT, '>>', '/tmp/lacuna-deploy.log'); -open STDERR, '>&', \*STDOUT; - -sub out { - my $message = shift; - say DateTime->now, " ", $message; -} - -my $config = Config::JSON->new('/home/lacuna/server/etc/lacuna.conf'); -my $s3 = Net::Amazon::S3->new( - aws_access_key_id => $config->get('access_key'), - aws_secret_access_key => $config->get('secret_key'), - retry => 1, -); -my %types = ( - css => 'text/css', - cur => 'image/x-win-bitmap', - gif => 'image/png', - html => 'text/html', - jpg => 'image/jpeg', - js => 'text/javascript', - json => 'application/json', - png => 'image/png', - txt => 'text/plain', -); - -run(@ARGV); - -sub run { - my ($repo, $branch) = @_; - - my $repo_config = $config->get("repo/$repo"); - - return - unless $repo_config; - - my $branch_config = $repo_config->{branch}{$branch}; - return - unless $branch_config; - - out "--------"; - out "Updating $repo / $branch"; - out ""; - - my $dir = Path::Class::Dir->new($repo_config->{path}); - my $git = Git::Wrapper->new($repo_config->{path}); - $git->fetch; - $git->checkout($branch); - my ($old_rev) = $git->rev_parse('HEAD'); - $git->pull; - my @updated_files = $git->diff({name_only => 1}, $old_rev, 'HEAD'); - - if ($repo eq 'Lacuna-Web-Client') { - my $bucket = $branch_config->{bucket}; - my $s3bucket = $s3->bucket($bucket) or die $s3->err . ": " . $s3->errstr; - my ($new_rev) = $git->rev_parse({short => 1}, 'HEAD'); - my $url_root = $branch_config->{url_root}; - my $prefix = $branch_config->{prefix}; - my $index_file = $branch_config->{index_file}; - - my $license_text = sprintf <<'END_TEXT', (localtime)[5] + 1900, $new_rev; -/* -Copyright (c) %s, Lacuna Expanse Corp. All rights reserved. -Code licensed under the BSD License: -http://github.com/plainblack/Lacuna-Web-Client/blob/master/LICENSE -Built from: http://github.com/plainblack/Lacuna-Web-Client/commit/%s -*/ -END_TEXT - # new gulp-based client. - chdir($repo_config->{path}); - system("npm install"); - system("node_modules/bower/bin/bower","install","--config.interactive=false","--allow-root") - if -e "node_modules/bower/bin/bower"; - system("gulp build-no-lint"); - - my $lacuna_dir = $dir->subdir('lacuna'); - $lacuna_dir->recurse( - callback => sub { - my $file = shift; - return unless -f $file; - my ($ext) = $file =~ /\.(css|js)$/; - my $type = $types{$ext} || 'text/plain'; - my $s3path = "$prefix/$new_rev/" . $file->relative($dir); - - my $content = $license_text . $file->slurp; - $content = cmd_pipe($content, 'gzip', '-9'); - - $s3bucket->add_key( - $s3path, - $content, - { - 'Content-Type' => $type, - 'Content-Encoding' => 'gzip', - 'Expires' => DateTime::Format::HTTP->format_datetime(DateTime->now->add(years=>5)), - 'Cache-Control' => CACHECONTROL(180), - acl_short => 'public-read', - }, - ) or die $s3->err . ": " . $s3->errstr; - } - ); - - # Update the index file to point to the new store. - my $index = do { - open my $fh, '<', $index_file; - local $/; - <$fh>; - }; - $index =~ s{((?:href|src)=")[^"]+(/(?:load\.(?:min\.)?js|styles\.(?:min\.)?css)")}{$1$url_root/$prefix/$new_rev/lacuna$2}msxg; - open my $fh, '>', $index_file; - print {$fh} $index; - close $fh; - - my $allfiles = $s3bucket->list_all({prefix => $prefix.'/'}); - for my $key (@{ $allfiles->{keys} }) { - my $file = $key->{key}; - if ($file =~ m{^$prefix/$new_rev/}) { - next; - } - $s3bucket->delete_key($file); - } - } - elsif ($repo eq 'Lacuna-Server') { - # pull already done locally - } - elsif ($repo eq 'Lacuna-Server-Open') { - my $restart_server = 0; - my $server_path = $repo_config->{path} || "$FindBin::Bin/.."; - - if ($branch eq "pt-reboot" or $branch eq "pt") { - chdir($server_path); - system("git", "pull", "origin", $branch); - $restart_server = 1; - } - - if ($restart_server) { - # startqa.sh used to live in the (now gone) Lacuna-Server-Private - # repo; it is now a normal script alongside this one. - chdir($FindBin::Bin); - system("$FindBin::Bin/startqa.sh"); - } - } - elsif ($repo eq 'Lacuna-Assets') { - my $bucket = $branch_config->{bucket}; - my $s3bucket = $s3->bucket($bucket); - for my $file (@updated_files) { - my $local_file = $dir->file($file); - next - unless $local_file && -f $local_file; - - my ($ext) = $file =~ /\.([^.]+)$/; - - my $type = $types{$ext} || 'text/plain'; - - my $s3path = "assets/$file"; - - $s3bucket->add_key_filename( - $s3path, - $local_file->stringify, - { - 'Content-Type' => $type, - 'Expires' => DateTime::Format::HTTP->format_datetime(DateTime->now->add(years=>5)), - 'Cache-Control' => CACHECONTROL(7), - acl_short => 'public-read', - }, - ) or die $s3->err . ": " . $s3->errstr; - } - } -} - -sub cmd_pipe { - my ($content, @cmd) = @_; - - my $r = ''; - my $cv = AnyEvent::Util::run_cmd(\@cmd, '<', \$content, '>', \$r); - $cv->recv; - return $r; -} - -sub cmd_pipe_old { - my ($content, @cmd) = @_; - my ($wtr, $rdr); - my $err = Symbol::gensym(); - my $pid = IPC::Open3::open3($wtr, $rdr, $err, @cmd); - print {$wtr} $content; - close $wtr; - my $out = do {local $/; <$rdr>}; - chomp (my @err = <$err>); - waitpid $pid, 0; - return $out; -} - diff --git a/bin/deploy.psgi b/bin/deploy.psgi deleted file mode 100644 index db91b5ba..00000000 --- a/bin/deploy.psgi +++ /dev/null @@ -1,58 +0,0 @@ -use strict; -use 5.010; - -# -# Deploy webhook front-end for The Lacuna Expanse server. -# -# Reconstructed: this file only ever existed in this repo as a symlink into the -# (now gone) Lacuna-Server-Private repo. bin/start_deploy.sh / bin/start_pt.sh -# run it under starman on port 5001. It receives a git host push notification -# and hands ($repo, $branch) to bin/deploy.pl, which does the actual pull / -# asset publish / server restart. -# -# The GitHub-push-based deploy flow this fronted is retired (deployment is now -# Docker Compose), so this is intentionally a thin shim: enough to keep the -# start scripts working and to still allow a manual kick. -# - -use FindBin; -use JSON qw(decode_json); -use Plack::Request; - -my $deploy_script = "$FindBin::Bin/deploy.pl"; - -no warnings 'void'; - -sub dispatch { - my ($repo, $branch) = @_; - return "ignored: missing repo/branch\n" unless $repo && $branch; - - # Fire and forget - deploy.pl daemonises itself and logs to - # $LACUNA_LOG_DIR/deploy/deploy.log (falling back to /tmp/lacuna-deploy.log). - system('perl', $deploy_script, $repo, $branch); - return "deploying $repo / $branch\n"; -} - -sub { - my $env = shift; - my $req = Plack::Request->new($env); - - if ($req->method eq 'GET') { - return [ 200, [ 'Content-Type' => 'text/plain' ], - [ "Lacuna deploy webhook. POST a git push payload here.\n" ] ]; - } - - if ($req->method ne 'POST') { - return [ 405, [ 'Content-Type' => 'text/plain' ], [ "method not allowed\n" ] ]; - } - - # Accept either a raw JSON body or the classic form-encoded `payload` param. - my $raw = $req->parameters->{payload} // $req->content // ''; - my $payload = eval { decode_json($raw) } || {}; - - my $repo = $payload->{repository}{name}; - my ($branch) = ($payload->{ref} // '') =~ m{refs/heads/(.+)$}; - - my $msg = eval { dispatch($repo, $branch) } || "error: $@\n"; - return [ 200, [ 'Content-Type' => 'text/plain' ], [ $msg ] ]; -}; diff --git a/bin/generate_news_feeds.pl b/bin/generate_news_feeds.pl index c58ef2d5..f04a3430 100644 --- a/bin/generate_news_feeds.pl +++ b/bin/generate_news_feeds.pl @@ -4,17 +4,15 @@ use Lacuna::DB; use Lacuna; use XML::FeedPP; use DateTime; -use Net::Amazon::S3; +use File::Path qw(make_path); use Encode; +# Per-zone Network 19 RSS feeds. Written into the public web root; nginx serves +# them at /network19/.rss (see lib/Lacuna/DB/Result/News.pm feed_url). +my $public_root = '/home/lacuna/server/var/www/public'; + my $config = Lacuna->config; my $db = Lacuna->db; -my $s3 = Net::Amazon::S3->new( - aws_access_key_id => $config->get('access_key'), - aws_secret_access_key => $config->get('secret_key'), - retry => 1, - ); -my $bucket = $s3->bucket($config->get('feeds/bucket')); my $news_domain = $db->resultset('Lacuna::DB::Result::News'); foreach my $x (int($config->get('map_size/x')->[0]/250) .. int($config->get('map_size/x')->[1]/250)) { foreach my $y (int($config->get('map_size/y')->[0]/250) .. int($config->get('map_size/y')->[1]/250)) { @@ -39,18 +37,15 @@ foreach my $x (int($config->get('map_size/x')->[0]/250) .. int($config->get('map $item->title(encode("UTF-8",$story->headline)); $item->pubDate($story->date_posted); } - say "Uploading..."; - $bucket->add_key( - Lacuna::DB::Result::News->feed_filename($zone), - $feed->to_string, - { - 'Content-Type' => 'application/rss+xml', - acl_short => 'public-read', - } - ); + my $filename = Lacuna::DB::Result::News->feed_filename($zone); + my $path = $public_root.'/'.$filename; + (my $dir = $path) =~ s{/[^/]+$}{}; + make_path($dir); + say "Writing $path"; + open my $fh, '>', $path or die "Can't write $path: $!"; + print $fh $feed->to_string; + close $fh; } } say "Finished!"; - - diff --git a/bin/generate_stars_csv.pl b/bin/generate_stars_csv.pl index 4ede84ad..23895d26 100644 --- a/bin/generate_stars_csv.pl +++ b/bin/generate_stars_csv.pl @@ -3,8 +3,10 @@ use lib '/home/lacuna/server/lib'; use Lacuna::DB; use Lacuna; use DateTime; -use Net::Amazon::S3; use Text::CSV_XS; + +my $public_root = '/home/lacuna/server/var/www/public'; + my $out; my $csv = Text::CSV_XS->new({binary => 1}); $csv->combine(qw(id name x y color zone)); @@ -21,19 +23,9 @@ while (my $star = $stars->next) { } } -my $config = Lacuna->config; -my $s3 = Net::Amazon::S3->new( - aws_access_key_id => $config->get('access_key'), - aws_secret_access_key => $config->get('secret_key'), - retry => 1, - ); -my $bucket = $s3->bucket($config->get('feeds/bucket')); -$bucket->add_key( - 'stars.csv', - $out, - { - 'Content-Type' => 'text/csv', - acl_short => 'public-read', - } -); - +my $filename = 'stars.csv'; +my $path = $public_root.'/'.$filename; +say "Writing $path"; +open my $fh, '>', $path or die "Can't write $path: $!"; +print $fh $out; +close $fh; diff --git a/bin/init_sched.sh b/bin/init_sched.sh deleted file mode 100644 index d251a2b2..00000000 --- a/bin/init_sched.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -# Legacy bare-metal launcher for the scheduler daemons (--daemonize). Under -# compose these run via bin/run_scheduler.sh instead. App::Daemon writes to -# $App::Daemon::logfile (set in each schedule_*.pl) but won't create the dir. -mkdir -p "${LACUNA_LOG_DIR:-/home/lacuna/server/log}/scheduler" - -/data/apps/bin/perl /home/lacuna/server/bin/schedule_building.pl --noquiet --daemonize --initialize -/data/apps/bin/perl /home/lacuna/server/bin/schedule_ship_arrival.pl --noquiet --daemonize --initialize diff --git a/bin/lacuna.logrotate b/bin/lacuna.logrotate deleted file mode 100644 index 0e47136d..00000000 --- a/bin/lacuna.logrotate +++ /dev/null @@ -1,34 +0,0 @@ -# logrotate configuration for The Lacuna Expanse server. -# -# Consumed by the logrotate sidecar defined in docker/docker-compose.homelab.yml, -# which bind-mounts host ./log at /home/lacuna/server/log and this file at -# /etc/logrotate.d/lacuna. (It can equally be installed as /etc/logrotate.d/lacuna -# on a bare-metal host.) The paths below are the in-container log tree, which is -# also the host ./log tree via the bind mount. -# -# Every producer now writes into this tree: -# server/ - the plack app (Log4perl FILE appender) + plackup framework noise -# scheduler/ - schedule_{building,ship_arrival,captcha}.pl (via bin/run_scheduler.sh) -# cron/ - the ofelia-driven bin/run_*.sh batch scripts -# deploy/ - bin/deploy.pl -# nginx/ - nginx access.log + error.log -# -# copytruncate: plackup, the scheduler daemons and nginx hold their log handles -# open and have no cross-container reopen signal; truncating in place on the -# shared bind mount needs none. - -/home/lacuna/server/log/server/*.log -/home/lacuna/server/log/scheduler/*.log -/home/lacuna/server/log/cron/*.log -/home/lacuna/server/log/deploy/*.log -/home/lacuna/server/log/nginx/*.log -{ - daily - rotate 14 - missingok - notifempty - compress - delaycompress - copytruncate - sharedscripts -} diff --git a/bin/mission_check.pl b/bin/mission_check.pl index c1119577..80113d9a 100644 --- a/bin/mission_check.pl +++ b/bin/mission_check.pl @@ -6,7 +6,6 @@ use Lacuna; use Lacuna::Util qw(format_date); use Getopt::Long; use JSON; -use SOAP::Amazon::S3; use Lacuna::Constants qw(SHIP_TYPES ORE_TYPES); use utf8; diff --git a/bin/restart_starman.sh b/bin/restart_starman.sh deleted file mode 100755 index 7eb4b1e2..00000000 --- a/bin/restart_starman.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -export PATH=/data/apps/bin:$PATH -cd /home/lacuna/server/bin -perl generate_docs.pl > /dev/null -killall -HUP start_server diff --git a/bin/run_daily.sh b/bin/run_daily.sh index 57eed565..b9a4c706 100755 --- a/bin/run_daily.sh +++ b/bin/run_daily.sh @@ -1,5 +1,4 @@ #!/bin/bash -export PATH=/data/apps/bin:$PATH cd /home/lacuna/server/bin LOG_DIR="${LACUNA_LOG_DIR:-/home/lacuna/server/log}/cron" diff --git a/bin/run_four_hourly.sh b/bin/run_four_hourly.sh index 7a4b9d7f..c3784d0a 100755 --- a/bin/run_four_hourly.sh +++ b/bin/run_four_hourly.sh @@ -1,5 +1,4 @@ #!/bin/bash -export PATH=/data/apps/bin:$PATH cd /home/lacuna/server/bin LOG_DIR="${LACUNA_LOG_DIR:-/home/lacuna/server/log}/cron" diff --git a/bin/run_hourly.sh b/bin/run_hourly.sh index 13374cc9..fd6a5f32 100755 --- a/bin/run_hourly.sh +++ b/bin/run_hourly.sh @@ -1,5 +1,4 @@ #!/bin/bash -export PATH=/data/apps/bin:$PATH cd /home/lacuna/server/bin # Batch output goes to the shared log tree (host log/cron/). Several targets here, diff --git a/bin/run_two_hourly.sh b/bin/run_two_hourly.sh index 9daf9c12..ee009e45 100755 --- a/bin/run_two_hourly.sh +++ b/bin/run_two_hourly.sh @@ -1,5 +1,4 @@ #!/bin/bash -export PATH=/data/apps/bin:$PATH cd /home/lacuna/server/bin LOG_DIR="${LACUNA_LOG_DIR:-/home/lacuna/server/log}/cron" diff --git a/bin/run_weekly.sh b/bin/run_weekly.sh index e82992fb..9615c6ab 100755 --- a/bin/run_weekly.sh +++ b/bin/run_weekly.sh @@ -1,5 +1,4 @@ #!/bin/bash -export PATH=/data/apps/bin:$PATH cd /home/lacuna/server/bin LOG_DIR="${LACUNA_LOG_DIR:-/home/lacuna/server/log}/cron" diff --git a/bin/setup/install-pm.sh b/bin/setup/install-pm.sh deleted file mode 100755 index 3ebf6257..00000000 --- a/bin/setup/install-pm.sh +++ /dev/null @@ -1,43 +0,0 @@ -cpanm AnyEvent Email::Valid Text::CSV_XS Log::Log4perl UUID::Tiny DateTime::Format::MySQL DBIx::Class::TimeStamp -cpanm JSON::XS JSON Config::JSON Starman JSON::RPC::Dispatcher Log::Any::Adapter Log::Any::Adapter::Log4perl String::Random -cpanm List::Util::WeightedChoice List::Util List::MoreUtils DateTime Regexp::Common Pod::Simple::HTML File::Copy -cpanm DateTime::Format::Duration XML::FeedPP SOAP::Amazon::S3 DBD::mysql DBIx::Class JSON::Any DBIx::Class::InflateColumn::Serializer -cpanm DBIx::Class::DynamicSubclass Memcached::libmemcached Server::Starter IO::Socket::SSL Net::Server::SS::PreFork -cpanm Email::Stuff File::Path namespace::autoclean Clone Plack::Middleware::CrossOrigin Net::Amazon::S3 -cpanm Path::Class Git::Wrapper Guard Digest::MD5 Digest::HMAC_SHA1 XML::Hash::LX Tie::IxHash LWP::UserAgent XML::Parser -cpanm SOAP::Lite URI::Encode XML::Hash::LX - -cpanm List::Util::WeightedChoice -cpanm Module::Find -cpanm Moose -cpanm DBIx::Class::Schema -cpanm DateTime -cpanm DateTime::Format::Duration -cpanm DateTime::Format::Strptime -cpanm namespace::autoclean -cpanm DBIx::Class::TimeStamp -cpanm DBIx::Class::InflateColumn::Serializer -cpanm DBIx::Class::DynamicSubclass -cpanm Email::Stuff -cpanm Email::Valid -cpanm UUID::Tiny -cpanm Config::YAML -cpanm Config::JSON -cpanm LWP::UserAgent -cpanm Regexp::Common -cpanm Beanstalk::Client -cpanm Memcached::libmemcached -cpanm JSON::RPC::Dispatcher::App -cpanm String::Random -cpanm Text::CSV_XS -cpanm JSON::WebToken -cpanm Guard -cpanm URI::Encode -cpanm XML::Hash::LX -cpanm Tie::IxHash -cpanm DBD::mysql -cpanm Log::Log4perl -cpanm Log::Any::Adapter -cpanm Log::Any::Adapter::Log4perl -cpanm Plack::Middleware::CrossOrigin - diff --git a/bin/setup/server/build.sh b/bin/setup/server/build.sh deleted file mode 100755 index df533ec1..00000000 --- a/bin/setup/server/build.sh +++ /dev/null @@ -1,47 +0,0 @@ -. dataapps.sh - -cp dataapps.sh /etc/profile.d/ - -yum -y install ncurses-devel gcc make glibc-devel gcc-c++ zlib-devel openssl-devel java sendmail expat expat-devel -service sendmail start -rpm -ivh *.rpm - -cd libxml2-2.7.7 -./configure --prefix=/data/apps -make -make install -cd .. - -cd pcre-8.33 -./configure --prefix=/data/apps -make -make install -cd .. - -cd nginx-0.7.67 -./configure --prefix=/data/apps --with-pcre=../pcre-8.33 --with-http_ssl_module --with-openssl=../openssl-1.0.0c -make -make install -cd .. - -cd perl-5.12.1 -./Configure -Dprefix=/data/apps -des -make -make install -cd .. - -cd libevent-1.4.14b-stable -./configure --prefix=/data/apps -make -make install -cd .. - -cd memcached-1.4.5 -./configure --prefix=/data/apps -make -make install -cd .. - -cpan App::cpanminus - - diff --git a/bin/setup/server/dataapps.sh b/bin/setup/server/dataapps.sh deleted file mode 100755 index d0a2d04e..00000000 --- a/bin/setup/server/dataapps.sh +++ /dev/null @@ -1,4 +0,0 @@ -export PATH=/data/apps/bin:/data/apps/sbin:$PATH -export LD_LIBRARY_PATH=/data/apps/lib:$LD_LIBRARY_PATH -export ANY_MOOSE=Moose - diff --git a/bin/setup/server/download.sh b/bin/setup/server/download.sh deleted file mode 100755 index be2d5450..00000000 --- a/bin/setup/server/download.sh +++ /dev/null @@ -1,26 +0,0 @@ -wget http://www.cpan.org/src/5.0/perl-5.12.1.tar.gz -tar xfz perl-5.12.1.tar.gz - -wget http://www.monkey.org/~provos/libevent-1.4.14b-stable.tar.gz -tar xfz libevent-1.4.14b-stable.tar.gz - -wget http://memcached.googlecode.com/files/memcached-1.4.5.tar.gz -tar xfz memcached-1.4.5.tar.gz - -wget http://www.percona.com/redir/downloads/Percona-Server-5.1/Percona-Server-5.1.54-12.5/RPM/rhel5/x86_64/Percona-Server-shared-51-5.1.54-rel12.5.188.rhel5.x86_64.rpm -wget http://www.percona.com/redir/downloads/Percona-Server-5.1/Percona-Server-5.1.54-12.5/RPM/rhel5/x86_64/Percona-Server-server-51-5.1.54-rel12.5.188.rhel5.x86_64.rpm -wget http://www.percona.com/redir/downloads/Percona-Server-5.1/Percona-Server-5.1.54-12.5/RPM/rhel5/x86_64/Percona-Server-devel-51-5.1.54-rel12.5.188.rhel5.x86_64.rpm -wget http://www.percona.com/redir/downloads/Percona-Server-5.1/Percona-Server-5.1.54-12.5/RPM/rhel5/x86_64/Percona-Server-client-51-5.1.54-rel12.5.188.rhel5.x86_64.rpm -wget http://www.percona.com/redir/downloads/XtraBackup/XtraBackup-1.4/RPM/rhel5/x86_64/xtrabackup-1.4-74.rhel5.x86_64.rpm - -wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.33.tar.gz -tar xfz pcre-8.33.tar.gz - -wget http://openssl.org/source/openssl-1.0.0c.tar.gz -tar xfz openssl-1.0.0c.tar.gz - -wget http://nginx.org/download/nginx-0.7.67.tar.gz -tar xfz nginx-0.7.67.tar.gz - -wget ftp://anonymous@xmlsoft.org/libxml2/libxml2-sources-2.7.7.tar.gz -tar xfz libxml2-sources-2.7.7.tar.gz diff --git a/bin/start_all.sh b/bin/start_all.sh deleted file mode 100755 index ca511648..00000000 --- a/bin/start_all.sh +++ /dev/null @@ -1,5 +0,0 @@ -perl generate_docs.pl > /dev/null -./start_memcached.sh -./start_lacuna.sh -./start_deploy.sh - diff --git a/bin/start_beanstalk.sh b/bin/start_beanstalk.sh deleted file mode 100755 index f9083566..00000000 --- a/bin/start_beanstalk.sh +++ /dev/null @@ -1 +0,0 @@ -beanstalkd >/tmp/beanstalk 2>/tmp/beanstalk < /dev/null & disown diff --git a/bin/start_deploy.sh b/bin/start_deploy.sh deleted file mode 100755 index ea121998..00000000 --- a/bin/start_deploy.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -export PATH=/data/apps/bin:$PATH -cd /home/lacuna/server/bin -start_server --port 5001 -- starman --workers 1 --user nobody --group nobody --preload-app deploy.psgi & - diff --git a/bin/start_lacuna.sh b/bin/start_lacuna.sh index 92dda91b..abe2b8cc 100755 --- a/bin/start_lacuna.sh +++ b/bin/start_lacuna.sh @@ -1,5 +1,14 @@ #!/bin/bash -export PATH=/data/apps/bin:$PATH -cd /home/lacuna/server/bin -start_server --port 80 -- starman --workers 7 --user nobody --group nobody --preload-app lacuna.psgi & +# +# Production launcher: Server::Starter + Starman in the foreground so the +# container lifecycle tracks the app. Dependency binaries come from the +# Carton-managed ./local/bin, already on PATH via the Dockerfile ENV. +# + +set -e + +cd /home/lacuna/server/bin +mkdir -p /home/lacuna/server/var/www/public/api +perl generate_docs.pl > /dev/null +exec start_server --port 5000 -- starman --workers 7 --preload-app lacuna.psgi diff --git a/bin/start_memcached.sh b/bin/start_memcached.sh deleted file mode 100755 index 4455b04f..00000000 --- a/bin/start_memcached.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -export PATH=/data/apps/bin:$PATH -cd /home/lacuna/server/bin -memcached -d -u nobody -m 1024 - diff --git a/bin/start_pt.sh b/bin/start_pt.sh deleted file mode 100755 index 4801088c..00000000 --- a/bin/start_pt.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash -export PATH=/data/apps/bin:$PATH -cd /home/lacuna/server/bin -perl generate_docs.pl > /dev/null -memcached -d -u nobody -m 512 -fuser -k 5000/tcp -fuser -k 5001/tcp - -start_server --port 5000 -- starman --user nobody --group nobody --workers 3 --preload-app lacuna.psgi & -start_server --port 5001 -- starman --workers 1 --user nobody --group nobody --preload-app deploy.psgi & - -service nginx start - diff --git a/bin/startqa.sh b/bin/startqa.sh deleted file mode 100755 index dedd3c80..00000000 --- a/bin/startqa.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash -# -# Start the Lacuna server on the QA box. -# -# This script previously lived in the (now gone) Lacuna-Server-Private repo; -# bin/deploy.pl execs it after pulling a new revision. Reconstructed from -# bin/start_pt.sh, which is the equivalent launcher for the "pt" environment. - -export PATH=/data/apps/bin:$PATH -cd /home/lacuna/server/bin - -perl generate_docs.pl > /dev/null - -memcached -d -u nobody -m 512 - -fuser -k 5000/tcp -fuser -k 5001/tcp - -start_server --port 5000 -- starman --user nobody --group nobody --workers 3 --preload-app lacuna.psgi & -start_server --port 5001 -- starman --workers 1 --user nobody --group nobody --preload-app deploy.psgi & - -service nginx start diff --git a/bin/stop_memcached.sh b/bin/stop_memcached.sh deleted file mode 100755 index e670f860..00000000 --- a/bin/stop_memcached.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -export PATH=/data/apps/bin:$PATH -cd /home/lacuna/server/bin -killall memcached diff --git a/bin/stop_starman.sh b/bin/stop_starman.sh deleted file mode 100755 index c389c982..00000000 --- a/bin/stop_starman.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -export PATH=/data/apps/bin:$PATH -cd /home/lacuna/server/bin -killall start_server diff --git a/bin/summarize_server.pl b/bin/summarize_server.pl index 5371a1e8..a083fcb9 100644 --- a/bin/summarize_server.pl +++ b/bin/summarize_server.pl @@ -164,37 +164,18 @@ sub generate_overview { $out{glyphs}{types}{$glyph->type} = $glyph->quantity; } - my $config = Lacuna->config; - if ($config->get('access_key')) { - require SOAP::Amazon::S3; - - out('Write To S3'); - my $s3 = SOAP::Amazon::S3->new($config->get('access_key'), $config->get('secret_key'), { RaiseError => 1 }); - my $bucket = $s3->bucket($config->get('feeds/bucket')); - # fetch existing overview - my $old_object = $bucket->object('server_overview.json'); - my $old_stats = from_json( $old_object->getdata ); - # add old spies data to new data + my $read; + + if (-e '/home/lacuna/server/var/www/public/server_overview.json') + { + open my $read, '<', '/home/lacuna/server/var/www/public/server_overview.json'; + my $old_stats = from_json(do { local $/; <$read> }); $out{spies} = $old_stats->{spies}; - # save updated data - my $object = $bucket->putobject('server_overview.json', to_json(\%out), { 'Content-Type' => 'application/json' }); - $object->acl('public'); } - else - { - my $read; - - if (-e '/home/lacuna/server/var/www/public/server_overview.json') - { - open my $read, '<', '/home/lacuna/server/var/www/public/server_overview.json'; - my $old_stats = from_json(do { local $/; <$read> }); - $out{spies} = $old_stats->{spies}; - } - open my $fh, '>', '/home/lacuna/server/var/www/public/server_overview.json'; - print $fh to_json(\%out); - close $fh; - } + open my $fh, '>', '/home/lacuna/server/var/www/public/server_overview.json'; + print $fh to_json(\%out); + close $fh; } @@ -533,22 +514,9 @@ sub output_map { } my $json_txt = JSON->new->utf8->encode(\%output); - my $config = Lacuna->config; - if ($config->get('access_key')) { - require SOAP::Amazon::S3; - - out('Write Map To S3'); - my $s3 = SOAP::Amazon::S3->new($config->get('access_key'), $config->get('secret_key'), { RaiseError => 1 }); - my $bucket = $s3->bucket($config->get('feeds/bucket')); - my $object = $bucket->putobject('starmap.json', $json_txt, { 'Content-Type' => 'application/json; charset=utf-8' }); - $object->acl('public'); - } - else - { - open my $fh, '>', '/home/lacuna/server/var/www/public/starmap.json'; - print $fh $json_txt; - close $fh; - } + open my $fh, '>', '/home/lacuna/server/var/www/public/starmap.json'; + print $fh $json_txt; + close $fh; } # UTILITIES diff --git a/bin/summarize_spies.pl b/bin/summarize_spies.pl index 4bfe3f75..a39d3095 100644 --- a/bin/summarize_spies.pl +++ b/bin/summarize_spies.pl @@ -94,43 +94,17 @@ sub generate_overview { }, ); - my $config = Lacuna->config; - if ($config->get('access_key')) { - require SOAP::Amazon::S3; - - out('Write To S3'); - my $s3 = SOAP::Amazon::S3->new($config->get('access_key'), $config->get('secret_key'), { RaiseError => 1 }); - my $bucket = $s3->bucket($config->get('feeds/bucket')); - # fetch existing overview - my $old_object = $bucket->object('server_overview.json'); - my $stats = from_json( $old_object->getdata ); - # replace old spies data with new - $stats->{spies} = $out{spies}; - # save updated data -#XXX -# my $spy_txt = JSON->new->pretty->canonical->utf8->encode($stats); -# open(OUT, ">:utf8:", "spies.json"); -# print OUT $spy_txt; -# close(OUT); -#XXX - my $object = $bucket->putobject('server_overview.json', to_json($stats), { 'Content-Type' => 'application/json' }); - $object->acl('public'); - } - else + my $stats = {}; + if (-e '/home/lacuna/server/var/www/public/server_overview.json') { - my $stats = {}; - if (-e '/home/lacuna/server/var/www/public/server_overview.json') - { - open my $read, '<', '/home/lacuna/server/var/www/public/server_overview.json'; - $stats = from_json(do { local $/; <$read> }); - } - $stats->{spies} = $out{spies}; - - open my $fh, '>', '/home/lacuna/server/var/www/public/server_overview.json'; - print $fh to_json(\%out); - close $fh; - + open my $read, '<', '/home/lacuna/server/var/www/public/server_overview.json'; + $stats = from_json(do { local $/; <$read> }); } + $stats->{spies} = $out{spies}; + + open my $fh, '>', '/home/lacuna/server/var/www/public/server_overview.json'; + print $fh to_json(\%out); + close $fh; } diff --git a/bin/util/push_assets.pl b/bin/util/push_assets.pl deleted file mode 100644 index ea6e9ed0..00000000 --- a/bin/util/push_assets.pl +++ /dev/null @@ -1,107 +0,0 @@ -use strict; -use File::Find; -use 5.010; -use lib '/home/lacuna/server/lib'; -use Lacuna::DB; -use Lacuna; -use DateTime; -use File::Slurp; -use Net::Amazon::S3; -use Getopt::Long; -use DateTime::Format::HTTP; - -$|=1; - -our $quiet; -our $start = '/data/Lacuna-Assets/'; -our @pushes; - -GetOptions( - 'quiet' => \$quiet, - 'start=s' => \$start, - 'push=s' => \@pushes, -); - - -my $config = Lacuna->config; -my $s3 = Net::Amazon::S3->new( - aws_access_key_id => $config->get('access_key'), - aws_secret_access_key => $config->get('secret_key'), - retry => 1, - ); -my $bucket = $s3->bucket('game.lacunaexpanse.com'); - -my %types = ( - png => "image/png", - jpg => "image/jpeg", - gif => "image/png", - css => "text/css", - json => "application/json", - html => "text/html", - txt => "text/plain", - cur => "image/x-win-bitmap", -); - -if (scalar @pushes) { - foreach my $push (@pushes) { - if (-f $push) { - push_file($push); - } - elsif (-d $push) { - push_dir($push); - } - else { - say "Skipping $push"; - } - } - exit; -} - -die 'start must end with a slash' unless ($start =~ m/\/$/); -push_dir($start); - -sub push_dir { - my $path = shift; - find(sub { - push_file($File::Find::name); - }, - $path); -} - -sub push_file { - my ($path) = @_; - $path =~ m/^(.*)\/(.*)$/; - my $dir = $1; - my $name = $2; - $dir =~ m/^$start(.*)$/; - my $sansstart = $1; - if (-f $path && $name !~ m/^\./ && $sansstart !~ m/^\./) { - say $path; - my $assets = 'assets/'.$sansstart; - my $s3path = $assets.'/'.$name; - say $s3path; - my $type = "text/plain"; - if ($name =~ m/\.(.\w+)$/) { - $type = $types{$1}; - } - else { - warn "MIME type not found for ".$path; - } - say $type; - #my $contents = read_file($File::Find::name, binmode => ':raw'); - $bucket->add_key_filename( - $s3path, - $path, - { - 'Content-Type' => $type, - 'Expires' => DateTime::Format::HTTP->format_datetime(DateTime->now->add(years=>5)), - 'Cache-Control' => 'max-age=290304000, public', - acl_short => 'public-read', - } - ) or die $s3->err . ": " . $s3->errstr; - } - else { - warn "Skipping ".$path; - } -} - diff --git a/bin/util/swap_bodies.pl b/bin/util/swap_bodies.pl index 355b0ec3..be1dff7a 100644 --- a/bin/util/swap_bodies.pl +++ b/bin/util/swap_bodies.pl @@ -6,7 +6,6 @@ use Lacuna; use Lacuna::Util qw(format_date); use Getopt::Long; use JSON; -use SOAP::Amazon::S3; use Lacuna::Constants qw(SHIP_TYPES ORE_TYPES); use utf8; diff --git a/cpanfile b/cpanfile index 6e539d6e..034ad6bc 100644 --- a/cpanfile +++ b/cpanfile @@ -111,7 +111,6 @@ requires 'LWP::UserAgent'; requires 'LWP::Protocol::https'; requires 'IO::Socket::IP'; requires 'IO::Socket::SSL'; -requires 'Net::Amazon::S3'; requires 'SOAP::Lite'; # --- Runtime: email --------------------------------------------------------- diff --git a/cpanfile.snapshot b/cpanfile.snapshot index 84ae2a94..5621bfcd 100644 --- a/cpanfile.snapshot +++ b/cpanfile.snapshot @@ -4915,210 +4915,6 @@ DISTRIBUTIONS Test::More 0 Type::Tiny 0 perl 5.022 - Net-Amazon-S3-0.992 - pathname: B/BA/BARNEY/Net-Amazon-S3-0.992.tar.gz - provides: - Net::Amazon::S3 0.992 - Net::Amazon::S3::ACL::Canned 0.992 - Net::Amazon::S3::ACL::Grantee 0.992 - Net::Amazon::S3::ACL::Grantee::Email 0.992 - Net::Amazon::S3::ACL::Grantee::Group 0.992 - Net::Amazon::S3::ACL::Grantee::User 0.992 - Net::Amazon::S3::ACL::Set 0.992 - Net::Amazon::S3::Authorization 0.992 - Net::Amazon::S3::Authorization::Basic 0.992 - Net::Amazon::S3::Authorization::IAM 0.992 - Net::Amazon::S3::Bucket 0.992 - Net::Amazon::S3::Client 0.992 - Net::Amazon::S3::Client::Bucket 0.992 - Net::Amazon::S3::Client::Object 0.992 - Net::Amazon::S3::Client::Object::Range 0.992 - Net::Amazon::S3::Constants 0.992 - Net::Amazon::S3::Constraint::ACL::Canned 0.992 - Net::Amazon::S3::Constraint::Etag 0.992 - Net::Amazon::S3::Error::Handler 0.992 - Net::Amazon::S3::Error::Handler::Confess 0.992 - Net::Amazon::S3::Error::Handler::Legacy 0.992 - Net::Amazon::S3::Error::Handler::Status 0.992 - Net::Amazon::S3::Error::Handler::X 0.992 - Net::Amazon::S3::HTTPRequest 0.992 - Net::Amazon::S3::Operation::Bucket::Acl::Fetch 0.992 - Net::Amazon::S3::Operation::Bucket::Acl::Fetch::Request 0.992 - Net::Amazon::S3::Operation::Bucket::Acl::Fetch::Response 0.992 - Net::Amazon::S3::Operation::Bucket::Acl::Set 0.992 - Net::Amazon::S3::Operation::Bucket::Acl::Set::Request 0.992 - Net::Amazon::S3::Operation::Bucket::Acl::Set::Response 0.992 - Net::Amazon::S3::Operation::Bucket::Create 0.992 - Net::Amazon::S3::Operation::Bucket::Create::Request 0.992 - Net::Amazon::S3::Operation::Bucket::Create::Response 0.992 - Net::Amazon::S3::Operation::Bucket::Delete 0.992 - Net::Amazon::S3::Operation::Bucket::Delete::Request 0.992 - Net::Amazon::S3::Operation::Bucket::Delete::Response 0.992 - Net::Amazon::S3::Operation::Bucket::Location 0.992 - Net::Amazon::S3::Operation::Bucket::Location::Request 0.992 - Net::Amazon::S3::Operation::Bucket::Location::Response 0.992 - Net::Amazon::S3::Operation::Bucket::Tags::Add 0.992 - Net::Amazon::S3::Operation::Bucket::Tags::Add::Request 0.992 - Net::Amazon::S3::Operation::Bucket::Tags::Add::Response 0.992 - Net::Amazon::S3::Operation::Bucket::Tags::Delete 0.992 - Net::Amazon::S3::Operation::Bucket::Tags::Delete::Request 0.992 - Net::Amazon::S3::Operation::Bucket::Tags::Delete::Response 0.992 - Net::Amazon::S3::Operation::Buckets::Delete 0.992 - Net::Amazon::S3::Operation::Buckets::List 0.992 - Net::Amazon::S3::Operation::Buckets::List::Request 0.992 - Net::Amazon::S3::Operation::Buckets::List::Response 0.992 - Net::Amazon::S3::Operation::Object::Acl::Fetch 0.992 - Net::Amazon::S3::Operation::Object::Acl::Fetch::Request 0.992 - Net::Amazon::S3::Operation::Object::Acl::Fetch::Response 0.992 - Net::Amazon::S3::Operation::Object::Acl::Set 0.992 - Net::Amazon::S3::Operation::Object::Acl::Set::Request 0.992 - Net::Amazon::S3::Operation::Object::Acl::Set::Response 0.992 - Net::Amazon::S3::Operation::Object::Add 0.992 - Net::Amazon::S3::Operation::Object::Add::Request 0.992 - Net::Amazon::S3::Operation::Object::Add::Response 0.992 - Net::Amazon::S3::Operation::Object::Delete 0.992 - Net::Amazon::S3::Operation::Object::Delete::Request 0.992 - Net::Amazon::S3::Operation::Object::Delete::Response 0.992 - Net::Amazon::S3::Operation::Object::Fetch 0.992 - Net::Amazon::S3::Operation::Object::Fetch::Request 0.992 - Net::Amazon::S3::Operation::Object::Fetch::Response 0.992 - Net::Amazon::S3::Operation::Object::Head 0.992 - Net::Amazon::S3::Operation::Object::Head::Request 0.992 - Net::Amazon::S3::Operation::Object::Head::Response 0.992 - Net::Amazon::S3::Operation::Object::Part 0.992 - Net::Amazon::S3::Operation::Object::Parts::Complete 0.992 - Net::Amazon::S3::Operation::Object::Restore 0.992 - Net::Amazon::S3::Operation::Object::Restore::Request 0.992 - Net::Amazon::S3::Operation::Object::Restore::Response 0.992 - Net::Amazon::S3::Operation::Object::Tags::Add 0.992 - Net::Amazon::S3::Operation::Object::Tags::Add::Request 0.992 - Net::Amazon::S3::Operation::Object::Tags::Add::Response 0.992 - Net::Amazon::S3::Operation::Object::Tags::Delete 0.992 - Net::Amazon::S3::Operation::Object::Tags::Delete::Request 0.992 - Net::Amazon::S3::Operation::Object::Tags::Delete::Response 0.992 - Net::Amazon::S3::Operation::Object::Upload::Abort 0.992 - Net::Amazon::S3::Operation::Object::Upload::Abort::Request 0.992 - Net::Amazon::S3::Operation::Object::Upload::Abort::Response 0.992 - Net::Amazon::S3::Operation::Object::Upload::Complete 0.992 - Net::Amazon::S3::Operation::Object::Upload::Complete::Request 0.992 - Net::Amazon::S3::Operation::Object::Upload::Complete::Response 0.992 - Net::Amazon::S3::Operation::Object::Upload::Create 0.992 - Net::Amazon::S3::Operation::Object::Upload::Create::Request 0.992 - Net::Amazon::S3::Operation::Object::Upload::Create::Response 0.992 - Net::Amazon::S3::Operation::Object::Upload::Part::Request 0.992 - Net::Amazon::S3::Operation::Object::Upload::Part::Response 0.992 - Net::Amazon::S3::Operation::Object::Upload::Parts::Request 0.992 - Net::Amazon::S3::Operation::Object::Upload::Parts::Response 0.992 - Net::Amazon::S3::Operation::Objects::Delete::Request 0.992 - Net::Amazon::S3::Operation::Objects::Delete::Response 0.992 - Net::Amazon::S3::Operation::Objects::List::Request 0.992 - Net::Amazon::S3::Operation::Objects::List::Response 0.992 - Net::Amazon::S3::Request 0.992 - Net::Amazon::S3::Request::Bucket 0.992 - Net::Amazon::S3::Request::Object 0.992 - Net::Amazon::S3::Request::Role::HTTP::Header 0.992 - Net::Amazon::S3::Request::Role::HTTP::Header::ACL 0.992 - Net::Amazon::S3::Request::Role::HTTP::Header::Content_length 0.992 - Net::Amazon::S3::Request::Role::HTTP::Header::Content_md5 0.992 - Net::Amazon::S3::Request::Role::HTTP::Header::Content_type 0.992 - Net::Amazon::S3::Request::Role::HTTP::Header::Copy_source 0.992 - Net::Amazon::S3::Request::Role::HTTP::Header::Encryption 0.992 - Net::Amazon::S3::Request::Role::HTTP::Method 0.992 - Net::Amazon::S3::Request::Role::HTTP::Method::DELETE 0.992 - Net::Amazon::S3::Request::Role::HTTP::Method::GET 0.992 - Net::Amazon::S3::Request::Role::HTTP::Method::HEAD 0.992 - Net::Amazon::S3::Request::Role::HTTP::Method::POST 0.992 - Net::Amazon::S3::Request::Role::HTTP::Method::PUT 0.992 - Net::Amazon::S3::Request::Role::Query::Action 0.992 - Net::Amazon::S3::Request::Role::Query::Action::Acl 0.992 - Net::Amazon::S3::Request::Role::Query::Action::Delete 0.992 - Net::Amazon::S3::Request::Role::Query::Action::Location 0.992 - Net::Amazon::S3::Request::Role::Query::Action::Restore 0.992 - Net::Amazon::S3::Request::Role::Query::Action::Tagging 0.992 - Net::Amazon::S3::Request::Role::Query::Action::Uploads 0.992 - Net::Amazon::S3::Request::Role::Query::Param 0.992 - Net::Amazon::S3::Request::Role::Query::Param::Delimiter 0.992 - Net::Amazon::S3::Request::Role::Query::Param::Marker 0.992 - Net::Amazon::S3::Request::Role::Query::Param::Max_keys 0.992 - Net::Amazon::S3::Request::Role::Query::Param::Part_number 0.992 - Net::Amazon::S3::Request::Role::Query::Param::Prefix 0.992 - Net::Amazon::S3::Request::Role::Query::Param::Upload_id 0.992 - Net::Amazon::S3::Request::Role::Query::Param::Version_id 0.992 - Net::Amazon::S3::Request::Role::Tags::Add 0.992 - Net::Amazon::S3::Request::Role::XML::Content 0.992 - Net::Amazon::S3::Request::Service 0.992 - Net::Amazon::S3::Response 0.992 - Net::Amazon::S3::Role::ACL 0.992 - Net::Amazon::S3::Role::Bucket 0.992 - Net::Amazon::S3::Signature 0.992 - Net::Amazon::S3::Signature::V2 0.992 - Net::Amazon::S3::Signature::V4 0.992 - Net::Amazon::S3::Signature::V4Implementation 0.992 - Net::Amazon::S3::Utils 0.992 - Net::Amazon::S3::Vendor 0.992 - Net::Amazon::S3::Vendor::Amazon 0.992 - Net::Amazon::S3::Vendor::Generic 0.992 - Net::Amazon::S3::X 0.992 - Shared::Examples::Net::Amazon::S3 0.992 - Shared::Examples::Net::Amazon::S3::API 0.992 - Shared::Examples::Net::Amazon::S3::Client 0.992 - Shared::Examples::Net::Amazon::S3::Fixture 0.992 - Shared::Examples::Net::Amazon::S3::Request 0.992 - requirements: - Carp 0 - Data::Stream::Bulk::Callback 0 - DateTime::Format::HTTP 0 - Digest::HMAC_SHA1 0 - Digest::MD5 0 - Digest::MD5::File 0 - Digest::SHA 0 - Exporter::Tiny 0 - ExtUtils::MakeMaker 0 - File::Find::Rule 0 - File::stat 0 - Getopt::Long 0 - HTTP::Date 0 - HTTP::Response 0 - HTTP::Status 0 - Hash::Util 0 - IO::File 1.14 - LWP 6.03 - LWP::UserAgent::Determined 0 - MIME::Base64 0 - MIME::Types 0 - Moose 0.85 - Moose::Meta::Class 0 - Moose::Object 0 - Moose::Role 0 - Moose::Util 0 - Moose::Util::TypeConstraints 0 - MooseX::Role::Parameterized 0 - MooseX::StrictConstructor 0.16 - MooseX::Types::DateTime::MoreCoercions 0.07 - Path::Class 0 - Pod::Usage 0 - Ref::Util 0 - Regexp::Common 0 - Safe::Isa 0 - Scalar::Util 0 - Sub::Override 0 - Term::Encoding 0 - Term::ProgressBar::Simple 0 - Test::Deep v0.111.0 - Test::LWP::UserAgent 0 - Test::More 0 - Time::Piece 0 - URI 0 - URI::Escape 0 - URI::QueryParam 0 - XML::LibXML 0 - XML::LibXML::XPathContext 0 - constant 0 - namespace::clean 0 - parent 0 - perl 5.016 - strict 0 - warnings 0 Net-DNS-1.56 pathname: N/NL/NLNETLABS/Net-DNS-1.56.tar.gz provides: diff --git a/docker/server/Dockerfile b/docker/server/Dockerfile index 2ac4588b..58a5761e 100644 --- a/docker/server/Dockerfile +++ b/docker/server/Dockerfile @@ -70,7 +70,6 @@ ENV PATH="/home/lacuna/server/local/bin:${PATH}" \ # which redirects LACUNA_LOG_DIR elsewhere). RUN mkdir -p /home/lacuna/server/log/server \ /home/lacuna/server/log/scheduler \ - /home/lacuna/server/log/cron \ - /home/lacuna/server/log/deploy + /home/lacuna/server/log/cron WORKDIR /home/lacuna/server/bin diff --git a/docker/server/docker-compose.yml b/docker/server/docker-compose.yml index 9d82880b..bbf33a00 100644 --- a/docker/server/docker-compose.yml +++ b/docker/server/docker-compose.yml @@ -33,6 +33,9 @@ services: - ./../../t:/home/lacuna/server/t - ./../../var:/home/lacuna/server/var - ./../../var/www/public/api/api.css:/home/lacuna/server/var/www/public/api/api.css + # Read-only: the app serves asset URLs via nginx, but t/370_Medals.t checks + # the medal PNGs exist on disk. + - ./../../assets:/home/lacuna/server/var/www/public/assets:ro - ./../../missions:/home/lacuna/server/missions - ./../../tmp:/tmp - ./../../log:/home/lacuna/server/log diff --git a/docker/server/etc-dev/lacuna.conf b/docker/server/etc-dev/lacuna.conf index cbb1dce2..20d9f332 100644 --- a/docker/server/etc-dev/lacuna.conf +++ b/docker/server/etc-dev/lacuna.conf @@ -2,10 +2,6 @@ { "develop_mode" : 0, - # Amazon S3 details - # "access_key" : "XXXX", - # "secret_key" : "XXXX", - "bhg_param" : { # If any are set to 0, use default. "success" : 0, @@ -41,9 +37,7 @@ }, "essentia_code_server_url" : "", "feeds" : { - "bucket" : "XXXX", - "surl" : "https://xxxx/", - "url" : "http://xxxx/" + "url" : "https://lacuna.allosaurus-chromatic.ts.net/" }, "itransact" : { "APIKey" : "XXXX", diff --git a/docker/server/etc-homelab/lacuna.conf b/docker/server/etc-homelab/lacuna.conf index cbb1dce2..20d9f332 100644 --- a/docker/server/etc-homelab/lacuna.conf +++ b/docker/server/etc-homelab/lacuna.conf @@ -2,10 +2,6 @@ { "develop_mode" : 0, - # Amazon S3 details - # "access_key" : "XXXX", - # "secret_key" : "XXXX", - "bhg_param" : { # If any are set to 0, use default. "success" : 0, @@ -41,9 +37,7 @@ }, "essentia_code_server_url" : "", "feeds" : { - "bucket" : "XXXX", - "surl" : "https://xxxx/", - "url" : "http://xxxx/" + "url" : "https://lacuna.allosaurus-chromatic.ts.net/" }, "itransact" : { "APIKey" : "XXXX", diff --git a/docker/server/etc-test/lacuna.conf b/docker/server/etc-test/lacuna.conf index cbb1dce2..20d9f332 100644 --- a/docker/server/etc-test/lacuna.conf +++ b/docker/server/etc-test/lacuna.conf @@ -2,10 +2,6 @@ { "develop_mode" : 0, - # Amazon S3 details - # "access_key" : "XXXX", - # "secret_key" : "XXXX", - "bhg_param" : { # If any are set to 0, use default. "success" : 0, @@ -41,9 +37,7 @@ }, "essentia_code_server_url" : "", "feeds" : { - "bucket" : "XXXX", - "surl" : "https://xxxx/", - "url" : "http://xxxx/" + "url" : "https://lacuna.allosaurus-chromatic.ts.net/" }, "itransact" : { "APIKey" : "XXXX", diff --git a/lib/Lacuna/DB/Result/Mission.pm b/lib/Lacuna/DB/Result/Mission.pm index f24d9a65..d373e542 100644 --- a/lib/Lacuna/DB/Result/Mission.pm +++ b/lib/Lacuna/DB/Result/Mission.pm @@ -555,7 +555,7 @@ sub feed_url { sub feed_filename { my ($class, $zone) = @_; - return 'missioncommand/'.create_uuid_as_string(UUID_MD5, $zone.Lacuna->config->get('feeds/bucket')).'.rss'; + return 'missioncommand/'.create_uuid_as_string(UUID_MD5, $zone.'missioncommand').'.rss'; } sub initialize { diff --git a/lib/Lacuna/DB/Result/News.pm b/lib/Lacuna/DB/Result/News.pm index ec36ef8c..220a97b3 100644 --- a/lib/Lacuna/DB/Result/News.pm +++ b/lib/Lacuna/DB/Result/News.pm @@ -33,7 +33,7 @@ sub feed_url { sub feed_filename { my ($class, $zone) = @_; - return 'network19/'.create_uuid_as_string(UUID_MD5, $zone.Lacuna->config->get('feeds/bucket')).'.rss'; + return 'network19/'.create_uuid_as_string(UUID_MD5, $zone.'network19').'.rss'; } no Moose; diff --git a/lib/Lacuna/Web.pm b/lib/Lacuna/Web.pm index 79c63c82..61542d09 100644 --- a/lib/Lacuna/Web.pm +++ b/lib/Lacuna/Web.pm @@ -105,7 +105,7 @@ sub wrapper { } close $file; if ($options->{logo}) { - $content = ''.$content; + $content = ''.$content; } return [ sprintf($html, ($options->{title} || 'The Lacuna Expanse'), $options->{head_tags}, $content), { status => $options->{status} } ]; } diff --git a/t/370_Medals.t b/t/370_Medals.t index 9e845fed..a7258e4d 100644 --- a/t/370_Medals.t +++ b/t/370_Medals.t @@ -12,7 +12,7 @@ use TestHelper; my @medals = keys %{Lacuna::DB::Result::Medals::MEDALS()}; plan tests => scalar @medals; -my $assets = '/data/Lacuna-Assets/medal/'; +my $assets = '/home/lacuna/server/var/www/public/assets/medal/'; opendir(my $dir, $assets); my @images = readdir $dir; diff --git a/var/wrapper.html b/var/wrapper.html index a0628de5..5e587d0f 100644 --- a/var/wrapper.html +++ b/var/wrapper.html @@ -52,7 +52,7 @@ color: #ff0000; } A.server_button { - background-image: url(https://s3.amazonaws.com/www.lacunaexpanse.com/button_bkg.png); + background-color: #ffb400; text-decoration: none; display: block; border: 1px solid black; -- 2.51.2