Essai de configuration smtp, pour gérer soucis de certificat
This commit is contained in:
parent
71a050bc93
commit
74b76a70a3
|
@ -102,12 +102,12 @@ class EventsController < ApplicationController
|
||||||
private
|
private
|
||||||
# Use callbacks to share common setup or constraints between actions.
|
# Use callbacks to share common setup or constraints between actions.
|
||||||
def set_event
|
def set_event
|
||||||
if (params[:secret].present?)
|
if params[:secret].present?
|
||||||
@event = Event.where(secret: params[:secret])
|
@event = Event.where secret: params[:secret]
|
||||||
else
|
else
|
||||||
@event = Event.moderated
|
@event = Event.moderated
|
||||||
end
|
end
|
||||||
@event = @event.find(params[:id])
|
@event = @event.find params[:id]
|
||||||
end
|
end
|
||||||
|
|
||||||
# Never trust parameters from the scary internet, only allow the white list through.
|
# Never trust parameters from the scary internet, only allow the white list through.
|
||||||
|
|
|
@ -64,6 +64,7 @@ Rails.application.configure do
|
||||||
# Ignore bad email addresses and do not raise email delivery errors.
|
# Ignore bad email addresses and do not raise email delivery errors.
|
||||||
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
|
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
|
||||||
# config.action_mailer.raise_delivery_errors = false
|
# config.action_mailer.raise_delivery_errors = false
|
||||||
|
config.action_mailer.smtp_settings.openssl_verify_mode = 'none'
|
||||||
|
|
||||||
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
|
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
|
||||||
# the I18n.default_locale when a translation cannot be found).
|
# the I18n.default_locale when a translation cannot be found).
|
||||||
|
|
|
@ -0,0 +1,17 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
set -e
|
||||||
|
oldrev=$1
|
||||||
|
newrev=$2
|
||||||
|
|
||||||
|
run() {
|
||||||
|
[ -x $1 ] && $1 $oldrev $newrev
|
||||||
|
}
|
||||||
|
|
||||||
|
echo files changed: $(git diff $oldrev $newrev --diff-filter=ACDMR --name-only | wc -l)
|
||||||
|
|
||||||
|
umask 002
|
||||||
|
|
||||||
|
git submodule sync && git submodule update --init --recursive
|
||||||
|
|
||||||
|
run deploy/before_restart
|
||||||
|
run deploy/restart && run deploy/after_restart
|
|
@ -0,0 +1,39 @@
|
||||||
|
#!/usr/bin/env ruby
|
||||||
|
oldrev, newrev = ARGV
|
||||||
|
|
||||||
|
def run(cmd)
|
||||||
|
exit($?.exitstatus) unless system "umask 002 && #{cmd}"
|
||||||
|
end
|
||||||
|
|
||||||
|
RAILS_ENV = ENV['RAILS_ENV'] || 'production'
|
||||||
|
use_bundler = File.file? 'Gemfile'
|
||||||
|
rake_cmd = use_bundler ? 'bundle exec rake' : 'rake'
|
||||||
|
|
||||||
|
if use_bundler
|
||||||
|
bundler_args = ['--deployment']
|
||||||
|
BUNDLE_WITHOUT = ENV['BUNDLE_WITHOUT'] || 'development:test'
|
||||||
|
bundler_args << '--without' << BUNDLE_WITHOUT unless BUNDLE_WITHOUT.empty?
|
||||||
|
|
||||||
|
# update gem bundle
|
||||||
|
run "bundle install #{bundler_args.join(' ')}"
|
||||||
|
end
|
||||||
|
|
||||||
|
if File.file? 'Rakefile'
|
||||||
|
tasks = []
|
||||||
|
|
||||||
|
num_migrations = `git diff #{oldrev} #{newrev} --diff-filter=A --name-only -z db/migrate`.split("\0").size
|
||||||
|
# run migrations if new ones have been added
|
||||||
|
tasks << "db:migrate" if num_migrations > 0
|
||||||
|
|
||||||
|
# precompile assets
|
||||||
|
changed_assets = `git diff #{oldrev} #{newrev} --name-only -z app/assets`.split("\0")
|
||||||
|
tasks << "assets:precompile" if changed_assets.size > 0
|
||||||
|
|
||||||
|
run "#{rake_cmd} #{tasks.join(' ')} RAILS_ENV=#{RAILS_ENV}" if tasks.any?
|
||||||
|
end
|
||||||
|
|
||||||
|
# clear cached assets (unversioned/ignored files)
|
||||||
|
run "git clean -x -f -- public/stylesheets public/javascripts"
|
||||||
|
|
||||||
|
# clean unversioned files from vendor/plugins (e.g. old submodules)
|
||||||
|
run "git clean -d -f -- vendor/plugins"
|
|
@ -0,0 +1,3 @@
|
||||||
|
#!/bin/sh
|
||||||
|
touch tmp/restart.txt
|
||||||
|
echo "restarting Passenger app"
|
Loading…
Reference in New Issue