diff --git a/.unreleased/LLT-5726 b/.unreleased/LLT-5726 new file mode 100644 index 000000000..e69de29bb diff --git a/qnap/build_sign.csv b/qnap/build_sign.csv new file mode 100644 index 000000000..3966cb267 --- /dev/null +++ b/qnap/build_sign.csv @@ -0,0 +1 @@ +,/NordSecMeshnet.sh, diff --git a/qnap/config/.gitkeep b/qnap/config/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/qnap/icons/.gitkeep b/qnap/icons/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/qnap/package_routines b/qnap/package_routines new file mode 100644 index 000000000..fd83600d8 --- /dev/null +++ b/qnap/package_routines @@ -0,0 +1,140 @@ +###################################################################### +# List of available definitions (it's not necessary to uncomment them) +###################################################################### +###### Command definitions ##### +#CMD_AWK="/bin/awk" +#CMD_CAT="/bin/cat" +#CMD_CHMOD="/bin/chmod" +#CMD_CHOWN="/bin/chown" +#CMD_CP="/bin/cp" +#CMD_CUT="/bin/cut" +#CMD_DATE="/bin/date" +#CMD_ECHO="/bin/echo" +#CMD_EXPR="/usr/bin/expr" +#CMD_FIND="/usr/bin/find" +#CMD_GETCFG="/sbin/getcfg" +#CMD_GREP="/bin/grep" +#CMD_GZIP="/bin/gzip" +#CMD_HOSTNAME="/bin/hostname" +#CMD_LN="/bin/ln" +#CMD_LOG_TOOL="/sbin/log_tool" +#CMD_MD5SUM="/bin/md5sum" +#CMD_MKDIR="/bin/mkdir" +#CMD_MV="/bin/mv" +#CMD_RM="/bin/rm" +#CMD_RMDIR="/bin/rmdir" +#CMD_SED="/bin/sed" +#CMD_SETCFG="/sbin/setcfg" +#CMD_SLEEP="/bin/sleep" +#CMD_SORT="/usr/bin/sort" +#CMD_SYNC="/bin/sync" +#CMD_TAR="/bin/tar" +#CMD_TOUCH="/bin/touch" +#CMD_WGET="/usr/bin/wget" +#CMD_WLOG="/sbin/write_log" +#CMD_XARGS="/usr/bin/xargs" +#CMD_7Z="/usr/local/sbin/7z" +# +###### System definitions ##### +#SYS_EXTRACT_DIR="$(pwd)" +#SYS_CONFIG_DIR="/etc/config" +#SYS_INIT_DIR="/etc/init.d" +#SYS_STARTUP_DIR="/etc/rcS.d" +#SYS_SHUTDOWN_DIR="/etc/rcK.d" +#SYS_RSS_IMG_DIR="/home/httpd/RSS/images" +#SYS_QPKG_DATA_FILE_GZIP="./data.tar.gz" +#SYS_QPKG_DATA_FILE_BZIP2="./data.tar.bz2" +#SYS_QPKG_DATA_FILE_7ZIP="./data.tar.7z" +#SYS_QPKG_DATA_CONFIG_FILE="./conf.tar.gz" +#SYS_QPKG_DATA_MD5SUM_FILE="./md5sum" +#SYS_QPKG_DATA_PACKAGES_FILE="./Packages.gz" +#SYS_QPKG_CONFIG_FILE="$SYS_CONFIG_DIR/qpkg.conf" +#SYS_QPKG_CONF_FIELD_QPKGFILE="QPKG_File" +#SYS_QPKG_CONF_FIELD_NAME="Name" +#SYS_QPKG_CONF_FIELD_VERSION="Version" +#SYS_QPKG_CONF_FIELD_ENABLE="Enable" +#SYS_QPKG_CONF_FIELD_DATE="Date" +#SYS_QPKG_CONF_FIELD_SHELL="Shell" +#SYS_QPKG_CONF_FIELD_INSTALL_PATH="Install_Path" +#SYS_QPKG_CONF_FIELD_CONFIG_PATH="Config_Path" +#SYS_QPKG_CONF_FIELD_WEBUI="WebUI" +#SYS_QPKG_CONF_FIELD_WEBPORT="Web_Port" +#SYS_QPKG_CONF_FIELD_SERVICEPORT="Service_Port" +#SYS_QPKG_CONF_FIELD_SERVICE_PIDFILE="Pid_File" +#SYS_QPKG_CONF_FIELD_AUTHOR="Author" +#SYS_QPKG_CONF_FIELD_RC_NUMBER="RC_Number" +## The following variables are assigned values at run-time. +#SYS_HOSTNAME=$($CMD_HOSTNAME) +## Data file name (one of SYS_QPKG_DATA_FILE_GZIP, SYS_QPKG_DATA_FILE_BZIP2, +## or SYS_QPKG_DATA_FILE_7ZIP) +#SYS_QPKG_DATA_FILE= +## Base location. +#SYS_QPKG_BASE="" +## Base location of QPKG installed packages. +#SYS_QPKG_INSTALL_PATH="" +## Location of installed software. +#SYS_QPKG_DIR="" +## If the QPKG should be enabled or disabled after the installation/upgrade. +#SYS_QPKG_SERVICE_ENABLED="" +## Architecture of the device the QPKG is installed on. +#SYS_CPU_ARCH="" +## Name and location of system shares +#SYS_PUBLIC_SHARE="" +#SYS_PUBLIC_PATH="" +#SYS_DOWNLOAD_SHARE="" +#SYS_DOWNLOAD_PATH="" +#SYS_MULTIMEDIA_SHARE="" +#SYS_MULTIMEDIA_PATH="" +#SYS_RECORDINGS_SHARE="" +#SYS_RECORDINGS_PATH="" +#SYS_USB_SHARE="" +#SYS_USB_PATH="" +#SYS_WEB_SHARE="" +#SYS_WEB_PATH="" +## Path to ipkg or opkg package tool if installed. +#CMD_PKG_TOOL= +# +###################################################################### +# All package specific functions shall call 'err_log MSG' if an error +# is detected that shall terminate the installation. +###################################################################### +# +###################################################################### +# Define any package specific operations that shall be performed when +# the package is removed. +###################################################################### +#PKG_PRE_REMOVE="{ +#}" +# +#PKG_MAIN_REMOVE="{ +#}" +# +#PKG_POST_REMOVE="{ +#}" +# +###################################################################### +# Define any package specific initialization that shall be performed +# before the package is installed. +###################################################################### +#pkg_init(){ +#} +# +###################################################################### +# Define any package specific requirement checks that shall be +# performed before the package is installed. +###################################################################### +#pkg_check_requirement(){ +#} +# +###################################################################### +# Define any package specific operations that shall be performed when +# the package is installed. +###################################################################### +#pkg_pre_install(){ +#} +# +#pkg_install(){ +#} +# +#pkg_post_install(){ +#} diff --git a/qnap/qpkg.cfg b/qnap/qpkg.cfg new file mode 100644 index 000000000..01e97c66d --- /dev/null +++ b/qnap/qpkg.cfg @@ -0,0 +1,105 @@ +# Name of the packaged application. +QPKG_NAME="Nord Security Meshnet" +# Name of the display application. +QPKG_DISPLAY_NAME="Nord Security Meshnet" +# Version of the packaged application. +QPKG_VER="0.0.1-alpha" +# Author or maintainer of the package +QPKG_AUTHOR="info@nordvpn.com" +# License for the packaged application +QPKG_LICENSE="GPL-3.0-only" +# One-line description of the packaged application +#QPKG_SUMMARY="" + +# Preferred number in start/stop sequence. +QPKG_RC_NUM="101" +# Init-script used to control the start and stop of the installed application. +QPKG_SERVICE_PROGRAM="NordSecMeshnet.sh" + +# Optional 1 is enable. Path of starting/ stopping shall script. (no start/stop on App Center) +#QPKG_DISABLE_APPCENTER_UI_SERVICE=1 + +# Specifies any packages required for the current package to operate. +#QPKG_REQUIRE="Python >= 2.7" +# Replace the QPKG_REQUIRE message displayed in the system log +#QPKG_REQUIRE_MSG="" +# Specifies what packages cannot be installed if the current package +# is to operate properly. +#QPKG_CONFLICT="Python" +# Name of configuration file (multiple definitions are allowed). +#QPKG_CONFIG="myApp.conf" +#QPKG_CONFIG="/etc/config/myApp.conf" +# Port number used by service program. +#QPKG_SERVICE_PORT="" +# Location of file with running service's PID +#QPKG_SERVICE_PIDFILE="" +# Relative path to web interface +#QPKG_WEBUI="" +# Port number for the web interface. +#QPKG_WEB_PORT="" +# Port number for the SSL web interface. +#QPKG_WEB_SSL_PORT="" + +# Use QTS HTTP Proxy and set Proxy_Path in the qpkg.conf. +# When the QPKG has its own HTTP service port, and want clients to connect via QTS HTTP port (default 8080). +# Usually use this option when the QPKG need to connect via myQNAPcloud service. +#QPKG_USE_PROXY="1" +#QPKG_PROXY_PATH="/qpkg_name" + +#Desktop Application (since 4.1) +# Set value to 1 means to open the QPKG's Web UI inside QTS desktop instead of new window. +#QPKG_DESKTOP_APP="1" +# Desktop Application Window default inner width (since 4.1) (not over 1178) +#QPKG_DESKTOP_APP_WIN_WIDTH="" +# Desktop Application Window default inner height (since 4.1) (not over 600) +#QPKG_DESKTOP_APP_WIN_HEIGHT="" + +# Minimum QTS version requirement +QTS_MINI_VERSION="5.0.0" + +# Select volume +# 1: support installation +# 2: support migration +# 3 (1+2): support both installation and migration +#QPKG_VOLUME_SELECT="0" + +# Set timeout for QPKG enable and QPKG disable (since 4.1.0) +# Format in seconds (enable, disable) +#QPKG_TIMEOUT="10,30" + +# Visible setting for the QPKG that has web UI, show this QPKG on the Main menu of +# 1(default): administrators, 2: all NAS users. +#QPKG_VISIBLE="2" + +# Make the QPKG be visible only for +# 1: administrators, 2: all NAS users, 3(default): No limit +#QPKG_FORCE_VISIBLE="3" + +# Storage share folder add/delete action +#QPKG_SHARE_ADD_ACTION="" +#QPKG_SHARE_DEL_ACTION="" + +# Storage mount/unmount action +#QPKG_MOUNT_ACTION="" +#QPKG_UNMOUNT_ACTION="" + +# Register action volume status into read delete or read only mode +#QPKG_ENTER_READDELETE_ACTION="" +#QPKG_LEAVE_READDELETE_ACTION="" + +# For Hero FW 5.2.x +#QPKG_ENTER_HERO_LOW_SPACE_ACTION="" +#QPKG_LEAVE_HERO_LOW_SPACE_ACTION="" + +#QPKG_ENTER_HERO_CRITICAL_LOW_ACTION="" +#QPKG_LEAVE_HERO_CRITICAL_LOW_ACTION="" + +# Default timeout is 15 sec, if without this option +#QPKG_ACTION_TIMEOUT="" + +# For QNAP code signing (currently can be done only inside QNAP) +# Uncomment the following four options if you want to enable code signing for this QPKG +#QNAP_CODE_SIGNING="0" +#QNAP_CODE_SIGNING_SERVER_IP="codesigning.qnap.com.tw" +#QNAP_CODE_SIGNING_SERVER_PORT="5001" +#QNAP_CODE_SIGNING_CSV="build_sign.csv" diff --git a/qnap/shared/.gitkeep b/qnap/shared/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/qnap/shared/NordSecMeshnet.sh b/qnap/shared/NordSecMeshnet.sh new file mode 100755 index 000000000..0e4c746c5 --- /dev/null +++ b/qnap/shared/NordSecMeshnet.sh @@ -0,0 +1,34 @@ +#!/bin/sh +CONF=/etc/config/qpkg.conf +QPKG_NAME="Nord Security Meshnet" +QPKG_ROOT=`/sbin/getcfg $QPKG_NAME Install_Path -f ${CONF}` +APACHE_ROOT=`/sbin/getcfg SHARE_DEF defWeb -d Qweb -f /etc/config/def_share.info` +export QNAP_QPKG=$QPKG_NAME + +case "$1" in + start) + ENABLED=$(/sbin/getcfg $QPKG_NAME Enable -u -d FALSE -f $CONF) + if [ "$ENABLED" != "TRUE" ]; then + echo "$QPKG_NAME is disabled." + exit 1 + fi + : ADD START ACTIONS HERE + ;; + + stop) + : ADD STOP ACTIONS HERE + ;; + + restart) + $0 stop + $0 start + ;; + remove) + ;; + + *) + echo "Usage: $0 {start|stop|restart|remove}" + exit 1 +esac + +exit 0 diff --git a/qnap/x86_64/.gitkeep b/qnap/x86_64/.gitkeep new file mode 100644 index 000000000..e69de29bb