Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update #295

Merged
merged 7 commits into from
Feb 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
with:
persist-credentials: false

- name: Run GoReleaser
- name: Update README
run: make update-readme

- name: Check if README is up-to date
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#syntax=docker/dockerfile:1.2
FROM debian:bookworm-20240130-slim as base
FROM debian:bookworm-20240211-slim as base

FROM base

Expand Down
41 changes: 23 additions & 18 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,36 +57,43 @@ release-prod: ## Build release and publish

.PHONY: install
install: ## Install protonwire
@./scripts/goreleaser-wrapper build

@if [[ ! -e /usr/local/bin ]]; then install -g root -o root -m 755 -d /usr/local/bin; fi
install -g root -o root -m 755 protonwire /usr/local/bin/protonwire

@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
install -g root -o root -m 644 systemd/polkit/protonwire.pkla /etc/polkit-1/localauthority/10-vendor.d/protonwire.pkla

@if [[ ! -e /usr/local/lib/sysctl.d ]]; then install -g root -o root -m 755 -d /usr/local/lib/sysctl.d; fi
install -g root -o root -m 644 systemd/sysctl.d/protonwire.conf /usr/local/lib/sysctl.d/protonwire.conf
@if [[ ! -e /etc/sysctl.d ]]; then install -g root -o root -m 755 -d /etc/sysctl.d; fi
install -g root -o root -m 644 systemd/sysctl.d/protonwire.conf /etc/sysctl.d/protonwire.conf

@if [[ ! -e /etc/systemd/system ]]; then install -g root -o root -m 755 -d /etc/systemd/system; fi
install -g root -o root -m 644 systemd/system/protonwire.service /etc/systemd/system/protonwire.service

@if [[ ! -e /usr/local/lib/systemd/system ]]; then install -g root -o root -m 755 -d /usr/local/lib/systemd/system; fi
install -g root -o root -m 644 systemd/system/protonwire.service /usr/local/lib/systemd/system/protonwire.service
@if [[ ! -e /etc/sysusers.d ]]; then install -g root -o root -m 755 -d /etc/sysusers.d; fi
install -g root -o root -m 644 systemd/sysusers.d/protonwire.conf /etc/sysusers.d/protonwire.conf

@if [[ ! -e /usr/local/lib/sysusers.d ]]; then install -g root -o root -m 755 -d /usr/local/lib/sysusers.d; fi
install -g root -o root -m 644 systemd/sysusers.d/protonwire.conf /usr/local/lib/sysusers.d/protonwire.conf
@if [[ ! -e /etc/tmpfiles.d ]]; then install -g root -o root -m 755 -d /etc/tmpfiles.d; fi
install -g root -o root -m 644 systemd/tmpfiles.d/protonwire.conf /etc/tmpfiles.d/protonwire.conf

@if [[ ! -e /usr/local/bin ]]; then install -g root -o root -m 755 -d /usr/local/bin; fi
install -g root -o root -m 755 protonwire /usr/local/bin/protonwire

@if [[ ! -e /usr/local/man/man1 ]]; then install -g root -o root -m 755 -d /usr/local/man/man1; fi
help2man --no-info --manual="ProtonWire - ProtonVPN Wireguard Client" ./protonwire | install -g root -o root -m 644 /dev/stdin /usr/local/man/man1/protonwire.1

systemctl restart systemd-sysusers.service
systemd-sysusers protonwire.conf
/usr/lib/systemd/systemd-sysctl protonwire.conf
systemd-tmpfiles --create protonwire.conf
systemctl daemon-reload

.PHONY: uninstall
uninstall: ## Uninstall protonwire
rm -f /usr/local/bin/protonwire
rm -f /usr/local/lib/sysctl.d/protonwire.conf
rm -f /usr/local/lib/systemd/system/protonwire.service
rm -f /usr/local/lib/sysusers.d/protonwire.conf
protonwire disable-killswitch || true
systemctl disable --now protonwire || true
rm -f /etc/polkit-1/localauthority/10-vendor.d/protonwire.pkla
rm -f /etc/sysctl.d/protonwire.conf
rm -f /etc/systemd/system/protonwire.service
rm -f /etc/sysusers.d/protonwire.conf
rm -f /etc/tmpfiles.d/protonwire.conf
rm -f /usr/local/man/man1/protonwire.1
rm -f /usr/local/bin/protonwire
systemctl daemon-reload

.PHONY: clean
Expand All @@ -98,5 +105,3 @@ clean: ## clean
update-readme: ## Update README
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
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
sed -i '/<!--diana::dynamic:protonwire-container-unit-file:begin-->/,/<!--diana::dynamic:protonwire-container-unit-file:end-->/!b;//!d;/<!--diana::dynamic:protonwire-container-unit-file:end-->/e echo "\\\`\\\`\\\`ini" && cat docs/examples/container-protonwire.service && echo "\\\`\\\`\\\`"' README.md
sed -i '/<!--diana::dynamic:protonwire-app-unit-file:begin-->/,/<!--diana::dynamic:protonwire-app-unit-file:end-->/!b;//!d;/<!--diana::dynamic:protonwire-app-unit-file:end-->/e echo "\\\`\\\`\\\`ini" && cat docs/examples/container-protonwire-example-app.service && echo "\\\`\\\`\\\`"' README.md
Loading
Loading