-
Notifications
You must be signed in to change notification settings - Fork 0
/
settings.template.py
93 lines (71 loc) · 2.86 KB
/
settings.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
import os
# Sample Specify web asset server settings.
# Turns on bottle.py debugging, module reloading and printing some
# information to console.
LOG_LEVEL = "INFO"
DEBUG_APP = True
# This secret key is used to generate authentication tokens for requests.
# The same key must be set in the Web Store Attachment Preferences in Specify.
# A good source for key value is: https://www.grc.com/passwords.htm
# Set KEY to None to disable security. This is NOT recommended since doing so
# will allow anyone on the internet to use the attachment server to store
# arbitrary files.
KEY = 'redacted'
# Auth token timestamp must be within this many seconds of server time
# in order to be considered valid. This prevents replay attacks.
# Set to None to disable time validation.
TIME_TOLERANCE = 150
# Set this to True to require authentication for downloads in addition
# to uploads and deletes. Static file access, if enabled, is not
# affected by this setting.
REQUIRE_KEY_FOR_GET = False
# This is required for use with the Web Portal.
# Enables the 'getfileref' and '/static/...' URLs.
ALLOW_STATIC_FILE_ACCESS = True
# These values are interpolated into the web_asset_store.xml resource
# so the client knows how to talk to the server.
# HOST = '192.168.1.224'
# Image server host and port info
if "EXTERNAL_IP" in os.environ:
HOST = os.getenv('EXTERNAL_IP')
# print(f"Got external Ip from environment:{HOST}")
else:
import socket
hostname = socket.gethostname()
local_ip = socket.gethostbyname(hostname)
HOST = local_ip
# print(f"Got external Ip from gethostbyname:{HOST}")
# use this server name if on backend
# HOST = 'http://instutution.org'
PORT = 80
SERVER_NAME = HOST
SERVER_PORT = PORT
print(f"Starting with host: {HOST}")
DEVELOPMENT_PORT = PORT
# Port the development test server should listen on.
DEVELOPMENT_PORT = PORT
# Map collection names to directories. Set to None to store
# everything in the same originals and thumbnail directories. This is
# recommended unless some provision is made to allow attachments for
# items scoped above collections to be found.
COLLECTION_DIRS = {
# 'COLLECTION_NAME': 'DIRECTORY_NAME',
'Botany': 'botany',
'Ichthyology': 'ichthyology',
}
# Base directory for all attachments.
BASE_DIR = './attachments/'
# Originals and thumbnails are stored in separate directories.
THUMB_DIR = 'thumbnails'
ORIG_DIR = 'originals'
# Set of mime types that the server will try to thumbnail.
CAN_THUMBNAIL = {'image/jpeg', 'image/gif', 'image/png', 'image/tiff', 'application/pdf'}
# What HTTP server to use for stand-alone operation.
# SERVER = 'paste' # Requires python-paste package. Fast, and seems to work good.
SERVER = 'wsgiref' # For testing. Requires no extra packages.
#Image databse connection information
SQL_USER='redacted'
SQL_PASSWORD='redacted'
SQL_HOST='http://instutution.org'
SQL_PORT=3306
SQL_DATABASE='images'