Skip to content

Commit d9646e9

Browse files
committed
Readme and bug fixes
1 parent e66ff72 commit d9646e9

File tree

5 files changed

+26
-5
lines changed

5 files changed

+26
-5
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,9 @@ Assuming you have the local and remote repositories created,
150150
`git config core.sshCommand 'ssh -i ~/.ssh/<private key name>'`
151151
8. Test the refresh button for the remote branches on the WebUI, fetch from the source control menu in Studio or VS Code, and `git fetch` in Git Bash. All 3 should work without any issues.
152152
153+
### HTTPS Support
154+
We recommend that people connect to their remote git repository using SSH. If you cannot use SSH connections, we also have support for HTTPS connection through OAuth2. See [our documentation for setting up an https connection](/docs/https.md).
155+
153156
## Support
154157
155158
If you find a bug or would like to request an enhancement, [report an issue](https://github.com/intersystems/git-source-control/issues/new). If you have a question, post it on the [InterSystems Developer Community](https://community.intersystems.com/) - consider using the "Git" and "Source Control" tags as appropriate.

cls/SourceControl/Git/Settings.cls

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Property gitUserEmail As %String(MAXLEN = 255) [ InitialExpression = {##class(So
3939
Property gitRemoteURL As %String(MAXLEN = "") [ InitialExpression = {##class(SourceControl.Git.Utils).GetConfiguredRemote()} ];
4040

4141
/// Type of git remote (SSH or HTTPS (Only with OAuth))
42-
Property gitRemoteType As %String(VALUELIST = ",HTTPS,SSH") [ InitialExpression = {##class(SourceControl.Git.Utils).GitRemoteType()} ];
42+
Property gitRemoteType As %String(VALUELIST = ",HTTPS,SSH") [ InitialExpression = {##class(SourceControl.Git.Settings).GetRemoteType(##class(SourceControl.Git.Utils).GetConfiguredRemote())} ];
4343

4444
/// Whether mapped items should be read-only, preventing them from being added to source control
4545
Property mappedItemsReadOnly As %Boolean [ InitialExpression = {##class(SourceControl.Git.Utils).MappedItemsReadOnly()} ];
@@ -308,7 +308,7 @@ ClassMethod Configure() As %Boolean [ CodeMode = objectgenerator ]
308308
do %code.WriteLine(" set list(5) = """"")
309309
do %code.WriteLine(" set response = ##class(%Library.Prompt).GetArray("_promptQuoted_",.value,.list,,,,"_defaultPromptFlag_")")
310310
} elseif ((propertyDef) && (propertyDef.Name ="gitRemoteType")) {
311-
do %code.WriteLine(" if (inst.gitRemoteURL '= """") { set inst.gitRemoteType = inst.GetRemoteType(inst.gitRemoteURL)}")
311+
do %code.WriteLine(" if (inst.gitRemoteURL '= """") { set value = inst.GetRemoteType(inst.gitRemoteURL)}")
312312
} else {
313313
do %code.WriteLine(" set response = ##class(%Library.Prompt).GetString("_promptQuoted_",.value,,,,"_defaultPromptFlag_")")
314314
}
@@ -556,7 +556,7 @@ Method SaveDefaults() As %Boolean
556556
return ##class(%zpkg.isc.sc.git.Defaults).SetDefaultSettings(defaults)
557557
}
558558

559-
ClassMethod GetRemoteType(remoteURL As %String)
559+
ClassMethod GetRemoteType(remoteURL As %String) As %String
560560
{
561561
return $select(remoteURL [ "https": "HTTPS",1:"SSH")
562562
}

cls/SourceControl/Git/Utils.cls

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,9 @@ ClassMethod DecomposeProdAllowIDE() As %Boolean [ CodeMode = expression ]
8282
$Get(@..#Storage@("settings","decomposeProdAllowIDE"), 0)
8383
}
8484

85-
ClassMethod GitRemoteType() As %String [ CodeMode = expression ]
85+
ClassMethod GitRemoteType() As %String
8686
{
87-
$Get(@..#Storage@("settings","gitRemoteType"), "")
87+
return ##class(SourceControl.Git.Settings).GetRemoteType(..GitRemoteURL())
8888
}
8989

9090
ClassMethod GitRemoteURL() As %String [ CodeMode = expression ]

docs/https.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
## Setting up HTTPS
2+
3+
We highly recommend that you use SSH to connect to your repositories. If this is not possible, then HTTPS is another option.
4+
5+
First, add your remote repo in the settings page, or during the Configure step.
6+
7+
After this, you have to authenticate using OAuth tokens. To do this, press "Authenticate" in the bottom left of the Embedded Git UI, or from the Source Control Menu.
8+
9+
### Authentication
10+
11+
If you have not already done so, create a new OAuth app in github or gitlab. The "Authorization callback URL" should be &lt;your url&gt;/isc/studio/usertemplates/gitsourcecontrol/oauth2.csp.
12+
13+
Remember to save the ClientID and ClientSecret. Once this is finished, you can enter your information into the authentication page.
14+
![Screenshot of authentication page](/images/auth.png)
15+
16+
Once all of the information is correct, you can press Save. This will redirect you to either gitlab or github in order to authorize the application to interact with this. After this is done, you will be redirected back to the authentication page, and you should be good to go!
17+
18+

docs/images/auth.png

33.3 KB
Loading

0 commit comments

Comments
 (0)