このツールで作成後、LOCAL_DOMAIN, SMTP_* などをエディタで追加する。
perl << 'EOS'
use strict;
use feature 'say';
sub appendenv {
open(my $fh,'>>','.env.production') || die $!;
print $fh $_[0];
}
appendenv('');
{
my @secrets=();
foreach(1..3) {
my $secret=`docker-compose run --rm web bundle exec rake secret`;
chomp $secret;
push @secrets,$secret;
}
my $buf.="SECRET_KEY_BASE=$secrets[0]\n";
$buf.="OTP_SECRET=$secrets[1]\n";
$buf.="PAPERCLIP_SECRET=$secrets[2]\n";
appendenv($buf);
}
appendenv(`docker-compose run --rm web bundle exec rake mastodon:webpush:generate_vapid_key`);
EOS