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
22on :
33 pull_request :
44 branches : [main]
55 push :
66 branches : [main]
77jobs :
8- check_pr :
8+ functional_tests :
99 runs-on : ubuntu-latest
1010 steps :
1111 - uses : actions/checkout@v2
Original file line number Diff line number Diff line change 1+ import os from 'os'
12import path from 'path'
23import { Host } from './ansible/types.js'
34import * as blocks from './blocks/index.js'
45import { Server , ServerConfig } from './types.js'
56
67export function server ( config : ServerConfig ) : Server {
8+ const user = os . userInfo ( ) . username
79 let connection = config . connection
810 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 }
1113 }
1214 const hosty_dir = config . hosty_dir || '/srv/hosty'
1315 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'
44
55export type LocalConnection = {
66 type : 'local'
7- user ? : string
7+ user : string
88 password ?: string
99}
1010
1111export type SshConnection = {
1212 type : 'ssh'
1313 address : string
1414 port ?: number
15- user ? : string
15+ user : string
1616 password ?: string
1717 private_key_path ?: string
1818}
1919
2020export type DockerConnection = {
2121 type : 'docker'
2222 container : string
23- user ? : string
23+ user : string
2424 password ?: string
2525}
2626
You can’t perform that action at this time.
0 commit comments