Skip to content

Commit

Permalink
Repo-sync
Browse files Browse the repository at this point in the history
  • Loading branch information
GitHub Workflow committed Oct 24, 2024
1 parent ecfd1cb commit f550021
Show file tree
Hide file tree
Showing 8 changed files with 53 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Containers/clamav/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# syntax=docker/dockerfile:latest
# Probably from this file: https://github.com/Cisco-Talos/clamav-docker/blob/main/clamav/1.3/alpine/Dockerfile
FROM clamav/clamav:1.4.1-8
FROM clamav/clamav:1.4.1-9

COPY clamav.conf /clamav.conf
COPY --chmod=775 start.script /start.script
Expand Down
9 changes: 7 additions & 2 deletions Containers/nextcloud/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ run_upgrade_if_needed_due_to_app_update() {
fi
}

# Adjust DATABASE_TYPE to by Nextcloud supported value
if [ "$DATABASE_TYPE" = postgres ]; then
export DATABASE_TYPE=pgsql
fi

# Only start container if redis is accessible
# shellcheck disable=SC2153
while ! nc -z "$REDIS_HOST" "6379"; do
Expand Down Expand Up @@ -237,12 +242,12 @@ if ! [ -f "$NEXTCLOUD_DATA_DIR/skip.update" ]; then
);
DATADIR_PERMISSION_CONF

echo "Installing with PostgreSQL database"
echo "Installing with $DATABASE_TYPE database"
# Set a default value for POSTGRES_PORT
if [ -z "$POSTGRES_PORT" ]; then
POSTGRES_PORT=5432
fi
INSTALL_OPTIONS+=(--database pgsql --database-name "$POSTGRES_DB" --database-user "$POSTGRES_USER" --database-pass "$POSTGRES_PASSWORD" --database-host "$POSTGRES_HOST" --database-port "$POSTGRES_PORT")
INSTALL_OPTIONS+=(--database "$DATABASE_TYPE" --database-name "$POSTGRES_DB" --database-user "$POSTGRES_USER" --database-pass "$POSTGRES_PASSWORD" --database-host "$POSTGRES_HOST" --database-port "$POSTGRES_PORT")

echo "Starting Nextcloud installation..."
if ! php /var/www/html/occ maintenance:install "${INSTALL_OPTIONS[@]}"; then
Expand Down
5 changes: 5 additions & 0 deletions Containers/nextcloud/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ done
POSTGRES_USER="oc_$POSTGRES_USER"
export POSTGRES_USER

# Check that db type is not empty
if [ -z "$DATABASE_TYPE" ]; then
export DATABASE_TYPE=postgres
fi

# Fix false database connection on old instances
if [ -f "/var/www/html/config/config.php" ]; then
sleep 2
Expand Down
15 changes: 11 additions & 4 deletions Containers/notify-push/start.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#!/bin/bash

if [ -z "$NEXTCLOUD_HOST" ]; then
echo "NEXTCLOUD_HOST need to be provided. Exiting!"
echo "NEXTCLOUD_HOST needs to be provided. Exiting!"
exit 1
elif [ -z "$POSTGRES_HOST" ]; then
echo "POSTGRES_HOST need to be provided. Exiting!"
echo "POSTGRES_HOST needs to be provided. Exiting!"
exit 1
elif [ -z "$REDIS_HOST" ]; then
echo "REDIS_HOST need to be provided. Exiting!"
echo "REDIS_HOST needs to be provided. Exiting!"
exit 1
fi

Expand Down Expand Up @@ -52,9 +52,16 @@ fi
if [ -z "$REDIS_DB_INDEX" ]; then
REDIS_DB_INDEX=0
fi
# Set a default for db type
if [ -z "$DATABASE_TYPE" ]; then
DATABASE_TYPE=postgres
elif [ "$DATABASE_TYPE" != postgres ] && [ "$DATABASE_TYPE" != mysql ]; then
echo "DB type must be either postgres or mysql"
exit 1
fi

# Set sensitive values as env
export DATABASE_URL="postgres://oc_$POSTGRES_USER:$POSTGRES_PASSWORD@$POSTGRES_HOST:$POSTGRES_PORT/$POSTGRES_DB"
export DATABASE_URL="$DATABASE_TYPE://oc_$POSTGRES_USER:$POSTGRES_PASSWORD@$POSTGRES_HOST:$POSTGRES_PORT/$POSTGRES_DB"
export REDIS_URL="redis://:$REDIS_HOST_PASSWORD@$REDIS_HOST/$REDIS_DB_INDEX"

# Run it
Expand Down
2 changes: 1 addition & 1 deletion local-instance.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ The recommended way is the following:
1. Enter the ip-address of your local dns-server in the daemon.json file for docker so that you are sure that all docker containers use the correct local dns-server.
1. Now, entering the domain in the AIO-interface should work as expected and should allow you to continue with the setup

Here is a video that does shows this a bit more in detail: https://youtu.be/zk-y2wVkY4c
**Hint:** You may have a look at [this video](https://youtu.be/zk-y2wVkY4c) for a more complete but possibly outdated example.

## 2. Use the ACME DNS-challenge
You can alternatively use the ACME DNS-challenge to get a valid certificate for Nextcloud. Here is described how to set it up: https://github.com/nextcloud/all-in-one#how-to-get-nextcloud-running-using-the-acme-dns-challenge
Expand Down
4 changes: 2 additions & 2 deletions php/public/toggle-dark-mode.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ function applySavedTheme() {
}
}

// Immediately apply the saved theme
applySavedTheme();
// Apply theme when the page loads
document.addEventListener('DOMContentLoaded', applySavedTheme);
4 changes: 4 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Included are:
- A+ security in Nextcloud security scan
- Ready to be used behind existing [Reverse proxies](https://github.com/nextcloud/all-in-one/blob/main/reverse-proxy.md)
- Can be used behind [Cloudflare Tunnel](https://github.com/nextcloud/all-in-one#how-to-run-nextcloud-behind-a-cloudflare-tunnel)
- Can be used inside [Tailscale network](https://github.com/nextcloud/all-in-one/discussions/5439)
- Ready for big file uploads up to 10 GB on public links, [adjustable](https://github.com/nextcloud/all-in-one#how-to-adjust-the-upload-limit-for-nextcloud) (logged in users can upload much bigger files using the webinterface or the mobile/desktop clients since chunking is used in that case)
- PHP and web server timeouts set to 3600s, [adjustable](https://github.com/nextcloud/all-in-one#how-to-adjust-the-max-execution-time-for-nextcloud) (important for big file uploads)
- Defaults to a max of 512 MB RAM per PHP process, [adjustable](https://github.com/nextcloud/all-in-one#how-to-adjust-the-php-memory-limit-for-nextcloud)
Expand Down Expand Up @@ -239,6 +240,9 @@ Another but untested way is to install Portainer on your TrueNAS SCALE from here
### How to run Nextcloud behind a Cloudflare Tunnel?
Although it does not seems like it is the case but from AIO perspective a Cloudflare Tunnel works like a reverse proxy. So please follow the [reverse proxy documentation](./reverse-proxy.md) where is documented how to make it run behind a Cloudflare Tunnel. However please see the [caveats](https://github.com/nextcloud/all-in-one#notes-on-cloudflare-proxytunnel) before proceeding.
### How to run Nextcloud inside a Tailscale network?
For a reverse proxy example guide for Tailscale, see this guide by @flll: https://github.com/nextcloud/all-in-one/discussions/5439
### Disrecommended VPS providers
- *Older* Strato VPS using Virtuozzo caused problems though ones from Q3 2023 and later should work.
If your VPS has a `/proc/user_beancounters` file and a low `numproc` limit set in it
Expand Down
25 changes: 22 additions & 3 deletions reverse-proxy.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,8 @@ To make the config work you can run the following command:

<summary>click here to expand</summary>

**Hint:** You may have a look at [this guide](https://github.com/nextcloud/all-in-one/discussions/575#discussion-4055615) for a more complete but possibly outdated example.

Add this to your Caddyfile:

```
Expand Down Expand Up @@ -204,6 +206,9 @@ For a reverse proxy example guide for Citrix ADC VPX / Citrix Netscaler, see thi
<summary>click here to expand</summary>
**Hint:** You may have a look at [this guide](https://github.com/nextcloud/all-in-one/discussions/2845#discussioncomment-6423237) for a more complete but possibly outdated example.
Although it does not seem like it is the case but from AIO perspective a Cloudflare Tunnel works like a reverse proxy. Please see the [caveats](https://github.com/nextcloud/all-in-one#notes-on-cloudflare-proxytunnel) before proceeding. Here is then how to make it work:
1. Install the Cloudflare Tunnel on the same machine where AIO will be running on and point the Tunnel with the domain that you want to use for AIO to `http://localhost:11000`.<br>
Expand Down Expand Up @@ -317,6 +322,8 @@ backend Nextcloud
<summary>click here to expand</summary>
**Hint:** You may have a look at [this guide](https://github.com/nextcloud/all-in-one/discussions/588#discussioncomment-2811152) for a more complete but possibly outdated example.
**Disclaimer:** This config was tested and should normally work on all modern Nginx versions. Improvements to the config are very welcome!
Add the below template to your Nginx config.
Expand Down Expand Up @@ -401,8 +408,6 @@ server {
⚠️ **Please note:** look into [this](#adapting-the-sample-web-server-configurations-below) to adapt the above example configuration.
**Advice:** You may have a look at [this](https://github.com/nextcloud/all-in-one/discussions/588#discussioncomment-2811152) for a more complete example.
</details>
### Nginx-Proxy-Manager - NPM
Expand All @@ -411,6 +416,8 @@ server {
<summary>click here to expand</summary>
**Hint:** You may have a look at [this guide](https://github.com/nextcloud/all-in-one/discussions/588#discussioncomment-3040493) for a more complete but possibly oudated example.
First, make sure the environmental variables `PUID` and `PGID` in the `compose.yaml` file for NPM are either unset or set to `0`.
If you need to change the GID/PID then please add `net.ipv4.ip_unprivileged_port_start=0` at the end of `/etc/sysctl.conf`. Note: this will cause that non root users can bind privileged ports.
Expand Down Expand Up @@ -560,6 +567,8 @@ See these screenshots for a working config:

<summary>click here to expand</summary>

**Hint:** You may have a look at [this video](https://www.youtube.com/watch?v=VLPSRrLMDmA) for a more complete but possibly outdated example.

**Disclaimer:** it might be possible that the config below is not working 100% correctly, yet. Improvements to it are very welcome!

Traefik's building blocks (router, service, middlewares) need to be defined using dynamic configuration similar to [this](https://doc.traefik.io/traefik/providers/file/#configuration-examples) official Traefik configuration example. Using **docker labels _won't work_** because of the nature of the project.
Expand Down Expand Up @@ -638,7 +647,6 @@ The examples below define the dynamic configuration in YAML files. If you rather
---
⚠️ **Please note:** look into [this](#adapting-the-sample-web-server-configurations-below) to adapt the above example configuration.
**Hint**: see https://www.youtube.com/watch?v=VLPSRrLMDmA for a video on configuring Traefik.
</details>
Expand Down Expand Up @@ -710,6 +718,17 @@ Add the following `web.config` file to the root of the site you created as the r

</details>

### Tailscale

<details>

<summary>click here to expand</summary>

For a reverse proxy example guide for Tailscale, see this guide by @flll: https://github.com/nextcloud/all-in-one/discussions/5439

</details>


### Others

<details>
Expand Down

0 comments on commit f550021

Please sign in to comment.