Added CT's Duplicati and Vouch-Proxy
This commit is contained in:
21
CT-Files/vouchproxy/Scripts/AddOne.sh
Normal file
21
CT-Files/vouchproxy/Scripts/AddOne.sh
Normal file
@@ -0,0 +1,21 @@
|
||||
#!/bin/ash
|
||||
|
||||
#Get and update ID
|
||||
if [ ! -f "/opt/VouchTemplates/.vouchID" ]; then ID=0; else source /opt/VouchTemplates/.vouchID; fi
|
||||
if [ -z ${ID+x} ]; then ID=0; fi
|
||||
ID=$(($ID+1))
|
||||
echo "ID=$ID" > /opt/VouchTemplates/.vouchID
|
||||
|
||||
#Settign up config
|
||||
mkdir "/etc/vouch-proxy$ID"
|
||||
cp -r /usr/share/webapps/vouch-proxy "/usr/share/webapps/vouch-proxy$ID"
|
||||
rm "/usr/share/webapps/vouch-proxy$ID/config"
|
||||
ln -s "/etc/vouch-proxy$ID" "/usr/share/webapps/vouch-proxy$ID/config"
|
||||
cp /opt/VouchTemplates/Vouch-Config "/etc/vouch-proxy$ID/config.yml"
|
||||
sed -i "s/VID/$ID/" "/etc/vouch-proxy$ID/config.yml"
|
||||
|
||||
#Setting up service
|
||||
cp /opt/VouchTemplates/Vouch-Service "/etc/init.d/vouch-proxy$ID"
|
||||
sed -i "s/VID/$ID/" "/etc/init.d/vouch-proxy$ID"
|
||||
chmod +x "/etc/init.d/vouch-proxy$ID"
|
||||
rc-update add "vouch-proxy$ID"
|
||||
5
CT-Files/vouchproxy/Scripts/init.sh
Normal file
5
CT-Files/vouchproxy/Scripts/init.sh
Normal file
@@ -0,0 +1,5 @@
|
||||
#!/bin/ash
|
||||
rc-update add vouch-proxy
|
||||
mv /opt/Setup/Templates /opt/VouchTemplates
|
||||
touch /opt/VouchTemplates/.vouchID
|
||||
mv /opt/Setup/Scripts/AddOne.sh /opt/AddVouchInstance.sh
|
||||
8
CT-Files/vouchproxy/Templates/Vouch-Config
Normal file
8
CT-Files/vouchproxy/Templates/Vouch-Config
Normal file
@@ -0,0 +1,8 @@
|
||||
# vouch config
|
||||
# Bare minimum to get vouch running on another port
|
||||
|
||||
vouch:
|
||||
# logLevel: debug
|
||||
logLevel: info
|
||||
port: 909VID
|
||||
# Insert further config here
|
||||
23
CT-Files/vouchproxy/Templates/Vouch-Service
Normal file
23
CT-Files/vouchproxy/Templates/Vouch-Service
Normal file
@@ -0,0 +1,23 @@
|
||||
#!/sbin/openrc-run
|
||||
|
||||
: ${command_user:="vouch"}
|
||||
: ${command_group:="vouch"}
|
||||
: ${cfgfile:="/etc/vouch-proxyVID/config.yml"}
|
||||
|
||||
name="Vouch Proxy VID"
|
||||
command="/usr/sbin/vouch-proxy"
|
||||
command_background="yes"
|
||||
pidfile="/run/vouch-proxy/$RC_SVCNAME.pid"
|
||||
start_stop_daemon_args="--user $command_user --group $command_group -1 /var/log/vouch-proxy/vouch-proxyVID.log"
|
||||
required_files="$cfgfile"
|
||||
export VOUCH_ROOT="/usr/share/webapps/vouch-proxyVID"
|
||||
|
||||
depend() {
|
||||
use net
|
||||
after firewall
|
||||
}
|
||||
|
||||
start_pre() {
|
||||
checkpath -d -m 0755 -o $command_user:$command_group ${pidfile%/*}
|
||||
checkpath -d -m 0755 -o $command_user:$command_group /var/log/vouch-proxy
|
||||
}
|
||||
Reference in New Issue
Block a user