diff --git a/Makefile b/Makefile index d324e1f..c079598 100644 --- a/Makefile +++ b/Makefile @@ -10,6 +10,9 @@ WIN_SRC = win_service.c OBJ = $(SRC:.c=.o) WIN_OBJ = $(WIN_SRC:.c=.o) +PREFIX := /usr/local +INSTALL_DIR := $(DESTDIR)$(PREFIX)/bin/ + all: $(TARGET) $(TARGET): $(OBJ) @@ -23,3 +26,7 @@ windows: $(OBJ) $(WIN_OBJ) clean: rm -f $(TARGET) $(TARGET).exe $(OBJ) $(WIN_OBJ) + +install: $(TARGET) + mkdir -p $(INSTALL_DIR) + install -m 755 $(TARGET) $(INSTALL_DIR) diff --git a/dist/linux/README.md b/dist/linux/README.md new file mode 100644 index 0000000..96db4d8 --- /dev/null +++ b/dist/linux/README.md @@ -0,0 +1,24 @@ +# Installing on Linux + +## Building +```sh +cd byedpi/ +make +sudo make install +``` + +## Systemd Service (optional) + +Copy and enable the service: + +```sh +cp byedpi.service ~/.config/systemd/user/ +systemctl --user daemon-reload +systemctl --user enable byedpi.service +systemctl --user start byedpi.service +``` + +You should see the service now marked as "active": +```sh +systemctl --user status byedpi.service +``` diff --git a/dist/linux/byedpi.service b/dist/linux/byedpi.service new file mode 100644 index 0000000..af986ae --- /dev/null +++ b/dist/linux/byedpi.service @@ -0,0 +1,14 @@ +[Unit] +Description=byedpi +Documentation=https://github.com/hufrea/byedpi + +[Service] +ExecStart=ciadpi --split 1 --disorder 3+s --mod-http=h,d --auto=torst --tlsrec 1+s +TimeoutStopSec=5s +LimitNOFILE=1048576 +LimitNPROC=512 +PrivateTmp=true +ProtectSystem=full + +[Install] +WantedBy=default.target \ No newline at end of file