From dcaae95daa8ee3d7e8044d55d13887d8ff353030 Mon Sep 17 00:00:00 2001 From: Luke Childs Date: Thu, 5 Aug 2021 12:41:04 +0100 Subject: [PATCH] Add Nextcloud app --- apps/nextcloud/data/db/.gitkeep | 0 apps/nextcloud/data/nextcloud/.gitkeep | 0 apps/nextcloud/data/redis/.gitkeep | 0 apps/nextcloud/docker-compose.yml | 68 ++++++++++++++++++++++++++ apps/registry.json | 22 +++++++++ scripts/configure | 10 ++++ templates/.env-sample | 5 ++ templates/torrc-sample | 4 ++ 8 files changed, 109 insertions(+) create mode 100644 apps/nextcloud/data/db/.gitkeep create mode 100644 apps/nextcloud/data/nextcloud/.gitkeep create mode 100644 apps/nextcloud/data/redis/.gitkeep create mode 100644 apps/nextcloud/docker-compose.yml diff --git a/apps/nextcloud/data/db/.gitkeep b/apps/nextcloud/data/db/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/apps/nextcloud/data/nextcloud/.gitkeep b/apps/nextcloud/data/nextcloud/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/apps/nextcloud/data/redis/.gitkeep b/apps/nextcloud/data/redis/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/apps/nextcloud/docker-compose.yml b/apps/nextcloud/docker-compose.yml new file mode 100644 index 0000000..a80893e --- /dev/null +++ b/apps/nextcloud/docker-compose.yml @@ -0,0 +1,68 @@ +version: "3.7" + +services: + db: + image: mariadb:10.5.8@sha256:8040983db146f729749081c6b216a19d52e0973134e2e34c0b4fd87f48bc15b0 + user: "1000:1000" + command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW + restart: on-failure + volumes: + - ${APP_DATA_DIR}/data/db:/var/lib/mysql + environment: + - MYSQL_ROOT_PASSWORD=moneyprintergobrrr + - MYSQL_PASSWORD=moneyprintergobrrr + - MYSQL_DATABASE=nextcloud + - MYSQL_USER=nextcloud + networks: + default: + ipv4_address: $APP_NEXTCLOUD_DB_IP + + redis: + image: redis:6.2.2-buster@sha256:e10f55f92478715698a2cef97c2bbdc48df2a05081edd884938903aa60df6396 + user: "1000:1000" + restart: on-failure + volumes: + - "${APP_DATA_DIR}/data/redis:/data" + networks: + default: + ipv4_address: $APP_NEXTCLOUD_REDIS_IP + + web: + image: nextcloud:22.0.0-apache@sha256:55de721417c16ff110720217406778e16f1b63154d2e8d42fc7913c37dbe6d50 + # Currently needs to be run as root, if we run as uid 1000 this fails + # https://github.com/nextcloud/docker/blob/05026b029d37fc5cd488d4a4a2a79480e39841ba/21.0/apache/entrypoint.sh#L53-L77 + # user: "1000:1000" + restart: on-failure + ports: + - ${APP_NEXTCLOUD_PORT}:80 + volumes: + - ${APP_DATA_DIR}/data/nextcloud:/var/www/html + environment: + - MYSQL_HOST=${APP_NEXTCLOUD_DB_IP} + - REDIS_HOST=${APP_NEXTCLOUD_REDIS_IP} + - MYSQL_PASSWORD=moneyprintergobrrr + - MYSQL_DATABASE=nextcloud + - MYSQL_USER=nextcloud + - NEXTCLOUD_TRUSTED_DOMAINS=${APP_DOMAIN}:${APP_NEXTCLOUD_PORT} ${APP_HIDDEN_SERVICE} + depends_on: + - db + - redis + networks: + default: + ipv4_address: $APP_NEXTCLOUD_IP + + cron: + image: nextcloud:22.0.0-apache@sha256:55de721417c16ff110720217406778e16f1b63154d2e8d42fc7913c37dbe6d50 + # Currently needs to be run as root, if we run as uid 1000 this fails + # https://github.com/nextcloud/docker/blob/05026b029d37fc5cd488d4a4a2a79480e39841ba/21.0/apache/entrypoint.sh#L53-L77 + # user: "1000:1000" + restart: on-failure + volumes: + - ${APP_DATA_DIR}/data/nextcloud:/var/www/html + entrypoint: /cron.sh + depends_on: + - db + - redis + networks: + default: + ipv4_address: $APP_NEXTCLOUD_CRON_IP diff --git a/apps/registry.json b/apps/registry.json index eb1e27a..3e76024 100644 --- a/apps/registry.json +++ b/apps/registry.json @@ -1,4 +1,26 @@ [ + { + "id": "nextcloud", + "category": "Files", + "name": "Nextcloud", + "version": "21.0.2", + "tagline": "Productivity platform that keeps you in control", + "description": "Nextcloud puts your data at your fingertips, under your control. Store your documents, calendar, contacts and photos on your Umbrel instead of some company's data center. Features:\n\n- Mobile and desktop sync \n- Versioning and undelete \n- Galleries and activity feed \n- File editing and preview support for PDF, images, text files, Open Document, Word files and more. \n- Smooth performance and easy user interface. \n- Fine-grained control over access to data and sharing capabilities by user and by group.\n\nNote: After creating your admin account when you open Nextcloud for the first time, you'll be taken to a white (blank) screen. Please close the app and open it again to continue.", + "developer": "Nextcloud GmbH", + "website": "https://nextcloud.com", + "dependencies": [], + "repo": "https://github.com/nextcloud/server", + "support": "https://help.nextcloud.com/categories", + "port": 8081, + "gallery": [ + "1.jpg", + "2.jpg", + "3.jpg" + ], + "path": "", + "defaultPassword": "", + "torOnly": false + }, { "id": "mempool", "category": "Explorers", diff --git a/scripts/configure b/scripts/configure index dece228..9549747 100755 --- a/scripts/configure +++ b/scripts/configure @@ -158,6 +158,11 @@ APP_SAMOURAI_SERVER_NODE_IP="10.21.21.25" APP_BLUEWALLET_LNDHUB_IP="10.21.21.30" APP_BLUEWALLET_LNDHUB_PORT="3008" APP_BLUEWALLET_REDIS_IP="10.21.21.31" +APP_NEXTCLOUD_PORT="8081" +APP_NEXTCLOUD_IP="10.21.21.32" +APP_NEXTCLOUD_DB_IP="10.21.21.33" +APP_NEXTCLOUD_REDIS_IP="10.21.21.34" +APP_NEXTCLOUD_CRON_IP="10.21.21.35" # Generate RPC credentials if [[ -z ${BITCOIN_RPC_USER+x} ]] || [[ -z ${BITCOIN_RPC_PASS+x} ]] || [[ -z ${BITCOIN_RPC_AUTH+x} ]]; then @@ -321,6 +326,11 @@ for template in "${NGINX_CONF_FILE}" "${BITCOIN_CONF_FILE}" "${LND_CONF_FILE}" " sed -i "s//${APP_BLUEWALLET_LNDHUB_IP}/g" "${template}" sed -i "s//${APP_BLUEWALLET_LNDHUB_PORT}/g" "${template}" sed -i "s//${APP_BLUEWALLET_REDIS_IP}/g" "${template}" + sed -i "s//${APP_NEXTCLOUD_PORT}/g" "${template}" + sed -i "s//${APP_NEXTCLOUD_IP}/g" "${template}" + sed -i "s//${APP_NEXTCLOUD_DB_IP}/g" "${template}" + sed -i "s//${APP_NEXTCLOUD_REDIS_IP}/g" "${template}" + sed -i "s//${APP_NEXTCLOUD_CRON_IP}/g" "${template}" done ########################################################## diff --git a/templates/.env-sample b/templates/.env-sample index 6affecc..59805de 100644 --- a/templates/.env-sample +++ b/templates/.env-sample @@ -61,3 +61,8 @@ APP_SAMOURAI_SERVER_NODE_IP= APP_BLUEWALLET_LNDHUB_IP= APP_BLUEWALLET_LNDHUB_PORT= APP_BLUEWALLET_REDIS_IP= +APP_NEXTCLOUD_PORT= +APP_NEXTCLOUD_IP= +APP_NEXTCLOUD_DB_IP= +APP_NEXTCLOUD_REDIS_IP= +APP_NEXTCLOUD_CRON_IP= diff --git a/templates/torrc-sample b/templates/torrc-sample index afbe6ac..8f11027 100644 --- a/templates/torrc-sample +++ b/templates/torrc-sample @@ -84,4 +84,8 @@ HiddenServicePort 80 :: +# nextcloud Hidden Service +HiddenServiceDir /var/lib/tor/app-nextcloud +HiddenServicePort 80 :80 + HashedControlPassword