Skip to content

Commit 58c5f9e

Browse files
committed
Configuring settings.py to be safe with the django secret key
1 parent 600355b commit 58c5f9e

7 files changed

Lines changed: 18 additions & 14 deletions

File tree

.env_template

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
POSTGRES_DB=main
22
POSTGRES_USER=admin
33
POSTGRES_PASSWORD=admin
4+
DJANGO_SECRET_KEY=8a72377bee5adeff7158a7f9d5b72a31853a439e8a736c07b98b1051240f18cc

urNode-backend/ur_node/api_app/core/chains/ethereum/goerli-testnet/geth.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ spec:
1717
spec:
1818
terminationGracePeriodSeconds: 300
1919
containers:
20-
- name: GoerliTestnetgeth
20+
- name: geth
2121
image: ethereum/client-go
2222
ports:
23-
- { containerPort: 8545, targetPort: 8545 }
24-
- { containerPort: 8546, targetPort: 8546 }
25-
- { containerPort: 8551, targetPort: 8551 }
26-
- { containerPort: 30303, protocol: TCP, targetPort: 30303 }
27-
- { containerPort: 30303, protocol: UDP, targetPort: 30303 }
23+
- { containerPort: 8545 }
24+
- { containerPort: 8546 }
25+
- { containerPort: 8551 }
26+
- { containerPort: 30303, protocol: TCP }
27+
- { containerPort: 30303, protocol: UDP }
2828
args:
2929
[
3030
"--http",
@@ -53,8 +53,8 @@ spec:
5353
memory: 2G
5454
cpu: 1000m
5555
limits:
56-
memory: 3G
57-
cpu: 3000m
56+
memory: 16G
57+
cpu: 8000m
5858
livenessProbe:
5959
httpGet:
6060
path: /
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
286b9bb4af60c092cee6451a7d50bf729cb7560a2d59e5e85fecebfe6221a86c

urNode-backend/ur_node/api_app/core/chains/ethereum/goerli-testnet/kustomization.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ resources:
66
- service.yaml
77
- geth.yaml
88
- prysm.yaml
9+
- 0namespace.yaml
910
configMapGenerator:
1011
- name: geth-jwt
1112
files: ["jwt.hex"]

urNode-backend/ur_node/api_app/core/chains/ethereum/goerli-testnet/prysm.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@ spec:
5050
port: 4000
5151
resources:
5252
limits:
53-
cpu: 1000m
54-
memory: 2G
53+
cpu: 8000m
54+
memory: 16G
5555
requests:
56-
cpu: 2000m
56+
cpu: 1000m
5757
memory: 4G
5858
volumeMounts:
5959
- mountPath: /data

urNode-backend/ur_node/api_app/core/chains/ethereum/goerli-testnet/pvc.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ metadata:
55
spec:
66
resources:
77
requests:
8-
storage: 5i
8+
storage: 5Gi
99
volumeMode: Filesystem
1010
storageClassName: ebs-gp3
1111
accessModes:
@@ -18,7 +18,7 @@ metadata:
1818
spec:
1919
resources:
2020
requests:
21-
storage: 5i
21+
storage: 5Gi
2222
volumeMode: Filesystem
2323
storageClassName: ebs-gp3
2424
accessModes:

urNode-backend/ur_node/ur_node/settings.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import os
2+
import secrets
23
from datetime import timedelta
34
from pathlib import Path
45

@@ -10,7 +11,7 @@
1011
# See https://docs.djangoproject.com/en/3.2/howto/deployment/checklist/
1112

1213
# SECURITY WARNING: keep the secret key used in production secret!
13-
SECRET_KEY = "django-insecure-=d1u1(vn$wwn&h2h40r9#&7*j1cbu$9rtl4)nnyjb4$0vp43h1"
14+
SECRET_KEY = os.environ.get("DJANGO_SECRET_KEY", secrets.token_hex())
1415

1516
# SECURITY WARNING: don't run with debug turned on in production!
1617
DEBUG = True

0 commit comments

Comments
 (0)