Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
163 commits
Select commit Hold shift + click to select a range
f5abb8c
Update version number
jayvarner Dec 1, 2020
5d97141
Merge branch 'rcv3.0' into release
jayvarner Dec 1, 2020
5b16f34
Merge tag 'v3.0' into develop
jayvarner Dec 1, 2020
74820a2
Add new ECDS Auth Engine, Fix Tests
jayvarner Jun 2, 2021
e18e32c
Changes to support update development
jayvarner Jun 15, 2021
e23f78a
Changes to support updates
jayvarner Jun 15, 2021
0b50cc9
Update for auth engine to fix CircleCi build
jayvarner Jun 15, 2021
b982a77
Update credentials for CircleCi database
jayvarner Jun 15, 2021
6502118
CircleCi build working locally
jayvarner Jun 15, 2021
8119eec
Add .circleci/config.yml
jayvarner Jun 15, 2021
78a2964
Fix deploy, add S3 support
jayvarner Jun 16, 2021
6704f43
Merge branch 'develop' of github.com:ecds/otb-api-server into develop
jayvarner Jun 16, 2021
c09d0ca
Remove bad tests
jayvarner Jun 16, 2021
9d7655f
Dry up controllers. Validate size of map icons
jayvarner Jun 21, 2021
045f96d
Include tours in FlatPageSerializer
jayvarner Jun 21, 2021
946de23
Update splash media
jayvarner Jul 1, 2021
9676be4
Update auth engine
jayvarner Jul 1, 2021
e864cd9
Update to gem lock
jayvarner Jul 1, 2021
40fa8f0
Include mapable tours for tour sets
jayvarner Jul 2, 2021
e235a32
Move active storage to tenants
jayvarner Jul 2, 2021
1453fe8
Move image_url to model for map overlay
jayvarner Jul 6, 2021
8658331
Improve images and clean out some junk
jayvarner Jul 7, 2021
e77cde0
Remove UUID from Slugs
jayvarner Jul 7, 2021
8fcdc89
Remove errant test
jayvarner Jul 7, 2021
1c46146
Update CircleCI config
jayvarner Jul 8, 2021
44b767b
Clean up
jayvarner Jul 9, 2021
96baf22
Add tour duration, bump Rails
jayvarner Jul 14, 2021
90c269a
Don't send 404
jayvarner Jul 16, 2021
a9706be
Add all tours method to user model
jayvarner Jul 30, 2021
2abccda
Fixed and added tests
jayvarner Jul 30, 2021
50278b6
Update CircleCI config
jayvarner Jul 30, 2021
6178b67
Save guards for duratin calculation
jayvarner Aug 2, 2021
99b7a60
Use libvips for images
jayvarner Aug 2, 2021
160cb96
Don't override image_url
jayvarner Aug 2, 2021
831c901
Fix gif variants
jayvarner Aug 2, 2021
d7ff41c
Update CircleCI config
jayvarner Aug 2, 2021
f3b45e0
Update deploy config
jayvarner Aug 2, 2021
97b9f93
Update deploy and Gemfile.lock
jayvarner Aug 2, 2021
9e0aa57
Fix endpoints for fetching single records
jayvarner Aug 2, 2021
ee63509
Locate request IP
jayvarner Aug 6, 2021
352f824
Skip requests specs
jayvarner Aug 6, 2021
a316838
Better defaults for map/geo stuff
jayvarner Aug 9, 2021
e251d80
Improve estimated time attribute
jayvarner Aug 9, 2021
4a13018
Return empty list of user for non-admins instead of 204
jayvarner Aug 9, 2021
6af39e7
Add external link for tours
jayvarner Aug 16, 2021
1cabe6a
Ensure external link has protocol
jayvarner Aug 16, 2021
9446e80
Fix deploy
jayvarner Aug 16, 2021
4694d88
Fix tour slug, remove debug
jayvarner Aug 16, 2021
b217c6c
Update config
jayvarner Aug 26, 2021
9c4d3c2
Get large image from Vimeo
jayvarner Aug 26, 2021
0d1c65b
Update flat pages test
jayvarner Aug 26, 2021
440698c
Don't use Vips. Does not play well with gifs
jayvarner Aug 26, 2021
f848033
Ensure default icon_color is set for stops
jayvarner Aug 30, 2021
f905f99
Test with MySQL
jayvarner Aug 30, 2021
97d5138
Fix setting icon color
jayvarner Aug 30, 2021
67ab38e
Set database defaults
jayvarner Aug 30, 2021
17d7110
Remove PostgreSQL extensions
jayvarner Aug 30, 2021
1cf7279
Remove install of PostgreSQL install
jayvarner Aug 30, 2021
6fb0ae0
Make precision compatible with MySQL
jayvarner Aug 30, 2021
36e85f7
Fix slugs id
jayvarner Aug 30, 2021
625e6e0
Fix splash_image_medium_id type
jayvarner Aug 30, 2021
157ee12
Fix mode_id type
jayvarner Aug 30, 2021
de3365b
Fix type for flat pages body
jayvarner Aug 30, 2021
8454df3
Make data compatible with MySQL
jayvarner Aug 31, 2021
b7e2349
Remove tags
jayvarner Aug 31, 2021
d81b719
Remove tag models
jayvarner Aug 31, 2021
5ae1d7a
Improve site icons
jayvarner Sep 1, 2021
fe96281
Fix CircleCi config
jayvarner Sep 1, 2021
85538f6
Added LQIP to Medium, fixed slugs id and some tests
jayvarner Sep 2, 2021
9b0454c
Remove TourCollection
jayvarner Sep 2, 2021
26df16c
Minor fixes
jayvarner Sep 2, 2021
674956a
Remove Coveralls file
jayvarner Sep 2, 2021
8b2bac4
Update tests
jayvarner Sep 2, 2021
4c109cc
Handle Ferrum error in CircleCI
jayvarner Sep 3, 2021
7f0a3ad
Fix SoundCloud test
jayvarner Sep 3, 2021
b8e8024
Test YouTube not found
jayvarner Sep 3, 2021
e9a7745
Clean up
jayvarner Sep 3, 2021
d7eb1df
Increase test coverage
jayvarner Sep 8, 2021
609987a
Fix tests for CircleCI build
jayvarner Sep 8, 2021
bc7fab8
Add debug statements
jayvarner Sep 9, 2021
6274da4
Remove debug statements. Add fake Google key for testing.
jayvarner Sep 9, 2021
f903a3f
Don't add themes to new tenants.
jayvarner Sep 9, 2021
62951e7
Tidy up and more tests
jayvarner Sep 9, 2021
58bb9ec
Complete test coverage
jayvarner Sep 14, 2021
0514267
Update Ruby version
jayvarner Sep 17, 2021
db935a7
Prep for production release
jayvarner Sep 17, 2021
1fa42bd
Fix requests
jayvarner Sep 17, 2021
933854b
Update env settings
jayvarner Sep 17, 2021
3f0a45d
Fix issue with lat/lng values due to MySQL limitations
jayvarner Sep 17, 2021
f18829b
Update to Ruby 3
jayvarner Sep 17, 2021
98e8569
User on service for Google's directions matrix API
jayvarner Sep 17, 2021
55bc86d
replace ip info key
jayvarner Sep 20, 2021
40c82c5
Clean up
jayvarner Oct 4, 2021
07f94a4
Add/update site logo
jayvarner Oct 4, 2021
c2f93c4
Fix purgering site icon
jayvarner Oct 4, 2021
26fec74
Fix invalid response for directions
jayvarner Oct 4, 2021
65cddf2
Fix user controller test
jayvarner Oct 4, 2021
466b6a3
Update Ruby version and remove mimmagic dependencies
jayvarner Oct 5, 2021
228a234
Config updates
jayvarner Oct 11, 2021
4499ac8
Add test to update medium metadata
jayvarner Oct 11, 2021
7781d6d
Selectively calculate duration for tour
jayvarner Oct 11, 2021
3e42cf3
More test for when not to update duration
jayvarner Oct 11, 2021
6c686f1
Use fake key when testing
jayvarner Oct 11, 2021
854273b
Remove Google Services gem
jayvarner Oct 11, 2021
99af965
Adjust tests for CircleCI
jayvarner Oct 11, 2021
1e3f9b5
Try to fix CircleCI test
jayvarner Oct 11, 2021
5d2de9f
Tmp fix for Array column in CircleCI
jayvarner Oct 12, 2021
2ef09e1
Consistantly namespace stuff under module V3
jayvarner Oct 12, 2021
cdd81af
Update Auth Engine for multiple browser support
jayvarner Oct 12, 2021
5da658f
Fix removing TourSet logo
jayvarner Oct 14, 2021
a7c2ddf
Fix language codes
jayvarner Oct 21, 2021
0399f3e
Only collect all tours when requesting specific tour
jayvarner Nov 8, 2021
9cd2e73
Fix for listing sites for non super users
jayvarner Nov 12, 2021
03d3650
Another fix for listing tour sets
jayvarner Nov 12, 2021
5b8fefd
Use default bounds is stop count is < 2
jayvarner Jan 27, 2022
bbc3d8f
Add map bound restrictions controls
jayvarner Feb 16, 2022
1ecbd5e
Remove puts statement in spec
jayvarner Feb 16, 2022
420f752
Update production env
jayvarner Mar 2, 2022
f84bfdd
Fix unauthenticated TourSet request by subdir
jayvarner Mar 10, 2022
5f2df82
Paginate media responses
jayvarner Mar 14, 2022
0269dd9
Enforce unique tour title
jayvarner May 9, 2022
8360c1a
Clean up debug statements
jayvarner May 9, 2022
0608921
Prevent caching of some responses
jayvarner May 9, 2022
49ffddc
Update prod deploy
jayvarner May 9, 2022
e981166
Fix for SoundCloud tests
jayvarner May 9, 2022
0f9503e
Fix for anonymous requests
jayvarner May 9, 2022
7d159df
Spec for tour title uniqueness
jayvarner May 9, 2022
c735b2c
Some helpful snippets
jayvarner May 9, 2022
8398c20
Chunk duration requests to stay below the limit
jayvarner May 9, 2022
64c5934
Clean up logs and update deploy config
jayvarner May 11, 2022
979f110
Properly encode StringIO objects
jayvarner May 11, 2022
09117e1
Update Rails to 7
jayvarner Jul 27, 2022
47e3f28
Expand who can edit tour sets
jayvarner Jul 27, 2022
4921af8
Remove unused var
jayvarner Jul 27, 2022
23e1289
Don't add http when link_addredss is empty string
jayvarner Jul 27, 2022
bc5823d
Spec for expanded TourSet CRUD
jayvarner Jul 27, 2022
79c63da
Add terms aceptanced to user modle
jayvarner Jul 29, 2022
1b445b8
Update CircleCI config
jayvarner Jul 29, 2022
8a99a26
Update deploy config
jayvarner Jul 29, 2022
efc64a7
Downgrade Rails
jayvarner Aug 1, 2022
e3724aa
Fix migration version
jayvarner Aug 1, 2022
5612f02
Fix schema version
jayvarner Aug 1, 2022
ddbe785
Fix schema
jayvarner Aug 1, 2022
4ef125f
Replace migration, fix spec helper
jayvarner Aug 1, 2022
390eac7
Clean up
jayvarner Aug 1, 2022
7808081
Update GeoJSON view
jayvarner Oct 9, 2022
16a40ea
Custom parameterize_intl method
jayvarner Oct 26, 2022
ab5a192
Add tour media to geojson
jayvarner Oct 26, 2022
ff18cd7
Fix geojson controller
jayvarner Oct 26, 2022
3b0553b
Small fixes, bump Ruby version
jayvarner Oct 27, 2022
58cd61e
Fix Rails version
jayvarner Oct 27, 2022
990d9a5
Install Chrome for CI
jayvarner Oct 27, 2022
e0af65f
Update Prod IPs
jayvarner Oct 27, 2022
5156189
Extend life of ActiveStorage objects
jayvarner Oct 28, 2022
5be734d
Allow CORS for OpenWorld
jayvarner Oct 28, 2022
fc091a8
Fix CORS config
jayvarner Oct 28, 2022
f76883c
Add Docker Compose setup for Rails app
atharvanegi Aug 4, 2025
aaf633d
Add GitHub Actions workflows
atharvanegi Aug 13, 2025
8b4a020
Fix MySQL service container configuration in GitHub Actions
atharvanegi Aug 13, 2025
7b91187
Simplify test workflow to use PostgreSQL only
atharvanegi Aug 13, 2025
44885de
Simplify test workflow to use PostgreSQL only
atharvanegi Aug 13, 2025
17864c0
Fix Faker::Internet.safe_email compatibility issue
atharvanegi Aug 13, 2025
c1bfe5f
Migrate to Docker/ECS deployment
atharvanegi Oct 21, 2025
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
93 changes: 93 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
version: 2

orbs:
browser-tools: circleci/browser-tools@1.4.0

jobs:
build:
working_directory: ~/otb-api

# Primary container image where all commands run

docker:
- image: cimg/ruby:3.1.2-browsers
environment:
PGUSER: root
RAILS_ENV: test
DB_HOSTNAME: 127.0.0.1
DB_USERNAME: user
DB_PASSWORD: password
TEST_DB_NAME: otb
MYSQL_ALLOW_EMPTY_PASSWORD: true
CI: 'circleci'
BROWSER_PATH: /usr/bin/google-chrome

- image: circleci/postgres:10
environment:
POSTGRES_USER: user
POSTGRES_DB: otb
POSTGRES_PASSWORD: password

- image: circleci/mysql:latest
command: [--default-authentication-plugin=mysql_native_password]
environment:
MYSQL_DATABASE: otb
MYSQL_USER: user
MYSQL_PASSWORD: password
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_ROOT_PASSWORD: password

steps:
- checkout
- run:
name: Install dependencies
command: |
wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo apt update
sudo apt install -y postgresql-client || true
sudo apt install -y imagemagick libappindicator1 fonts-liberation
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo dpkg -i google-chrome*.deb
gem install bundle
bundle check --path=vendor/bundle || bundle install --path=vendor/bundle --jobs 4 --retry 3

- run:
name: Make Tmp Directory
command: |
sudo mkdir -p /data/tmp
sudo chmod 777 /data/tmp
sudo chown $USER:$USER /data/tmp
sudo mkdir -p public/storage/tmp
sudo chmod 777 public/storage/tmp
sudo chown $USER:$USER public/storage/tmp

# Test building MySQL
# TODO: Figure out how to allow the database user to create new tenants in
# the MySQL Docker instance. For now, we'll just test that it can setup the
# initial database using MySQL.
# - run:
# name: Wait for DB
# command: dockerize -wait tcp://127.0.0.1:3306 -timeout 1m

# - run:
# name: MySQL Setup
# command: |
# export DB_ADAPTER=mysql2
# bundle exec rake db:drop RAILS_ENV=test DB_ADAPTER=mysql2
# bundle exec rake db:create RAILS_ENV=test DB_ADAPTER=mysql2
# bundle exec rake db:schema:load RAILS_ENV=test DB_ADAPTER=mysql2
# bundle exec rake db:migrate RAILS_ENV=test DB_ADAPTER=mysql2

# Test using PostgreSQL
- run:
name: PostgreSQL Setup
command: |
export DB_ADAPTER=postgresql
bundle exec rake db:drop RAILS_ENV=test DB_ADAPTER=postgresql
bundle exec rake db:create RAILS_ENV=test DB_ADAPTER=postgresql
bundle exec rake db:schema:load RAILS_ENV=test DB_ADAPTER=postgresql
bundle exec rake db:migrate RAILS_ENV=test DB_ADAPTER=postgresql

- run:
name: Parallel RSpec with PostgreSQL
command: DB_ADAPTER=postgresql bundle exec rspec spec/
1 change: 0 additions & 1 deletion .coveralls.yml

This file was deleted.

54 changes: 54 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Git
.git
.gitignore

# Documentation
README.md
CHANGELOG.md
LICENSE

# Development files
.env*

# Dependencies
node_modules
vendor/bundle/.bundle

# Build artifacts
tmp/*
log/*
coverage/*
public/storage/*
storage/*

# Test files
spec/
test/
.rspec

# Development tools
.vscode/
.idea/
*.swp
*.swo
*~

# OS generated files
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db

# Rails specific
/log/*.log
/tmp
/storage
/public/storage
/coverage

# Docker
Dockerfile*
docker-compose*
112 changes: 112 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
name: Deploy

on:
push:
branches: [ develop, main ]
workflow_dispatch:
inputs:
environment:
description: 'Environment to deploy to'
required: true
default: 'staging'
type: choice
options:
- staging
- production

env:
RAILS_ENV: production

permissions:
id-token: write # Required for AWS OIDC
contents: read

jobs:
test:
runs-on: ubuntu-latest

services:
postgres:
image: postgres:13
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: otb_test
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.1.2
bundler-cache: true

- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y postgresql-client imagemagick libpq-dev gdal-bin libgdal-dev

- name: Create directories
run: |
sudo mkdir -p /data/tmp
sudo chmod 777 /data/tmp
mkdir -p public/storage/tmp

- name: Set up database
run: |
export DB_ADAPTER=postgresql
until pg_isready -h localhost -p 5432 -U postgres; do sleep 2; done
bundle exec rake db:create RAILS_ENV=test DB_ADAPTER=postgresql
bundle exec rake db:schema:load RAILS_ENV=test DB_ADAPTER=postgresql

- name: Run tests
run: |
DB_ADAPTER=postgresql bundle exec rspec --format progress

deploy:
needs: test
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.AWS_ROLE }}
aws-region: us-east-1
role-session-name: GitHub-OIDC-OTB

- name: Deploy to ECS
env:
AWS_ECR: ${{ secrets.AWS_ECR }}
AWS_ECS_CLUSTER_DEV: ${{ secrets.AWS_ECS_CLUSTER_DEV }}
AWS_ECS_CLUSTER_PROD: ${{ secrets.AWS_ECS_CLUSTER_PROD }}
AWS_ECS_SERVICE_DEV: ${{ secrets.AWS_ECS_SERVICE_DEV }}
AWS_ECS_SERVICE_PROD: ${{ secrets.AWS_ECS_SERVICE_PROD }}
AWS_REGION: ${{ secrets.AWS_REGION }}
BRANCH: ${{ github.ref_name }}
run: |
chmod +x build.sh
./build.sh

- name: Notify deployment status
if: always()
run: |
branch="${{ github.ref_name }}"
environment=$([ "$branch" == "main" ] && echo "production" || echo "staging")
if [[ "${{ job.status }}" == "success" ]]; then
echo "Successfully deployed to $environment via ECS"
else
echo "Deployment to $environment failed"
fi
81 changes: 81 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: Test

on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]

env:
RAILS_ENV: test
PGUSER: postgres
DB_HOSTNAME: localhost
DB_USERNAME: postgres
DB_PASSWORD: postgres
TEST_DB_NAME: otb_test
CI: 'github-actions'
BROWSER_PATH: /usr/bin/google-chrome

jobs:
test:
runs-on: ubuntu-latest

services:
postgres:
image: postgres:13
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: otb_test
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.1.2
bundler-cache: true

- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y postgresql-client imagemagick libpq-dev gdal-bin libgdal-dev fonts-liberation
wget -q https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo dpkg -i google-chrome-stable_current_amd64.deb || true
sudo apt-get install -f -y

- name: Create required directories
run: |
sudo mkdir -p /data/tmp
sudo chmod 777 /data/tmp
sudo chown $USER:$USER /data/tmp
mkdir -p public/storage/tmp
chmod 777 public/storage/tmp

- name: Wait for database to be ready
run: |
until pg_isready -h localhost -p 5432 -U postgres; do
echo "Waiting for PostgreSQL..."
sleep 2
done

- name: Set up PostgreSQL database
run: |
export DB_ADAPTER=postgresql
bundle exec rake db:drop RAILS_ENV=test DB_ADAPTER=postgresql || true
bundle exec rake db:create RAILS_ENV=test DB_ADAPTER=postgresql
bundle exec rake db:schema:load RAILS_ENV=test DB_ADAPTER=postgresql
bundle exec rake db:migrate RAILS_ENV=test DB_ADAPTER=postgresql

- name: Run RSpec tests
run: |
DB_ADAPTER=postgresql bundle exec rspec --format progress
7 changes: 5 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
*.DS_Store
coverage
config/database.yml
log
config/secrets.yml
tmp
config/initializers/auth.rb
public/uploads/
public/storage/*
.vscode
*.env*
.ruby-version
.bundle
.coveralls.yml

/config/master.key
storage
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.1.2
28 changes: 0 additions & 28 deletions .travis.yml

This file was deleted.

Loading
Loading