Compare commits
35 Commits
2599ec5c08
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| c22771560d | |||
| 051542c98c | |||
| 7f059fa931 | |||
| c2ed4e6661 | |||
| c492269972 | |||
| 2982e9614f | |||
| 41ab2dc096 | |||
| da4b9c25b1 | |||
| d4887b4ed6 | |||
| 48486429d7 | |||
| 7cb910397f | |||
| cfd50275fe | |||
| ddd57432e5 | |||
| 2f35fcab1c | |||
| 0b2fdcf86d | |||
| b12c5fdc88 | |||
| 24f55efe42 | |||
| d72874c7ed | |||
| 2653e36e69 | |||
| 46bccb73d1 | |||
| f9301cfe20 | |||
| cdd4ef5500 | |||
| f8ee71f21e | |||
| acfbbd046c | |||
| 2ce751ffed | |||
| b26e70a3ae | |||
| 32afd9dff5 | |||
| f349c94465 | |||
| b3ba74e40e | |||
| 8aeeea1e02 | |||
| 9574029b6f | |||
| 389689d188 | |||
| c119befd6f | |||
| 7de40c2c16 | |||
| 68fb61b66a |
1
.devcontainer/.gitignore
vendored
Normal file
1
.devcontainer/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
.kube/**
|
||||||
111
.devcontainer/.zshrc
Normal file
111
.devcontainer/.zshrc
Normal file
@@ -0,0 +1,111 @@
|
|||||||
|
# If you come from bash you might have to change your $PATH.
|
||||||
|
# export PATH=$HOME/bin:$HOME/.local/bin:/usr/local/bin:$PATH
|
||||||
|
|
||||||
|
# Path to your Oh My Zsh installation.
|
||||||
|
export ZSH="$HOME/.oh-my-zsh"
|
||||||
|
|
||||||
|
# Set name of the theme to load --- if set to "random", it will
|
||||||
|
# load a random theme each time Oh My Zsh is loaded, in which case,
|
||||||
|
# to know which specific one was loaded, run: echo $RANDOM_THEME
|
||||||
|
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
|
||||||
|
ZSH_THEME="gnzh"
|
||||||
|
|
||||||
|
# Set list of themes to pick from when loading at random
|
||||||
|
# Setting this variable when ZSH_THEME="devcontainers"
|
||||||
|
# a theme from this variable instead of looking in $ZSH/themes/
|
||||||
|
# If set to an empty array, this variable will have no effect.
|
||||||
|
# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" )
|
||||||
|
|
||||||
|
# Uncomment the following line to use case-sensitive completion.
|
||||||
|
# CASE_SENSITIVE="true"
|
||||||
|
|
||||||
|
# Uncomment the following line to use hyphen-insensitive completion.
|
||||||
|
# Case-sensitive completion must be off. _ and - will be interchangeable.
|
||||||
|
# HYPHEN_INSENSITIVE="true"
|
||||||
|
|
||||||
|
# Uncomment one of the following lines to change the auto-update behavior
|
||||||
|
# zstyle ':omz:update' mode disabled # disable automatic updates
|
||||||
|
# zstyle ':omz:update' mode auto # update automatically without asking
|
||||||
|
# zstyle ':omz:update' mode reminder # just remind me to update when it's time
|
||||||
|
|
||||||
|
# Uncomment the following line to change how often to auto-update (in days).
|
||||||
|
# zstyle ':omz:update' frequency 13
|
||||||
|
|
||||||
|
# Uncomment the following line if pasting URLs and other text is messed up.
|
||||||
|
# DISABLE_MAGIC_FUNCTIONS="true"
|
||||||
|
|
||||||
|
# Uncomment the following line to disable colors in ls.
|
||||||
|
# DISABLE_LS_COLORS="true"
|
||||||
|
|
||||||
|
# Uncomment the following line to disable auto-setting terminal title.
|
||||||
|
# DISABLE_AUTO_TITLE="true"
|
||||||
|
|
||||||
|
# Uncomment the following line to enable command auto-correction.
|
||||||
|
# ENABLE_CORRECTION="true"
|
||||||
|
|
||||||
|
# Uncomment the following line to display red dots whilst waiting for completion.
|
||||||
|
# You can also set it to another string to have that shown instead of the default red dots.
|
||||||
|
# e.g. COMPLETION_WAITING_DOTS="%F{yellow}waiting...%f"
|
||||||
|
# Caution: this setting can cause issues with multiline prompts in zsh < 5.7.1 (see #5765)
|
||||||
|
# COMPLETION_WAITING_DOTS="true"
|
||||||
|
|
||||||
|
# Uncomment the following line if you want to disable marking untracked files
|
||||||
|
# under VCS as dirty. This makes repository status check for large repositories
|
||||||
|
# much, much faster.
|
||||||
|
# DISABLE_UNTRACKED_FILES_DIRTY="true"
|
||||||
|
|
||||||
|
# Uncomment the following line if you want to change the command execution time
|
||||||
|
# stamp shown in the history command output.
|
||||||
|
# You can set one of the optional three formats:
|
||||||
|
# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
|
||||||
|
# or set a custom format using the strftime function format specifications,
|
||||||
|
# see 'man strftime' for details.
|
||||||
|
# HIST_STAMPS="mm/dd/yyyy"
|
||||||
|
|
||||||
|
# Would you like to use another custom folder than $ZSH/custom?
|
||||||
|
# ZSH_CUSTOM=/path/to/new-custom-folder
|
||||||
|
|
||||||
|
# Which plugins would you like to load?
|
||||||
|
# Standard plugins can be found in $ZSH/plugins/
|
||||||
|
# Custom plugins may be added to $ZSH_CUSTOM/plugins/
|
||||||
|
# Example format: plugins=(rails git textmate ruby lighthouse)
|
||||||
|
# Add wisely, as too many plugins slow down shell startup.
|
||||||
|
plugins=(git timer web-search ssh kubectl helm colorize zsh-autosuggestions fast-syntax-highlighting)
|
||||||
|
ZSH_COLORIZE_TOOL=chroma
|
||||||
|
|
||||||
|
source $ZSH/oh-my-zsh.sh
|
||||||
|
|
||||||
|
# User configuration
|
||||||
|
|
||||||
|
# export MANPATH="/usr/local/man:$MANPATH"
|
||||||
|
|
||||||
|
# You may need to manually set your language environment
|
||||||
|
# export LANG=en_US.UTF-8
|
||||||
|
|
||||||
|
# Preferred editor for local and remote sessions
|
||||||
|
# if [[ -n $SSH_CONNECTION ]]; then
|
||||||
|
# export EDITOR='vim'
|
||||||
|
# else
|
||||||
|
# export EDITOR='nvim'
|
||||||
|
# fi
|
||||||
|
|
||||||
|
# Compilation flags
|
||||||
|
# export ARCHFLAGS="-arch $(uname -m)"
|
||||||
|
|
||||||
|
# Set personal aliases, overriding those provided by Oh My Zsh libs,
|
||||||
|
# plugins, and themes. Aliases can be placed here, though Oh My Zsh
|
||||||
|
# users are encouraged to define aliases within a top-level file in
|
||||||
|
# the $ZSH_CUSTOM folder, with .zsh extension. Examples:
|
||||||
|
# - $ZSH_CUSTOM/aliases.zsh
|
||||||
|
# - $ZSH_CUSTOM/macos.zsh
|
||||||
|
# For a full list of active aliases, run `alias`.
|
||||||
|
#
|
||||||
|
# Example aliases
|
||||||
|
# alias zshconfig="mate ~/.zshrc"
|
||||||
|
# alias ohmyzsh="mate ~/.oh-my-zsh"
|
||||||
|
DISABLE_AUTO_UPDATE=true
|
||||||
|
DISABLE_UPDATE_PROMPT=true
|
||||||
|
export FAST_HIGHLIGHT_CHROMA_PATH="/home/vscode/lib/chroma"
|
||||||
|
export FAST_HIGHLIGHT_CHROMA=1
|
||||||
|
export PATH=$PATH:/home/vscode/lib
|
||||||
|
|
||||||
3
.devcontainer/Dockerfile
Normal file
3
.devcontainer/Dockerfile
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
FROM mcr.microsoft.com/devcontainers/base:jammy
|
||||||
|
|
||||||
|
# Optional: install additional tools here
|
||||||
45
.devcontainer/devcontainer.json
Normal file
45
.devcontainer/devcontainer.json
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
|
||||||
|
// README at: https://github.com/devcontainers/templates/tree/main/src/ubuntu
|
||||||
|
{
|
||||||
|
"name": "cloud-limbosolutions-com-dev",
|
||||||
|
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
|
||||||
|
"build": {
|
||||||
|
"dockerfile": "Dockerfile"
|
||||||
|
},
|
||||||
|
"features": {
|
||||||
|
"ghcr.io/devcontainers/features/kubectl-helm-minikube:1": {}
|
||||||
|
},
|
||||||
|
"runArgs": ["--hostname=cloud-limbosolutions-com-dev-container"],
|
||||||
|
// "features": {},
|
||||||
|
|
||||||
|
// Use 'forwardPorts' to make a list of ports inside the container available locally.
|
||||||
|
// "forwardPorts": [],
|
||||||
|
// Configure tool-specific properties.
|
||||||
|
// "customizations": {},
|
||||||
|
|
||||||
|
"mounts": [
|
||||||
|
"source=${localWorkspaceFolder}/.devcontainer/.zshrc,target=/home/vscode/.zshrc,type=bind",
|
||||||
|
"source=${localWorkspaceFolder}/.devcontainer/.kube,target=/home/vscode/.kube,type=bind",
|
||||||
|
"source=${localEnv:HOME}/.gitconfig,target=/home/vscode/.gitconfig,type=bind,consistency=cached",
|
||||||
|
"source=${localEnv:HOME}/.ssh,target=/home/vscode/.ssh,type=bind,consistency=cached"
|
||||||
|
],
|
||||||
|
"remoteEnv": {
|
||||||
|
|
||||||
|
},
|
||||||
|
"postCreateCommand": "bash .devcontainer/scripts/postCreate.sh",
|
||||||
|
"customizations": {
|
||||||
|
"vscode": {
|
||||||
|
"extensions": [
|
||||||
|
"ms-kubernetes-tools.vscode-kubernetes-tools",
|
||||||
|
"mtxr.sqltools-driver-mysql",
|
||||||
|
"stateful.runme",
|
||||||
|
"yzhang.markdown-all-in-one",
|
||||||
|
"davidanson.vscode-markdownlint",
|
||||||
|
"eamodio.gitlens"
|
||||||
|
],
|
||||||
|
"settings": {
|
||||||
|
"terminal.integrated.defaultProfile.linux": "zsh"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
11
.devcontainer/scripts/postCreate.sh
Normal file
11
.devcontainer/scripts/postCreate.sh
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
#!/bin/zsh
|
||||||
|
|
||||||
|
#setup chroma for zsh colorize
|
||||||
|
mkdir -p ~/lib
|
||||||
|
curl -Lo ~/lib/chroma https://github.com/alecthomas/chroma/releases/latest/download/chroma-linux-amd64
|
||||||
|
chmod +x ~/lib/chroma
|
||||||
|
|
||||||
|
git clone https://github.com/zdharma-continuum/fast-syntax-highlighting.git ~/.oh-my-zsh/custom/plugins/fast-syntax-highlighting
|
||||||
|
git clone https://github.com/zsh-users/zsh-autosuggestions ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions
|
||||||
|
|
||||||
|
|
||||||
4
.gitignore
vendored
Normal file
4
.gitignore
vendored
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
**.env.**
|
||||||
|
.env
|
||||||
|
localSettings
|
||||||
|
archive
|
||||||
99
README.md
99
README.md
@@ -1,5 +1,98 @@
|
|||||||
# nextcloud-utils
|
# cloud.limbosolutions.com
|
||||||
|
|
||||||
caso seja necessário forçar o scan de ficheiros
|
Welcome to public repository of [https://cloud.limbosolutions.com](https://cloud.limbosolutions.com)
|
||||||
docker exec --user www-data nextcloud php occ files:scan USERNAME
|
|
||||||
|
|
||||||
|
Using [NextCloud](https://nextcloud.com/)
|
||||||
|
|
||||||
|
- [command](#command)
|
||||||
|
- [maintenance mode](#maintenance-mode)
|
||||||
|
- [scan files](#scan-files)
|
||||||
|
- [preview generator](#preview-generator)
|
||||||
|
- [repair tree](#repair-tree)
|
||||||
|
- [delete file locks](#delete-file-locks)
|
||||||
|
- [Setup](#setup)
|
||||||
|
- [kubernetes Namespace](#kubernetes-namespace)
|
||||||
|
- [Add helm chart](#add-helm-chart)
|
||||||
|
- [Update Helm chart](#update-helm-chart)
|
||||||
|
- [Install / Update](#install--update)
|
||||||
|
|
||||||
|
## command
|
||||||
|
|
||||||
|
``` bash
|
||||||
|
su -s /bin/bash www-data -c "php occ upgrade;"
|
||||||
|
```
|
||||||
|
|
||||||
|
## maintenance mode
|
||||||
|
|
||||||
|
``` bash
|
||||||
|
su -s /bin/bash www-data -c "php -d memory_limit=-1 /var/www/html/occ maintenance:mode --on;"
|
||||||
|
su -s /bin/bash www-data -c "php -d memory_limit=-1 /var/www/html/occ maintenance:mode --off"
|
||||||
|
```
|
||||||
|
|
||||||
|
### scan files
|
||||||
|
|
||||||
|
``` bash
|
||||||
|
su -s /bin/bash www-data -c "php -d memory_limit=-1 /var/www/html/occ files:scan --all"
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
### preview generator
|
||||||
|
|
||||||
|
<https://apps.nextcloud.com/apps/previewgenerator>
|
||||||
|
|
||||||
|
``` bash
|
||||||
|
su -s /bin/bash www-data -c "./occ preview:generate-all -vvv"
|
||||||
|
su -s /bin/bash www-data -c "./occ preview:generate-all --path=marcio.fernandes/files/Photos -vvv"
|
||||||
|
```
|
||||||
|
|
||||||
|
``` bash
|
||||||
|
# cron job
|
||||||
|
php /var/www/nextcloud/occ preview:pre-generate
|
||||||
|
```
|
||||||
|
|
||||||
|
### repair tree
|
||||||
|
|
||||||
|
``` bash
|
||||||
|
su -s /bin/bash www-data -c "php occ files:repair-tree"
|
||||||
|
```
|
||||||
|
|
||||||
|
### delete file locks
|
||||||
|
|
||||||
|
``` bash
|
||||||
|
# execute on mariadb
|
||||||
|
DELETE FROM oc_file_locks WHERE 1;
|
||||||
|
```
|
||||||
|
|
||||||
|
## Setup
|
||||||
|
|
||||||
|
### kubernetes Namespace
|
||||||
|
|
||||||
|
``` yaml
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Namespace
|
||||||
|
metadata:
|
||||||
|
name: cloud-limbosolutions-com
|
||||||
|
labels:
|
||||||
|
name: cloud-limbosolutions-com
|
||||||
|
```
|
||||||
|
|
||||||
|
### Add helm chart
|
||||||
|
|
||||||
|
``` bash
|
||||||
|
helm repo add nextcloud https://nextcloud.github.io/helm/
|
||||||
|
```
|
||||||
|
|
||||||
|
### Update Helm chart
|
||||||
|
|
||||||
|
```bash
|
||||||
|
helm repo update nextcloud
|
||||||
|
```
|
||||||
|
|
||||||
|
### Install / Update
|
||||||
|
|
||||||
|
``` bash
|
||||||
|
helm upgrade --install nextcloud nextcloud/nextcloud \
|
||||||
|
--values ./nextcloud/values.yaml \
|
||||||
|
--values ./nextcloud/values.local.yaml \
|
||||||
|
--namespace=cloud-limbosolutions-com
|
||||||
|
```
|
||||||
|
|||||||
@@ -1,50 +0,0 @@
|
|||||||
version: '2'
|
|
||||||
services:
|
|
||||||
db:
|
|
||||||
image: mariadb:10.5
|
|
||||||
restart: always
|
|
||||||
command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
|
|
||||||
volumes:
|
|
||||||
- db:/var/lib/mysql
|
|
||||||
environment:
|
|
||||||
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
|
|
||||||
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
|
|
||||||
- MYSQL_DATABASE=${MYSQL_DATABASE}
|
|
||||||
- MYSQL_USER=${MYSQL_USER}
|
|
||||||
app:
|
|
||||||
image: nextcloud-smbclient:latest
|
|
||||||
restart: always
|
|
||||||
ports:
|
|
||||||
- ${APP_PORT}:80
|
|
||||||
links:
|
|
||||||
- db
|
|
||||||
volumes:
|
|
||||||
- html:/var/www/html
|
|
||||||
environment:
|
|
||||||
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
|
|
||||||
- MYSQL_DATABASE=${MYSQL_DATABASE}
|
|
||||||
- MYSQL_USER=${MYSQL_USER}
|
|
||||||
- MYSQL_HOST=${MYSQL_HOST}
|
|
||||||
- PHP_MEMORY_LIMIT=2048M
|
|
||||||
duplicati:
|
|
||||||
image: duplicati-sqlclient:latest
|
|
||||||
environment:
|
|
||||||
- DB_HOST=${MYSQL_HOST}
|
|
||||||
- DB_NAME=${MYSQL_DATABASE}
|
|
||||||
- DB_USER=${MYSQL_USER}
|
|
||||||
- DB_PASSWORD=${MYSQL_PASSWORD}
|
|
||||||
- DB_BACKUP_TARGETFOLDER=${DB_BACKUP_TARGETFOLDER}
|
|
||||||
volumes:
|
|
||||||
- duplicati_data:/data
|
|
||||||
- db:/backup/db_data:ro
|
|
||||||
- html:/backup/app_data:ro
|
|
||||||
- duplicati_data:/backup/duplicati_data:ro
|
|
||||||
- db-dumps:${DB_BACKUP_TARGETFOLDER}
|
|
||||||
ports:
|
|
||||||
- ${DUPLICATI_PORT}:8200
|
|
||||||
restart: unless-stopped
|
|
||||||
volumes:
|
|
||||||
html:
|
|
||||||
db:
|
|
||||||
duplicati_data:
|
|
||||||
db-dumps:
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
FROM nextcloud:24.0
|
|
||||||
RUN apt update;apt install -y smbclient libsmbclient-dev;
|
|
||||||
129
jobs/backup/backup-cronjob.yaml
Normal file
129
jobs/backup/backup-cronjob.yaml
Normal file
@@ -0,0 +1,129 @@
|
|||||||
|
apiVersion: batch/v1
|
||||||
|
kind: CronJob
|
||||||
|
metadata:
|
||||||
|
name: backup
|
||||||
|
namespace: cloud-limbosolutions-com
|
||||||
|
spec:
|
||||||
|
schedule: "0 2 * * *"
|
||||||
|
jobTemplate:
|
||||||
|
spec:
|
||||||
|
backoffLimit: 1
|
||||||
|
template:
|
||||||
|
spec:
|
||||||
|
restartPolicy: Never
|
||||||
|
initContainers:
|
||||||
|
- name: mariadb-client
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
memory: "512Mi"
|
||||||
|
cpu: "500m"
|
||||||
|
requests:
|
||||||
|
memory: "256Mi"
|
||||||
|
cpu: "250m"
|
||||||
|
image: alpine/mysql
|
||||||
|
command: ["sh", "-c"]
|
||||||
|
args:
|
||||||
|
- |
|
||||||
|
set -e
|
||||||
|
mkdir -p /data/mariadb-export
|
||||||
|
echo "TRACE: Exporting database"
|
||||||
|
#mysqldump --column-statistics=0 -u ${MYSQL_USER} -h ${MYSQL_HOST} ${MYSQL_DB} > /data/mariadb-export/backup.sql
|
||||||
|
mysqldump -u ${MYSQL_USER} -h ${MYSQL_HOST} ${MYSQL_DB} > /data/mariadb-export/backup.sql
|
||||||
|
echo "TRACE: Exporting database finished"
|
||||||
|
|
||||||
|
env:
|
||||||
|
- name: MYSQL_USER
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: nextcloud-db
|
||||||
|
key: db-username
|
||||||
|
|
||||||
|
- name: MYSQL_PWD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: nextcloud-db
|
||||||
|
key: db-password
|
||||||
|
|
||||||
|
- name: MYSQL_DB
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: backup-secret
|
||||||
|
key: DB_NAME
|
||||||
|
|
||||||
|
- name: MYSQL_HOST
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: backup-secret
|
||||||
|
key: DB_HOST
|
||||||
|
|
||||||
|
volumeMounts:
|
||||||
|
- name: backup-var
|
||||||
|
mountPath: /data/mariadb-export
|
||||||
|
subPath: mariadb-export
|
||||||
|
|
||||||
|
|
||||||
|
containers:
|
||||||
|
- name: gitea-pbs-client
|
||||||
|
image: git.limbosolutions.com/kb/pbsclient
|
||||||
|
env:
|
||||||
|
- name: MODE
|
||||||
|
value: shell
|
||||||
|
- name: PBS_REPOSITORY
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: backup-secret
|
||||||
|
key: PBS_REPOSITORY
|
||||||
|
- name: PBS_PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: backup-secret
|
||||||
|
key: PBS_PASSWORD
|
||||||
|
- name: PBS_FINGERPRINT
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: backup-secret
|
||||||
|
key: PBS_FINGERPRINT
|
||||||
|
|
||||||
|
command: ["bash", "-c"]
|
||||||
|
args:
|
||||||
|
- |
|
||||||
|
set -e
|
||||||
|
SCRIPT_START_TIME=$(date +%s)
|
||||||
|
proxmox-backup-client backup nextcloud-html.pxar:/data/nextcloud-html nextcloud-data.pxar:/data/nextcloud-data mariadb-data.pxar:/data/mariadb-data mariadb-export.pxar:/data/mariadb-export --include-dev /data/nextcloud-html --include-dev /data/nextcloud-data --include-dev /data/mariadb-data --include-dev /data/mariadb-export --backup-id "nextcloud-full" -ns cloud.limbosolutions.com && \
|
||||||
|
SCRIPT_DURATION=$(($(date +%s) - SCRIPT_START_TIME)) && \
|
||||||
|
echo "INFO: Finished Backup of cloud.limbosolutions.com ($((SCRIPT_DURATION / 60 / 60)):$((SCRIPT_DURATION / 60)):$((SCRIPT_DURATION % 60)))"
|
||||||
|
|
||||||
|
volumeMounts:
|
||||||
|
- name: nextcloud-html
|
||||||
|
mountPath: /data/nextcloud-html
|
||||||
|
|
||||||
|
- name: nextcloud-data
|
||||||
|
mountPath: /data/nextcloud-data
|
||||||
|
|
||||||
|
- name: db-data
|
||||||
|
mountPath: /data/mariadb-data
|
||||||
|
|
||||||
|
- name: backup-var
|
||||||
|
mountPath: /tmp
|
||||||
|
subPath: tmp
|
||||||
|
|
||||||
|
- name: backup-var
|
||||||
|
mountPath: /data/mariadb-export
|
||||||
|
subPath: mariadb-export
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
- name: nextcloud-html
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: nextcloud-nextcloud
|
||||||
|
|
||||||
|
- name: nextcloud-data
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: nextcloud-nextcloud-data
|
||||||
|
|
||||||
|
- name: db-data
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: data-nextcloud-mariadb-0
|
||||||
|
|
||||||
|
- name: backup-var
|
||||||
|
emptyDir: {}
|
||||||
|
|
||||||
13
jobs/backup/secret.yaml
Normal file
13
jobs/backup/secret.yaml
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Secret
|
||||||
|
metadata:
|
||||||
|
name: backup-secret
|
||||||
|
namespace: cloud-limbosolutions-com
|
||||||
|
data:
|
||||||
|
PBS_REPOSITORY: ${PBS_REPOSITORY}
|
||||||
|
PBS_PASSWORD: ${PBS_PASSWORD}
|
||||||
|
PBS_FINGERPRINT: ${PBS_FINGERPRINT}
|
||||||
|
DB_NAME: ${DB_NAME}
|
||||||
|
DB_HOST: ${DB_HOST}
|
||||||
|
# get sql client user and password from nextcloud secret
|
||||||
1
nextcloud/.gitignore
vendored
Normal file
1
nextcloud/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
**.local**.yaml
|
||||||
194
nextcloud/values.yaml
Normal file
194
nextcloud/values.yaml
Normal file
@@ -0,0 +1,194 @@
|
|||||||
|
image:
|
||||||
|
repository: nextcloud
|
||||||
|
flavor: apache
|
||||||
|
tag:
|
||||||
|
pullPolicy: Always
|
||||||
|
|
||||||
|
replicaCount: 1
|
||||||
|
|
||||||
|
|
||||||
|
internalDatabase:
|
||||||
|
enabled: false
|
||||||
|
|
||||||
|
externalDatabase:
|
||||||
|
enabled: type
|
||||||
|
type: mysql
|
||||||
|
|
||||||
|
|
||||||
|
mariadb:
|
||||||
|
enabled: true
|
||||||
|
architecture: standalone
|
||||||
|
|
||||||
|
primary:
|
||||||
|
persistence:
|
||||||
|
enabled: true
|
||||||
|
existingClaim: ""
|
||||||
|
storageClass: ""
|
||||||
|
accessMode: ReadWriteOnce
|
||||||
|
size: 8Gi
|
||||||
|
|
||||||
|
|
||||||
|
service:
|
||||||
|
type: ClusterIP
|
||||||
|
port: 8080
|
||||||
|
loadBalancerIP: ""
|
||||||
|
nodePort:
|
||||||
|
|
||||||
|
persistence:
|
||||||
|
enabled: true
|
||||||
|
accessMode: ReadWriteOnce
|
||||||
|
size: 8Gi
|
||||||
|
|
||||||
|
nextcloudData:
|
||||||
|
enabled: true
|
||||||
|
subPath:
|
||||||
|
annotations: {}
|
||||||
|
accessMode: ReadWriteOnce
|
||||||
|
size: 8Gi
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
cpu: "1"
|
||||||
|
memory: 3000Mi
|
||||||
|
requests:
|
||||||
|
cpu: "0.5"
|
||||||
|
memory: 512Mi
|
||||||
|
|
||||||
|
|
||||||
|
## Cronjob to execute Nextcloud background tasks
|
||||||
|
## ref: https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/background_jobs_configuration.html#cron
|
||||||
|
##
|
||||||
|
cronjob:
|
||||||
|
enabled: true
|
||||||
|
|
||||||
|
## Cronjob sidecar resource requests and limits
|
||||||
|
## ref: http://kubernetes.io/docs/user-guide/compute-resources/
|
||||||
|
##
|
||||||
|
resources: {}
|
||||||
|
|
||||||
|
# Allow configuration of lifecycle hooks
|
||||||
|
# ref: https://kubernetes.io/docs/tasks/configure-pod-container/attach-handler-lifecycle-event/
|
||||||
|
lifecycle: {}
|
||||||
|
# postStartCommand: []
|
||||||
|
# preStopCommand: []
|
||||||
|
# Set securityContext parameters. For example, you may need to define runAsNonRoot directive
|
||||||
|
securityContext: {}
|
||||||
|
# runAsUser: 33
|
||||||
|
# runAsGroup: 33
|
||||||
|
# runAsNonRoot: true
|
||||||
|
# readOnlyRootFilesystem: true
|
||||||
|
|
||||||
|
# The command the cronjob container executes.
|
||||||
|
command:
|
||||||
|
- /cron.sh
|
||||||
|
|
||||||
|
nextcloud:
|
||||||
|
extraVolumes:
|
||||||
|
- name: mf-documents
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: mf-documents-storage-limbosolutions-com
|
||||||
|
|
||||||
|
- name: mf-photos
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: mf-photos-storage-limbosolutions-com
|
||||||
|
|
||||||
|
- name: media-gaming
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: media-gaming-storage-limbosolutions-com
|
||||||
|
- name: media-music
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: media-music-storage-limbosolutions-com
|
||||||
|
- name: media-videos
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: media-videos-storage-limbosolutions-com
|
||||||
|
- name: it-storage
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: itstorage-storage-limbosolutions-com
|
||||||
|
|
||||||
|
- name: mf-nexcloud
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: mf-nexcloud-storage-limbosolutions-com
|
||||||
|
|
||||||
|
|
||||||
|
extraVolumeMounts:
|
||||||
|
- name: mf-nexcloud
|
||||||
|
mountPath: /var/www/html/data/marcio.fernandes/files
|
||||||
|
|
||||||
|
- name: mf-documents
|
||||||
|
mountPath: /var/www/html/data/marcio.fernandes/files/Documents
|
||||||
|
|
||||||
|
- name: mf-photos
|
||||||
|
mountPath: /var/www/html/data/marcio.fernandes/files/Photos
|
||||||
|
|
||||||
|
- name: media-gaming
|
||||||
|
mountPath: /var/www/html/data/marcio.fernandes/files/Gaming
|
||||||
|
|
||||||
|
- name: media-music
|
||||||
|
mountPath: /var/www/html/data/marcio.fernandes/files/Music
|
||||||
|
|
||||||
|
- name: media-videos
|
||||||
|
mountPath: /var/www/html/data/marcio.fernandes/files/Videos
|
||||||
|
|
||||||
|
- name: it-storage
|
||||||
|
mountPath: /var/www/html/data/marcio.fernandes/files/NeirdStorage
|
||||||
|
configs:
|
||||||
|
https.config.php: |-
|
||||||
|
<?php
|
||||||
|
$CONFIG = array (
|
||||||
|
'overwritehost' => 'cloud.limbosolutions.com',
|
||||||
|
'overwrite.cli.url' => 'https://cloud.limbosolutions.com',
|
||||||
|
'overwriteprotocol' => 'https',
|
||||||
|
'trusted_proxies' => array ( 0 => '127.0.0.1', 1 => '::1', 2 => '10.0.0.0'),
|
||||||
|
);
|
||||||
|
|
||||||
|
# A value of 1 e.g. will only run these background jobs between 01:00am UTC and 05:00am UTC:
|
||||||
|
# https://docs.nextcloud.com/server/30/admin_manual/configuration_server/background_jobs_configuration.html
|
||||||
|
maintenance.config.php: |-
|
||||||
|
<?php
|
||||||
|
$CONFIG = array (
|
||||||
|
'maintenance_window_start' => 1,
|
||||||
|
);
|
||||||
|
# nextcloud:
|
||||||
|
# configs:
|
||||||
|
# logging.config.php: |-
|
||||||
|
# <?php
|
||||||
|
# $CONFIG = array (
|
||||||
|
# 'log_type' => 'file',
|
||||||
|
# 'logfile' => 'nextcloud.log',
|
||||||
|
# 'loglevel' => 0,
|
||||||
|
# 'logdateformat' => 'F d, Y H:i:s'
|
||||||
|
# );
|
||||||
|
|
||||||
|
|
||||||
|
ingress:
|
||||||
|
enabled: true
|
||||||
|
className: traefik
|
||||||
|
annotations:
|
||||||
|
kubernetes.io/ingress.class: traefik
|
||||||
|
cert-manager.io/cluster-issuer: "letsencrypt-prod"
|
||||||
|
traefik.ingress.kubernetes.io/router.entrypoints: websecure,public-https
|
||||||
|
|
||||||
|
# traefik.public-https.redirect.permanent: 'true'
|
||||||
|
# traefik.public-https.redirect.regex: 'https://(.*)/.well-known/(?:card|cal)dav'
|
||||||
|
# traefik.public-https.redirect.replacement: 'https://$$1/remote.php/dav'
|
||||||
|
# traefik.public-https.headers.STSPreload: 'true'
|
||||||
|
# traefik.public-https.headers.STSSeconds: '15552000'
|
||||||
|
# traefik.public-https.routers.nextcloud.middlewares: 'nextcloudHeader'
|
||||||
|
|
||||||
|
# traefik.web-secure.routers.nextcloud.middlewares: 'nextcloudHeader'
|
||||||
|
# traefik.websecure.headers.STSPreload: 'true'
|
||||||
|
# traefik.websecure.headers.STSSeconds: '15552000'
|
||||||
|
# traefik.websecure.redirect.permanent: 'true'
|
||||||
|
# traefik.websecure.redirect.regex: 'https://(.*)/.well-known/(?:card|cal)dav'
|
||||||
|
# traefik.websecure.redirect.replacement: 'https://$$1/remote.php/dav'
|
||||||
|
# hosts:
|
||||||
|
# - host: cloud.limbosolutions.com
|
||||||
|
# paths:
|
||||||
|
# - path: /
|
||||||
|
# pathType: Prefix
|
||||||
|
tls:
|
||||||
|
- secretName: cloud-limbosolutions-com-secret-tls
|
||||||
|
hosts:
|
||||||
|
- "cloud.limbosolutions.com"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
112
persistance-volumes-claims.yaml
Normal file
112
persistance-volumes-claims.yaml
Normal file
@@ -0,0 +1,112 @@
|
|||||||
|
|
||||||
|
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: mf-documents-storage-limbosolutions-com
|
||||||
|
namespace: cloud-limbosolutions-com
|
||||||
|
spec:
|
||||||
|
storageClassName: "" # isto tem mesmo de ficar senão não funciona não sei pq.. tem de ficar ""
|
||||||
|
volumeName: mf-documents-storage-limbosolutions-com
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteMany
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 64Gi
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: media-music-storage-limbosolutions-com
|
||||||
|
namespace: cloud-limbosolutions-com
|
||||||
|
spec:
|
||||||
|
storageClassName: "" # isto tem mesmo de ficar senão não funciona não sei pq.. tem de ficar ""
|
||||||
|
volumeName: media-music-storage-limbosolutions-com
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteMany
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 64Gi
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: media-videos-storage-limbosolutions-com
|
||||||
|
namespace: cloud-limbosolutions-com
|
||||||
|
spec:
|
||||||
|
storageClassName: "" # isto tem mesmo de ficar senão não funciona não sei pq.. tem de ficar ""
|
||||||
|
volumeName: media-videos-storage-limbosolutions-com
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteMany
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 2000Gi
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: media-gaming-storage-limbosolutions-com
|
||||||
|
namespace: cloud-limbosolutions-com
|
||||||
|
spec:
|
||||||
|
storageClassName: "" # isto tem mesmo de ficar senão não funciona não sei pq.. tem de ficar ""
|
||||||
|
volumeName: media-gaming-storage-limbosolutions-com
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteMany
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 64Gi
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: itstorage-storage-limbosolutions-com
|
||||||
|
namespace: cloud-limbosolutions-com
|
||||||
|
spec:
|
||||||
|
storageClassName: "" # isto tem mesmo de ficar senão não funciona não sei pq.. tem de ficar ""
|
||||||
|
volumeName: itstorage-storage-limbosolutions-com
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteMany
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 1000Gi
|
||||||
|
---
|
||||||
|
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: mf-photos-storage-limbosolutions-com
|
||||||
|
namespace: cloud-limbosolutions-com
|
||||||
|
spec:
|
||||||
|
storageClassName: "" # isto tem mesmo de ficar senão não funciona não sei pq.. tem de ficar ""
|
||||||
|
volumeName: mf-photos-storage-limbosolutions-com
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteMany
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 64Gi
|
||||||
|
---
|
||||||
|
|
||||||
|
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: mf-nexcloud-storage-limbosolutions-com
|
||||||
|
namespace: cloud-limbosolutions-com
|
||||||
|
spec:
|
||||||
|
storageClassName: "" # isto tem mesmo de ficar senão não funciona não sei pq.. tem de ficar ""
|
||||||
|
volumeName: mf-nexcloud-storage-limbosolutions-com
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteMany
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 64Gi
|
||||||
|
---
|
||||||
Reference in New Issue
Block a user