From ba051e50d78d1e0ac43fc02e9b29772c5b6ec218 Mon Sep 17 00:00:00 2001 From: Igor Pecovnik Date: Wed, 4 Dec 2024 22:10:05 +0100 Subject: [PATCH] Add Ownloud --- tools/include/images/MED927.png | Bin 0 -> 7634 bytes tools/include/markdown/MED027-footer.md | 18 +++++ tools/include/markdown/MED027-header.md | 1 + tools/json/config.software.json | 30 ++++++++ tools/modules/runtime/config.runtime.sh | 1 + tools/modules/software/install_owncloud.sh | 81 +++++++++++++++++++++ 6 files changed, 131 insertions(+) create mode 100644 tools/include/images/MED927.png create mode 100644 tools/include/markdown/MED027-footer.md create mode 100644 tools/include/markdown/MED027-header.md create mode 100644 tools/modules/software/install_owncloud.sh diff --git a/tools/include/images/MED927.png b/tools/include/images/MED927.png new file mode 100644 index 0000000000000000000000000000000000000000..a35f54f0a211cd5160dab96061eef2d7937b6a4b GIT binary patch literal 7634 zcmdU!_cxs1`|gR}#RLf=LX2oJ87+Dz7$qTk)G;z@7}0wTqD7lgA|yINCWzh=29FlK z3o=5~j2gj_yg%>r{hYJTKX86}_P(#zeeG+nXFq$*S`(wMt3gN2MomOSM5lRQ^&t@v z37UxLQV1!@MTO={FL3c-(1#hSu?s5W@%Z!eb7Jb7@d>FEoZJmWMAw5fRh0~VrZ;k& zGV>c)6zdDY*5$;8ZN#42Jk-iqyn-Xd zaTbDjnJn=edCB#E1r%@uJNzB#H~miF zJrl+$S!xn8R~!R~TdQ_@>VPn1NhLgR>WlfJygCArRDUV8@oEM}5zhu+zlYI)-|Elbg%42Dwp4^a5z799y55=DX=I z0Vbr7pqK9I`{KFB?GMzR`q@n4_T2L-3_id@0ec&)!81S4CV&UZ8ks*gZrB6>Tqw;+ zGXu_tQGoUVC6qO+B5EzuEEb@}&~zL?KfMKl--&X;?_8P*)s}oS%nwb(StP*bT#)?G z$6&?_yi^dCduxOXb=SlbbUOvFuKSteK%%Y>mpV&1@O1?2hRLH8y7gBZer0sz6+2b8PgPbM(a)5MtCAW!{5nr1FS z4)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)bK}Hnowji-(jC%W+hR`}b_ZL!@UmnDriNj`#G;A!S z4nk$`Ep^O>dWWw)xTpi)?>N&GOohQ# zVh=?u#wfOLLX;fr(9$Jk+Uph^?;70<9uSgS9vQx2f8?2Y)DP)amYo_{(!059-2h^t zSDn?X^b_pTBgh+glWFE&;{cWHtw9U2qZem>R({oc`T=QL1L;2JlyBW&IQ|qp5*qVS zLoR2p-asTkkSmXL?-GAGU{KwGxVLRi0d7nEiB)AX}Su;kRo{PJY z_SlX4sir}AVN?bk5&V7VF2&^!5&Sk<=zmJ7kc%Nx;YH=wrIaq@A7~BoFa3{1WsrV1 zKJ>5lKXgaxKhPc-IDX`!pK8R$`mfQ2!(RzhC}hV*@>k=x`Ir8?@CCg_17j: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 0d407579..a28cb4e7 100644 --- a/tools/json/config.software.json +++ b/tools/json/config.software.json @@ -1030,6 +1030,36 @@ "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 a0f0f990..d5fb48d3 100644 --- a/tools/modules/runtime/config.runtime.sh +++ b/tools/modules/runtime/config.runtime.sh @@ -99,6 +99,7 @@ update_sub_submenu_data "Software" "Database" "DAT006" "http://$LOCALIPADD:${mod 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_owncloud.sh b/tools/modules/software/install_owncloud.sh new file mode 100644 index 00000000..3e10a432 --- /dev/null +++ b/tools/modules/software/install_owncloud.sh @@ -0,0 +1,81 @@ +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=Etc/UTC \ + -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 "\tstatus\t- Installation status $title." + echo -e "\tremove\t- Remove $title." + echo + ;; + *) + ${module_options["module_owncloud,feature"]} ${commands[3]} + ;; + esac +}