Skip to content

Commit 1979b9d

Browse files
carlastabilesameerbamanha-okta
authored andcommitted
Initial commit
0 parents  commit 1979b9d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+3053
-0
lines changed

.github/workflows/sca_scan.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: SCA
2+
3+
on:
4+
push:
5+
branches: ["master", "main"]
6+
7+
jobs:
8+
snyk-cli:
9+
uses: auth0/devsecops-tooling/.github/workflows/sca-scan.yml@main
10+
with:
11+
additional-arguments: "--exclude=README.md,.jfrog"
12+
secrets: inherit

.gitignore

Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
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+
!/log/.keep
18+
!/tmp/.keep
19+
20+
# Ignore pidfiles, but keep the directory.
21+
/tmp/pids/*
22+
!/tmp/pids/
23+
!/tmp/pids/.keep
24+
25+
# Ignore storage (uploaded files in development and any SQLite databases).
26+
/storage/*
27+
!/storage/.keep
28+
/tmp/storage/*
29+
!/tmp/storage/
30+
!/tmp/storage/.keep
31+
32+
# Ignore master key for decrypting credentials and more.
33+
/config/master.key
34+
35+
# Ignore application configuration
36+
/config/application.yml
37+
38+
# Ignore database configuration (if using figaro or similar)
39+
/config/database.yml
40+
41+
# Ruby
42+
*.gem
43+
*.rbc
44+
/.config
45+
/coverage/
46+
/InstalledFiles
47+
/pkg/
48+
/spec/reports/
49+
/spec/examples.txt
50+
/test/tmp/
51+
/test/version_tmp/
52+
/tmp/
53+
54+
# RDoc documentation
55+
/doc/
56+
/rdoc/
57+
58+
# Yard documentation
59+
/.yardoc/
60+
/_yardoc/
61+
62+
# Bundler
63+
vendor/bundle/
64+
.bundle/
65+
Gemfile.lock
66+
67+
# Rails
68+
*.log
69+
tmp/
70+
log/
71+
public/system/
72+
public/assets/
73+
.sass-cache/
74+
75+
# Database
76+
*.sqlite3
77+
*.sqlite3-journal
78+
*.sqlite3-*
79+
/.env
80+
81+
# IDE and editor files
82+
.vscode/
83+
.idea/
84+
*.swp
85+
*.swo
86+
*~
87+
.project
88+
.secret
89+
90+
# OS generated files
91+
.DS_Store
92+
.DS_Store?
93+
._*
94+
.Spotlight-V100
95+
.Trashes
96+
ehthumbs.db
97+
Thumbs.db
98+
99+
# Node.js (if using Webpacker or similar)
100+
node_modules/
101+
npm-debug.log*
102+
yarn-debug.log*
103+
yarn-error.log*
104+
105+
# Ignore Spring files
106+
/spring/*.pid
107+
108+
# Ignore bootsnap cache
109+
/tmp/cache/bootsnap-compile-cache*
110+
/tmp/cache/bootsnap-load-path-cache*
111+
112+
# Ignore local secrets
113+
/tmp/local_secret.txt
114+
115+
# Ignore pgvector dumps
116+
*.sql
117+
118+
# Ignore backup files
119+
*.backup
120+
*.bak
121+
122+
# Ignore documentation builds
123+
/public/doc/
124+
125+
# Ignore coverage reports
126+
/coverage/
127+
128+
# Ignore compiled assets in development
129+
/public/assets/
130+
131+
# Ignore application credentials (they're encrypted anyway, but good practice)
132+
/config/credentials.yml.enc.backup
133+
134+
# Ignore local environment configuration
135+
.env.local
136+
.env.development.local
137+
.env.test.local
138+
.env.production.local
139+
140+
# Ignore yarn integrity file
141+
.yarn-integrity

Dockerfile

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# syntax = docker/dockerfile:1
2+
3+
# Make sure RUBY_VERSION matches the Ruby version in .ruby-version and Gemfile
4+
ARG RUBY_VERSION=4.0.1
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+
37+
# Final stage for app image
38+
FROM base
39+
40+
# Install packages needed for deployment
41+
RUN apt-get update -qq && \
42+
apt-get install --no-install-recommends -y curl libvips postgresql-client && \
43+
rm -rf /var/lib/apt/lists /var/cache/apt/archives
44+
45+
# Copy built artifacts: gems, application
46+
COPY --from=build /usr/local/bundle /usr/local/bundle
47+
COPY --from=build /rails /rails
48+
49+
# Run and own only the runtime files as a non-root user for security
50+
RUN useradd rails --create-home --shell /bin/bash && \
51+
chown -R rails:rails db log storage tmp
52+
USER rails:rails
53+
54+
# Entrypoint prepares the database.
55+
ENTRYPOINT ["/rails/bin/docker-entrypoint"]
56+
57+
# Start the server by default, this can be overwritten at runtime
58+
EXPOSE 3000
59+
CMD ["./bin/rails", "server"]

Gemfile

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
source "https://rubygems.org"
2+
3+
ruby "4.0.1"
4+
5+
# Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main"
6+
gem "rails", "~> 8.1.2.1"
7+
8+
# Use postgresql as the database for Active Record
9+
gem "pg", "~> 1.1"
10+
11+
# Use the Puma web server [https://github.com/puma/puma]
12+
gem "puma", ">= 5.0"
13+
14+
# Use Active Model has_secure_password [https://guides.rubyonrails.org/active_model_basics.html#securepassword]
15+
gem "bcrypt", "~> 3.1.22"
16+
17+
# RAG Application Dependencies
18+
gem "neighbor" # pgvector wrapper for vector similarity search
19+
gem "ruby-openai" # OpenAI API integration for embeddings and LLM
20+
21+
# HTTP clients
22+
gem "faraday" # HTTP client for API integrations
23+
24+
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
25+
gem "tzinfo-data", platforms: [:windows, :jruby]
26+
27+
# Reduces boot times through caching; required in config/boot.rb
28+
gem "bootsnap", require: false
29+
30+
# Environment variable management
31+
gem "dotenv-rails"
32+
33+
# Auth0 Authentication
34+
gem "omniauth-auth0", "~> 3.1"
35+
gem "omniauth-rails_csrf_protection", "~> 2.0.0"
36+
gem "repost"
37+
38+
# OpenFGA - Fine-Grained Authorization
39+
gem "openfga", "~> 0.1.5"
40+
41+
# Use Active Storage variants [https://guides.rubyonrails.org/active_storage_overview.html#transforming-images]
42+
# gem "image_processing", "~> 1.2"
43+
44+
# Use Rack CORS for handling Cross-Origin Resource Sharing (CORS), making cross-origin Ajax possible
45+
# gem "rack-cors"
46+
47+
group :development, :test do
48+
# See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem
49+
gem "debug", platforms: [:windows]
50+
end
51+
52+
group :development do
53+
gem "pry"
54+
end
55+

0 commit comments

Comments
 (0)