10 Commits
8 changed files with 1142 additions and 88 deletions
@@ -0,0 +1,11 @@
apiVersion: v1
data:
DB_DATABASE_NAME: ZGphbmdv
DB_HOST: ZGphbmdvLWRiLXN2Yw==
DB_PASSWORD: U3VmZnJhZ2UtTW9uZXliYWdzLUlsbHVzaW9uNw==
DB_USERNAME: ZGphbmdvX3VzZXJuYW1l
kind: Secret
metadata:
creationTimestamp: null
name: django-db-credentials
namespace: django
File diff suppressed because one or more lines are too long
@@ -0,0 +1,11 @@
apiVersion: v1
data:
DB_DATABASE_NAME: aW1taWNo
DB_HOST: aW1taWNodC1kYi1zdmM=
DB_PASSWORD: U3Bvb24tQm9yb3VnaC1CYXNpczg=
DB_USERNAME: aW1taWNoX3VzZXJuYW1l
kind: Secret
metadata:
creationTimestamp: null
name: immich-db-credentials
namespace: immicht
+6 -4
View File
@@ -35,8 +35,8 @@ PROXY_HTTP="http://gluetun-svc.gluetun.svc:8888"
#BASE_URL="https://www.pornpics.com/pornstars/eiby-shine/" #BASE_URL="https://www.pornpics.com/pornstars/eiby-shine/"
#pornstars="eiby-shine" #pornstars="eiby-shine"
BASE_URL="https://www.pornpics.com/?q=shy+imp" #BASE_URL="https://www.pornpics.com/pornstars/chloe-camilla/"
pornstars="shy-imp" #pornstars="chloe-camilla"
#BASE_URL="https://www.pornpics.com/pornstars/becky-summer" #BASE_URL="https://www.pornpics.com/pornstars/becky-summer"
#pornstars="becky-summer" #pornstars="becky-summer"
@@ -44,6 +44,9 @@ pornstars="shy-imp"
#clear files beforehand #clear files beforehand
echo "Pornstar: "$pornstars
echo "URL: "$BASE_URL
mkdir -p $DESTINATION_FOLDER/$pornstars mkdir -p $DESTINATION_FOLDER/$pornstars
@@ -63,7 +66,7 @@ echo "" > $DESTINATION_FOLDER/$pornstars-image_to_download.txt
for f in $(cat $DESTINATION_FOLDER/$pornstars-urls_of_galleries.txt ); do for f in $(cat $DESTINATION_FOLDER/$pornstars-urls_of_galleries.txt ); do
$curl_command $f | grep -Eo "(http|https)://[a-zA-Z0-9./?=_%:-]*" | grep "https://cdni.pornpics.com/1280" >> $DESTINATION_FOLDER/$pornstars-image_to_download.txt $curl_command $f | grep -Eo "(http|https)://[a-zA-Z0-9./?=_%:-]*" | grep "https://cdni.pornpics.com/" >> $DESTINATION_FOLDER/$pornstars-image_to_download.txt
echo $f echo $f
done done
@@ -73,4 +76,3 @@ for g in $(cat $DESTINATION_FOLDER/$pornstars-image_to_download.txt ); do
# wget -e use_proxy=yes -e http_proxy=$PROXY_HTTP $g -P $DESTINATION_FOLDER/$pornstars # wget -e use_proxy=yes -e http_proxy=$PROXY_HTTP $g -P $DESTINATION_FOLDER/$pornstars
echo $g echo $g
done done
exit 0
@@ -6,25 +6,24 @@ data:
\"$v\"=\"$2\"\n shift\n fi\n shift\ndone\n\n#check if we will use \"$v\"=\"$2\"\n shift\n fi\n shift\ndone\n\n#check if we will use
a HTTP proxy or not\n\nif [[ -z $http_proxy ]]; then\n echo \"not using a HTTP proxy or not\n\nif [[ -z $http_proxy ]]; then\n echo \"not using
proxy\"\n curl_command=\"curl\"\nelse\n echo \"using proxy\"\n curl_command=\"curl proxy\"\n curl_command=\"curl\"\nelse\n echo \"using proxy\"\n curl_command=\"curl
-x $http_proxy\"\n\nfi\n\n\n#dowload from https://www.pornpics.com/pornstars/eiby-shine/\nDESTINATION_FOLDER=\"/data\"\nPROXY_HTTP=\"http://gluetun-svc.gluetun.svc:8888\"\n\n#BASE_URL=\"https://www.pornpics.com/pornstars/eiby-shine/\"\n#pornstars=\"eiby-shine\"\n\nBASE_URL=\"https://www.pornpics.com/?q=shy+imp\"\npornstars=\"shy-imp\"\n\n#BASE_URL=\"https://www.pornpics.com/pornstars/becky-summer\"\n#pornstars=\"becky-summer\"\n\n\n#clear -x $http_proxy\"\n\nfi\n\n\n#dowload from https://www.pornpics.com/pornstars/eiby-shine/\nDESTINATION_FOLDER=\"/data\"\nPROXY_HTTP=\"http://gluetun-svc.gluetun.svc:8888\"\n\n#BASE_URL=\"https://www.pornpics.com/pornstars/eiby-shine/\"\n#pornstars=\"eiby-shine\"\n\n#BASE_URL=\"https://www.pornpics.com/pornstars/chloe-camilla/\"\n#pornstars=\"chloe-camilla\"\n\n#BASE_URL=\"https://www.pornpics.com/pornstars/becky-summer\"\n#pornstars=\"becky-summer\"\n\n\n#clear
files beforehand\n\n\nmkdir -p $DESTINATION_FOLDER/$pornstars\n\nif [[ $skip_searching_gallery files beforehand\n\necho \"Pornstar: \"$pornstars\necho \"URL: \"$BASE_URL\n\n\nmkdir
== true ]]; then\n echo \"not looping through galleries\"\n\t\techo \"using -p $DESTINATION_FOLDER/$pornstars\n\nif [[ $skip_searching_gallery == true ]];
existing file instead\"\n\t\t#because we need to keep the file $DESTINATION_FOLDER/$pornstars-urls_of_galleries.txt then\n echo \"not looping through galleries\"\n\t\techo \"using existing
with the existing URL , in this condition, \n\t\t#no deletion of this file\necho file instead\"\n\t\t#because we need to keep the file $DESTINATION_FOLDER/$pornstars-urls_of_galleries.txt
\"https://www.pornpics.com/galleries/onlyfans-shy-imp-starring-shy-imp-naked-porn-pics-90263490/\nhttps://www.pornpics.com/galleries/onlyfans-shy-imp-featuring-shy-imp-xxx-porn-pics-15741579/\nhttps://www.pornpics.com/galleries/onlyfans-shy-imp-starring-shy-imp-naked-photos-68925414/\nhttps://www.pornpics.com/galleries/onlyfans-shy-imp-shy-imp-20862921/\nhttps://www.pornpics.com/galleries/skinny-girl-with-pink-hair-shy-imp-shows-her-small-tits-during-a-solo-show-50988369/\nhttps://www.pornpics.com/galleries/onlyfans-shy-imp-featuring-shy-imp-hot-gallery-86312934/\" with the existing URL , in this condition, \n\t\t#no deletion of this file\nelse\n
>> $DESTINATION_FOLDER/$pornstars-urls_of_galleries.txt\n\nelse\n echo \ echo \"looping through galleries\"\n\t\t#because we will re-generate this
\"looping through galleries\"\n\t\t#because we will re-generate this file, can file, can be emptied\n\t\techo \"\" > $DESTINATION_FOLDER/$pornstars-urls_of_galleries.txt\n
be emptied\n\t\techo \"\" > $DESTINATION_FOLDER/$pornstars-urls_of_galleries.txt\n
\ $curl_command -s $BASE_URL | grep -Eo \"(http|https)://[a-zA-Z0-9./?=_%:-]*\" \ $curl_command -s $BASE_URL | grep -Eo \"(http|https)://[a-zA-Z0-9./?=_%:-]*\"
| grep \"https://www.pornpics.com/galleries/\" |sort -u >> $DESTINATION_FOLDER/$pornstars-urls_of_galleries.txt\nfi\n\necho | grep \"https://www.pornpics.com/galleries/\" |sort -u >> $DESTINATION_FOLDER/$pornstars-urls_of_galleries.txt\nfi\n\necho
\"\" > $DESTINATION_FOLDER/$pornstars-image_to_download.txt\n\n\nfor f in $(cat \"\" > $DESTINATION_FOLDER/$pornstars-image_to_download.txt\n\n\nfor f in $(cat
$DESTINATION_FOLDER/$pornstars-urls_of_galleries.txt ); do\n\t$curl_command $f $DESTINATION_FOLDER/$pornstars-urls_of_galleries.txt ); do\n\t$curl_command $f
| grep -Eo \"(http|https)://[a-zA-Z0-9./?=_%:-]*\" | grep \"https://cdni.pornpics.com/1280\" | grep -Eo \"(http|https)://[a-zA-Z0-9./?=_%:-]*\" | grep \"https://cdni.pornpics.com/\"
>> $DESTINATION_FOLDER/$pornstars-image_to_download.txt\n\techo $f\ndone\n\n\nfor >> $DESTINATION_FOLDER/$pornstars-image_to_download.txt\n\techo $f\ndone\n\n\nfor
g in $(cat $DESTINATION_FOLDER/$pornstars-image_to_download.txt ); do \n\t$curl_command g in $(cat $DESTINATION_FOLDER/$pornstars-image_to_download.txt ); do \n\t$curl_command
-O --output-dir $DESTINATION_FOLDER/$pornstars $g\n# wget -e use_proxy=yes -O --output-dir $DESTINATION_FOLDER/$pornstars $g\n# wget -e use_proxy=yes
-e http_proxy=$PROXY_HTTP $g -P $DESTINATION_FOLDER/$pornstars\n echo $g -e http_proxy=$PROXY_HTTP $g -P $DESTINATION_FOLDER/$pornstars\n echo $g
\ndone\nexit 0\n" \ndone\n"
kind: ConfigMap kind: ConfigMap
metadata: metadata:
creationTimestamp: null creationTimestamp: null
@@ -17,13 +17,17 @@ spec:
mountPropagation: None mountPropagation: None
name: data-pvc name: data-pvc
command: command:
# - /bin/bash
# - -c
# - sleep 3600
- bash - bash
- -c
- sleep 3600
# - bash
- /config/download.sh - /config/download.sh
- --http_proxy - --http_proxy
- "http://gluetun-svc.gluetun.svc:8888" - "http://gluetun-svc.gluetun.svc:8888"
- --BASE_URL
- "https://www.pornpics.com/?q=bretona"
- --pornstars
- "bretona"
restartPolicy: Never restartPolicy: Never
volumes: volumes:
- configMap: - configMap:
+90 -24
View File
@@ -12,13 +12,17 @@ variable "kubernetes" {
name = optional(string) name = optional(string)
image = string image = string
pvc = optional(map(object({ pvc = optional(map(object({
name = string name = string
pvc = optional(bool, false) pvc = optional(bool, false)
config_map = optional(bool, false) config_map = optional(bool, false)
host_path = optional(string) secret = optional(bool, false)
pvc_size = optional(string) host_path = optional(string)
storage_class_name = optional(string, "nfs-storage-intelligent") pvc_size = optional(string)
mount_path = string storage_class_name = optional(string, "nfs-storage-intelligent")
annotations_fileType = optional(string)
existing_pvc = optional(bool, false)
mount_path = string
sub_path = optional(string)
}))) })))
environment = optional(map(object({ environment = optional(map(object({
name = optional(string) name = optional(string)
@@ -30,14 +34,14 @@ variable "kubernetes" {
}) })
})) }))
}))) })))
replicas = optional(number, 1) replicas = optional(number, 1)
namespace = optional(string) namespace = optional(string)
connected_namespace = optional(string, "") connected_namespace = optional(string, "")
# namespace = optional(string,coalesce(connected_namespace,"")) command = optional(list(string))
#block_namespace_creation = optional(bool, false)
service_port = optional(list(number)) service_port = optional(list(number))
service_type = optional(string, "ClusterIP") service_type = optional(string, "ClusterIP")
service_name = optional(string) service_name = optional(string)
domain_name = optional(string)
liveness_tcp_socket = optional(number) liveness_tcp_socket = optional(number)
liveness_http_get = optional(string) liveness_http_get = optional(string)
liveness_http_get_path = optional(string) liveness_http_get_path = optional(string)
@@ -62,18 +66,36 @@ variable "kubernetes" {
} }
locals { locals {
pvc_details = flatten([ pvc_list = flatten([
for key, value in var.kubernetes : [ for key, value in var.kubernetes : [
for index, pvc in value.pvc : { for index, pvc in value.pvc : {
index = index key = "${coalesce(value.namespace, value.connected_namespace, key)}/${pvc.name}"
pvc = pvc.pvc index = index
name = pvc.name pvc = pvc.pvc
pvc_size = pvc.pvc_size name = pvc.name
mount_path = pvc.mount_path pvc_size = pvc.pvc_size
storage_class_name = pvc.storage_class_name mount_path = pvc.mount_path
namespace = coalesce(value.namespace, value.connected_namespace, key) storage_class_name = pvc.storage_class_name
annotations_fileType = pvc.annotations_fileType
existing_pvc = pvc.existing_pvc
sub_path = pvc.sub_path
namespace = coalesce(value.namespace, value.connected_namespace, key)
}] if value.enabled == true && value.pvc != null }] if value.enabled == true && value.pvc != null
]) ])
# group duplicates instead of throwing an error
pvc_map_grouped = {
for p in local.pvc_list :
p.key => p...
}
# keep only one PVC per key (take the first)
pvc_map = {
for k, list in local.pvc_map_grouped :
k => list[0]
}
pvc_details = values(local.pvc_map)
} }
locals { locals {
@@ -128,14 +150,19 @@ resource "kubernetes_manifest" "manifest" {
resource "kubernetes_persistent_volume_claim" "automatic-pvc" { resource "kubernetes_persistent_volume_claim" "automatic-pvc" {
for_each = { for key, value in local.pvc_details : "${value.index}" => merge(value, { mew_key = value.index }) if value.pvc } for_each = { for key, value in local.pvc_details : "${value.index}" => merge(value, { mew_key = value.index }) if value.pvc && value.existing_pvc != true }
metadata { metadata {
namespace = coalesce(each.value.namespace, each.key) namespace = coalesce(each.value.namespace, each.key)
name = "${each.value.name}-pvc" name = "${each.value.name}-pvc"
labels = { labels = {
deployment_method = "Terraform" deployment_method = "Terraform"
} }
annotations = {
fileType = try(each.value.annotations_fileType, "file")
}
} }
spec { spec {
access_modes = ["ReadWriteMany"] access_modes = ["ReadWriteMany"]
storage_class_name = each.value.storage_class_name storage_class_name = each.value.storage_class_name
@@ -322,6 +349,7 @@ resource "kubernetes_deployment_v1" "automatic" {
content { content {
mount_path = volume_mount.value.mount_path mount_path = volume_mount.value.mount_path
name = "${volume_mount.value.name}-pvc" name = "${volume_mount.value.name}-pvc"
sub_path = volume_mount.value.sub_path != null ? volume_mount.value.sub_path : ""
} }
} }
@@ -349,6 +377,20 @@ resource "kubernetes_deployment_v1" "automatic" {
} }
} }
# dynamic "command" {
# for_each = each.value.command != null ? [1] : []
# content {
# [each.value.command]
# }
# }
# command = each.value.command != null ? {
# [each.value.command]
# } : {}
command = each.value.command != null ? each.value.command : []
dynamic "env" { dynamic "env" {
for_each = each.value.environment != null ? each.value.environment : {} for_each = each.value.environment != null ? each.value.environment : {}
@@ -463,6 +505,12 @@ resource "kubernetes_deployment_v1" "automatic" {
} }
} }
dynamic "secret" {
for_each = volume.value.secret ? [1] : []
content {
secret_name = volume.value.name
}
}
} }
} }
@@ -522,9 +570,8 @@ resource "kubernetes_deployment_v1" "database-automatic" {
name = "${each.key}-db-pvc" name = "${each.key}-db-pvc"
} }
command = try([each.value.database.command],[])
#command = [try(each.value.database.command,"")]
dynamic "env" { dynamic "env" {
for_each = each.value.environment != null ? each.value.environment : {} for_each = each.value.environment != null ? each.value.environment : {}
@@ -722,3 +769,22 @@ resource "kubernetes_deployment_v1" "redis-automatic" {
} }
} }
} }
resource "kubernetes_config_map" "automatic-configmap" {
metadata {
name = "extra-sites-terraform"
namespace = "reverse-proxy"
annotations = {
"reloader.stakater.com/match" : "true",
}
}
data = {
for key, value in var.kubernetes :
"${value.domain_name}.conf" => templatefile("nginx_config.tftpl", {
name_site = value.domain_name
name_service = "${key}-svc.${coalesce(value.namespace, value.connected_namespace, key)}.svc:${value.service_port.0}"
}) if value.domain_name != null && value.enabled == true
}
}
+999 -46
View File
File diff suppressed because it is too large Load Diff