Skip to content

Commit

Permalink
Remove all remaining database code from the HXL Proxy. HXL-79
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmegginson committed Jul 20, 2023
1 parent d8e28f5 commit 2fdf403
Show file tree
Hide file tree
Showing 15 changed files with 14 additions and 743 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ test-docker:
run-local: $(VENV)
. $(VENV) && HXL_PROXY_CONFIG=../local/config.py flask --app hxl_proxy run

run-detached: $(VENV)
. $(VENV) && HXL_PROXY_CONFIG=../local/config.py screen -d -m flask --app hxl_proxy run

debug-local: $(VENV)
. $(VENV) && HXL_PROXY_CONFIG=../local/config.py flask --debug --app hxl_proxy run

Expand Down
50 changes: 0 additions & 50 deletions config.py.TEMPLATE
Original file line number Diff line number Diff line change
Expand Up @@ -115,60 +115,10 @@ ITOS_CACHE_NAME = 'itos-in' # no trailing colon needed
ITOS_CACHE_BACKEND = 'memory'
ITOS_CACHE_TIMEOUT = 604800

#
# Database connection info
#

# 'sqlite3' or 'mysql'
DB_TYPE=os.getenv('DB_TYPE', 'sqlite3')

# Schema file, for tests.
DB_SCHEMA_FILE = os.getenv('DB_SCHEMA_FILE', 'schema-sqlite3.sql')

# SQLite3 settings
DB_FILE='/tmp/hxl-proxy.db'

# MySQL settings
DB_HOST = os.getenv('MYSQL_HOST', 'localhost')
DB_DATABASE = os.getenv('MYSQL_DB', 'hxl_proxy')
DB_PORT = os.getenv('DB_PORT', 3306)
DB_USERNAME = os.getenv('MYSQL_USER', '')
DB_PASSWORD = os.getenv('MYSQL_PASS', '')

#
# Values for Google Drive access
#
GOOGLE_CLIENT_ID = os.getenv('GOOGLE_CLIENT_ID', '<client id>')
GOOGLE_OAUTH_ID = os.getenv('GOOGLE_OAUTH_ID', '<oauth id>')

#
# Values for Humanitarian.ID remote login
#
HID_CLIENT_ID = os.getenv('HID_CLIENT_ID', '<client id>')
HID_CLIENT_SECRET = os.getenv('HID_CLIENT_SECRET', '<client secret>')
HID_REDIRECT_URI = os.getenv('HID_REDIRECT_URI', '<redirect URI>')
HID_BASE_URL = os.getenv('HID_BASE_URL', 'https://auth.humanitarian.id') # change to http://auth.dev.humanitarian.id for dev testing

#
# Where to find shapes, etc. for p-codes. Usually leave as-is.
#
PCODE_BASE_URL = 'https://hxlstandard.github.io/p-codes'

#
# Countries available for mapping (update as needed).
#
PCODE_COUNTRY_MAP = {
'Burundi': 'BDI',
'Cameroon': 'CMR',
'Chad': 'TCD',
'Ecuador': 'ECU',
'Guinea': 'GIN',
'Haiti': 'HTI',
'Mali': 'MLI',
'Nepal': 'NPL',
'Niger': 'NER',
'Nigeria': 'NGA',
'Somalia': 'SOM',
}

# end
110 changes: 0 additions & 110 deletions hxl_proxy/admin.py

This file was deleted.

2 changes: 1 addition & 1 deletion hxl_proxy/controllers.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import hxl_proxy
from hxl.input import HXLIOException

from hxl_proxy import admin, app, cache, caching, dao, exceptions, filters, pcodes, preview, recipes, util, validate
from hxl_proxy import app, cache, caching, exceptions, filters, pcodes, preview, recipes, util, validate

import datetime, flask, hxl, importlib, io, json, logging, requests, requests_cache, signal, werkzeug, csv, urllib

Expand Down

0 comments on commit 2fdf403

Please sign in to comment.