Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
35 changes: 35 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Test

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

permissions:
contents: read

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
- name: Run tests
run: |
pytest tests/
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
- name: Install JS dependencies
run: npm ci
- name: Run JS tests
run: node tests/test_js_deps.js
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,12 @@ CREATE TABLE public.event_attendee_junction (
CONSTRAINT event_attendee_junction_pkey PRIMARY KEY (id ASC),
CONSTRAINT event_attendee_junction_event_id_fkey FOREIGN KEY (event_id) REFERENCES public.events(id) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT event_attendee_junction_attendee_id_fkey FOREIGN KEY (attendee_id) REFERENCES public.attendee(id) ON UPDATE CASCADE
)
);

-- Enable Row Level Security (RLS) to address Supabase security warnings
ALTER TABLE public.attendee ENABLE ROW LEVEL SECURITY;
ALTER TABLE public.events ENABLE ROW LEVEL SECURITY;
ALTER TABLE public.event_attendee_junction ENABLE ROW LEVEL SECURITY;
```

I write sql queries to manage all my admin stuff. Ping me if you want more details.
Expand Down
11 changes: 8 additions & 3 deletions config.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,14 @@

class Config(object):
SECRET_KEY = os.environ.get("SECRET_KEY") or "you-will-never-guess"
SQLALCHEMY_DATABASE_URI = os.environ.get(
"DATABASE_URL"
) or "sqlite:///" + os.path.join(basedir, "app.db")
db_url = os.environ.get("DATABASE_URL")
if db_url:
if db_url.startswith("postgres://"):
db_url = db_url.replace("postgres://", "postgresql://", 1)
if db_url.startswith("postgresql://") and "sslmode=" not in db_url:
db_url += "?sslmode=require" if "?" not in db_url else "&sslmode=require"

SQLALCHEMY_DATABASE_URI = db_url or "sqlite:///" + os.path.join(basedir, "app.db")
SQLALCHEMY_TRACK_MODIFICATIONS = False
DOMAIN = os.environ.get("DOMAIN") or "http://localhost:5000"
PARTY_NAME = os.environ.get("PARTY_NAME") or "Shy"
2 changes: 1 addition & 1 deletion netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
MISE_VERBOSE=1
command = "python freeze.py"
publish = "app/build"
environment = { PYTHON_VERSION = "3.12" }
environment = { PYTHON_VERSION = "3.12", NODE_VERSION = "22" }


[[plugins]]
Expand Down
6 changes: 5 additions & 1 deletion netlify/edge-functions/attendee_status.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import { createClient } from "https://esm.sh/@supabase/supabase-js@2";

const env_vars = Deno.env.toObject();
const supabase = createClient(env_vars["supabaseUrl"], env_vars["supabaseKey"]);
const supabase = createClient(
env_vars["supabaseUrl"],
env_vars["SUPABASE_SERVICE_ROLE_KEY"] || env_vars["supabaseKey"],
{ auth: { persistSession: false } }
);

export default async (request, context) => {
const url = new URL(request.url);
Expand Down
3 changes: 2 additions & 1 deletion netlify/functions/form-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import parse from "querystring";

const supabase = createClient(
process.env["supabaseUrl"],
process.env["supabaseKey"],
process.env["SUPABASE_SERVICE_ROLE_KEY"] || process.env["supabaseKey"],
{ auth: { persistSession: false } }
);

const twilio_client = require("twilio")(
Expand Down
Loading
Loading