-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: implements new install mechanism
This installer requires to be configured due make config Changes: Add tools/configure.sh script and make config. Refactor of uninstall.sh according to new installer Add dev-helper.sh to provide various informations for developing and also could check existing installation as kinda "unit-test" This should also fix #46 and fix #41 Signed-off-by: Stephan Wendel <[email protected]> Signed-off-by: Stephan Wendel <[email protected]>
- Loading branch information
Showing
23 changed files
with
1,200 additions
and
620 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
#### webcamd - A webcam Service for multiple Cams and Stream Services. | ||
#### | ||
#### Written by Stephan Wendel aka KwadFan <[email protected]> | ||
#### Copyright 2021 | ||
#### Copyright 2021 - 2022 | ||
#### https://github.com/mainsail-crew/crowsnest | ||
#### | ||
#### This File is distributed under GPLv3 | ||
#### | ||
|
||
.PHONY: help install unsinstall build buildclean | ||
.PHONY: build buildclean config help install unsinstall | ||
|
||
# Setup | ||
USER = $(shell whoami) | ||
|
@@ -25,18 +25,17 @@ help: | |
@echo "" | ||
@echo " Available actions:" | ||
@echo "" | ||
@echo " install Installs crowsnest" | ||
@echo " uninstall Uninstalls crowsnest" | ||
@echo " config Configures Installer" | ||
@echo " install Installs crowsnest (needs sudo)" | ||
@echo " uninstall Uninstalls crowsnest (needs sudo)" | ||
@echo " build builds binaries" | ||
@echo " buildclean cleans binaries (for recompile)" | ||
@echo " clean Removes Installer config" | ||
@echo "" | ||
|
||
install: | ||
@bash -c 'tools/install.sh' | ||
|
||
unattended: | ||
@bash -c 'tools/install.sh -z' | ||
|
||
uninstall: | ||
@bash -c 'tools/uninstall.sh' | ||
|
||
|
@@ -46,4 +45,16 @@ build: | |
buildclean: | ||
$(MAKE) -C $(BIN_FOLDER) clean | ||
|
||
clean: | ||
@if [ -f tools/.config ]; then rm -f tools/.config; fi | ||
@echo "Removed installer config file ..." | ||
|
||
config: | ||
@bash -c 'tools/configure.sh' | ||
|
||
report: | ||
@if [ -f ~/report.txt ]; then rm -f ~/report.txt; fi | ||
@bash -c 'tools/dev-helper.sh -a >> ~/report.txt' | ||
@sed -ri 's/\x1B\[([0-9]{1,3}(;[0-9]{1,2})?)?[mGK]//g' ~/report.txt | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,27 +2,33 @@ | |
#### crowsnest - A webcam Service for multiple Cams and Stream Services. | ||
#### | ||
#### Written by Stephan Wendel aka KwadFan <[email protected]> | ||
#### Copyright 2021 | ||
#### Copyright 2021 - 2022 | ||
#### https://github.com/mainsail-crew/crowsnest | ||
#### | ||
#### This File is distributed under GPLv3 | ||
#### | ||
# shellcheck disable=all | ||
|
||
# crowsnest | ||
[ -n "$CROWSNEST_CROWSNEST_REPO_SHIP" ] || CROWSNEST_CROWSNEST_REPO_SHIP=https://github.com/mainsail-crew/crowsnest.git | ||
[ -n "$CROWSNEST_CROWSNEST_REPO_BRANCH" ] || CROWSNEST_CROWSNEST_REPO_BRANCH=master | ||
[ -n "$CROWSNEST_CROWSNEST_DEPS" ] || CROWSNEST_CROWSNEST_DEPS="git crudini bsdutils findutils v4l-utils ffmpeg" | ||
[ -n "$CROWSNEST_DEFAULT_CONF" ] || CROWSNEST_DEFAULT_CONF="mainsail_default.conf" | ||
[ -n "$CROWSNEST_DEFAULT_CONF_DIR" ] || CROWSNEST_DEFAULT_CONF_DIR="/home/${BASE_USER}/klipper_config" | ||
# Force Raspicam fix bool (1:yes / 0:no) | ||
[ -n "$CROWSNEST_FORCE_RASPICAMFIX" ] || CROWSNEST_FORCE_RASPICAMFIX=1 | ||
# Add Crowsnest to moonraker.conf (update manager) bool (1:yes / 0:no) | ||
[ -n "$CROWSNEST_ADD_CROWSNEST_MOONRAKER" ] || CROWSNEST_ADD_CROWSNEST_MOONRAKER=1 | ||
# crowsnest repo | ||
[[ -n "$CROWSNEST_REPO_SHIP" ]] || CROWSNEST_REPO_SHIP=https://github.com/mainsail-crew/crowsnest.git | ||
[[ -n "$CROWSNEST_REPO_BRANCH" ]] || CROWSNEST_REPO_BRANCH=master | ||
|
||
# crowsnest setup | ||
[[ -n "$CROWSNEST_DEFAULT_CONF" ]] || CROWSNEST_DEFAULT_CONF="resources/crowsnest.conf" | ||
[[ -n "$CROWSNEST_CONFIG_PATH" ]] || CROWSNEST_CONFIG_PATH="/home/pi/printer_data/config" | ||
[[ -n "$CROWSNEST_LOG_PATH" ]] || CROWSNEST_LOG_PATH="/home/pi/printer_data/logs" | ||
[[ -n "$CROWSNEST_ENV_PATH" ]] || CROWSNEST_ENV_PATH="/home/pi/printer_data/systemd" | ||
[[ -n "$CROWSNEST_RASPICAMFIX" ]] || CROWSNEST_RASPICAMFIX="1" | ||
[[ -n "$CROWSNEST_ADD_CROWSNEST_MOONRAKER" ]] || CROWSNEST_ADD_CROWSNEST_MOONRAKER="1" | ||
[[ -n "$CROWSNEST_MOONRAKER_CONF_PATH" ]] || CROWSNEST_MOONRAKER_CONF_PATH="/home/pi/printer_data/config/moonraker.conf" | ||
|
||
|
||
# ustreamer | ||
[ -n "$CROWSNEST_USTREAMER_DEPS" ] || CROWSNEST_USTREAMER_DEPS="git build-essential libevent-dev libjpeg-dev \ | ||
libbsd-dev libraspberrypi-dev libgpiod-dev" | ||
[ -n "$CROWSNEST_USTREAMER_WITH_OMX" ] || CROWSNEST_USTREAMER_WITH_OMX="y" | ||
[ -n "$CROWSNEST_USTREAMER_WITH_GPIO" ] || CROWSNEST_USTREAMER_WITH_GPIO="n" | ||
[[ -n "$CROWSNEST_USTREAMER_REPO_SHIP" ]] || CROWSNEST_USTREAMER_REPO_SHIP="https://github.com/pikvm/ustreamer.git" | ||
[[ -n "$CROWSNEST_USTREAMER_REPO_BRANCH" ]] || CROWSNEST_USTREAMER_REPO_BRANCH="master" | ||
|
||
########################################################################### | ||
### DO NOT EDIT BELOW THIS LINE, UNLESS YOU KNOW EXACTLY WHAT HAPPENDS! ### | ||
########################################################################### | ||
|
||
CROWSNEST_UNATTENDED="1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
#### crowsnest - A webcam Service for multiple Cams and Stream Services. | ||
#### | ||
#### Written by Stephan Wendel aka KwadFan <[email protected]> | ||
#### Copyright 2021 | ||
#### Copyright 2021 - 2022 | ||
#### https://github.com/mainsail-crew/crowsnest | ||
#### | ||
#### This File is distributed under GPLv3 | ||
|
@@ -20,10 +20,11 @@ StartLimitIntervalSec=180 | |
WantedBy=multi-user.target | ||
|
||
[Service] | ||
Environment=CROWSNEST_CONFIG=/home/pi/klipper_config/crowsnest.conf | ||
Type=exec | ||
User=pi | ||
Type=simple | ||
User=%USER% | ||
RemainAfterExit=Yes | ||
ExecStart= /usr/local/bin/crowsnest -c ${CROWSNEST_CONFIG} | ||
WorkingDirectory=/home/%USER%/crowsnest | ||
EnvironmentFile=%ENV% | ||
ExecStart= /usr/local/bin/crowsnest $CROWSNEST_ARGS | ||
Restart=on-failure | ||
RestartSec=5 |
22 changes: 10 additions & 12 deletions
22
file_templates/logrotate_crowsnest → resources/logrotate_crowsnest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,20 @@ | ||
# crowsnest logrotate file | ||
|
||
#### crowsnest - A webcam Service for multiple Cams and Stream Services. | ||
#### | ||
#### Written by Stephan Wendel aka KwadFan <[email protected]> | ||
#### Copyright 2021 | ||
#### Copyright 2021 - 2022 | ||
#### https://github.com/mainsail-crew/crowsnest | ||
#### | ||
#### This File is distributed under GPLv3 | ||
#### | ||
|
||
|
||
/home/pi/klipper_logs/crowsnest.log { | ||
rotate 3 | ||
missingok | ||
notifempty | ||
copy | ||
daily | ||
dateext | ||
dateformat .%Y-%m-%d | ||
maxsize 4M | ||
%LOGPATH% { | ||
rotate 3 | ||
missingok | ||
notifempty | ||
copy | ||
daily | ||
dateext | ||
dateformat .%Y-%m-%d | ||
maxsize 4M | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.