Compare commits

...

10 Commits

Author SHA1 Message Date
73da4ed12c tweaks...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2024-01-04 02:52:44 +03:00
7e091183ce added global network config...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2024-01-04 02:25:20 +03:00
4871f73d52 preparing for a common net config...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2024-01-04 01:47:12 +03:00
8af5a74a60 tweaking...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2024-01-04 01:32:12 +03:00
5400fa174f fix...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2024-01-04 01:28:51 +03:00
eab3056379 fix...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2024-01-04 01:26:39 +03:00
15c01c1c0e tweaking...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2024-01-04 01:21:31 +03:00
c17133e818 tweaking...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2024-01-04 00:51:56 +03:00
7926aa771f tweaking...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2024-01-04 00:27:58 +03:00
63f8ae15ba tweaking...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2024-01-04 00:27:08 +03:00
9 changed files with 70 additions and 44 deletions

View File

@ -242,7 +242,7 @@ buildAssets(){
local TEMPLATE_DIR=$1
TEMPLATE_DIR=${TEMPLATE_DIR:=templates}
local ASSETS_DIR=$2
TEMPLATE_DIR=${ASSETS_DIR:=assets}
ASSETS_DIR=${ASSETS_DIR:=assets}
local TEMPLATES=($(find "$TEMPLATE_DIR" -type f))
for file in "${TEMPLATES[@]}" ; do
@ -254,15 +254,28 @@ buildAssets(){
mkdir -p "$(dirname "${ASSETS_DIR}/${file}")"
cat "${TEMPLATE_DIR}/${file}" \
| sed \
-e 's/\${EMAIL}/'$EMAIL'/' \
-e 's/\${DOMAIN}/'$DOMAIN'/' \
-e 's/\${CTHOSTNAME}/'$CTHOSTNAME'/' \
-e 's/\${WAN_IP}/'${WAN_IP/\//\\/}'/' \
-e 's/\${WAN_GATE}/'$WAN_GATE'/' \
-e 's/\${LAN_IP}/'${LAN_IP/\//\\/}'/' \
-e 's/\${LAN_GATE}/'$LAN_GATE'/' \
-e 's/\${ADMIN_IP}/'${ADMIN_IP/\//\\/}'/' \
-e 's/\${ADMIN_GATE}/'$ADMIN_GATE'/' \
-e 's/\${EMAIL}/'${EMAIL/\//\\/}'/g' \
-e 's/\${DOMAIN}/'${DOMAIN/\//\\/}'/g' \
-e 's/\${CTHOSTNAME}/'${CTHOSTNAME/\//\\/}'/g' \
-e 's/\${GATE_HOSTNAME}/'${GATE_HOSTNAME/\//\\/}'/g' \
-e 's/\${NS_HOSTNAME}/'${NS_HOSTNAME/\//\\/}'/g' \
-e 's/\${GATE_LAN_IP}/'${GATE_LAN_IP/\//\\/}'/g' \
-e 's/\${GATE_LAN_IPn}/'${GATE_LAN_IP/\/*}'/g' \
-e 's/\${GATE_ADMIN_IP}/'${GATE_ADMIN_IP/\//\\/}'/g' \
-e 's/\${GATE_ADMIN_IPn}/'${GATE_ADMIN_IP/\/*}'/g' \
-e 's/\${NS_LAN_IP}/'${NS_LAN_IP/\//\\/}'/g' \
-e 's/\${NS_LAN_IPn}/'${NS_LAN_IP/\/*}'/g' \
-e 's/\${NS_ADMIN_IP}/'${NS_ADMIN_IP/\//\\/}'/g' \
-e 's/\${NS_ADMIN_IPn}/'${NS_ADMIN_IP/\/*}'/g' \
-e 's/\${WAN_IP}/'${WAN_IP/\//\\/}'/g' \
-e 's/\${WAN_IPn}/'${WAN_IP/\/*}'/g' \
-e 's/\${WAN_GATE}/'${WAN_GATE/\//\\/}'/g' \
-e 's/\${LAN_IP}/'${LAN_IP/\//\\/}'/g' \
-e 's/\${LAN_IPn}/'${LAN_IP/\/*}'/g' \
-e 's/\${LAN_GATE}/'${LAN_GATE/\//\\/}'/' \
-e 's/\${ADMIN_IP}/'${ADMIN_IP/\//\\/}'/g' \
-e 's/\${ADMIN_IPn}/'${ADMIN_IP/\/*}'/g' \
-e 's/\${ADMIN_GATE}/'${ADMIN_GATE/\//\\/}'/g' \
> "${ASSETS_DIR}/${file}"
done
}

View File

@ -8,15 +8,18 @@ config.global: config.global.example
config: config.global
gate: gate-traefik
.PHONY: gate
gate: ./gate-traefik
$</make.sh
ns: ns
$</make.sh
.PHONY: ns
ns:
$@/make.sh
all: config gate ns
.PHONY: all
all: config gate dns

View File

@ -2,8 +2,10 @@
A set of scripts for automating setup and tasks in proxmox.
## TODO
- revise defaults
# Goals
## Goals
- support the basic CT lifecicle:
- setup/build/update
- run

View File

@ -13,5 +13,15 @@ DFL_WAN_BRIDGE=2
DFL_LAN_BRIDGE=0
DFL_ADMIN_BRIDGE=1
# this can be used for passing in ssh keys, etc...
DFL_PCT_EXTRA=
NS_HOSTNAME=ns
NS_ADMIN_IP=10.0.0.1/24
NS_LAN_IP=10.1.1.1/24
GATE_HOSTNAME=gate
GATE_ADMIN_IP=10.0.0.2/24
GATE_LAN_IP=10.1.1.2/24

View File

@ -22,14 +22,14 @@ source ../.pct-helpers
#----------------------------------------------------------------------
DFL_ID=${DFL_ID:=101}
DFL_CTHOSTNAME=${DFL_CTHOSTNAME:=gate}
DFL_CTHOSTNAME=${GATE_HOSTNAME:=${DFL_CTHOSTNAME:=gate}}
DFL_WAN_IP=${DFL_WAN_IP:=192.168.1.101/24}
DFL_WAN_GATE=${DFL_WAN_GATE:=192.168.1.252}
DFL_WAN_IP=${DFL_WAN_IP}
DFL_WAN_GATE=${DFL_WAN_GATE}
DFL_ADMIN_IP=${DFL_ADMIN_IP:=10.0.0.2/24}
DFL_ADMIN_IP=${GATE_ADMIN_IP:=${DFL_ADMIN_IP:=10.0.0.2/24}}
ADMIN_GATE=-
DFL_LAN_IP=${DFL_LAN_IP:=10.1.1.2/24}
DFL_LAN_IP=${GATE_LAN_IP:=${DFL_LAN_IP:=10.1.1.2/24}}
LAN_GATE=-
REBOOT=${REBOOT:=1}

View File

@ -4,12 +4,12 @@ iface lo inet6 loopback
auto admin
iface admin inet static
address 10.0.0.2
address ${ADMIN_IP}
hostname $(hostname)
auto lan
iface lan inet static
address 10.1.1.2
address ${LAN_IP}
hostname $(hostname)
auto wan

View File

@ -21,15 +21,16 @@ source ../.pct-helpers
#----------------------------------------------------------------------
DFL_ID=100
DFL_CTHOSTNAME=ns
DFL_ID=${DFL_ID:=100}
DFL_CTHOSTNAME=${NS_HOSTNAME:=${DFL_CTHOSTNAME:=ns}}
WAN_IP=-
WAN_GATE=-
DFL_ADMIN_IP=${DFL_ADMIN_IP:=10.0.0.1/24}
ADMIN_GATE=-
DFL_LAN_IP=${DFL_LAN_IP:=10.1.1.1/24}
DFL_LAN_GATE=${DFL_LAN_IP:=10.1.1.2/24}
DFL_LAN_IP=${NS_LAN_IP:=${DFL_LAN_IP:=10.1.1.1/24}}
DFL_LAN_GATE=${GATE_LAN_IP:=${DFL_LAN_GATE:=10.1.1.2}}
DFL_LAN_GATE=${DFL_LAN_GATE/\/*}
REBOOT=${REBOOT:=1}
@ -80,5 +81,6 @@ pctSet $ID "${OPTS_STAGE_2}" $REBOOT
echo "# Done."
#----------------------------------------------------------------------
# vim:set ts=4 sw=4 :

View File

@ -1,5 +1,7 @@
#----------------------------------------------------------------------
#
# XXX get domain ips from config...
#
#----------------------------------------------------------------------
# DNS
@ -41,16 +43,16 @@ dhcp-range=interface:admin,10.0.0.20,10.0.0.200,12h
dhcp-range=interface:lan,10.1.1.20,10.1.1.200,12h
# ns
address=/ns/10.0.0.1
address=/ns/10.1.1.1
address=/${CTHOSTNAME}/${ADMIN_IPn}
address=/${CTHOSTNAME}/${LAN_IPn}
# gate
address=/gate/10.0.0.2
address=/gate/10.1.1.2
dhcp-option=admin,option:router,10.0.0.2
dhcp-option=lan,option:router,10.1.1.2
dhcp-host=admin,gate,10.0.0.2,infinite
dhcp-host=lan,gate,10.1.1.2,infinite
address=/${GATE_HOSTNAME}/${GATE_ADMIN_IPn}
address=/${GATE_HOSTNAME}/${LAN_GATE}
dhcp-option=admin,option:router,${GATE_ADMIN_IPn}
dhcp-option=lan,option:router,${LAN_GATE}
dhcp-host=admin,gate,${GATE_ADMIN_IPn},infinite
dhcp-host=lan,gate,${LAN_GATE},infinite
# pve
address=/pve/10.0.0.254

View File

@ -2,21 +2,15 @@ auto lo
iface lo inet loopback
iface lo inet6 loopback
# bootstrap...
auto wan
iface wan inet static
address ${WAN_IP}
gateway ${WAN_GATE}
hostname $(hostname)
auto lan
iface lan inet static
address 10.0.0.1/24
gateway 10.0.0.2
address ${LAN_IP}
gateway ${LAN_GATE}
hostname $(hostname)
auto admin
iface admin inet dhcp
iface admin inet static
address ${ADMIN_IP}
hostname $(hostname)