forked from SETI/rms-opus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathopus_secrets_template.py
169 lines (126 loc) · 5.86 KB
/
opus_secrets_template.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
################################################################################
# Settings that are local to the current installation and need to be
# set separately for each installation and server.
################################################################################
import os
### NEEDED FOR ALL APPLICATIONS ###
# The brand of the back-end SQL database.
# Valid values are: MySQL, PostgreSQL
DB_BRAND = 'MySQL'
# The hostname and database name in which the OPUS and dictionary schemas live.
# In most cases, the hostname will be 'localhost'.
# For MySQL, the database is IGNORED.
# For PostgreSQL, this is the database to connect to.
DB_HOST_NAME = '<HOST_NAME>'
DB_DATABASE_NAME = '<DB_NAME>'
# The main namespace in which OPUS tables live.
# For MySQL this is the database name.
# For PostgreSQL this is the schema name.
DB_SCHEMA_NAME = '<SCHEMA_NAME>'
# The database user and password. This user needs to have most privileges,
# including table creation and deletion.
DB_USER = '<DB_USER>'
DB_PASSWORD = '<DB_PASSWORD>'
# The root directory of all PDS holdings. Under this directory should be
# volumes, calibrated, metadata, previews, and diagrams.
PDS_DATA_DIR = '<HOLDING_DIR>'
# The directory where pds-opus lives.
PDS_OPUS_PATH = '<PDS_OPUS_PATH>'
# The directory where the pds-opus library lives. This should normally be
# .../pds-opus/lib
PDS_OPUS_LIB_PATH = os.path.join(PDS_OPUS_PATH, 'lib')
# The directory where the pds-webtools repo lives. This should
# normally be .../pds-webtools
PDS_WEBTOOLS_PATH = '<PDS_WEBTOOLS_PATH>'
# The directory where the pds-tools repo lives. This should
# normally be .../pds-tools
PDS_TOOLS_PATH = '<PDS_TOOLS_PATH>'
############################################
### NEEDED FOR THE MAIN OPUS APPLICATION ###
############################################
# The Django debug setting. NEVER deploy a production site with DEBUG set to
# True.
DEBUG = True
# The list of hosts or IP addresses that Django is permitted to serve
ALLOWED_HOSTS = ('127.0.0.1',
'localhost',
<ADDITIONAL_ALLOWED_HOSTS>)
# These settings are useful to include on a production server
# ADMINS = (<email list>)
# MANAGERS = ADMINS
# EMAIL_* (see https://docs.djangoproject.com/en/2.1/topics/email/)
# SERVER_EMAIL
# The Django "secret key". This needs to be a unique, secret string.
# Generator tools are available:
# https://www.google.com/search?q=django+secret+generator
SECRET_KEY = '<SECRET_KEY>'
# Where static files are served from in a production environment
# This is ignored in a non-production environment
STATIC_ROOT = '<STATIC_ROOT>'
# Where static files are served from if this is a non-production environment,
# usually .../pds-opus/opus/application/static_media
# If this is a production environment, this should be the same as STATIC_ROOT
OPUS_STATIC_ROOT = '<OPUS_STATIC_ROOT>'
# The prefix to add to all cache keys indicating a unique string for this
# installation on a server. This allows multiple OPUS installations on the
# same server without causing memcached cache key conflicts.
CACHE_SERVER_PREFIX = '<CACHE_SERVER_PREFIX>'
# Where to put zipped cart files for downloading and the manifest file
# Needs a TRAILING SLASH
TAR_FILE_PATH = '<TAR_FILE_PATH>/'
MANIFEST_FILE_PATH = '<MANIFEST_FILE_PATH>/'
# The root URL used to retrieve zipped collections files
# Needs a TRAILING SLASH
TAR_FILE_URL_PATH = '<TAR_FILE_URL>/'
# The public URL to access OPUS
PUBLIC_OPUS_URL = 'https://opus.pds-rings.seti.org/'
# The root URL used to retrieve product files from a web server
PRODUCT_HTTP_PATH = 'https://opus.pds-rings.seti.org/'
# The root URL used to retrieve product files from viewmaster
VIEWMASTER_ROOT_PATH = 'https://pds-rings.seti.org/'
# The directory in which to place log files created by OPUS
OPUS_LOGFILE_DIR = '<OPUS_LOGFILE_DIR>'
OPUS_LOG_FILE = os.path.join(OPUS_LOGFILE_DIR, 'opus_log.txt')
# The file that contains the date of the last blog update
OPUS_LAST_BLOG_UPDATE_FILE = '<LAST_BLOG_UPDATE_FILE>'
# The file that contains the html for any short-term notifications
OPUS_NOTIFICATION_FILE = '<NOTIFICATION_FILE>'
# What level of message to log at each destination
OPUS_LOG_FILE_LEVEL = 'INFO'
OPUS_LOG_CONSOLE_LEVEL = 'INFO'
OPUS_LOG_DJANGO_LEVEL = 'WARN'
OPUS_LOG_API_CALLS = False
# Allow faking of slow network connections
# None = Don't do anything different
# Positive = Delay this exact number of milliseconds
# Negative = Delay a random amount between 0 and abs(delay)
OPUS_FAKE_API_DELAYS = None
# Allow random throwing of Http404 or Http500 errors
OPUS_FAKE_SERVER_ERROR404_PROBABILITY = 0.
OPUS_FAKE_SERVER_ERROR500_PROBABILITY = 0.
##############################
### NEEDED FOR OPUS IMPORT ###
##############################
# The prefix to use for temporary tables during import
IMPORT_TABLE_TEMP_PREFIX = 'imp_'
# The directory in which to place log files created during the import process.
IMPORT_LOGFILE_DIR = '<IMPORT_LOGFILE_DIR>'
IMPORT_LOG_FILE = os.path.join(IMPORT_LOGFILE_DIR, 'opus_import.log')
IMPORT_DEBUG_LOG_FILE = os.path.join(IMPORT_LOGFILE_DIR, 'opus_import_debug.log')
#############################################
### NEEDED FOR THE DICTIONARY APPLICATION ###
#############################################
# The prefix URL to look up individual terms in the dictionary.
DICTIONARY_TERM_URL = '<DICTIONARY_URL>'
####################################
### NEEDED FOR DICTIONARY IMPORT ###
####################################
# The pdsdd.full file including path
DICTIONARY_PDSDD_FILE = os.path.join(PDS_OPUS_PATH,
'dictionary/pdsdd.full')
# The contexts.csv file including path
DICTIONARY_CONTEXTS_FILE = os.path.join(PDS_OPUS_PATH,
'dictionary/contexts.csv')
# The location of the OPUS .json table_schema files
DICTIONARY_JSON_SCHEMA_PATH = os.path.join(PDS_OPUS_PATH,
'opus/import/table_schemas')