Add prefixes to Nextcloud page

This commit is contained in:
exu 2023-07-11 17:13:49 +02:00
parent 20f5db5998
commit 35b1a986ce

View File

@ -9,10 +9,14 @@ visible: true
Nextcloud will be using apache
[shroot]
```sh
apt install mlocate apache2 libapache2-mod-php mariadb-client mariadb-server wget unzip bzip2 curl php php-common php-curl php-gd php-mbstring php-mysql php-xml php-zip php-intl php-apcu php-redis php-bcmath php-gmp php-imagick
```
[/shroot]
Not found: `php-http-request python-certbot-apache`
No password set
@ -37,23 +41,35 @@ Exit the MariaDB prompt
Download Nextcloud into `/var/www`
[shroot]
```sh
wget https://download.nextcloud.com/server/releases/nextcloud-{VERSION}.tar.bz2
tar -xf nextcloud-{VERSION}.tar.bz2
```
[/shroot]
Change owner to the apache user
[shroot]
```sh
chown -Rfv www-data:www-data /var/www/nextcloud
```
[/shroot]
Create nextcloud configuration for apache
[shroot]
```sh
vi /etc/apache2/sites-available/nextcloud.conf
```
[/shroot]
Configuration file
```apacheconf
@ -83,25 +99,37 @@ Configuration file
Enable nextcloud and disable the default site
[shroot]
```sh
a2ensite nextcloud.conf && a2dissite 000-default.conf
```
[/shroot]
Edit `ports.conf` for apache2 to only bind the addresses you need
[shroot]
```sh
systemctl restart apache2
```
[/shroot]
### Cron
To execute regular jobs, I personally use cron.
Edit `crontab` as the `www-data` user.
[shuser]
```sh
sudo -u www-data crontab -e
```
[/shuser]
Add this following line:
```
@ -119,7 +147,7 @@ The main config file is `{NEXTCLOUD DIR}/config/config.php`
This settings keeps the files for 15 days, unless drive space is getting low.
In that case it delets them earlier.
```
```php
'trashbin_retention_obligation' => 'auto, 15',
```
@ -127,7 +155,7 @@ In that case it delets them earlier.
This disables the warning of untrusted proxy in the webinterface.
```
```php
'trusted_proxies' =>
array (
0 => '{PROXY IP}',
@ -138,7 +166,7 @@ This disables the warning of untrusted proxy in the webinterface.
Array of trusted domains.
```
```php
'trusted_domains' =>
array (
0 => '{DOMAIN 1}',
@ -152,18 +180,26 @@ Array of trusted domains.
Enable maintenance mode to prevent data inconsistencies
[shuser]
```sh
sudo -u www-data php /var/www/nextcloud/occ maintenance:mode --on
```
[/shuser]
To disable maintenance mode again, run the same command with `--off` instead of `--on`
### Upgrade with CLI
[shuser]
```sh
sudo -u www-data php /var/www/nextcloud/updater/updater.phar
```
[/shuser]
### Backup Database
Dump database to file
@ -215,7 +251,10 @@ mariadb -h {SERVER} -u {USERNAME} -p{PASSWORD} {DB NAME} < nextcloud-sqlbkp.bak
> [Docker Compose for Nextcloud + Collabora + Traefik?](https://help.nextcloud.com/t/docker-compose-for-nextcloud-collabora-traefik/127733/2)
> [Use HTTPS with Ubuntu 22.04, apache, Nextcloud and Collabora(Docker)](https://help.nextcloud.com/t/use-https-with-ubuntu-22-04-apache-nextcloud-and-collabora-docker/142880)
> [HowTo: Ubuntu + Docker + Nextcloud + Talk + Collabora](https://help.nextcloud.com/t/howto-ubuntu-docker-nextcloud-talk-collabora/76430)
> [HowTo: Ubuntu + Docker + Nextcloud + Talk + Collabora](https://help.nextcloud.com/t/howto-ubuntu-docker-nextcloud-talk-collabora/76430)
> [Collabora - Installation Guide](https://sdk.collaboraonline.com/docs/installation/index.html)
[shroot]
```sh
podman run -t -d --name collabora-online -p 9980:9980 \
@ -224,6 +263,8 @@ podman run -t -d --name collabora-online -p 9980:9980 \
docker.io/collabora/code:latest
```
[/shroot]
```nginx
server {
listen 443 ssl;
@ -282,15 +323,19 @@ Integrating onlyoffice, requires setting the correct Content Security Policy hea
For my installation, the headers needed to be set like this.
```
Content-Security-Policy "default-src 'self' 'unsafe-inline' 'unsafe-eval' data: onlyoffice.exu.li;"
Content-Security-Policy "default-src 'self' 'unsafe-inline' 'unsafe-eval' data: [ONLYOFFICE DOMAIN NAME];"
```
[shroot]
```sh
sudo podman run -itd --name onlyoffice -p 8080:80 \
podman run -itd --name onlyoffice -p 8080:80 \
-e JWT_SECRET={secret key} \
docker.io/onlyoffice/documentserver
```
[/shroot]
> [Installing ONLYOFFICE Docs Community Edition for Docker on a local server](https://helpcenter.onlyoffice.com/installation/docs-community-install-docker.aspx)
> [About the ONLYOFFICE and Nextcloud integration](https://helpcenter.onlyoffice.com/integration/gettingstarted-nextcloud.aspx)
> [Using ONLYOFFICE Docs behind the proxy](https://helpcenter.onlyoffice.com/installation/docs-community-proxy.aspx)