Skip to content

Commit 1dd1741

Browse files
Initial commit
0 parents  commit 1dd1741

109 files changed

Lines changed: 3054 additions & 0 deletions

File tree

Some content is hidden

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

.dockerignore

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# See https://docs.docker.com/engine/reference/builder/#dockerignore-file for more about ignoring files.
2+
3+
# Ignore git directory.
4+
/.git/
5+
/.gitignore
6+
7+
# Ignore bundler config.
8+
/.bundle
9+
10+
# Ignore all environment files.
11+
/.env*
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
38+
39+
# Ignore CI service files.
40+
/.github
41+
42+
# Ignore Kamal files.
43+
/config/deploy*.yml
44+
/.kamal
45+
46+
# Ignore development files
47+
/.devcontainer
48+
49+
# Ignore Docker-related files
50+
/.dockerignore
51+
/Dockerfile*

.gitattributes

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

.github/dependabot.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: bundler
4+
directory: "/"
5+
schedule:
6+
interval: weekly
7+
open-pull-requests-limit: 10
8+
- package-ecosystem: github-actions
9+
directory: "/"
10+
schedule:
11+
interval: weekly
12+
open-pull-requests-limit: 10

.github/workflows/ci.yml

Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [ main ]
7+
8+
jobs:
9+
scan_ruby:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v6
15+
16+
- name: Set up Ruby
17+
uses: ruby/setup-ruby@v1
18+
with:
19+
bundler-cache: true
20+
21+
- name: Scan for common Rails security vulnerabilities using static analysis
22+
run: bin/brakeman --no-pager
23+
24+
- name: Scan for known security vulnerabilities in gems used
25+
run: bin/bundler-audit
26+
27+
scan_js:
28+
runs-on: ubuntu-latest
29+
30+
steps:
31+
- name: Checkout code
32+
uses: actions/checkout@v6
33+
34+
- name: Set up Ruby
35+
uses: ruby/setup-ruby@v1
36+
with:
37+
bundler-cache: true
38+
39+
- name: Scan for security vulnerabilities in JavaScript dependencies
40+
run: bin/importmap audit
41+
42+
lint:
43+
runs-on: ubuntu-latest
44+
env:
45+
RUBOCOP_CACHE_ROOT: tmp/rubocop
46+
steps:
47+
- name: Checkout code
48+
uses: actions/checkout@v6
49+
50+
- name: Set up Ruby
51+
uses: ruby/setup-ruby@v1
52+
with:
53+
bundler-cache: true
54+
55+
- name: Prepare RuboCop cache
56+
uses: actions/cache@v4
57+
env:
58+
DEPENDENCIES_HASH: ${{ hashFiles('.ruby-version', '**/.rubocop.yml', '**/.rubocop_todo.yml', 'Gemfile.lock') }}
59+
with:
60+
path: ${{ env.RUBOCOP_CACHE_ROOT }}
61+
key: rubocop-${{ runner.os }}-${{ env.DEPENDENCIES_HASH }}-${{ github.ref_name == github.event.repository.default_branch && github.run_id || 'default' }}
62+
restore-keys: |
63+
rubocop-${{ runner.os }}-${{ env.DEPENDENCIES_HASH }}-
64+
65+
- name: Lint code for consistent style
66+
run: bin/rubocop -f github
67+
68+
test:
69+
runs-on: ubuntu-latest
70+
71+
services:
72+
postgres:
73+
image: postgres
74+
env:
75+
POSTGRES_USER: postgres
76+
POSTGRES_PASSWORD: postgres
77+
ports:
78+
- 5432:5432
79+
options: --health-cmd="pg_isready" --health-interval=10s --health-timeout=5s --health-retries=3
80+
81+
# redis:
82+
# image: valkey/valkey:8
83+
# ports:
84+
# - 6379:6379
85+
# options: --health-cmd "redis-cli ping" --health-interval 10s --health-timeout 5s --health-retries 5
86+
87+
steps:
88+
- name: Install packages
89+
run: sudo apt-get update && sudo apt-get install --no-install-recommends -y libpq-dev
90+
91+
- name: Checkout code
92+
uses: actions/checkout@v6
93+
94+
- name: Set up Ruby
95+
uses: ruby/setup-ruby@v1
96+
with:
97+
bundler-cache: true
98+
99+
- name: Run tests
100+
env:
101+
RAILS_ENV: test
102+
DATABASE_URL: postgres://postgres:postgres@localhost:5432
103+
# RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }}
104+
# REDIS_URL: redis://localhost:6379/0
105+
run: bin/rails db:test:prepare test
106+
107+
system-test:
108+
runs-on: ubuntu-latest
109+
110+
services:
111+
postgres:
112+
image: postgres
113+
env:
114+
POSTGRES_USER: postgres
115+
POSTGRES_PASSWORD: postgres
116+
ports:
117+
- 5432:5432
118+
options: --health-cmd="pg_isready" --health-interval=10s --health-timeout=5s --health-retries=3
119+
120+
# redis:
121+
# image: valkey/valkey:8
122+
# ports:
123+
# - 6379:6379
124+
# options: --health-cmd "redis-cli ping" --health-interval 10s --health-timeout 5s --health-retries 5
125+
126+
steps:
127+
- name: Install packages
128+
run: sudo apt-get update && sudo apt-get install --no-install-recommends -y libpq-dev
129+
130+
- name: Checkout code
131+
uses: actions/checkout@v6
132+
133+
- name: Set up Ruby
134+
uses: ruby/setup-ruby@v1
135+
with:
136+
bundler-cache: true
137+
138+
- name: Run System Tests
139+
env:
140+
RAILS_ENV: test
141+
DATABASE_URL: postgres://postgres:postgres@localhost:5432
142+
# RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }}
143+
# REDIS_URL: redis://localhost:6379/0
144+
run: bin/rails db:test:prepare test:system
145+
146+
- name: Keep screenshots from failed system tests
147+
uses: actions/upload-artifact@v4
148+
if: failure()
149+
with:
150+
name: screenshots
151+
path: ${{ github.workspace }}/tmp/screenshots
152+
if-no-files-found: ignore

.gitignore

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# See https://help.github.com/articles/ignoring-files for more about ignoring files.
2+
#
3+
# Temporary files generated by your text editor or operating system
4+
# belong in git's global ignore instead:
5+
# `$XDG_CONFIG_HOME/git/ignore` or `~/.config/git/ignore`
6+
7+
# Ignore bundler config.
8+
/.bundle
9+
10+
# Ignore all environment files.
11+
/.env*
12+
13+
# Ignore all logfiles and tempfiles.
14+
/log/*
15+
/tmp/*
16+
!/log/.keep
17+
!/tmp/.keep
18+
19+
# Ignore pidfiles, but keep the directory.
20+
/tmp/pids/*
21+
!/tmp/pids/
22+
!/tmp/pids/.keep
23+
24+
# Ignore storage (uploaded files in development and any SQLite databases).
25+
/storage/*
26+
!/storage/.keep
27+
/tmp/storage/*
28+
!/tmp/storage/
29+
!/tmp/storage/.keep
30+
31+
/public/assets
32+
33+
# Ignore key files for decrypting credentials and more.
34+
/config/*.key
35+
36+
37+
/app/assets/builds/*
38+
!/app/assets/builds/.keep

.kamal/hooks/docker-setup.sample

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
3+
echo "Docker set up on $KAMAL_HOSTS..."

.kamal/hooks/post-app-boot.sample

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
3+
echo "Booted app version $KAMAL_VERSION on $KAMAL_HOSTS..."

.kamal/hooks/post-deploy.sample

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/sh
2+
3+
# A sample post-deploy hook
4+
#
5+
# These environment variables are available:
6+
# KAMAL_RECORDED_AT
7+
# KAMAL_PERFORMER
8+
# KAMAL_VERSION
9+
# KAMAL_HOSTS
10+
# KAMAL_ROLES (if set)
11+
# KAMAL_DESTINATION (if set)
12+
# KAMAL_RUNTIME
13+
14+
echo "$KAMAL_PERFORMER deployed $KAMAL_VERSION to $KAMAL_DESTINATION in $KAMAL_RUNTIME seconds"
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
3+
echo "Rebooted kamal-proxy on $KAMAL_HOSTS"

.kamal/hooks/pre-app-boot.sample

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
3+
echo "Booting app version $KAMAL_VERSION on $KAMAL_HOSTS..."

0 commit comments

Comments
 (0)