-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
334 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
postgres:$apr1$bxjseg8r$v2qBpyoTODV/55oRc6CHV1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
user nginx; | ||
worker_processes auto; | ||
|
||
error_log /var/log/nginx/error.log notice; | ||
pid /var/run/nginx.pid; | ||
|
||
events { | ||
worker_connections 1024; | ||
} | ||
|
||
http { | ||
## | ||
# Basic Settings | ||
## | ||
|
||
sendfile on; | ||
tcp_nopush on; | ||
tcp_nodelay on; | ||
keepalive_timeout 65; | ||
types_hash_max_size 2048; | ||
# server_tokens off; | ||
|
||
# server_names_hash_bucket_size 64; | ||
# server_name_in_redirect off; | ||
|
||
include /etc/nginx/mime.types; | ||
default_type application/octet-stream; | ||
|
||
## | ||
# SSL Settings | ||
## | ||
|
||
ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # Dropping SSLv3, ref: POODLE | ||
ssl_prefer_server_ciphers on; | ||
|
||
## | ||
# Logging Settings | ||
## | ||
|
||
log_format main '$remote_addr - $remote_user [$time_local] "$request" ' | ||
'$status $body_bytes_sent "$http_referer" ' | ||
'"$http_user_agent" "$http_x_forwarded_for"'; | ||
|
||
access_log /var/log/nginx/access.log main; | ||
|
||
## | ||
# Gzip Settings | ||
## | ||
|
||
gzip on; | ||
|
||
# gzip_vary on; | ||
# gzip_proxied any; | ||
# gzip_comp_level 6; | ||
# gzip_buffers 16 8k; | ||
# gzip_http_version 1.1; | ||
# gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript; | ||
|
||
## | ||
# Virtual Host Configs | ||
## | ||
|
||
include /etc/nginx/sites-enabled/*; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
FROM nginx:latest | ||
|
||
WORKDIR /usr/share/nginx/html | ||
RUN rm -rf ./* | ||
|
||
RUN mkdir -p /etc/nginx/sites-available | ||
RUN mkdir -p /etc/nginx/sites-enabled | ||
COPY ./docker/pgadmin-nginx/nginx.conf /etc/nginx/ | ||
COPY ./docker/pgadmin-nginx/.htpasswd /etc/nginx/ | ||
COPY ./docker/pgadmin-nginx/sites/pgadmin /etc/nginx/sites-available/ | ||
RUN ln -s /etc/nginx/sites-available/pgadmin /etc/nginx/sites-enabled/pgadmin | ||
|
||
CMD ["nginx", "-g", "daemon off;"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
server { | ||
listen 5433; | ||
server_name merci.emgbook.com; | ||
|
||
# set DNS resolver as Docker internal DNS | ||
resolver 127.0.0.11 valid=10s; | ||
resolver_timeout 5s; | ||
|
||
location / { | ||
proxy_set_header Host $host; | ||
proxy_set_header X-Real-IP ip_address; | ||
|
||
auth_basic "Restricted"; | ||
auth_basic_user_file /etc/nginx/.htpasswd; | ||
|
||
client_body_buffer_size 32k; | ||
|
||
proxy_pass http://merci-pgadmin:80; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,14 @@ | ||
from sqlalchemy import Engine, create_engine | ||
|
||
from thankyou.core.config import get_env, Env | ||
from thankyou.dao.sqlalchemy import SQLAlchemyDao | ||
|
||
|
||
class PostgresDao(SQLAlchemyDao): | ||
def __init__(self, host: str, database: str, user: str, password: str, port: int = 5432, | ||
encryption_secret_key: str = None): | ||
encryption_secret_key: str = None, echo: bool = False): | ||
self.conn_string = f"postgresql://{user}:{password}@{host}:{port}/{database}" | ||
super().__init__(encryption_secret_key=encryption_secret_key) | ||
super().__init__(encryption_secret_key=encryption_secret_key, echo=echo) | ||
|
||
def _create_engine(self) -> Engine: | ||
return create_engine(self.conn_string) | ||
return create_engine(self.conn_string, echo=self.echo, pool_recycle=3600, pool_timeout=20) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.