File tree Expand file tree Collapse file tree 3 files changed +9
-7
lines changed Expand file tree Collapse file tree 3 files changed +9
-7
lines changed Original file line number Diff line number Diff line change 1
- name : PR checks
1
+ name : Tests
2
2
on :
3
3
pull_request :
4
4
branches : [main]
5
5
push :
6
6
branches : [main]
7
7
jobs :
8
- check_pr :
8
+ functional_tests :
9
9
runs-on : ubuntu-latest
10
10
steps :
11
11
- uses : actions/checkout@v2
Original file line number Diff line number Diff line change
1
+ import os from 'os'
1
2
import path from 'path'
2
3
import { Host } from './ansible/types.js'
3
4
import * as blocks from './blocks/index.js'
4
5
import { Server , ServerConfig } from './types.js'
5
6
6
7
export function server ( config : ServerConfig ) : Server {
8
+ const user = os . userInfo ( ) . username
7
9
let connection = config . connection
8
10
if ( ! connection ) {
9
- if ( config . name === 'localhost' ) connection = { type : 'local' , user : process . env . USER }
10
- else connection = { type : 'ssh' , address : config . name }
11
+ if ( config . name === 'localhost' ) connection = { type : 'local' , user }
12
+ else connection = { type : 'ssh' , address : config . name , user }
11
13
}
12
14
const hosty_dir = config . hosty_dir || '/srv/hosty'
13
15
const backups_dir = path . join ( hosty_dir , 'backups' )
Original file line number Diff line number Diff line change @@ -4,23 +4,23 @@ import { ChildProcess, SpawnOptions } from 'child_process'
4
4
5
5
export type LocalConnection = {
6
6
type : 'local'
7
- user ? : string
7
+ user : string
8
8
password ?: string
9
9
}
10
10
11
11
export type SshConnection = {
12
12
type : 'ssh'
13
13
address : string
14
14
port ?: number
15
- user ? : string
15
+ user : string
16
16
password ?: string
17
17
private_key_path ?: string
18
18
}
19
19
20
20
export type DockerConnection = {
21
21
type : 'docker'
22
22
container : string
23
- user ? : string
23
+ user : string
24
24
password ?: string
25
25
}
26
26
You can’t perform that action at this time.
0 commit comments