Skip to content

Commit 7d06b3b

Browse files
committed
Clean app.json and env vars
1 parent 796bfa0 commit 7d06b3b

File tree

3 files changed

+42
-76
lines changed

3 files changed

+42
-76
lines changed

app.json

+40-60
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,43 @@
11
{
2-
"name": "Falco",
3-
"description": "A Heroku version of Falco",
4-
"repository": "https://github.com/theodo/falco",
5-
"logo": "https://user-images.githubusercontent.com/2587348/51670042-0f2b6a80-1fc6-11e9-8080-c3195853ba62.png",
6-
"keywords": ["nginx", "docker", "proxy"],
7-
"stack": "container",
8-
"addons": ["heroku-postgresql:hobby-dev", "heroku-redis"],
9-
"env": {
10-
"MEDIA_BUCKET": "falco-staging-media",
11-
"PUBLIC_URL": "/static/front",
12-
"DB_CYPHER_KEY": {
13-
"description": "This gets generated",
14-
"generator": "secret"
15-
},
16-
"SECRET_KEY": {
17-
"description": "This gets generated",
18-
"generator": "secret"
19-
},
20-
"EMAIL_HOST": {
21-
"description": "The host to use for sending email.",
22-
"value": "localhost",
23-
"required": false
24-
},
25-
"EMAIL_USER": {
26-
"description": "Username to use for the SMTP server defined in EMAIL_HOST. If empty, Django won’t attempt authentication.",
27-
"value": "",
28-
"required": false
29-
},
30-
"EMAIL_PASSWORD": {
31-
"description": "Password to use for the SMTP server defined in EMAIL_HOST. This setting is used in conjunction with EMAIL_HOST_USER when authenticating to the SMTP server. If either of these settings is empty, Django won’t attempt authentication.",
32-
"value": "",
33-
"required": false
34-
},
35-
"EMAIL_PORT": {
36-
"description": "Port to use for the SMTP server defined in EMAIL_HOST.",
37-
"value": "587",
38-
"required": false
39-
},
40-
"EMAIL_FROM": {
41-
"description": "Who sends the mail",
42-
"value": "[email protected]",
43-
"required": false
44-
},
45-
"EMAIL_TO": {
46-
"description": "Who should receive the mails. Will be used to create the admin account, with 'admin' password.",
47-
"value": ""
48-
},
49-
"ALLOWED_HOST": {
50-
"description": "The URL the application will be available on. See https://docs.djangoproject.com/fr/2.2/ref/settings/#allowed-hosts",
51-
"value": ".herokuapp.com"
52-
},
53-
"REACT_APP_API_BASE_URL": {
54-
"description": "The URL of the application, again. (Unused ?)",
55-
"value": "",
56-
"required": false
57-
}
2+
"name": "Falco",
3+
"description": "A Heroku version of Falco",
4+
"repository": "https://github.com/theodo/falco",
5+
"logo": "https://user-images.githubusercontent.com/2587348/51670042-0f2b6a80-1fc6-11e9-8080-c3195853ba62.png",
6+
"keywords": ["webpagetest", "performance"],
7+
"stack": "container",
8+
"addons": ["heroku-postgresql:hobby-dev", "heroku-redis"],
9+
"env": {
10+
"MEDIA_BUCKET": "falco-staging-media",
11+
"DB_CYPHER_KEY": {
12+
"description": "This gets generated",
13+
"generator": "secret"
5814
},
59-
"scripts": {
60-
"postdeploy": "./manage.py shell -c \"from django.contrib.auth import get_user_model; User = get_user_model(); User.objects.create_superuser('admin', '$EMAIL_FROM', 'admin')\""
15+
"SECRET_KEY": {
16+
"description": "This gets generated",
17+
"generator": "secret"
6118
},
62-
"success_url": "/admin/?next=%2Fadmin%2Fpassword_change%2F"
63-
}
19+
"EMAIL_ADMIN": {
20+
"description": "This email will be assigned to the `admin` account",
21+
"value": "[email protected]",
22+
"required": true
23+
},
24+
"ALLOWED_HOST": {
25+
"description": "The URL the application will be available on. See https://docs.djangoproject.com/fr/2.2/ref/settings/#allowed-hosts",
26+
"value": ".herokuapp.com"
27+
}
28+
},
29+
"formation": {
30+
"web": {
31+
"quantity": 1,
32+
"size": "Free"
33+
},
34+
"worker": {
35+
"quantity": 1,
36+
"size": "Free"
37+
}
38+
},
39+
"scripts": {
40+
"postdeploy": "./manage.py shell -c \"from django.contrib.auth import get_user_model; User = get_user_model(); User.objects.create_superuser('admin', '$EMAIL_ADMIN', 'admin')\""
41+
},
42+
"success_url": "/admin/?next=%2Fadmin%2Fpassword_change%2F"
43+
}

backend/root/settings/prod.py

-14
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,9 @@
1010
FERNET_KEYS = [os.environ.get("DB_CYPHER_KEY")]
1111
DEBUG = False
1212

13-
ALLOWED_HOSTS = ["falco-nicolasgo.herokuapp.com"]
14-
1513
if "ALLOWED_HOST" in os.environ:
1614
ALLOWED_HOSTS.append(os.environ.get("ALLOWED_HOST"))
1715

18-
try:
19-
LOCAL_EC2_IP = requests.get(
20-
"http://169.254.169.254/latest/meta-data/local-ipv4"
21-
).text
22-
PUBLIC_EC2_IP = requests.get(
23-
"http://169.254.169.254/latest/meta-data/public-ipv4"
24-
).text
25-
ALLOWED_HOSTS.append(LOCAL_EC2_IP)
26-
ALLOWED_HOSTS.append(PUBLIC_EC2_IP)
27-
except requests.exceptions.RequestException:
28-
pass
29-
3016
INSTALLED_APPS = INSTALLED_APPS + ["django.contrib.staticfiles"]
3117

3218
# Secure connection

heroku.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ setup:
77
build:
88
docker:
99
web: Dockerfile
10-
celery: Dockerfile
10+
worker: Dockerfile
1111
release:
1212
image: web
1313
command:
1414
- ./release_backend.sh
1515
run:
1616
web: ./start_backend.sh
17-
celery: ./start_celery.sh
17+
worker: ./start_celery.sh

0 commit comments

Comments
 (0)