mirror of
https://github.com/flynx/proxmox-utils.git
synced 2025-12-26 05:12:06 +00:00
Compare commits
No commits in common. "e0816feb07b115755ef4c6eab3f1e6fcf3e68b51" and "ffb69c61adc73324bb79387ff62c7f4895a5dc96" have entirely different histories.
e0816feb07
...
ffb69c61ad
39
.pct-helpers
39
.pct-helpers
@ -202,9 +202,7 @@ xread(){
|
||||
shift
|
||||
local non_empty=1
|
||||
fi
|
||||
# XXX check DFL_..???
|
||||
if [[ "${!2}" == "SKIP" ]] ; then
|
||||
eval "$2="
|
||||
return
|
||||
fi
|
||||
if [ -z ${!2} ] ; then
|
||||
@ -222,9 +220,7 @@ xread(){
|
||||
# xreadYes MSG VAR
|
||||
#
|
||||
xreadYes(){
|
||||
# XXX check DFL_..???
|
||||
if [[ "${!2}" == "SKIP" ]] ; then
|
||||
eval "$2="
|
||||
return
|
||||
fi
|
||||
if [ -z ${!2} ] ; then
|
||||
@ -316,12 +312,8 @@ tklWaitForSetup(){
|
||||
# CLEAN_RUN - if set ignore ./config.last-run
|
||||
# CONFIG - config file to load last
|
||||
#
|
||||
# XXX need this not to make this behave with explicitly set vars...
|
||||
readConfig(){
|
||||
if [ -z $NO_DEFAULTS ] ; then
|
||||
local IFS=$'\n'
|
||||
#__ENV=($( (set -o posix ; set | grep -v 'BASHOPTS=') ))
|
||||
#__ENV=($( (declare -xp) ))
|
||||
[ -e ../config.global ] \
|
||||
&& source ../config.global
|
||||
[ -e ./config ] \
|
||||
@ -332,8 +324,6 @@ readConfig(){
|
||||
&& source ./config.last-run
|
||||
[ -e "$CONFIG" ] \
|
||||
&& source $CONFIG
|
||||
#eval "${__ENV[@]}"
|
||||
#__ENV=
|
||||
fi
|
||||
}
|
||||
|
||||
@ -383,22 +373,6 @@ saveLastRunConfig(){
|
||||
saveConfig -d -a "$cfg" ${XREAD_VARS[@]}
|
||||
}
|
||||
|
||||
# webAppConfig NAME
|
||||
webAppConfig(){
|
||||
local name=${1^^}
|
||||
eval "${name}_SUBDOMAIN=\${${name}_SUBDOMAIN:=\${DFL_SUB${name}_DOMAIN}}
|
||||
${name}_SUBDOMAIN=\${${name}_SUBDOMAIN:+\${${name}_SUBDOMAIN%.}.}
|
||||
${name}_DOMAIN=\${${name}_DOMAIN:=\${DFL_${name}_DOMAIN}}
|
||||
# prioretize \${name}_*
|
||||
DFL_DOMAIN=\${DFL_DOMAIN:+\${${name}_SUBDOMAIN}\${DFL_DOMAIN}}
|
||||
DFL_DOMAIN=\${DOMAIN:+\${${name}_SUBDOMAIN}\${DOMAIN}}
|
||||
if [ \$${name}_DOMAIN ] ; then
|
||||
DFL_DOMAIN=\${${name}_SUBDOMAIN}\${${name}_DOMAIN}
|
||||
fi"
|
||||
# force check of domain...
|
||||
DOMAIN=
|
||||
}
|
||||
|
||||
#
|
||||
# readVars
|
||||
#
|
||||
@ -451,25 +425,12 @@ readVars(){
|
||||
# Gateways can be:
|
||||
# <empty>
|
||||
# <IP>
|
||||
# XXX these are the same...
|
||||
xread "WAN ip: " WAN_IP
|
||||
if [[ $WAN_IP != "dhcp" ]] ; then
|
||||
xread "WAN gateway: " WAN_GATE
|
||||
else
|
||||
WAN_GATE=
|
||||
fi
|
||||
xread "LAN ip: " LAN_IP
|
||||
if [[ $LAN_IP != "dhcp" ]] ; then
|
||||
xread "LAN gateway: " LAN_GATE
|
||||
else
|
||||
LAN_GATE=
|
||||
fi
|
||||
xread "ADMIN ip: " ADMIN_IP
|
||||
if [[ $ADMIN_IP != "dhcp" ]] ; then
|
||||
xread "ADMIN gateway: " ADMIN_GATE
|
||||
else
|
||||
ADMIN_GATE=
|
||||
fi
|
||||
|
||||
# root password...
|
||||
if [ -z $ROOTPASS ] ; then
|
||||
|
||||
@ -18,6 +18,14 @@
|
||||
#
|
||||
#------------------------------------------------------------------------
|
||||
|
||||
DFL_EMAIL=user@example.com
|
||||
|
||||
DFL_DOMAIN=example.com
|
||||
|
||||
DFL_WAN_IP=192.168.1.101/24
|
||||
DFL_WAN_GATE=192.168.1.252
|
||||
|
||||
|
||||
# CT interface bridge configuration.
|
||||
#
|
||||
# These are set to the bridge number (the number in 'vmbr#') used for
|
||||
@ -33,35 +41,6 @@ LAN_BRIDGE=
|
||||
ADMIN_BRIDGE=
|
||||
|
||||
|
||||
DFL_WAN_IP=192.168.1.101/24
|
||||
DFL_WAN_GATE=192.168.1.252
|
||||
|
||||
|
||||
# Doman and email configuration
|
||||
#
|
||||
EMAIL=user@example.com
|
||||
|
||||
DOMAIN=example.com
|
||||
|
||||
|
||||
# Web app/service domain configuration
|
||||
#
|
||||
# Here two optional variables are provided per service:
|
||||
# - <SERVICE>_DOMAIN=...
|
||||
# Overrides the $DOMAIN option above for <SERVICE>
|
||||
# - <SERVICE>_SUBDOMAIN=...
|
||||
# Sets the subdomain of $DOMAIN (or $<SERVICE>_DOMAIN) for <SERVICE>
|
||||
#
|
||||
|
||||
# Nextcloud
|
||||
#NEXTCLOUD_DOMAIN=
|
||||
NEXTCLOUD_SUBDOMAIN=nc.
|
||||
|
||||
# Gitea
|
||||
#GITEA_DOMAIN=
|
||||
#GITEA_SUBDOMAIN=git.
|
||||
|
||||
|
||||
# Extra options passed to each CT created.
|
||||
#
|
||||
# This can be used for passing in ssh keys, etc...
|
||||
@ -69,9 +48,6 @@ NEXTCLOUD_SUBDOMAIN=nc.
|
||||
# see:
|
||||
# man pct
|
||||
#
|
||||
# Example:
|
||||
# DFL_PCT_EXTRA="--ssh-public-keys /path/to/autohrized_keys"
|
||||
#
|
||||
DFL_PCT_EXTRA=SKIP
|
||||
|
||||
|
||||
|
||||
@ -4,7 +4,7 @@ http:
|
||||
entryPoints:
|
||||
- https
|
||||
service: nextcloud
|
||||
rule: "Host(`${DOMAIN}`)"
|
||||
rule: "Host(`nc.${DOMAIN}`)"
|
||||
tls:
|
||||
certResolver: letsEncrypt
|
||||
|
||||
@ -17,8 +17,6 @@ readConfig
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
|
||||
webAppConfig gitea
|
||||
|
||||
DFL_ID=${DFL_ID:=300}
|
||||
DFL_CTHOSTNAME=${DFL_CTHOSTNAME:=gitea}
|
||||
|
||||
|
||||
@ -17,8 +17,6 @@ readConfig
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
|
||||
webAppConfig Nextcloud
|
||||
|
||||
DFL_ID=${DFL_ID:=300}
|
||||
DFL_CTHOSTNAME=${DFL_CTHOSTNAME:=nextcloud}
|
||||
|
||||
@ -44,9 +42,6 @@ REBOOT=${REBOOT:=1}
|
||||
|
||||
readVars
|
||||
|
||||
# Nextcloud-specific configuration...
|
||||
APP_DOMAIN=$DOMAIN
|
||||
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
|
||||
|
||||
@ -40,8 +40,6 @@ $(SERVER_CONF): $(SERVER_TPL) $(SERVER_KEY)
|
||||
-e 's/\$${\SERVER_PRIVATE_KEY}/'$$(sed -e 's/\//\\\//g' "$(SERVER_KEY)")'/g' \
|
||||
> "$@"
|
||||
|
||||
# XXX need to figure out a way to link this to the .config file without
|
||||
# conflicting with the server's wg0.conf
|
||||
%.client: $(CLIENT_TPL) $(SERVER_CLIENT_TPL) \
|
||||
$(CLIENT_DIR)/%_id $(CLIENT_DIR)/%_id.pub \
|
||||
$(SERVER_CONF) $(SERVER_PUBLIC_KEY)
|
||||
@ -69,12 +67,6 @@ $(SERVER_CONF): $(SERVER_TPL) $(SERVER_KEY)
|
||||
&& qrencode -t UTF8 -r "$(CLIENT_DIR)/$*.conf" )
|
||||
|
||||
|
||||
|
||||
%.qr: %.client
|
||||
@ ( echo "# Profile: $*" \
|
||||
&& qrencode -t UTF8 -r "$*.conf" )
|
||||
|
||||
|
||||
server: $(SERVER_CONF)
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user