The latest 2023 Wanke cloud flash armbian, deploy docker and configure various common container images

#以下安装从基于
root@onecloud:~# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.2 LTS
Release:        22.04
Codename:       jammy

Flashing starts

(Part of the information of the following flashing tutorial comes from: Wanke Cloud Flashing ARMBIAN System, Installing DOCKER, PORTAINER, HOME ASSISTANT and QBITTORRENT Tutorial-HEU8 ) The tutorial provided by the original website requires you to flash the system to the U disk first, and then transfer the system of the U disk to emmc, but the image I provide below does not require this operation, please pay attention to the distinction.

Tools used:

  1. A double-ended USB cable (buy it or make it yourself, there are tutorials online);

  2. One computer;

  3. Tweezers or pins (or other conductive objects for shorting the motherboard);

  4. Screwdriver, hair dryer (heating the adhesive backing makes it easier to remove);

  5. A USB flash drive (useful for flashing and expanding Wanke cloud hard drive capacity);

  6. The resources in the links below can be downloaded for later use.

    #Mirror address: https://www.aliyundrive.com/s/NXjbaKC3Hyq
    Extraction code: 5i7a

    #Writing package tool: https://pan.baidu.com/s/1BNwv61YDj3b4r3IjmJjheA

    Extraction code: 6666

Disassembly tutorial

For the disassembly part, you can directly refer to the video shared by Powersee, which is more intuitive.

https://www.bilibili.com/video/BV1sU4y1s7Yu?spm_id_from=333.999.0.0

img

After prying it open, use a screwdriver to remove the screws and then take out the motherboard.

Flashing process

After the motherboard is removed, one end of the double-ended USB cable is connected to the computer, and the other end is plugged into the USB port near the HDMI side for power backup.

1. Flash the system image

Open the USB_Burning_Tool on the computer, select the image Armbian_23.02.0-trunk_Onecloud_jammy_edge_6.1.9_minimal.burn.img, and click Start (the following pictures are from the Internet, the image names are different, the ones I sent shall prevail).

img

Wanke Cloud motherboards are divided into different motherboard models according to the time of purchase of Wanke Cloud. Here is the 1.0 version. For the short-circuiting methods of other versions, please see below:

https://powersee.github.io/2021/01/wankeyun-server/

img

When short-circuiting here, turn on the power of Wanke Cloud (it is recommended to use a socket with a switch, or ask someone to help you plug in the power, otherwise the short-circuit operation will not be easy).

img

After the short circuit is successful, the system recognizes that Wanke Cloud will automatically start flashing the phone. After the flashing is completed, unplug the USB cable, turn off the power and put it aside for later use.

2. Follow-up operations

If everything goes well, now your Wanke Cloud has flashed the Armbian system. Plug the Wanke Cloud into the Internet cable and connect it to the power supply. After a while, you will see a onecould IP address from the router background. This is your Wanke Cloud. Next we proceed with the follow-up operations, mounting the USB flash drive, installing docker, etc.

The first time you log in to Wanke Cloud may require the MobaXterm_Installer_v22.1 remote tool in my link. Using findshell, it seems that you cannot change the password the first time you log in. This image requires you to change the password when you log in for the first time. You can skip it with ctrl+c.

Mount U disk

After flashing the machine, the total space of Wanke Cloud disk is 6.5G, and the system should occupy 16% of the space. If we want to install and download a lot of software later, then this space is obviously not enough. I mounted a solid state ssd hard drive myself to use as a data disk

Plug in the U disk (insert it into the port close to HDMI. The network cable may not be able to enter the system through this port. It depends on the firmware). #Mount the disk
extended partition. Be careful not to copy the command. The disk name and partition name are up to you. View
the disk name

fdisk -l

[External link image transfer failed. The source site may have an anti-leeching mechanism. It is recommended to save the image and upload it directly (img-Sta5BV5E-1692148614106) (D:\02_Personal\0819 Data Migration\Notes\Hardware\assets\1684133948229.png) ]

Find the external hard drive you plugged in. The name of my external hard drive is sda.

Format disk

[root@localhost ~]# mkfs.ext4 /dev/sda

Proceed anyway? (y,n) y

We mount it to the /mnt/disk directory and enter the following command to create the directory first.

mkdir /mnt/disk

mount

mount /dev/sda /mnt/disk

Check the mounting effect

df -lh

[External link image transfer failed. The source site may have an anti-leeching mechanism. It is recommended to save the image and upload it directly (img-5hkY8ALq-1692148614107) (D:\02_Personal\0819 Data Migration\Notes\Hardware\assets\1684133985777.png) ]

Set the default mount at startup

[root@localhost ~]# blkid /dev/sda /dev/sda: UUID="b8c4a45f-ed74-3089-fcdb-0273de904d6d" TYPE="ext4" 

Note that after the above command operation is completed, a uuid will be generated and the given uuid will be added to /etc/fstab

[root@localhost ~]# vim /etc/fstab

Add the following information to the last line UUID=""

UUID=04caf540-3bbf-49a4-84eb-b6de3f437a9f /mnt/disk ext4 defaults 1 2

[External link image transfer failed. The source site may have an anti-leeching mechanism. It is recommended to save the image and upload it directly (img-C11og32w-1692148614107) (D:\02_Personal\0819 Data Migration\Notes\Hardware\assets\1684134027380.png) ]

Last input

mount -a

Check whether it is correct. If no error is reported, you can restart and test whether the mounting is successful.
————————————————

Install smaba to create shared disks

Installation command

apt install samba -y
apt install vim -y
to check the installation status

systemctl status nmbd

Create shared directory

#mkdir /mnt/disk/downloads

Edit the configuration file.

vi /etc/samba/smb.conf

Add the following to the end.

[share]

comment = share

path = /mnt/disk

public = yes

writable = yes

browseable=yes

available=yes

guest ok=yes

Restart service

systemctl restart nmbd

Then open \Your Wanke Cloud IP on your computer, and you should be able to see this shared folder.

Install docker and modify docker's data storage path to the mounted disk

Enter the automatic installation command directly.

curl -fsSL https://get.docker.com | bash -s docker –mirror Aliyun

View basic information about docker

docker info

Stop docker service

systemctl stop docker.socket

systemctl stop docker.service

Modify docker configuration to change the default directory

vi /etc/docker/daemon.json

Copy the following content into it

{
    
    
  "registry-mirrors": ["https://vrtulz5k.mirror.aliyuncs.com"]
}

Start docker

systemctl start docker.socket

systemctl start docker.service

Portainer deployment

docker run -d  --restart=always --name="portainer" -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock 6053537/portainer-ce

Install qbittorrent

Just copy the following command into ssh and press Enter. Of course, you can also create a container in the portainer installed above.

docker run -d \
  --network host \
  --name=qbittorrent \
  -e PUID=1000 \
  -e PGID=1000 \
  -e TZ=Etc/UTC \
  -e WEBUI_PORT=8080 \
  -p 8080:8080 \
  -p 6881:6881 \
  -p 6881:6881/udp \
  -v /mnt/disk/appdata/config:/config \
  -v /mnt/disk/downloads:/downloads \
  --restart unless-stopped \
  lscr.io/linuxserver/qbittorrent:latest

After installation, you can access it through Wanke Cloud IP + port 8080. The default account is admin and the default password is adminadmin. The web_ui in the settings can be changed to Chinese. If you have any questions, please refer to the official
documentation
https://hub.docker.com/r/linuxserver/qbittorrent

Install Aria2 Pro and AriaNg

Directly ssh to Wanke Cloud and enter the following code to install the Docker version of aria2

docker run -d \
    --name aria2-pro \
    --restart unless-stopped \
    --log-opt max-size=1m \
    -e PUID=$UID \
    -e PGID=$GID \
    -e UMASK_SET=022 \
    -e RPC_SECRET=qq1172851433 \
    -e RPC_PORT=6800 \
    -p 6800:6800 \
    -e LISTEN_PORT=6888 \
    -p 6888:6888 \
    -p 6888:6888/udp \
    -v /mnt/disk/appdata/config:/config \
    -v /mnt/disk/downloads:/downloads \
    p3terx/aria2-pro

Just change the above command <RPC_SECRET> to a Chinese and English string yourself.

The content on the left of /downloads is mapped to that disk and can be changed to the U disk or hard disk we mounted.

For details, see https://p3terx.com/archives/docker-aria2-pro.html

To install AriaNg, run the following command

docker run -d \
    --name ariang \
    --log-opt max-size=1m \
    --restart unless-stopped \
    -p 6880:6880 \
	--network host \
    p3terx/ariang

​If
an error is reported in the above copy, copy it line by line.
Configure aria2
, enter Synology ip:6880 in the browser, and open the AriaNg management page. After entering, an "Authentication Failed" error pop-up window will pop up, ignore it.

Select the "AriaNg Settings" item under "System Settings" on the left. Select the "RPC(192.168.x.xx..." menu on the right, and then configure the "Aria2 RPC address" port number and "Aria2 RPC key" items that were set when creating the container previously. For some information, refer to: Playing with
Synology NAS – Download the artifact aria2 – GXNAS Blog

Docker installs Pagoda panel

Pull run:

docker run -tid \
--name baota \
--restart unless-stopped \
-p 21:21 \
-p 80:80 \
-p 443:443 \
-p 888:888 \
-p 3306:3306 \
-p 8888:8888 \
-v /mnt/disk/baota/www:/www/wwwroot \
-v /mnt/disk/baota/wwwbase:/www/backup/site \
-v /mnt/disk/baota/datebase:/www/backup/database \
yiwanlingyi/baota_back:lnmp59-arm

Parameter description, you can delete the ones you don’t need and change the directory to your own.

-p 21:21 \ # ftp
-p 80:80 \ # http
-p 443:443 \ # https
-p 888:888 \ # phpMyAdmin
-p 3306:3306 \ # Database
-p 8888:8888 \ # Pagoda management port
-v Change the directory to your own:/www/wwwroot \ # Website directory
-v Change the directory to your own:/www/backup/site \ # Whole site backup directory
-v Change the directory to your own:/www/bace/datebase \ # Database backup directory
yiwanlingyi/baota_back:lnmp59-arm # arm64 adm64 platform self-modification
Start the pagoda: docker exec -it baota /bin/bash /etc/init.d/bt start
Get the pagoda's account password: docker exec -it baota /bin/bash /etc/init.d/bt defaultDefault
address: ip:8888

Forgot your password? Change the Pagoda login password:

docker exec -it baota /bin/bash # Enter the container baota
cd /www/server/panel && python tools.py panel 123456 # Change the password to 123456
username # The username will be displayed

Bt-Panel: http://IP:8888
username: nks7z1ae
password: c719b381

Install openwrt

Turn on network card promiscuous mode

ip link set eth0 promisc on

Create network

docker network create -d macvlan --subnet=192.168.123.0/24 --gateway=192.168.123.1 -o parent=eth0 macnet

[↑Modify it according to the network segment where Wanke Cloud is located. For example: Wanke Cloud IP: 192.168.123.147, change it to 192.168.123.0/24, and change 192.168.123.1 to the main routing address]

Pull the OpenWRT image

docker pull xuanaimai/onecloud:21-05-29

Create container

docker run -itd --name=openwrt --restart=always --network=macnet --privileged=true xuanaimai/onecloud:21-05-29 /sbin/init

-name=OneCloud openwrt, you can change it to what you want. The container name should not be the same as other containers. It will conflict.
According to the main route DHCP allocation, find a host named OpenWRT, copy its IPv4 address and paste it into the browser. Enter OpenWRT and use
the password
Wanke Cloud and the main router. The dhcp settings are sometimes added and sometimes not. For specific settings, please refer to [Ultimate Guide] for insights on adding iptables custom firewall rules for N1 as a bypass router - FiXon wireless routers and other FiXon network devices. -Enshan Wireless Forum)

14. Click the connected network in the mobile network settings

Change ip settings to static

ip address mobile phone original ip

Prefix length default

The address in front of the router openwrt

The address in front of dns1 openwrt

Check the upper right corner to save

Test whether the browser can access the Internet. If it can, just set the bypass router of Wanke Cloud.

15. Turn on adhome in the service and test the ad removal function on your mobile phone.

Net Center Cloud

docker run -d --name=wxedge --restart=always --privileged --net=host --tmpfs /run --tmpfs /tmp -v /mnt/disk/storage:/storage:rw onething1/wxedge

Parameter Description:

–privileged must be turned on.

–net currently only supports host (recommended) and macvlan network modes.

/media/wxedge_storage is a directory on the disk, which must be mounted to the /storage directory in the container. At least 50G of space is required. A solid-state drive is recommended.

3. Device binding

Open the browser (Google Chrome is recommended) and enter the LAN http://ip:18888 (the IP can be viewed through the router management terminal page), such as http://192.168.1.10:18888

Deploy peanut shells to achieve intranet penetration

The first step:
Go to Peanut Shell to register an account. I won’t go into details here.

Step Two:
Pull and Install the Peanut Shell

wget "https://dl-cdn.oray.com/hsk/linux/phddns_5.1.0_rapi_armhf.deb" -O phddns_5.1.0_rapi_armhf.deb

The pull path is the Raspberry Pi 32-bit version of the Peanut Shell official website, whichever is the official website path. Note that it is a 32-bit version.
Install it after the download is complete.

sudo dpkg -i phddns_5.1.0_rapi_armhf.deb

​ //phddns_5.1.0_rapi_armhf.deb is the pulled package

The third step is to configure Peanut Shell. After installation,
there will be an sn number. The default password is admin, followed by a URL managed by Peanut Shell. Enter it into the browser to open it. Use the sn number to log in to the device in the device list on the left.
PS: If you forget the SN number, you can check it with the phddns status command
and then add the required mapping through the intranet.

For example, if I remotely operate qBittorrent
on the internal network, the login port of qBittorrent is 192.168.31.89:8080,
then set the mapping type HTTPS (there is a permanent authentication of 6 yuan, and I don’t know if it is an arbitrary charge). The
external network domain name: free account Peanut Shell Custom For example, [color=rgba(0, 0, 0, 0.6)]12345678.imdo.co
External network port: the default is fine.
Intranet host: 192.168.31.89
Intranet port: 8080.
Make sure
to access the external network browser after the settings are completed. [color=rgba(0, 0, 0, 0.6)]12345678.imdo.co can manage and log in to qBittorrent.

Enter the command to start automatically at boot:

systemctl enable phtunnel

Install Home Assistant

Pull the image first

docker pull homeassistant/home-assistant

Then create a container in prtainer and select the image file you just pulled.

Network port configuration 8123 mapping, as shown below:

img

Then access it through Wanke Cloud IP+8123 port, and the configuration interface will appear.

img

Create an account first.

img

These points DETECT the current location. Then just click the button in the lower right corner to complete.

img

After entering the interface, modify the Chinese language.

Mijia devices connect to Home Assistant

I have a lot of Xiaomi smart homes at home, including Dingdong and Tmall Genie. I feel that accessing them is a little more troublesome. I will study them later when I have time.

Xiaomi devices have two convenient plug-ins for connecting to Home Assistant, Xiaomi Miio and Xiaomi Miot Auto.

Among them, Xiaomi Miio can be found directly in Home Assistant, Configuration, Integration, and Add Integration, as shown below:

img

Click and enter your Xiaomi account to automatically add your smart hardware.

img

img

The other Xiaomi Miot Auto feels more powerful, but it requires additional installation of HACS. To install it, the method is as follows:

Home Assistant Install HACS

Official tutorial link: https://hacs.xyz/docs/setup/download#option-2-run-the-installer-inside-the-container

Steps:

1. In Portainer, find the terminal button behind the homeassistant container, and then click the connect button.

img

2. Enter the installation command and press Enter, as shown below:

img

However, due to network problems, the download will fail. We can manually write the relevant code into a file and execute it manually.

Open the URL below and copy all the content

https://raw.githubusercontent.com/hacs/install/main/install

Download the compressed package in the content of the above URL and replace the link.

https://github.com/hacs/integration/releases/latest/download/hacs.zip

Then go back to Portainer's terminal

vi ha.sh

Press i to paste the content, then esc, :wq to save.

bash ha.sh

img

The installation is successful, now restart the Home Assistant service.

img

After the restart is complete, go to Configure, Integrate, Add Integration in the lower left corner and search for HACS.

Submit after checking 4 I know.

img

Then the verification interface in the picture above appears. First click on the URL 1, and then enter the verification code provided by 2.

If it prompts Could not authenticate with GitHub, try again later. It is because Wanke Cloud cannot access the github.com website.

You can enter the terminal of the Home Assistant container in Portainer and enter the following command to modify the hosts file.

img

vi /etc/hosts

i

Add the following string at the end

52.192.72.89 github.com

Just use the ping tool on the Internet to look at this IP and replace it with the IP of github.com parsed from around the world.

After esc:wq save.

img

After the addition is successful, you can see the HACS menu entry on the left.

Click HACS, then click Integration, and browse and download the repository in the lower right corner.

Find Xiaomi Miot Auto and click Download in the lower right corner.

After the installation is complete, restart Home Assistant.

After the restart is complete, visit the link below, change the address in the new webpage to the address of Home Assistant on your Wanke Cloud and open it.

https://my.home-assistant.io/redirect/config_flow_start/?domain=xiaomi_miot

img

Then it is more convenient to directly select account integration when configuring.

Deploy Kedao Cloud

docker run -d -it --name kodexplorer -p 58989:80 -v /mnt/disk/kedaoyun:/var/www/html --restart=always kodcloud/kodexplorer:latest

Enter Wanke Cloud IP: 58989 to access Kedao Cloud

Uninstall docker

1. Delete docker and all packages automatically installed during installation

apt-get autoremove docker docker-ce docker-engine  docker.io  containerd runc

2. Check whether docker is uninstalled cleanly

dpkg -l | grep docker
 dpkg -l |grep ^rc|awk '{print $2}' |sudo xargs dpkg -P # 删除无用的相关的配置文件

3. Delete related plug-ins that have not been deleted

apt-get autoremove docker-ce-*

4. Delete docker related configuration & directory

rm -rf /etc/systemd/system/docker.service.d
rm -rf /var/lib/docker

5. Make sure docker is uninstalled

docker --version

er run -d -it --name kodexplorer -p 58989:80 -v /mnt/disk/kedaoyun:/var/www/html --restart=always kodcloud/kodexplorer:latest


**输入玩客云IP:58989就可以访问可道云**

# **卸载docker**

1.删除docker及安装时自动安装的所有包

apt-get autoremove docker docker-ce docker-engine docker.io containerd runc


2.查看docker是否卸载干净

dpkg -l | grep docker


dpkg -l |grep ^rc|awk '{print $2}' |sudo xargs dpkg -P # Delete useless related configuration files


3.删除没有删除的相关插件

apt-get autoremove docker-ce-*


4.删除docker的相关配置&目录

rm -rf /etc/systemd/system/docker.service.d


rm -rf /var/lib/docker


5.确定docker卸载完毕

docker --version


[](https://3z92g91899.zicp.fun/#/)

Guess you like

Origin blog.csdn.net/qq1172851433/article/details/132311776