Compare commits

...

15 Commits

Author SHA1 Message Date
d5a396f53a Fixed the tests and apart from one, they all work 2026-05-02 11:10:25 +00:00
5a38d132b8 Fixed some model tests 2026-05-02 10:51:55 +00:00
6ebb7390d5 Just checking in 2026-05-02 10:46:08 +00:00
92ceddc32e database updated to create domain crendtial references 2026-04-30 15:18:51 +00:00
791034f7a4 readme updated 2026-04-27 12:24:18 +00:00
9267adbecb Latest checkin 2026-04-27 12:09:40 +00:00
b6e558e6dd Lets get the tests working 2026-04-23 12:09:35 +00:00
d1222a6baa Added database creation to the readme 2026-04-23 11:41:36 +00:00
02185cac54 Database installed but not working 2026-04-23 11:26:27 +00:00
03b5ab680b Did Bundle update in the wrong dir 2026-04-23 11:19:11 +00:00
bfd075048d Latest bin files 2026-04-23 11:08:50 +00:00
7d2be7f137 Still not working 2026-04-23 11:06:09 +00:00
d963716372 First bit of config done 2026-04-23 10:59:24 +00:00
5991fd1296 Gemspec updated 2026-04-23 10:54:13 +00:00
5d472a6271 Changed Gemfile 2026-04-23 10:41:10 +00:00
31 changed files with 551 additions and 313 deletions

8
.rubocop.yml Normal file
View File

@@ -0,0 +1,8 @@
# Omakase Ruby styling for Rails
inherit_gem: { rubocop-rails-omakase: rubocop.yml }
# Overwrite or add rules to create your own house style
#
# # Use `[a, [b, c]]` not `[ a, [ b, c ] ]`
# Layout/SpaceInsideArrayLiteralBrackets:
# Enabled: false

62
Gemfile
View File

@@ -1,10 +1,16 @@
source "https://rubygems.org" source "https://rubygems.org"
git_source(:github) { |repo| "https://github.com/#{repo}.git" } git_source(:github) { |repo| "https://github.com/#{repo}.git" }
ruby "3.3.1" ruby "4.0.2"
# Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main" # Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main"
gem "rails", "7.1.3.3" gem "rails", "8.1.3"
gem "propshaft"
gem "puma", "~> 6.0"
gem "importmap-rails"
gem "turbo-rails"
gem "stimulus-rails"
gem "jbuilder"
gem 'devise' gem 'devise'
gem 'devise-two-factor' gem 'devise-two-factor'
@@ -16,35 +22,18 @@ gem "sprockets-rails"
# Use mysql as the database for Active Record # Use mysql as the database for Active Record
gem "mysql2", "~> 0.5" gem "mysql2", "~> 0.5"
# Use the Puma web server [https://github.com/puma/puma]
gem "puma", "~> 6.0"
# Use JavaScript with ESM import maps [https://github.com/rails/importmap-rails] gem "tzinfo-data", platforms: %i[ windows jruby ]
gem "importmap-rails"
# Hotwire's SPA-like page accelerator [https://turbo.hotwired.dev] # Use the database-backed adapters for Rails.cache, Active Job, and Action Cable
gem "turbo-rails" gem "solid_cache"
gem "solid_queue"
# Hotwire's modest JavaScript framework [https://stimulus.hotwired.dev] gem "solid_cable"
gem "stimulus-rails"
# Build JSON APIs with ease [https://github.com/rails/jbuilder]
gem "jbuilder"
# Use Redis adapter to run Action Cable in production
# gem "redis", "~> 4.0"
# Use Kredis to get higher-level data types in Redis [https://github.com/rails/kredis]
# gem "kredis"
# Use Active Model has_secure_password [https://guides.rubyonrails.org/active_model_basics.html#securepassword]
# gem "bcrypt", "~> 3.1.7"
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem "tzinfo-data", platforms: %i[ mingw mswin x64_mingw jruby ]
# Reduces boot times through caching; required in config/boot.rb # Reduces boot times through caching; required in config/boot.rb
gem "bootsnap", require: false gem "bootsnap", require: false
gem "thruster", require: false
gem "image_processing", "~> 1.2"
# Use Sass to process CSS # Use Sass to process CSS
# gem "sassc-rails" # gem "sassc-rails"
@@ -54,22 +43,25 @@ gem "bootsnap", require: false
group :development, :test do group :development, :test do
# See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem # See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem
gem "debug", platforms: %i[ mri mingw x64_mingw ] gem "debug", platforms: %i[ mri windows ], require: "debug/prelude"
# Audits gems for known security defects (use config/bundler-audit.yml to ignore issues)
gem "bundler-audit", require: false
# Static analysis for security vulnerabilities [https://brakemanscanner.org/]
gem "brakeman", require: false
# Omakase Ruby styling [https://github.com/rails/rubocop-rails-omakase/]
gem "rubocop-rails-omakase", require: false
end end
group :development do group :development do
# Use console on exceptions pages [https://github.com/rails/web-console] # Use console on exceptions pages [https://github.com/rails/web-console]
gem "web-console" gem "web-console"
# Add speed badges [https://github.com/MiniProfiler/rack-mini-profiler]
# gem "rack-mini-profiler"
# Speed up commands on slow machines / big apps [https://github.com/rails/spring]
# gem "spring"
end end
group :test do group :test do
# Use system testing [https://guides.rubyonrails.org/testing.html#system-testing] # Use system testing [https://guides.rubyonrails.org/testing.html#system-testing]
gem "capybara" gem "capybara", "~> 3.40"
gem "selenium-webdriver" gem "selenium-webdriver", "~> 4.43"
end end

View File

@@ -1,89 +1,95 @@
GEM GEM
remote: https://rubygems.org/ remote: https://rubygems.org/
specs: specs:
actioncable (7.1.3.3) action_text-trix (2.1.18)
actionpack (= 7.1.3.3) railties
activesupport (= 7.1.3.3) actioncable (8.1.3)
actionpack (= 8.1.3)
activesupport (= 8.1.3)
nio4r (~> 2.0) nio4r (~> 2.0)
websocket-driver (>= 0.6.1) websocket-driver (>= 0.6.1)
zeitwerk (~> 2.6) zeitwerk (~> 2.6)
actionmailbox (7.1.3.3) actionmailbox (8.1.3)
actionpack (= 7.1.3.3) actionpack (= 8.1.3)
activejob (= 7.1.3.3) activejob (= 8.1.3)
activerecord (= 7.1.3.3) activerecord (= 8.1.3)
activestorage (= 7.1.3.3) activestorage (= 8.1.3)
activesupport (= 7.1.3.3) activesupport (= 8.1.3)
mail (>= 2.7.1) mail (>= 2.8.0)
net-imap actionmailer (8.1.3)
net-pop actionpack (= 8.1.3)
net-smtp actionview (= 8.1.3)
actionmailer (7.1.3.3) activejob (= 8.1.3)
actionpack (= 7.1.3.3) activesupport (= 8.1.3)
actionview (= 7.1.3.3) mail (>= 2.8.0)
activejob (= 7.1.3.3)
activesupport (= 7.1.3.3)
mail (~> 2.5, >= 2.5.4)
net-imap
net-pop
net-smtp
rails-dom-testing (~> 2.2) rails-dom-testing (~> 2.2)
actionpack (7.1.3.3) actionpack (8.1.3)
actionview (= 7.1.3.3) actionview (= 8.1.3)
activesupport (= 7.1.3.3) activesupport (= 8.1.3)
nokogiri (>= 1.8.5) nokogiri (>= 1.8.5)
racc
rack (>= 2.2.4) rack (>= 2.2.4)
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)
rails-html-sanitizer (~> 1.6) rails-html-sanitizer (~> 1.6)
actiontext (7.1.3.3) useragent (~> 0.16)
actionpack (= 7.1.3.3) actiontext (8.1.3)
activerecord (= 7.1.3.3) action_text-trix (~> 2.1.15)
activestorage (= 7.1.3.3) actionpack (= 8.1.3)
activesupport (= 7.1.3.3) activerecord (= 8.1.3)
activestorage (= 8.1.3)
activesupport (= 8.1.3)
globalid (>= 0.6.0) globalid (>= 0.6.0)
nokogiri (>= 1.8.5) nokogiri (>= 1.8.5)
actionview (7.1.3.3) actionview (8.1.3)
activesupport (= 7.1.3.3) activesupport (= 8.1.3)
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)
activejob (7.1.3.3) activejob (8.1.3)
activesupport (= 7.1.3.3) activesupport (= 8.1.3)
globalid (>= 0.3.6) globalid (>= 0.3.6)
activemodel (7.1.3.3) activemodel (8.1.3)
activesupport (= 7.1.3.3) activesupport (= 8.1.3)
activerecord (7.1.3.3) activerecord (8.1.3)
activemodel (= 7.1.3.3) activemodel (= 8.1.3)
activesupport (= 7.1.3.3) activesupport (= 8.1.3)
timeout (>= 0.4.0) timeout (>= 0.4.0)
activestorage (7.1.3.3) activestorage (8.1.3)
actionpack (= 7.1.3.3) actionpack (= 8.1.3)
activejob (= 7.1.3.3) activejob (= 8.1.3)
activerecord (= 7.1.3.3) activerecord (= 8.1.3)
activesupport (= 7.1.3.3) activesupport (= 8.1.3)
marcel (~> 1.0) marcel (~> 1.0)
activesupport (7.1.3.3) activesupport (8.1.3)
base64 base64
bigdecimal bigdecimal
concurrent-ruby (~> 1.0, >= 1.0.2) concurrent-ruby (~> 1.0, >= 1.3.1)
connection_pool (>= 2.2.5) connection_pool (>= 2.2.5)
drb drb
i18n (>= 1.6, < 2) i18n (>= 1.6, < 2)
json
logger (>= 1.4.2)
minitest (>= 5.1) minitest (>= 5.1)
mutex_m securerandom (>= 0.3)
tzinfo (~> 2.0) tzinfo (~> 2.0, >= 2.0.5)
addressable (2.8.6) uri (>= 0.13.1)
public_suffix (>= 2.0.2, < 6.0) addressable (2.9.0)
base64 (0.2.0) public_suffix (>= 2.0.2, < 8.0)
bcrypt (3.1.20) ast (2.4.3)
bigdecimal (3.1.8) base64 (0.3.0)
bcrypt (3.1.22)
bigdecimal (4.1.2)
bindex (0.8.1) bindex (0.8.1)
bootsnap (1.18.3) bootsnap (1.23.0)
msgpack (~> 1.2) msgpack (~> 1.2)
builder (3.2.4) brakeman (8.0.4)
racc
builder (3.3.0)
bundler-audit (0.9.3)
bundler (>= 1.2.0)
thor (~> 1.0)
capybara (3.40.0) capybara (3.40.0)
addressable addressable
matrix matrix
@@ -94,193 +100,297 @@ GEM
regexp_parser (>= 1.5, < 3.0) regexp_parser (>= 1.5, < 3.0)
xpath (~> 3.2) xpath (~> 3.2)
chunky_png (1.4.0) chunky_png (1.4.0)
concurrent-ruby (1.2.3) concurrent-ruby (1.3.6)
connection_pool (2.4.1) connection_pool (3.0.2)
crass (1.0.6) crass (1.0.6)
date (3.3.4) date (3.5.1)
debug (1.9.2) debug (1.11.1)
irb (~> 1.10) irb (~> 1.10)
reline (>= 0.3.8) reline (>= 0.3.8)
devise (4.9.4) devise (5.0.3)
bcrypt (~> 3.0) bcrypt (~> 3.0)
orm_adapter (~> 0.1) orm_adapter (~> 0.1)
railties (>= 4.1.0) railties (>= 7.0)
responders responders
warden (~> 1.2.3) warden (~> 1.2.3)
devise-two-factor (5.0.0) devise-two-factor (6.4.0)
activesupport (~> 7.0) activesupport (>= 7.2, < 8.2)
devise (~> 4.0) devise (>= 4.0, < 6.0)
railties (~> 7.0) railties (>= 7.2, < 8.2)
rotp (~> 6.0) rotp (~> 6.0)
drb (2.2.1) drb (2.2.3)
erubi (1.12.0) erb (6.0.4)
globalid (1.2.1) erubi (1.13.1)
et-orbi (1.4.0)
tzinfo
ffi (1.17.4)
fugit (1.12.1)
et-orbi (~> 1.4)
raabro (~> 1.4)
globalid (1.3.0)
activesupport (>= 6.1) activesupport (>= 6.1)
i18n (1.14.5) i18n (1.14.8)
concurrent-ruby (~> 1.0) concurrent-ruby (~> 1.0)
importmap-rails (2.0.1) image_processing (1.14.0)
mini_magick (>= 4.9.5, < 6)
ruby-vips (>= 2.0.17, < 3)
importmap-rails (2.2.3)
actionpack (>= 6.0.0) actionpack (>= 6.0.0)
activesupport (>= 6.0.0) activesupport (>= 6.0.0)
railties (>= 6.0.0) railties (>= 6.0.0)
io-console (0.7.2) io-console (0.8.2)
irb (1.13.1) irb (1.18.0)
pp (>= 0.6.0)
prism (>= 1.3.0)
rdoc (>= 4.0.0) rdoc (>= 4.0.0)
reline (>= 0.4.2) reline (>= 0.4.2)
jbuilder (2.12.0) jbuilder (2.14.1)
actionview (>= 5.0.0) actionview (>= 7.0.0)
activesupport (>= 5.0.0) activesupport (>= 7.0.0)
loofah (2.22.0) json (2.19.4)
language_server-protocol (3.17.0.5)
lint_roller (1.1.0)
logger (1.7.0)
loofah (2.25.1)
crass (~> 1.0.2) crass (~> 1.0.2)
nokogiri (>= 1.12.0) nokogiri (>= 1.12.0)
mail (2.8.1) mail (2.9.0)
logger
mini_mime (>= 0.1.1) mini_mime (>= 0.1.1)
net-imap net-imap
net-pop net-pop
net-smtp net-smtp
marcel (1.0.4) marcel (1.1.0)
matrix (0.4.2) matrix (0.4.3)
mini_magick (5.3.1)
logger
mini_mime (1.1.5) mini_mime (1.1.5)
mini_portile2 (2.8.6) mini_portile2 (2.8.9)
minitest (5.22.3) minitest (6.0.5)
msgpack (1.7.2) drb (~> 2.0)
mutex_m (0.2.0) prism (~> 1.5)
mysql2 (0.5.6) msgpack (1.8.0)
net-imap (0.4.11) mysql2 (0.5.7)
bigdecimal
net-imap (0.6.3)
date date
net-protocol net-protocol
net-pop (0.1.2) net-pop (0.1.2)
net-protocol net-protocol
net-protocol (0.2.2) net-protocol (0.2.2)
timeout timeout
net-smtp (0.5.0) net-smtp (0.5.1)
net-protocol net-protocol
nio4r (2.7.3) nio4r (2.7.5)
nokogiri (1.16.5) nokogiri (1.19.2)
mini_portile2 (~> 2.8.2) mini_portile2 (~> 2.8.2)
racc (~> 1.4) racc (~> 1.4)
orm_adapter (0.5.0) orm_adapter (0.5.0)
psych (5.1.2) parallel (2.0.1)
parser (3.3.11.1)
ast (~> 2.4.1)
racc
pp (0.6.3)
prettyprint
prettyprint (0.2.0)
prism (1.9.0)
propshaft (1.3.2)
actionpack (>= 7.0.0)
activesupport (>= 7.0.0)
rack
psych (5.3.1)
date
stringio stringio
public_suffix (5.0.5) public_suffix (7.0.5)
puma (6.4.2) puma (6.6.1)
nio4r (~> 2.0) nio4r (~> 2.0)
racc (1.7.3) raabro (1.4.0)
rack (3.0.11) racc (1.8.1)
rack-session (2.0.0) rack (3.2.6)
rack-session (2.1.2)
base64 (>= 0.1.0)
rack (>= 3.0.0) rack (>= 3.0.0)
rack-test (2.1.0) rack-test (2.2.0)
rack (>= 1.3) rack (>= 1.3)
rackup (2.1.0) rackup (2.3.1)
rack (>= 3) rack (>= 3)
webrick (~> 1.8) rails (8.1.3)
rails (7.1.3.3) actioncable (= 8.1.3)
actioncable (= 7.1.3.3) actionmailbox (= 8.1.3)
actionmailbox (= 7.1.3.3) actionmailer (= 8.1.3)
actionmailer (= 7.1.3.3) actionpack (= 8.1.3)
actionpack (= 7.1.3.3) actiontext (= 8.1.3)
actiontext (= 7.1.3.3) actionview (= 8.1.3)
actionview (= 7.1.3.3) activejob (= 8.1.3)
activejob (= 7.1.3.3) activemodel (= 8.1.3)
activemodel (= 7.1.3.3) activerecord (= 8.1.3)
activerecord (= 7.1.3.3) activestorage (= 8.1.3)
activestorage (= 7.1.3.3) activesupport (= 8.1.3)
activesupport (= 7.1.3.3)
bundler (>= 1.15.0) bundler (>= 1.15.0)
railties (= 7.1.3.3) railties (= 8.1.3)
rails-dom-testing (2.2.0) rails-dom-testing (2.3.0)
activesupport (>= 5.0.0) activesupport (>= 5.0.0)
minitest minitest
nokogiri (>= 1.6) nokogiri (>= 1.6)
rails-html-sanitizer (1.6.0) rails-html-sanitizer (1.7.0)
loofah (~> 2.21) loofah (~> 2.25)
nokogiri (~> 1.14) 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)
railties (7.1.3.3) railties (8.1.3)
actionpack (= 7.1.3.3) actionpack (= 8.1.3)
activesupport (= 7.1.3.3) activesupport (= 8.1.3)
irb irb (~> 1.13)
rackup (>= 1.0.0) rackup (>= 1.0.0)
rake (>= 12.2) rake (>= 12.2)
thor (~> 1.0, >= 1.2.2) thor (~> 1.0, >= 1.2.2)
tsort (>= 0.2)
zeitwerk (~> 2.6) zeitwerk (~> 2.6)
rake (13.2.1) rainbow (3.1.1)
rdoc (6.6.3.1) rake (13.4.2)
rdoc (7.2.0)
erb
psych (>= 4.0.0) psych (>= 4.0.0)
regexp_parser (2.9.1) tsort
reline (0.5.7) regexp_parser (2.12.0)
reline (0.6.3)
io-console (~> 0.5) io-console (~> 0.5)
responders (3.1.1) responders (3.2.0)
actionpack (>= 5.2) actionpack (>= 7.0)
railties (>= 5.2) railties (>= 7.0)
rexml (3.2.6) rexml (3.4.4)
rotp (6.3.0) rotp (6.3.0)
rqrcode (2.2.0) rqrcode (3.2.0)
chunky_png (~> 1.0) chunky_png (~> 1.0)
rqrcode_core (~> 1.0) rqrcode_core (~> 2.0)
rqrcode_core (1.2.0) rqrcode_core (2.1.0)
rubyzip (2.3.2) rubocop (1.86.1)
selenium-webdriver (4.20.1) json (~> 2.3)
language_server-protocol (~> 3.17.0.2)
lint_roller (~> 1.1.0)
parallel (>= 1.10)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 2.9.3, < 3.0)
rubocop-ast (>= 1.49.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 4.0)
rubocop-ast (1.49.1)
parser (>= 3.3.7.2)
prism (~> 1.7)
rubocop-performance (1.26.1)
lint_roller (~> 1.1)
rubocop (>= 1.75.0, < 2.0)
rubocop-ast (>= 1.47.1, < 2.0)
rubocop-rails (2.34.3)
activesupport (>= 4.2.0)
lint_roller (~> 1.1)
rack (>= 1.1)
rubocop (>= 1.75.0, < 2.0)
rubocop-ast (>= 1.44.0, < 2.0)
rubocop-rails-omakase (1.1.0)
rubocop (>= 1.72)
rubocop-performance (>= 1.24)
rubocop-rails (>= 2.30)
ruby-progressbar (1.13.0)
ruby-vips (2.3.0)
ffi (~> 1.12)
logger
rubyzip (3.2.2)
securerandom (0.4.1)
selenium-webdriver (4.43.0)
base64 (~> 0.2) base64 (~> 0.2)
logger (~> 1.4)
rexml (~> 3.2, >= 3.2.5) rexml (~> 3.2, >= 3.2.5)
rubyzip (>= 1.2.2, < 3.0) rubyzip (>= 1.2.2, < 4.0)
websocket (~> 1.0) websocket (~> 1.0)
sprockets (4.2.1) solid_cable (3.0.12)
actioncable (>= 7.2)
activejob (>= 7.2)
activerecord (>= 7.2)
railties (>= 7.2)
solid_cache (1.0.10)
activejob (>= 7.2)
activerecord (>= 7.2)
railties (>= 7.2)
solid_queue (1.4.0)
activejob (>= 7.1)
activerecord (>= 7.1)
concurrent-ruby (>= 1.3.1)
fugit (~> 1.11)
railties (>= 7.1)
thor (>= 1.3.1)
sprockets (4.2.2)
concurrent-ruby (~> 1.0) concurrent-ruby (~> 1.0)
logger
rack (>= 2.2.4, < 4) rack (>= 2.2.4, < 4)
sprockets-rails (3.4.2) sprockets-rails (3.5.2)
actionpack (>= 5.2) actionpack (>= 6.1)
activesupport (>= 5.2) activesupport (>= 6.1)
sprockets (>= 3.0.0) sprockets (>= 3.0.0)
stimulus-rails (1.3.3) stimulus-rails (1.3.4)
railties (>= 6.0.0)
stringio (3.1.0)
thor (1.3.1)
timeout (0.4.1)
turbo-rails (2.0.5)
actionpack (>= 6.0.0)
activejob (>= 6.0.0)
railties (>= 6.0.0) railties (>= 6.0.0)
stringio (3.2.0)
thor (1.5.0)
thruster (0.1.20)
timeout (0.6.1)
tsort (0.2.0)
turbo-rails (2.0.23)
actionpack (>= 7.1.0)
railties (>= 7.1.0)
tzinfo (2.0.6) tzinfo (2.0.6)
concurrent-ruby (~> 1.0) concurrent-ruby (~> 1.0)
unicode-display_width (3.2.0)
unicode-emoji (~> 4.1)
unicode-emoji (4.2.0)
uri (1.1.1)
useragent (0.16.11)
warden (1.2.9) warden (1.2.9)
rack (>= 2.0.9) rack (>= 2.0.9)
web-console (4.2.1) web-console (4.3.0)
actionview (>= 6.0.0) actionview (>= 8.0.0)
activemodel (>= 6.0.0)
bindex (>= 0.4.0) bindex (>= 0.4.0)
railties (>= 6.0.0) railties (>= 8.0.0)
webrick (1.8.1) websocket (1.2.11)
websocket (1.2.10) websocket-driver (0.8.0)
websocket-driver (0.7.6) base64
websocket-extensions (>= 0.1.0) websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5) websocket-extensions (0.1.5)
xpath (3.2.0) xpath (3.2.0)
nokogiri (~> 1.8) nokogiri (~> 1.8)
zeitwerk (2.6.14) zeitwerk (2.7.5)
PLATFORMS PLATFORMS
x86_64-openbsd x86_64-openbsd
DEPENDENCIES DEPENDENCIES
bootsnap bootsnap
capybara brakeman
bundler-audit
capybara (~> 3.40)
debug debug
devise devise
devise-two-factor devise-two-factor
image_processing (~> 1.2)
importmap-rails importmap-rails
jbuilder jbuilder
mysql2 (~> 0.5) mysql2 (~> 0.5)
propshaft
puma (~> 6.0) puma (~> 6.0)
rails (= 7.1.3.3) rails (= 8.1.3)
rqrcode rqrcode
selenium-webdriver rubocop-rails-omakase
selenium-webdriver (~> 4.43)
solid_cable
solid_cache
solid_queue
sprockets-rails sprockets-rails
stimulus-rails stimulus-rails
thruster
turbo-rails turbo-rails
tzinfo-data tzinfo-data
web-console web-console
RUBY VERSION RUBY VERSION
ruby 3.3.1p55 ruby 4.0.2p0
BUNDLED WITH BUNDLED WITH
2.3.26 2.3.26

View File

@@ -6,7 +6,27 @@ An ISC Licensed RoR app to manage your OpenSMTPD users.
## OpenBSD Instructions. ## OpenBSD Instructions.
doas pkg_add ```
doas pkg_add ruby
ln -sf /usr/local/bin/ruby40 /usr/local/bin/ruby
ln -sf /usr/local/bin/bundle40 /usr/local/bin/bundle
ln -sf /usr/local/bin/bundler40 /usr/local/bin/bundler
ln -sf /usr/local/bin/erb40 /usr/local/bin/erb
ln -sf /usr/local/bin/gem40 /usr/local/bin/gem
ln -sf /usr/local/bin/irb40 /usr/local/bin/irb
ln -sf /usr/local/bin/minitest40 /usr/local/bin/minitest
ln -sf /usr/local/bin/racc40 /usr/local/bin/racc
ln -sf /usr/local/bin/rake40 /usr/local/bin/rake
ln -sf /usr/local/bin/rbs40 /usr/local/bin/rbs
ln -sf /usr/local/bin/rdbg40 /usr/local/bin/rdbg
ln -sf /usr/local/bin/rdoc40 /usr/local/bin/rdoc
ln -sf /usr/local/bin/ri40 /usr/local/bin/ri
ln -sf /usr/local/bin/syntax_suggest40 /usr/local/bin/syntax_suggest
ln -sf /usr/local/bin/test-unit40 /usr/local/bin/test-unit
ln -sf /usr/local/bin/typeprof40 /usr/local/bin/typeprof
```
## Database schema ## Database schema
Is derived from https://github.com/OpenSMTPD/OpenSMTPD-extras/blob/master/extras/tables/table-mysql/table-mysql.5 Is derived from https://github.com/OpenSMTPD/OpenSMTPD-extras/blob/master/extras/tables/table-mysql/table-mysql.5
@@ -14,9 +34,9 @@ Is derived from https://github.com/OpenSMTPD/OpenSMTPD-extras/blob/master/extras
## Prerequisites ## Prerequisites
* Ruby version - 3.2.3 * Ruby version - 4.0.2
* Rails 7.1.3 * Rails 8.1.3
* System dependencies * System dependencies
@@ -24,7 +44,19 @@ Is derived from https://github.com/OpenSMTPD/OpenSMTPD-extras/blob/master/extras
* Database creation * Database creation
```
CREATE USER 'OpenSMTPD'@'localhost' IDENTIFIED BY 'password';
CREATE DATABASE OpenSMTPD;
GRANT ALL PRIVILEGES ON OpenSMTPD.* TO 'OpenSMTPD'@'localhost';
FLUSH PRIVILEGES;
```
* Database initialization * Database initialization
```
RAILS_ENV=production rails db:migrate
RAILS_ENV=production rails console
```
* How to run the test suite * How to run the test suite
@@ -32,12 +64,13 @@ Is derived from https://github.com/OpenSMTPD/OpenSMTPD-extras/blob/master/extras
* Deployment instructions * Deployment instructions
You will need to create an admin user using the Rails Console:
## Licensed ## Licensed
Copyright 2022 - 2023 Jez Caudle Copyright 2022 - 2026 Jez Caudle
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.

View File

@@ -3,4 +3,8 @@ class User < ApplicationRecord
# Include default devise modules. Others available are: # Include default devise modules. Others available are:
# :confirmable, :lockable, :timeoutable, :trackable and :omniauthable # :confirmable, :lockable, :timeoutable, :trackable and :omniauthable
devise :recoverable, :rememberable, :validatable, :lockable, :timeoutable, :trackable, :registerable devise :recoverable, :rememberable, :validatable, :lockable, :timeoutable, :trackable, :registerable
def role
end
end end

7
bin/brakeman Executable file
View File

@@ -0,0 +1,7 @@
#!/usr/bin/env ruby
require "rubygems"
require "bundler/setup"
ARGV.unshift("--ensure-latest")
load Gem.bin_path("brakeman", "brakeman")

6
bin/bundler-audit Executable file
View File

@@ -0,0 +1,6 @@
#!/usr/bin/env ruby
require_relative "../config/boot"
require "bundler/audit/cli"
ARGV.concat %w[ --config config/bundler-audit.yml ] if ARGV.empty? || ARGV.include?("check")
Bundler::Audit::CLI.start

6
bin/ci Executable file
View File

@@ -0,0 +1,6 @@
#!/usr/bin/env ruby
require_relative "../config/boot"
require "active_support/continuous_integration"
CI = ActiveSupport::ContinuousIntegration
require_relative "../config/ci.rb"

2
bin/dev Executable file
View File

@@ -0,0 +1,2 @@
#!/usr/bin/env ruby
exec "./bin/rails", "server", *ARGV

8
bin/docker-entrypoint Executable file
View File

@@ -0,0 +1,8 @@
#!/bin/bash -e
# If running the rails server then create or migrate existing database
if [ "${@: -2:1}" == "./bin/rails" ] && [ "${@: -1:1}" == "server" ]; then
./bin/rails db:prepare
fi
exec "${@}"

8
bin/rubocop Executable file
View File

@@ -0,0 +1,8 @@
#!/usr/bin/env ruby
require "rubygems"
require "bundler/setup"
# Explicit RuboCop config increases performance slightly while avoiding config confusion.
ARGV.unshift("--config", File.expand_path("../.rubocop.yml", __dir__))
load Gem.bin_path("rubocop", "rubocop")

View File

@@ -1,11 +1,10 @@
#!/usr/bin/env ruby #!/usr/bin/env ruby
require "fileutils" require "fileutils"
# path to your application root.
APP_ROOT = File.expand_path("..", __dir__) APP_ROOT = File.expand_path("..", __dir__)
def system!(*args) def system!(*args)
system(*args) || abort("\n== Command #{args} failed ==") system(*args, exception: true)
end end
FileUtils.chdir APP_ROOT do FileUtils.chdir APP_ROOT do
@@ -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 =="
@@ -24,10 +22,14 @@ FileUtils.chdir APP_ROOT do
puts "\n== Preparing database ==" puts "\n== Preparing database =="
system! "bin/rails db:prepare" system! "bin/rails db:prepare"
system! "bin/rails db:reset" if ARGV.include?("--reset")
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
exec "bin/dev"
end
end end

5
bin/thrust Executable file
View File

@@ -0,0 +1,5 @@
#!/usr/bin/env ruby
require "rubygems"
require "bundler/setup"
load Gem.bin_path("thruster", "thrust")

View File

@@ -9,7 +9,8 @@ Bundler.require(*Rails.groups)
module OpensmtpdRailsFrontend module OpensmtpdRailsFrontend
class Application < Rails::Application class Application < Rails::Application
# Initialize configuration defaults for originally generated Rails version. # Initialize configuration defaults for originally generated Rails version.
config.load_defaults 7.0 config.load_defaults 8.1
config.autoload_lib(ignore: %w[assets tasks])
# Configuration for the application, engines, and railties goes here. # Configuration for the application, engines, and railties goes here.
# #

View File

@@ -13,20 +13,20 @@ default: &default
adapter: mysql2 adapter: mysql2
encoding: utf8mb4 encoding: utf8mb4
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
username: root username: OpenSMTPD
password: password password: password
host: localhost host: localhost
development: development:
<<: *default <<: *default
database: opensmtpd_dev database: OpenSMTPD
# Warning: The database defined as "test" will be erased and # Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake". # re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production. # Do not set this db to the same as development or production.
test: test:
<<: *default <<: *default
database: opensmtpd_test database: OpenSMTPD_test
# As with config/credentials.yml, you never want to store sensitive information, # As with config/credentials.yml, you never want to store sensitive information,
# like your database password, in your source code. If your source code is # like your database password, in your source code. If your source code is
@@ -50,6 +50,6 @@ test:
# #
production: production:
<<: *default <<: *default
database: opensmtpd database: OpenSMTPD
username: opensmtpd username: OpenSMTPD
password: <%= ENV["OPENSMTPD_RAILS_FRONTEND_DATABASE_PASSWORD"] %> password: <%= ENV["OPENSMTPD_RAILS_FRONTEND_DATABASE_PASSWORD"] %>

View File

@@ -3,10 +3,8 @@ 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 config.enable_reloading = true
# since you don't have to restart the web server when you make code changes.
config.cache_classes = false
# Do not eager load code on boot. # Do not eager load code on boot.
config.eager_load = false config.eager_load = false
@@ -14,48 +12,52 @@ Rails.application.configure do
# Show full error reports. # Show full error reports.
config.consider_all_requests_local = true config.consider_all_requests_local = true
# 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
# Make template changes take effect immediately.
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 }
# 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 config.active_record.migration_error = :page_load
# Highlight code that triggered database queries in logs. # Highlight code that triggered database queries in logs.
config.active_record.verbose_query_logs = true config.active_record.verbose_query_logs = true
# 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.
config.active_job.verbose_enqueue_logs = true
# Highlight code that triggered redirect in logs.
config.action_dispatch.verbose_redirect_logs = true
# Suppress logger output for asset requests. # Suppress logger output for asset requests.
config.assets.quiet = true config.assets.quiet = true
@@ -63,10 +65,19 @@ Rails.application.configure do
# config.i18n.raise_on_missing_translations = true # config.i18n.raise_on_missing_translations = true
# Annotate rendered view with file names. # Annotate rendered view with file names.
# config.action_view.annotate_rendered_view_with_filenames = true config.action_view.annotate_rendered_view_with_filenames = true
# Uncomment if you wish to allow Action Cable access from any origin. # Uncomment if you wish to allow Action Cable access from any origin.
# config.action_cable.disable_request_forgery_protection = true # config.action_cable.disable_request_forgery_protection = true
# Raise error when a before_action's only/except options reference missing actions.
config.action_controller.raise_on_missing_callback_actions = true
# Apply autocorrection by RuboCop to files generated by `bin/rails generate`.
# config.generators.apply_rubocop_autocorrect_after_generate!
config.action_mailer.default_url_options = { host: 'localhost', port: 3000 } config.action_mailer.default_url_options = { host: 'localhost', port: 3000 }
end end
#

View File

@@ -6,7 +6,3 @@ Rails.application.config.assets.version = "1.0"
# Add additional assets to the asset load path. # Add additional assets to the asset load path.
# Rails.application.config.assets.paths << Emoji.images_path # Rails.application.config.assets.paths << Emoji.images_path
# Precompile additional assets.
# application.js, application.css, and all non-JS/CSS in the app/assets
# folder are already added.
# Rails.application.config.assets.precompile += %w( admin.js admin.css )

View File

@@ -1,8 +1,8 @@
# Be sure to restart your server when you modify this file. # Be sure to restart your server when you modify this file.
# Define an application-wide content security policy # Define an application-wide content security policy.
# For further information see the following documentation # See the Securing Rails Applications Guide for more information:
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy # https://guides.rubyonrails.org/security.html#content-security-policy-header
# Rails.application.configure do # Rails.application.configure do
# config.content_security_policy do |policy| # config.content_security_policy do |policy|
@@ -16,11 +16,14 @@
# # policy.report_uri "/csp-violation-report-endpoint" # # policy.report_uri "/csp-violation-report-endpoint"
# 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) { request.session.id.to_s } # config.content_security_policy_nonce_generator = ->(request) { request.session.id.to_s }
# config.content_security_policy_nonce_directives = %w(script-src) # config.content_security_policy_nonce_directives = %w(script-src style-src)
# #
# # Report CSP violations to a specified URI. See: # # Automatically add `nonce` to `javascript_tag`, `javascript_include_tag`, and `stylesheet_link_tag`
# # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy-Report-Only # # if the corresponding directives are specified in `content_security_policy_nonce_directives`.
# # config.content_security_policy_nonce_auto = true
#
# # Report violations without enforcing the policy.
# # config.content_security_policy_report_only = true # # config.content_security_policy_report_only = true
# end # end

View File

@@ -1,8 +1,8 @@
# Be sure to restart your server when you modify this file. # Be sure to restart your server when you modify this file.
# Configure parameters to be filtered from the log file. Use this to limit dissemination of # Configure parameters to be partially matched (e.g. passw matches password) and filtered from the log file.
# sensitive information. See the ActiveSupport::ParameterFilter documentation for supported # Use this to limit dissemination of sensitive information.
# notations and behaviors. # See the ActiveSupport::ParameterFilter documentation for supported notations and behaviors.
Rails.application.config.filter_parameters += [ Rails.application.config.filter_parameters += [
:passw, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn :passw, :email, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn, :cvv, :cvc
] ]

View File

@@ -1,44 +1,47 @@
# Puma can serve each request in a thread from an internal thread pool.
# The `threads` method setting takes two numbers: a minimum and maximum.
# Any libraries that use thread pools should be configured to match
# the maximum value specified for Puma. Default is set to 5 threads for minimum
# and maximum; this matches the default thread size of Active Record.
#
max_threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }
min_threads_count = ENV.fetch("RAILS_MIN_THREADS") { max_threads_count }
threads min_threads_count, max_threads_count
# Specifies the `worker_timeout` threshold that Puma will use to wait before
# terminating a worker in development environments. #bind 'tcp://0.0.0.0:3002'
# 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
# about methods provided by the DSL, see https://puma.io/puma/Puma/DSL.html.
# #
worker_timeout 3600 if ENV.fetch("RAILS_ENV", "development") == "development" # Puma starts a configurable number of processes (workers) and each process
# 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. You can set it to `auto` to automatically start a worker
# for each available processor.
#
# 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
# prioritize throughput over latency.
#
# 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
# Global VM Lock (GVL) it has diminishing returns and will degrade the
# response time (latency) of the application.
#
# The default is set to 3 threads as it's deemed a decent compromise between
# throughput and latency for the average Rails application.
#
# Any libraries that use a connection pool or another resource pool should
# be configured to provide at least as many connections as the number of
# threads. This includes Active Record's `pool` parameter in `database.yml`.
threads_count = ENV.fetch("RAILS_MAX_THREADS", 3)
threads threads_count, threads_count
# Specifies the `port` that Puma will listen on to receive requests; default is 3000. # Specifies the `port` that Puma will listen on to receive requests; default is 3000.
# port ENV.fetch("PORT", 3000)
port ENV.fetch("PORT") { 3001 }
# Specifies the `environment` that Puma will run in.
#
environment ENV.fetch("RAILS_ENV") { "development" }
# Specifies the `pidfile` that Puma will use.
pidfile ENV.fetch("PIDFILE") { "tmp/pids/server.pid" }
# Specifies the number of `workers` to boot in clustered mode.
# Workers are forked web server processes. If using threads and workers together
# the concurrency of the application would be max `threads` * `workers`.
# Workers do not work on JRuby or Windows (both of which do not support
# processes).
#
# workers ENV.fetch("WEB_CONCURRENCY") { 2 }
# Use the `preload_app!` method when specifying a `workers` number.
# This directive tells Puma to first boot the application and load code
# before forking the application. This takes advantage of Copy On Write
# process behavior so workers use less memory.
#
# preload_app!
# 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
bind 'tcp://0.0.0.0:3002'
# 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"]

View File

@@ -0,0 +1,8 @@
class CreateDomainsAdmins < ActiveRecord::Migration[8.1]
def change
create_table :domains_admins, id: false do |t|
t.belongs_to :users
t.belongs_to :domains
end
end
end

View File

@@ -0,0 +1,5 @@
class AddDomainRedToCredentials < ActiveRecord::Migration[8.1]
def change
add_reference :credentials, :domain, null: false, foreign_key: true
end
end

View File

@@ -0,0 +1,5 @@
class AddDomainRedToVirtuals < ActiveRecord::Migration[8.1]
def change
add_reference :virtuals, :domain, null: false, foreign_key: true
end
end

58
db/schema.rb generated
View File

@@ -10,53 +10,63 @@
# #
# It's strongly recommended that you check this file into your version control system. # It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema[7.1].define(version: 2024_05_21_090545) do ActiveRecord::Schema[8.1].define(version: 2026_04_30_152237) do
create_table "credentials", charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t| create_table "credentials", charset: "latin1", collation: "latin1_swedish_ci", force: :cascade do |t|
t.datetime "created_at", null: false
t.bigint "domain_id", null: false
t.string "email" t.string "email"
t.string "password" t.string "password"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false t.datetime "updated_at", null: false
t.integer "domain_id"
t.index ["domain_id"], name: "index_credentials_on_domain_id" t.index ["domain_id"], name: "index_credentials_on_domain_id"
end end
create_table "domains", charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t| create_table "domains", charset: "latin1", collation: "latin1_swedish_ci", force: :cascade do |t|
t.string "domain"
t.datetime "created_at", null: false t.datetime "created_at", null: false
t.string "domain"
t.datetime "updated_at", null: false t.datetime "updated_at", null: false
end end
create_table "users", charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t| create_table "domains_admins", id: false, charset: "latin1", collation: "latin1_swedish_ci", force: :cascade do |t|
t.bigint "domains_id"
t.bigint "users_id"
t.index ["domains_id"], name: "index_domains_admins_on_domains_id"
t.index ["users_id"], name: "index_domains_admins_on_users_id"
end
create_table "users", charset: "latin1", collation: "latin1_swedish_ci", force: :cascade do |t|
t.integer "consumed_timestep"
t.datetime "created_at", null: false
t.datetime "current_sign_in_at"
t.string "current_sign_in_ip"
t.string "email", default: "", null: false t.string "email", default: "", null: false
t.string "encrypted_password", default: "", null: false t.string "encrypted_password", default: "", null: false
t.string "reset_password_token"
t.datetime "reset_password_sent_at"
t.datetime "remember_created_at"
t.integer "sign_in_count", default: 0, null: false
t.datetime "current_sign_in_at"
t.datetime "last_sign_in_at"
t.string "current_sign_in_ip"
t.string "last_sign_in_ip"
t.integer "failed_attempts", default: 0, null: false t.integer "failed_attempts", default: 0, null: false
t.string "unlock_token" t.datetime "last_sign_in_at"
t.string "last_sign_in_ip"
t.datetime "locked_at" t.datetime "locked_at"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "otp_secret"
t.integer "consumed_timestep"
t.boolean "otp_required_for_login" t.boolean "otp_required_for_login"
t.string "otp_secret"
t.datetime "remember_created_at"
t.datetime "reset_password_sent_at"
t.string "reset_password_token"
t.integer "role", default: 1000, null: false
t.integer "sign_in_count", default: 0, null: false
t.string "unlock_token"
t.datetime "updated_at", null: false
t.index ["email"], name: "index_users_on_email", unique: true t.index ["email"], name: "index_users_on_email", unique: true
t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
t.index ["unlock_token"], name: "index_users_on_unlock_token", unique: true t.index ["unlock_token"], name: "index_users_on_unlock_token", unique: true
end end
create_table "virtuals", charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t| create_table "virtuals", charset: "latin1", collation: "latin1_swedish_ci", force: :cascade do |t|
t.string "email"
t.string "destination"
t.datetime "created_at", null: false t.datetime "created_at", null: false
t.string "destination"
t.bigint "domain_id", null: false
t.string "email"
t.datetime "updated_at", null: false t.datetime "updated_at", null: false
t.integer "domain_id"
t.index ["domain_id"], name: "index_virtuals_on_domain_id" t.index ["domain_id"], name: "index_virtuals_on_domain_id"
end end
add_foreign_key "credentials", "domains"
add_foreign_key "virtuals", "domains"
end end

View File

@@ -5,7 +5,7 @@ class CredentialsControllerTest < ActionDispatch::IntegrationTest
setup do setup do
@credential = credentials(:one) @credential = credentials(:one)
@domain = domains(:one) @domain = domains(:domainone)
end end
test "should not get new" do test "should not get new" do

View File

@@ -3,7 +3,7 @@ require "test_helper"
class DomainsControllerTest < ActionDispatch::IntegrationTest class DomainsControllerTest < ActionDispatch::IntegrationTest
include Devise::Test::IntegrationHelpers include Devise::Test::IntegrationHelpers
setup do setup do
@domain = domains(:one) @domain = domains(:domainone)
end end
test "not should get index because user not logged in" do test "not should get index because user not logged in" do

View File

@@ -5,7 +5,7 @@ class VirtualsControllerTest < ActionDispatch::IntegrationTest
setup do setup do
@virtual = virtuals(:one) @virtual = virtuals(:one)
@domain = domains(:one) @domain = domains(:domainone)
end end
test "should get not get new because we are not logged in" do test "should get not get new because we are not logged in" do

View File

@@ -3,9 +3,9 @@
one: one:
email: bob@example.net email: bob@example.net
password: MyString password: MyString
domain: one domain: domainone
two: two:
email: alice@example.org email: alice@example.org
password: MyString password: MyString
domain: two domain: domaintwo

View File

@@ -1,7 +1,7 @@
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html # Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
one: domainone:
domain: example.net domain: example.net
two: domaintwo:
domain: example.org domain: example.org

View File

@@ -19,7 +19,12 @@ class CredentialTest < ActiveSupport::TestCase
end end
test "domain added to name" do test "domain added to name" do
@c = Credential.new(email: "jez@#{domains(:one).domain}", password: "1234567&ab", domain_id: domains(:one).id) @c = Credential.new(email: "jez@#{domains(:domainone).domain}", password: "1234567&ab", domain_id: domains(:domainone).id)
assert @c.save assert @c.save
end end
test "domain_id not the same as domain" do
@c = Credential.new(email: "steve@#{domains(:domainone).domain}", password: "1234567&ab", domain_id: domains(:domainone).id)
assert_not @c.save
end
end end

View File

@@ -43,7 +43,7 @@ class VirtualTest < ActiveSupport::TestCase
@v = Virtual.new @v = Virtual.new
@v.email = "abuse@example.net" @v.email = "abuse@example.net"
@v.destination = "valid@email.com" @v.destination = "valid@email.com"
@v.domain_id = domains(:one).id + 1234 @v.domain_id = domains(:domainone).id + 1234
assert !@v.save assert !@v.save
end end