Use $QUAYPATH and $QUAYDIR in conf and init files
This commit is contained in:
parent
334a08d90b
commit
cdb3722c17
59 changed files with 341 additions and 225 deletions
|
@ -13,7 +13,7 @@ from flask import make_response, render_template, request, abort, session
|
|||
from flask_login import login_user
|
||||
from flask_principal import identity_changed
|
||||
|
||||
import endpoints.decorated # Register the various exceptions via decorators.
|
||||
import endpoints.decorated # Register the various exceptions via decorators.
|
||||
import features
|
||||
|
||||
from app import app, oauth_apps, oauth_login, LoginWrappedDBUser, user_analytics, license_validator
|
||||
|
@ -25,6 +25,7 @@ from util.names import parse_namespace_repository
|
|||
from util.secscan import PRIORITY_LEVELS
|
||||
from util.saas.useranalytics import build_error_callback
|
||||
from util.timedeltastring import convert_to_timedelta
|
||||
from _init import STATIC_DIR, __version__
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
@ -133,16 +134,9 @@ def list_files(path, extension):
|
|||
# Remove the static/ prefix. It is added in the template.
|
||||
return os.path.join(dp, f)[len('static/'):]
|
||||
|
||||
filepath = 'static/' + path
|
||||
filepath = os.path.join('static/', path)
|
||||
return [join_path(dp, f) for dp, dn, files in os.walk(filepath) for f in files if matches(f)]
|
||||
|
||||
@lru_cache(maxsize=1)
|
||||
def _get_version_number():
|
||||
try:
|
||||
with open('CHANGELOG.md') as f:
|
||||
return re.search('(v[0-9]+\.[0-9]+\.[0-9]+)', f.readline()).group(0)
|
||||
except IOError:
|
||||
return ''
|
||||
|
||||
def render_page_template(name, route_data=None, **kwargs):
|
||||
debugging = app.config.get('DEBUGGING', False)
|
||||
|
@ -188,7 +182,7 @@ def render_page_template(name, route_data=None, **kwargs):
|
|||
|
||||
version_number = ''
|
||||
if not features.BILLING:
|
||||
version_number = 'Quay %s' % _get_version_number()
|
||||
version_number = 'Quay %s' % __version__
|
||||
|
||||
resp = make_response(render_template(name,
|
||||
route_data=route_data,
|
||||
|
@ -226,4 +220,3 @@ def render_page_template(name, route_data=None, **kwargs):
|
|||
|
||||
resp.headers['X-FRAME-OPTIONS'] = 'DENY'
|
||||
return resp
|
||||
|
||||
|
|
Reference in a new issue