Skip to content

Commit f5d57b6

Browse files
authored
Use prebuild 'simple_token_authentication' gem and (#1562)
remove database backend groups in Gemfile
1 parent 254c988 commit f5d57b6

File tree

6 files changed

+11
-46
lines changed

6 files changed

+11
-46
lines changed

.dockerignore

+1
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@
55
.github
66
.env*
77
.dockerenv*
8+
tmp/

.github/workflows/ruby-tests.yml

-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ jobs:
6262
run: |
6363
gem install bundler
6464
bundle config path vendor/bundle
65-
bundle config set with 'sqlite'
6665
bundle install --jobs 4 --retry 3
6766
yarn install --frozen-lockfile
6867
- name: Run tests

Gemfile

+5-13
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,7 @@ gem 'mail_form', '>= 1.9.0'
9090
gem 'oj'
9191
gem 'puma'
9292
gem 'rollbar'
93-
gem 'simple_token_authentication', '~> 1.18', '>= 1.18.0',
94-
git: 'https://github.com/pglombardo/simple_token_authentication.git', branch: 'rails7-support'
93+
gem 'simple_token_authentication'
9594

9695
gem 'devise-i18n'
9796
gem 'i18n-tasks', '~> 1.0.13'
@@ -107,17 +106,10 @@ gem 'google-cloud-storage', '~> 1.45', require: false
107106
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
108107
gem 'tzinfo-data', platforms: %i[mingw mswin x64_mingw jruby]
109108

110-
group :postgres, optional: true do
111-
gem 'pg'
112-
end
113-
114-
group :mysql, optional: true do
115-
gem 'mysql2'
116-
end
117-
118-
group :sqlite, optional: true do
119-
gem 'sqlite3', force_ruby_platform: true
120-
end
109+
# Database backends
110+
gem 'mysql2'
111+
gem 'pg'
112+
gem 'sqlite3', force_ruby_platform: true
121113

122114
group :production, :private do
123115
gem 'rack-throttle', '0.7.0'

Gemfile.lock

+5-25
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,3 @@
1-
GIT
2-
remote: https://github.com/pglombardo/simple_token_authentication.git
3-
revision: 47db3936689c5d93b4226f85c3ca71c182ec0580
4-
branch: rails7-support
5-
specs:
6-
simple_token_authentication (1.18.0)
7-
actionmailer (>= 3.2.6, < 8)
8-
actionpack (>= 3.2.6, < 8)
9-
active_model_serializers
10-
activemodel-serializers-xml
11-
devise (>= 3.2, < 6)
12-
131
GIT
142
remote: https://github.com/pglombardo/version.git
153
revision: 97678e0068542fb919f909b0d3a9e853ec7a24c2
@@ -69,20 +57,11 @@ GEM
6957
erubi (~> 1.11)
7058
rails-dom-testing (~> 2.2)
7159
rails-html-sanitizer (~> 1.6)
72-
active_model_serializers (0.10.14)
73-
actionpack (>= 4.1)
74-
activemodel (>= 4.1)
75-
case_transform (>= 0.2)
76-
jsonapi-renderer (>= 0.1.1.beta1, < 0.3)
7760
activejob (7.1.2)
7861
activesupport (= 7.1.2)
7962
globalid (>= 0.3.6)
8063
activemodel (7.1.2)
8164
activesupport (= 7.1.2)
82-
activemodel-serializers-xml (1.0.2)
83-
activemodel (> 5.x)
84-
activesupport (> 5.x)
85-
builder (~> 3.1)
8665
activerecord (7.1.2)
8766
activemodel (= 7.1.2)
8867
activesupport (= 7.1.2)
@@ -163,8 +142,6 @@ GEM
163142
rack-test (>= 0.6.3)
164143
regexp_parser (>= 1.5, < 3.0)
165144
xpath (~> 3.2)
166-
case_transform (0.2)
167-
activesupport
168145
coderay (1.1.3)
169146
concurrent-ruby (1.2.2)
170147
config (5.0.0)
@@ -321,7 +298,6 @@ GEM
321298
activesupport (>= 5.0.0)
322299
jmespath (1.6.2)
323300
json (2.6.3)
324-
jsonapi-renderer (0.2.2)
325301
jwt (2.7.1)
326302
kramdown (2.4.0)
327303
rexml
@@ -530,6 +506,10 @@ GEM
530506
faraday (>= 0.17.5, < 3.a)
531507
jwt (>= 1.5, < 3.0)
532508
multi_json (~> 1.10)
509+
simple_token_authentication (1.18.1)
510+
actionmailer (>= 3.2.6, < 8)
511+
actionpack (>= 3.2.6, < 8)
512+
devise (>= 3.2, < 6)
533513
singleton (0.2.0)
534514
smart_properties (1.17.0)
535515
sprockets (4.2.1)
@@ -635,7 +615,7 @@ DEPENDENCIES
635615
ruby-debug-ide
636616
sass-rails (~> 6.0, >= 6.0.0)
637617
selenium-webdriver
638-
simple_token_authentication (~> 1.18, >= 1.18.0)!
618+
simple_token_authentication
639619
sqlite3
640620
stimulus-rails
641621
terser (~> 1.1)

README.md

-2
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,6 @@ gem install bundler
178178

179179
export RAILS_ENV=private
180180

181-
bundle config set with 'sqlite'
182181
bundle config set --local deployment 'true'
183182
bundle install --without development production test
184183
./bin/rails assets:precompile
@@ -202,7 +201,6 @@ export RAILS_ENV=production
202201
# Update the following line to point to your Postgres (or MySQL/Mariadb) instance
203202
DATABASE_URL=postgresql://passwordpusher_user:passwordpusher_passwd@postgres:5432/passwordpusher_db
204203

205-
bundle config set with 'postgres' # or 'mysql'
206204
bundle install --without development private test
207205
./bin/rails assets:precompile
208206
./bin/rails db:setup

containers/docker/pwpush/Dockerfile

-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
# Setting global arguments
2-
ARG BUNDLE_WITH=sqlite:mysql:postgres
32
ARG BUNDLE_WITHOUT=development:test:private
43
ARG BUNDLE_DEPLOYMENT=true
54

65
FROM ruby:3.2-alpine AS build-env
76

87
# include global args
9-
ARG BUNDLE_WITH
108
ARG BUNDLE_WITHOUT
119
ARG BUNDLE_DEPLOYMENT
1210

@@ -34,7 +32,6 @@ ENV RACK_ENV=production RAILS_ENV=production
3432

3533
RUN bundle config set without "${BUNDLE_WITHOUT}" \
3634
&& bundle config set deployment "${BUNDLE_DEPLOYMENT}" \
37-
&& bundle config set with "${BUNDLE_WITH}" \
3835
&& bundle install
3936

4037
RUN yarn install
@@ -57,7 +54,6 @@ RUN rm -rf node_modules tmp/cache vendor/assets spec \
5754
FROM ruby:3.2-alpine
5855

5956
# include global args
60-
ARG BUNDLE_WITH
6157
ARG BUNDLE_WITHOUT
6258
ARG BUNDLE_DEPLOYMENT
6359

@@ -88,7 +84,6 @@ ENV RACK_ENV=production RAILS_ENV=production
8884
COPY --from=build-env --chown=pwpusher:pwpusher ${APP_ROOT} ${APP_ROOT}
8985

9086
RUN bundle config set without "${BUNDLE_WITHOUT}" \
91-
&& bundle config set with "${BUNDLE_WITH}" \
9287
&& bundle config set deployment "${BUNDLE_DEPLOYMENT}"
9388

9489
USER pwpusher

0 commit comments

Comments
 (0)