Improve stability options

* Update Dockerfile by removing lefovers
* Treat  symbolic links as files, Ref: https://lftp.yar.ru/lftp-man.html
* Keep in sync with fork source via GitHub Action
* Update entrypoint.sh: more stable connections (more retries, longer timeout), only loading newer files (-n), loading symbolic links as files (-L) as well as specifically excluding the git directory (-x ^.git/$)

(Co-)authored-by: Tomasz Trębski <kornicameister@gmail.com>
This commit is contained in:
Tim Bernhard 2020-08-24 17:11:33 +02:00 committed by GitHub
parent b93ea89a8e
commit ba35a37f8c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 12 deletions

14
.github/workflows/fork.yml vendored Normal file
View File

@ -0,0 +1,14 @@
---
name: fork
"on":
schedule:
- cron: "*/30 * * * *"
jobs:
sync:
runs-on: ubuntu-latest
steps:
- uses: TG908/fork-sync@v1.1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

View File

@ -1,10 +1,11 @@
FROM alpine:3.11
WORKDIR /
COPY LICENSE README.md /
# RUN apk --no-cache add lftp
RUN apk --no-cache add ncftp
RUN apk --no-cache add \
lftp=4.8.4-r2
COPY entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]

View File

@ -1,17 +1,13 @@
#!/bin/sh -l
# lftp $INPUT_HOST -u $INPUT_USER,$INPUT_PASSWORD -e "set ftp:ssl-force $INPUT_FORCESSL; set ssl:verify-certificate false; mirror --reverse --continue --dereference --verbose=3 -P -x ^\.git/$ $INPUT_LOCALDIR $INPUT_REMOTEDIR; quit"
lftp -e "
set net:timeout 5;
set net:max-retries 3;
set net:reconnect-interval-multiplier 1;
lftp ${INPUT_HOST} -u ${INPUT_USER},${INPUT_PASSWORD} -e "
set net:timeout 60;
set net:max-retries 20;
set net:reconnect-interval-multiplier 2;
set net:reconnect-interval-base 5;
set ftp:ssl-force $INPUT_FORCESSL;
set sftp:auto-confirm yes;
set ssl:verify-certificate $INPUT_FORCESSL;
open $INPUT_HOST
user $INPUT_USER $INPUT_PASSWORD
mirror -v -P 5 -R $INPUT_LOCALDIR $INPUT_REMOTEDIR;
mirror -v -P 5 -R -n -L -x ^\.git/$ $INPUT_LOCALDIR $INPUT_REMOTEDIR;
quit
"