diff --git a/config/default.py b/config/default.py index a916a6c6..710b6498 100644 --- a/config/default.py +++ b/config/default.py @@ -79,11 +79,11 @@ GITHUB_REPO = environ.get('GITHUB_REPO', None) TARGET_BRANCH = environ.get('TARGET_BRANCH', None) # Git settings, used by git_service -# The above Github settings--used in file_service, will likely be deprecated -# You can override these settings in instance/config -GIT_REMOTE_PATH = environ.get('GIT_REMOTE_PATH', None) -GIT_BRANCH = environ.get('GIT_BRANCH', None) -GIT_MERGE_BRANCH = environ.get('GIT_MERGE_BRANCH', None) # Developers can set this to 'all' in instance.config +# Among other things, we use these to build a remote URL like https://username:password@host/path.git +GIT_REMOTE_SERVER = environ.get('GIT_REMOTE_SERVER', None) # example: 'github.com' +GIT_REMOTE_PATH = environ.get('GIT_REMOTE_PATH', None) # example: 'sartography/crconnect-workflow-specs +GIT_BRANCH = environ.get('GIT_BRANCH', None) # example: 'main' +GIT_MERGE_BRANCH = environ.get('GIT_MERGE_BRANCH', None) # Example: 'staging' # Email configuration DEFAULT_SENDER = 'uvacrconnect@virginia.edu' diff --git a/crc/services/git_service.py b/crc/services/git_service.py index 38786bdd..d0672a21 100644 --- a/crc/services/git_service.py +++ b/crc/services/git_service.py @@ -29,11 +29,10 @@ class GitService(object): @staticmethod def get_remote_url(remote_path): - # we use github - # Note that the 'password' is a token generated by github, not the site password + host = app.config['GIT_REMOTE_SERVER'] username = app.config["GIT_USER_NAME"] password = app.config["GIT_USER_PASS"] - remote_url = f"https://{username}:{password}@github.com/{remote_path}.git" + remote_url = f"https://{username}:{password}@{host}/{remote_path}.git" return remote_url @staticmethod