.dockerignore
... ...
@@ -0,0 +1,37 @@
1
+# See https://docs.docker.com/engine/reference/builder/#dockerignore-file for more about ignoring files.
2
+
3
+# Ignore git directory.
4
+/.git/
5
+
6
+# Ignore bundler config.
7
+/.bundle
8
+
9
+# Ignore all environment files (except templates).
10
+/.env*
11
+!/.env*.erb
12
+
13
+# Ignore all default key files.
14
+/config/master.key
15
+/config/credentials/*.key
16
+
17
+# Ignore all logfiles and tempfiles.
18
+/log/*
19
+/tmp/*
20
+!/log/.keep
21
+!/tmp/.keep
22
+
23
+# Ignore pidfiles, but keep the directory.
24
+/tmp/pids/*
25
+!/tmp/pids/.keep
26
+
27
+# Ignore storage (uploaded files in development and any SQLite databases).
28
+/storage/*
29
+!/storage/.keep
30
+/tmp/storage/*
31
+!/tmp/storage/.keep
32
+
33
+# Ignore assets.
34
+/node_modules/
35
+/app/assets/builds/*
36
+!/app/assets/builds/.keep
37
+/public/assets
.gitattributes
... ...
@@ -0,0 +1,9 @@
1
+# See https://git-scm.com/docs/gitattributes for more about git attribute files.
2
+
3
+# Mark the database schema as having been generated.
4
+db/schema.rb linguist-generated
5
+
6
+# Mark any vendored files as having been vendored.
7
+vendor/* linguist-vendored
8
+config/credentials/*.yml.enc diff=rails_credentials
9
+config/credentials.yml.enc diff=rails_credentials
.gitignore
... ...
@@ -0,0 +1,36 @@
1
+# See https://help.github.com/articles/ignoring-files for more about ignoring files.
2
+#
3
+# If you find yourself ignoring temporary files generated by your text editor
4
+# or operating system, you probably want to add a global ignore instead:
5
+# git config --global core.excludesfile '~/.gitignore_global'
6
+
7
+# Ignore bundler config.
8
+/.bundle
9
+
10
+# Ignore all environment files (except templates).
11
+/.env*
12
+!/.env*.erb
13
+
14
+# Ignore all logfiles and tempfiles.
15
+/log/*
16
+/tmp/*
17
+/gollum/*.md
18
+!/log/.keep
19
+!/tmp/.keep
20
+
21
+# Ignore pidfiles, but keep the directory.
22
+/tmp/pids/*
23
+!/tmp/pids/
24
+!/tmp/pids/.keep
25
+
26
+# Ignore storage (uploaded files in development and any SQLite databases).
27
+/storage/*
28
+!/storage/.keep
29
+/tmp/storage/*
30
+!/tmp/storage/
31
+!/tmp/storage/.keep
32
+
33
+/public/assets
34
+
35
+# Ignore master key for decrypting credentials and more.
36
+/config/master.key
.ruby-version
... ...
@@ -0,0 +1 @@
1
+ruby-3.2.2
Dockerfile
... ...
@@ -0,0 +1,62 @@
1
+# syntax = docker/dockerfile:1
2
+
3
+# Make sure RUBY_VERSION matches the Ruby version in .ruby-version and Gemfile
4
+ARG RUBY_VERSION=3.2.2
5
+FROM registry.docker.com/library/ruby:$RUBY_VERSION-slim as base
6
+
7
+# Rails app lives here
8
+WORKDIR /rails
9
+
10
+# Set production environment
11
+ENV RAILS_ENV="production" \
12
+ BUNDLE_DEPLOYMENT="1" \
13
+ BUNDLE_PATH="/usr/local/bundle" \
14
+ BUNDLE_WITHOUT="development"
15
+
16
+
17
+# Throw-away build stage to reduce size of final image
18
+FROM base as build
19
+
20
+# Install packages needed to build gems
21
+RUN apt-get update -qq && \
22
+ apt-get install --no-install-recommends -y build-essential git libpq-dev libvips pkg-config
23
+
24
+# Install application gems
25
+COPY Gemfile Gemfile.lock ./
26
+RUN bundle install && \
27
+ rm -rf ~/.bundle/ "${BUNDLE_PATH}"/ruby/*/cache "${BUNDLE_PATH}"/ruby/*/bundler/gems/*/.git && \
28
+ bundle exec bootsnap precompile --gemfile
29
+
30
+# Copy application code
31
+COPY . .
32
+
33
+# Precompile bootsnap code for faster boot times
34
+RUN bundle exec bootsnap precompile app/ lib/
35
+
36
+# Precompiling assets for production without requiring secret RAILS_MASTER_KEY
37
+RUN SECRET_KEY_BASE_DUMMY=1 ./bin/rails assets:precompile
38
+
39
+
40
+# Final stage for app image
41
+FROM base
42
+
43
+# Install packages needed for deployment
44
+RUN apt-get update -qq && \
45
+ apt-get install --no-install-recommends -y curl libvips postgresql-client && \
46
+ rm -rf /var/lib/apt/lists /var/cache/apt/archives
47
+
48
+# Copy built artifacts: gems, application
49
+COPY --from=build /usr/local/bundle /usr/local/bundle
50
+COPY --from=build /rails /rails
51
+
52
+# Run and own only the runtime files as a non-root user for security
53
+RUN useradd rails --create-home --shell /bin/bash && \
54
+ chown -R rails:rails db log storage tmp
55
+USER rails:rails
56
+
57
+# Entrypoint prepares the database.
58
+ENTRYPOINT ["/rails/bin/docker-entrypoint"]
59
+
60
+# Start the server by default, this can be overwritten at runtime
61
+EXPOSE 3000
62
+CMD ["./bin/rails", "server"]
Gemfile
... ...
@@ -0,0 +1,72 @@
1
+source "https://rubygems.org"
2
+
3
+ruby "3.2.2"
4
+
5
+# Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main"
6
+gem "rails", "~> 7.1.5", ">= 7.1.5.1"
7
+
8
+# The original asset pipeline for Rails [https://github.com/rails/sprockets-rails]
9
+gem "sprockets-rails"
10
+
11
+# Use postgresql as the database for Active Record
12
+gem "pg", "~> 1.1"
13
+
14
+# Use the Puma web server [https://github.com/puma/puma]
15
+gem "puma", ">= 5.0"
16
+
17
+# Use JavaScript with ESM import maps [https://github.com/rails/importmap-rails]
18
+gem "importmap-rails"
19
+
20
+# Hotwire's SPA-like page accelerator [https://turbo.hotwired.dev]
21
+gem "turbo-rails"
22
+
23
+# Hotwire's modest JavaScript framework [https://stimulus.hotwired.dev]
24
+gem "stimulus-rails"
25
+
26
+# Build JSON APIs with ease [https://github.com/rails/jbuilder]
27
+gem "jbuilder"
28
+
29
+gem 'gollum'
30
+
31
+gem 'pry-byebug'
32
+gem 'pry-rails'
33
+
34
+# Use Redis adapter to run Action Cable in production
35
+# gem "redis", ">= 4.0.1"
36
+
37
+# Use Kredis to get higher-level data types in Redis [https://github.com/rails/kredis]
38
+# gem "kredis"
39
+
40
+# Use Active Model has_secure_password [https://guides.rubyonrails.org/active_model_basics.html#securepassword]
41
+# gem "bcrypt", "~> 3.1.7"
42
+
43
+# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
44
+gem "tzinfo-data", platforms: %i[ windows jruby ]
45
+
46
+# Reduces boot times through caching; required in config/boot.rb
47
+gem "bootsnap", require: false
48
+
49
+# Use Active Storage variants [https://guides.rubyonrails.org/active_storage_overview.html#transforming-images]
50
+# gem "image_processing", "~> 1.2"
51
+
52
+group :development, :test do
53
+ # See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem
54
+ gem "debug", platforms: %i[ mri windows ]
55
+end
56
+
57
+group :development do
58
+ # Use console on exceptions pages [https://github.com/rails/web-console]
59
+ gem "web-console"
60
+
61
+ # Add speed badges [https://github.com/MiniProfiler/rack-mini-profiler]
62
+ # gem "rack-mini-profiler"
63
+
64
+ # Speed up commands on slow machines / big apps [https://github.com/rails/spring]
65
+ # gem "spring"
66
+end
67
+
68
+group :test do
69
+ # Use system testing [https://guides.rubyonrails.org/testing.html#system-testing]
70
+ gem "capybara"
71
+ gem "selenium-webdriver"
72
+end
Gemfile.lock
... ...
@@ -0,0 +1,369 @@
1
+GEM
2
+ remote: https://rubygems.org/
3
+ specs:
4
+ actioncable (7.1.5.1)
5
+ actionpack (= 7.1.5.1)
6
+ activesupport (= 7.1.5.1)
7
+ nio4r (~> 2.0)
8
+ websocket-driver (>= 0.6.1)
9
+ zeitwerk (~> 2.6)
10
+ actionmailbox (7.1.5.1)
11
+ actionpack (= 7.1.5.1)
12
+ activejob (= 7.1.5.1)
13
+ activerecord (= 7.1.5.1)
14
+ activestorage (= 7.1.5.1)
15
+ activesupport (= 7.1.5.1)
16
+ mail (>= 2.7.1)
17
+ net-imap
18
+ net-pop
19
+ net-smtp
20
+ actionmailer (7.1.5.1)
21
+ actionpack (= 7.1.5.1)
22
+ actionview (= 7.1.5.1)
23
+ activejob (= 7.1.5.1)
24
+ activesupport (= 7.1.5.1)
25
+ mail (~> 2.5, >= 2.5.4)
26
+ net-imap
27
+ net-pop
28
+ net-smtp
29
+ rails-dom-testing (~> 2.2)
30
+ actionpack (7.1.5.1)
31
+ actionview (= 7.1.5.1)
32
+ activesupport (= 7.1.5.1)
33
+ nokogiri (>= 1.8.5)
34
+ racc
35
+ rack (>= 2.2.4)
36
+ rack-session (>= 1.0.1)
37
+ rack-test (>= 0.6.3)
38
+ rails-dom-testing (~> 2.2)
39
+ rails-html-sanitizer (~> 1.6)
40
+ actiontext (7.1.5.1)
41
+ actionpack (= 7.1.5.1)
42
+ activerecord (= 7.1.5.1)
43
+ activestorage (= 7.1.5.1)
44
+ activesupport (= 7.1.5.1)
45
+ globalid (>= 0.6.0)
46
+ nokogiri (>= 1.8.5)
47
+ actionview (7.1.5.1)
48
+ activesupport (= 7.1.5.1)
49
+ builder (~> 3.1)
50
+ erubi (~> 1.11)
51
+ rails-dom-testing (~> 2.2)
52
+ rails-html-sanitizer (~> 1.6)
53
+ activejob (7.1.5.1)
54
+ activesupport (= 7.1.5.1)
55
+ globalid (>= 0.3.6)
56
+ activemodel (7.1.5.1)
57
+ activesupport (= 7.1.5.1)
58
+ activerecord (7.1.5.1)
59
+ activemodel (= 7.1.5.1)
60
+ activesupport (= 7.1.5.1)
61
+ timeout (>= 0.4.0)
62
+ activestorage (7.1.5.1)
63
+ actionpack (= 7.1.5.1)
64
+ activejob (= 7.1.5.1)
65
+ activerecord (= 7.1.5.1)
66
+ activesupport (= 7.1.5.1)
67
+ marcel (~> 1.0)
68
+ activesupport (7.1.5.1)
69
+ base64
70
+ benchmark (>= 0.3)
71
+ bigdecimal
72
+ concurrent-ruby (~> 1.0, >= 1.0.2)
73
+ connection_pool (>= 2.2.5)
74
+ drb
75
+ i18n (>= 1.6, < 2)
76
+ logger (>= 1.4.2)
77
+ minitest (>= 5.1)
78
+ mutex_m
79
+ securerandom (>= 0.3)
80
+ tzinfo (~> 2.0)
81
+ addressable (2.8.7)
82
+ public_suffix (>= 2.0.2, < 7.0)
83
+ base64 (0.3.0)
84
+ benchmark (0.4.1)
85
+ bigdecimal (3.2.2)
86
+ bindex (0.8.1)
87
+ bootsnap (1.18.6)
88
+ msgpack (~> 1.2)
89
+ builder (3.3.0)
90
+ byebug (12.0.0)
91
+ capybara (3.40.0)
92
+ addressable
93
+ matrix
94
+ mini_mime (>= 0.1.3)
95
+ nokogiri (~> 1.11)
96
+ rack (>= 1.6.0)
97
+ rack-test (>= 0.6.3)
98
+ regexp_parser (>= 1.5, < 3.0)
99
+ xpath (~> 3.2)
100
+ coderay (1.1.3)
101
+ concurrent-ruby (1.3.5)
102
+ connection_pool (2.5.3)
103
+ crass (1.0.6)
104
+ date (3.4.1)
105
+ debug (1.11.0)
106
+ irb (~> 1.10)
107
+ reline (>= 0.3.8)
108
+ drb (2.2.3)
109
+ erb (5.0.1)
110
+ erubi (1.13.1)
111
+ gemojione (4.3.3)
112
+ json
113
+ github-markup (4.0.2)
114
+ globalid (1.2.1)
115
+ activesupport (>= 6.1)
116
+ gollum (6.1.0)
117
+ gemojione (~> 4.1)
118
+ gollum-lib (~> 6.0)
119
+ i18n (~> 1.8)
120
+ kramdown (~> 2.3)
121
+ kramdown-parser-gfm (~> 1.1.0)
122
+ mustache-sinatra (~> 2.0)
123
+ octicons (~> 19.0)
124
+ rack (>= 3.0)
125
+ rackup (~> 2.1)
126
+ rdoc (~> 6)
127
+ rss (~> 0.3)
128
+ sinatra (~> 4.0)
129
+ sinatra-contrib (~> 4.0)
130
+ sprockets (~> 4.1)
131
+ sprockets-helpers (~> 1.2)
132
+ therubyrhino (~> 2.1.0)
133
+ useragent (~> 0.16.2)
134
+ webrick (~> 1.7)
135
+ gollum-lib (6.0)
136
+ gemojione (~> 4.1)
137
+ github-markup (~> 4.0)
138
+ gollum-rugged_adapter (~> 3.0)
139
+ loofah (~> 2.3)
140
+ nokogiri (~> 1.8)
141
+ rouge (~> 3.1)
142
+ twitter-text (= 1.14.7)
143
+ gollum-rugged_adapter (3.0)
144
+ mime-types (~> 3.4)
145
+ rugged (~> 1.5)
146
+ i18n (1.14.7)
147
+ concurrent-ruby (~> 1.0)
148
+ importmap-rails (2.1.0)
149
+ actionpack (>= 6.0.0)
150
+ activesupport (>= 6.0.0)
151
+ railties (>= 6.0.0)
152
+ io-console (0.8.0)
153
+ irb (1.15.2)
154
+ pp (>= 0.6.0)
155
+ rdoc (>= 4.0.0)
156
+ reline (>= 0.4.2)
157
+ jbuilder (2.13.0)
158
+ actionview (>= 5.0.0)
159
+ activesupport (>= 5.0.0)
160
+ json (2.12.2)
161
+ kramdown (2.5.1)
162
+ rexml (>= 3.3.9)
163
+ kramdown-parser-gfm (1.1.0)
164
+ kramdown (~> 2.0)
165
+ logger (1.7.0)
166
+ loofah (2.24.1)
167
+ crass (~> 1.0.2)
168
+ nokogiri (>= 1.12.0)
169
+ mail (2.8.1)
170
+ mini_mime (>= 0.1.1)
171
+ net-imap
172
+ net-pop
173
+ net-smtp
174
+ marcel (1.0.4)
175
+ matrix (0.4.3)
176
+ method_source (1.1.0)
177
+ mime-types (3.7.0)
178
+ logger
179
+ mime-types-data (~> 3.2025, >= 3.2025.0507)
180
+ mime-types-data (3.2025.0708)
181
+ mini_mime (1.1.5)
182
+ minitest (5.25.5)
183
+ msgpack (1.8.0)
184
+ multi_json (1.15.0)
185
+ mustache (1.1.1)
186
+ mustache-sinatra (2.0.0)
187
+ mustache (~> 1.0)
188
+ mustermann (3.0.3)
189
+ ruby2_keywords (~> 0.0.1)
190
+ mutex_m (0.3.0)
191
+ net-imap (0.5.9)
192
+ date
193
+ net-protocol
194
+ net-pop (0.1.2)
195
+ net-protocol
196
+ net-protocol (0.2.2)
197
+ timeout
198
+ net-smtp (0.5.1)
199
+ net-protocol
200
+ nio4r (2.7.4)
201
+ nokogiri (1.18.8-x86_64-linux-gnu)
202
+ racc (~> 1.4)
203
+ octicons (19.15.3)
204
+ pg (1.5.9)
205
+ pp (0.6.2)
206
+ prettyprint
207
+ prettyprint (0.2.0)
208
+ pry (0.15.2)
209
+ coderay (~> 1.1)
210
+ method_source (~> 1.0)
211
+ pry-byebug (3.11.0)
212
+ byebug (~> 12.0)
213
+ pry (>= 0.13, < 0.16)
214
+ pry-rails (0.3.11)
215
+ pry (>= 0.13.0)
216
+ psych (5.2.6)
217
+ date
218
+ stringio
219
+ public_suffix (6.0.2)
220
+ puma (6.6.0)
221
+ nio4r (~> 2.0)
222
+ racc (1.8.1)
223
+ rack (3.1.16)
224
+ rack-protection (4.1.1)
225
+ base64 (>= 0.1.0)
226
+ logger (>= 1.6.0)
227
+ rack (>= 3.0.0, < 4)
228
+ rack-session (2.1.1)
229
+ base64 (>= 0.1.0)
230
+ rack (>= 3.0.0)
231
+ rack-test (2.2.0)
232
+ rack (>= 1.3)
233
+ rackup (2.2.1)
234
+ rack (>= 3)
235
+ rails (7.1.5.1)
236
+ actioncable (= 7.1.5.1)
237
+ actionmailbox (= 7.1.5.1)
238
+ actionmailer (= 7.1.5.1)
239
+ actionpack (= 7.1.5.1)
240
+ actiontext (= 7.1.5.1)
241
+ actionview (= 7.1.5.1)
242
+ activejob (= 7.1.5.1)
243
+ activemodel (= 7.1.5.1)
244
+ activerecord (= 7.1.5.1)
245
+ activestorage (= 7.1.5.1)
246
+ activesupport (= 7.1.5.1)
247
+ bundler (>= 1.15.0)
248
+ railties (= 7.1.5.1)
249
+ rails-dom-testing (2.3.0)
250
+ activesupport (>= 5.0.0)
251
+ minitest
252
+ nokogiri (>= 1.6)
253
+ rails-html-sanitizer (1.6.2)
254
+ loofah (~> 2.21)
255
+ 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)
256
+ railties (7.1.5.1)
257
+ actionpack (= 7.1.5.1)
258
+ activesupport (= 7.1.5.1)
259
+ irb
260
+ rackup (>= 1.0.0)
261
+ rake (>= 12.2)
262
+ thor (~> 1.0, >= 1.2.2)
263
+ zeitwerk (~> 2.6)
264
+ rake (13.3.0)
265
+ rdoc (6.14.2)
266
+ erb
267
+ psych (>= 4.0.0)
268
+ regexp_parser (2.10.0)
269
+ reline (0.6.1)
270
+ io-console (~> 0.5)
271
+ rexml (3.4.1)
272
+ rouge (3.30.0)
273
+ rss (0.3.1)
274
+ rexml
275
+ ruby2_keywords (0.0.5)
276
+ rubyzip (2.4.1)
277
+ rugged (1.9.0)
278
+ securerandom (0.4.1)
279
+ selenium-webdriver (4.34.0)
280
+ base64 (~> 0.2)
281
+ logger (~> 1.4)
282
+ rexml (~> 3.2, >= 3.2.5)
283
+ rubyzip (>= 1.2.2, < 3.0)
284
+ websocket (~> 1.0)
285
+ sinatra (4.1.1)
286
+ logger (>= 1.6.0)
287
+ mustermann (~> 3.0)
288
+ rack (>= 3.0.0, < 4)
289
+ rack-protection (= 4.1.1)
290
+ rack-session (>= 2.0.0, < 3)
291
+ tilt (~> 2.0)
292
+ sinatra-contrib (4.1.1)
293
+ multi_json (>= 0.0.2)
294
+ mustermann (~> 3.0)
295
+ rack-protection (= 4.1.1)
296
+ sinatra (= 4.1.1)
297
+ tilt (~> 2.0)
298
+ sprockets (4.2.2)
299
+ concurrent-ruby (~> 1.0)
300
+ logger
301
+ rack (>= 2.2.4, < 4)
302
+ sprockets-helpers (1.4.0)
303
+ sprockets (>= 2.2)
304
+ sprockets-rails (3.5.2)
305
+ actionpack (>= 6.1)
306
+ activesupport (>= 6.1)
307
+ sprockets (>= 3.0.0)
308
+ stimulus-rails (1.3.4)
309
+ railties (>= 6.0.0)
310
+ stringio (3.1.7)
311
+ therubyrhino (2.1.2)
312
+ therubyrhino_jar (>= 1.7.4, < 1.7.9)
313
+ therubyrhino_jar (1.7.8)
314
+ thor (1.3.2)
315
+ tilt (2.6.1)
316
+ timeout (0.4.3)
317
+ turbo-rails (2.0.16)
318
+ actionpack (>= 7.1.0)
319
+ railties (>= 7.1.0)
320
+ twitter-text (1.14.7)
321
+ unf (~> 0.1.0)
322
+ tzinfo (2.0.6)
323
+ concurrent-ruby (~> 1.0)
324
+ unf (0.1.4)
325
+ unf_ext
326
+ unf_ext (0.0.9.1)
327
+ useragent (0.16.11)
328
+ web-console (4.2.1)
329
+ actionview (>= 6.0.0)
330
+ activemodel (>= 6.0.0)
331
+ bindex (>= 0.4.0)
332
+ railties (>= 6.0.0)
333
+ webrick (1.9.1)
334
+ websocket (1.2.11)
335
+ websocket-driver (0.8.0)
336
+ base64
337
+ websocket-extensions (>= 0.1.0)
338
+ websocket-extensions (0.1.5)
339
+ xpath (3.2.0)
340
+ nokogiri (~> 1.8)
341
+ zeitwerk (2.7.3)
342
+
343
+PLATFORMS
344
+ x86_64-linux
345
+
346
+DEPENDENCIES
347
+ bootsnap
348
+ capybara
349
+ debug
350
+ gollum
351
+ importmap-rails
352
+ jbuilder
353
+ pg (~> 1.1)
354
+ pry-byebug
355
+ pry-rails
356
+ puma (>= 5.0)
357
+ rails (~> 7.1.5, >= 7.1.5.1)
358
+ selenium-webdriver
359
+ sprockets-rails
360
+ stimulus-rails
361
+ turbo-rails
362
+ tzinfo-data
363
+ web-console
364
+
365
+RUBY VERSION
366
+ ruby 3.2.2p53
367
+
368
+BUNDLED WITH
369
+ 2.4.10
README.md
... ...
@@ -0,0 +1,24 @@
1
+# README
2
+
3
+This README would normally document whatever steps are necessary to get the
4
+application up and running.
5
+
6
+Things you may want to cover:
7
+
8
+* Ruby version
9
+
10
+* System dependencies
11
+
12
+* Configuration
13
+
14
+* Database creation
15
+
16
+* Database initialization
17
+
18
+* How to run the test suite
19
+
20
+* Services (job queues, cache servers, search engines, etc.)
21
+
22
+* Deployment instructions
23
+
24
+* ...
Rakefile
... ...
@@ -0,0 +1,6 @@
1
+# Add your own tasks in files placed in lib/tasks ending in .rake,
2
+# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3
+
4
+require_relative "config/application"
5
+
6
+Rails.application.load_tasks
app/assets/config/manifest.js
... ...
@@ -0,0 +1,4 @@
1
+//= link_tree ../images
2
+//= link_directory ../stylesheets .css
3
+//= link_tree ../../javascript .js
4
+//= link_tree ../../../vendor/javascript .js
app/assets/images/.keep
app/assets/stylesheets/application.css
... ...
@@ -0,0 +1,15 @@
1
+/*
2
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
3
+ * listed below.
4
+ *
5
+ * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
6
+ * vendor/assets/stylesheets directory can be referenced here using a relative path.
7
+ *
8
+ * You're free to add application-wide styles to this file and they'll appear at the bottom of the
9
+ * compiled file so the styles you add here take precedence over styles defined in any other CSS
10
+ * files in this directory. Styles in this file should be added after the last require_* statement.
11
+ * It is generally better to create a new file per style scope.
12
+ *
13
+ *= require_tree .
14
+ *= require_self
15
+ */
app/channels/application_cable/channel.rb
... ...
@@ -0,0 +1,4 @@
1
+module ApplicationCable
2
+ class Channel < ActionCable::Channel::Base
3
+ end
4
+end
app/channels/application_cable/connection.rb
... ...
@@ -0,0 +1,4 @@
1
+module ApplicationCable
2
+ class Connection < ActionCable::Connection::Base
3
+ end
4
+end
app/controllers/application_controller.rb
... ...
@@ -0,0 +1,2 @@
1
+class ApplicationController < ActionController::Base
2
+end
app/controllers/concerns/.keep
app/helpers/application_helper.rb
... ...
@@ -0,0 +1,2 @@
1
+module ApplicationHelper
2
+end
app/javascript/application.js
... ...
@@ -0,0 +1,3 @@
1
+// Configure your import map in config/importmap.rb. Read more: https://github.com/rails/importmap-rails
2
+import "@hotwired/turbo-rails"
3
+import "controllers"
app/javascript/controllers/application.js
... ...
@@ -0,0 +1,9 @@
1
+import { Application } from "@hotwired/stimulus"
2
+
3
+const application = Application.start()
4
+
5
+// Configure Stimulus development experience
6
+application.debug = false
7
+window.Stimulus = application
8
+
9
+export { application }
app/javascript/controllers/hello_controller.js
... ...
@@ -0,0 +1,7 @@
1
+import { Controller } from "@hotwired/stimulus"
2
+
3
+export default class extends Controller {
4
+ connect() {
5
+ this.element.textContent = "Hello World!"
6
+ }
7
+}
app/javascript/controllers/index.js
... ...
@@ -0,0 +1,4 @@
1
+// Import and register all your controllers from the importmap via controllers/**/*_controller
2
+import { application } from "controllers/application"
3
+import { eagerLoadControllersFrom } from "@hotwired/stimulus-loading"
4
+eagerLoadControllersFrom("controllers", application)
app/jobs/application_job.rb
... ...
@@ -0,0 +1,7 @@
1
+class ApplicationJob < ActiveJob::Base
2
+ # Automatically retry jobs that encountered a deadlock
3
+ # retry_on ActiveRecord::Deadlocked
4
+
5
+ # Most jobs are safe to ignore if the underlying records are no longer available
6
+ # discard_on ActiveJob::DeserializationError
7
+end
app/mailers/application_mailer.rb
... ...
@@ -0,0 +1,4 @@
1
+class ApplicationMailer < ActionMailer::Base
2
+ default from: "from@example.com"
3
+ layout "mailer"
4
+end
app/models/application_record.rb
... ...
@@ -0,0 +1,3 @@
1
+class ApplicationRecord < ActiveRecord::Base
2
+ primary_abstract_class
3
+end
app/models/concerns/.keep
app/views/layouts/application.html.erb
... ...
@@ -0,0 +1,16 @@
1
+<!DOCTYPE html>
2
+<html>
3
+ <head>
4
+ <title>Wiki</title>
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <%= csrf_meta_tags %>
7
+ <%= csp_meta_tag %>
8
+
9
+ <%= stylesheet_link_tag "application", "data-turbo-track": "reload" %>
10
+ <%= javascript_importmap_tags %>
11
+ </head>
12
+
13
+ <body>
14
+ <%= yield %>
15
+ </body>
16
+</html>
app/views/layouts/mailer.html.erb
... ...
@@ -0,0 +1,13 @@
1
+<!DOCTYPE html>
2
+<html>
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
5
+ <style>
6
+ /* Email styles need to be inline */
7
+ </style>
8
+ </head>
9
+
10
+ <body>
11
+ <%= yield %>
12
+ </body>
13
+</html>
app/views/layouts/mailer.text.erb
... ...
@@ -0,0 +1 @@
1
+<%= yield %>
bin/bundle
... ...
@@ -0,0 +1,109 @@
1
+#!/usr/bin/env ruby
2
+# frozen_string_literal: true
3
+
4
+#
5
+# This file was generated by Bundler.
6
+#
7
+# The application 'bundle' is installed as part of a gem, and
8
+# this file is here to facilitate running it.
9
+#
10
+
11
+require "rubygems"
12
+
13
+m = Module.new do
14
+ module_function
15
+
16
+ def invoked_as_script?
17
+ File.expand_path($0) == File.expand_path(__FILE__)
18
+ end
19
+
20
+ def env_var_version
21
+ ENV["BUNDLER_VERSION"]
22
+ end
23
+
24
+ def cli_arg_version
25
+ return unless invoked_as_script? # don't want to hijack other binstubs
26
+ return unless "update".start_with?(ARGV.first || " ") # must be running `bundle update`
27
+ bundler_version = nil
28
+ update_index = nil
29
+ ARGV.each_with_index do |a, i|
30
+ if update_index && update_index.succ == i && a =~ Gem::Version::ANCHORED_VERSION_PATTERN
31
+ bundler_version = a
32
+ end
33
+ next unless a =~ /\A--bundler(?:[= ](#{Gem::Version::VERSION_PATTERN}))?\z/
34
+ bundler_version = $1
35
+ update_index = i
36
+ end
37
+ bundler_version
38
+ end
39
+
40
+ def gemfile
41
+ gemfile = ENV["BUNDLE_GEMFILE"]
42
+ return gemfile if gemfile && !gemfile.empty?
43
+
44
+ File.expand_path("../Gemfile", __dir__)
45
+ end
46
+
47
+ def lockfile
48
+ lockfile =
49
+ case File.basename(gemfile)
50
+ when "gems.rb" then gemfile.sub(/\.rb$/, ".locked")
51
+ else "#{gemfile}.lock"
52
+ end
53
+ File.expand_path(lockfile)
54
+ end
55
+
56
+ def lockfile_version
57
+ return unless File.file?(lockfile)
58
+ lockfile_contents = File.read(lockfile)
59
+ return unless lockfile_contents =~ /\n\nBUNDLED WITH\n\s{2,}(#{Gem::Version::VERSION_PATTERN})\n/
60
+ Regexp.last_match(1)
61
+ end
62
+
63
+ def bundler_requirement
64
+ @bundler_requirement ||=
65
+ env_var_version ||
66
+ cli_arg_version ||
67
+ bundler_requirement_for(lockfile_version)
68
+ end
69
+
70
+ def bundler_requirement_for(version)
71
+ return "#{Gem::Requirement.default}.a" unless version
72
+
73
+ bundler_gem_version = Gem::Version.new(version)
74
+
75
+ bundler_gem_version.approximate_recommendation
76
+ end
77
+
78
+ def load_bundler!
79
+ ENV["BUNDLE_GEMFILE"] ||= gemfile
80
+
81
+ activate_bundler
82
+ end
83
+
84
+ def activate_bundler
85
+ gem_error = activation_error_handling do
86
+ gem "bundler", bundler_requirement
87
+ end
88
+ return if gem_error.nil?
89
+ require_error = activation_error_handling do
90
+ require "bundler/version"
91
+ end
92
+ return if require_error.nil? && Gem::Requirement.new(bundler_requirement).satisfied_by?(Gem::Version.new(Bundler::VERSION))
93
+ warn "Activating bundler (#{bundler_requirement}) failed:\n#{gem_error.message}\n\nTo install the version of bundler this project requires, run `gem install bundler -v '#{bundler_requirement}'`"
94
+ exit 42
95
+ end
96
+
97
+ def activation_error_handling
98
+ yield
99
+ nil
100
+ rescue StandardError, LoadError => e
101
+ e
102
+ end
103
+end
104
+
105
+m.load_bundler!
106
+
107
+if m.invoked_as_script?
108
+ load Gem.bin_path("bundler", "bundle")
109
+end
bin/docker-entrypoint
... ...
@@ -0,0 +1,8 @@
1
+#!/bin/bash -e
2
+
3
+# If running the rails server then create or migrate existing database
4
+if [ "${1}" == "./bin/rails" ] && [ "${2}" == "server" ]; then
5
+ ./bin/rails db:prepare
6
+fi
7
+
8
+exec "${@}"
bin/importmap
... ...
@@ -0,0 +1,4 @@
1
+#!/usr/bin/env ruby
2
+
3
+require_relative "../config/application"
4
+require "importmap/commands"
bin/rails
... ...
@@ -0,0 +1,4 @@
1
+#!/usr/bin/env ruby
2
+APP_PATH = File.expand_path("../config/application", __dir__)
3
+require_relative "../config/boot"
4
+require "rails/commands"
bin/rake
... ...
@@ -0,0 +1,4 @@
1
+#!/usr/bin/env ruby
2
+require_relative "../config/boot"
3
+require "rake"
4
+Rake.application.run
bin/setup
... ...
@@ -0,0 +1,33 @@
1
+#!/usr/bin/env ruby
2
+require "fileutils"
3
+
4
+# path to your application root.
5
+APP_ROOT = File.expand_path("..", __dir__)
6
+
7
+def system!(*args)
8
+ system(*args, exception: true)
9
+end
10
+
11
+FileUtils.chdir APP_ROOT do
12
+ # This script is a way to set up or update your development environment automatically.
13
+ # This script is idempotent, so that you can run it at any time and get an expectable outcome.
14
+ # Add necessary setup steps to this file.
15
+
16
+ puts "== Installing dependencies =="
17
+ system! "gem install bundler --conservative"
18
+ system("bundle check") || system!("bundle install")
19
+
20
+ # puts "\n== Copying sample files =="
21
+ # unless File.exist?("config/database.yml")
22
+ # FileUtils.cp "config/database.yml.sample", "config/database.yml"
23
+ # end
24
+
25
+ puts "\n== Preparing database =="
26
+ system! "bin/rails db:prepare"
27
+
28
+ puts "\n== Removing old logs and tempfiles =="
29
+ system! "bin/rails log:clear tmp:clear"
30
+
31
+ puts "\n== Restarting application server =="
32
+ system! "bin/rails restart"
33
+end
config.ru
... ...
@@ -0,0 +1,6 @@
1
+# This file is used by Rack-based servers to start the application.
2
+
3
+require_relative "config/environment"
4
+
5
+run Rails.application
6
+Rails.application.load_server
config/application.rb
... ...
@@ -0,0 +1,32 @@
1
+require_relative "boot"
2
+
3
+require "rails/all"
4
+
5
+# Require the gems listed in Gemfile, including any gems
6
+# you've limited to :test, :development, or :production.
7
+Bundler.require(*Rails.groups)
8
+
9
+module Wiki
10
+ class Application < Rails::Application
11
+ # Initialize configuration defaults for originally generated Rails version.
12
+ config.load_defaults 7.1
13
+
14
+ # Please, add to the `ignore` list any other `lib` subdirectories that do
15
+ # not contain `.rb` files, or that should not be reloaded or eager loaded.
16
+ # Common ones are `templates`, `generators`, or `middleware`, for example.
17
+ config.autoload_lib(ignore: %w(assets tasks))
18
+
19
+ config.i18n.available_locales = [:ru, :en]
20
+ config.i18n.default_locale = :ru
21
+ config.i18n.locale = :ru
22
+ config.time_zone = 'Europe/Moscow'
23
+
24
+ # Configuration for the application, engines, and railties goes here.
25
+ #
26
+ # These settings can be overridden in specific environments using the files
27
+ # in config/environments, which are processed later.
28
+ #
29
+ # config.time_zone = "Central Time (US & Canada)"
30
+ # config.eager_load_paths << Rails.root.join("extras")
31
+ end
32
+end
config/boot.rb
... ...
@@ -0,0 +1,4 @@
1
+ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
2
+
3
+require "bundler/setup" # Set up gems listed in the Gemfile.
4
+require "bootsnap/setup" # Speed up boot time by caching expensive operations.
config/cable.yml
... ...
@@ -0,0 +1,10 @@
1
+development:
2
+ adapter: async
3
+
4
+test:
5
+ adapter: test
6
+
7
+production:
8
+ adapter: redis
9
+ url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %>
10
+ channel_prefix: wiki_production
config/credentials.yml.enc
... ...
@@ -0,0 +1 @@
1
+DmEVXxlypZqIQaSrDXbO/o+FbpqGtaUthosDm654o815osU6uMIIvPfUsezffm9INQv4tKUrqEYKTjFoa+uWkOUlZcbuMQDp5oPzSW9ul76QyNtS0VJdLULa3O3D05+363X6LFMHWRHrYsiDC0x54SFDGIEOFyXXnOtfktxMCwla9buTRWcxR7Xf1q7Rd6BSRFXbLwzYd82cfymKaARH6r9rI52onnxBKcbW2Vrnga7k0y10/z+BJh5scL77o+wWrl8ghxWpIXL6MtUvF6DkNOFyXrdtQV/n+mY3DTiXOcuFx9u20h5cyDGKxyd3WVDVes3ZzBl9E0jRH0AYHq5R1VK6J9kQyKwwiNVpcxcZbBxOpi1Ixy1zfRZS/+It9wLDrtKTOXAj/QSdSiezvSKaobEU5xWq--yY8o9gz19cGAODOg--FbNg6Y3jxblYKrbH3A5xcg==
... ...
\ No newline at end of file
config/database.yml
... ...
@@ -0,0 +1,84 @@
1
+# PostgreSQL. Versions 9.3 and up are supported.
2
+#
3
+# Install the pg driver:
4
+# gem install pg
5
+# On macOS with Homebrew:
6
+# gem install pg -- --with-pg-config=/usr/local/bin/pg_config
7
+# On Windows:
8
+# gem install pg
9
+# Choose the win32 build.
10
+# Install PostgreSQL and put its /bin directory on your path.
11
+#
12
+# Configure Using Gemfile
13
+# gem "pg"
14
+#
15
+default: &default
16
+ adapter: postgresql
17
+ encoding: unicode
18
+ # For details on connection pooling, see Rails configuration guide
19
+ # https://guides.rubyonrails.org/configuring.html#database-pooling
20
+ pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
21
+
22
+development:
23
+ <<: *default
24
+ database: wiki_development
25
+
26
+ # The specified database role being used to connect to PostgreSQL.
27
+ # To create additional roles in PostgreSQL see `$ createuser --help`.
28
+ # When left blank, PostgreSQL will use the default role. This is
29
+ # the same name as the operating system user running Rails.
30
+ #username: wiki
31
+
32
+ # The password associated with the PostgreSQL role (username).
33
+ #password:
34
+
35
+ # Connect on a TCP socket. Omitted by default since the client uses a
36
+ # domain socket that doesn't need configuration. Windows does not have
37
+ # domain sockets, so uncomment these lines.
38
+ #host: localhost
39
+
40
+ # The TCP port the server listens on. Defaults to 5432.
41
+ # If your server runs on a different port number, change accordingly.
42
+ #port: 5432
43
+
44
+ # Schema search path. The server defaults to $user,public
45
+ #schema_search_path: myapp,sharedapp,public
46
+
47
+ # Minimum log levels, in increasing order:
48
+ # debug5, debug4, debug3, debug2, debug1,
49
+ # log, notice, warning, error, fatal, and panic
50
+ # Defaults to warning.
51
+ #min_messages: notice
52
+
53
+# Warning: The database defined as "test" will be erased and
54
+# re-generated from your development database when you run "rake".
55
+# Do not set this db to the same as development or production.
56
+test:
57
+ <<: *default
58
+ database: wiki_test
59
+
60
+# As with config/credentials.yml, you never want to store sensitive information,
61
+# like your database password, in your source code. If your source code is
62
+# ever seen by anyone, they now have access to your database.
63
+#
64
+# Instead, provide the password or a full connection URL as an environment
65
+# variable when you boot the app. For example:
66
+#
67
+# DATABASE_URL="postgres://myuser:mypass@localhost/somedatabase"
68
+#
69
+# If the connection URL is provided in the special DATABASE_URL environment
70
+# variable, Rails will automatically merge its configuration values on top of
71
+# the values provided in this file. Alternatively, you can specify a connection
72
+# URL environment variable explicitly:
73
+#
74
+# production:
75
+# url: <%= ENV["MY_APP_DATABASE_URL"] %>
76
+#
77
+# Read https://guides.rubyonrails.org/configuring.html#configuring-a-database
78
+# for a full overview on how database connection configuration can be specified.
79
+#
80
+production:
81
+ <<: *default
82
+ database: wiki_production
83
+ username: wiki
84
+ password: <%= ENV["WIKI_DATABASE_PASSWORD"] %>
config/environment.rb
... ...
@@ -0,0 +1,5 @@
1
+# Load the Rails application.
2
+require_relative "application"
3
+
4
+# Initialize the Rails application.
5
+Rails.application.initialize!
config/environments/development.rb
... ...
@@ -0,0 +1,76 @@
1
+require "active_support/core_ext/integer/time"
2
+
3
+Rails.application.configure do
4
+ # Settings specified here will take precedence over those in config/application.rb.
5
+
6
+ # In the development environment your application's code is reloaded any time
7
+ # it changes. This slows down response time but is perfect for development
8
+ # since you don't have to restart the web server when you make code changes.
9
+ config.enable_reloading = true
10
+
11
+ # Do not eager load code on boot.
12
+ config.eager_load = false
13
+
14
+ # Show full error reports.
15
+ config.consider_all_requests_local = true
16
+
17
+ # Enable server timing
18
+ config.server_timing = true
19
+
20
+ # Enable/disable caching. By default caching is disabled.
21
+ # Run rails dev:cache to toggle caching.
22
+ if Rails.root.join("tmp/caching-dev.txt").exist?
23
+ config.action_controller.perform_caching = true
24
+ config.action_controller.enable_fragment_cache_logging = true
25
+
26
+ config.cache_store = :memory_store
27
+ config.public_file_server.headers = {
28
+ "Cache-Control" => "public, max-age=#{2.days.to_i}"
29
+ }
30
+ else
31
+ config.action_controller.perform_caching = false
32
+
33
+ config.cache_store = :null_store
34
+ end
35
+
36
+ # Store uploaded files on the local file system (see config/storage.yml for options).
37
+ config.active_storage.service = :local
38
+
39
+ # Don't care if the mailer can't send.
40
+ config.action_mailer.raise_delivery_errors = false
41
+
42
+ config.action_mailer.perform_caching = false
43
+
44
+ # Print deprecation notices to the Rails logger.
45
+ config.active_support.deprecation = :log
46
+
47
+ # Raise exceptions for disallowed deprecations.
48
+ config.active_support.disallowed_deprecation = :raise
49
+
50
+ # Tell Active Support which deprecation messages to disallow.
51
+ config.active_support.disallowed_deprecation_warnings = []
52
+
53
+ # Raise an error on page load if there are pending migrations.
54
+ config.active_record.migration_error = :page_load
55
+
56
+ # Highlight code that triggered database queries in logs.
57
+ config.active_record.verbose_query_logs = true
58
+
59
+ # Highlight code that enqueued background job in logs.
60
+ config.active_job.verbose_enqueue_logs = true
61
+
62
+ # Suppress logger output for asset requests.
63
+ config.assets.quiet = true
64
+
65
+ # Raises error for missing translations.
66
+ # config.i18n.raise_on_missing_translations = true
67
+
68
+ # Annotate rendered view with file names.
69
+ # config.action_view.annotate_rendered_view_with_filenames = true
70
+
71
+ # Uncomment if you wish to allow Action Cable access from any origin.
72
+ # config.action_cable.disable_request_forgery_protection = true
73
+
74
+ # Raise error when a before_action's only/except options reference missing actions
75
+ config.action_controller.raise_on_missing_callback_actions = true
76
+end
config/environments/production.rb
... ...
@@ -0,0 +1,97 @@
1
+require "active_support/core_ext/integer/time"
2
+
3
+Rails.application.configure do
4
+ # Settings specified here will take precedence over those in config/application.rb.
5
+
6
+ # Code is not reloaded between requests.
7
+ config.enable_reloading = false
8
+
9
+ # Eager load code on boot. This eager loads most of Rails and
10
+ # your application in memory, allowing both threaded web servers
11
+ # and those relying on copy on write to perform better.
12
+ # Rake tasks automatically ignore this option for performance.
13
+ config.eager_load = true
14
+
15
+ # Full error reports are disabled and caching is turned on.
16
+ config.consider_all_requests_local = false
17
+ config.action_controller.perform_caching = true
18
+
19
+ # Ensures that a master key has been made available in ENV["RAILS_MASTER_KEY"], config/master.key, or an environment
20
+ # key such as config/credentials/production.key. This key is used to decrypt credentials (and other encrypted files).
21
+ # config.require_master_key = true
22
+
23
+ # Disable serving static files from `public/`, relying on NGINX/Apache to do so instead.
24
+ # config.public_file_server.enabled = false
25
+
26
+ # Compress CSS using a preprocessor.
27
+ # config.assets.css_compressor = :sass
28
+
29
+ # Do not fall back to assets pipeline if a precompiled asset is missed.
30
+ config.assets.compile = false
31
+
32
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server.
33
+ # config.asset_host = "http://assets.example.com"
34
+
35
+ # Specifies the header that your server uses for sending files.
36
+ # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for Apache
37
+ # config.action_dispatch.x_sendfile_header = "X-Accel-Redirect" # for NGINX
38
+
39
+ # Store uploaded files on the local file system (see config/storage.yml for options).
40
+ config.active_storage.service = :local
41
+
42
+ # Mount Action Cable outside main process or domain.
43
+ # config.action_cable.mount_path = nil
44
+ # config.action_cable.url = "wss://example.com/cable"
45
+ # config.action_cable.allowed_request_origins = [ "http://example.com", /http:\/\/example.*/ ]
46
+
47
+ # Assume all access to the app is happening through a SSL-terminating reverse proxy.
48
+ # Can be used together with config.force_ssl for Strict-Transport-Security and secure cookies.
49
+ # config.assume_ssl = true
50
+
51
+ # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
52
+ config.force_ssl = true
53
+
54
+ # Log to STDOUT by default
55
+ config.logger = ActiveSupport::Logger.new(STDOUT)
56
+ .tap { |logger| logger.formatter = ::Logger::Formatter.new }
57
+ .then { |logger| ActiveSupport::TaggedLogging.new(logger) }
58
+
59
+ # Prepend all log lines with the following tags.
60
+ config.log_tags = [ :request_id ]
61
+
62
+ # "info" includes generic and useful information about system operation, but avoids logging too much
63
+ # information to avoid inadvertent exposure of personally identifiable information (PII). If you
64
+ # want to log everything, set the level to "debug".
65
+ config.log_level = ENV.fetch("RAILS_LOG_LEVEL", "info")
66
+
67
+ # Use a different cache store in production.
68
+ # config.cache_store = :mem_cache_store
69
+
70
+ # Use a real queuing backend for Active Job (and separate queues per environment).
71
+ # config.active_job.queue_adapter = :resque
72
+ # config.active_job.queue_name_prefix = "wiki_production"
73
+
74
+ config.action_mailer.perform_caching = false
75
+
76
+ # Ignore bad email addresses and do not raise email delivery errors.
77
+ # Set this to true and configure the email server for immediate delivery to raise delivery errors.
78
+ # config.action_mailer.raise_delivery_errors = false
79
+
80
+ # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
81
+ # the I18n.default_locale when a translation cannot be found).
82
+ config.i18n.fallbacks = true
83
+
84
+ # Don't log any deprecations.
85
+ config.active_support.report_deprecations = false
86
+
87
+ # Do not dump schema after migrations.
88
+ config.active_record.dump_schema_after_migration = false
89
+
90
+ # Enable DNS rebinding protection and other `Host` header attacks.
91
+ # config.hosts = [
92
+ # "example.com", # Allow requests from example.com
93
+ # /.*\.example\.com/ # Allow requests from subdomains like `www.example.com`
94
+ # ]
95
+ # Skip DNS rebinding protection for the default health check endpoint.
96
+ # config.host_authorization = { exclude: ->(request) { request.path == "/up" } }
97
+end
config/environments/test.rb
... ...
@@ -0,0 +1,64 @@
1
+require "active_support/core_ext/integer/time"
2
+
3
+# The test environment is used exclusively to run your application's
4
+# test suite. You never need to work with it otherwise. Remember that
5
+# your test database is "scratch space" for the test suite and is wiped
6
+# and recreated between test runs. Don't rely on the data there!
7
+
8
+Rails.application.configure do
9
+ # Settings specified here will take precedence over those in config/application.rb.
10
+
11
+ # While tests run files are not watched, reloading is not necessary.
12
+ config.enable_reloading = false
13
+
14
+ # Eager loading loads your entire application. When running a single test locally,
15
+ # this is usually not necessary, and can slow down your test suite. However, it's
16
+ # recommended that you enable it in continuous integration systems to ensure eager
17
+ # loading is working properly before deploying your code.
18
+ config.eager_load = ENV["CI"].present?
19
+
20
+ # Configure public file server for tests with Cache-Control for performance.
21
+ config.public_file_server.enabled = true
22
+ config.public_file_server.headers = {
23
+ "Cache-Control" => "public, max-age=#{1.hour.to_i}"
24
+ }
25
+
26
+ # Show full error reports and disable caching.
27
+ config.consider_all_requests_local = true
28
+ config.action_controller.perform_caching = false
29
+ config.cache_store = :null_store
30
+
31
+ # Render exception templates for rescuable exceptions and raise for other exceptions.
32
+ config.action_dispatch.show_exceptions = :rescuable
33
+
34
+ # Disable request forgery protection in test environment.
35
+ config.action_controller.allow_forgery_protection = false
36
+
37
+ # Store uploaded files on the local file system in a temporary directory.
38
+ config.active_storage.service = :test
39
+
40
+ config.action_mailer.perform_caching = false
41
+
42
+ # Tell Action Mailer not to deliver emails to the real world.
43
+ # The :test delivery method accumulates sent emails in the
44
+ # ActionMailer::Base.deliveries array.
45
+ config.action_mailer.delivery_method = :test
46
+
47
+ # Print deprecation notices to the stderr.
48
+ config.active_support.deprecation = :stderr
49
+
50
+ # Raise exceptions for disallowed deprecations.
51
+ config.active_support.disallowed_deprecation = :raise
52
+
53
+ # Tell Active Support which deprecation messages to disallow.
54
+ config.active_support.disallowed_deprecation_warnings = []
55
+
56
+ # Raises error for missing translations.
57
+ # config.i18n.raise_on_missing_translations = true
58
+
59
+ # Annotate rendered view with file names.
60
+ # config.action_view.annotate_rendered_view_with_filenames = true
61
+
62
+ # Raise error when a before_action's only/except options reference missing actions
63
+ config.action_controller.raise_on_missing_callback_actions = true
64
+end
config/importmap.rb
... ...
@@ -0,0 +1,7 @@
1
+# Pin npm packages by running ./bin/importmap
2
+
3
+pin "application"
4
+pin "@hotwired/turbo-rails", to: "turbo.min.js"
5
+pin "@hotwired/stimulus", to: "stimulus.min.js"
6
+pin "@hotwired/stimulus-loading", to: "stimulus-loading.js"
7
+pin_all_from "app/javascript/controllers", under: "controllers"
config/initializers/assets.rb
... ...
@@ -0,0 +1,12 @@
1
+# Be sure to restart your server when you modify this file.
2
+
3
+# Version of your assets, change this if you want to expire all your assets.
4
+Rails.application.config.assets.version = "1.0"
5
+
6
+# Add additional assets to the asset load path.
7
+# Rails.application.config.assets.paths << Emoji.images_path
8
+
9
+# Precompile additional assets.
10
+# application.js, application.css, and all non-JS/CSS in the app/assets
11
+# folder are already added.
12
+# Rails.application.config.assets.precompile += %w( admin.js admin.css )
config/initializers/content_security_policy.rb
... ...
@@ -0,0 +1,25 @@
1
+# Be sure to restart your server when you modify this file.
2
+
3
+# Define an application-wide content security policy.
4
+# See the Securing Rails Applications Guide for more information:
5
+# https://guides.rubyonrails.org/security.html#content-security-policy-header
6
+
7
+# Rails.application.configure do
8
+# config.content_security_policy do |policy|
9
+# policy.default_src :self, :https
10
+# policy.font_src :self, :https, :data
11
+# policy.img_src :self, :https, :data
12
+# policy.object_src :none
13
+# policy.script_src :self, :https
14
+# policy.style_src :self, :https
15
+# # Specify URI for violation reports
16
+# # policy.report_uri "/csp-violation-report-endpoint"
17
+# end
18
+#
19
+# # Generate session nonces for permitted importmap, inline scripts, and inline styles.
20
+# config.content_security_policy_nonce_generator = ->(request) { request.session.id.to_s }
21
+# config.content_security_policy_nonce_directives = %w(script-src style-src)
22
+#
23
+# # Report violations without enforcing the policy.
24
+# # config.content_security_policy_report_only = true
25
+# end
config/initializers/filter_parameter_logging.rb
... ...
@@ -0,0 +1,8 @@
1
+# Be sure to restart your server when you modify this file.
2
+
3
+# Configure parameters to be partially matched (e.g. passw matches password) and filtered from the log file.
4
+# Use this to limit dissemination of sensitive information.
5
+# See the ActiveSupport::ParameterFilter documentation for supported notations and behaviors.
6
+Rails.application.config.filter_parameters += [
7
+ :passw, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn
8
+]
config/initializers/inflections.rb
... ...
@@ -0,0 +1,16 @@
1
+# Be sure to restart your server when you modify this file.
2
+
3
+# Add new inflection rules using the following format. Inflections
4
+# are locale specific, and you may define rules for as many different
5
+# locales as you wish. All of these examples are active by default:
6
+# ActiveSupport::Inflector.inflections(:en) do |inflect|
7
+# inflect.plural /^(ox)$/i, "\\1en"
8
+# inflect.singular /^(ox)en/i, "\\1"
9
+# inflect.irregular "person", "people"
10
+# inflect.uncountable %w( fish sheep )
11
+# end
12
+
13
+# These inflection rules are supported but not enabled by default:
14
+# ActiveSupport::Inflector.inflections(:en) do |inflect|
15
+# inflect.acronym "RESTful"
16
+# end
config/initializers/permissions_policy.rb
... ...
@@ -0,0 +1,13 @@
1
+# Be sure to restart your server when you modify this file.
2
+
3
+# Define an application-wide HTTP permissions policy. For further
4
+# information see: https://developers.google.com/web/updates/2018/06/feature-policy
5
+
6
+# Rails.application.config.permissions_policy do |policy|
7
+# policy.camera :none
8
+# policy.gyroscope :none
9
+# policy.microphone :none
10
+# policy.usb :none
11
+# policy.fullscreen :self
12
+# policy.payment :self, "https://secure.example.com"
13
+# end
config/locales/en.yml
... ...
@@ -0,0 +1,31 @@
1
+# Files in the config/locales directory are used for internationalization and
2
+# are automatically loaded by Rails. If you want to use locales other than
3
+# English, add the necessary files in this directory.
4
+#
5
+# To use the locales, use `I18n.t`:
6
+#
7
+# I18n.t "hello"
8
+#
9
+# In views, this is aliased to just `t`:
10
+#
11
+# <%= t("hello") %>
12
+#
13
+# To use a different locale, set it with `I18n.locale`:
14
+#
15
+# I18n.locale = :es
16
+#
17
+# This would use the information in config/locales/es.yml.
18
+#
19
+# To learn more about the API, please read the Rails Internationalization guide
20
+# at https://guides.rubyonrails.org/i18n.html.
21
+#
22
+# Be aware that YAML interprets the following case-insensitive strings as
23
+# booleans: `true`, `false`, `on`, `off`, `yes`, `no`. Therefore, these strings
24
+# must be quoted to be interpreted as strings. For example:
25
+#
26
+# en:
27
+# "yes": yup
28
+# enabled: "ON"
29
+
30
+en:
31
+ hello: "Hello world"
config/locales/ru.yml
... ...
@@ -0,0 +1,103 @@
1
+ru:
2
+ create:
3
+ title: Создать страницу
4
+ edit: Редактировать
5
+ preview: Предпросмотр
6
+ navbar:
7
+ home_button: Главная
8
+ overview_button: Репозиторий
9
+ latest_changes_button: Последние изменения
10
+ history_button: История
11
+ upload_button: Загрузить
12
+ rename_button: Переименовать
13
+ edit_button: Редактировать
14
+ new_button: Новая
15
+ searchbar:
16
+ placeholder: Поиск
17
+ aria:
18
+ label: Поиск по сайту
19
+ wiki_content:
20
+ last_edit: Когда эта страница была последний раз изменена?
21
+ delete_link:
22
+ title: Удалить эту страницу
23
+ confirm: Вы уверены?
24
+ editor:
25
+ restore_button:
26
+ value: Восстановить текст
27
+ prompt: Нажмите кнопку, чтобы восстановить текст.
28
+ function_bar:
29
+ heading1:
30
+ value: H1
31
+ title: Заголовок 1
32
+ heading2:
33
+ value: H2
34
+ title: Заголовок 2
35
+ heading3:
36
+ value: H3
37
+ title: Заголовок 3
38
+ link: Ссылка
39
+ image: Картинка
40
+ bold: Жирный
41
+ italic: Курсив
42
+ code: Код
43
+ unordered_list: Список
44
+ ordered_list: Упорядоченный список
45
+ blockquote: Цитата
46
+ horizontal_rule: Линия
47
+ accept_selected_criticMarkup: Принять CriticMarkup
48
+ reject_selected_criticMarkup: Отклонить CriticMarkup
49
+ reverse_text_direction: Расположение текста
50
+ help: Помощь
51
+ keybinding: Горячие клавиши
52
+ wiki_format: Установить формат страницы
53
+ rendering_unavailable_for: Рендеринг недоступен для
54
+ save_button:
55
+ value: Сохранить
56
+ title: Сохранить текущие изменения
57
+ cancel_button:
58
+ value: Отмена
59
+ title: Отмена редактирования
60
+ confirm: Отмена может привести к потере данных. Вы уверены, что хотите продолжить?
61
+ note:
62
+ title: "Примечание:"
63
+ content: "Эта страница будет создана в %{path} каталоге."
64
+ pagination:
65
+ aria:
66
+ label: Страницы
67
+ next_page: Следующая страница
68
+ previous_page: Предыдущая страница
69
+ next: Следующая
70
+ previous: Предыдущая
71
+ precious/views/compare:
72
+ back_to_page_history: Вернуться к истории страницы
73
+ back_to_top: Вернуться к началу
74
+ comparison_of: Сравнение
75
+ comparing_versions_of: "Сравнение версий %{name}"
76
+ comparing_from: "Сравнить %{before} после %{after}"
77
+ revert: Отменить изменения
78
+ precious/views/edit:
79
+ edit: Редактировать
80
+ preview: Предпросмотр
81
+ title: "Редактирование %{title}"
82
+ precious/views/error:
83
+ error: Ошибка
84
+ precious/views/history:
85
+ browse_in_history_description: Просмотреть страницу на данном этапе истории
86
+ compare_revisions: Сравнить версии
87
+ history_for: "История %{name}"
88
+ precious/views/latest_changes:
89
+ title: Последние изменения
90
+ precious/views/layout:
91
+ title: Главная
92
+ precious/views/overview:
93
+ back_to_top: Вернуться к началу
94
+ delete_confirmation: "Вы уверены, что хотите удалить %{name}?"
95
+ no_pages_in: "Нет страниц в %{ref}."
96
+ title: "Обзор %{ref}"
97
+ precious/views/search:
98
+ aria:
99
+ show_all: Показать все совпадения на этой странице
100
+ back_to_top: Вернуться к началу
101
+ no_results: По вашему запросу ничего не найдено.
102
+ search_results_for: "Результаты поиска по запросу %{query}"
103
+ title: "Результаты поиска по запросу %{query}"
config/puma.rb
... ...
@@ -0,0 +1,44 @@
1
+# This configuration file will be evaluated by Puma. The top-level methods that
2
+# are invoked here are part of Puma's configuration DSL. For more information
3
+# about methods provided by the DSL, see https://puma.io/puma/Puma/DSL.html.
4
+
5
+# Puma can serve each request in a thread from an internal thread pool.
6
+# The `threads` method setting takes two numbers: a minimum and maximum.
7
+# Any libraries that use thread pools should be configured to match
8
+# the maximum value specified for Puma. Default is set to 5 threads for minimum
9
+# and maximum; this matches the default thread size of Active Record.
10
+max_threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }
11
+min_threads_count = ENV.fetch("RAILS_MIN_THREADS") { max_threads_count }
12
+threads min_threads_count, max_threads_count
13
+
14
+rails_env = ENV.fetch("RAILS_ENV") { "development" }
15
+
16
+if rails_env == "production"
17
+ # If you are running more than 1 thread per process, the workers count
18
+ # should be equal to the number of processors (CPU cores) in production.
19
+ #
20
+ # It defaults to 1 because it's impossible to reliably detect how many
21
+ # CPU cores are available. Make sure to set the `WEB_CONCURRENCY` environment
22
+ # variable to match the number of processors.
23
+ worker_count = Integer(ENV.fetch("WEB_CONCURRENCY") { 1 })
24
+ if worker_count > 1
25
+ workers worker_count
26
+ else
27
+ preload_app!
28
+ end
29
+end
30
+# Specifies the `worker_timeout` threshold that Puma will use to wait before
31
+# terminating a worker in development environments.
32
+worker_timeout 3600 if ENV.fetch("RAILS_ENV", "development") == "development"
33
+
34
+# Specifies the `port` that Puma will listen on to receive requests; default is 3000.
35
+port ENV.fetch("PORT") { 3000 }
36
+
37
+# Specifies the `environment` that Puma will run in.
38
+environment rails_env
39
+
40
+# Specifies the `pidfile` that Puma will use.
41
+pidfile ENV.fetch("PIDFILE") { "tmp/pids/server.pid" }
42
+
43
+# Allow puma to be restarted by `bin/rails restart` command.
44
+plugin :tmp_restart
config/routes.rb
... ...
@@ -0,0 +1,11 @@
1
+Rails.application.routes.draw do
2
+ require 'gollum/app'
3
+
4
+ Rails.application.routes.draw do
5
+ wiki_options = {:universal_toc => false}
6
+ Precious::App.set(:gollum_path, Rails.root.join('gollum').to_s)
7
+ Precious::App.set(:default_markup, :markdown) # set your favorite markup language
8
+ Precious::App.set(:wiki_options, wiki_options)
9
+ mount Precious::App, at:'/'
10
+ end
11
+end
config/storage.yml
... ...
@@ -0,0 +1,34 @@
1
+test:
2
+ service: Disk
3
+ root: <%= Rails.root.join("tmp/storage") %>
4
+
5
+local:
6
+ service: Disk
7
+ root: <%= Rails.root.join("storage") %>
8
+
9
+# Use bin/rails credentials:edit to set the AWS secrets (as aws:access_key_id|secret_access_key)
10
+# amazon:
11
+# service: S3
12
+# access_key_id: <%= Rails.application.credentials.dig(:aws, :access_key_id) %>
13
+# secret_access_key: <%= Rails.application.credentials.dig(:aws, :secret_access_key) %>
14
+# region: us-east-1
15
+# bucket: your_own_bucket-<%= Rails.env %>
16
+
17
+# Remember not to checkin your GCS keyfile to a repository
18
+# google:
19
+# service: GCS
20
+# project: your_project
21
+# credentials: <%= Rails.root.join("path/to/gcs.keyfile") %>
22
+# bucket: your_own_bucket-<%= Rails.env %>
23
+
24
+# Use bin/rails credentials:edit to set the Azure Storage secret (as azure_storage:storage_access_key)
25
+# microsoft:
26
+# service: AzureStorage
27
+# storage_account_name: your_account_name
28
+# storage_access_key: <%= Rails.application.credentials.dig(:azure_storage, :storage_access_key) %>
29
+# container: your_container_name-<%= Rails.env %>
30
+
31
+# mirror:
32
+# service: Mirror
33
+# primary: local
34
+# mirrors: [ amazon, google, microsoft ]
db/seeds.rb
... ...
@@ -0,0 +1,9 @@
1
+# This file should ensure the existence of records required to run the application in every environment (production,
2
+# development, test). The code here should be idempotent so that it can be executed at any point in every environment.
3
+# The data can then be loaded with the bin/rails db:seed command (or created alongside the database with db:setup).
4
+#
5
+# Example:
6
+#
7
+# ["Action", "Comedy", "Drama", "Horror"].each do |genre_name|
8
+# MovieGenre.find_or_create_by!(name: genre_name)
9
+# end
gollum
... ...
@@ -0,0 +1 @@
1
+Subproject commit b0b07bfb5da78e0f0fa6b1182b2490ee8882d3e6
lib/assets/.keep
lib/tasks/.keep
log/.keep
public/404.html
... ...
@@ -0,0 +1,67 @@
1
+<!DOCTYPE html>
2
+<html>
3
+<head>
4
+ <title>The page you were looking for doesn't exist (404)</title>
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <style>
7
+ .rails-default-error-page {
8
+ background-color: #EFEFEF;
9
+ color: #2E2F30;
10
+ text-align: center;
11
+ font-family: arial, sans-serif;
12
+ margin: 0;
13
+ }
14
+
15
+ .rails-default-error-page div.dialog {
16
+ width: 95%;
17
+ max-width: 33em;
18
+ margin: 4em auto 0;
19
+ }
20
+
21
+ .rails-default-error-page div.dialog > div {
22
+ border: 1px solid #CCC;
23
+ border-right-color: #999;
24
+ border-left-color: #999;
25
+ border-bottom-color: #BBB;
26
+ border-top: #B00100 solid 4px;
27
+ border-top-left-radius: 9px;
28
+ border-top-right-radius: 9px;
29
+ background-color: white;
30
+ padding: 7px 12% 0;
31
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
+ }
33
+
34
+ .rails-default-error-page h1 {
35
+ font-size: 100%;
36
+ color: #730E15;
37
+ line-height: 1.5em;
38
+ }
39
+
40
+ .rails-default-error-page div.dialog > p {
41
+ margin: 0 0 1em;
42
+ padding: 1em;
43
+ background-color: #F7F7F7;
44
+ border: 1px solid #CCC;
45
+ border-right-color: #999;
46
+ border-left-color: #999;
47
+ border-bottom-color: #999;
48
+ border-bottom-left-radius: 4px;
49
+ border-bottom-right-radius: 4px;
50
+ border-top-color: #DADADA;
51
+ color: #666;
52
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53
+ }
54
+ </style>
55
+</head>
56
+
57
+<body class="rails-default-error-page">
58
+ <!-- This file lives in public/404.html -->
59
+ <div class="dialog">
60
+ <div>
61
+ <h1>The page you were looking for doesn't exist.</h1>
62
+ <p>You may have mistyped the address or the page may have moved.</p>
63
+ </div>
64
+ <p>If you are the application owner check the logs for more information.</p>
65
+ </div>
66
+</body>
67
+</html>
public/422.html
... ...
@@ -0,0 +1,67 @@
1
+<!DOCTYPE html>
2
+<html>
3
+<head>
4
+ <title>The change you wanted was rejected (422)</title>
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <style>
7
+ .rails-default-error-page {
8
+ background-color: #EFEFEF;
9
+ color: #2E2F30;
10
+ text-align: center;
11
+ font-family: arial, sans-serif;
12
+ margin: 0;
13
+ }
14
+
15
+ .rails-default-error-page div.dialog {
16
+ width: 95%;
17
+ max-width: 33em;
18
+ margin: 4em auto 0;
19
+ }
20
+
21
+ .rails-default-error-page div.dialog > div {
22
+ border: 1px solid #CCC;
23
+ border-right-color: #999;
24
+ border-left-color: #999;
25
+ border-bottom-color: #BBB;
26
+ border-top: #B00100 solid 4px;
27
+ border-top-left-radius: 9px;
28
+ border-top-right-radius: 9px;
29
+ background-color: white;
30
+ padding: 7px 12% 0;
31
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
+ }
33
+
34
+ .rails-default-error-page h1 {
35
+ font-size: 100%;
36
+ color: #730E15;
37
+ line-height: 1.5em;
38
+ }
39
+
40
+ .rails-default-error-page div.dialog > p {
41
+ margin: 0 0 1em;
42
+ padding: 1em;
43
+ background-color: #F7F7F7;
44
+ border: 1px solid #CCC;
45
+ border-right-color: #999;
46
+ border-left-color: #999;
47
+ border-bottom-color: #999;
48
+ border-bottom-left-radius: 4px;
49
+ border-bottom-right-radius: 4px;
50
+ border-top-color: #DADADA;
51
+ color: #666;
52
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53
+ }
54
+ </style>
55
+</head>
56
+
57
+<body class="rails-default-error-page">
58
+ <!-- This file lives in public/422.html -->
59
+ <div class="dialog">
60
+ <div>
61
+ <h1>The change you wanted was rejected.</h1>
62
+ <p>Maybe you tried to change something you didn't have access to.</p>
63
+ </div>
64
+ <p>If you are the application owner check the logs for more information.</p>
65
+ </div>
66
+</body>
67
+</html>
public/500.html
... ...
@@ -0,0 +1,66 @@
1
+<!DOCTYPE html>
2
+<html>
3
+<head>
4
+ <title>We're sorry, but something went wrong (500)</title>
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <style>
7
+ .rails-default-error-page {
8
+ background-color: #EFEFEF;
9
+ color: #2E2F30;
10
+ text-align: center;
11
+ font-family: arial, sans-serif;
12
+ margin: 0;
13
+ }
14
+
15
+ .rails-default-error-page div.dialog {
16
+ width: 95%;
17
+ max-width: 33em;
18
+ margin: 4em auto 0;
19
+ }
20
+
21
+ .rails-default-error-page div.dialog > div {
22
+ border: 1px solid #CCC;
23
+ border-right-color: #999;
24
+ border-left-color: #999;
25
+ border-bottom-color: #BBB;
26
+ border-top: #B00100 solid 4px;
27
+ border-top-left-radius: 9px;
28
+ border-top-right-radius: 9px;
29
+ background-color: white;
30
+ padding: 7px 12% 0;
31
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
+ }
33
+
34
+ .rails-default-error-page h1 {
35
+ font-size: 100%;
36
+ color: #730E15;
37
+ line-height: 1.5em;
38
+ }
39
+
40
+ .rails-default-error-page div.dialog > p {
41
+ margin: 0 0 1em;
42
+ padding: 1em;
43
+ background-color: #F7F7F7;
44
+ border: 1px solid #CCC;
45
+ border-right-color: #999;
46
+ border-left-color: #999;
47
+ border-bottom-color: #999;
48
+ border-bottom-left-radius: 4px;
49
+ border-bottom-right-radius: 4px;
50
+ border-top-color: #DADADA;
51
+ color: #666;
52
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53
+ }
54
+ </style>
55
+</head>
56
+
57
+<body class="rails-default-error-page">
58
+ <!-- This file lives in public/500.html -->
59
+ <div class="dialog">
60
+ <div>
61
+ <h1>We're sorry, but something went wrong.</h1>
62
+ </div>
63
+ <p>If you are the application owner check the logs for more information.</p>
64
+ </div>
65
+</body>
66
+</html>
public/apple-touch-icon-precomposed.png
public/apple-touch-icon.png
public/favicon.ico
public/robots.txt
... ...
@@ -0,0 +1 @@
1
+# See https://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file
storage/.keep
test/application_system_test_case.rb
... ...
@@ -0,0 +1,5 @@
1
+require "test_helper"
2
+
3
+class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
4
+ driven_by :selenium, using: :chrome, screen_size: [1400, 1400]
5
+end
test/channels/application_cable/connection_test.rb
... ...
@@ -0,0 +1,13 @@
1
+require "test_helper"
2
+
3
+module ApplicationCable
4
+ class ConnectionTest < ActionCable::Connection::TestCase
5
+ # test "connects with cookies" do
6
+ # cookies.signed[:user_id] = 42
7
+ #
8
+ # connect
9
+ #
10
+ # assert_equal connection.user_id, "42"
11
+ # end
12
+ end
13
+end
test/controllers/.keep
test/fixtures/files/.keep
test/helpers/.keep
test/integration/.keep
test/mailers/.keep
test/models/.keep
test/system/.keep
test/test_helper.rb
... ...
@@ -0,0 +1,15 @@
1
+ENV["RAILS_ENV"] ||= "test"
2
+require_relative "../config/environment"
3
+require "rails/test_help"
4
+
5
+module ActiveSupport
6
+ class TestCase
7
+ # Run tests in parallel with specified workers
8
+ parallelize(workers: :number_of_processors)
9
+
10
+ # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order.
11
+ fixtures :all
12
+
13
+ # Add more helper methods to be used by all tests here...
14
+ end
15
+end
tmp/.keep
tmp/pids/.keep
tmp/storage/.keep
vendor/.keep
vendor/javascript/.keep