samien 5 ماه پیش
والد
کامیت
166f73f1e6
5فایلهای تغییر یافته به همراه67 افزوده شده و 17 حذف شده
  1. 4 1
      Dockerfile
  2. 57 15
      README.md
  3. 1 1
      files/supervisor.sh
  4. 5 0
      files/sync-exclude.lst
  5. 0 0
      files/unsync-folders.lst

+ 4 - 1
Dockerfile

@@ -1,14 +1,17 @@
 FROM alpine:latest
 FROM alpine:latest
 ADD files/supervisor.sh /supervisor.sh
 ADD files/supervisor.sh /supervisor.sh
+ADD files/sync-exclude.lst /config/sync-exclude.lst
+ADD files/unsync-folders.lst /config/unsync-folders.lst
 ENV USER ""
 ENV USER ""
 ENV PSWD ""
 ENV PSWD ""
 ENV HOST ""
 ENV HOST ""
-ENV PATHNAME ""
+ENV FNAME ""
 RUN addgroup -g 1000 nextcloud \
 RUN addgroup -g 1000 nextcloud \
     && adduser -G nextcloud -D -u 1000 nextcloud \
     && adduser -G nextcloud -D -u 1000 nextcloud \
     && apk update \
     && apk update \
     && apk add nextcloud-client \
     && apk add nextcloud-client \
     && chmod +x /supervisor.sh \
     && chmod +x /supervisor.sh \
+    && mkdir -p /config \
     && mkdir -p /home/nextcloud/data \
     && mkdir -p /home/nextcloud/data \
     && chown nextcloud:nextcloud /home/nextcloud/data
     && chown nextcloud:nextcloud /home/nextcloud/data
 CMD ["/supervisor.sh"]
 CMD ["/supervisor.sh"]

+ 57 - 15
README.md

@@ -1,9 +1,6 @@
 # Nextcloud client
 # Nextcloud client
 This image provides a Nextcloud client to sync a Docker volume to a Nectcloud location.
 This image provides a Nextcloud client to sync a Docker volume to a Nectcloud location.
 
 
-## Deprecated
-This repo was moved to [GitLab](https://gitlab.com/nilsramsperger/docker-nextcloud-client).
-
 ## Usage
 ## Usage
 To start the container run `docker run -d --init --name nextcloud-client --restart unless-stopped -v nextcloud-data:/home/nextcloud/data -e USER='myuser' -e PSWD='mypswd' -e HOST='https://myhost' nilsramsperger/nextcloud-client`
 To start the container run `docker run -d --init --name nextcloud-client --restart unless-stopped -v nextcloud-data:/home/nextcloud/data -e USER='myuser' -e PSWD='mypswd' -e HOST='https://myhost' nilsramsperger/nextcloud-client`
 The env parameters `USER`, `PSWD` and `HOST` have to be replaced with username, password and host URL of the NextCloud server.
 The env parameters `USER`, `PSWD` and `HOST` have to be replaced with username, password and host URL of the NextCloud server.
@@ -14,15 +11,60 @@ i.e.: `-v image-files:/home/nextcloud/data/image-files`
 
 
 Synchronization is performed every 60 seconds.
 Synchronization is performed every 60 seconds.
 
 
-## FAQ
-### Question
-Existing files on Nextcloud server are not synced to client.
-The docker log tells, that access was denied.
-
-### Answer
-Folders might be created with wrong rights on first sync.
-Tap into the continer by `docker exec -it nextloud ash`.
-Then switch to the Nextcloud folder by `cs /home/nextcloud/data`.
-`ls -Al` should show folders owned by `root:root`.
-Issue a `chown -R nextcloud:nextcloud *` to fix it.
-Then `exit` the container.
+
+
+```
+docker run -d --init --name nextcloud-client --restart unless-stopped -v nextcloud-data:/home/nextcloud/data -e USER='myuser' -e PSWD='mypswd' -e HOST='https://myhost' -e PATH_URL nilsramsperger/nextcloud-client
+```
+
+
+
+
+
+```
+docker run -d --init \
+  --name nextcloud-client-lr \
+  --restart unless-stopped \
+  -v /mnt/NasData/Data/cloud_samien_cn/lr:/home/nextcloud/data \
+  -v /mnt/NasData/Data/docker/nextcloud-client/config:/config \
+  -e USER='samien' \
+  -e PSWD='1278852633' \
+  -e HOST='http://192.168.153.5/' \
+  nextcloud-client
+```
+
+参数说明:
+
+USER:用户名
+
+PSWD:密码
+
+HOST:网址路径
+
+FNAME:子目录路径
+
+
+
+配置文件路径
+
+过滤文件:
+
+/config/sync-exclude.lst
+
+```
+~*.tmp
+._*
+]Thumbs.db
+]photothumb.db
+System Volume Information
+```
+
+不同步目录列表:
+
+/config/unsync-folders.lst
+
+```
+/Tools
+/Backups
+```
+

+ 1 - 1
files/supervisor.sh

@@ -13,7 +13,7 @@ while true
 do
 do
     echo "Start sync"
     echo "Start sync"
     chown -R nextcloud:nextcloud /home/nextcloud/data
     chown -R nextcloud:nextcloud /home/nextcloud/data
-    /bin/su -s /bin/ash nextcloud -c "nextcloudcmd --non-interactive --unsyncedfolders '/home/nextcloud/exclude/exclude/unsync' --path '$PATHNAME'  -u '$USER' -p '$PSWD' /home/nextcloud/data '$HOST'"
+    /bin/su -s /bin/ash nextcloud -c "nextcloudcmd --non-interactive --unsyncedfolders '/config/unsync-folders.lst' --exclude '/config/sync-exclude.lst' --path '$FNAME'  -u '$USER' -p '$PSWD' /home/nextcloud/data '$HOST'"
     echo "Sync done"
     echo "Sync done"
     sleep 60
     sleep 60
 done
 done

+ 5 - 0
files/sync-exclude.lst

@@ -0,0 +1,5 @@
+~*.tmp
+._*
+]Thumbs.db
+]photothumb.db
+System Volume Information

+ 0 - 0
files/unsync-folders.lst


粤ICP备19079148号