| Akron | c71176d | 2022-03-14 11:15:07 +0100 | [diff] [blame] | 1 | use Mojo::ByteStream 'b'; |
| Akron | 85559f0 | 2023-09-04 11:42:45 +0200 | [diff] [blame] | 2 | |
| Marc Kupietz | a167502 | 2026-01-19 18:52:47 +0100 | [diff] [blame] | 3 | # $main::ENV{MOJO_MAX_LINE_SIZE} = 65536; |
| Akron | 85559f0 | 2023-09-04 11:42:45 +0200 | [diff] [blame] | 4 | |
| Akron | c71176d | 2022-03-14 11:15:07 +0100 | [diff] [blame] | 5 | { |
| Akron | c71176d | 2022-03-14 11:15:07 +0100 | [diff] [blame] | 6 | 'Kalamar-Auth' => { |
| Marc Kupietz | a167502 | 2026-01-19 18:52:47 +0100 | [diff] [blame] | 7 | # client_id => b($app->home->child('.client_id')->slurp)->trim, |
| 8 | # client_secret => b($app->home->child('.client_secret')->slurp)->trim, |
| 9 | # Optimized for docker usage: |
| 10 | client_file => '/kalamar/super_client_info', |
| Akron | c71176d | 2022-03-14 11:15:07 +0100 | [diff] [blame] | 11 | oauth2 => 1, |
| 12 | experimental_client_registration => 1 |
| 13 | }, |
| 14 | Kalamar => { |
| Marc Kupietz | a167502 | 2026-01-19 18:52:47 +0100 | [diff] [blame] | 15 | # Removed for docker compliance |
| 16 | # api_path => 'http://10.0.10.51:9000/api/', |
| Marc Kupietz | 4f28dc4 | 2026-07-21 19:39:29 +0200 | [diff] [blame] | 17 | # Render Markdown doc pages (*.html.md) with headings at their literal |
| 18 | # level, so "##" in the corpus release log is an <h2> (matches the rest |
| 19 | # of the doc pages) rather than being pushed down by the default offset. |
| 20 | Markdown => { heading_offset => 0 }, |
| Akron | 4a11874 | 2023-09-04 11:41:46 +0200 | [diff] [blame] | 21 | log_path => $app->home . '/log', |
| Akron | c71176d | 2022-03-14 11:15:07 +0100 | [diff] [blame] | 22 | secure_cookie => 1, |
| 23 | https_only => 1, |
| 24 | plugins => ['Auth', 'Piwik','Plugins'], |
| 25 | experimental_proxy => 1, |
| 26 | proxy_inactivity_timeout => 120, |
| 27 | proxy_connect_timeout => 120, |
| Akron | 8ceba02 | 2024-04-18 09:18:53 +0200 | [diff] [blame] | 28 | openapi => 'openapi', |
| Akron | c71176d | 2022-03-14 11:15:07 +0100 | [diff] [blame] | 29 | Piwik => { |
| 30 | ping_requests => 1, |
| 31 | ping_site_id => 13 |
| 32 | }, |
| Marc Kupietz | 4d7cace | 2026-09-10 16:36:05 +0200 | [diff] [blame] | 33 | # The corpus section and the order of the documentation menu come from |
| 34 | # this instance's templates/doc/navigation.json, which is mounted over |
| 35 | # the one Kalamar ships. Entries listed here are appended after it. |
| Akron | c71176d | 2022-03-14 11:15:07 +0100 | [diff] [blame] | 36 | navi_ext => [ |
| 37 | { |
| Akron | c71176d | 2022-03-14 11:15:07 +0100 | [diff] [blame] | 38 | "title" => "Privacy", |
| 39 | "id" => "privacy" |
| 40 | }, |
| Akron | 8dbf9c6 | 2024-03-20 17:24:15 +0100 | [diff] [blame] | 41 | { |
| 42 | "title" => "News", |
| 43 | "id" => "news" |
| 44 | }, |
| Marc Kupietz | 442e0bd | 2026-08-04 12:51:39 +0200 | [diff] [blame] | 45 | { |
| 46 | "title" => "citation", |
| 47 | "id" => "citation" |
| 48 | }, |
| Akron | c71176d | 2022-03-14 11:15:07 +0100 | [diff] [blame] | 49 | ], |
| Marc Kupietz | a167502 | 2026-01-19 18:52:47 +0100 | [diff] [blame] | 50 | defaults => { |
| 51 | alignment => 'center' # or 'right' or 'center' |
| 52 | }, |
| Akron | c71176d | 2022-03-14 11:15:07 +0100 | [diff] [blame] | 53 | }, |
| 54 | CSP => { |
| 55 | 'frame-src' => 'self', |
| 56 | 'frame-ancestors' => ['self','http://*.ids-mannheim.de/','https://*.ids-mannheim.de/','http://klinux10/'] |
| 57 | }, |
| 58 | 'Kalamar-Plugins' => { |
| Marc Kupietz | a167502 | 2026-01-19 18:52:47 +0100 | [diff] [blame] | 59 | # Optimized for docker usage: |
| 60 | default_plugins => '/kalamar/default.plugins.json' |
| Akron | c71176d | 2022-03-14 11:15:07 +0100 | [diff] [blame] | 61 | }, |
| 62 | Piwik => { |
| 63 | url => 'https://stats.ids-mannheim.de', |
| 64 | token_auth => '8515ea786127a63a2974de25a0808b00', |
| 65 | site_id => 8, |
| 66 | embed => 1 |
| 67 | }, |
| 68 | hypnotoad => { |
| 69 | listen => ['http://*:4348'], |
| 70 | workers => 5, |
| 71 | inactivity_timeout => 120, |
| 72 | proxy => 1 |
| 73 | }, |
| Akron | c71176d | 2022-03-14 11:15:07 +0100 | [diff] [blame] | 74 | Localize => { |
| Marc Kupietz | a167502 | 2026-01-19 18:52:47 +0100 | [diff] [blame] | 75 | override => 1, |
| Akron | c71176d | 2022-03-14 11:15:07 +0100 | [diff] [blame] | 76 | dict => { |
| 77 | de_loginExplanation => 'Anmeldung mit einem registrierten <%= link_to "Cosmas-II" => "https://perso.ids-mannheim.de/registration/", style => "white-space: nowrap" %>-Konto', |
| 78 | en_loginExplanation => 'Login with a registered <%= link_to "Cosmas-II" => "https://perso.ids-mannheim.de/registration/", style => "white-space: nowrap" %> account', |
| 79 | en_Nav_privacy => 'Privacy', |
| 80 | de_Nav_privacy => 'Datenschutz', |
| 81 | de_Nav_corpora => 'Korpora', |
| 82 | en_Nav_corpora => 'Corpora', |
| Marc Kupietz | 4d7cace | 2026-09-10 16:36:05 +0200 | [diff] [blame] | 83 | de_Nav_corpus => 'Korpusgrundlage', |
| 84 | en_Nav_corpus => 'Corpus basis', |
| 85 | en_Nav_composition => 'Composition', |
| 86 | de_Nav_composition => 'Zusammensetzung', |
| 87 | en_Nav_useful_subcorpora => 'Useful subcorpora', |
| 88 | de_Nav_useful_subcorpora => 'Nützliche Subkorpora', |
| 89 | en_Nav_named_vc => 'Named VC', |
| 90 | de_Nav_named_vc => 'Benamte VC', |
| Akron | c71176d | 2022-03-14 11:15:07 +0100 | [diff] [blame] | 91 | en_howToCite => 'Citation Help', |
| 92 | de_howToCite => 'Zitierhilfe', |
| Marc Kupietz | 442e0bd | 2026-08-04 12:51:39 +0200 | [diff] [blame] | 93 | en_Nav_citation => 'References / Citation Help', |
| 94 | de_Nav_citation => 'Referenzen / Zitierhilfe', |
| 95 | en_corpusPub => 'DeReKo', |
| 96 | de_corpusPub => 'DeReKo', |
| Marc Kupietz | 152dfc9 | 2025-04-11 10:02:27 +0200 | [diff] [blame] | 97 | de_usefulvcs => 'Nützliche virtuelle Sub-Korpora', |
| 98 | en_usefulvcs => 'Useful virtual sub-corpora', |
| 99 | de_currentdb => 'Aktuelle Datengrundlage: virtuelles Korpus <%= t code => stash("vc") %>', |
| 100 | en_currentdb => 'Current data set: Virtual corpus <%= t code => stash("vc") %>', |
| 101 | de_compositionbysource => 'Zusammensetzung nach Quelle', |
| 102 | en_compositionbysource => 'Composition by source', |
| Marc Kupietz | a167502 | 2026-01-19 18:52:47 +0100 | [diff] [blame] | 103 | #de_Title_composition => 'Korpus-Zusammensetzung', |
| 104 | #en_Title_composition => 'Corpus Composition', |
| Marc Kupietz | 4f28dc4 | 2026-07-21 19:39:29 +0200 | [diff] [blame] | 105 | en_Nav_releases => 'Release Log', |
| Marc Kupietz | 2bd89b3 | 2026-08-03 17:39:34 +0200 | [diff] [blame] | 106 | de_Nav_releases => 'Korpus-Releases', |
| Akron | c71176d | 2022-03-14 11:15:07 +0100 | [diff] [blame] | 107 | } |
| 108 | }, |
| 109 | 'TagHelpers-ContentBlock' => { |
| 110 | footer => [ |
| 111 | { |
| 112 | inline => '<%= link_to loc("about") => "https://www.ids-mannheim.de/digspra/kl/projekte/korap/" %>', |
| 113 | position => 70 |
| 114 | }, |
| 115 | { |
| Marc Kupietz | a167502 | 2026-01-19 18:52:47 +0100 | [diff] [blame] | 116 | inline => '<%= link_to loc("news") => url_for(doc => {page => "news" }) %>', |
| 117 | position => 72 |
| 118 | }, |
| 119 | { |
| Marc Kupietz | 442e0bd | 2026-08-04 12:51:39 +0200 | [diff] [blame] | 120 | inline => '<%= link_to loc("howToCite") => url_for(doc => { page => "citation", scope => undef }) %>', |
| Akron | c71176d | 2022-03-14 11:15:07 +0100 | [diff] [blame] | 121 | position => 75 |
| 122 | }, |
| 123 | { |
| Akron | dc1b9bb | 2025-07-21 14:34:05 +0200 | [diff] [blame] | 124 | inline => '<%= link_to loc("privacy") => url_for(doc => { page => "privacy", scope => undef }) %>', |
| Akron | c71176d | 2022-03-14 11:15:07 +0100 | [diff] [blame] | 125 | position => 90 |
| 126 | }, |
| 127 | { |
| 128 | inline => '<%= link_to loc("imprint") => "https://www.ids-mannheim.de/allgemein/impressum/" %>', |
| 129 | position => 80 |
| 130 | }, |
| 131 | ], |
| 132 | faq => [ |
| 133 | { |
| 134 | position => 50, |
| 135 | inline => <<'HOWTOCITE' |
| 136 | <section> |
| 137 | <h3 id="howToCite"><%= loc 'howToCite' %></h3> |
| Marc Kupietz | 442e0bd | 2026-08-04 12:51:39 +0200 | [diff] [blame] | 138 | <p><%= link_to loc('howToCite') => url_for(doc => { page => "citation", scope => undef })->query({ embedded => "true" }) %></p> |
| Akron | c71176d | 2022-03-14 11:15:07 +0100 | [diff] [blame] | 139 | </section> |
| 140 | HOWTOCITE |
| 141 | } |
| 142 | ], |
| 143 | loginInfo => [ |
| 144 | { |
| 145 | inline => '<p><%== loc "loginExplanation" %></p>', |
| 146 | position => 50 |
| 147 | }#, |
| 148 | # { |
| 149 | # inline => '<p class="announcement"><time datetime="2018-05-24">24.05.2018</time> Um weitere Anwendungen für die Nutzung von DeReKo anbieten zu können, haben wir die <%= link_to "Nutzungsvereinbarung", "https://www.ids-mannheim.de/cosmas2/projekt/registrierung/Nutzungsvereinbarung.html" %> angepasst!</p>', |
| 150 | # position => 100 |
| 151 | # } |
| Akron | 743c2d6 | 2025-03-05 14:37:59 +0100 | [diff] [blame] | 152 | ], |
| 153 | headerButtonGroup => [ |
| 154 | { |
| Akron | dc1b9bb | 2025-07-21 14:34:05 +0200 | [diff] [blame] | 155 | inline => '<h3 class="nav-link"><%= link_to loc("news") => url_for(doc => {page => "news", scope => undef }) %></h3>', |
| Akron | 743c2d6 | 2025-03-05 14:37:59 +0100 | [diff] [blame] | 156 | position => 30 |
| 157 | } |
| Akron | c71176d | 2022-03-14 11:15:07 +0100 | [diff] [blame] | 158 | ] |
| 159 | }, |
| Akron | c71176d | 2022-03-14 11:15:07 +0100 | [diff] [blame] | 160 | # See Mojolicious::Plugin::CHI |
| Marc Kupietz | a167502 | 2026-01-19 18:52:47 +0100 | [diff] [blame] | 161 | # Could be optimized to use the data folder in docker scenarios: |
| 162 | # CHI => { |
| 163 | # default => { |
| 164 | # driver => 'FastMmap', |
| 165 | # root_dir => app->home . '/cache/data', |
| 166 | # cache_size => '500m', |
| 167 | # max_size => '500m' |
| 168 | # }, |
| 169 | # user => { |
| 170 | # l1_cache => { |
| 171 | # driver => 'FastMmap', |
| 172 | # root_dir => app->home . '/cache/usermap', |
| 173 | # cache_size => '50m', |
| 174 | # max_size => '50m' |
| 175 | # }, |
| 176 | # driver => 'File', |
| 177 | # root_dir => app->home . '/cache/userfile', |
| 178 | # max_key_length => 64, |
| 179 | # max_size => '500m' |
| 180 | # } |
| 181 | # } |
| Akron | c71176d | 2022-03-14 11:15:07 +0100 | [diff] [blame] | 182 | }; |