mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-29 10:17:16 +08:00
Remote Setup: Only generate the key if not already generated
This way one can go back and change the clone url if one wants to and the ssh key would not have changed. There is an additional SSH Key changing button if one needs to regenerate it for some reason. This should fix #47. Well, it's not the best solution, but it is a workaround. For the Clone Url you must enter SSH-KEY-ID@clone-url-provided-by-aws. In order to get the SSH KEY ID you must upload the public key provdied to your AWS Credentials.
This commit is contained in:
@ -53,7 +53,6 @@ class GitHostSetupScreenState extends State<GitHostSetupScreen> {
|
|||||||
int _currentPageIndex = 0;
|
int _currentPageIndex = 0;
|
||||||
|
|
||||||
Widget _buildPage(BuildContext context, int pos) {
|
Widget _buildPage(BuildContext context, int pos) {
|
||||||
Fimber.d("_buildPage " + pos.toString());
|
|
||||||
assert(_pageCount >= 1);
|
assert(_pageCount >= 1);
|
||||||
|
|
||||||
if (pos == 0) {
|
if (pos == 0) {
|
||||||
@ -279,6 +278,10 @@ class GitHostSetupScreenState extends State<GitHostSetupScreen> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void _generateSshKey(BuildContext context) {
|
void _generateSshKey(BuildContext context) {
|
||||||
|
if (publicKey.isNotEmpty) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var comment = "GitJournal " +
|
var comment = "GitJournal " +
|
||||||
Platform.operatingSystem +
|
Platform.operatingSystem +
|
||||||
" " +
|
" " +
|
||||||
@ -287,6 +290,7 @@ class GitHostSetupScreenState extends State<GitHostSetupScreen> {
|
|||||||
generateSSHKeys(comment: comment).then((String publicKey) {
|
generateSSHKeys(comment: comment).then((String publicKey) {
|
||||||
setState(() {
|
setState(() {
|
||||||
this.publicKey = publicKey;
|
this.publicKey = publicKey;
|
||||||
|
Fimber.d("PublicKey: " + publicKey);
|
||||||
_copyKeyToClipboard(context);
|
_copyKeyToClipboard(context);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -355,6 +359,7 @@ class GitHostSetupScreenState extends State<GitHostSetupScreen> {
|
|||||||
String repoPath = p.join(basePath, "journal");
|
String repoPath = p.join(basePath, "journal");
|
||||||
String error;
|
String error;
|
||||||
try {
|
try {
|
||||||
|
Fimber.d("Cloning " + _gitCloneUrl);
|
||||||
await GitRepo.clone(repoPath, _gitCloneUrl);
|
await GitRepo.clone(repoPath, _gitCloneUrl);
|
||||||
} on GitException catch (e) {
|
} on GitException catch (e) {
|
||||||
error = e.cause;
|
error = e.cause;
|
||||||
|
Reference in New Issue
Block a user