소스 검색

add baidu pan

orbitzs 3 년 전
부모
커밋
ac640e0c5e

+ 5 - 0
baidu/.env

@@ -0,0 +1,5 @@
+CONTAINER_NAME=baidupan
+BAIDU_USERDAT=./baidu_yun/user
+BAIDU_DATAPATH=./baidu_yun/download
+
+

+ 1 - 0
baidu/.gitignore

@@ -0,0 +1 @@
+baidu_yun

+ 46 - 0
baidu/baidunetdisk_docker/Dockerfile

@@ -0,0 +1,46 @@
+FROM ubuntu:bionic
+
+RUN apt update && \
+    apt install -y libnss3 libgtk-3-0 libx11-xcb1 libxss1 libasound2 desktop-file-utils && \
+    apt install -y fonts-droid-fallback && \
+    apt clean && rm -rf /var/lib/apt/lists/*
+
+#ARG BAIDUNETDISK_URL="http://wppkg.baidupcs.com/issue/netdisk/LinuxGuanjia/3.0.1/baidunetdisk_linux_3.0.1.2.deb"
+#ARG BAIDUNETDISK_URL="https://issuepcdn.baidupcs.com/issue/netdisk/LinuxGuanjia/4.3.0/baidunetdisk_4.3.0_amd64.deb"
+#RUN apt update && apt install -y  wget && \
+#    cd /tmp && wget $BAIDUNETDISK_URL && dpkg -i baidunetdisk_linux_*.deb && rm baidunetdisk_linux_*.deb && \
+#    apt remove -y wget && apt autoremove -y && apt clean && rm -rf /var/lib/apt/lists/*
+
+
+RUN apt update \
+    && apt install -y --no-install-recommends --allow-unauthenticated \
+    	libnotify4 xdg-utils libsecret-1-0 
+
+COPY fs/baidunetdisk_4.3.0_amd64.deb /tmp/
+RUN cd /tmp && dpkg -i baidunetdisk_4.3.0_amd64.deb && rm baidunetdisk_4.3.0_amd64.deb
+
+
+
+ARG NOVNC=/opt/noVNC
+RUN apt update && apt install -y wget git && \
+    export DEBIAN_FRONTEND=noninteractive && apt install -y vnc4server xfce4 python3 firefox xfce4-terminal mousepad && \
+    git clone --depth 1 https://github.com/novnc/noVNC.git $NOVNC && \
+    git clone --depth 1 https://github.com/novnc/websockify.git $NOVNC/utils/websockify && \
+    find ${NOVNC} -name ".git*" | xargs rm -rf && \
+    ln -s /usr/bin/python3 /usr/bin/python && \
+    ln -s $NOVNC/vnc.html $NOVNC/index.html && \
+    touch /root/.Xauthority && \
+    apt remove -y wget git && apt autoremove -y && apt clean && rm -rf /var/lib/apt/lists/*
+
+# COPY vnc /root/.vnc
+COPY fs/*.desktop /root/Desktop/
+COPY fs/baidunetdisk.desktop /root/Desktop/
+COPY fs/readme.1st /root/Desktop/
+
+ARG VNC_PASSWORD=12345678
+COPY xstartup /root/.vnc/
+RUN printf "${VNC_PASSWORD}\n${VNC_PASSWORD}\n\n" | vncpasswd
+
+COPY baidunetdisk_entrypoint.sh /
+ENTRYPOINT ["/baidunetdisk_entrypoint.sh"]
+

+ 20 - 0
baidu/baidunetdisk_docker/README.md

@@ -0,0 +1,20 @@
+# Baidu NetDisk Docker
+
+## Introduction
+Baidu has provide a NetDisk client for Linux (https://pan.baidu.com/download#pan). However, it only works on ubuntu 18.04 or newer. To get it work on 16.04 or older, this repo share a docker image. Additionally, the UI is based on VNC (noVNC), so you can access it through any VNC client or browser.
+
+## Usage
+
+Try with the following command:
+```bash
+docker run -p 5901:5901 -p 6080:6080 /dir/to/user/data:/root/baidunetdisk -v /dir/to/download/data:/root/baidunetdiskdownload dawnos/baidunetdisk
+```
+
+Please replace the paths `/dir/to/user/data` and `/dir/to/download/data` to the paths you want to store your user data and downloaded files. An example is
+```bash
+docker run -p 5901:5901 -p 6080:6080 -v ${HOME}/baidunetdisk:/root/baidunetdisk -v ${HOME}/baidunetdiskdownload:/root/baidunetdiskdownload dawnos/baidunetdisk
+```
+
+Then you can access Baidu Netdisk through:
+- VNC client on `localhost:5901`, or
+- http://localhost:6080 in browser.

+ 15 - 0
baidu/baidunetdisk_docker/baidunetdisk_entrypoint.sh

@@ -0,0 +1,15 @@
+#!/bin/sh
+
+# TODO: change permission more elegant
+chmod a+rwx /root/baidunetdisk
+#chmod a+rwx /root/baidunetdiskdownload
+#chmod a+rwx /root/Downloads
+
+/usr/bin/vncserver -geometry 1600x1200 2>&1
+/opt/noVNC/utils/novnc_proxy --vnc localhost:5901 2>&1 &
+echo "Access through VNC (5091) or browser (localhost:6080) using password: 12345678."
+DISPLAY=:1 /opt/baidunetdisk/baidunetdisk --no-sandbox 2>&1
+#DISPLAY=:1 /opt/baidunetdisk/baidunetdisk --type=renderer --no-sandbox --enable-features=WebComponentsV0Enabled --disable-features=SpareRendererForSitePerProcess --lang=en-US --app-path=/opt/baidunetdisk/resources/app.asar --node-integration --node-integration-in-worker --webview-tag --no-sandbox --no-zygote --enable-remote-module --background-color=#F6F6F6 --enable-spellcheck --enable-websql --num-raster-threads=4 --enable-main-frame-before-activation --renderer-client-id=5 --no-v8-untrusted-code-mitigations --shared-files=v8_snapshot_data:100 2>&1
+
+exit 0
+

+ 10 - 0
baidu/baidunetdisk_docker/fs/Firefox Web Browser.desktop

@@ -0,0 +1,10 @@
+[Desktop Entry]
+Version=1.0
+Type=Application
+Name=Firefox Web Browser
+Comment=Browse the World Wide Web
+Exec=firefox %u
+Icon=firefox
+Path=
+Terminal=false
+StartupNotify=true

+ 10 - 0
baidu/baidunetdisk_docker/fs/baidunetdisk.desktop

@@ -0,0 +1,10 @@
+[Desktop Entry]
+Version=1.0
+Type=Application
+Name=baidunetdisk
+Comment=百度网盘
+Exec=/opt/baidunetdisk/baidunetdisk --no-sandbox %U
+Icon=baidunetdisk
+Path=
+Terminal=false
+StartupNotify=false

BIN
baidu/baidunetdisk_docker/fs/baidunetdisk_4.3.0_amd64.deb


+ 3 - 0
baidu/baidunetdisk_docker/fs/readme.1st

@@ -0,0 +1,3 @@
+after logged into baidupan, open this link to access folders shared by others.
+
+https://pan.baidu.com/mbox/homepage#share

+ 10 - 0
baidu/baidunetdisk_docker/fs/xfce4-terminal.desktop

@@ -0,0 +1,10 @@
+[Desktop Entry]
+Version=1.0
+Type=Application
+Name=xfce4-terminal
+Comment=
+Exec=xfce4-terminal
+Icon=utilities-terminal
+Path=
+Terminal=false
+StartupNotify=false

+ 15 - 0
baidu/baidunetdisk_docker/run.sh

@@ -0,0 +1,15 @@
+#!/usr/bin/env bash
+
+# Default directories
+USERDATA_DIR=$HOME/baidunetdisk
+DOWNLOAD_DIR=$HOME/baidunetdiskdownload
+
+if [ $# != 2 ] ; then
+  echo "Directories for user data and download not provided. Using default directories."
+else
+  USERDATA_DIR=$1
+  DOWNLOAD_DIR=$2
+fi
+
+docker run --rm ${DISPLAY_CONF} -p 5906:5901 -p 6080:6080 -v ${USERDATA_DIR}:/root/baidunetdisk -v ${DOWNLOAD_DIR}:/root/baidunetdiskdownload dawnos/baidunetdisk
+

+ 1 - 0
baidu/baidunetdisk_docker/vnc/passwd

@@ -0,0 +1 @@
+נה1dצ�דs

+ 24 - 0
baidu/baidunetdisk_docker/xstartup

@@ -0,0 +1,24 @@
+#!/bin/sh
+
+xhost +
+
+# SESSION_MANAGER is inherited from the environment and some window
+# managers require that it be cleared.
+# http://osdir.com/ml/gnome.ximian.snapshots/2002-09/msg00034.html
+# For example, Xfce4 version 4.6.1 and Deb5-64 require the unsetenv.
+# Goolging indicates that others also require the unsetenv.
+unsetenv SESSION_MANAGER
+
+# Startup scripts, e.g. /etc/xdg/xfce4/xinitrc require
+# http://en.wikipedia.org/wiki/D-Bus to run correctly.
+unsetenv DBUS_SESSION_BUS_ADDRESS
+
+
+# Set VNCSESSION to tell /etc/xdg/xfce4/xinitrc to not run xscreensaver
+# http://vstone.eu/2009/04/disabling-xscreensaver-when-using-xfce-vnc/
+setenv VNCSESSION yes
+
+startxfce4 &
+
+# Make sure that copy / paste are correctly forwarded to the VNC viewer
+vncconfig -nowin &

+ 14 - 0
baidu/docker-compose.yml

@@ -0,0 +1,14 @@
+version: "2.1"
+services:
+  baidupan:
+    image: hubreg.algometic.com/baidupan:0.2 
+#    image: baidupan:0.2 
+    container_name: ${CONTAINER_NAME} 
+    volumes:
+      - ${BAIDU_USERDAT}/data:/root/baidunetdisk
+      - ${BAIDU_DATAPATH}/data:/root/Downloads
+    ports:
+      - 5941:5901
+      - 6081:6080
+    restart: "no" 
+

+ 17 - 0
mosh/docker-compose.yml

@@ -0,0 +1,17 @@
+version: "2.1"
+services:
+ 
+ httpd:
+    image: dperson/torproxy 
+    container_name: ${CONTAINER_NAME} 
+    ports:
+      - 8118:8118
+    environment:
+      - TZ:${TZ}
+      - BW:${BW}    
+    restart: "no" 
+    network_mode: none
+
+
+     
+