diff --git a/pillar/api/file_storage/__init__.py b/pillar/api/file_storage/__init__.py index e94b563b..d5877ddc 100644 --- a/pillar/api/file_storage/__init__.py +++ b/pillar/api/file_storage/__init__.py @@ -364,8 +364,7 @@ def generate_link(backend, file_path: str, project_id=None, is_public=False) -> return blob.get_url(is_public=is_public) if backend == 'pillar': - return url_for('file_storage.index', file_name=file_path, - _external=True, _scheme=current_app.config['SCHEME']) + return url_for('file_storage.index', file_name=file_path, _external=True) if backend == 'cdnsun': return hash_file_path(file_path, None) if backend == 'unittest': diff --git a/pillar/api/file_storage_backends/local.py b/pillar/api/file_storage_backends/local.py index 40049770..c1147d63 100644 --- a/pillar/api/file_storage_backends/local.py +++ b/pillar/api/file_storage_backends/local.py @@ -34,7 +34,7 @@ class LocalBucket(Bucket): def copy_blob(self, blob: Blob, to_bucket: Bucket): """Copies a blob from the current bucket to the other bucket. - + Implementations only need to support copying between buckets of the same storage backend. """ @@ -73,8 +73,7 @@ class LocalBlob(Blob): from flask import url_for path = self.bucket.bucket_path / self.partial_path - url = url_for('file_storage.index', file_name=str(path), _external=True, - _scheme=current_app.config['SCHEME']) + url = url_for('file_storage.index', file_name=str(path), _external=True) return url def create_from_file(self, file_obj: FileType, *, diff --git a/pillar/auth/oauth.py b/pillar/auth/oauth.py index a01c6a11..ab420130 100644 --- a/pillar/auth/oauth.py +++ b/pillar/auth/oauth.py @@ -74,8 +74,7 @@ class OAuthSignIn(metaclass=abc.ABCMeta): pass def get_callback_url(self): - return url_for('users.oauth_callback', provider=self.provider_name, - _external=True, _scheme=current_app.config['SCHEME']) + return url_for('users.oauth_callback', provider=self.provider_name, _external=True) @staticmethod def auth_code_from_request() -> str: diff --git a/pillar/config.py b/pillar/config.py index 1b2ae20f..30658560 100644 --- a/pillar/config.py +++ b/pillar/config.py @@ -12,7 +12,7 @@ import requests.certs RFC1123_DATE_FORMAT = '%a, %d %b %Y %H:%M:%S GMT' PILLAR_SERVER_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) -SCHEME = 'https' +PREFERRED_URL_SCHEME = 'https' STORAGE_DIR = getenv('PILLAR_STORAGE_DIR', '/data/storage/pillar') PORT = 5000 HOST = '0.0.0.0' diff --git a/pillar/web/nodes/routes.py b/pillar/web/nodes/routes.py index 2b997bbc..9bcd757a 100644 --- a/pillar/web/nodes/routes.py +++ b/pillar/web/nodes/routes.py @@ -412,8 +412,7 @@ def edit(node_id): else: project_update_nodes_list(node, project_id=project._id) return redirect(url_for('nodes.view', node_id=node_id, embed=1, - _external=True, - _scheme=current_app.config['SCHEME'])) + _external=True)) else: log.debug('Error sending data to Pillar, see Pillar logs.') error = 'Server error'