d582f15681
- Implemented tests for import polling functionality, ensuring correct behavior for active and terminal import statuses. - Created tests for the login page, validating user interactions and error handling. - Added unit tests for money utility functions, covering parsing, formatting, and summation of monetary values. - Developed tests for query keys, ensuring proper scoping and invalidation roots. chore: setup testing environment and configuration - Added setup file for testing with Vitest and Testing Library. - Configured TypeScript and Vite for the frontend project. - Created Docker and Nginx configurations for local development and production environments. - Established a PostgreSQL initialization script for setting up application roles. docs: add README and environment configuration for infra - Included README for the infra directory, detailing local development setup and service descriptions. - Created an example environment configuration file for local development with placeholders for sensitive information.
26 lines
789 B
Bash
Executable File
26 lines
789 B
Bash
Executable File
#!/bin/sh
|
|
set -eu
|
|
|
|
psql \
|
|
--set ON_ERROR_STOP=1 \
|
|
--set app_user="$APP_DATABASE_USER" \
|
|
--set app_password="$APP_DATABASE_PASSWORD" \
|
|
--username "$POSTGRES_USER" \
|
|
--dbname "$POSTGRES_DB" <<'SQL'
|
|
SELECT format(
|
|
'CREATE ROLE %I LOGIN PASSWORD %L NOSUPERUSER NOCREATEDB NOCREATEROLE NOINHERIT NOBYPASSRLS',
|
|
:'app_user',
|
|
:'app_password'
|
|
) \gexec
|
|
SELECT format('GRANT CONNECT ON DATABASE %I TO %I', current_database(), :'app_user') \gexec
|
|
SELECT format('GRANT USAGE ON SCHEMA public TO %I', :'app_user') \gexec
|
|
SELECT format(
|
|
'ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT, INSERT, UPDATE, DELETE ON TABLES TO %I',
|
|
:'app_user'
|
|
) \gexec
|
|
SELECT format(
|
|
'ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT USAGE, SELECT ON SEQUENCES TO %I',
|
|
:'app_user'
|
|
) \gexec
|
|
SQL
|