Skip to content
This repository has been archived by the owner on Sep 2, 2024. It is now read-only.

Commit

Permalink
Add crawler and search
Browse files Browse the repository at this point in the history
  • Loading branch information
gdonald committed Oct 9, 2023
1 parent 60e9d73 commit 1ee1c5b
Show file tree
Hide file tree
Showing 160 changed files with 5,608 additions and 186 deletions.
4 changes: 4 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
SITE_NAME="ELDAC"
USER_AGENT="ELDAC/1.0 (https://eldac.io)"
HOST_THROTTLE_SECONDS=1
HOST_RULE_DEFAULT="deny"
78 changes: 78 additions & 0 deletions .github/workflows/eldac.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: "Ruby on Rails CI"
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:14-alpine
ports:
- "5432:5432"
env:
POSTGRES_DB: rails_test
POSTGRES_USER: rails
POSTGRES_PASSWORD: password
env:
RAILS_ENV: test
DATABASE_URL: "postgres://rails:password@localhost:5432/rails_test"
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Install chrome
uses: browser-actions/setup-chrome@latest
- run: chrome --version

- name: Install xvfb
run: |
sudo apt-get update
sudo apt-get install xvfb
- name: Install Ruby and gems
uses: ruby/setup-ruby@v1
with:
bundler-cache: true

- name: Set up database schema
run: bin/rails db:schema:load

- name: Run tests
run: xvfb-run --auto-servernum bundle exec rspec

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
files: ./coverage/.resultset.json

lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Ruby and gems
uses: ruby/setup-ruby@v1
with:
bundler-cache: true

- name: Setup Bundle Audit
run: gem install bundle-audit
- name: Security audit dependencies
run: bundle exec bundle audit check --update
continue-on-error: true

- name: Setup Brakeman
run: gem install brakeman
- name: Security audit application code
run: bundle exec brakeman -q -w2
continue-on-error: true

- name: Setup Rubocop
run: gem install rubocop
- name: Lint Ruby files
run: bundle exec rubocop --parallel
7 changes: 2 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@
# Ignore bundler config.
/.bundle

# Ignore all environment files (except templates).
/.env*
!/.env*.erb

# Ignore all logfiles and tempfiles.
/log/*
/tmp/*
Expand All @@ -22,13 +18,14 @@
!/tmp/pids/
!/tmp/pids/.keep

# Ignore storage (uploaded files in development and any SQLite databases).
# Ignore uploaded files in development.
/storage/*
!/storage/.keep
/tmp/storage/*
!/tmp/storage/
!/tmp/storage/.keep

/coverage
/public/assets

# Ignore master key for decrypting credentials and more.
Expand Down
2 changes: 2 additions & 0 deletions .rspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
--require spec_helper
--color
13 changes: 13 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
require:
- rubocop-rake
- rubocop-rails
- rubocop-rspec
- rubocop-capybara
- rubocop-factory_bot

AllCops:
NewCops: enable
Style/Documentation:
Enabled: false
# RSpec/ExampleLength:
# Max: 7
18 changes: 10 additions & 8 deletions Capfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# frozen_string_literal: true

# Load DSL and set up stages
require "capistrano/setup"
require 'capistrano/setup'

# Include default deployment tasks
require "capistrano/deploy"
require 'capistrano/deploy'

# Load the SCM plugin appropriate to your project:
#
Expand All @@ -12,7 +14,7 @@ require "capistrano/deploy"
# require "capistrano/scm/svn"
# install_plugin Capistrano::SCM::Svn
# or
require "capistrano/scm/git"
require 'capistrano/scm/git'
install_plugin Capistrano::SCM::Git

# Include tasks from other gems included in your Gemfile
Expand All @@ -29,10 +31,10 @@ install_plugin Capistrano::SCM::Git
# require "capistrano/rvm"
# require "capistrano/rbenv"
# require "capistrano/chruby"
require "capistrano/bundler"
require "capistrano/rails/assets"
require "capistrano/rails/migrations"
require "capistrano/passenger"
require 'capistrano/bundler'
require 'capistrano/rails/assets'
require 'capistrano/rails/migrations'
require 'capistrano/passenger'

# Load custom tasks from `lib/capistrano/tasks` if you have any defined
Dir.glob("lib/capistrano/tasks/*.rake").each { |r| import r }
Dir.glob('lib/capistrano/tasks/*.rake').each { |r| import r }
49 changes: 40 additions & 9 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,46 @@
# frozen_string_literal: true

source 'https://rubygems.org'

ruby '3.2.2'

gem 'rails', '~> 7.1.0'

gem 'sprockets-rails'
gem 'aasm', '~> 5.5.0'
gem 'bcrypt', '~> 3.1.7'
gem 'bootstrap5-kaminari-views', '~> 0.0.1'
gem 'cssbundling-rails'
gem 'dotenv-rails', '~> 2.8.1'
gem 'httparty', '~> 0.21.0'
gem 'image_processing', '~> 1.2'
gem 'jbuilder'
gem 'jsbundling-rails'
gem 'jwt', '~> 2.7.1'
gem 'kaminari', '~> 1.2.2'
gem 'nokogiri', '~> 1.15.4'
gem 'pg', '~> 1.1'
gem 'pg_search', '~> 2.3.6'
gem 'puma', '>= 5.0'
gem 'jsbundling-rails'
gem 'turbo-rails'
gem 'rack', '~> 2.2.8'
gem 'rbnacl', '~> 7.1.1'
gem 'redis', '~> 5.0.7'
gem 'sidekiq', '~> 7.1.4'
gem 'sidekiq-cron', '~> 1.10.1'
gem 'sprockets-rails'
gem 'stimulus-rails'
gem 'cssbundling-rails'
gem 'jbuilder'
gem 'redis', '>= 4.0.1'
gem 'bcrypt', '~> 3.1.7'
gem 'image_processing', '~> 1.2'
gem 'turbo-rails'

group :development, :test do
gem 'debug', platforms: %i[mri]
gem 'brakeman'
gem 'bundler-audit'
gem 'debug'
gem 'factory_bot_rails', '~> 6.2.0'
gem 'pry'
gem 'rspec-rails', '~> 6.0.3'
gem 'rubocop', require: false
gem 'rubocop-rails'
gem 'rubocop-rake'
gem 'rubocop-rspec'
end

group :development do
Expand All @@ -28,3 +51,11 @@ group :development do
gem 'ed25519'
gem 'web-console'
end

group :test do
gem 'capybara'
gem 'selenium-webdriver'
gem 'shoulda-matchers', '~> 5.3.0'
gem 'simplecov', require: false
gem 'webmock'
end
Loading

0 comments on commit 1ee1c5b

Please sign in to comment.