Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions scripts/resource.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
"darwin-x64": [
{
"name": "ovm",
"version": "v1.0.4",
"version": "v1.0.5",
"download": "https://static.oomol.com/ovm-resources/Bauklotze/{version}/ovm-amd64",
"sha256": "11b21af7020339903e5aa4fcf7fb17a632b61aa1f1dc2c39c9c4489a28d54963",
"sha256": "f21544ad8fe1ba753d9d5317a018bdf6d0ce0c20d372e7a68132c4835ce32846",
"out": "bin/ovm"
},
{
Expand All @@ -25,9 +25,9 @@
"darwin-arm64": [
{
"name": "ovm",
"version": "v1.0.4",
"version": "v1.0.5",
"download": "https://static.oomol.com/ovm-resources/Bauklotze/{version}/ovm-arm64",
"sha256": "598a7edcdd57fa1817aa453a7e3d5697bbd79e4a3de66a9894063f34cb022141",
"sha256": "ea3ee611e5942f03a0dccb41f749f3b01a20301bf26a9233da8d4e4092053ed7",
"out": "bin/ovm"
},
{
Expand Down
21 changes: 5 additions & 16 deletions src/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,10 @@ abstract class Request {
}

type RequestDarwinRawInfoResp = {
GvProxy: {
HostSocks: [string];
};
SSH: {
IdentityPath: string;
Port: number;
RemoteUsername: string;
}
podmanSocketPath: string;
sshPort: number;
sshUser: string;
hostEndpoint: string;
}

export class RequestDarwin extends Request {
Expand All @@ -133,14 +129,7 @@ export class RequestDarwin extends Request {
}

public async info(): Promise<OVMDarwinInfo> {
const result = JSON.parse(await this.do("info", Method.GET)) as RequestDarwinRawInfoResp;
return {
podmanSocketPath: result.GvProxy.HostSocks[0],
sshPort: result.SSH.Port,
sshUser: result.SSH.RemoteUsername,
sshPrivateKeyPath: result.SSH.IdentityPath,
sshPublicKeyPath: `${result.SSH.IdentityPath}.pub`,
};
return JSON.parse(await this.do("info", Method.GET)) as RequestDarwinRawInfoResp;
}

public async state(): Promise<OVMDarwinState> {
Expand Down
9 changes: 4 additions & 5 deletions src/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,10 @@ export type OVMDarwinRunEvent = {
}

export interface OVMDarwinInfo {
podmanSocketPath: string,
sshPort: number,
sshUser: string,
sshPublicKeyPath: string,
sshPrivateKeyPath: string,
podmanSocketPath: string;
sshPort: number;
sshUser: string;
hostEndpoint: string;
}

export interface OVMDarwinState {
Expand Down