Compare commits

...

4 Commits

Author SHA1 Message Date
xiongdian.me
35c302a445 riot: dynamic port forwarding 2023-12-07 18:24:56 +08:00
xiongdian.me
ce657c8300 fix ci 2023-12-07 18:21:02 +08:00
xiongdian.me
c1d555393a gitconf: pull.ff = only 2023-12-07 18:14:42 +08:00
xiongdian.me
b1272e22bb riot config: add nasp remote and null domain 2023-12-07 14:48:27 +08:00
4 changed files with 29 additions and 1 deletions

View File

@ -9,6 +9,8 @@
quotepath = false # chinese chars
[push]
autoSetupRemote = true
[pull]
ff = only
[branch]
# Show most recently changed branches first.
sort = -committerdate

View File

@ -8,7 +8,18 @@ j.remote() {
RET_TRUST_SERVER=1
}
nasp.remote() {
remote=nasp.ob.ac.cn
RET_PORT=${RET_PORT:-36022}
RET_USERNAME=${RET_USERNAME:-ssh}
RET_TRUST_SERVER=1
}
# domains
.domain() {
RET_USERNAME=${RET_USERNAME:-root}
}
i.domain() {
RET_HOSTNAME=$host.ibd.ink
RET_PORT=${RET_PORT:-12022}

View File

@ -163,6 +163,18 @@ run_sshl()
eval_or_echo $cmd
}
# sshd
run_sshd()
{
local port=$(get_free_port)
SSH_OPTIONS="$SSH_OPTIONS -NC -D $port"
local cmd="$(prepare_ssh_cmd ssh)"
fmt_note "-->" $cmd
fmt_note " > please access localhost:$port"
eval_or_echo $cmd
}
# scp
run_scp() {
local src="$1"
@ -228,6 +240,9 @@ router() {
test -n "$3" || fmt_fatal "no target address provided"
run_sshl "$3"
;;
sshd )
run_sshd
;;
scp )
test -n "$3" || fmt_fatal "no source path specified"
test -n "$4" || fmt_fatal "no destination path specified"

View File

@ -38,7 +38,7 @@ test $(echo n | tools/common.sh ask_for_yN "test") = "0"
test $(echo | tools/common.sh ask_for_yN "test") = "0"
test $(echo | tools/common.sh ask_for_Yn "test") = "1"
test $(DFS_QUIET=1 tools/common.sh ask_for_Yn "test") = "1"
test "$(DFS_TRUST=1 riot time@is.impt:2222/yes@you-r.right/you@are.really.recht./ibd./try@it,another@host scp /tmp/ ./tmp -D 2>/dev/null)" = 'scp -P 12022 -o ControlMaster=auto -o ControlPath=/tmp/sshcm-%C -o PermitLocalCommand=yes -o ProxyJump=time@is.impt:2222,yes@you-r.right,you@are.really.recht.,ibd. -r try@it.ibd.ink:"/tmp/" "./tmp"
test "$(DFS_TRUST=1 riot time@is.impt:2222/yes@you-r.right/you@are.really.recht./ibd./try@it,another@host scp /tmp/ ./tmp -D 2>/dev/null)" = 'scp -P 12022 -o ControlMaster=auto -o ControlPath=/tmp/sshcm-%C -o PermitLocalCommand=yes -o ProxyJump=time@is.impt:2222,yes@you-r.right,you@are.really.recht.,root@ibd. -r try@it.ibd.ink:"/tmp/" "./tmp"
scp -P 12022 -o ControlMaster=auto -o ControlPath=/tmp/sshcm-%C -o PermitLocalCommand=yes -o ForwardX11=yes -o ForwardAgent=yes -r another@host.ibd.ink:"/tmp/" "./tmp"'
# check alias