Implement upload/download limits, disable_verify_certificates config keys
This commit is contained in:
@@ -17,10 +17,34 @@
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
# Check mandatory Seafile configuration have been properly set.
|
||||
if [ -z $SEAF_SERVER_URL ]; then echo "The \$SEAF_SERVER_URL was not defined. Stopping container..."; exit 1; fi
|
||||
if [ -z $SEAF_USERNAME ]; then echo "The \$SEAF_USERNAME was not defined. Stopping container..."; exit 1; fi
|
||||
if [ -z $SEAF_PASSWORD ]; then echo "The \$SEAF_PASSWORD was not defined. Stopping container..."; exit 1; fi
|
||||
if [ -z $SEAF_LIBRARY_UUID ]; then echo "The \$SEAF_LIBRARY_UUID was not defined. Stopping container..."; exit 1; fi
|
||||
if [ -z $SEAF_SERVER_URL ]; then
|
||||
echo "The \$SEAF_SERVER_URL is not defined. Stopping container..."
|
||||
exit 1
|
||||
fi
|
||||
if [ -z $SEAF_USERNAME ]; then
|
||||
echo "The \$SEAF_USERNAME is not defined. Stopping container..."
|
||||
exit 1
|
||||
fi
|
||||
if [ -z $SEAF_PASSWORD ]; then
|
||||
echo "The \$SEAF_PASSWORD is not defined. Stopping container..."
|
||||
exit 1
|
||||
fi
|
||||
if [ -z $SEAF_LIBRARY_UUID ]; then
|
||||
echo "The \$SEAF_LIBRARY_UUID is not defined. Stopping container..."
|
||||
exit 1
|
||||
fi
|
||||
if [ -n "$SEAF_UPLOAD_LIMIT" ]
|
||||
&& [[ $SEAF_UPLOAD_LIMIT =~ ^[0-9]+$ ]]
|
||||
&& [ "$SEAF_UPLOAD_LIMIT" -gt 0 ]; then
|
||||
echo "The \$SEAF_UPLOAD_LIMIT is not an integer greater than 0. Stopping container..."
|
||||
exit 1
|
||||
fi
|
||||
if [ -n "$SEAF_DOWNLOAD_LIMIT" ]
|
||||
&& [[ $SEAF_DOWNLOAD_LIMIT =~ ^[0-9]+$ ]]
|
||||
&& [ "$SEAF_DOWNLOAD_LIMIT" -gt 0 ]; then
|
||||
echo "The \$SEAF_DOWNLOAD_LIMIT is not an integer greater than 0. Stopping container..."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Update the user ID, if the $UID changed.
|
||||
if [ "$UID" != "1000" ]; then
|
||||
@@ -49,6 +73,9 @@ su - $UNAME << EO
|
||||
export SEAF_USERNAME=$SEAF_USERNAME
|
||||
export SEAF_PASSWORD=$SEAF_PASSWORD
|
||||
export SEAF_LIBRARY_UUID=$SEAF_LIBRARY_UUID
|
||||
export SEAF_SKIP_SSL_CERT=$SEAF_SKIP_SSL_CERT
|
||||
test -n "$SEAF_UPLOAD_LIMIT" && export SEAF_UPLOAD_LIMIT=$SEAF_UPLOAD_LIMIT
|
||||
test -n "$SEAF_DOWNLOAD_LIMIT" && export SEAF_DOWNLOAD_LIMIT=$SEAF_DOWNLOAD_LIMIT
|
||||
export UNAME=$UNAME
|
||||
/bin/bash /home/seafuser/entrypoint.sh
|
||||
EO
|
||||
|
||||
Reference in New Issue
Block a user