-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from starxg/dev
1.0.2
- Loading branch information
Showing
10 changed files
with
362 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,13 @@ | ||
# Sync Config | ||
|
||
### For the Terminus terminal | ||
### For the [Terminus](https://github.com/Eugeny/terminus) terminal | ||
|
||
This plugin can Sync configuration files to GitHub Gist or Gitee Gist. | ||
|
||
![](./screenshot.png) | ||
|
||
--- | ||
|
||
Like my work? | ||
|
||
[![ko-fi](https://www.ko-fi.com/img/donate_sm.png)](https://ko-fi.com/huangxingguang) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { Injectable } from '@angular/core'; | ||
import { Connection } from 'api'; | ||
import * as keytar from 'keytar' | ||
|
||
|
||
function getKey(conn: Connection) { | ||
let key = `ssh@${conn.host}` | ||
if (conn.port) { | ||
key = `ssh@${conn.host}:${conn.port}` | ||
} | ||
return key; | ||
} | ||
|
||
/** | ||
* https://github.com/Eugeny/terminus/blob/bd46b08c9d909603eca4f1ca149d9a2d0155117f/terminus-ssh/src/services/passwordStorage.service.ts | ||
*/ | ||
@Injectable({ providedIn: 'root' }) | ||
export class PasswordStorageService { | ||
|
||
async savePassword(conn: Connection): Promise<void> { | ||
return keytar.setPassword(getKey(conn), conn.user, conn.auth.password) | ||
} | ||
|
||
async deletePassword(conn: Connection): Promise<void> { | ||
await keytar.deletePassword(getKey(conn), conn.user) | ||
} | ||
|
||
async loadPassword(conn: Connection): Promise<string | null> { | ||
return keytar.getPassword(getKey(conn), conn.user) | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,6 +34,8 @@ module.exports = { | |
] | ||
}, | ||
externals: [ | ||
'keytar', | ||
'axios', | ||
'fs', | ||
'ngx-toastr', | ||
/^rxjs/, | ||
|
Oops, something went wrong.