Skip to content

Commit

Permalink
Add Ownloud
Browse files Browse the repository at this point in the history
  • Loading branch information
igorpecovnik committed Dec 4, 2024
1 parent 29b680f commit 2caf11d
Show file tree
Hide file tree
Showing 6 changed files with 131 additions and 0 deletions.
Binary file added tools/include/images/MED927.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions tools/include/markdown/MED027-footer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
=== "Access to the web interface"

The web interface is accessible via port **7787**:

- URL: `http://<your.IP>: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
```
1 change: 1 addition & 0 deletions tools/include/markdown/MED027-header.md
Original file line number Diff line number Diff line change
@@ -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.
30 changes: 30 additions & 0 deletions tools/json/config.software.json
Original file line number Diff line number Diff line change
Expand Up @@ -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\" ]]"
}
]
},
Expand Down
1 change: 1 addition & 0 deletions tools/modules/runtime/config.runtime.sh
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ fi
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"]}"
Expand Down
81 changes: 81 additions & 0 deletions tools/modules/software/install_owncloud.sh
Original file line number Diff line number Diff line change
@@ -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"]} <command>"
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
}

0 comments on commit 2caf11d

Please sign in to comment.