add nextcloud

This commit is contained in:
Gabriel Augendre 2024-10-12 13:33:33 +02:00
parent 2e055b77b0
commit cb1a169091
10 changed files with 167 additions and 0 deletions

View file

@ -1,8 +1,13 @@
#!/bin/bash #!/bin/bash
set -euxo pipefail
echo "creating directories for '$1'" echo "creating directories for '$1'"
mkdir -p "playbooks/apps/files/$1" mkdir -p "playbooks/apps/files/$1"
mkdir -p "playbooks/apps/templates/$1" mkdir -p "playbooks/apps/templates/$1"
cp playbooks/apps/template.yaml.dist "playbooks/apps/$1.yaml" cp playbooks/apps/template.yaml.dist "playbooks/apps/$1.yaml"
sed -i '' "s/==APP==/$1/g" "playbooks/apps/$1.yaml" sed -i '' "s/==APP==/$1/g" "playbooks/apps/$1.yaml"
git add .
pre-commit run
git add .
echo "done" echo "done"

View file

@ -14,6 +14,7 @@
- import_playbook: manuels.yaml # noqa: name[play] - import_playbook: manuels.yaml # noqa: name[play]
- import_playbook: media.yaml # noqa: name[play] - import_playbook: media.yaml # noqa: name[play]
- import_playbook: miniflux.yaml # noqa: name[play] - import_playbook: miniflux.yaml # noqa: name[play]
- import_playbook: nextcloud.yaml # noqa: name[play]
- import_playbook: portainer.yaml # noqa: name[play] - import_playbook: portainer.yaml # noqa: name[play]
- import_playbook: privatebin.yaml # noqa: name[play] - import_playbook: privatebin.yaml # noqa: name[play]
- import_playbook: shortener.yaml # noqa: name[play] - import_playbook: shortener.yaml # noqa: name[play]

View file

@ -0,0 +1,12 @@
To get help: `occ help <command>`
To list commands: `occ list`
## Examples
Rescan file for modifications that happened outside nextcloud (e.g. on the filesystem directly).
```bash
/usr/bin/docker-compose -f /home/gaugendre/nextcloud/docker-compose.yaml exec --user www-data nextcloud php occ files:scan -p gaugendre/files/Photos
```
Calling `files:scan` without arguments will scan all files for all users. This may take a very long time.
Scope to a user or a path instead.

View file

@ -0,0 +1,89 @@
services:
nextcloud:
build:
context: nextcloud_build
pull: true
image: nextcloud_local
restart: always
ports:
- "8003:80"
volumes:
- ./nextcloud_data:/var/www/html
env_file: nextcloud.env
depends_on:
- db
- redis
mem_limit: 1g
cpus: 3
fulltextsearchindex:
build:
context: nextcloud_build
pull: true
image: nextcloud_local
restart: always
working_dir: /var/www/html
command: /var/www/html/occ fulltextsearch:live -q
user: '33:33'
volumes:
- ./nextcloud_data:/var/www/html
env_file: nextcloud.env
depends_on:
- db
- elasticsearch
mem_limit: 100m
cpus: 1
notify_push:
build:
context: nextcloud_build
pull: true
image: nextcloud_local
working_dir: /var/www/html/config
command: /var/www/html/custom_apps/notify_push/bin/x86_64/notify_push config.php
restart: always
volumes:
- ./nextcloud_data:/var/www/html:ro
env_file: nextcloud.env
environment:
RUST_BACKTRACE: full
COLORBT_SHOW_HIDDEN: 1
# NEXTCLOUD_URL: http://nextcloud/
depends_on:
- nextcloud
ports:
- "8004:7867"
mem_limit: 150m
db:
image: postgres:15
restart: always
env_file: postgres.env
volumes:
- ./db_data:/var/lib/postgresql/data
mem_limit: 1g
redis:
image: redis:7
restart: always
mem_limit: 150m
elasticsearch:
image: custom-elastic
build:
context: ./elasticsearch/
pull: true
args:
ELASTIC_VERSION: "8.9.2"
restart: always
env_file: elasticsearch.env
mem_limit: 8g
volumes:
- ./elastic_data:/usr/share/elasticsearch/data
- ./elastic_backups:/backups
kibana:
image: docker.elastic.co/kibana/kibana:8.9.1
restart: always
env_file: kibana.env
ports:
- "9009:5601"
volumes:
- ./kibana_data:/usr/share/kibana/data
- ./elastic_backups:/backups
depends_on:
- elasticsearch

View file

@ -0,0 +1,2 @@
#!/bin/bash
docker compose build --pull elasticsearch nextcloud; docker compose pull kibana redis db; docker compose up -d

View file

@ -0,0 +1,35 @@
---
- name: Nextcloud
hosts: servers
gather_facts: false
tasks:
- name: Docker
ansible.builtin.include_role:
name: docker
vars:
docker_app_name: nextcloud
elastic_password: !vault |
$ANSIBLE_VAULT;1.1;AES256
64313934396132333838376166663339376237643937366632636637323330303933343166303536
3138643465363162666237663032663165313837643763620a346662613162353337313436346335
63323765626463613535326564643262646431616531396361393864356237383663646666643330
3230653437316139630a653362653732626565353636383965303235633536646331313938613539
61313532653930333564613461363937643930313334373665353066323737346664
kibana_password: !vault |
$ANSIBLE_VAULT;1.1;AES256
66326232323830316662373432326633396462366365656232306330343531363935393835306263
3963323930343533353336386633313465386264366130610a376331643364363436306161373239
66333833373038393761626438646530373831666637366634643462343936386635633135663436
6435336238376132610a303230613730313164653633656432633433356465643839376434396339
37633034623438623561373634653737323963326137663964396362356339326461
postgres_password: !vault |
$ANSIBLE_VAULT;1.1;AES256
33656534393864633765356638633666343931396439343133643966333534383430373561386539
3266316439626465386234636533656231333930356632390a336631376266653038383837613861
33666239333333363536363338343639653535666161643965643338363562333230646263303032
3861623231343265640a663030316336393230633734643036633738393837353735313335343535
63383663363366336236653361623732383135333037613432393466626632353830323063663838
61333133303962363931633637646237343433303361656232653038323935623932333836663535
38613534316332393364363034366535373037373861363736613639656362643564393932356465
65626462626363633930

View file

@ -0,0 +1,6 @@
discovery.type=single-node
xpack.security.enabled=true
ES_JAVA_OPTS=-Xms2g -Xmx2g
ELASTIC_PASSWORD={{ elastic_password }}
KIBANA_PASSWORD={{ kibana_password }}
path.repo=/backups

View file

@ -0,0 +1,3 @@
ELASTICSEARCH_HOSTS=http://elasticsearch:9200
ELASTICSEARCH_USERNAME=kibana_system
ELASTICSEARCH_PASSWORD={{ kibana_password }}

View file

@ -0,0 +1,12 @@
POSTGRES_DB=nextcloud
POSTGRES_USER=nextcloud
POSTGRES_PASSWORD={{ postgres_password }}
POSTGRES_HOST=db
NEXTCLOUD_TRUSTED_DOMAINS=cloud.augendre.info
REDIS_HOST=redis
OVERWRITEHOST=cloud.augendre.info
OVERWRITEPROTOCOL=https
TRUSTED_PROXIES=172.0.0.0/8
APACHE_DISABLE_REWRITE_IP=1

View file

@ -0,0 +1,2 @@
POSTGRES_USER=nextcloud
POSTGRES_PASSWORD={{ postgres_password }}