Skip to content

Commit

Permalink
Merge pull request #193 from cyb3rgh05t/master
Browse files Browse the repository at this point in the history
  • Loading branch information
fscorrupt authored Jan 14, 2025
2 parents bd51763 + 09e60cb commit a95fd8b
Show file tree
Hide file tree
Showing 15 changed files with 163 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .templates/mod/docker-mod-storagecheck.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#!/bin/bash
####################################
# All rights reserved. #
# started from Zero #
# Docker owned dockserver #
# Docker Maintainer dockserver #
#####################################
#####################################
# THIS DOCKER IS UNDER LICENSE #
# NO CUSTOMIZING IS ALLOWED #
# NO REBRANDING IS ALLOWED #
# NO CODE MIRRORING IS ALLOWED #
#####################################
# shellcheck disable=SC2086
# shellcheck disable=SC2046

FOLDER=$1
APP=$2
USERNAME=$3
TOKEN=$4

### APP SETTINGS ###

PICTURE="./images/$APP.png"
APPFOLDER="./$FOLDER/$APP"

### RELEASE SETTINGS ###

echo '{
"appname": "'${APP}'",
"apppic": "'${PICTURE}'",
"appfolder": "./'$FOLDER'/'$APP'",
"user": "github-actions[bot]"
}' > "./$FOLDER/$APP/release.json"

### DOCKER BUILD ###
### GENERATE Dockerfile based on release.json

echo '## This file is automatically generated (based on release.json)
##
## Do not changes any lines here
##
FROM scratch
COPY '"${APPFOLDER}"'/root/ /
##EOF' > ./$FOLDER/$APP/Dockerfile
8 changes: 8 additions & 0 deletions container.json
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,14 @@ mod docker-mod-healthcheck
"user": "github-actions[bot]"
}

mod docker-mod-storagecheck
{
"appname": "docker-mod-storagecheck",
"apppic": "./images/docker-mount.png",
"appfolder": "./mod/docker-mod-storagecheck",
"user": "github-actions[bot]"
}

mod docker-mod-nzbget
{
"appname": "docker-mod-nzbget",
Expand Down
7 changes: 7 additions & 0 deletions mod/docker-mod-storagecheck/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
## This file is automatically generated (based on release.json)
##
## Do not changes any lines here
##
FROM scratch
COPY ./mod/docker-mod-storagecheck/root/ /
##EOF
6 changes: 6 additions & 0 deletions mod/docker-mod-storagecheck/release.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"appname": "docker-mod-storagecheck",
"apppic": "./images/docker-mount.png",
"appfolder": "./mod/docker-mod-storagecheck",
"user": "github-actions[bot]"
}
15 changes: 15 additions & 0 deletions mod/docker-mod-storagecheck/root/donate.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
----------------------------------------------------

____ _
| _ \ ___ ___| | _____ ___ _ ____ _____ _ __
| | | |/ _ \ / __| |/ / __|/ _ \ '__\ \ / / _ \ '__|
| |_| | (_) | (__| <\__ \ __/ | \ V / __/ |
|____/ \___/ \___|_|\_\___/\___|_| \_/ \___|_|


----------------------------------------------------

To support the projects visit:

https://dockserver.io/
----------------------------------------------------
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/usr/bin/with-contenv bash
# shellcheck shell=bash
#####################################
# All rights reserved. #
# started from Zero #
# Docker owned dockserver #
# Docker Maintainer dockserver #
#####################################
# THIS DOCKER IS UNDER LICENSE #
# NO CUSTOMIZING IS ALLOWED #
# NO REBRANDING IS ALLOWED #
# NO CODE MIRRORING IS ALLOWED #
#####################################

STORAGECHECK="/mnt/unionfs/.storagecheck/test"
STORAGECHECK2="/mnt/unionfs/.storagecheck/test2"
APP="${HOSTNAME^}"

function log() {
GRAY="\033[0;37m"
BLUE="\033[0;34m"
NC="\033[0m"
$(which echo) -e "${GRAY}[$($(which date) +'%Y/%m/%d %H:%M:%S')]${BLUE} [${APP}]${NC} ${1}"
}

log "-> Checking for Storage Mounts ... <-"

while [[ ! -f "${STORAGECHECK}" || ! -f "${STORAGECHECK2}" ]]; do
log "-> Waiting for Storage Mounts ... <-" && sleep 10
done

log "-> Storage Mounts online ! | Starting ${APP} ... <-"
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
oneshot
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/etc/s6-overlay/s6-rc.d/init-mod-universal-mount/run
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/usr/bin/with-contenv bash
# shellcheck shell=bash
#####################################
# All rights reserved. #
# started from Zero #
# Docker owned dockserver #
# Docker Maintainer dockserver #
#####################################
# THIS DOCKER IS UNDER LICENSE #
# NO CUSTOMIZING IS ALLOWED #
# NO REBRANDING IS ALLOWED #
# NO CODE MIRRORING IS ALLOWED #
#####################################

STORAGECHECK="/mnt/unionfs/.storagecheck/test"
STORAGECHECK2="/mnt/unionfs/.storagecheck/test2"
APP="${HOSTNAME^}"

function log() {
GRAY="\033[0;37m"
BLUE="\033[0;34m"
NC="\033[0m"
$(which echo) -e "${GRAY}[$($(which date) +'%Y/%m/%d %H:%M:%S')]${BLUE} [${APP}]${NC} ${1}"
}

while true; do
if [[ ! -f "${STORAGECHECK}" || ! -f "${STORAGECHECK2}" ]]; then
log "-> One or more Storage Mounts offline ! | Stopping ${APP} ... <-"
mapfile -t "SERVICES" < <($(which ls) /var/run/service/ | $(which grep) -Ewiv "s6-linux-init-shutdownd|s6rc-fdholder|s6rc-oneshot-runner|svc-cron|svc-mod-universal-storagecheck")
for SERVICE in ${SERVICES[@]}; do
s6-svc -d /var/run/service/${SERVICE}
while [[ ! -f "${STORAGECHECK}" || ! -f "${STORAGECHECK2}" ]]; do
$(which sleep) 30
done
s6-svc -u /var/run/service/${SERVICE}
done
log "-> Storage Mounts online again ! | Starting ${APP} ...<-"
fi
$(which sleep) 120
log "-> Checking for Storage Mounts ... <-"

while [[ ! -f "${STORAGECHECK}" || ! -f "${STORAGECHECK2}" ]]; do
log "-> Waiting for Storage Mounts ... <-" && sleep 10
done

log "-> Storage Mounts online ! | Starting ${APP} ... <-"
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
longrun

0 comments on commit a95fd8b

Please sign in to comment.