├── Dockerfile ├── start.sh └── README.md /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM i386/alpine 2 | 3 | # Install required packages 4 | RUN apk --update --no-cache add xvfb x11vnc openbox samba-winbind-clients 5 | RUN echo "https://dl-4.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories && \ 6 | apk --no-cache add wine 7 | 8 | # Configure the virtual display port 9 | ENV DISPLAY :0 10 | 11 | # Expose the vnc port 12 | EXPOSE 5900 13 | 14 | # Configure the wine prefix location 15 | RUN mkdir /wine 16 | ENV WINEPREFIX /wine/ 17 | 18 | # Disable wine debug messages 19 | ENV WINEDEBUG -all 20 | 21 | # Configure wine to run without mono or gecko as they are not required 22 | ENV WINEDLLOVERRIDES mscoree,mshtml= 23 | 24 | # Set the wine computer name 25 | ENV COMPUTER_NAME bz-docker 26 | 27 | # Create the data Directory 28 | RUN mkdir /data 29 | 30 | # Copy the start script to the container 31 | COPY start.sh /start.sh 32 | 33 | # Set the start script as entrypoint 34 | ENTRYPOINT ./start.sh 35 | -------------------------------------------------------------------------------- /start.sh: -------------------------------------------------------------------------------- 1 | echo "Starting the virtual display & vnc server" 2 | rm -f /tmp/.X0-lock 3 | Xvfb :0 -screen 0 1024x768x24 & openbox & x11vnc -nopw -q -forever -loop -shared & 4 | 5 | function configure_wine { 6 | unlink $WINEPREFIX/dosdevices/z: 7 | ln -s /data/ $WINEPREFIX/dosdevices/d: 8 | 9 | 10 | if [ ${#COMPUTER_NAME} -gt 15 ]; then 11 | echo "Error: computer name cannot be longer than 15 characters" 12 | exit 1 13 | fi 14 | echo "Setting the wine computer name" 15 | wine reg add "HKCU\\SOFTWARE\\Wine\\Network\\" /v UseDnsComputerName /f /d N 16 | wine reg add "HKLM\\SYSTEM\\CurrentControlSet\\Control\\ComputerName\\ComputerName" /v ComputerName /f /d $COMPUTER_NAME 17 | wine reg add "HKLM\\SYSTEM\\CurrentControlSet\\Control\\ComputerName\\ActiveComputerName" /v ComputerName /f /d $COMPUTER_NAME 18 | } 19 | 20 | cp $WINEPREFIX/drive_c/Program\ Files/Backblaze/bzbui.exe.aside $WINEPREFIX/drive_c/Program\ Files/Backblaze/bzbui.exe 21 | until [ -f $WINEPREFIX/drive_c/Program\ Files/Backblaze/bzbui.exe ]; do 22 | echo "Backblaze not installed" 23 | echo "Initializing the wine prefix" 24 | wine wineboot -i -u 25 | configure_wine 26 | echo "Downloading the Backblaze personal installer..." 27 | wget https://www.backblaze.com/win32/install_backblaze.exe -P /wine/drive_c/ 28 | echo "Backblaze installer started, please go through the graphical setup in by logging onto the containers vnc server" 29 | wine $WINEPREFIX/drive_c/install_backblaze.exe 30 | echo "Installation finished or aborted, trying to start the Backblaze client..." 31 | wineserver -k 32 | done 33 | 34 | 35 | if [ -f $WINEPREFIX/drive_c/Program\ Files/Backblaze/bzbui.exe ]; then 36 | configure_wine 37 | echo "Backblaze found, starting the Backblaze client..." 38 | wine $WINEPREFIX/drive_c/Program\ Files/Backblaze/bzbui.exe -noqiet 39 | fi 40 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # backblaze-personal-wine 2 | 3 | Looking for a (relatively) easy way to backup your personal linux system via Backblaze Personal unlimited? 4 | Then look no further, this container automatically creates a tiny Wine prefix that runs the Backblaze personal client to backup any mounted directory in your linux filesystem. 5 | Please note, Linux specific file attributes (like ownership, acls or permissions) will not be backed up; 6 | 7 | ## Option 1: Docker compose example using a HTML based noVNC client (recommended) 8 |
9 | Click to expand! 10 | 11 | This example includes an html based VNC client (noVNC) that you can open in your browser, 12 | ``` 13 | version: "2.2" 14 | services: 15 | # Backblaze Personal 16 | backblaze-personal-wine: 17 | image: tom300z/backblaze-personal-wine 18 | container_name: backblaze-personal-wine 19 | init: true 20 | volumes: 21 | - /opt/docker/backblaze-personal-wine:/wine/ # The location to store the backblaze Wine prefix in 22 | - /my/important/photos:/data/photos # All directories that should be backed up should be mounted under the "/data/" directory 23 | - /my/important/spreadsheets:/data/spreadsheets 24 | networks: 25 | backup-net: 26 | 27 | # Backblaze Personal vnc client 28 | backblaze-novnc: 29 | image: dougw/novnc 30 | container_name: backblaze-novnc 31 | networks: 32 | backup-net: 33 | environment: 34 | - REMOTE_HOST=backblaze-personal-wine # This must be the container_name of the backblaze-personal-wine container 35 | - REMOTE_PORT=5900 36 | restart: unless-stopped 37 | ports: 38 | - 80:8081 # Exposes the client to http port 80. You may use any port here (e.g.: if you have a reverse proxy) 39 | 40 | # This part is important, don't forget it! 41 | networks: 42 | backup-net: 43 | driver: bridge 44 | ``` 45 | ### Security 46 | The noVNC only serves a HTTP connection by default, please make sure to configure your firewall to only allow local connections in that case. 47 | 48 | firewalld example: 49 | ``` 50 | firewall-cmd --permanent --add-rich-rule "rule family="ipv4" source address="192.168.178.0/24" port port="80" protocol="tcp" accept" 51 | firewall-cmd --reload 52 | ``` 53 | 54 | If you want to access the noVNC webpage from outside it is recommended to use a tls reverse proxy like traefik or nginx. 55 | 56 | 57 | ### Connecting to the VNC Server 58 | You can open the noVNC client in your browser (make sure your firewall allows acess to the port): 59 | address: http://your.linux.ip.address:80/vnc.html 60 |

61 | 62 | 63 | ## Option 2: Docker compose example (standalone) 64 |
65 | Click to expand! 66 | 67 | ``` 68 | version: "2.2" 69 | services: 70 | # Backblaze Personal 71 | backblaze-personal-wine: 72 | image: tom300z/backblaze-personal-wine 73 | container_name: backblaze-personal-wine 74 | init: true 75 | volumes: 76 | - /opt/docker/backblaze-personal-wine:/wine/ # The location to store the backblaze Wine prefix in 77 | - /my/important/photos:/data/photos # All directories that should be backed up should be mounted under the "/data/" directory 78 | - /my/important/spreadsheets:/data/spreadsheets 79 | ports: 80 | - 25900:5900 # Expose the (unencrypted) VNC server to the host make sure to only allow local connections to the server. This can be removed after the initial installation and backup phase. 81 | ``` 82 | 83 | ### Security 84 | The server runs an unencrypted integrated VNC server. 85 | If you need to connect to the vnc server from a different machine (on headless systems), please make sure to configure your firewall to only allow local connections to the VNC. 86 | firewalld example: 87 | ``` 88 | firewall-cmd --permanent --add-rich-rule "rule family="ipv4" source address="192.168.178.0/24" port port="25900" protocol="tcp" accept" 89 | firewall-cmd --reload 90 | ``` 91 | 92 | ### Connecting to the VNC Server 93 | To go through the setup process you must connect to the integrated vnc server via a client like RealVNC Client. 94 | address: your.linux.ip.address:25900 95 | user: none (admin) 96 | password: none 97 |

98 | 99 | ## Setup guide 100 | 101 | 102 | ### Step 1: Installation 103 | When starting the container for the first time, it will automatically initialize a new Wine prefix and download & run the backblaze installer. 104 | 105 | When you only see a black screen once you are connected press alt-tab to activate the installer window. 106 | The installer might look a bit weird (all white) at the very beginning. Just enter your backblaze account email into the white box and hit enter, then the you should see the rest of the ui. 107 | Enter your password and hit "Install", the installer will start scanning your drive. 108 | 109 | ### Step 2: Configuration 110 | Once the Installer is finished the backblaze client should open automatically. 111 | 112 | You will notice that currently only around 10 files are backed up. 113 | To change that click the Settings button and check the box for the "D:" drive, this drive corresponds to the /data/ directory of your container. 114 | You can also set a better name for your backup here, by default the rather obscure container id is used. 115 | I'd also reccommend to remove the blacklisted file extensions from the "Exclusions" tab. 116 | 117 | Once you hit "Ok" or "Apply" the client will start scanning your drives again, this might take a very long time depending on the number of files you mounted under the /data/ dir, just be patient and leave the container running. 118 | You can dis- and reconnect from and to the VNC server at any time, this will not affect the Backblaze client. 119 | 120 | When the analysis is complete make shoure the client performs the initial backup (this should happen automatically). 121 | Depending on the number and size of the files you want to back up and your upload speed, this will take quite some time. 122 | If you have to stop the container during the initial backup the backup will continue where it left once the container is started again. 123 | 124 | Backblaze is now configured to automatically backup your linux files, to check the progress or change settings use the VNC Server. 125 | --------------------------------------------------------------------------------