Merge 1e84a4e34a
into 432fa57e61
This commit is contained in:
commit
14106eb87f
22 changed files with 215 additions and 205 deletions
6
Gemfile
6
Gemfile
|
@ -1,7 +1,7 @@
|
||||||
source "https://rubygems.org"
|
source "https://rubygems.org"
|
||||||
|
|
||||||
# Require rails
|
# Require rails
|
||||||
gem "rails", "~> 7.2.0"
|
gem "rails", "~> 8.0.0"
|
||||||
gem "turbo-rails"
|
gem "turbo-rails"
|
||||||
|
|
||||||
# Require json for multi_json
|
# Require json for multi_json
|
||||||
|
@ -49,7 +49,7 @@ gem "file_exists"
|
||||||
# Load rails plugins
|
# Load rails plugins
|
||||||
gem "actionpack-page_caching", ">= 1.2.0"
|
gem "actionpack-page_caching", ">= 1.2.0"
|
||||||
gem "activerecord-import"
|
gem "activerecord-import"
|
||||||
gem "active_record_union"
|
gem "active_record_union", :github => "brianhempel/active_record_union", :ref => "master"
|
||||||
gem "bootstrap", "~> 5.3.2"
|
gem "bootstrap", "~> 5.3.2"
|
||||||
gem "bootstrap_form", "~> 5.0"
|
gem "bootstrap_form", "~> 5.0"
|
||||||
gem "cancancan"
|
gem "cancancan"
|
||||||
|
@ -61,7 +61,7 @@ gem "http_accept_language", "~> 2.1.1"
|
||||||
gem "i18n-js", "~> 3.9.2"
|
gem "i18n-js", "~> 3.9.2"
|
||||||
gem "openstreetmap-deadlock_retry", ">= 1.3.1", :require => "deadlock_retry"
|
gem "openstreetmap-deadlock_retry", ">= 1.3.1", :require => "deadlock_retry"
|
||||||
gem "rack-cors"
|
gem "rack-cors"
|
||||||
gem "rails-i18n", "~> 7.0.0"
|
gem "rails-i18n", "~> 8.0.0"
|
||||||
gem "rails_param"
|
gem "rails_param"
|
||||||
gem "rinku", ">= 2.0.6", :require => "rails_rinku"
|
gem "rinku", ">= 2.0.6", :require => "rails_rinku"
|
||||||
gem "strong_migrations", "< 2.0.0"
|
gem "strong_migrations", "< 2.0.0"
|
||||||
|
|
130
Gemfile.lock
130
Gemfile.lock
|
@ -1,34 +1,41 @@
|
||||||
|
GIT
|
||||||
|
remote: https://github.com/brianhempel/active_record_union.git
|
||||||
|
revision: 8ebe558709aabe039abd24e3e7dd4d4354a6de88
|
||||||
|
ref: master
|
||||||
|
specs:
|
||||||
|
active_record_union (1.3.0)
|
||||||
|
activerecord (>= 6.0)
|
||||||
|
|
||||||
GEM
|
GEM
|
||||||
remote: https://rubygems.org/
|
remote: https://rubygems.org/
|
||||||
specs:
|
specs:
|
||||||
aasm (5.5.0)
|
aasm (5.5.0)
|
||||||
concurrent-ruby (~> 1.0)
|
concurrent-ruby (~> 1.0)
|
||||||
actioncable (7.2.2.1)
|
actioncable (8.0.1)
|
||||||
actionpack (= 7.2.2.1)
|
actionpack (= 8.0.1)
|
||||||
activesupport (= 7.2.2.1)
|
activesupport (= 8.0.1)
|
||||||
nio4r (~> 2.0)
|
nio4r (~> 2.0)
|
||||||
websocket-driver (>= 0.6.1)
|
websocket-driver (>= 0.6.1)
|
||||||
zeitwerk (~> 2.6)
|
zeitwerk (~> 2.6)
|
||||||
actionmailbox (7.2.2.1)
|
actionmailbox (8.0.1)
|
||||||
actionpack (= 7.2.2.1)
|
actionpack (= 8.0.1)
|
||||||
activejob (= 7.2.2.1)
|
activejob (= 8.0.1)
|
||||||
activerecord (= 7.2.2.1)
|
activerecord (= 8.0.1)
|
||||||
activestorage (= 7.2.2.1)
|
activestorage (= 8.0.1)
|
||||||
activesupport (= 7.2.2.1)
|
activesupport (= 8.0.1)
|
||||||
mail (>= 2.8.0)
|
mail (>= 2.8.0)
|
||||||
actionmailer (7.2.2.1)
|
actionmailer (8.0.1)
|
||||||
actionpack (= 7.2.2.1)
|
actionpack (= 8.0.1)
|
||||||
actionview (= 7.2.2.1)
|
actionview (= 8.0.1)
|
||||||
activejob (= 7.2.2.1)
|
activejob (= 8.0.1)
|
||||||
activesupport (= 7.2.2.1)
|
activesupport (= 8.0.1)
|
||||||
mail (>= 2.8.0)
|
mail (>= 2.8.0)
|
||||||
rails-dom-testing (~> 2.2)
|
rails-dom-testing (~> 2.2)
|
||||||
actionpack (7.2.2.1)
|
actionpack (8.0.1)
|
||||||
actionview (= 7.2.2.1)
|
actionview (= 8.0.1)
|
||||||
activesupport (= 7.2.2.1)
|
activesupport (= 8.0.1)
|
||||||
nokogiri (>= 1.8.5)
|
nokogiri (>= 1.8.5)
|
||||||
racc
|
rack (>= 2.2.4)
|
||||||
rack (>= 2.2.4, < 3.2)
|
|
||||||
rack-session (>= 1.0.1)
|
rack-session (>= 1.0.1)
|
||||||
rack-test (>= 0.6.3)
|
rack-test (>= 0.6.3)
|
||||||
rails-dom-testing (~> 2.2)
|
rails-dom-testing (~> 2.2)
|
||||||
|
@ -36,39 +43,37 @@ GEM
|
||||||
useragent (~> 0.16)
|
useragent (~> 0.16)
|
||||||
actionpack-page_caching (1.2.4)
|
actionpack-page_caching (1.2.4)
|
||||||
actionpack (>= 4.0.0)
|
actionpack (>= 4.0.0)
|
||||||
actiontext (7.2.2.1)
|
actiontext (8.0.1)
|
||||||
actionpack (= 7.2.2.1)
|
actionpack (= 8.0.1)
|
||||||
activerecord (= 7.2.2.1)
|
activerecord (= 8.0.1)
|
||||||
activestorage (= 7.2.2.1)
|
activestorage (= 8.0.1)
|
||||||
activesupport (= 7.2.2.1)
|
activesupport (= 8.0.1)
|
||||||
globalid (>= 0.6.0)
|
globalid (>= 0.6.0)
|
||||||
nokogiri (>= 1.8.5)
|
nokogiri (>= 1.8.5)
|
||||||
actionview (7.2.2.1)
|
actionview (8.0.1)
|
||||||
activesupport (= 7.2.2.1)
|
activesupport (= 8.0.1)
|
||||||
builder (~> 3.1)
|
builder (~> 3.1)
|
||||||
erubi (~> 1.11)
|
erubi (~> 1.11)
|
||||||
rails-dom-testing (~> 2.2)
|
rails-dom-testing (~> 2.2)
|
||||||
rails-html-sanitizer (~> 1.6)
|
rails-html-sanitizer (~> 1.6)
|
||||||
active_record_union (1.3.0)
|
activejob (8.0.1)
|
||||||
activerecord (>= 4.0)
|
activesupport (= 8.0.1)
|
||||||
activejob (7.2.2.1)
|
|
||||||
activesupport (= 7.2.2.1)
|
|
||||||
globalid (>= 0.3.6)
|
globalid (>= 0.3.6)
|
||||||
activemodel (7.2.2.1)
|
activemodel (8.0.1)
|
||||||
activesupport (= 7.2.2.1)
|
activesupport (= 8.0.1)
|
||||||
activerecord (7.2.2.1)
|
activerecord (8.0.1)
|
||||||
activemodel (= 7.2.2.1)
|
activemodel (= 8.0.1)
|
||||||
activesupport (= 7.2.2.1)
|
activesupport (= 8.0.1)
|
||||||
timeout (>= 0.4.0)
|
timeout (>= 0.4.0)
|
||||||
activerecord-import (2.1.0)
|
activerecord-import (2.1.0)
|
||||||
activerecord (>= 4.2)
|
activerecord (>= 4.2)
|
||||||
activestorage (7.2.2.1)
|
activestorage (8.0.1)
|
||||||
actionpack (= 7.2.2.1)
|
actionpack (= 8.0.1)
|
||||||
activejob (= 7.2.2.1)
|
activejob (= 8.0.1)
|
||||||
activerecord (= 7.2.2.1)
|
activerecord (= 8.0.1)
|
||||||
activesupport (= 7.2.2.1)
|
activesupport (= 8.0.1)
|
||||||
marcel (~> 1.0)
|
marcel (~> 1.0)
|
||||||
activesupport (7.2.2.1)
|
activesupport (8.0.1)
|
||||||
base64
|
base64
|
||||||
benchmark (>= 0.3)
|
benchmark (>= 0.3)
|
||||||
bigdecimal
|
bigdecimal
|
||||||
|
@ -80,6 +85,7 @@ GEM
|
||||||
minitest (>= 5.1)
|
minitest (>= 5.1)
|
||||||
securerandom (>= 0.3)
|
securerandom (>= 0.3)
|
||||||
tzinfo (~> 2.0, >= 2.0.5)
|
tzinfo (~> 2.0, >= 2.0.5)
|
||||||
|
uri (>= 0.13.1)
|
||||||
addressable (2.8.7)
|
addressable (2.8.7)
|
||||||
public_suffix (>= 2.0.2, < 7.0)
|
public_suffix (>= 2.0.2, < 7.0)
|
||||||
annotaterb (4.14.0)
|
annotaterb (4.14.0)
|
||||||
|
@ -495,20 +501,20 @@ GEM
|
||||||
rackup (1.0.1)
|
rackup (1.0.1)
|
||||||
rack (< 3)
|
rack (< 3)
|
||||||
webrick
|
webrick
|
||||||
rails (7.2.2.1)
|
rails (8.0.1)
|
||||||
actioncable (= 7.2.2.1)
|
actioncable (= 8.0.1)
|
||||||
actionmailbox (= 7.2.2.1)
|
actionmailbox (= 8.0.1)
|
||||||
actionmailer (= 7.2.2.1)
|
actionmailer (= 8.0.1)
|
||||||
actionpack (= 7.2.2.1)
|
actionpack (= 8.0.1)
|
||||||
actiontext (= 7.2.2.1)
|
actiontext (= 8.0.1)
|
||||||
actionview (= 7.2.2.1)
|
actionview (= 8.0.1)
|
||||||
activejob (= 7.2.2.1)
|
activejob (= 8.0.1)
|
||||||
activemodel (= 7.2.2.1)
|
activemodel (= 8.0.1)
|
||||||
activerecord (= 7.2.2.1)
|
activerecord (= 8.0.1)
|
||||||
activestorage (= 7.2.2.1)
|
activestorage (= 8.0.1)
|
||||||
activesupport (= 7.2.2.1)
|
activesupport (= 8.0.1)
|
||||||
bundler (>= 1.15.0)
|
bundler (>= 1.15.0)
|
||||||
railties (= 7.2.2.1)
|
railties (= 8.0.1)
|
||||||
rails-controller-testing (1.0.5)
|
rails-controller-testing (1.0.5)
|
||||||
actionpack (>= 5.0.1.rc1)
|
actionpack (>= 5.0.1.rc1)
|
||||||
actionview (>= 5.0.1.rc1)
|
actionview (>= 5.0.1.rc1)
|
||||||
|
@ -520,15 +526,15 @@ GEM
|
||||||
rails-html-sanitizer (1.6.2)
|
rails-html-sanitizer (1.6.2)
|
||||||
loofah (~> 2.21)
|
loofah (~> 2.21)
|
||||||
nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
|
nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
|
||||||
rails-i18n (7.0.10)
|
rails-i18n (8.0.1)
|
||||||
i18n (>= 0.7, < 2)
|
i18n (>= 0.7, < 2)
|
||||||
railties (>= 6.0.0, < 8)
|
railties (>= 8.0.0, < 9)
|
||||||
rails_param (1.3.1)
|
rails_param (1.3.1)
|
||||||
actionpack (>= 3.2.0)
|
actionpack (>= 3.2.0)
|
||||||
activesupport (>= 3.2.0)
|
activesupport (>= 3.2.0)
|
||||||
railties (7.2.2.1)
|
railties (8.0.1)
|
||||||
actionpack (= 7.2.2.1)
|
actionpack (= 8.0.1)
|
||||||
activesupport (= 7.2.2.1)
|
activesupport (= 8.0.1)
|
||||||
irb (~> 1.13)
|
irb (~> 1.13)
|
||||||
rackup (>= 1.0.0)
|
rackup (>= 1.0.0)
|
||||||
rake (>= 12.2)
|
rake (>= 12.2)
|
||||||
|
@ -680,7 +686,7 @@ PLATFORMS
|
||||||
DEPENDENCIES
|
DEPENDENCIES
|
||||||
aasm
|
aasm
|
||||||
actionpack-page_caching (>= 1.2.0)
|
actionpack-page_caching (>= 1.2.0)
|
||||||
active_record_union
|
active_record_union!
|
||||||
activerecord-import
|
activerecord-import
|
||||||
addressable (~> 2.8)
|
addressable (~> 2.8)
|
||||||
annotaterb
|
annotaterb
|
||||||
|
@ -753,9 +759,9 @@ DEPENDENCIES
|
||||||
quad_tile (~> 1.0.1)
|
quad_tile (~> 1.0.1)
|
||||||
rack-cors
|
rack-cors
|
||||||
rack-uri_sanitizer
|
rack-uri_sanitizer
|
||||||
rails (~> 7.2.0)
|
rails (~> 8.0.0)
|
||||||
rails-controller-testing
|
rails-controller-testing
|
||||||
rails-i18n (~> 7.0.0)
|
rails-i18n (~> 8.0.0)
|
||||||
rails_param
|
rails_param
|
||||||
rinku (>= 2.0.6)
|
rinku (>= 2.0.6)
|
||||||
rotp
|
rotp
|
||||||
|
|
|
@ -25,7 +25,7 @@ class AccountsController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def update
|
def update
|
||||||
user_params = params.require(:user).permit(:display_name, :new_email, :pass_crypt, :pass_crypt_confirmation, :auth_provider)
|
user_params = params.expect(:user => [:display_name, :new_email, :pass_crypt, :pass_crypt_confirmation, :auth_provider])
|
||||||
|
|
||||||
if params[:user][:auth_provider].blank? ||
|
if params[:user][:auth_provider].blank? ||
|
||||||
(params[:user][:auth_provider] == current_user.auth_provider &&
|
(params[:user][:auth_provider] == current_user.auth_provider &&
|
||||||
|
|
|
@ -51,6 +51,6 @@ class DiaryCommentsController < ApplicationController
|
||||||
##
|
##
|
||||||
# return permitted diary comment parameters
|
# return permitted diary comment parameters
|
||||||
def comment_params
|
def comment_params
|
||||||
params.require(:diary_comment).permit(:body)
|
params.expect(:diary_comment => [:body])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -219,7 +219,7 @@ class DiaryEntriesController < ApplicationController
|
||||||
##
|
##
|
||||||
# return permitted diary entry parameters
|
# return permitted diary entry parameters
|
||||||
def entry_params
|
def entry_params
|
||||||
params.require(:diary_entry).permit(:title, :body, :language_code, :latitude, :longitude)
|
params.expect(:diary_entry => [:title, :body, :language_code, :latitude, :longitude])
|
||||||
rescue ActionController::ParameterMissing
|
rescue ActionController::ParameterMissing
|
||||||
ActionController::Parameters.new.permit(:title, :body, :language_code, :latitude, :longitude)
|
ActionController::Parameters.new.permit(:title, :body, :language_code, :latitude, :longitude)
|
||||||
end
|
end
|
||||||
|
|
|
@ -33,7 +33,7 @@ class IssueCommentsController < ApplicationController
|
||||||
private
|
private
|
||||||
|
|
||||||
def issue_comment_params
|
def issue_comment_params
|
||||||
params.require(:issue_comment).permit(:body)
|
params.expect(:issue_comment => [:body])
|
||||||
end
|
end
|
||||||
|
|
||||||
# This sort of assumes there are only two roles
|
# This sort of assumes there are only two roles
|
||||||
|
|
|
@ -78,7 +78,7 @@ class MessagesController < ApplicationController
|
||||||
##
|
##
|
||||||
# return permitted message parameters
|
# return permitted message parameters
|
||||||
def message_params
|
def message_params
|
||||||
params.require(:message).permit(:title, :body)
|
params.expect(:message => [:title, :body])
|
||||||
rescue ActionController::ParameterMissing
|
rescue ActionController::ParameterMissing
|
||||||
ActionController::Parameters.new.permit(:title, :body)
|
ActionController::Parameters.new.permit(:title, :body)
|
||||||
end
|
end
|
||||||
|
|
|
@ -21,8 +21,8 @@ class Oauth2ApplicationsController < Doorkeeper::ApplicationsController
|
||||||
|
|
||||||
def application_params
|
def application_params
|
||||||
params[:oauth2_application][:scopes]&.delete("")
|
params[:oauth2_application][:scopes]&.delete("")
|
||||||
params.require(:oauth2_application)
|
params
|
||||||
.permit(:name, :redirect_uri, :confidential, :scopes => [])
|
.expect(:oauth2_application => [:name, :redirect_uri, :confidential, { :scopes => [] }])
|
||||||
.merge(:owner => current_resource_owner)
|
.merge(:owner => current_resource_owner)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -49,7 +49,7 @@ class ReportsController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def report_params
|
def report_params
|
||||||
params.require(:report).permit(:details, :category)
|
params.expect(:report => [:details, :category])
|
||||||
end
|
end
|
||||||
|
|
||||||
def issue_params
|
def issue_params
|
||||||
|
|
|
@ -223,6 +223,6 @@ class TracesController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def trace_params
|
def trace_params
|
||||||
params.require(:trace).permit(:description, :tagstring, :visibility)
|
params.expect(:trace => [:description, :tagstring, :visibility])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -238,9 +238,9 @@ class UsersController < ApplicationController
|
||||||
##
|
##
|
||||||
# return permitted user parameters
|
# return permitted user parameters
|
||||||
def user_params
|
def user_params
|
||||||
params.require(:user).permit(:email, :display_name,
|
params.expect(:user => [:email, :display_name,
|
||||||
:auth_provider, :auth_uid,
|
:auth_provider, :auth_uid,
|
||||||
:pass_crypt, :pass_crypt_confirmation)
|
:pass_crypt, :pass_crypt_confirmation])
|
||||||
end
|
end
|
||||||
|
|
||||||
##
|
##
|
||||||
|
|
2
bin/dev
Executable file
2
bin/dev
Executable file
|
@ -0,0 +1,2 @@
|
||||||
|
#!/usr/bin/env ruby
|
||||||
|
exec "./bin/rails", "server", *ARGV
|
13
bin/setup
13
bin/setup
|
@ -2,7 +2,6 @@
|
||||||
require "fileutils"
|
require "fileutils"
|
||||||
|
|
||||||
APP_ROOT = File.expand_path("..", __dir__)
|
APP_ROOT = File.expand_path("..", __dir__)
|
||||||
APP_NAME = "openstreetmap".freeze
|
|
||||||
|
|
||||||
def system!(*)
|
def system!(*)
|
||||||
system(*, :exception => true)
|
system(*, :exception => true)
|
||||||
|
@ -14,7 +13,6 @@ FileUtils.chdir APP_ROOT do
|
||||||
# Add necessary setup steps to this file.
|
# Add necessary setup steps to this file.
|
||||||
|
|
||||||
puts "== Installing dependencies =="
|
puts "== Installing dependencies =="
|
||||||
system! "gem install bundler --conservative"
|
|
||||||
system("bundle check") || system!("bundle install")
|
system("bundle check") || system!("bundle install")
|
||||||
|
|
||||||
# puts "\n== Copying sample files =="
|
# puts "\n== Copying sample files =="
|
||||||
|
@ -28,10 +26,9 @@ FileUtils.chdir APP_ROOT do
|
||||||
puts "\n== Removing old logs and tempfiles =="
|
puts "\n== Removing old logs and tempfiles =="
|
||||||
system! "bin/rails log:clear tmp:clear"
|
system! "bin/rails log:clear tmp:clear"
|
||||||
|
|
||||||
puts "\n== Restarting application server =="
|
unless ARGV.include?("--skip-server")
|
||||||
system! "bin/rails restart"
|
puts "\n== Starting development server =="
|
||||||
|
$stdout.flush # flush the output before exec(2) so that it displays
|
||||||
# puts "\n== Configuring puma-dev =="
|
exec "bin/dev"
|
||||||
# system "ln -nfs #{APP_ROOT} ~/.puma-dev/#{APP_NAME}"
|
end
|
||||||
# system "curl -Is https://#{APP_NAME}.test/up | head -n 1"
|
|
||||||
end
|
end
|
||||||
|
|
5
bin/thrust
Executable file
5
bin/thrust
Executable file
|
@ -0,0 +1,5 @@
|
||||||
|
#!/usr/bin/env ruby
|
||||||
|
require "rubygems"
|
||||||
|
require "bundler/setup"
|
||||||
|
|
||||||
|
load Gem.bin_path("thruster", "thrust")
|
|
@ -3,9 +3,7 @@ require "active_support/core_ext/integer/time"
|
||||||
Rails.application.configure do
|
Rails.application.configure do
|
||||||
# Settings specified here will take precedence over those in config/application.rb.
|
# Settings specified here will take precedence over those in config/application.rb.
|
||||||
|
|
||||||
# In the development environment your application's code is reloaded any time
|
# Make code changes take effect immediately without server restart.
|
||||||
# it changes. This slows down response time but is perfect for development
|
|
||||||
# since you don't have to restart the web server when you make code changes.
|
|
||||||
config.enable_reloading = true
|
config.enable_reloading = true
|
||||||
|
|
||||||
# Do not eager load code on boot.
|
# Do not eager load code on boot.
|
||||||
|
@ -17,53 +15,46 @@ Rails.application.configure do
|
||||||
# Enable server timing.
|
# Enable server timing.
|
||||||
config.server_timing = true
|
config.server_timing = true
|
||||||
|
|
||||||
# Enable/disable caching. By default caching is disabled.
|
# Enable/disable Action Controller caching. By default Action Controller caching is disabled.
|
||||||
# Run rails dev:cache to toggle caching.
|
# Run rails dev:cache to toggle Action Controller caching.
|
||||||
if Rails.root.join("tmp/caching-dev.txt").exist?
|
if Rails.root.join("tmp/caching-dev.txt").exist?
|
||||||
config.action_controller.perform_caching = true
|
config.action_controller.perform_caching = true
|
||||||
config.action_controller.enable_fragment_cache_logging = true
|
config.action_controller.enable_fragment_cache_logging = true
|
||||||
|
config.public_file_server.headers = { "cache-control" => "public, max-age=#{2.days.to_i}" }
|
||||||
config.cache_store = :memory_store
|
|
||||||
config.public_file_server.headers = { "Cache-Control" => "public, max-age=#{2.days.to_i}" }
|
|
||||||
else
|
else
|
||||||
config.action_controller.perform_caching = false
|
config.action_controller.perform_caching = false
|
||||||
|
|
||||||
config.cache_store = :null_store
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Change to :null_store to avoid any caching.
|
||||||
|
config.cache_store = :memory_store
|
||||||
|
|
||||||
# Store uploaded files on the local file system (see config/storage.yml for options).
|
# Store uploaded files on the local file system (see config/storage.yml for options).
|
||||||
config.active_storage.service = :local
|
config.active_storage.service = :local
|
||||||
|
|
||||||
# Don't care if the mailer can't send.
|
# Don't care if the mailer can't send.
|
||||||
config.action_mailer.raise_delivery_errors = false
|
config.action_mailer.raise_delivery_errors = false
|
||||||
|
|
||||||
# Disable caching for Action Mailer templates even if Action Controller
|
# Make template changes take effect immediately.
|
||||||
# caching is enabled.
|
|
||||||
config.action_mailer.perform_caching = false
|
config.action_mailer.perform_caching = false
|
||||||
|
|
||||||
|
# Set localhost to be used by links generated in mailer templates.
|
||||||
config.action_mailer.default_url_options = { :host => "localhost", :port => 3000 }
|
config.action_mailer.default_url_options = { :host => "localhost", :port => 3000 }
|
||||||
|
|
||||||
# Print deprecation notices to the Rails logger.
|
# Print deprecation notices to the Rails logger.
|
||||||
config.active_support.deprecation = :log
|
config.active_support.deprecation = :log
|
||||||
|
|
||||||
# Raise exceptions for disallowed deprecations.
|
|
||||||
config.active_support.disallowed_deprecation = :raise
|
|
||||||
|
|
||||||
# Tell Active Support which deprecation messages to disallow.
|
|
||||||
config.active_support.disallowed_deprecation_warnings = []
|
|
||||||
|
|
||||||
# Raise an error on page load if there are pending migrations.
|
# Raise an error on page load if there are pending migrations.
|
||||||
config.active_record.migration_error = :page_load unless Settings.status == "database_offline"
|
config.active_record.migration_error = :page_load unless Settings.status == "database_offline"
|
||||||
|
|
||||||
# Highlight code that triggered database queries in logs.
|
# Highlight code that triggered database queries in logs.
|
||||||
config.active_record.verbose_query_logs = true unless Settings.status == "database_offline"
|
config.active_record.verbose_query_logs = true unless Settings.status == "database_offline"
|
||||||
|
|
||||||
|
# Append comments with runtime information tags to SQL queries in logs.
|
||||||
|
config.active_record.query_log_tags_enabled = true
|
||||||
|
|
||||||
# Highlight code that enqueued background job in logs.
|
# Highlight code that enqueued background job in logs.
|
||||||
config.active_job.verbose_enqueue_logs = true
|
config.active_job.verbose_enqueue_logs = true
|
||||||
|
|
||||||
# Suppress logger output for asset requests.
|
|
||||||
config.assets.quiet = true
|
|
||||||
|
|
||||||
# Export translations automatically.
|
# Export translations automatically.
|
||||||
config.middleware.use I18n::JS::Middleware
|
config.middleware.use I18n::JS::Middleware
|
||||||
|
|
||||||
|
|
|
@ -6,83 +6,51 @@ Rails.application.configure do
|
||||||
# Code is not reloaded between requests.
|
# Code is not reloaded between requests.
|
||||||
config.enable_reloading = false
|
config.enable_reloading = false
|
||||||
|
|
||||||
# Eager load code on boot. This eager loads most of Rails and
|
# Eager load code on boot for better performance and memory savings (ignored by Rake tasks).
|
||||||
# your application in memory, allowing both threaded web servers
|
|
||||||
# and those relying on copy on write to perform better.
|
|
||||||
# Rake tasks automatically ignore this option for performance.
|
|
||||||
config.eager_load = true
|
config.eager_load = true
|
||||||
|
|
||||||
# Full error reports are disabled and caching is turned on.
|
# Full error reports are disabled.
|
||||||
config.consider_all_requests_local = false
|
config.consider_all_requests_local = false
|
||||||
|
|
||||||
|
# Turn on fragment caching in view templates.
|
||||||
config.action_controller.perform_caching = true
|
config.action_controller.perform_caching = true
|
||||||
|
|
||||||
# Ensures that a master key has been made available in ENV["RAILS_MASTER_KEY"], config/master.key, or an environment
|
# Cache assets for far-future expiry since they are all digest stamped.
|
||||||
# key such as config/credentials/production.key. This key is used to decrypt credentials (and other encrypted files).
|
config.public_file_server.headers = { "cache-control" => "public, max-age=#{1.year.to_i}" }
|
||||||
# config.require_master_key = true
|
|
||||||
|
|
||||||
# Disable serving static files from `public/`, relying on NGINX/Apache to do so instead.
|
|
||||||
# config.public_file_server.enabled = false
|
|
||||||
|
|
||||||
# Compress JavaScripts using a preprocessor.
|
|
||||||
config.assets.js_compressor = Terser.new
|
|
||||||
|
|
||||||
# Compress CSS using a preprocessor.
|
|
||||||
# config.assets.css_compressor = :sass
|
|
||||||
|
|
||||||
# Do not fall back to assets pipeline if a precompiled asset is missed.
|
|
||||||
config.assets.compile = false
|
|
||||||
|
|
||||||
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
|
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
|
||||||
# config.asset_host = "http://assets.example.com"
|
# config.asset_host = "http://assets.example.com"
|
||||||
|
|
||||||
# Specifies the header that your server uses for sending files.
|
|
||||||
# config.action_dispatch.x_sendfile_header = "X-Sendfile" # for Apache
|
|
||||||
# config.action_dispatch.x_sendfile_header = "X-Accel-Redirect" # for NGINX
|
|
||||||
|
|
||||||
# Store uploaded files on the local file system (see config/storage.yml for options).
|
# Store uploaded files on the local file system (see config/storage.yml for options).
|
||||||
config.active_storage.service = :local
|
config.active_storage.service = :local
|
||||||
|
|
||||||
# Mount Action Cable outside main process or domain.
|
|
||||||
# config.action_cable.mount_path = nil
|
|
||||||
# config.action_cable.url = "wss://example.com/cable"
|
|
||||||
# config.action_cable.allowed_request_origins = [ "http://example.com", /http:\/\/example.*/ ]
|
|
||||||
|
|
||||||
# Assume all access to the app is happening through a SSL-terminating reverse proxy.
|
# Assume all access to the app is happening through a SSL-terminating reverse proxy.
|
||||||
# Can be used together with config.force_ssl for Strict-Transport-Security and secure cookies.
|
config.assume_ssl = true
|
||||||
# config.assume_ssl = true
|
|
||||||
|
|
||||||
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
|
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
|
||||||
# config.force_ssl = true
|
config.force_ssl = true
|
||||||
|
|
||||||
# Skip http-to-https redirect for the default health check endpoint.
|
# Skip http-to-https redirect for the default health check endpoint.
|
||||||
# config.ssl_options = { redirect: { exclude: ->(request) { request.path == "/up" } } }
|
# config.ssl_options = { redirect: { exclude: ->(request) { request.path == "/up" } } }
|
||||||
|
|
||||||
# Log to STDOUT by default
|
# Log to STDOUT with the current request id as a default log tag.
|
||||||
# config.logger = ActiveSupport::Logger.new(STDOUT)
|
|
||||||
# .tap { |logger| logger.formatter = ::Logger::Formatter.new }
|
|
||||||
# .then { |logger| ActiveSupport::TaggedLogging.new(logger) }
|
|
||||||
|
|
||||||
# Prepend all log lines with the following tags.
|
|
||||||
config.log_tags = [:request_id]
|
config.log_tags = [:request_id]
|
||||||
|
config.logger = ActiveSupport::TaggedLogging.logger($stdout)
|
||||||
|
|
||||||
# "info" includes generic and useful information about system operation, but avoids logging too much
|
# Change to "debug" to log everything (including potentially personally-identifiable information!)
|
||||||
# information to avoid inadvertent exposure of personally identifiable information (PII). If you
|
|
||||||
# want to log everything, set the level to "debug".
|
|
||||||
config.log_level = ENV.fetch("RAILS_LOG_LEVEL", "info")
|
config.log_level = ENV.fetch("RAILS_LOG_LEVEL", "info")
|
||||||
|
|
||||||
# Use a different log path in production.
|
# Prevent health checks from clogging up the logs.
|
||||||
config.paths["log"] = Settings.log_path if Settings.key?(:log_path)
|
config.silence_healthcheck_path = "/up"
|
||||||
|
|
||||||
# Use a different cache store in production.
|
# Don't log any deprecations.
|
||||||
|
config.active_support.report_deprecations = false
|
||||||
|
|
||||||
|
# Replace the default in-process memory cache store with a durable alternative.
|
||||||
# config.cache_store = :mem_cache_store
|
# config.cache_store = :mem_cache_store
|
||||||
|
|
||||||
# Use a real queuing backend for Active Job (and separate queues per environment).
|
# Replace the default in-process and non-durable queuing backend for Active Job.
|
||||||
# config.active_job.queue_adapter = :resque
|
# config.active_job.queue_adapter = :resque
|
||||||
# config.active_job.queue_name_prefix = "openstreetmap_production"
|
|
||||||
|
|
||||||
# Disable caching for Action Mailer templates even if Action Controller
|
|
||||||
# caching is enabled.
|
|
||||||
config.action_mailer.perform_caching = false
|
|
||||||
|
|
||||||
# Configure caching of static assets
|
# Configure caching of static assets
|
||||||
config.action_controller.page_cache_directory = Rails.public_path
|
config.action_controller.page_cache_directory = Rails.public_path
|
||||||
|
@ -91,21 +59,34 @@ Rails.application.configure do
|
||||||
# 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
|
||||||
|
|
||||||
|
# Set host to be used by links generated in mailer templates.
|
||||||
|
config.action_mailer.default_url_options = { :host => "example.com" }
|
||||||
|
|
||||||
|
# Specify outgoing SMTP server. Remember to add smtp/* credentials via rails credentials:edit.
|
||||||
|
# config.action_mailer.smtp_settings = {
|
||||||
|
# user_name: Rails.application.credentials.dig(:smtp, :user_name),
|
||||||
|
# password: Rails.application.credentials.dig(:smtp, :password),
|
||||||
|
# address: "smtp.example.com",
|
||||||
|
# port: 587,
|
||||||
|
# authentication: :plain
|
||||||
|
# }
|
||||||
|
|
||||||
# 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).
|
||||||
config.i18n.fallbacks = true
|
config.i18n.fallbacks = true
|
||||||
|
|
||||||
# Don't log any deprecations.
|
|
||||||
config.active_support.report_deprecations = false
|
|
||||||
|
|
||||||
# Do not dump schema after migrations.
|
# Do not dump schema after migrations.
|
||||||
config.active_record.dump_schema_after_migration = false unless Settings.status == "database_offline"
|
config.active_record.dump_schema_after_migration = false unless Settings.status == "database_offline"
|
||||||
|
|
||||||
|
# Only use :id for inspections in production.
|
||||||
|
config.active_record.attributes_for_inspect = [:id]
|
||||||
|
|
||||||
# Enable DNS rebinding protection and other `Host` header attacks.
|
# Enable DNS rebinding protection and other `Host` header attacks.
|
||||||
# config.hosts = [
|
# config.hosts = [
|
||||||
# "example.com", # Allow requests from example.com
|
# "example.com", # Allow requests from example.com
|
||||||
# /.*\.example\.com/ # Allow requests from subdomains like `www.example.com`
|
# /.*\.example\.com/ # Allow requests from subdomains like `www.example.com`
|
||||||
# ]
|
# ]
|
||||||
|
#
|
||||||
# Skip DNS rebinding protection for the default health check endpoint.
|
# Skip DNS rebinding protection for the default health check endpoint.
|
||||||
# config.host_authorization = { exclude: ->(request) { request.path == "/up" } }
|
# config.host_authorization = { exclude: ->(request) { request.path == "/up" } }
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require "active_support/core_ext/integer/time"
|
|
||||||
|
|
||||||
# The test environment is used exclusively to run your application's
|
# The test environment is used exclusively to run your application's
|
||||||
# test suite. You never need to work with it otherwise. Remember that
|
# test suite. You never need to work with it otherwise. Remember that
|
||||||
# your test database is "scratch space" for the test suite and is wiped
|
# your test database is "scratch space" for the test suite and is wiped
|
||||||
|
@ -17,12 +15,11 @@ Rails.application.configure do
|
||||||
# loading is working properly before deploying your code.
|
# loading is working properly before deploying your code.
|
||||||
config.eager_load = ENV["CI"].present?
|
config.eager_load = ENV["CI"].present?
|
||||||
|
|
||||||
# Configure public file server for tests with Cache-Control for performance.
|
# Configure public file server for tests with cache-control for performance.
|
||||||
config.public_file_server.headers = { "Cache-Control" => "public, max-age=#{1.hour.to_i}" }
|
config.public_file_server.headers = { "cache-control" => "public, max-age=3600" }
|
||||||
|
|
||||||
# Show full error reports and disable caching.
|
# Show full error reports.
|
||||||
config.consider_all_requests_local = true
|
config.consider_all_requests_local = true
|
||||||
config.action_controller.perform_caching = false
|
|
||||||
config.cache_store = :null_store
|
config.cache_store = :null_store
|
||||||
|
|
||||||
# Render exception templates for rescuable exceptions and raise for other exceptions.
|
# Render exception templates for rescuable exceptions and raise for other exceptions.
|
||||||
|
@ -37,31 +34,17 @@ Rails.application.configure do
|
||||||
# Disable logging in tests, for speed increases. Set to :info to bring back logging
|
# Disable logging in tests, for speed increases. Set to :info to bring back logging
|
||||||
config.log_level = :warn
|
config.log_level = :warn
|
||||||
|
|
||||||
# Disable caching for Action Mailer templates even if Action Controller
|
|
||||||
# caching is enabled.
|
|
||||||
config.action_mailer.perform_caching = false
|
|
||||||
|
|
||||||
# Tell Action Mailer not to deliver emails to the real world.
|
# Tell Action Mailer not to deliver emails to the real world.
|
||||||
# The :test delivery method accumulates sent emails in the
|
# The :test delivery method accumulates sent emails in the
|
||||||
# ActionMailer::Base.deliveries array.
|
# ActionMailer::Base.deliveries array.
|
||||||
config.action_mailer.delivery_method = :test
|
config.action_mailer.delivery_method = :test
|
||||||
|
|
||||||
# Unlike controllers, the mailer instance doesn't have any context about the
|
# Set host to be used by links generated in mailer templates.
|
||||||
# incoming request so you'll need to provide the :host parameter yourself.
|
|
||||||
config.action_mailer.default_url_options = { :host => Settings.server_url }
|
config.action_mailer.default_url_options = { :host => Settings.server_url }
|
||||||
|
|
||||||
# Print deprecation notices to the stderr.
|
# Print deprecation notices to the stderr.
|
||||||
config.active_support.deprecation = :stderr
|
config.active_support.deprecation = :stderr
|
||||||
|
|
||||||
# Raise exceptions for disallowed deprecations.
|
|
||||||
config.active_support.disallowed_deprecation = :raise
|
|
||||||
|
|
||||||
# Tell Active Support which deprecation messages to disallow.
|
|
||||||
config.active_support.disallowed_deprecation_warnings = []
|
|
||||||
|
|
||||||
# Export translations automatically.
|
|
||||||
config.middleware.use I18n::JS::Middleware
|
|
||||||
|
|
||||||
# Raises error for missing translations.
|
# Raises error for missing translations.
|
||||||
config.i18n.raise_on_missing_translations = true
|
config.i18n.raise_on_missing_translations = true
|
||||||
|
|
||||||
|
@ -74,6 +57,9 @@ Rails.application.configure do
|
||||||
# Use the test adapter for ActiveJob during testing.
|
# Use the test adapter for ActiveJob during testing.
|
||||||
config.active_job.queue_adapter = :test
|
config.active_job.queue_adapter = :test
|
||||||
|
|
||||||
# Allow FactoryBot to set primary key attributes
|
# Allow FactoryBot to set primary key attributes.
|
||||||
config.factory_bot.reject_primary_key_attributes = false
|
config.factory_bot.reject_primary_key_attributes = false
|
||||||
|
|
||||||
|
# Disable page caching.
|
||||||
|
config.action_controller.perform_caching = false
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,23 +1,23 @@
|
||||||
CanonicalRails.setup do |config|
|
# CanonicalRails.setup do |config|
|
||||||
# Force the protocol. If you do not specify, the protocol will be based on the incoming request's protocol.
|
# # Force the protocol. If you do not specify, the protocol will be based on the incoming request's protocol.
|
||||||
|
|
||||||
config.protocol = "#{Settings.server_protocol}://"
|
# config.protocol = "#{Settings.server_protocol}://"
|
||||||
|
|
||||||
# This is the main host, not just the TLD, omit slashes and protocol. If you have more than one, pick the one you want to rank in search results.
|
# # This is the main host, not just the TLD, omit slashes and protocol. If you have more than one, pick the one you want to rank in search results.
|
||||||
|
|
||||||
config.host = Settings.server_url
|
# config.host = Settings.server_url
|
||||||
config.port = Settings.server_protocol == "https" ? 443 : 80
|
# config.port = Settings.server_protocol == "https" ? 443 : 80
|
||||||
|
|
||||||
# http://en.wikipedia.org/wiki/URL_normalization
|
# # http://en.wikipedia.org/wiki/URL_normalization
|
||||||
# Trailing slash represents semantics of a directory, ie a collection view - implying an :index get route;
|
# # Trailing slash represents semantics of a directory, ie a collection view - implying an :index get route;
|
||||||
# otherwise we have to assume semantics of an instance of a resource type, a member view - implying a :show get route
|
# # otherwise we have to assume semantics of an instance of a resource type, a member view - implying a :show get route
|
||||||
#
|
# #
|
||||||
# Acts as a whitelist for routes to have trailing slashes
|
# # Acts as a whitelist for routes to have trailing slashes
|
||||||
|
|
||||||
config.collection_actions = [:index]
|
# config.collection_actions = [:index]
|
||||||
|
|
||||||
# Parameter spamming can cause index dilution by creating seemingly different URLs with identical or near-identical content.
|
# # Parameter spamming can cause index dilution by creating seemingly different URLs with identical or near-identical content.
|
||||||
# Unless whitelisted, these parameters will be omitted
|
# # Unless whitelisted, these parameters will be omitted
|
||||||
|
|
||||||
config.whitelisted_parameters = []
|
# config.whitelisted_parameters = []
|
||||||
end
|
# end
|
||||||
|
|
|
@ -36,9 +36,9 @@ Rails.application.configure do
|
||||||
policy.report_uri(Settings.csp_report_url) if Settings.key?(:csp_report_url)
|
policy.report_uri(Settings.csp_report_url) if Settings.key?(:csp_report_url)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Generate session nonces for permitted importmap and inline scripts
|
# Generate session nonces for permitted importmap, inline scripts, and inline styles.
|
||||||
config.content_security_policy_nonce_generator = ->(_request) { SecureRandom.base64(24) }
|
config.content_security_policy_nonce_generator = ->(_request) { SecureRandom.base64(24) }
|
||||||
config.content_security_policy_nonce_directives = %w[style-src]
|
config.content_security_policy_nonce_directives = %w[script-src style-src]
|
||||||
|
|
||||||
# Report violations without enforcing the policy.
|
# Report violations without enforcing the policy.
|
||||||
config.content_security_policy_report_only = true unless Settings.csp_enforce
|
config.content_security_policy_report_only = true unless Settings.csp_enforce
|
||||||
|
|
30
config/initializers/new_framework_defaults_8_0.rb
Normal file
30
config/initializers/new_framework_defaults_8_0.rb
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
# Be sure to restart your server when you modify this file.
|
||||||
|
#
|
||||||
|
# This file eases your Rails 8.0 framework defaults upgrade.
|
||||||
|
#
|
||||||
|
# Uncomment each configuration one by one to switch to the new default.
|
||||||
|
# Once your application is ready to run with all new defaults, you can remove
|
||||||
|
# this file and set the `config.load_defaults` to `8.0`.
|
||||||
|
#
|
||||||
|
# Read the Guide for Upgrading Ruby on Rails for more info on each option.
|
||||||
|
# https://guides.rubyonrails.org/upgrading_ruby_on_rails.html
|
||||||
|
|
||||||
|
###
|
||||||
|
# Specifies whether `to_time` methods preserve the UTC offset of their receivers or preserves the timezone.
|
||||||
|
# If set to `:zone`, `to_time` methods will use the timezone of their receivers.
|
||||||
|
# If set to `:offset`, `to_time` methods will use the UTC offset.
|
||||||
|
# If `false`, `to_time` methods will convert to the local system UTC offset instead.
|
||||||
|
#++
|
||||||
|
# Rails.application.config.active_support.to_time_preserves_timezone = :zone
|
||||||
|
|
||||||
|
###
|
||||||
|
# When both `If-Modified-Since` and `If-None-Match` are provided by the client
|
||||||
|
# only consider `If-None-Match` as specified by RFC 7232 Section 6.
|
||||||
|
# If set to `false` both conditions need to be satisfied.
|
||||||
|
#++
|
||||||
|
# Rails.application.config.action_dispatch.strict_freshness = true
|
||||||
|
|
||||||
|
###
|
||||||
|
# Set `Regexp.timeout` to `1`s by default to improve security over Regexp Denial-of-Service attacks.
|
||||||
|
#++
|
||||||
|
# Regexp.timeout = 1
|
|
@ -1,13 +1,17 @@
|
||||||
# This configuration file will be evaluated by Puma. The top-level methods that
|
# This configuration file will be evaluated by Puma. The top-level methods that
|
||||||
# are invoked here are part of Puma's configuration DSL. For more information
|
# are invoked here are part of Puma's configuration DSL. For more information
|
||||||
# about methods provided by the DSL, see https://puma.io/puma/Puma/DSL.html.
|
# about methods provided by the DSL, see https://puma.io/puma/Puma/DSL.html.
|
||||||
|
#
|
||||||
# Puma starts a configurable number of processes (workers) and each process
|
# Puma starts a configurable number of processes (workers) and each process
|
||||||
# serves each request in a thread from an internal thread pool.
|
# serves each request in a thread from an internal thread pool.
|
||||||
#
|
#
|
||||||
|
# You can control the number of workers using ENV["WEB_CONCURRENCY"]. You
|
||||||
|
# should only set this value when you want to run 2 or more workers. The
|
||||||
|
# default is already 1.
|
||||||
|
#
|
||||||
# The ideal number of threads per worker depends both on how much time the
|
# The ideal number of threads per worker depends both on how much time the
|
||||||
# application spends waiting for IO operations and on how much you wish to
|
# application spends waiting for IO operations and on how much you wish to
|
||||||
# to prioritize throughput over latency.
|
# prioritize throughput over latency.
|
||||||
#
|
#
|
||||||
# As a rule of thumb, increasing the number of threads will increase how much
|
# As a rule of thumb, increasing the number of threads will increase how much
|
||||||
# traffic a given process can handle (throughput), but due to CRuby's
|
# traffic a given process can handle (throughput), but due to CRuby's
|
||||||
|
@ -29,5 +33,9 @@ port ENV.fetch("PORT", 3000)
|
||||||
# Allow puma to be restarted by `bin/rails restart` command.
|
# Allow puma to be restarted by `bin/rails restart` command.
|
||||||
plugin :tmp_restart
|
plugin :tmp_restart
|
||||||
|
|
||||||
# Only use a pidfile when requested
|
# Run the Solid Queue supervisor inside of Puma for single-server deployments
|
||||||
|
plugin :solid_queue if ENV["SOLID_QUEUE_IN_PUMA"]
|
||||||
|
|
||||||
|
# Specify the PID file. Defaults to tmp/pids/server.pid in development.
|
||||||
|
# In other environments, only set the PID file if requested.
|
||||||
pidfile ENV["PIDFILE"] if ENV["PIDFILE"]
|
pidfile ENV["PIDFILE"] if ENV["PIDFILE"]
|
||||||
|
|
|
@ -15,7 +15,7 @@ class NodeVersionsTest < ActionDispatch::IntegrationTest
|
||||||
propagate_tags(node, node.old_nodes.last)
|
propagate_tags(node, node.old_nodes.last)
|
||||||
|
|
||||||
## First try this with a non-public user
|
## First try this with a non-public user
|
||||||
auth_header = bearer_authorization_header private_user
|
auth_header = request_headers private_user
|
||||||
|
|
||||||
# setup a simple XML node
|
# setup a simple XML node
|
||||||
xml_doc = xml_for_node(private_node)
|
xml_doc = xml_for_node(private_node)
|
||||||
|
@ -62,7 +62,7 @@ class NodeVersionsTest < ActionDispatch::IntegrationTest
|
||||||
# probably should check that they didn't get written to the database
|
# probably should check that they didn't get written to the database
|
||||||
|
|
||||||
## Now do it with the public user
|
## Now do it with the public user
|
||||||
auth_header = bearer_authorization_header user
|
auth_header = request_headers user
|
||||||
|
|
||||||
# setup a simple XML node
|
# setup a simple XML node
|
||||||
|
|
||||||
|
@ -191,4 +191,8 @@ class NodeVersionsTest < ActionDispatch::IntegrationTest
|
||||||
create(:old_node_tag, :old_node => old_node, :k => k, :v => v)
|
create(:old_node_tag, :old_node => old_node, :k => k, :v => v)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def request_headers(user)
|
||||||
|
bearer_authorization_header(user).merge("Content-Type" => "application/xml")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue