You are here

Asustor/ADM NAS Installation Tutorial

1 post / 0 new
xgx
Offline
Donator
Joined: 2 years
Last seen: 4 months
Asustor/ADM NAS Installation Tutorial

I recently configured WG++ to run on my Asustor NAS and I found the whole process to be a bit confusing, so I wrote up a crude tutorial.

@mat8861, Thank your for your help while I was setting it up.

Disclaimer: I have never used Linux before and these instruction come from me hacking together something until i got it working. That being said, I couldn't find any better instructions online, so I hope this helps you out if you have trouble setting up WG++ on your Asustor NAS.

Legend:
1 Preparation
1.1 Initialize your NAS
1.2 Enable SSH on your NAS
1.3 Install an SSH client
1.4 Install WinSCP (optional)
1.5 Learn how to use vi (optional)
1.6 SSH to your NAS
2 Install .NET
2.1 Download/extract .NET
2.2 Configure .NET variables
2.3 Check that .NET was installed correctly
3 Install WG++
3.1 Download/extract WG++
3.2 Check that WG++ was installed correctly
3.3 Copy guide.xml file to shared folder
3.4 Configure WG++
3.5 Schedule WG++ to run periodically

1 Preparation
1.1 Initialize your NAS
-Follow the instructions that came with your NAS, available at https://www.asustor.com/en/knowledge/detail/?id=&group_id=704

1.2 Enable SSH on your NAS
-Go to your NAS portal.(ex: http://MyNAS:8000)
-Open Services > Terminal
-Check "Enable SSH service" and "Enable SFTP service" and click "Apply".
-Restart your NAS by clicking on your user name (top-right) and selecting "Restart".

1.3 Install an SSH client
-My preferred client is TeraTerm (https://ttssh2.osdn.jp/index.html.en)
-Note: Right-clicking in TeraTerm pastes whatever is in your clipboard.
-You can alternatively install "Shell in a Box" from App Central, but I have had issues with it.

1.4 Install WinSCP (optional)
-WinSCP allows you to easily browse the files of your NAS (full file system, not just network shares). It also allows you to easily create/edit files such as scripts.
-Go to https://winscp.net/eng/download.php and download/install WinSCP.

1.5 Learn how to use vi (optional)
vi is a terminal text editor that is a bit tricky for beginners, but you can get by with the following tips. It comes preinstalled on your NAS.
-To open a file run:
vi filename.txt
-If file is protected, run:
sudo vi filename.txt
-vi has two modes (input/command). The application starts in command mode. Press 'i' to enter input mode and 'Esc' to return to command mode.
-To exit vi, enter command mode and type colon ':' and then one of the following:
'q'+'Enter' to exit when no changes have been made
'q!'+'Enter' to exit WITHOUT saving changes
'wq'+'Enter' to save changes and exit

1.6 SSH to your NAS
-To run commands on your NAS, you need to connect to it through SSH.
-Open TeraTerm, and enter Host and port number you configured earlier (default port: 22) and click "OK.
-When prompted enter your username/password and click "OK".

2 Install .NET
2.1 Download/extract .NET
-You must download the install package from Microsoft. The latest stable version at the time of writing this is 7.0.400 and is what is linked to below.
-Other versions can be downloaded here: https://dotnet.microsoft.com/en-us/download/dotnet (Be sure to select the binaries for Linux/Arm64)
-Enter the following SSH command to download the binaries:
wget https://download.visualstudio.microsoft.com/download/pr/16b0b1af-6eab-4f9e-b9a4-9b29f6a1d681/4624e54b61cae05b1025211482f9c5e9/dotnet-sdk-7.0.400-linux-arm64.tar.gz

-Create a directory for .NET:
mkdir /volume1/bin/dotnet-64

-Extract the binaries to the newly created folder:
tar -zxvf dotnet-sdk-7.0.400-linux-arm64.tar.gz -C /volume1/bin/dotnet-64

2.2 Configure .NET variables
-To use .NET, you now need to add the .NET folder to the system $PATH and create the DOTNET_ROOT variable.
-Since ADM recreates /volume0 on boot, we cannot edit any system files directly. Instead we will create a script that edits the files and schedule it to run on boot.
-We will define the variables in /etc/profile so that they are set for all users.

-Using WinSCP or vi, create /volume1/home/startup.sh and write these lines to the file:

# Path to .NET
dotnet_root_path=/volume1/bin/dotnet-64

# Add .NET variables to /etc/profile
# Define DOTNET_ROOT
echo "export DOTNET_ROOT=$dotnet_root_path">>/etc/profile
# Add DOTNET path to PATH
echo "export PATH=$dotnet_root_path:$PATH">>/etc/profile

-To schedule a cron job, run:
sudo crontab -e
-Add the following line to run your script on reboot:
@reboot /bin/sh /volume1/home/startup.sh
-Don't forget to save with "wq" when you exit.

-Go back to the portal and restart the NAS.

2.3 Check that .NET was installed correctly
-Check the .NET version installed by running:
dotnet --version
-If you get "7.0.400", the software was installed correctly and you can delete the installer by running:
rm dotnet-sdk-7.0.400-linux-arm64.tar.gz

3 Install WG++
3.1 Download/extract WG++
-Download the WebGrab+Plus installer:
wget http://webgrabplus.com/sites/default/files/download/SW/V5.1.0/WebGrabPlus_V5.1_install.tar.gz

-Extract the installer:
tar -zxvf WebGrabPlus_V5.1_install.tar.gz -C /volume1/bin

-Go to bin folder:
cd /volume1/bin/

-Rename WebGrab+Plus folder so it is no longer hidden.
mv .wg++ wg++

-Run installer:
cd wg++
sh ./install.sh

-You may get an error on line 27, but this can be ignored.

./install.sh: line 27: syntax error: bad substitution
==> installing siteini.pack
==> installing WebGrab++.config.xml
==> installing mdb/mdb.config.xml
==> installing rex/rex.config.xml
==> DONE

3.2 Check that WG++ was installed correctly
-Switch to root user (you will likely get an error if you are not signed in as root):
sudo -i

-Run WebGrab+Plus:
sh /volume1/bin/wg++/run.net.sh

-If the script ends with something like
Job finished at 14/09/2023 20:40:54 done in 8s
-The installation was successful and you can delete the installer file.

3.3 Copy guide.xml file to shared folder
-The wguide.xml file generated will not be accessible on the network. It must be copied to a shared location.
-Open run.net.sh in an editor and add the following line before "quit 0;":
cp "$DIR/guide.xml" /share/Public/epg/
-Replace the destination with your desired network share.

3.4 Configure WG++
-Configure your WebGrab++.config.xml file using the instructions online (http://www.webgrabplus.com/documentation/configuration/webgrabconfigxml).
-I strongly recommend getting your config file running properly on a Windows computer and then copying it over. It'll be easier to debug that way.
-I recommend using WinSCP to access the file since it will be much easier to edit than using vi.

3.5 Schedule WG++ to run periodically
-To schedule a cron job, run:
sudo crontab -e
-Add a line to run WG++ as desired. For example, to run it daily at 5PM:
0 17 * * * /bin/sh -l -c "/bin/sh /volume1/bin/wg++/run.net.sh" > /var/log/wg++.log 2>&1
-The output of the last execution will be saved in /var/log/wg++.log.
-Don't forget to save with "wq" when you exit.

Misc notes for n00bs:

  • ADM is built on Busybox, which uses ash (not bash)
  • If logged in in SSH and WinSCP, sometimes the web portal doesn't work.
  • List all folder (including hidden):
  • ls -a

  • Copy a folder and contents:
  • cp -r src dest

  • Delete a folder and contents:
  • rm -r folder

  • Check the size of a folder:
  • du -sh dotnet-64

  • Run sudo with current user's PATH:
  • sudo env "PATH=$PATH" dotnet --version

Brought to you by Jan van Straaten

Program Development - Jan van Straaten ------- Web design - Francis De Paemeleere
Supported by: servercare.nl