wip
Some checks failed
ci/woodpecker/push/test Pipeline failed
checks / tflint (push) Has been cancelled
checks / pre-commit (push) Has been cancelled
checks / k8s (push) Has been cancelled

This commit is contained in:
cătălin 2026-04-03 22:45:01 +02:00
commit 9a398a1177
No known key found for this signature in database
3 changed files with 120 additions and 10 deletions

16
.woodpecker/test.yaml Normal file
View file

@ -0,0 +1,16 @@
---
when:
- event: push
branch: feat/woodpecker-ci
steps:
- name: build
image: debian
commands:
- echo "This is the build step"
- echo "binary-data-123" > executable
- name: a-test-step
image: golang:1.16
commands:
- echo "Testing ..."
- ./executable

103
scripts/create-nginx-certs.sh Executable file
View file

@ -0,0 +1,103 @@
#!/usr/bin/env bash
set -euo pipefail
usage() {
cat <<'EOF'
Usage:
create-nginx-certs.sh --domain <domain> [--output <name>]
Options:
-d, --domain Domain name to use for the certificate Common Name and SAN
-o, --output Output file base name (defaults to the domain name)
-h, --help Show this help message
Examples:
./create-nginx-certs.sh --domain mydomain.local
./create-nginx-certs.sh --domain mydomain.local --output foo
EOF
}
DOMAIN=""
OUTPUT_BASE=""
while [[ $# -gt 0 ]]; do
case "$1" in
-d|--domain)
if [[ $# -lt 2 ]]; then
echo "Error: --domain requires a value" >&2
usage >&2
exit 1
fi
DOMAIN="$2"
shift 2
;;
-o|--output)
if [[ $# -lt 2 ]]; then
echo "Error: --output requires a value" >&2
usage >&2
exit 1
fi
OUTPUT_BASE="$2"
shift 2
;;
-h|--help)
usage
exit 0
;;
*)
echo "Error: unknown argument: $1" >&2
usage >&2
exit 1
;;
esac
done
if [[ -z "$DOMAIN" ]]; then
echo "Error: --domain is required" >&2
usage >&2
exit 1
fi
if [[ -z "$OUTPUT_BASE" ]]; then
OUTPUT_BASE="$DOMAIN"
fi
CERT_FILE="${OUTPUT_BASE}.pem"
KEY_FILE="${OUTPUT_BASE}.key.pem"
TMP_CONFIG="$(mktemp)"
cleanup() {
rm -f "$TMP_CONFIG"
}
trap cleanup EXIT
cat > "$TMP_CONFIG" <<EOF
[req]
default_bits = 2048
prompt = no
default_md = sha256
distinguished_name = dn
req_extensions = req_ext
[dn]
CN = ${DOMAIN}
[req_ext]
subjectAltName = @alt_names
[alt_names]
DNS.1 = ${DOMAIN}
EOF
openssl req -x509 \
-nodes \
-days 3650 \
-newkey rsa:2048 \
-keyout "$KEY_FILE" \
-out "$CERT_FILE" \
-config "$TMP_CONFIG" \
-extensions req_ext
echo "Created certificate: $CERT_FILE"
echo "Created private key: $KEY_FILE"

View file

@ -23,18 +23,9 @@ provider "adguard" {
resource "adguard_rewrite" "argo_1" {
domain = "argo.fuku"
answer = "192.168.1.31"
answer = "192.168.1.12"
}
resource "adguard_rewrite" "argo_2" {
domain = "argo.fuku"
answer = "192.168.1.32"
}
resource "adguard_rewrite" "argo_3" {
domain = "argo.fuku"
answer = "192.168.1.33"
}
resource "adguard_rewrite" "feeds" {
domain = "feeds.roboces.dev"
answer = "192.168.1.12"