diff --git a/tools/include/images/MED015.png b/tools/include/images/MED015.png new file mode 100644 index 00000000..2080feb7 Binary files /dev/null and b/tools/include/images/MED015.png differ diff --git a/tools/include/images/MED020.png b/tools/include/images/MED020.png new file mode 100644 index 00000000..c7e12308 Binary files /dev/null and b/tools/include/images/MED020.png differ diff --git a/tools/include/images/MED927.png b/tools/include/images/MED927.png new file mode 100644 index 00000000..a35f54f0 Binary files /dev/null and b/tools/include/images/MED927.png differ diff --git a/tools/include/markdown/MED015-footer.md b/tools/include/markdown/MED015-footer.md new file mode 100644 index 00000000..6a67c9f4 --- /dev/null +++ b/tools/include/markdown/MED015-footer.md @@ -0,0 +1,18 @@ +=== "Access to the web interface" + + The web interface is accessible via port **8884**: + + - URL: `https://:8884` + - Username/Password: There is none, but it is highly suggested setting a password for this container. To do this go to Actions -> Settings -> set user/password for the webUI. + +=== "Directories" + + - Install directory: `/armbian/syncthing` + - Site configuration directory: `/armbian/syncthing/config` + - Data directory: `/armbian/syncthing/data1` `/armbian/syncthing/data2` + +=== "View logs" + + ```sh + docker logs -f syncthing + ``` diff --git a/tools/include/markdown/MED015-header.md b/tools/include/markdown/MED015-header.md new file mode 100644 index 00000000..b3fdf358 --- /dev/null +++ b/tools/include/markdown/MED015-header.md @@ -0,0 +1 @@ +Syncthing replaces proprietary sync and cloud services with something open, trustworthy and decentralized. Your data is your data alone and you deserve to choose where it is stored, if it is shared with some third party and how it's transmitted over the Internet. diff --git a/tools/include/markdown/MED020-footer.md b/tools/include/markdown/MED020-footer.md new file mode 100644 index 00000000..bedce4f8 --- /dev/null +++ b/tools/include/markdown/MED020-footer.md @@ -0,0 +1,18 @@ +=== "Access to the web interface" + + The web interface is accessible via port **443**: + + - URL: `https://:443` + - Username/Password: admin / generate at first web interface login + +=== "Directories" + + - Install directory: `/armbian/nextcloud` + - Site configuration directory: `/armbian/nextcloud/config` + - Data directory: `/armbian/nextcloud/data` + +=== "View logs" + + ```sh + docker logs -f nextcloud + ``` diff --git a/tools/include/markdown/MED020-header.md b/tools/include/markdown/MED020-header.md new file mode 100644 index 00000000..2665d461 --- /dev/null +++ b/tools/include/markdown/MED020-header.md @@ -0,0 +1,3 @@ +Nextcloud gives you access to all your files wherever you are. +
+Where are your photos and documents? With Nextcloud you pick a server of your choice, at home, in a data center or at a provider. And that is where your files will be. Nextcloud runs on that server, protecting your data and giving you access from your desktop or mobile devices. Through Nextcloud you also access, sync and share your existing data on that FTP drive at the office, a Dropbox or a NAS you have at home. diff --git a/tools/include/markdown/MED027-footer.md b/tools/include/markdown/MED027-footer.md new file mode 100644 index 00000000..4e833bb5 --- /dev/null +++ b/tools/include/markdown/MED027-footer.md @@ -0,0 +1,18 @@ +=== "Access to the web interface" + + The web interface is accessible via port **7787**: + + - URL: `http://:7787` + - Username/Password: admin / admin + +=== "Directories" + + - Install directory: `/armbian/owncloud` + - Site configuration directory: `/armbian/owncloud/config` + - Data directory: `/armbian/owncloud/data` + +=== "View logs" + + ```sh + docker logs -f owncloud + ``` diff --git a/tools/include/markdown/MED027-header.md b/tools/include/markdown/MED027-header.md new file mode 100644 index 00000000..7b4060ae --- /dev/null +++ b/tools/include/markdown/MED027-header.md @@ -0,0 +1 @@ +ownCloud is a free and open-source software project for content collaboration and sharing and syncing of files in distributed and federated enterprise scenarios. diff --git a/tools/json/config.software.json b/tools/json/config.software.json index 335aae7c..a28cb4e7 100644 --- a/tools/json/config.software.json +++ b/tools/json/config.software.json @@ -970,8 +970,97 @@ "status": "Stable", "author": "@igorpecovnik", "condition": "! module_stirling status && [[ -d \"${SOFTWARE_FOLDER}/stirling\" ]]" + }, + { + "id": "MED015", + "description": "Syncthing Install", + "command": [ + "module_syncthing install" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "! module_syncthing status" + }, + { + "id": "MED016", + "description": "Syncthing Remove", + "command": [ + "module_syncthing remove" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "module_syncthing status" + }, + { + "id": "MED017", + "description": "Syncthing Purge data folder", + "command": [ + "module_syncthing purge" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "! module_syncthing status && [[ -d \"${SOFTWARE_FOLDER}/syncthing\" ]]" + }, + { + "id": "MED020", + "description": "Nextcloud Install", + "command": [ + "module_nextcloud install" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "! module_nextcloud status" + }, + { + "id": "MED021", + "description": "Nextcloud Remove", + "command": [ + "module_nextcloud remove" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "module_nextcloud status" + }, + { + "id": "MED022", + "description": "Nextcloud Purge data folder", + "command": [ + "module_nextcloud purge" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "! module_nextcloud status && [[ -d \"${SOFTWARE_FOLDER}/nextcloud\" ]]" + }, + { + "id": "MED025", + "description": "Owncloud Install", + "command": [ + "module_owncloud install" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "! module_owncloud status" + }, + { + "id": "MED026", + "description": "Owncloud Remove", + "command": [ + "module_owncloud remove" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "module_owncloud status" + }, + { + "id": "MED027", + "description": "Owncloud Purge data folder", + "command": [ + "module_owncloud purge" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "! module_owncloud status && [[ -d \"${SOFTWARE_FOLDER}/owncloud\" ]]" } - ] }, { diff --git a/tools/modules/runtime/config.runtime.sh b/tools/modules/runtime/config.runtime.sh index 3cd755d0..d5fb48d3 100644 --- a/tools/modules/runtime/config.runtime.sh +++ b/tools/modules/runtime/config.runtime.sh @@ -97,6 +97,9 @@ fi update_sub_submenu_data "Software" "Database" "DAT002" "Server: $LOCALIPADD" update_sub_submenu_data "Software" "Database" "DAT006" "http://$LOCALIPADD:${module_options["module_phpmyadmin,port"]}" update_sub_submenu_data "Software" "Media" "MED006" "http://$LOCALIPADD:${module_options["module_stirling,port"]}" +update_sub_submenu_data "Software" "Media" "MED016" "http://$LOCALIPADD:${module_options["module_syncthing,port"]}" +update_sub_submenu_data "Software" "Media" "MED021" "https://$LOCALIPADD:${module_options["module_nextcloud,port"]}" +update_sub_submenu_data "Software" "Media" "MED026" "http://$LOCALIPADD:${module_options["module_owncloud,port"]}" update_sub_submenu_data "Software" "Containers" "CON006" "http://$LOCALIPADD:${module_options["module_portainer,port"]}" update_sub_submenu_data "Software" "HomeAutomation" "HA004" "http://$LOCALIPADD:${module_options["module_haos,port"]}" update_sub_submenu_data "Software" "Monitoring" "MON004" "http://$LOCALIPADD:${module_options["module_netdata,port"]}" diff --git a/tools/modules/software/install_nextcloud.sh b/tools/modules/software/install_nextcloud.sh new file mode 100644 index 00000000..cde430bd --- /dev/null +++ b/tools/modules/software/install_nextcloud.sh @@ -0,0 +1,84 @@ +module_options+=( + ["module_nextcloud,author"]="" + ["module_nextcloud,maintainer"]="@igorpecovnik" + ["module_nextcloud,testers"]="@igorpecovnik" + ["module_nextcloud,feature"]="module_nextcloud" + ["module_nextcloud,desc"]="Install nextcloud container" + ["module_nextcloud,example"]="install remove purge status help" + ["module_nextcloud,port"]="443" + ["module_nextcloud,status"]="Active" + ["module_nextcloud,arch"]="x86-64,arm64" +) +# +# Module nextcloud +# +function module_nextcloud () { + local title="nextcloud" + local condition=$(which "$title" 2>/dev/null) + + if check_if_installed docker-ce; then + local container=$(docker container ls -a | mawk '/nextcloud?( |$)/{print $1}') + local image=$(docker image ls -a | mawk '/nextcloud?( |$)/{print $3}') + fi + + local commands + IFS=' ' read -r -a commands <<< "${module_options["module_nextcloud,example"]}" + + NEXTCLOUD_BASE="${SOFTWARE_FOLDER}/nextcloud" + + case "$1" in + "${commands[0]}") + check_if_installed docker-ce || install_docker + [[ -d "$NEXTCLOUD_BASE" ]] || mkdir -p "$NEXTCLOUD_BASE" || { echo "Couldn't create storage directory: $NEXTCLOUD_BASE"; exit 1; } + docker run -d \ + --name=nextcloud \ + -e PUID=1000 \ + -e PGID=1000 \ + -e TZ="$(cat /etc/timezone)" \ + -p 443:443 \ + -v "${NEXTCLOUD_BASE}/config:/config" \ + -v "${NEXTCLOUD_BASE}/data:/data" \ + --restart unless-stopped \ + lscr.io/linuxserver/nextcloud:latest + for i in $(seq 1 20); do + if docker inspect -f '{{ index .Config.Labels "build_version" }}' nextcloud >/dev/null 2>&1 ; then + break + else + sleep 3 + fi + if [ $i -eq 20 ] ; then + echo -e "\nTimed out waiting for ${title} to start, consult your container logs for more info (\`docker logs nextcloud\`)" + exit 1 + fi + done + ;; + "${commands[1]}") + [[ "${container}" ]] && docker container rm -f "$container" >/dev/null + [[ "${image}" ]] && docker image rm "$image" >/dev/null + ;; + "${commands[2]}") + [[ -n "${NEXTCLOUD_BASE}" && "${NEXTCLOUD_BASE}" != "/" ]] && rm -rf "${NEXTCLOUD_BASE}" + ;; + "${commands[3]}") + if [[ "${container}" && "${image}" ]]; then + return 0 + else + return 1 + fi + ;; + "${commands[4]}") + echo -e "\nUsage: ${module_options["module_nextcloud,feature"]} " + echo -e "Commands: ${module_options["module_nextcloud,example"]}" + echo "Available commands:" + echo -e "\tinstall\t- Install $title." + echo -e "\tremove\t- Remove $title." + echo -e "\tpurge\t- Purge $title data folder." + echo -e "\tstatus\t- Installation status $title." + + echo + ;; + *) + ${module_options["module_nextcloud,feature"]} ${commands[4]} + ;; + esac +} diff --git a/tools/modules/software/install_owncloud.sh b/tools/modules/software/install_owncloud.sh new file mode 100644 index 00000000..6a294c8e --- /dev/null +++ b/tools/modules/software/install_owncloud.sh @@ -0,0 +1,82 @@ +module_options+=( + ["module_owncloud,author"]="@armbian" + ["module_owncloud,feature"]="module_owncloud" + ["module_owncloud,desc"]="Install owncloud container" + ["module_owncloud,example"]="install remove purge status help" + ["module_owncloud,port"]="7787" + ["module_owncloud,status"]="Active" + ["module_owncloud,arch"]="x86-64,arm64" +) +# +# Module owncloud +# +function module_owncloud () { + local title="owncloud" + local condition=$(which "$title" 2>/dev/null) + + if check_if_installed docker-ce; then + local container=$(docker container ls -a | mawk '/owncloud?( |$)/{print $1}') + local image=$(docker image ls -a | mawk '/owncloud/{print $3}') + fi + + local commands + IFS=' ' read -r -a commands <<< "${module_options["module_owncloud,example"]}" + + OWNCLOUD_BASE="${SOFTWARE_FOLDER}/owncloud" + + case "$1" in + "${commands[0]}") + check_if_installed docker-ce || install_docker + [[ -d "$OWNCLOUD_BASE" ]] || mkdir -p "$OWNCLOUD_BASE" || { echo "Couldn't create storage directory: $OWNCLOUD_BASE"; exit 1; } + docker run -d \ + --name=owncloud \ + -e PUID=1000 \ + -e PGID=1000 \ + -e TZ="$(cat /etc/timezone)" \ + -e "OWNCLOUD_TRUSTED_DOMAINS=${LOCALIPADD}" \ + -p 7787:8080 \ + -v "${OWNCLOUD_BASE}/config:/config" \ + -v "${OWNCLOUD_BASE}/data:/mnt/data" \ + --restart unless-stopped \ + owncloud/server + for i in $(seq 1 20); do + if docker inspect -f '{{ index .Config.Labels "build_version" }}' owncloud >/dev/null 2>&1 ; then + break + else + sleep 3 + fi + if [ $i -eq 20 ] ; then + echo -e "\nTimed out waiting for ${title} to start, consult your container logs for more info (\`docker logs owncloud\`)" + exit 1 + fi + done + ;; + "${commands[1]}") + [[ "${container}" ]] && docker container rm -f "$container" >/dev/null + [[ "${image}" ]] && docker image rm "$image" >/dev/null + ;; + "${commands[2]}") + [[ -n "${OWNCLOUD_BASE}" && "${OWNCLOUD_BASE}" != "/" ]] && rm -rf "${OWNCLOUD_BASE}" + ;; + "${commands[3]}") + if [[ "${container}" && "${image}" ]]; then + return 0 + else + return 1 + fi + ;; + "${commands[4]}") + echo -e "\nUsage: ${module_options["module_owncloud,feature"]} " + echo -e "Commands: ${module_options["module_owncloud,example"]}" + echo "Available commands:" + echo -e "\tinstall\t- Install $title." + echo -e "\tremove\t- Remove $title." + echo -e "\tpurge\t- Purge $title data folder." + echo -e "\tstatus\t- Installation status $title." + echo + ;; + *) + ${module_options["module_owncloud,feature"]} ${commands[4]} + ;; + esac +} diff --git a/tools/modules/software/install_syncthing.sh b/tools/modules/software/install_syncthing.sh new file mode 100644 index 00000000..10d16823 --- /dev/null +++ b/tools/modules/software/install_syncthing.sh @@ -0,0 +1,89 @@ +module_options+=( + ["module_syncthing,author"]="" + ["module_syncthing,maintainer"]="@igorpecovnik" + ["module_syncthing,testers"]="@igorpecovnik" + ["module_syncthing,feature"]="module_syncthing" + ["module_syncthing,desc"]="Install syncthing container" + ["module_syncthing,example"]="install remove purge status help" + ["module_syncthing,port"]="8884" + ["module_syncthing,status"]="Active" + ["module_syncthing,arch"]="x86-64,arm64" +) +# +# Module syncthing +# +function module_syncthing () { + local title="syncthing" + local condition=$(which "$title" 2>/dev/null) + + if check_if_installed docker-ce; then + local container=$(docker container ls -a | mawk '/syncthing?( |$)/{print $1}') + local image=$(docker image ls -a | mawk '/syncthing?( |$)/{print $3}') + fi + + local commands + IFS=' ' read -r -a commands <<< "${module_options["module_syncthing,example"]}" + + SYNCTHING_BASE="${SOFTWARE_FOLDER}/syncthing" + + case "$1" in + "${commands[0]}") + check_if_installed docker-ce || install_docker + [[ -d "$SYNCTHING_BASE" ]] || mkdir -p "$SYNCTHING_BASE" || { echo "Couldn't create storage directory: $SYNCTHING_BASE"; exit 1; } + docker run -d \ + --name=syncthing \ + --hostname=syncthing `#optional` \ + -e PUID=1000 \ + -e PGID=1000 \ + -e TZ="$(cat /etc/timezone)" \ + -p 8884:8384 \ + -p 22000:22000/tcp \ + -p 22000:22000/udp \ + -p 21027:21027/udp \ + -v "${SYNCTHING_BASE}/config:/config" \ + -v "${SYNCTHING_BASE}/data1:/data1" \ + -v "${SYNCTHING_BASE}/data2:/data2" \ + --restart unless-stopped \ + lscr.io/linuxserver/syncthing:latest + for i in $(seq 1 20); do + if docker inspect -f '{{ index .Config.Labels "build_version" }}' syncthing >/dev/null 2>&1 ; then + break + else + sleep 3 + fi + if [ $i -eq 20 ] ; then + echo -e "\nTimed out waiting for ${title} to start, consult your container logs for more info (\`docker logs syncthing\`)" + exit 1 + fi + done + ;; + "${commands[1]}") + [[ "${container}" ]] && docker container rm -f "$container" >/dev/null + [[ "${image}" ]] && docker image rm "$image" >/dev/null + ;; + "${commands[2]}") + [[ -n "${SYNCTHING_BASE}" && "${SYNCTHING_BASE}" != "/" ]] && rm -rf "${SYNCTHING_BASE}" + ;; + "${commands[3]}") + if [[ "${container}" && "${image}" ]]; then + return 0 + else + return 1 + fi + ;; + "${commands[4]}") + echo -e "\nUsage: ${module_options["module_syncthing,feature"]} " + echo -e "Commands: ${module_options["module_syncthing,example"]}" + echo "Available commands:" + echo -e "\tinstall\t- Install $title." + echo -e "\tremove\t- Remove $title." + echo -e "\tpurge\t- Purge $title data folder." + echo -e "\tstatus\t- Installation status $title." + + echo + ;; + *) + ${module_options["module_syncthing,feature"]} ${commands[4]} + ;; + esac +}