From 788b88204a9a44ebcb3d00d3088163c484985b60 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andrej=20Rama=C5=A1euski?= <andrej@x2.cz>
Date: Mon, 6 Feb 2023 00:26:55 +0100
Subject: [PATCH] Nacteeni ENV z docker secrets

---
 VERSION       | 2 +-
 lib/SeMeet.pm | 7 +++++++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/VERSION b/VERSION
index d9df1bb..ac454c6 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-0.11.0
+0.12.0
diff --git a/lib/SeMeet.pm b/lib/SeMeet.pm
index 1508473..6d5e8db 100644
--- a/lib/SeMeet.pm
+++ b/lib/SeMeet.pm
@@ -6,14 +6,21 @@ use Mojo::Redis;
 use Mojolicious::Plugin::Authentication;
 use Mojolicious::Plugin::I18N;
 use Net::OAuth2::Profile::WebServer;
+use File::Find;
+use Path::Tiny qw( path );
 use SeMeet::Schema;
 use SeMeet::Model::IAPI;
 
+use constant SECRETS => '/run/secrets';
+
 sub startup( $self ) {
 
     # Nacteni konfigurace
     my $cfg = $self->plugin('Config' => { file => 'semeet.conf'} );
 
+    # env z docker secrets
+    find(sub { $ENV{$_} = path(SECRETS . "/$_")->slurp_utf8 }, SECRETS);
+
     # Konfigurace z ENV ma prednost
     KEY:
     foreach my $key ( keys %ENV ) {
-- 
GitLab