Skip to content

Commit 236f871

Browse files
committed
chore: cleanup deb/rpm support
1 parent a400e07 commit 236f871

14 files changed

+111
-309
lines changed

.goreleaser.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,9 @@ docker_manifests:
177177
- 'ghcr.io/tprasadtp/protonvpn:{{ .Version }}-amd64'
178178
- 'ghcr.io/tprasadtp/protonvpn:{{ .Version }}-arm64'
179179

180+
checksum:
181+
disable: true
182+
180183
release:
181184
mode: replace
182185
prerelease: auto

Dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,11 @@ FROM base
55

66
# hadolint ignore=DL3008,DL3009
77
RUN --mount=type=tmpfs,target=/var/lib/apt/lists \
8-
--mount=type=cache,sharing=private,target=/var/cache/apt \
8+
--mount=type=tmpfs,target=/var/cache/apt \
99
apt-get update && \
1010
DEBIAN_FRONTEND=noninteractive apt-get install \
1111
--yes \
1212
--no-install-recommends \
13-
--option 'Binary::apt::APT::Keep-Downloaded-Packages=true' \
1413
ca-certificates \
1514
netcat-openbsd \
1615
curl \
@@ -33,4 +32,6 @@ COPY --chown=root:root --chmod=0755 protonwire /usr/bin/protonwire
3332

3433
RUN ln -s /usr/bin/protonwire /usr/bin/protonvpn
3534

36-
CMD [ "/usr/bin/protonwire", "connect", "--container" ]
35+
ENTRYPOINT [ "/usr/bin/protonwire" ]
36+
37+
CMD [ "connect", "--container" ]

Makefile

Lines changed: 3 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ endif
66
export REPO_ROOT := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
77

88
ifeq ($(SHELLCHECK_VERSION),)
9-
SHELLCHECK_VERSION := v0.9.0
9+
SHELLCHECK_VERSION := v0.10.0
1010
endif
1111

1212
# Set default goal to help
@@ -28,6 +28,7 @@ shellcheck: ## Runs shellcheck
2828
-v $(REPO_ROOT)/protonwire:/protonwire:ro \
2929
koalaman/shellcheck:$(SHELLCHECK_VERSION) \
3030
--color=always \
31+
--extended-analysis=true \
3132
/protonwire
3233

3334
.PHONY: docker
@@ -55,47 +56,6 @@ release: ## Build release
5556
release-prod: ## Build release and publish
5657
goreleaser release --clean
5758

58-
.PHONY: install
59-
install: ## Install protonwire
60-
@if [[ ! -e /etc/polkit-1/localauthority/10-vendor.d ]]; then install -g root -o root -m 755 -d /etc/polkit-1/localauthority/10-vendor.d; fi
61-
install -g root -o root -m 644 systemd/polkit/protonwire.pkla /etc/polkit-1/localauthority/10-vendor.d/protonwire.pkla
62-
63-
@if [[ ! -e /etc/sysctl.d ]]; then install -g root -o root -m 755 -d /etc/sysctl.d; fi
64-
install -g root -o root -m 644 systemd/sysctl.d/protonwire.conf /etc/sysctl.d/protonwire.conf
65-
66-
@if [[ ! -e /etc/systemd/system ]]; then install -g root -o root -m 755 -d /etc/systemd/system; fi
67-
install -g root -o root -m 644 systemd/system/protonwire.service /etc/systemd/system/protonwire.service
68-
69-
@if [[ ! -e /etc/sysusers.d ]]; then install -g root -o root -m 755 -d /etc/sysusers.d; fi
70-
install -g root -o root -m 644 systemd/sysusers.d/protonwire.conf /etc/sysusers.d/protonwire.conf
71-
72-
@if [[ ! -e /etc/tmpfiles.d ]]; then install -g root -o root -m 755 -d /etc/tmpfiles.d; fi
73-
install -g root -o root -m 644 systemd/tmpfiles.d/protonwire.conf /etc/tmpfiles.d/protonwire.conf
74-
75-
@if [[ ! -e /usr/local/bin ]]; then install -g root -o root -m 755 -d /usr/local/bin; fi
76-
install -g root -o root -m 755 protonwire /usr/local/bin/protonwire
77-
78-
@if [[ ! -e /usr/local/man/man1 ]]; then install -g root -o root -m 755 -d /usr/local/man/man1; fi
79-
help2man --no-info --manual="ProtonWire - ProtonVPN Wireguard Client" ./protonwire | install -g root -o root -m 644 /dev/stdin /usr/local/man/man1/protonwire.1
80-
81-
systemd-sysusers protonwire.conf
82-
/usr/lib/systemd/systemd-sysctl protonwire.conf
83-
systemd-tmpfiles --create protonwire.conf
84-
systemctl daemon-reload
85-
86-
.PHONY: uninstall
87-
uninstall: ## Uninstall protonwire
88-
protonwire disable-killswitch || true
89-
systemctl disable --now protonwire || true
90-
rm -f /etc/polkit-1/localauthority/10-vendor.d/protonwire.pkla
91-
rm -f /etc/sysctl.d/protonwire.conf
92-
rm -f /etc/systemd/system/protonwire.service
93-
rm -f /etc/sysusers.d/protonwire.conf
94-
rm -f /etc/tmpfiles.d/protonwire.conf
95-
rm -f /usr/local/man/man1/protonwire.1
96-
rm -f /usr/local/bin/protonwire
97-
systemctl daemon-reload
98-
9959
.PHONY: clean
10060
clean: ## clean
10161
rm -rf $(REPO_ROOT)/dist/
@@ -104,4 +64,4 @@ clean: ## clean
10464
.PHONY: update-readme
10565
update-readme: ## Update README
10666
sed -i '/<!--diana::dynamic:protonwire-help:begin-->/,/<!--diana::dynamic:protonwire-help:end-->/!b;//!d;/<!--diana::dynamic:protonwire-help:end-->/e echo "<pre>" && ./protonwire --help && echo "</pre>"' README.md
107-
sed -i '/<!--diana::dynamic:protonwire-sample-compose-file:begin-->/,/<!--diana::dynamic:protonwire-sample-compose-file:end-->/!b;//!d;/<!--diana::dynamic:protonwire-sample-compose-file:end-->/e echo "\\\`\\\`\\\`yaml" && cat docs/examples/docker-compose-demo.yml && echo "\\\`\\\`\\\`"' README.md
67+
sed -i '/<!--diana::dynamic:protonwire-sample-compose-file:begin-->/,/<!--diana::dynamic:protonwire-sample-compose-file:end-->/!b;//!d;/<!--diana::dynamic:protonwire-sample-compose-file:end-->/e echo "\\\`\\\`\\\`yaml" && cat docs/examples/docker/docker-compose.yml && echo "\\\`\\\`\\\`"' README.md

docs/examples/container-protonwire-example-app.service

Lines changed: 0 additions & 75 deletions
This file was deleted.

docs/examples/container-protonwire.service

Lines changed: 0 additions & 88 deletions
This file was deleted.
File renamed without changes.

docs/examples/podman/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Podman Systemd Examples

docs/examples/protonwire-example-app.container renamed to docs/examples/podman/protonwire-example-app.container

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,18 @@
22
Description=Example application using protonwire VPN container
33
Documentation=https://github.com/tprasadtp/protonvpn-docker
44

5+
# Ensure protonwire container is started and healthy.
6+
Requires=protonwire.service
57
After=protonwire.service
8+
9+
# If protonwire container is stopped, this will be stopped as well.
610
BindsTo=protonwire.service
711

812
[Container]
9-
Pod=protonwire.pod
1013
Image=docker.io/library/caddy:latest
1114
Timezone=local
1215
RunInit=true
16+
Network=container:protonwire
1317
Exec=caddy reverse-proxy --change-host-header --from :8000 --to https://ip.me:443
1418

1519
[Install]
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
[Unit]
2+
Description=ProtonVPN Container
3+
Documentation=https://github.com/tprasadtp/protonvpn-docker
4+
5+
[Container]
6+
# Enable protonwire itself to handle systemd readiness protocol.
7+
# For podman 5.0 or later it might be tempting to use Notify=healthy
8+
# but container also posts status information like connected server and
9+
# exit IP which might be important.
10+
Notify=true
11+
12+
# Container Name.
13+
#
14+
# Alternatively, pod can be used. But pod files are only supported on
15+
# podman 5.0 or later and require using PodmanArgs as Sysctl is not
16+
# recognized by the generator.
17+
ContainerName=protonwire
18+
19+
# Runtime configuration
20+
Image=ghcr.io/tprasadtp/protonwire:7
21+
Timezone=local
22+
RunInit=true
23+
24+
# Server Configuration.
25+
Environment=PROTONVPN_SERVER=node-nl-03.protonvpn.net
26+
Environment=KILL_SWITCH=1
27+
Environment=DEBUG=1
28+
29+
# Private Key
30+
#
31+
# This MUST be created before enabling the service.
32+
Secret=protonwire-private-key,mode=600
33+
34+
# Image specific extra permissions.
35+
AddCapability=NET_ADMIN
36+
Sysctl=net.ipv4.conf.all.rp_filter=2
37+
Sysctl=net.ipv6.conf.all.disable_ipv6=1
38+
39+
# Mounts
40+
Tmpfs=/tmp
41+
42+
# Healthcheck
43+
HealthCmd=protonwire check --container --quiet
44+
HealthInterval=2m
45+
HealthRetries=3
46+
HealthStartPeriod=30s
47+
HealthTimeout=20s
48+
49+
# Ports
50+
#
51+
# This example only publishes a single port. port 8000 both on host and container.
52+
# Add as many ports as your applications require.
53+
#
54+
# Try to setup a reverse proxy which understands podman/docker and only expose ports
55+
# 443 and 80 (should redirect to 443). This ensures that you can reach hosted applications
56+
# using reverse proxy without re-configuring protonwire container every time a new service
57+
# is added. This is only a recommendation and not a requirement.
58+
# Do note that binding to ports < 1024 may require additional work if running in rootless mode.
59+
# See https://github.com/containers/podman/blob/master/rootless.md
60+
PublishPort=8000
61+
62+
[Install]
63+
WantedBy=default.target

docs/examples/protonwire.container

Lines changed: 0 additions & 40 deletions
This file was deleted.

0 commit comments

Comments
 (0)