Skip to content

Commit

Permalink
docker final, some sanitization
Browse files Browse the repository at this point in the history
  • Loading branch information
kuldeepaher01 committed Oct 19, 2024
1 parent cf22c05 commit 8ec74fb
Show file tree
Hide file tree
Showing 11 changed files with 446 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
NEXTAUTH_SECRET = "77c81dcda20d3bde2db733601888f3"
NEXTAUTH_URL = "http://localhost:3000/"
DATABASE_URL = "postgresql://hhg_owner:complex%23password69@localhost:5433/hhg"
DATABASE_URL = "postgresql://hhg_owner:VerySecurePassword69@localhost:5433/hhg"
2 changes: 1 addition & 1 deletion db_setup.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Windows PowerShell script (setup.ps1)
$env:DATABASE_URL = "postgresql://hhg_owner:complex%23password69@localhost:5433/hhg"
# $env:DATABASE_URL = "postgresql://hhg_owner:VerySecurePassword69@localhost:5433/hhg"

# Check if the volume exists
$volumeExists = docker volume ls -q -f name=hhg-postgres-data
Expand Down
2 changes: 1 addition & 1 deletion db_setup.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Linux Bash script (setup.sh)
#!/bin/bash
export DATABASE_URL="postgresql://hhg_owner:complex%23password69@localhost:5433/hhg"
export DATABASE_URL="postgresql://hhg_owner:VerySecurePassword69@localhost:5433/hhg"

# Check if the volume exists
if [ -z "$(docker volume ls -q -f name=hhg-postgres-data)" ]; then
Expand Down
2 changes: 1 addition & 1 deletion dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ FROM postgres:16
# Set environment variables
ENV POSTGRES_DB=hhg
ENV POSTGRES_USER=hhg_owner
ENV POSTGRES_PASSWORD=complex%23password69
ENV POSTGRES_PASSWORD=VerySecurePassword69

# Copy the SQL script into the container
COPY init.sql /docker-entrypoint-initdb.d/
Expand Down
8 changes: 4 additions & 4 deletions init.sql
Original file line number Diff line number Diff line change
Expand Up @@ -367,10 +367,10 @@ CREATE TRIGGER update_paid_timestamp_trigger BEFORE UPDATE OF paid ON public.ven

INSERT INTO public.users (username, password, role)
VALUES
('guest_user', '112345', 'guest'),
('regular_user', '112345', 'user'),
('admin_user', '112345', 'admin'),
('super_admin', '112345', 'super-admin');
('guest_user', '$2a$10$TwliPe.pCKHLIA2CYGUjqOUta2g5bCOKdwN0DqcwABUXWe9ohyv2C', 'guest'),
('regular_user', '$2a$10$TwliPe.pCKHLIA2CYGUjqOUta2g5bCOKdwN0DqcwABUXWe9ohyv2C', 'user'),
('admin_user', '$2a$10$TwliPe.pCKHLIA2CYGUjqOUta2g5bCOKdwN0DqcwABUXWe9ohyv2C', 'admin'),
('super_admin', '$2a$10$TwliPe.pCKHLIA2CYGUjqOUta2g5bCOKdwN0DqcwABUXWe9ohyv2C', 'super-admin');


INSERT INTO public.vendor (vendorname, mobilenumber, galanumber, token_no, vendornameshort, vendorpriority)
Expand Down
Loading

0 comments on commit 8ec74fb

Please sign in to comment.