From c128b49eb2747a29181ad01c7fada0a444a232dc Mon Sep 17 00:00:00 2001 From: Darren <27513732@qq.com> Date: Mon, 15 Jan 2024 12:11:11 +0800 Subject: [PATCH] add duplicati --- apps/duplicati/.env | 27 ++++++++++++++ apps/duplicati/CHANGELOG.md | 5 +++ apps/duplicati/Notes.md | 1 + apps/duplicati/docker-compose.yml | 25 +++++++++++++ apps/duplicati/src/README.md | 3 ++ apps/duplicati/src/after_up.sh | 1 + apps/duplicati/src/encrypt.sh | 12 ++++++ apps/duplicati/src/filelist | 3 ++ apps/duplicati/src/get_version.sh | 1 + apps/duplicati/src/nginx-proxy.conf | 57 +++++++++++++++++++++++++++++ apps/duplicati/src/php_exra.ini | 8 ++++ apps/duplicati/src/replace_url.sh | 1 + apps/duplicati/variables.json | 18 +++++++++ 13 files changed, 162 insertions(+) create mode 100644 apps/duplicati/.env create mode 100644 apps/duplicati/CHANGELOG.md create mode 100644 apps/duplicati/Notes.md create mode 100644 apps/duplicati/docker-compose.yml create mode 100644 apps/duplicati/src/README.md create mode 100644 apps/duplicati/src/after_up.sh create mode 100644 apps/duplicati/src/encrypt.sh create mode 100644 apps/duplicati/src/filelist create mode 100644 apps/duplicati/src/get_version.sh create mode 100644 apps/duplicati/src/nginx-proxy.conf create mode 100644 apps/duplicati/src/php_exra.ini create mode 100644 apps/duplicati/src/replace_url.sh create mode 100644 apps/duplicati/variables.json diff --git a/apps/duplicati/.env b/apps/duplicati/.env new file mode 100644 index 000000000..6cb0a01de --- /dev/null +++ b/apps/duplicati/.env @@ -0,0 +1,27 @@ +W9_REPO=lscr.io/linuxserver/duplicati +W9_DIST=community +W9_VERSION=latest + +W9_POWER_PASSWORD=1PrMxExC45LsCT + + +#### -- Not allowed to edit below environments when recreate app based on existing data -- #### + +W9_ID=duplicati +W9_HTTP_PORT=8200 +W9_HTTP_PORT_SET=9001 + +W9_URL=internet_ip +W9_NETWORK=websoft9 + +#### ----------------------------------------------------------------------------------------- #### + + +# Below environment is created by duplicati + +TZ=Etc/UTC + +# PUID and PGID not need because we use named volumes +#PUID=1000 +#PGID=1000 +# CLI_ARGS= \ No newline at end of file diff --git a/apps/duplicati/CHANGELOG.md b/apps/duplicati/CHANGELOG.md new file mode 100644 index 000000000..582cf46c5 --- /dev/null +++ b/apps/duplicati/CHANGELOG.md @@ -0,0 +1,5 @@ +# CHANGELOG + +## Release +### Fixes and Enhancements + diff --git a/apps/duplicati/Notes.md b/apps/duplicati/Notes.md new file mode 100644 index 000000000..edc208ca9 --- /dev/null +++ b/apps/duplicati/Notes.md @@ -0,0 +1 @@ +# Duplicati diff --git a/apps/duplicati/docker-compose.yml b/apps/duplicati/docker-compose.yml new file mode 100644 index 000000000..1bfd6103e --- /dev/null +++ b/apps/duplicati/docker-compose.yml @@ -0,0 +1,25 @@ +# image,docs: https://hub.docker.com/r/linuxserver/duplicati + +version: '3.8' + +services: + + wordpress: + image: $W9_REPO:$W9_VERSION + container_name: $W9_ID + restart: unless-stopped + ports: + - $W9_HTTP_PORT_SET:80 + env_file: .env + volumes: + - config:/config + - backups:/backups + - source:/source +volumes: + config: + backups: + source: +networks: + default: + name: $W9_NETWORK + external: true \ No newline at end of file diff --git a/apps/duplicati/src/README.md b/apps/duplicati/src/README.md new file mode 100644 index 000000000..cdbd7a0b9 --- /dev/null +++ b/apps/duplicati/src/README.md @@ -0,0 +1,3 @@ +# About + +This folder includes files mount to container and used by Websoft9 diff --git a/apps/duplicati/src/after_up.sh b/apps/duplicati/src/after_up.sh new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/apps/duplicati/src/after_up.sh @@ -0,0 +1 @@ + diff --git a/apps/duplicati/src/encrypt.sh b/apps/duplicati/src/encrypt.sh new file mode 100644 index 000000000..2939685f7 --- /dev/null +++ b/apps/duplicati/src/encrypt.sh @@ -0,0 +1,12 @@ +#!/bin/bash +export PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin +clear + + + +# Add encrypt script below if use W9_ENCRYPT_PASSWORD at .env file +# ------------- start ------------------------- + + + +# ------------- end --------------------------- diff --git a/apps/duplicati/src/filelist b/apps/duplicati/src/filelist new file mode 100644 index 000000000..341240aed --- /dev/null +++ b/apps/duplicati/src/filelist @@ -0,0 +1,3 @@ +docker-compose.yml +script/test.sh +docker \ No newline at end of file diff --git a/apps/duplicati/src/get_version.sh b/apps/duplicati/src/get_version.sh new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/apps/duplicati/src/get_version.sh @@ -0,0 +1 @@ + diff --git a/apps/duplicati/src/nginx-proxy.conf b/apps/duplicati/src/nginx-proxy.conf new file mode 100644 index 000000000..951364ffe --- /dev/null +++ b/apps/duplicati/src/nginx-proxy.conf @@ -0,0 +1,57 @@ +proxy_busy_buffers_size 512k; +proxy_buffers 4 512k; +proxy_buffer_size 256k; +client_max_body_size 50m; +# override default location / +location / { + add_header X-Served-By $host; + proxy_set_header Host $host; + proxy_set_header X-Forwarded-Scheme $scheme; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Real-IP $remote_addr; + proxy_pass $forward_scheme://$server:$port$request_uri; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection upgrade; + } + +location /console { + proxy_pass http://$server:8080; + proxy_http_version 1.1; + proxy_set_header Host $http_host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; +} + +# for echo some useful information +location / { + default_type text/plain; + return 200 'Hello World'; +} + +location /oida/ { +# this is the address and port of the ORDS installation +proxy_pass http://127.0.0.1:8080/ords/; + +# set Origin to blank to avoid Chrome problems with CORS +proxy_set_header Origin "" ; + +# pass along some header variables with the public host name/port/and so on +proxy_set_header Host $host; +proxy_set_header X-Forwarded-Host $host:$server_port; +proxy_set_header X-Real-IP $remote_addr; +proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; +proxy_set_header X-Forwarded-Proto $scheme; + +# this reverse proxies any "location" headers being passed in the response +proxy_redirect http://$host/ords/ https://$host/oida/; + +# also tell cookies their public path +proxy_cookie_path /ords/ /oida/; + +# reverse proxy links included in response (ie from ORDS webservice) +sub_filter_types application/json ; +sub_filter http://$host/ords/ https://$host/oida/; +sub_filter_once off; +} diff --git a/apps/duplicati/src/php_exra.ini b/apps/duplicati/src/php_exra.ini new file mode 100644 index 000000000..085d38831 --- /dev/null +++ b/apps/duplicati/src/php_exra.ini @@ -0,0 +1,8 @@ +file_uploads = On +max_input_time = 800 +max_execution_time = 300 +memory_limit = 600M +upload_max_filesize = 900M +post_max_size = 900M +max_file_uploads = 200 +error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT \ No newline at end of file diff --git a/apps/duplicati/src/replace_url.sh b/apps/duplicati/src/replace_url.sh new file mode 100644 index 000000000..f737258b3 --- /dev/null +++ b/apps/duplicati/src/replace_url.sh @@ -0,0 +1 @@ +# some application have write url to database or config file, once replaced url at .env, it should replace it at config file or database \ No newline at end of file diff --git a/apps/duplicati/variables.json b/apps/duplicati/variables.json new file mode 100644 index 000000000..d7458742d --- /dev/null +++ b/apps/duplicati/variables.json @@ -0,0 +1,18 @@ +{ + "name": "duplicati", + "trademark": "Duplicati", + "release": true, + "fork_url": "https://hub.docker.com/r/linuxserver/duplicati", + "edition": [ + { + "dist": "community", + "version": ["2.0.7","latest"] + } + ], + "requirements": { + "cpu": "1", + "memory": "1", + "disk": "1", + "url": "https://duplicati.readthedocs.io/en/latest/02-installation/#prerequisites" + } +}