This commit is contained in:
2023-09-26 18:14:36 -06:00
commit fb5a0fc542
443 changed files with 21892 additions and 0 deletions

5
NextCloud/.db.env Normal file
View File

@@ -0,0 +1,5 @@
TZ=America/Denver
MYSQL_ROOT_PASSWORD=SUPER_SECRET
MYSQL_DATABASE=nextcloud
MYSQL_USER=admin
MYSQL_PASSWORD=SUPER_SUPER_SECRET

110
NextCloud/.drone.yml Normal file
View File

@@ -0,0 +1,110 @@
---
kind: pipeline
type: docker
name: deploy
environment:
PACKAGE: NextCloud
URL: nextcloud.alexlebens.net
steps:
- name: Tests
image: ps03fd.alexlebens.net:5000/droneimage:latest
commands:
- /scripts/tests.sh
- name: Nofification > Discord | Tests - Failure
image: appleboy/drone-discord
settings:
webhook_id:
from_secret: discord_webhook_id
webhook_token:
from_secret: discord_webhook_token
username: DroneCI - ps03fd
message: Docker compose validation for NextCloud failed.
when:
status:
- failure
- name: Configuration
image: ps03fd.alexlebens.net:5000/droneimage:latest
commands:
- mkdir ~/.ssh/
- echo "$SSH_KEY" > ~/.ssh/id_rsa
- chmod 600 ~/.ssh/id_rsa
- ssh-keyscan -H $HOST_IP >> ~/.ssh/known_hosts
- /scripts/configuration.sh
environment:
SSH_KEY:
from_secret: ssh_key_ps03fd_drone
DOCKER_HOST:
from_secret: docker_host_ps03fd
HOST_IP:
from_secret: host_ip_ps03fd
UPTIMEKUMA_NAME:
from_secret: uptimekuma_name
UPTIMEKUMA_PASSWORD:
from_secret: uptimekuma_password
UPTIMEKUMA_URL:
from_secret: uptimekuma_url
when:
branch:
- main
- name: Nofification > Discord | Configuration - Failure
image: appleboy/drone-discord
settings:
webhook_id:
from_secret: discord_webhook_id
webhook_token:
from_secret: discord_webhook_token
username: DroneCI - ps03fd
message: Configuration for NextCloud failed.
when:
status:
- failure
- name: Deploy
image: ps03fd.alexlebens.net:5000/droneimage:latest
commands:
- mkdir ~/.ssh/
- echo "$SSH_KEY" > ~/.ssh/id_rsa
- chmod 600 ~/.ssh/id_rsa
- ssh-keyscan -H $HOST_IP >> ~/.ssh/known_hosts
- /scripts/deploy.sh
environment:
SSH_KEY:
from_secret: ssh_key_ps03fd_drone
DOCKER_HOST:
from_secret: docker_host_ps03fd
HOST_IP:
from_secret: host_ip_ps03fd
when:
branch:
- main
- name: Nofification > Discord | Deploy - Success
image: appleboy/drone-discord
settings:
webhook_id:
from_secret: discord_webhook_id
webhook_token:
from_secret: discord_webhook_token
username: DroneCI - ps03fd
message: Docker compose deployment for NextCloud succeeded
when:
status:
- sucess
- name: Nofification > Discord | Deploy - Failure
image: appleboy/drone-discord
settings:
webhook_id:
from_secret: discord_webhook_id
webhook_token:
from_secret: discord_webhook_token
username: DroneCI - ps03fd
message: Docker compose deployment for NextCloud failed.
when:
status:
- failure

6
NextCloud/.env Normal file
View File

@@ -0,0 +1,6 @@
REDIS_HOST=nextcloud_redis
MYSQL_HOST=nextcloud_mariadb:3306
MYSQL_DATABASE=nextcloud
MYSQL_USER=admin
MYSQL_PASSWORD=SUPER_SUPER_SECRET
TRUSTED_PROXIES=treafik

3
NextCloud/README.md Normal file
View File

@@ -0,0 +1,3 @@
# NextCloud
[![Build Status](https://drone.alexlebens.net/api/badges/alexlebens/NextCloud/status.svg)](https://drone.alexlebens.net/alexlebens/NextCloud)

View File

@@ -0,0 +1,17 @@
{
"type": "docker",
"name": "NextCloud MariaDB - Docker",
"interval": 60,
"retryInterval": 20,
"maxretries": 1,
"notificationIDList": [
3,
4
],
"url": "https://nextcloud.alexlebens.net",
"accepted_statuscodes": [
"200-299"
],
"docker_container": "nextcloud_mariadb",
"docker_host": 1
}

View File

@@ -0,0 +1,17 @@
{
"type": "docker",
"name": "NextCloud Redis - Docker",
"interval": 60,
"retryInterval": 20,
"maxretries": 1,
"notificationIDList": [
3,
4
],
"url": "https://nextcloud.alexlebens.net",
"accepted_statuscodes": [
"200-299"
],
"docker_container": "nextcloud_redis",
"docker_host": 1
}

View File

@@ -0,0 +1,17 @@
{
"type": "docker",
"name": "NextCloud Server - Docker",
"interval": 60,
"retryInterval": 20,
"maxretries": 1,
"notificationIDList": [
3,
4
],
"url": "https://nextcloud.alexlebens.net",
"accepted_statuscodes": [
"200-299"
],
"docker_container": "nextcloud_server",
"docker_host": 1
}

View File

@@ -0,0 +1,15 @@
{
"type": "http",
"name": "NextCloud - Web",
"interval": 60,
"retryInterval": 20,
"maxretries": 1,
"notificationIDList": [
3,
4
],
"url": "https://nextcloud.alexlebens.net",
"accepted_statuscodes": [
"200-299"
]
}

View File

@@ -0,0 +1,101 @@
services:
mariadb:
container_name: nextcloud_mariadb
env_file:
- .db.env
image: mariadb:10
logging:
driver: json-file
options:
max-size: 50m
max-file: "3"
networks:
traefik:
ipv4_address: 172.27.1.91
restart: always
volumes:
- db:/var/lib/mysql
redis:
container_name: nextcloud_redis
image: redis:6
logging:
driver: json-file
options:
max-size: 50m
max-file: "3"
networks:
traefik: null
restart: always
volumes:
- redis:/var/lib/redis
- redis_data:/data
nextcloud:
container_name: nextcloud_server
depends_on:
- mariadb
- redis
env_file:
- .env
image: nextcloud:stable
labels:
traefik.docker.network: traefik
traefik.enable: true
traefik.http.routers.nextcloud.entrypoints: websecure
traefik.http.routers.nextcloud.rule: Host(`nextcloud.alexlebens.net`)
traefik.http.routers.nextcloud.service: nextcloud-nextcloud
traefik.http.routers.nextcloud.middlewares: nextcloud,nextcloud_redirect
traefik.http.middlewares.nextcloud.headers.customFrameOptionsValue: ALLOW-FROM https://nextcloud.alexlebens.net
traefik.http.middlewares.nextcloud.headers.contentSecurityPolicy: frame-ancestors 'self' nextcloud.alexlebens.net *.nextcloud.alexlebens.net
traefik.http.middlewares.nextcloud.headers.stsSeconds: 155520011
traefik.http.middlewares.nextcloud.headers.stsIncludeSubdomains: true
traefik.http.middlewares.nextcloud.headers.stsPreload: true
traefik.http.middlewares.nextcloud.headers.customresponseheaders.X-Frame-Options: SAMEORIGIN
traefik.http.middlewares.nextcloud_redirect.redirectregex.permanent: true
traefik.http.middlewares.nextcloud_redirect.redirectregex.regex: https://(.*)/.well-known/(card|cal)dav
traefik.http.middlewares.nextcloud_redirect.redirectregex.replacement: https://$${1}/remote.php/dav/
logging:
driver: json-file
options:
max-size: 50m
max-file: "3"
networks:
traefik: null
restart: always
volumes:
- data:/var/www/html
networks:
traefik:
name: traefik
external: true
volumes:
db:
driver: local
driver_opts:
type: none
o: bind
device: /var/lib/docker/volumes/partition/nextcloud_db
redis:
driver: local
driver_opts:
type: none
o: bind
device: /var/lib/docker/volumes/partition/nextcloud_redis
redis_data:
driver: local
driver_opts:
type: none
o: bind
device: /var/lib/docker/volumes/partition/nextcloud_redis_data
data:
driver: local
driver_opts:
type: none
o: bind
device: /var/lib/docker/volumes/partition/nextcloud_data