Skip to content

Instantly share code, notes, and snippets.

@mamemomonga
Created June 28, 2020 21:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mamemomonga/35d1438e9b2de01daacdcd4940f4dfd1 to your computer and use it in GitHub Desktop.
Save mamemomonga/35d1438e9b2de01daacdcd4940f4dfd1 to your computer and use it in GitHub Desktop.
Docker版Mastodonで、初期の.env.productionを作るツール

Docker版Mastodonで、初期の.env.productionを作るツール

このツールで作成後、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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment