Upgrade to Pro — share decks privately, control downloads, hide ads and more …

2022年に始めるPerlでWebサービス開発(趣味)

papix
June 09, 2022

 2022年に始めるPerlでWebサービス開発(趣味)

papix

June 09, 2022
Tweet

More Decks by papix

Other Decks in Technology

Transcript

  1. ࣗݾ঺հ • papix (id:papix / @__papix__) • גࣜձࣾ͸ͯͳ WebΞϓϦέʔγϣϯΤϯδχΞ (2017೥ʙ)

    • ϒϩάMediaνʔϜ → ϚϯΨνʔϜ • Ұൠࣾஂ๏ਓJapan Perl Associationཧࣄ • ϒϩά: https://papix.hatena(blog.(com|jp)|diary.jp)
  2. ԿΛ࡞Δ? • υϝΠϯʹैͬͯ(?), ٕज़Ͱཱྀߦͷ৴པੑΛߴΊ͍ͨ • ϫʔέʔγϣϯ(લճ࿩͠·ͨ͠Ͷ!)Ͱ͸, ॓ͷ௨৴؀ڥ͕େࣄ • ňWi-Fi͋Γ·͢ʼnͱॻ͔Ε͍ͯͯ΋, ͦͷ඼࣭·Ͱ͸Θ͔Βͳ͍

    • docker pullͰ͖ͳ͔ͬͨΓ, Online MTG͕Ͱ͖ͳ͍඼࣭ͩͱࠔΔ • օͰ॓ͷ৘ใ(௨৴଎౓౳)ΛूΊΔαʔϏε͕͋ΔͱศརͰ͸?
  3. ຊ୊ • ͱ͍͏Θ͚Ͱ, झຯͰ! PerlͰ! WebApp։ൃ, ࢝Ί·ͨ͠ • ·ͩ·ͩ։ൃணखͨ͠͹͔ΓͰ͕͢, ͲͷΑ͏ͳߏ੒ʹ͔ͨ͠࿩ͦ

    ͏ͱࢥ͍·͢ • ߹ཧੑ͸օແͰ, ׬શʹझຯʹৼΓ੾͍ͬͯΔ఺ྃ͝ঝ͍ͩ͘͞ • ͪͳΈʹίʔυωʔϜ͸ňMoonsideʼnͰ͢
  4. cpan fi le requires 'Amon2', '== 6.15'; requires 'Aniki', '==

    1.06'; requires 'Cookie::Baker', '== 0.11'; requires 'Crypt::JWT', '== 0.034'; requires 'DBD::mysql', '== 4.050'; requires 'DBIx::Schema::DSL', '== 1.0000'; requires 'Digest::HMAC', '== 1.04'; requires 'Digest::SHA', '== 6.02'; requires 'Furl', '== 3.14'; requires 'Gazelle', '== 0.49'; requires 'HTML::FillInForm::Lite', '== 1.15'; requires 'JSON::XS', '== 4.03'; requires 'Module::Find', '== 0.15'; requires 'Module::Functions', '== 2.1.3'; requires 'Plack::Middleware::ReverseProxy', '== 0.16'; requires 'Plack::Middleware::Session', '== 0.33'; requires 'Plack::Session::Store::Redis', '== 0.05'; requires 'Redis', '== 1.999'; requires 'Router::Boom', '== 1.03'; requires 'Smart::Args', '== 0.14'; requires 'Text::Xslate', '== v3.5.9'; requires 'Time::Moment', '== 0.44'; on development => sub { requires 'Anego', '== 0.02'; }; on test => sub { requires 'Test2', '== 1.302188'; requires 'Test::WWW::Mechanize::PSGI', '== 0.39'; }; جຊతʹ࠷৽൛Λ࢖͏Α͏, όʔδϣϯݻఆ͍ͯ͠Δ
  5. Amon2 / Text::Xslate • WAF/Template Engine͸ͦΕͧΕAmon2/Text::XslateΛબఆ • Amon2͸࠷ۙ͝ແࠫଡͰ͕͢, લ͸݁ߏ࢖͍ͬͯͯ, ·ͩ·ͩهԱ͕

    ͋ΔͨΊ • Amon2Λ࠾༻͢ΔͳΒ౰વTemplate Engine͸Text::XslateͰ • Syntax͸Text::Xslate::Syntax::TTerseʹ͠·ͨ͠
  6. Authentication • Firebase Authentication • Ϣʔβʔ؅ཧपΓ͸ࣗલͰ؅ཧͨ͘͠ͳ͍ • Firebase AuthenticationͰ؅ཧͯ͠, PerlͷApp͔Βར༻͢Δ

    • ೝূ͸Firebase, ͦΕΛݩʹPerlͷAppͰηογϣϯΛ༻ҙ • ࢀߟจݙ: https://diary.ssig33.com/posts/535 • ͪ͜ΒͰ͸RailsͰͷࣄྫ͕ͩ, ಉ͡Α͏ͳ͜ͱ͸PerlͰ΋ग़དྷΔ
  7. CSRF Defender • ࠓճ͸ηογϣϯετΞʹRedisΛ࢖͏͜ͱʹͨ͠(झຯ) • ͕, HTTP::Session2::ServerStore͸Cache::Memcached::FastΛ૝ఆ ͍ͯ͠Δ • ݁ہ,

    Amon2ͷ࣮૷Λࢀߟʹͭͭ͠ಠࣗʹ࣮૷͢Δ͜ͱʹͨ͠ • RedisʹΑΔSession؅ཧ͸Plack::Session::Store::Redisʹ೚ͤΔ • ޙ͸ͦΕΛ࢖ͬͯtokenΛൃߦͨ͠Γ...