-
Notifications
You must be signed in to change notification settings - Fork 0
/
snapcraft.yaml
54 lines (50 loc) · 2.44 KB
/
snapcraft.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
name: newnode-vpn # you probably want to 'snapcraft register <name>'
base: core18
version: git
summary: NewNode VPN http[s] proxy to thwart censorship/blocking
description: |
NewNode VPN is an http[s] proxy that attempts to defeat web
censorship or site blocking using an ad hoc peer-to-peer network.
For http, it tries to download the page from multiple places,
including the origin server but also NewNode peers and other
locations where it might be cached. For https, it tries to find an
unblocked path to the origin server using its peer-to-peer network.
Installing NewNode VPM adds your local instance of NewNode VPN to
that peer-to-peer network, which will assist other users' attempts
to access blocked web sites.
grade: devel # must be 'stable' to release into candidate/stable channels
confinement: strict # use 'strict' once you have the right plugs and slots
parts:
newnode-vpn:
source: https://github.com/clostra/newnode
source-type: git
# note that https_wget.c is patched below to allow the location of the wget
# executable to be specified with an environment variable. Since the sed
# script will be run every time the snap is recompiled, make sure that it
# doesn't make any cumulative changes.
override-build: |
update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-10 100
update-alternatives --install /usr/bin/clang clang /usr/bin/clang-10 100
update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-10 100
sed --in-place -e 's,"/usr/bin/wget",getenv("PATH_WGET"),' https_wget.c
grep PATH_WGET https_wget.c
./build.sh
test -d ../install/bin || mkdir ../install/bin
cp client ../install/bin/client
(echo '#!/bin/bash' ; echo export 'PATH_WGET=$(which wget)'; echo 'exec $SNAP/bin/client -v') > ../install/bin/client.sh
chmod +x ../install/bin/client.sh
stage: [ bin/client, bin/client.sh ]
prime: [ bin/client, bin/client.sh ]
organize:
client: bin/
build-packages: # packages required for the part to build
[ automake, clang-10, clang-format-10, libsodium-dev, libtool, make, pkg-config, wget ]
stage-packages: # packages required to run the part
[ libpsl5, libsodium-dev, libpcre2-8-0, wget ]
# See 'snapcraft plugins'
plugin: nil
apps:
newnode-vpn:
command: bin/client.sh
daemon: simple
plugs: [ network, network-bind, network-observe ]