Skip to content

Commit 224d28c

Browse files
committed
add support for service serve to run rclone serve
It is specially desigend to serve a local dir mounted by `rclone mount`. Related environment variables: `RCLONE_SERVE_MODE` `RCLONE_SERVE_ARGS`
1 parent 1ac0d59 commit 224d28c

File tree

5 files changed

+15
-1
lines changed

5 files changed

+15
-1
lines changed

.github/workflows/buildx.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ jobs:
7070
.
7171
VER=$(docker run --rm --entrypoint=/usr/bin/rclone ${{ env.IMAGE_NAME }}:testing version | head -n1 | cut -f2 -d'v')
7272
echo "APP_VER=$VER" >> $GITHUB_ENV
73-
echo ::set-output name=github_desc::$(curl -sX GET https://api.github.com/repos/${GITHUB_REPOSITORY} | jq -r .description)
7473
-
7574
name: Login to docker.io
7675
if: env.X_SKIP == 'false'

root/etc/s6-overlay/s6-rc.d/cron/dependencies.d/serve

Whitespace-only changes.

root/etc/s6-overlay/s6-rc.d/serve/dependencies.d/mount

Whitespace-only changes.

root/etc/s6-overlay/s6-rc.d/serve/run

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/usr/bin/with-contenv bash
2+
. /usr/local/bin/variables
3+
4+
case "$RCLONE_SERVE_MODE" in
5+
dlna|docker|ftp|http|restic|sftp|webdav)
6+
;;
7+
*)
8+
s6-svc -d . && exit 0
9+
;;
10+
esac
11+
12+
serve_command="rclone serve $RCLONE_SERVE_MODE ${rclone_mountpoint} ${RCLONE_SERVE_ARGS:---use-mmap --addr=:5678}"
13+
echo "*** serving => $serve_command"
14+
exec s6-setuidgid abc $serve_command
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
longrun

0 commit comments

Comments
 (0)