add snap build tools
This commit is contained in:
parent
8e411816c1
commit
687a0d78ba
6 changed files with 81 additions and 0 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -23,3 +23,4 @@ _testmain.go
|
|||
*.test
|
||||
*.prof
|
||||
sshpiperd/example/sshpiperd_key*
|
||||
snap
|
||||
|
|
|
|||
4
sshpiperd/snap/build.sh
Executable file
4
sshpiperd/snap/build.sh
Executable file
|
|
@ -0,0 +1,4 @@
|
|||
#!/bin/bash
|
||||
|
||||
snapcraft clean
|
||||
snapcraft
|
||||
23
sshpiperd/snap/docker-compose.yml
Normal file
23
sshpiperd/snap/docker-compose.yml
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
version: '3'
|
||||
|
||||
services:
|
||||
snap:
|
||||
image: snapcore/snapcraft
|
||||
volumes:
|
||||
- build:/build
|
||||
- .:/snap
|
||||
working_dir: /snap
|
||||
depends_on:
|
||||
- piper
|
||||
command:
|
||||
- "./build.sh"
|
||||
piper:
|
||||
build: ../..
|
||||
volumes:
|
||||
- build:/build
|
||||
command:
|
||||
- "/bin/cp"
|
||||
- "/go/bin/sshpiperd"
|
||||
- "/build/sshpiperd"
|
||||
volumes:
|
||||
build:
|
||||
4
sshpiperd/snap/snap/.snapcraft/state
Normal file
4
sshpiperd/snap/snap/.snapcraft/state
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
!GlobalState
|
||||
assets:
|
||||
build-packages: []
|
||||
build-snaps: []
|
||||
26
sshpiperd/snap/snap/hooks/configure
vendored
Executable file
26
sshpiperd/snap/snap/hooks/configure
vendored
Executable file
|
|
@ -0,0 +1,26 @@
|
|||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
bin=$SNAP/sshpiperd
|
||||
config=$SNAP_DATA/sshpiperd.ini
|
||||
|
||||
args=""
|
||||
for opt in $($bin options); do
|
||||
v=$(snapctl get $opt)
|
||||
|
||||
if [ "$v" != "" ]; then
|
||||
v=$(eval echo $v)
|
||||
args="$args --$opt=$v"
|
||||
|
||||
# special default
|
||||
elif [ "$opt" = "workingdir" ]; then
|
||||
mkdir -p $SNAP_COMMON/workingdir
|
||||
args="$args --$opt=$SNAP_COMMON/workingdir"
|
||||
elif [ "$opt" = "auditor-typescriptlogger-outputdir" ]; then
|
||||
mkdir -p $SNAP_COMMON/typescriptlog
|
||||
args="$args --$opt=$SNAP_COMMON/typescriptlog"
|
||||
fi
|
||||
done
|
||||
|
||||
echo ";DO NOT MODIFY, USE snap set sshpiperd key=val, AUTO GENERATED" $(date) > $config
|
||||
$bin --config /dev/null $args dumpconfig >> $config
|
||||
23
sshpiperd/snap/snapcraft.yaml
Normal file
23
sshpiperd/snap/snapcraft.yaml
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
name: sshpiperd
|
||||
version: 0.3
|
||||
summary: The missing reverse proxy for ssh
|
||||
description: |
|
||||
SSH Piper works as a proxy-like ware, and route connections by username, src ip , etc.
|
||||
|
||||
grade: devel
|
||||
confinement: devmode
|
||||
|
||||
parts:
|
||||
sshpiperd:
|
||||
plugin: dump
|
||||
source: /build
|
||||
|
||||
apps:
|
||||
sshpiperd:
|
||||
command: sshpiperd --config $SNAP_DATA/sshpiperd.ini
|
||||
plugs: [network-bind]
|
||||
daemon: simple
|
||||
|
||||
hooks:
|
||||
configure:
|
||||
plugs: []
|
||||
Loading…
Add table
Add a link
Reference in a new issue