From e50b8c82e4cf45fbfe9acfcac3590364c001462b Mon Sep 17 00:00:00 2001 From: eyedeekay Date: Wed, 21 May 2025 11:44:11 -0400 Subject: [PATCH] Fix Makefile --- Makefile | 132 +++++++++++++++++++++++++++---------------------------- 1 file changed, 66 insertions(+), 66 deletions(-) diff --git a/Makefile b/Makefile index 3fc8164..e3e2112 100644 --- a/Makefile +++ b/Makefile @@ -10,96 +10,96 @@ DATA_PATH = /var/lib/gitea all: help help: - @echo "GitLooseLeaf - Modified Gitea with multi-protocol support" - @echo "" - @echo "Usage:" - @echo " make download - Download the latest gitea binary" - @echo " make setup-user - Create git user and required directories" - @echo " make install-binary - Install Gitea binary" - @echo " make install-systemd - Install systemd service files" - @echo " make enable - Enable and start Gitea service" - @echo " make disable - Disable and stop Gitea service" - @echo " make install - Complete installation (all above steps)" - @echo " make uninstall - Remove Gitea" - @echo " make clean - Clean up downloaded files" - @echo "" - @echo "Note: Many commands require root privileges (use sudo)" + @echo "GitLooseLeaf - Modified Gitea with multi-protocol support" + @echo "" + @echo "Usage:" + @echo " make download - Download the latest gitea binary" + @echo " make setup-user - Create git user and required directories" + @echo " make install-binary - Install Gitea binary" + @echo " make install-systemd - Install systemd service files" + @echo " make enable - Enable and start Gitea service" + @echo " make disable - Disable and stop Gitea service" + @echo " make install - Complete installation (all above steps)" + @echo " make uninstall - Remove Gitea" + @echo " make clean - Clean up downloaded files" + @echo "" + @echo "Note: Many commands require root privileges (use sudo)" # Download latest Gitea binary download: - @echo "Downloading latest Gitea binary..." - mkdir -p downloads - GITEA_URL="https://github.com/go-i2p/go-gitlooseleaf/releases/download/nightly/gitea-Linux"; \ - wget -O downloads/gitea "$$GITEA_URL" || curl -L -o downloads/gitea "$$GITEA_URL" - chmod +x downloads/gitea + @echo "Downloading latest Gitea binary..." + mkdir -p downloads + GITEA_URL="https://github.com/go-i2p/go-gitlooseleaf/releases/download/nightly/gitea-Linux"; \ + wget -O downloads/gitea "$$GITEA_URL" || curl -L -o downloads/gitea "$$GITEA_URL" + chmod +x downloads/gitea # Setup git user and directories setup-user: - @echo "Setting up git user and directories..." - id -u git &>/dev/null || adduser \ - --system \ - --shell /bin/bash \ - --gecos 'Git Version Control' \ - --group \ - --disabled-password \ - --home /home/git \ - git - mkdir -p $(DATA_PATH)/{custom,data,log} - mkdir -p $(CONFIG_PATH) - chown -R git:git $(DATA_PATH)/ - chmod -R 750 $(DATA_PATH)/ - chown root:git $(CONFIG_PATH) - chmod 770 $(CONFIG_PATH) + @echo "Setting up git user and directories..." + id -u git &>/dev/null || adduser \ + --system \ + --shell /bin/bash \ + --gecos 'Git Version Control' \ + --group \ + --disabled-password \ + --home /home/git \ + git + mkdir -p $(DATA_PATH)/{custom,data,log} + mkdir -p $(CONFIG_PATH) + chown -R git:git $(DATA_PATH)/ + chmod -R 750 $(DATA_PATH)/ + chown root:git $(CONFIG_PATH) + chmod 770 $(CONFIG_PATH) # Install Gitea binary install-binary: download - @echo "Installing Gitea binary..." - cp downloads/gitea $(BINARY_PATH) - chmod +x $(BINARY_PATH) - setcap CAP_NET_BIND_SERVICE=+eip $(BINARY_PATH) + @echo "Installing Gitea binary..." + cp downloads/gitea $(BINARY_PATH) + chmod +x $(BINARY_PATH) + setcap CAP_NET_BIND_SERVICE=+eip $(BINARY_PATH) # Install systemd service files install-systemd: - @echo "Installing systemd service files..." - mkdir -p $(SYSTEMD_PATH)/gitea.service.d - cp etc/systemd/system/gitea.service $(SYSTEMD_PATH)/ - cp etc/systemd/system/gitea.service.d/user-config.conf $(SYSTEMD_PATH)/gitea.service.d/ - systemctl daemon-reload + @echo "Installing systemd service files..." + mkdir -p $(SYSTEMD_PATH)/gitea.service.d + cp etc/systemd/system/gitea.service $(SYSTEMD_PATH)/ + cp etc/systemd/system/gitea.service.d/user-config.conf $(SYSTEMD_PATH)/gitea.service.d/ + systemctl daemon-reload # Enable and start Gitea service enable: - @echo "Enabling and starting Gitea service..." - systemctl enable gitea.service - systemctl start gitea.service - @echo "Gitea service started successfully!" - @echo "Please configure your email in $(SYSTEMD_PATH)/gitea.service.d/user-config.conf" - @echo "Then restart with: systemctl restart gitea.service" + @echo "Enabling and starting Gitea service..." + systemctl enable gitea.service + systemctl start gitea.service + @echo "Gitea service started successfully!" + @echo "Please configure your email in $(SYSTEMD_PATH)/gitea.service.d/user-config.conf" + @echo "Then restart with: systemctl restart gitea.service" # Disable and stop Gitea service disable: - @echo "Disabling and stopping Gitea service..." - systemctl disable gitea.service - systemctl stop gitea.service + @echo "Disabling and stopping Gitea service..." + systemctl disable gitea.service + systemctl stop gitea.service # Complete installation install: setup-user install-binary install-systemd enable - @echo "Installation complete!" - @echo "You can now access Gitea at:" - @echo "- HTTPS: https://$(shell hostname):3000" - @echo "- I2P/Tor: Check logs for actual addresses: journalctl -u gitea" + @echo "Installation complete!" + @echo "You can now access Gitea at:" + @echo "- HTTPS: https://$(shell hostname):3000" + @echo "- I2P/Tor: Check logs for actual addresses: journalctl -u gitea" # Uninstall Gitea uninstall: disable - @echo "Uninstalling Gitea..." - rm -f $(BINARY_PATH) - rm -f $(SYSTEMD_PATH)/gitea.service - rm -rf $(SYSTEMD_PATH)/gitea.service.d - systemctl daemon-reload - @echo "Gitea has been uninstalled." - @echo "Note: User and data directories were not removed." - @echo "To completely remove, delete: $(CONFIG_PATH) and $(DATA_PATH)" + @echo "Uninstalling Gitea..." + rm -f $(BINARY_PATH) + rm -f $(SYSTEMD_PATH)/gitea.service + rm -rf $(SYSTEMD_PATH)/gitea.service.d + systemctl daemon-reload + @echo "Gitea has been uninstalled." + @echo "Note: User and data directories were not removed." + @echo "To completely remove, delete: $(CONFIG_PATH) and $(DATA_PATH)" # Clean up clean: - @echo "Cleaning up..." - rm -rf downloads \ No newline at end of file + @echo "Cleaning up..." + rm -rf downloads \ No newline at end of file