Compare commits

...

6 Commits

Author SHA1 Message Date
9eda8afb6c notes...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2024-01-27 17:51:56 +03:00
c898c0c874 cleanup...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2024-01-27 16:49:44 +03:00
a0b7e2c9d1 more work on bridge configuration...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2024-01-27 16:39:44 +03:00
83216179de notes...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2024-01-27 16:21:03 +03:00
4f00b91d55 notes...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2024-01-27 16:17:12 +03:00
c880780e48 working on host...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2024-01-27 16:13:38 +03:00
4 changed files with 94 additions and 12 deletions

View File

@ -371,6 +371,8 @@ webAppConfig(){
# #
# readVars # readVars
# readCTHardwareVars
# readBridgeVars
# #
# Variables this handles: # Variables this handles:
# EMAIL # EMAIL
@ -396,22 +398,28 @@ webAppConfig(){
# TMP_PASS_LEN # TMP_PASS_LEN
# ROOTPASS # ROOTPASS
# #
readCTHardwareVars(){
# hardware...
xread "CPU cores: " CORES
xread "RAM (MB): " RAM
xread "SWAP (MB): " SWAP
xread "DRIVE (GB): " DRIVE
}
readBridgeVars(){
# bridge config...
xread "WAN bridge: vmbr" WAN_BRIDGE
xread "LAN bridge: vmbr" LAN_BRIDGE
xread "ADMIN bridge: vmbr" ADMIN_BRIDGE
}
readVars(){ readVars(){
xread -n "Email: " EMAIL xread -n "Email: " EMAIL
xread -n "Domain: " DOMAIN xread -n "Domain: " DOMAIN
xread "ID: " ID xread "ID: " ID
xread "Hostname: " CTHOSTNAME xread "Hostname: " CTHOSTNAME
# hardware... readCTHardwareVars
xread "CPU cores: " CORES
xread "RAM (MB): " RAM
xread "SWAP (MB): " SWAP
xread "DRIVE (GB): " DRIVE
# bridge config... readBridgeVars
xread "WAN bridge: vmbr" WAN_BRIDGE
xread "LAN bridge: vmbr" LAN_BRIDGE
xread "ADMIN bridge: vmbr" ADMIN_BRIDGE
# gateway... # gateway...
# IPs can be: # IPs can be:
@ -473,10 +481,11 @@ PCT_TEMPLATE_VARS=(
EMAIL EMAIL
DOMAIN DOMAIN
CTHOSTNAME CTHOSTNAME
HOST_ADMIN_IP
GATE_HOSTNAME GATE_HOSTNAME
NS_HOSTNAME
GATE_LAN_IP GATE_LAN_IP
GATE_ADMIN_IP GATE_ADMIN_IP
NS_HOSTNAME
NS_LAN_IP NS_LAN_IP
NS_ADMIN_IP NS_ADMIN_IP
WAN_IP WAN_IP
@ -532,8 +541,8 @@ expandTemplate(){
# #
# expandTemplate PATH [VAR ...] # expandPCTTemplate PATH [VAR ...]
# .. | expandTemplate [VAR ...] # .. | expandPCTTemplate [VAR ...]
# #
expandPCTTemplate(){ expandPCTTemplate(){
local input= local input=

View File

@ -85,6 +85,9 @@ DFL_PCT_EXTRA=SKIP
# can be left as-is. # can be left as-is.
# #
# host
HOST_ADMIN_IP=10.0.0.245/24
# Nameserver # Nameserver
NS_HOSTNAME=ns NS_HOSTNAME=ns
NS_ID=100 NS_ID=100

24
host/bridges.tpl Normal file
View File

@ -0,0 +1,24 @@
auto vmbr${LAN_BRIDGE}
iface vmbr${LAN_BRIDGE} inet manual
bridge-ports none
bridge-stp off
bridge-fd 0
#LAN
auto vmbr${WAN_BRIDGE}
iface vmbr${WAN_BRIDGE} inet manual
bridge-ports ${WAN_PORT}
bridge-stp off
bridge-fd 0
#WAN
auto vmbr${ADMIN_BRIDGE}
iface vmbr${ADMIN_BRIDGE} inet static
address ${HOST_ADMIN_IP}
gateway ${GATE_ADMIN_IPn}
bridge-ports ${ADMIN_PORT}
bridge-stp off
bridge-fd 0
#ADMIN

View File

@ -10,12 +10,24 @@ PATH=$PATH:$(dirname "$(pwd)")
source ../.pct-helpers source ../.pct-helpers
#----------------------------------------------------------------------
need ifreload
#---------------------------------------------------------------------- #----------------------------------------------------------------------
readConfig readConfig
DFL_WAN_PORT=${DFL_WAN_PORT:-enp5s0}
DFL_ADMIN_PORT=${DFL_ADMIN_PORT:-enp2s0}
DFL_HOST_ADMIN_IP=${PROXMOX_ADMIN_IP:-10.0.0.254/24}
SOFTWARE=( SOFTWARE=(
ifupdown2
make make
w3m links w3m links
tree tree
@ -25,6 +37,10 @@ SOFTWARE=(
) )
# XXX
#readVars
#---------------------------------------------------------------------- #----------------------------------------------------------------------
# Tools # Tools
@ -37,8 +53,38 @@ if xreadYes "# Install additional apps?" APPS ; then
fi fi
# Networking # Networking
# XXX need to:
# - bootstrap this
# - setup the gate, ssh, and wireguard
# - inalize
# XXX /etc/hosts
# XXX save config???
# XXX should we do things in ./staging ???
if xreadYes "# Create bridges?" BRIDGES ; then if xreadYes "# Create bridges?" BRIDGES ; then
xread "WAN port: " WAN_PORT
xread "ADMIN port: " ADMIN_PORT
xread "Host ADMIN IP: " HOST_ADMIN_IP
xread "Gate ADMIN IP: " GATE_ADMIN_IP
readBridgeVars
@ cp /etc/network/interfaces{,.new}
BRIDGES="${\
cat bridges.tpl \
| expandPCTTemplate WAN_PORT ADMIN_PORT}"
# XXX add $BRIDGES to /etc/network/interfaces either before the
# source command or at the end...
# XXX
# review/apply setup...
echo "# Review updated: /etc/network/interfaces.new:"
@ cat /etc/network/interfaces.new
echo echo
if xreadYes "# Apply changes?" ; then
@ mv -b /etc/network/interfaces{.new,}
@ ifreload -a
fi
fi fi
# Firewall # Firewall