forked from swizzin/swizzin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'swizzin:master' into master
- Loading branch information
Showing
25 changed files
with
3,884 additions
and
175 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
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 |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#!/usr/bin/env bash | ||
# | ||
# authors: SavageCore | ||
# | ||
# Licensed under GNU General Public License v3.0 GPL-3 (in short) | ||
|
||
# Add the jfa-go official repository and key to our installation so we can use apt-get to install it. | ||
echo_progress_start "Setting up jfa-go repository" | ||
curl -s "https://apt.hrfee.dev/hrfee.pubkey.gpg" | gpg --dearmor > /usr/share/keyrings/jfa-go-archive-keyring.gpg 2>> "${log}" | ||
echo "deb [signed-by=/usr/share/keyrings/jfa-go-archive-keyring.gpg arch=$(dpkg --print-architecture)] https://apt.hrfee.dev trusty main" > /etc/apt/sources.list.d/jfa-go.list | ||
echo_progress_done "Repository added" | ||
|
||
# Install jfa-go using apt functions. | ||
# Install crudini to edit the config file | ||
apt_update | ||
apt_install jfa-go crudini | ||
|
||
# Configure the nginx proxypass using positional parameters. | ||
if [[ -f /install/.nginx.lock ]]; then | ||
bash /usr/local/bin/swizzin/nginx/jfago.sh | ||
systemctl -q restart nginx.service | ||
else | ||
echo_info "jfago will run on port 8056" | ||
fi | ||
|
||
# Create systemd service | ||
echo_progress_start "Setting up systemd service" | ||
jfagobinary=$(which jfa-go) | ||
cat > "/etc/systemd/system/jfago.service" << ADC | ||
[Unit] | ||
Description=An account management system for Jellyfin. | ||
[Service] | ||
ExecStart=$jfagobinary -config /root/.config/jfa-go/config.ini -data /root/.config/jfa-go/ | ||
[Install] | ||
WantedBy=multi-user.target | ||
ADC | ||
|
||
systemctl daemon-reload -q | ||
echo_progress_done "Service installed" | ||
|
||
# Start the service | ||
echo_progress_start "Enabling and starting jfago to create config file" | ||
systemctl -q enable jfago --now | ||
echo_progress_done | ||
|
||
crudini --set /root/.config/jfa-go/config.ini ui url_base /jfa-go | ||
|
||
# This file is created after installation to prevent reinstalling. You will need to remove the app first which deletes this file. | ||
touch /install/.jfago.lock | ||
echo_success "jfago installed but not configured" | ||
echo_info "Edit /root/.config/jfa-go/config.ini to configure and then restart the service with systemctl restart jfago" | ||
exit |
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
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
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
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/usr/bin/env bash | ||
# | ||
# Create our nginx application conf for jfa-go | ||
cat > /etc/nginx/apps/jfago.conf <<- NGINXCONF | ||
location ^~ /jfa-go { | ||
proxy_pass http://localhost:8056/jfa-go; | ||
http2_push_preload on; | ||
proxy_set_header Host \$host; | ||
proxy_set_header X-Real-IP \$remote_addr; | ||
proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for; | ||
proxy_set_header X-Forwarded-Proto \$scheme; | ||
proxy_set_header X-Forwarded-Protocol \$scheme; | ||
proxy_set_header X-Forwarded-Host \$http_host; | ||
proxy_buffering off; | ||
} | ||
NGINXCONF |
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/bash | ||
|
||
systemctl disable --now jfago -q | ||
|
||
rm -rf /root/.config/jfa-go | ||
|
||
apt_remove jfa-go | ||
|
||
rm -f /usr/share/keyrings/jfa-go-archive-keyring.gpg | ||
rm -f /etc/apt/sources.list.d/jfa-go.list | ||
|
||
apt_update | ||
|
||
rm -f /etc/systemd/system/jfago.service | ||
|
||
systemctl daemon-reload -q | ||
|
||
if [[ -f /install/.nginx.lock ]]; then | ||
rm /etc/nginx/apps/jfago.conf | ||
systemctl reload nginx | ||
fi | ||
|
||
rm /install/.jfago.lock |
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/usr/bin/env bash | ||
|
||
. /etc/swizzin/sources/functions/tests | ||
|
||
check_service "jfago" || BAD=true | ||
check_port "8056" || BAD=true | ||
check_nginx "jfa-go" || BAD=true | ||
|
||
evaluate_bad "jfago" |
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
Oops, something went wrong.