ãã¹ã¦ã®ã³ã³ãã³ãä½æè ã®ããã®æ å ±çºä¿¡ãã©ãããã©ã¼ã ã
æ¦è¦# Rails ã® ActionMailer ã§ã¡ã¼ã«ã¯ã©ã¤ã¢ã³ãã« AWS SES ã使ãå ´åã®è¨å®æ¹æ³ãæ¸ãã¦ãã¾ãã AWS ã¢ã¯ã»ã¹ãã¼ãç¨æãã# SendRawEmail ãªãã¬ã¼ã·ã§ã³ãå®è¡å¯è½ãª IAM ã¦ã¼ã¶ã¼ã®ã¢ã¯ã»ã¹ãã¼ãä½æãã¾ãã ä½ææ¹æ³ã¯ãã¡ããåèã«ãã¦ãã ããã AWS SDK ã® Rails ç¨ãã©ã°ã¤ã³ãã¤ã³ã¹ãã¼ã«# AWS SDK ã«ã¯ Rails ã¨ã®çµ±åãç°¡åã«å¯è½ã«ãããã©ã°ã¤ã³ãå ¬å¼ã§ç¨æããã¦ãã¾ãã Gemfile ã«æ¬¡ã®è¡ã追è¨ããbundle install ãå®è¡ãã¾ãã
Ruby: 2.5.7 Rails: 5.2.4 æ¬çªç°å¢ï¼AWS EC2ï¼MySQL2ï¼Nginxï¼Pumaï¼Linux(CentOS) åæ Capistranoå°å ¥æ¸ã¿ æ¬çªç°å¢ã§åãã 1. wheneverãæ¬çªç°å¢ã«ã»ããã£ã³ã° config/schedule.rb env :PATH, ENV['PATH'] # ãã°ãã¡ã¤ã«ã®åºåå set :output, 'log/cron.log' # ã¸ã§ãã®å®è¡ç°å¢ã®æå® set :environment, :production â ããå¤æ´ # æ¥æ¬æéã®åå8:00ã«ã¡ã¼ã«éä¿¡ãããï¼JSTã¯+9:00ãªã®ã§-9:00ã®æéãè¨è¿°ï¼ # æªèªéç¥ã3件以ä¸ãã¾ã£ã¦ããã¦ã¼ã¶ã¼ã«ã¡ã¼ã«éç¥ every 1.days, at: '11:00 pm' do runner "ScheduledProcessingMailer.che
ä»æ¥ @mad_p ããããRTæ¥ã¦ããã®ãã¤ã¼ãã«é¢ãã¦ãã¡ãã£ã¨èª¿ã¹ãã®ã§ã¾ã¨ãã¨ãã¾ãã Security Issue in Ruby on Rails Could Expose Cookies http://t.co/JlsXVEn4rZ â Ruby on Rails News (@RubyonRailsNews) September 25, 2013 åææ¡ä»¶ Railsã§ã¯ããã©ã«ãã§sessionãcookieã«ã®ã¿ä¿åãã¦ãDBãªãmemcacheãªãã®server-side storageã«ã¯ä½ãä¿åãã¾ããã ãããCookieStoreã¨ãå¼ã°ãã¦ããã¤ã§ãã ãã®å ´åã®session cookieã¯ãRailsã®session object (Hash object) ãMarshal.dumpãã¦ããã«ç½²åãä»ããtokenã§ãã rails 4ã§ã¯ç½²åä»ãã代
Rails ã§ã®ç§å¯æ å ±ã®ç®¡çæ©è½ããã¼ã¸ã§ã³ãã¨ã«å¤§ããéã£ã¦ãã件ã«ã¤ãã¦ãã¾ã¨ãã¦ããã¾ãã Rails 4.1 config/secrets.yml ç§å¯æ å ±ãæ ¼ç´ããè¨å®ãã¡ã¤ã«ã¨ã㦠config/secrets.yml ã追å ããã¾ããã ãã®ãã¡ã¤ã«ã®è¨å®å¤ã¯ Rails.application.secrets ã§åå¾ã§ãã¾ãã ãã®è¨å®ãã¡ã¤ã«ã®è¨å®å¤ã¯ãåä¸ãã¡ã¤ã«å ã§ãç°å¢å¥ã«åãããã¦ãããæ¬çªç°å¢ã§ã®è¨å®å¤ã¯ VCS ã¸ã³ãããããã¦ãåé¡ãªããããé常ãç°å¢å¤æ°ãåç §ããããã«ãã¾ãã development: secret_key_base: a4f6336a67817352a26e098403561530cdecdea6f9031deac218a8369b13fb39ba5e9663d59a3a379d88b5609d56e83457dc6b04ef11ce
M1 Macä¸ã§Rubyã¨Railsã®éçºç°å¢æ§ç¯ãã£ã¦ããã¾ã ããã¯YouTubeåç»ã®è³æã§ã M1 Macã«Rubyã¨Railsã®ç°å¢æ§ç¯ãã¦ã¿ã https://youtu.be/z3pjRoHuhEc ã¯ããã« ãªãã¹ããããã°ã©ãã³ã°åå¦è åãã«ããããããã解説ãã¦ããã¾ã ãã£ããã«ãã£ã¦ããã¾ããã 2021å¹´2ææç¹ã®æ å ±ã§ã M2ã®Macãåºãé (ãã¤?)ã«ã¯ å¤ãæ å ±ã«ãªã£ã¦ãã¯ããªã®ã§ãæ°ãã¤ããã ãã èªå·±ç´¹ä»ï¼ãªãµãã¼ ã½ããã¦ã§ã¢ã¨ã³ã¸ãã¢ãæ ªå¼ä¼ç¤¾ãã¬ã¸ãã¢ä»£è¡¨åç· å½¹ã iPhoneã¢ããªéçºæ´10å¹´ãä¼ç»éçºããiPhoneã¢ããª160ä¸ãã¦ã³ãã¼ã以ä¸ã æè¿ã¯iOS(Swift)ã¢ããªãããã³ãã¨ã³ã(React, TypeScript)ãã£ã¦ãã åç»(Rubyã¨Railsç°å¢æ§ç¯)ã®ç®æ¬¡ çè«ç·¨: Intel Macã¨M1 Macã®éã å®è·µç·¨
Storing secrets in a version control system is not a good idea. Rails provides a way to store credentials in an encrypted manner. In such approach, we need to just store secret key (called as master.key) separately which is used to decrypt credentials. AWS has released a feature called AWS secret manager. It solves a few problems. Storing environment credentials in a secure manner Auto rotate secr
ããã¯ã¨ã³ãã¨ã³ã¸ãã¢ã®æéã§ãã æ±äº¬ãªãªã³ããã¯2020ãéå¹ããã¾ããããLCLã¯ç§»è»¢åã®ãªãã£ã¹ããªãªã³ããã¯é¸ææã«è¿ãåã©ãã«ãã£ãã®ã§é¸æã«è¦ªè¿æãè¦ãã¾ãã ãã¦ãLCLã§ã¯ããã¯ã¨ã³ãéçºã®Webã¢ããªã±ã¼ã·ã§ã³ãã¬ã¼ã ã¯ã¼ã¯ã¨ãã¦Ruby on Railsãæ¡ç¨ãã¦ãã¾ãã å æ¥ãRailsã®ã¢ãããã¼ããæ§æã®æ´æ°ãããéã«Credentialæ©è½ã«ã¤ãã¦è¦ç´ãæ©ä¼ããã£ãã®ã§ãã®ç¥è¦ãå ±æãããã¨æãã¾ãã tl;dr master.keyã¯Gitãªãã¸ããªã«å«ããªã ãã«ãã¹ãã¼ã¸ãã«ãã--mount=type=secretãæ´»ç¨ãã¦Dockerã¤ã¡ã¼ã¸ã«ãmaster.keyãå«ããªã Amazon ECSã§ã¯SSMãã©ã¡ã¼ã¿ã®SecureStringãå©ç¨ãã¦ç°å¢å¤æ°RAILS_MASTER_KEYãè¨å®ãã Credentialæ©è½ã®æ¦è¦ Railsã¯ãã¼
Railsã®configã«ã¯consider_all_requests_localã¨ããè¨å®é ç®ããã£ã¦ãããã¤ãtrueã«ããã¨ããã¹ã¦ã®ã¨ã©ã¼ããã©ã¦ã¶ã«è¡¨ç¤ºãããããã¨ãã§ãããéã«ãfalseã«è¨å®ããã¨ããã©ã¦ã¶ã«ã¯è©³ç´°æ å ±ã表示ãããªãã ããã©ã«ãã§ã¯ã developmentç°å¢ã¯trueã productionç°å¢ã¯false ã«ãªã£ã¦ããã ã¨ã©ã¼æã®åä½ã確èªããéãdevelopmentã§ãproductionã¨åæ§ã®åä½ãããããã¨ãã¯ãããã¤ãconfig.consider_all_requests_local = falseã¨ãã¦ãããã°productionã¨åæ§ã®åä½ã確èªã§ããã ã¡ãªã¿ã«ãè¨å®ãã¡ã¤ã«ã¯ããã«ããã¾ãã - development: config/environments/development.rb - production: conf
Rails APIã¢ã¼ã + devise_token_auth + Vue.js 3 ã§èªè¨¼æ©è½ä»ãã®SPAãä½ã(Railsç·¨)Rails ã¯ããã« æ¬è¨äºã¯APIãRailsã®APIã¢ã¼ãã§éçºããããã³ãå´ãVue.js 3ã§éçºãã¦ãèªè¨¼åºç¤ã«devise_token_authãç¨ãã¦ãã¼ã¯ã³ãã¼ã¹ã®èªè¨¼æ©è½ä»ãã®SPAãä½ããã¥ã¼ããªã¢ã«ã«ãªãã¾ãã RailsãVue.jsã®ç°å¢æ§ç¯ã«ã¯è§¦ãã¾ããã®ã§ãããããã Vue.jsç·¨(ãã®1)ã¯ãã¡ã https://qiita.com/kk-icare/items/401114a1284f8e9ca135 Rails newã§APIä½æ ä»åã¯sample-apiã¨ããããã¸ã§ã¯ãåã¨ãã¾ãã DBã¯PostgreSQLã使ç¨ããtestãã£ã¬ã¯ããªã®çæãã¹ãããããAPIã¢ã¼ãã§Railsã¢ããªã®éå½¢ãä½æããããã«å®è¡ãã¾
ããã«ã¡ã¯ãRuby ã触ãå§ãã¦ãã£ã¨3ã¶æçµã£ã @enomotodev ã§ãã ä»å㯠Rails 㧠ActiveAdmin ã使ã£ã¦æéã§ç®¡çç»é¢ãä½ãæ¹æ³ãç´¹ä»ãããã¨æãã¾ãï¼ ç°å¢ Ruby 2.3.5 Rails 5.1.4 MySQL 5.7.20 ActiveAdmin ã®ã¤ã³ã¹ãã¼ã« Gemfile ã« activeadmin 㨠devise ã追å ããbundle install ãã¾ãã $ bin/rails g active_admin:install Running via Spring preloader in process 9928 invoke devise generate devise:install create config/initializers/devise.rb create config/locales/devise.en.ym
éçãã¡ã¤ã« Cache-controlããããæå®ãã Expiresã¨åããããã£ãã·ã¥ã®æå¹æéãæå®ã§ããã¬ã¹ãã³ã¹ããããHTTP1.1ã§å®ç¾©ããããã®ã§ãæå¹æéã ãã§ãªããã£ãã·ã¥ã«é¢ãã詳細ãªè¨å®ãè¡ããã大å¤æ°ã®ãã©ã¦ã¶ã HTTP1.1ã«å¯¾å¿ãã¦ããã®ã§ãExpiresã§ã¯ãªããCache-Controlããããå©ç¨ããã®ãããã 説æ max-age : ãã£ãã·ã¥ã®æå¹æéãè¨å®ããã(ç¸å¯¾æéã§æå®ããåä½ã¯ç§ãï¼ ä¾ãã°ãã©ã¦ã¶ã®ãã£ãã·ã¥ã1å¹´éæå¹ã«ãããå ´åã¯ã次ã®ããã«æå®ããã æå¹æéã®éã¯ãã£ãã·ã¥ãå©ç¨ããããµã¼ãã«åãåãããçºçããªãããã«ã§ããã
RubyKaigi 2014è¡ã£ããè¯ãçºè¡¨ãããããèãããã ãã©ãæè¿ISUCONã«åãã¦webã¢ããªã®ãã¥ã¼ãã³ã°ã«èå³ããã£ãã®ã§ç¹ã«final keynoteãèå³æ·±ãã£ãã ãã®ä¸ã§ç´¹ä»ããã¦ããtmm1/rblineprofãè¡ãã¨ã®å®è¡æéã表示ãã¦ãããã®ã§ã¨ã¦ã便å©ããã ã£ããã ãã©ãGitHubã§ã¯peek/peek-rblineprofã¨ããRailsç¨ã®ãã©ã°ã¤ã³ã§rblineprofãæ´»ç¨ãã¦ããã®ã§ãISUCONã§ãããã使ç¨ãããã§ãããsinatraã§ã©ããã£ã¦ä½¿ããèãã¦ããã kainosnoema/rack-lineprofã¨ããgemããã®ç¨éã«ä¾¿å©ããã ã£ãã®ã§ç´¹ä»ãããã 使ãæ¹ rack-lineprofã¯Rack middlewareã§ãã¾ã以ä¸ã®ããã«useããå¿ è¦ãããã require 'rack-lineprof' class My
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}