Skip to content
Permalink
Browse files

improvements for configuration file defaults and also defaults for th…

…e Docker container
  • Loading branch information...
shawnmjones committed Oct 12, 2018
1 parent d70e77f commit a52820c6db6acee3350d37d86ffd646764aeb744
Showing with 22 additions and 78 deletions.
  1. +4 −3 config/default.py
  2. +0 −62 instance/application.cfg
  3. +3 −1 mementoembed/__init__.py
  4. +15 −12 sample_appconfig.cfg
@@ -1,6 +1,8 @@
CACHEMODEL = 'SQLite'
CACHEENGINE = 'SQLite'
LOGLEVEL = "DEBUG"
REQUEST_TIMEOUT = 15
APPLICATION_LOGFILE = '/tmp/mementoembed/mementoembed-application.log'
ACCESS_LOGFILE = "/tmp/mementoembed/mementoembed-access.log"
ENABLE_THUMBNAILS = "Yes"
THUMBNAIL_SCRIPT_PATH = "mementoembed/static/js/create_screenshot.js"
THUMBNAIL_WORKING_FOLDER = "/tmp/mementoembed/thumbnails"
@@ -10,5 +12,4 @@
THUMBNAIL_WIDTH = "208"
THUMBNAIL_HEIGHT = "156"
THUMBNAIL_REMOVE_BANNERS = "No"
SOCIALCARD_DATAURIS_FOR_IMAGE = "No"
SOCIALCARD_DATAURIS_FOR_FAVICONS = "No"
DEFAULT_IMAGE_PATH = "mementoembed/static/images/96px-Sphere_wireframe.svg.png"

This file was deleted.

Oops, something went wrong.
@@ -210,8 +210,10 @@ def create_app():

app = Flask(__name__, instance_relative_config=True)

# defaults in all cases
app.config.from_object('config.default')
app.config.from_pyfile('application.cfg', silent=True)

# config used everywhere else
app.config.from_pyfile("/etc/mementoembed.cfg", silent=True)

setup_logging_config(app.config)
@@ -23,6 +23,12 @@ CACHE_EXPIRETIME = "604800"
# Note: .sqlite will be added to the end of the filename by the caching library
# CACHE_FILENAME = "/tmp/mementoembed_cache"

# --- MEMENTO PROCESSING SETTINGS ---

# This value indicates how long, in seconds, the system should wait for a
# server to respond to an HTTP request
REQUEST_TIMEOUT = "15"

# --- APPLICATION LOG FILE ---
# These settings apply to the log file for the application,
# writing status and debug information about its processes
@@ -53,6 +59,12 @@ THUMBNAIL_SCRIPT_PATH = "mementoembed/static/js/create_screenshot.js"
# The path to where thumbnails are written
THUMBNAIL_WORKING_FOLDER = "/app/thumbnails"

# The width of the thumbnail in pixels
THUMBNAIL_WIDTH = "208"

# The height of the thumbnail in pixels
THUMBNAIL_HEIGHT = "156"

# The width of the viewport for thumbnails
THUMBNAIL_VIEWPORT_WIDTH = "1024"

@@ -61,22 +73,13 @@ THUMBNAIL_VIEWPORT_HEIGHT = "768"

# Number of seconds to wait for the thumbnail script to finish
# before sending an error message back to the user
THUMBNAIL_TIMEOUT = "30"
THUMBNAIL_TIMEOUT = "300"

# --- MEMENTO PROCESSING SETTINGS ---

# This value indicates how long, in seconds, the system should wait for a
# server to respond to an HTTP request
REQUEST_TIMEOUT = "15"
# Should the thumbnail service try to remove the archive-specific banners from the thumbnail
THUMBNAIL_REMOVE_BANNERS = "No"

# --- SOCIAL CARD SETTINGS ---

# Should this service use data URIs for striking images
ALLOW_SOCIALCARD_DATAURIS_FOR_IMAGE = "No"

# Should this service use data URIs for favicons
ALLOW_SOCIALCARD_DATAURIS_FOR_FAVICONS = "No"

# Here are options for a default image to use if no other image can be found, to be specified 2 ways
# If both are specified DEFAULT_IMAGE_URI will take precedence over DEFAULT_IMAGE PATH

0 comments on commit a52820c

Please sign in to comment.
You can’t perform that action at this time.