Example #1
0
from flask import Flask
from flask import request
from flask import render_template
from flask import render_template_string
from flask import jsonify
from flask import json
from jinja2.exceptions import TemplateSyntaxError

import os

app = Flask(__name__)
app.config.from_envvar("APP_SETTINGS")
if "DOCKER_HOST" not in app.config:
    app.config["DOCKER_HOST"] = os.environ.get("DOCKER_HOST", "unix://var/run/docker.sock")
if not os.path.exists(app.config["SNIPPET_TMP_DIR"]):
    os.makedirs(app.config["SNIPPET_TMP_DIR"])

from redis import Redis

redis = Redis()

import docker

import hashlib
import re

import requests


def dkr_base_img():
    return app.config["DKR_BASE_IMAGE"]
Example #2
0
SQLALCHEMY_DATABASE_URI = "sqlite:////tmp/db.sqlite"
UPLOAD_FOLDER = "/home/vagrant/wharf/tmp/"

app = Flask(__name__)
app.config["DEBUG"] = True
app.config["SECRET_KEY"] = SECRET_KEY
app.config["SQLALCHEMY_DATABASE_URI"] = SQLALCHEMY_DATABASE_URI
app.config["DEFAULT_MAIL_SENDER"] = DEFAULT_MAIL_SENDER
app.config["SECURITY_REGISTERABLE"] = True
app.config["SECURITY_CONFIRMABLE"] = True
app.config["SECURITY_CHANGEABLE"] = True
app.config["SECURITY_RECOVERABLE"] = True
app.config["SECURITY_PASSWORD_HASH"] = "sha512_crypt"
app.config["SECURITY_PASSWORD_SALT"] = SECURITY_PASSWORD_SALT
app.config["SECURITY_POST_REGISTER_VIEW"] = "/login"
app.config["DOCKER_HOST"] = DOCKER_HOST
app.config["DOMAIN"] = DOMAIN
app.config["REDIS_HOST"] = REDIS_HOST
app.config["REDIS_PORT"] = REDIS_PORT
app.config["SERVICES_FOLDER"] = SERVICES_FOLDER
app.config["SERVICE_DICT"] = SERVICE_DICT
app.config["UPLOAD_FOLDER"] = UPLOAD_FOLDER
app.config.from_object("wharf.email_config.email")
app.debug = True

# Setup mail extension
mail = Mail(app)

# Setup babel
babel = Babel(app)