Skip to content

Commit 02b58d3

Browse files
committed
fixing outdated config template / fab template
1 parent 48200cd commit 02b58d3

File tree

2 files changed

+44
-63
lines changed

2 files changed

+44
-63
lines changed

config-example.py

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
import sys
2+
import os
3+
import logging
4+
15
# The application secret key
26
SECRET_KEY = 'CHANGE THIS'
37

@@ -12,9 +16,8 @@
1216
'consumer_secret': 'CHANGE THIS'
1317
}
1418

15-
# by default, disable Flask debug and testing modes
16-
DEBUG = True # Also remember to change LOGLEVEL below
17-
TESTING = True
19+
# Set debugging mode. This is detected by looking at the 'runserver' argument passed to manage.py
20+
DEBUG = (sys.argv[1] == 'runserver')
1821

1922
# This is the buffer for looking for tasks / challenges near the given
2023
# lon/lat
@@ -28,18 +31,12 @@
2831
SQLALCHEMY_DATABASE_URI = "postgresql://osm:osm@localhost/maproulette"
2932

3033
# Logging details
31-
import logging
32-
LOGFILE = '/tmp/maproulette.log'
33-
LOGLEVEL = logging.DEBUG
34+
LOGFILE = os.path.join(os.path.expanduser('~'), '/tmp/maproulette.log')
35+
LOGLEVEL = logging.DEBUG if DEBUG else logging.INFO
3436

3537
# the default challenge to run
3638
DEFAULT_CHALLENGE = 'CHANGE THIS'
3739

38-
# show a teaser page instead of the real thing
39-
TEASER = False
40-
# the text that should go into the teaser
41-
TEASER_TEXT = 'New MapRoulette Coming SOON!'
42-
4340
# IP Whitelist for external API calls
4441
# (/api/admin/*, /api/stats*, /api/users, /api/challenges)
4542
IP_WHITELIST = []

fabric_templates/config

Lines changed: 36 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,33 @@
1-
# The application secret key
2-
3-
# http://www.thedutchtable.com/2013/03/een-ei-is-geen-eivrolijk-pasen.html
4-
SECRET_KEY = 'REPLACE WITH YOUR APPLICATION SECRET KEY'
5-
61
{% if is_dev -%}
72
{% set db = "maproulette_dev" -%}
83
{% set cors_url = "http://maproulette-metrics-stage.s3-website-us-east-1.amazonaws.com/" -%}
4+
{% set osm_url = "http://api06.dev.openstreetmap.org" -%}
95
{% else -%}
106
{% set db = "maproulette" -%}
117
{% set cors_url = "http://maproulette-metrics-production.s3-website-us-east-1.amazonaws.com/" -%}
8+
{% set osm_url = "https://www.openstreetmap.org" -%}
129
{% endif -%}
10+
import sys
11+
import os
12+
import logging
1313

14-
# The database connection
15-
SQLALCHEMY_DATABASE_URI = "postgresql://osm:osm@localhost/{{db}}"
14+
# The application secret key
15+
SECRET_KEY = 'CHANGEME'
1616

17-
# show a teaser page instead of the real thing
18-
TEASER = False
19-
# the text that should go into the teaser
20-
TEASER_TEXT = 'New MapRoulette Challenges coming SOON!'
17+
# The OAuth configuration paramters for OSM.
2118

22-
import logging
23-
LOGFILE = '/srv/www/{{instance}}/log/maproulette.log'
24-
LOGLEVEL = logging.DEBUG
19+
OSM = {
20+
'base_url': '{{osm_url}}/api/0.6/',
21+
'request_token_url':
22+
'{{osm_url}}/oauth/request_token',
23+
'access_token_url': '{{osm_url}}/oauth/access_token',
24+
'authorize_url': '{{osm_url}}/oauth/authorize',
25+
'consumer_key': 'CHANGEME',
26+
'consumer_secret': 'CHANGEME'
27+
}
2528

26-
# by default, disable Flask debug and testing modes
27-
DEBUG = True
28-
TESTING = True
29+
# Set debugging mode. This is detected by looking at the 'runserver' argument passed to manage.py
30+
DEBUG = (sys.argv[1] == 'runserver')
2931

3032
# This is the buffer for looking for tasks / challenges near the given
3133
# lon/lat
@@ -35,47 +37,29 @@ NEARBUFFER = 0.01
3537
# for considering a challenge 'local'
3638
MAX_SQ_DEGREES_FOR_LOCAL = 10
3739

38-
from datetime import timedelta
39-
40-
# The expiration threshold for tasks that are 'assigned' or 'editing'
41-
TASK_EXPIRATION_THRESHOLD = timedelta(hours=1)
42-
43-
# The expiration threshold for tasks that are 'assigned' or 'editing'
44-
TASK_EXPIRATION_THRESHOLD = timedelta(hours=1)
40+
# The database connection
41+
SQLALCHEMY_DATABASE_URI = "postgresql://osm:osm@localhost/{{db}}"
4542

46-
# The time buffer between a task marked as fixed and the timestamp on the
47-
# changeset in OSM. (Used in validation)
48-
MAX_CHANGESET_OFFSET = timedelta(hours=1)
43+
# Logging details
44+
LOGFILE = '/srv/www/{{instance}}/log/maproulette.log'
45+
LOGLEVEL = logging.DEBUG if DEBUG else logging.INFO
4946

5047
# the default challenge to run
51-
DEFAULT_CHALLENGE = 'test1'
52-
53-
# The OAuth configuration paramters for OSM.
54-
{% if is_dev -%}
55-
{% set osm_url = "http://api06.dev.openstreetmap.org" -%}
56-
{% else -%}
57-
{% set osm_url = "https://www.openstreetmap.org" -%}
58-
{% endif -%}
59-
60-
OSM = {
61-
'base_url': '{{osm_url}}/api/0.6/',
62-
'request_token_url':
63-
'{{osm_url}}/oauth/request_token',
64-
'access_token_url': '{{osm_url}}/oauth/access_token',
65-
'authorize_url': '{{osm_url}}/oauth/authorize',
66-
'consumer_key': '{{consumer_key}}',
67-
'consumer_secret': '{{consumer_secret}}'
68-
}
69-
70-
# The MailGun API KEY
71-
MAILGUN_API_KEY = 'REPLACE WITH YOUR MAILGUN API KEY'
48+
DEFAULT_CHALLENGE = 'CHANGEME'
7249

7350
# IP Whitelist for external API calls
7451
# (/api/admin/*, /api/stats*, /api/users, /api/challenges)
75-
IP_WHITELIST = [ ]
52+
IP_WHITELIST = []
7653

77-
# Max number of tasks in a bulk update call
78-
MAX_TASKS_BULK_UPDATE = 5000
54+
# Service API keys
55+
MAILGUN_API_KEY = 'CHANGEME'
7956

8057
# URL to the metrics site instance, for allowing CORS requests from
81-
METRICS_URL = '{{cors_url}}'
58+
METRICS_URL = '{{cors_url}}'
59+
60+
# Max number of tasks in a bulk task update
61+
MAX_TASKS_BULK_UPDATE = 5000
62+
63+
# Basic Authentication user / pass
64+
AUTHORIZED_USER = 'CHANGEME'
65+
AUTHORIZED_PASSWORD = 'CHANGEME'

0 commit comments

Comments
 (0)