Skip to content

Commit

Permalink
Merge pull request #22 from Merrick28/v5.1
Browse files Browse the repository at this point in the history
V5.1
  • Loading branch information
Whisper40 authored May 7, 2021
2 parents 28216fa + 06f7df6 commit 15be98a
Show file tree
Hide file tree
Showing 13 changed files with 65 additions and 47 deletions.
2 changes: 1 addition & 1 deletion dockers/bazarr/bazarr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
container_name: bazarr_{{ user }}
restart: unless-stopped
volumes:
- $DATA_DIR/{{ user }}/data:/data/downloads
- $DATA_DIR/{{ user }}/data:/data
- $DATA_DIR/{{ user }}/config/bazarr:/config
labels:
- "user={{ user }}"
Expand Down
4 changes: 2 additions & 2 deletions dockers/flood/flood.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
- "traefik.http.routers.flood_{{ user }}-router.tls=true"
- "traefik.http.services.flood_{{ user }}-service.loadbalancer.server.port=3001"
volumes:
- $DATA_DIR/{{ user }}/data:/data/downloads
- $DATA_DIR/{{ user }}/data:/data
- $DATA_DIR/{{ user }}/config/torrent:/config
- $DATA_DIR/{{ user }}/config/torrent/run/rtorrent:/config/.local/share/rtorrent/
command: --port 3001 --allowedpath /data/downloads
command: --port 3001 --allowedpath /data
environment:
- TZ=${TZ}
- HOME=/config
Expand Down
2 changes: 1 addition & 1 deletion dockers/lidarr/lidarr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
container_name: lidarr_{{ user }}
restart: unless-stopped
volumes:
- $DATA_DIR/{{ user }}/data:/data/downloads
- $DATA_DIR/{{ user }}/data:/data
- $DATA_DIR/{{ user }}/config/lidarr:/config
labels:
- "user={{ user }}"
Expand Down
2 changes: 1 addition & 1 deletion dockers/medusa/medusa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
- "traefik.http.routers.medusa_{{ user }}-router.middlewares={{ user }}_medusa-auth"
- "traefik.http.middlewares.{{ user }}_medusa-auth.basicauth.users={{ user }}:${passwd_{{ user }}}"
volumes:
- $DATA_DIR/{{ user }}/data:/data/downloads
- $DATA_DIR/{{ user }}/data:/data
- $DATA_DIR/{{ user }}/config/medusa:/config
environment:
- PUID=${MYUID}
Expand Down
2 changes: 1 addition & 1 deletion dockers/radarr/radarr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
container_name: radarr_{{ user }}
restart: unless-stopped
volumes:
- $DATA_DIR/{{ user }}/data:/data/downloads
- $DATA_DIR/{{ user }}/data:/data
- $DATA_DIR/{{ user }}/config/radarr:/config
labels:
- "user={{ user }}"
Expand Down
2 changes: 1 addition & 1 deletion dockers/readarr/readarr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
container_name: readarr_{{ user }}
restart: unless-stopped
volumes:
- $DATA_DIR/{{ user }}/data:/data/downloads
- $DATA_DIR/{{ user }}/data:/data
- $DATA_DIR/{{ user }}/config/readarr:/config
labels:
- "user={{ user }}"
Expand Down
2 changes: 1 addition & 1 deletion dockers/rutorrent/rutorrent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
- "traefik.http.routers.rutorrent_{{ user }}-router.middlewares={{ user }}_rutorrent-auth"
- "traefik.http.middlewares.{{ user }}_rutorrent-auth.basicauth.users={{ user }}:${passwd_{{ user }}}"
volumes:
- $DATA_DIR/{{ user }}/data:/data/downloads
- $DATA_DIR/{{ user }}/data:/data
- $DATA_DIR/{{ user }}/config/torrent:/config
- $DATA_DIR/{{ user }}/config/torrent/run/rtorrent:/run/rtorrent
environment:
Expand Down
2 changes: 1 addition & 1 deletion dockers/sabnzbd/sabnzbd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
hostname: "{{ user }}-${SABNZBD_BASE_URL}-${SERVER_BASE_URL}.${DOMAIN_URL}"
restart: unless-stopped
volumes:
- $DATA_DIR/{{ user }}/data:/data/downloads
- $DATA_DIR/{{ user }}/data:/media
- $DATA_DIR/{{ user }}/config/sabnzbd:/datadir
labels:
- "user={{ user }}"
Expand Down
2 changes: 1 addition & 1 deletion dockers/sonarr/sonarr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
container_name: sonarr_{{ user }}
restart: unless-stopped
volumes:
- $DATA_DIR/{{ user }}/data:/data/downloads
- $DATA_DIR/{{ user }}/data:/data
- $DATA_DIR/{{ user }}/config/sonarr:/config
labels:
- "user={{ user }}"
Expand Down
13 changes: 13 additions & 0 deletions includes/help.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,19 @@ function showHelp {
[ --pyload ]
[ --flaresolverr ]
[ --stop ] : Stop seedbox
[ --seedbox username ] : Stop the specified seedbox
[ --all-seedbox ] : Stop all seedbox
[ --start ] : Start seedbox
[ --seedbox username ] : Start the specified seedbox
[ --all-seedbox ] : Start all seedbox
[ --restart ] : Restart seedbox
[ --seedbox username ] : Restart the specified seedbox
[ --all-seedbox ] : Restart all seedbox
[ --recreate ] : Recreate seedbox
[ --seedbox username ] : Recreate the specified seedbox
[ -d | --delete username ] : Delete functions (parameter : Name of user).
Expand Down
6 changes: 6 additions & 0 deletions includes/seedbox_functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ function actionAllSeedbox {
done
}

function recreateSeedbox {
cd docker-compose || error "Cannot go in docker-compose" 1
docker-compose -f "${username}.yml" stop
docker-compose -f "${username}.yml" up -d
}

function deleteData {
sudo rm -rf ${DATA_DIR}/${username}/data
}
Expand Down
53 changes: 18 additions & 35 deletions includes/user_process.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,49 +3,32 @@
function createDefaultDirectory {
if [ ! -d "${DATA_DIR}/${username}/data" ] || [ "$1" == "reset" ]
then
sudo mkdir -p ${DATA_DIR}/${username}/config

sudo mkdir -p ${DATA_DIR}/${username}/data
sudo mkdir -p ${DATA_DIR}/${username}/nextcloud
sudo touch ${DATA_DIR}/${username}/nextcloud/do-not-erase-me-you-brake-nextcloud.txt
sudo mkdir -p "${DATA_DIR}/${username}/"{data,nextcloud}
sudo touch "${DATA_DIR}/${username}/nextcloud/do-not-erase-me-you-brake-nextcloud.txt"

sudo mkdir -p ${DATA_DIR}/${username}/data/Films
sudo mkdir -p ${DATA_DIR}/${username}/data/SeriesTV
sudo mkdir -p ${DATA_DIR}/${username}/data/Logiciels
sudo mkdir -p ${DATA_DIR}/${username}/data/Documentaires
sudo mkdir -p ${DATA_DIR}/${username}/data/Animes
sudo mkdir -p ${DATA_DIR}/${username}/data/Musiques
sudo mkdir -p ${DATA_DIR}/${username}/data/Livres
sudo mkdir -p "${DATA_DIR}/${username}/data/downloads/"{Films,SeriesTV,Logiciels,Documentaires,Animes,Musiques,Livres}

sudo mkdir -p ${DATA_DIR}/${username}/config/filebrowser
sudo touch ${DATA_DIR}/${username}/config/filebrowser/database.db
sudo mkdir -p "${DATA_DIR}/${username}/config/"{filebrowser,filerun,nextcloud,sabnzbd,pyload,flaresolverr}

sudo mkdir -p ${DATA_DIR}/${username}/config/torrent/custom_plugins
sudo mkdir -p ${DATA_DIR}/${username}/config/torrent/.local/share/rtorrent
sudo mkdir -p ${DATA_DIR}/${username}/config/torrent/run/rtorrent
sudo touch "${DATA_DIR}/${username}/config/filebrowser/database.db"

sudo mkdir -p ${DATA_DIR}/${username}/config/filerun
sudo mkdir -p ${DATA_DIR}/${username}/config/filerun/{html,db}
sudo mkdir -p "${DATA_DIR}/${username}/config/torrent/custom_plugins"
sudo mkdir -p "${DATA_DIR}/${username}/config/torrent/.local/share/rtorrent"
sudo mkdir -p "${DATA_DIR}/${username}/config/torrent/run/rtorrent"

sudo mkdir -p ${DATA_DIR}/${username}/config/nextcloud

sudo mkdir -p ${DATA_DIR}/${username}/config/sabnzbd

sudo mkdir -p ${DATA_DIR}/${username}/config/pyload

sudo mkdir -p ${DATA_DIR}/${username}/config/flaresolverr
sudo mkdir -p "${DATA_DIR}/${username}/config/filerun/"{html,db}

# Apply Rights
echo "Applications des droits spécifiques pour un fonctionnement parfait entre nextcloud et la seedbox"
sudo chown root:root ${DATA_DIR}/${username}
sudo chmod 0770 ${DATA_DIR}/${username}/data
sudo chmod -R 775 ${DATA_DIR}/${username}/data/
sudo chmod 0770 ${DATA_DIR}/${username}/nextcloud
sudo chmod -R 770 ${DATA_DIR}/${username}/nextcloud/
sudo chmod -R 775 ${DATA_DIR}/${username}/config
sudo chown -R $(whoami):www-data ${DATA_DIR}/${username}/data
sudo chown -R $(whoami):www-data ${DATA_DIR}/${username}/nextcloud
sudo chown -R $(whoami):www-data ${DATA_DIR}/${username}/config
sudo chown root:root "${DATA_DIR}/${username}"
sudo chmod 0770 "${DATA_DIR}/${username}/data"
sudo chmod -R 775 "${DATA_DIR}/${username}/data"
sudo chmod 0770 "${DATA_DIR}/${username}/nextcloud"
sudo chmod -R 770 "${DATA_DIR}/${username}/nextcloud"
sudo chmod -R 775 "${DATA_DIR}/${username}/config"
sudo chown -R $(whoami):www-data "${DATA_DIR}/${username}/data"
sudo chown -R $(whoami):www-data "${DATA_DIR}/${username}/nextcloud"
sudo chown -R $(whoami):www-data "${DATA_DIR}/${username}/config"
fi
}

Expand Down
20 changes: 18 additions & 2 deletions seedbox_system.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ getUtils
# End Load Password & UID

# Load Menu
OPTS=`getopt -o a?d:f?h?v?r? --long apps,delete:,help,version,recreate-base-system,stop,start,restart,seedbox:,all-seedbox,delete-data,delete-config,delete-all,first-install,username:,password:,diskSize:,radarr:,lidarr:,sonarr:,medusa:,jackett:,bazarr:,rutorrent:,flood:,filebrowser:,nextcloud:,filerun:,sabnzbd:,pyload:,flaresolverr:,readarr:,vpn,create-client-no-password:,create-client-with-password:,view-all-client,remove-client: -n 'parse-options' -- "$@"`
OPTS=`getopt -o a?d:f?h?v?r? --long apps,delete:,help,version,recreate-base-system,stop,start,restart,recreate,seedbox:,all-seedbox,delete-data,delete-config,delete-all,first-install,username:,password:,diskSize:,radarr:,lidarr:,sonarr:,medusa:,jackett:,bazarr:,rutorrent:,flood:,filebrowser:,nextcloud:,filerun:,sabnzbd:,pyload:,flaresolverr:,readarr:,vpn,create-client-no-password:,create-client-with-password:,view-all-client,remove-client: -n 'parse-options' -- "$@"`
if [ $? != 0 ] ; then echo "Failed parsing options." >&2 ; exit 1 ; fi
eval set -- "$OPTS"

Expand Down Expand Up @@ -208,6 +208,22 @@ while test "$1" != --; do
esac
done
;;
--recreate )
shift 1
while test "$1" != --; do
case "$1" in
--seedbox )
username="$2"
recreateSeedbox
shift 2
;;
* ) echo "Unexpected option: $1 - this should not happen."
showHelp
break
;;
esac
done
;;
-d | --delete )
username="$2"
shift 2
Expand Down Expand Up @@ -302,7 +318,7 @@ while test "$1" != --; do
break
;;
-v | --version )
echo "v5.0"
echo "v5.1"
break
;;
-- ) shift;
Expand Down

0 comments on commit 15be98a

Please sign in to comment.