Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ group :development do
gem 'listen', '~> 3.5'
gem 'spring-watcher-listen', '~> 2.0.0'
gem 'binding_of_caller'
gem 'derailed_benchmarks'
gem 'stackprof'
end

group :test do
Expand All @@ -50,6 +52,9 @@ group :test do
gem "launchy"
gem "show_me_the_cookies", '~> 5.0.1'
gem "timecop"
gem 'fasterer', require: false
gem 'rails_best_practices'

end

group :development, :test do
Expand All @@ -58,6 +63,7 @@ group :development, :test do
gem 'simplecov'
gem 'rubocop-performance'
gem 'rubocop-rails'
gem 'bullet'
end

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
Expand Down
59 changes: 59 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ GEM
execjs (~> 2)
base64 (0.2.0)
benchmark (0.4.0)
benchmark-ips (2.14.0)
better_errors (2.10.1)
erubi (>= 1.0.0)
rack (>= 0.9.0)
Expand All @@ -96,6 +97,9 @@ GEM
bugsnag (6.27.1)
concurrent-ruby (~> 1.0)
builder (3.3.0)
bullet (8.0.1)
activesupport (>= 3.0.0)
uniform_notifier (~> 1.11)
byebug (11.1.3)
capybara (3.40.0)
addressable
Expand All @@ -118,6 +122,8 @@ GEM
ssrf_filter (~> 1.0)
childprocess (5.1.0)
logger (~> 1.5)
code_analyzer (0.5.5)
sexp_processor
concurrent-ruby (1.3.5)
connection_pool (2.5.0)
crass (1.0.6)
Expand All @@ -129,6 +135,24 @@ GEM
database_cleaner-core (2.0.1)
date (3.4.1)
debug_inspector (1.2.0)
derailed_benchmarks (2.2.1)
base64
benchmark-ips (~> 2)
bigdecimal
drb
get_process_mem
heapy (~> 0)
logger
memory_profiler (>= 0, < 2)
mini_histogram (>= 0.3.0)
mutex_m
ostruct
rack (>= 1)
rack-test
rake (> 10, < 14)
ruby-statistics (>= 4.0.1)
ruby2_keywords
thor (>= 0.19, < 2)
diff-lcs (1.5.1)
docile (1.4.1)
dotenv (3.1.2)
Expand All @@ -140,6 +164,7 @@ GEM
activemodel
encryptor (3.0.0)
erubi (1.13.1)
erubis (2.7.0)
execjs (2.10.0)
factory_bot (6.5.1)
activesupport (>= 6.1.0)
Expand All @@ -150,6 +175,8 @@ GEM
logger
faraday-net_http (3.1.1)
net-http
fasterer (0.11.0)
ruby_parser (>= 3.19.1)
ffi (1.17.0)
ffi (1.17.0-aarch64-linux-gnu)
ffi (1.17.0-aarch64-linux-musl)
Expand All @@ -161,9 +188,14 @@ GEM
ffi (1.17.0-x86_64-darwin)
ffi (1.17.0-x86_64-linux-gnu)
ffi (1.17.0-x86_64-linux-musl)
get_process_mem (1.0.0)
bigdecimal (>= 2.0)
ffi (~> 1.0)
globalid (1.2.1)
activesupport (>= 6.1)
hashie (5.0.0)
heapy (0.2.0)
thor
i18n (1.14.7)
concurrent-ruby (~> 1.0)
image_processing (1.13.0)
Expand All @@ -181,6 +213,7 @@ GEM
rails-dom-testing (>= 1, < 3)
railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
json (2.10.2)
jwt (2.8.2)
base64
kgio (2.11.4)
Expand All @@ -205,12 +238,15 @@ GEM
net-smtp
marcel (1.0.4)
matrix (0.4.2)
memory_profiler (1.1.0)
mini_histogram (0.3.1)
mini_magick (4.13.2)
mini_mime (1.1.5)
mini_portile2 (2.8.8)
minitest (5.25.4)
multi_xml (0.7.1)
bigdecimal (~> 3.1)
mutex_m (0.3.0)
net-http (0.4.1)
uri
net-imap (0.5.6)
Expand Down Expand Up @@ -262,6 +298,7 @@ GEM
omniauth-oauth2 (1.8.0)
oauth2 (>= 1.4, < 3)
omniauth (~> 2.0)
ostruct (0.6.1)
parallel (1.26.3)
parser (3.3.7.1)
ast (~> 2.4.1)
Expand Down Expand Up @@ -314,6 +351,14 @@ GEM
rails_12factor (0.0.3)
rails_serve_static_assets
rails_stdout_logging
rails_best_practices (1.23.2)
activesupport
code_analyzer (~> 0.5.5)
erubis
i18n
json
require_all (~> 3.0)
ruby-progressbar
rails_serve_static_assets (0.0.5)
rails_stdout_logging (0.0.5)
railties (8.0.1)
Expand All @@ -338,6 +383,7 @@ GEM
io-console (~> 0.5)
request_store (1.7.0)
rack (>= 1.4)
require_all (3.0.0)
rexml (3.4.1)
rouge (4.3.0)
rspec-core (3.13.0)
Expand Down Expand Up @@ -376,9 +422,14 @@ GEM
rack (>= 1.1)
rubocop (>= 1.7.0, < 2.0)
ruby-progressbar (1.13.0)
ruby-statistics (4.1.0)
ruby-vips (2.2.2)
ffi (~> 1.12)
logger
ruby2_keywords (0.0.5)
ruby_parser (3.21.1)
racc (~> 1.5)
sexp_processor (~> 4.16)
rubyzip (2.3.2)
sassc (2.4.0)
ffi (~> 1.9)
Expand All @@ -397,6 +448,7 @@ GEM
rexml (~> 3.2, >= 3.2.5)
rubyzip (>= 1.2.2, < 3.0)
websocket (~> 1.0)
sexp_processor (4.17.3)
show_me_the_cookies (5.0.1)
capybara (>= 2, < 4)
simple_form (5.3.1)
Expand Down Expand Up @@ -425,6 +477,7 @@ GEM
activesupport (>= 6.1)
sprockets (>= 3.0.0)
ssrf_filter (1.1.2)
stackprof (0.2.27)
stringio (3.1.5)
thor (1.3.2)
tilt (2.4.0)
Expand All @@ -438,6 +491,7 @@ GEM
unicorn (6.1.0)
kgio (~> 2.6)
raindrops (~> 0.7)
uniform_notifier (1.16.0)
uri (1.0.3)
useragent (0.16.11)
version_gem (1.1.4)
Expand Down Expand Up @@ -479,15 +533,18 @@ DEPENDENCIES
bootstrap-sass (~> 3.4.1)
bootstrap-scss
bugsnag
bullet
byebug
capybara
capybara-selenium
carrierwave
database_cleaner
derailed_benchmarks
dotenv-rails
email_validator
factory_bot
faker
fasterer
jbuilder
jquery-rails
launchy
Expand All @@ -501,6 +558,7 @@ DEPENDENCIES
puma (~> 6.4.3)
rails (~> 8.0.1)
rails_12factor
rails_best_practices
recaptcha
rspec-rails
rubocop
Expand All @@ -513,6 +571,7 @@ DEPENDENCIES
simplecov
skylight
spring-watcher-listen (~> 2.0.0)
stackprof
timecop
tzinfo-data
uglifier (>= 1.3.0)
Expand Down
6 changes: 3 additions & 3 deletions app/views/secret_mailer/consumnation_notification.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
<p>
This email is to notify you that <%= @secret.to_email %> viewed a secret that you shared with them via <%= link_to("SecretLink.org", "https://SecretLink.org") %>.
</p>
<% if @secret.title.present? %>
<% if @secret.title? %>
<p>
The title of the viewed secret was: <%= @secret.title %>
</p>
<% end %>
<% if @secret.comments.present? %>
<% if @secret.comments? %>
<p>
The comments on the viewed secret were:
</p>
Expand All @@ -18,7 +18,7 @@
</pre>
<% end %>
<p>
This secret was created by you <%= time_ago_in_words(@secret.created_at) %> ago.
This secret was created by you <%= distance_of_time_in_words(Time.zone.now, @secret.created_at) %> ago.
</p>
<p>
The encrypted information has now been deleted from the database.
Expand Down
6 changes: 3 additions & 3 deletions app/views/secret_mailer/consumnation_notification.text.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@ Hello <%= @secret.from_email %>

This email is to notify you that <%= @secret.to_email %> viewed a secret that you shared with them via SecretLink.org.

<% if @secret.title.present? %>
<% if @secret.title? %>
The title of the viewed secret was: <%= @secret.title %>
<% end %>

<% if @secret.comments.present? %>
<% if @secret.comments? %>
The comments on the viewed secret were:
------------------------------------------
<%= @secret.comments %>
------------------------------------------
<% end %>

This secret was created by you <%= time_ago_in_words(@secret.created_at) %> ago.
This secret was created by you <%= distance_of_time_in_words(Time.now, @secret.created_at) %> ago.

The encrypted information has now been deleted from the database.

Expand Down
6 changes: 3 additions & 3 deletions app/views/secret_mailer/secret_notification.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
<%= @secret.from_email %> has shared a secret with you via <%= link_to("SecretLink.org", "https://SecretLink.org") %>.<br />
</p>

<% if @secret.title.present? %>
<% if @secret.title? %>
<p>
<b>Title:</b> <%= @secret.title %>
</p>
<% end %>
<% if @secret.comments.present? %>
<% if @secret.comments? %>
<p>
<b>Comments:</b>
</p>
Expand All @@ -30,7 +30,7 @@
It can only be viewed once and will then be removed from the database.
</p>

<% if @secret.expire_at.present? %>
<% if @secret.expire_at? %>
<p>
It will also expire and be removed if not accessed before <%= @secret.expire_at.strftime('%d %B %Y') %>.
</p>
Expand Down
6 changes: 3 additions & 3 deletions app/views/secret_mailer/secret_notification.text.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ Hello <%= @secret.to_email %>

<%= @secret.from_email %> has shared a secret with you via SecretLink.org.

<% if @secret.title.present? %>
<% if @secret.title? %>
Title: <%= @secret.title %>
<% end %>

<% if @secret.comments.present? %>
<% if @secret.comments? %>
Comments:
------------------------------------------
<%= @secret.comments %>
Expand All @@ -20,7 +20,7 @@ This link will show you the secret:

It can only be viewed once and will then be removed from the database.

<% if @secret.expire_at.present? %>
<% if @secret.expire_at? %>
It will also expire and be removed if not accessed before <%= @secret.expire_at.strftime('%d %B %Y') %>.
<% end %>

Expand Down
6 changes: 3 additions & 3 deletions app/views/secrets/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
It will be <b>deleted</b> from our system once you view it, so be sure to make a copy.
</p>

<% if @secret.title.present? %>
<% if @secret.title? %>
<p>
<strong>Title:</strong>
<%= @secret.title %>
</p>
<% end %>

<% if @secret.comments.present? %>
<% if @secret.comments? %>
<p>
<strong>Comments:</strong>
</p>
Expand All @@ -33,7 +33,7 @@
<p>
<% if @unencrypted_secret || flash.now[:error] %>
<pre><%= @unencrypted_secret %></pre>
<% elsif @secret.encrypted_secret.blank? %>
<% elsif !@secret.encrypted_secret? %>
<pre>Secret has already been displayed and deleted.</pre>
<% else %>
<%= form_tag '/decrypt_secret' do |f| %>
Expand Down
12 changes: 12 additions & 0 deletions config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.

# Bullet Configuration
config.after_initialize do
Bullet.enable = true
Bullet.alert = true
Bullet.bullet_logger = true
Bullet.console = true
Bullet.rails_logger = true
end

# In the development environment your application's code is reloaded on
# every request. 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.
Expand Down Expand Up @@ -73,4 +82,7 @@
# Use an evented file watcher to asynchronously detect changes in source code,
# routes, locales, etc. This feature depends on the listen gem.
config.file_watcher = ActiveSupport::EventedFileUpdateChecker
# config.hosts << '0fe9-103-181-226-39.ngrok-free.app'
config.hosts.clear

end
2 changes: 1 addition & 1 deletion config/environments/staging.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
config.assets.configure do |env|
env.js_compressor = :uglifier # or :closure, :yui
env.css_compressor = :sass # or :yui
end
end
# config.assets.css_compressor = :sass

# Do not fallback to assets pipeline if a precompiled asset is missed.
Expand Down
Loading