mirror of
https://github.com/dockur/windows.git
synced 2026-08-03 12:37:20 +01:00
fix: Do not set computername if not explictly provided (#1922)
This commit is contained in:
+4
-4
@@ -12,7 +12,7 @@ An empty default means the variable is unset and its value is determined automat
|
|||||||
| `EDITION` | | Windows edition to install, such as `core` for Windows Server Core. |
|
| `EDITION` | | Windows edition to install, such as `core` for Windows Server Core. |
|
||||||
| `LANGUAGE` | `en-US` | Windows display language, such as `English`, `en-US`, or `en`. |
|
| `LANGUAGE` | `en-US` | Windows display language, such as `English`, `en-US`, or `en`. |
|
||||||
| `KEY` | | Windows product key used to install and activate Windows. |
|
| `KEY` | | Windows product key used to install and activate Windows. |
|
||||||
| `REGION` | | Windows regional format. Uses `LANGUAGE` when unset. |
|
| `REGION` | | Regional format. Uses `LANGUAGE` when unset. |
|
||||||
| `KEYBOARD` | | Keyboard layout. Uses `LANGUAGE` when unset. |
|
| `KEYBOARD` | | Keyboard layout. Uses `LANGUAGE` when unset. |
|
||||||
| `USERNAME` | `Docker` | Name of the Windows user account. |
|
| `USERNAME` | `Docker` | Name of the Windows user account. |
|
||||||
| `PASSWORD` | `admin` | Password for the Windows account. |
|
| `PASSWORD` | `admin` | Password for the Windows account. |
|
||||||
@@ -55,14 +55,14 @@ An empty default means the variable is unset and its value is determined automat
|
|||||||
| Variable | Default | Description |
|
| Variable | Default | Description |
|
||||||
|---|---|---|
|
|---|---|---|
|
||||||
| `NETWORK` | | Network mode, such as `nat`, `user`, or `N` to disable networking. |
|
| `NETWORK` | | Network mode, such as `nat`, `user`, or `N` to disable networking. |
|
||||||
| `DHCP` | `N` | Enables macvtap networking so Windows receives an address from the external LAN through DHCP. |
|
| `DHCP` | `N` | Enables macvtap networking so Windows receives a DHCP address. |
|
||||||
| `HOST` | `Windows` | Computer name assigned to Windows and advertised on the network. |
|
| `HOST` | | Optional Windows computer name and advertised network hostname. |
|
||||||
| `IP` | | Overrides the automatically selected guest IPv4 address. |
|
| `IP` | | Overrides the automatically selected guest IPv4 address. |
|
||||||
| `MAC` | | Guest network adapter MAC address. |
|
| `MAC` | | Guest network adapter MAC address. |
|
||||||
| `ADAPTER` | `virtio-net-pci` | QEMU network adapter model. |
|
| `ADAPTER` | `virtio-net-pci` | QEMU network adapter model. |
|
||||||
| `DEV` | `eth0` | Container network interface used as the uplink. |
|
| `DEV` | `eth0` | Container network interface used as the uplink. |
|
||||||
| `MTU` | | MTU assigned to the guest network interface. |
|
| `MTU` | | MTU assigned to the guest network interface. |
|
||||||
| `MASK` | `255.255.255.0` | IPv4 netmask. |
|
| `MASK` | `255.255.255.0` | IPv4 netmask for guest network. |
|
||||||
| `TAP` | `qemu` | TAP or macvtap interface name. |
|
| `TAP` | `qemu` | TAP or macvtap interface name. |
|
||||||
| `BRIDGE` | `docker` | Bridge name used for NAT networking. |
|
| `BRIDGE` | `docker` | Bridge name used for NAT networking. |
|
||||||
| `HOST_PORTS` | | Ports excluded from guest forwarding. |
|
| `HOST_PORTS` | | Ports excluded from guest forwarding. |
|
||||||
|
|||||||
+3
-5
@@ -1338,10 +1338,7 @@ validateComputerName() {
|
|||||||
|
|
||||||
local value="$1"
|
local value="$1"
|
||||||
|
|
||||||
if [ -z "$value" ]; then
|
[ -z "$value" ] && return 0
|
||||||
value="$APP"
|
|
||||||
HOST="$value"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "${#value}" -gt 15 ]; then
|
if [ "${#value}" -gt 15 ]; then
|
||||||
error "The HOST variable cannot contain more than 15 characters!"
|
error "The HOST variable cannot contain more than 15 characters!"
|
||||||
@@ -1764,13 +1761,14 @@ prepareInstall() {
|
|||||||
local username="${USERNAME:-Docker}"
|
local username="${USERNAME:-Docker}"
|
||||||
local password="${PASSWORD:-admin}"
|
local password="${PASSWORD:-admin}"
|
||||||
local workgroup="${WORKGROUP:-WORKGROUP}"
|
local workgroup="${WORKGROUP:-WORKGROUP}"
|
||||||
|
|
||||||
local sifHost sifUsername sifPassword sifOrganization sifWorkgroup
|
local sifHost sifUsername sifPassword sifOrganization sifWorkgroup
|
||||||
local regUsername regPassword
|
local regUsername regPassword
|
||||||
|
|
||||||
validateLegacyUsername "$username" "$desc" || return 1
|
validateLegacyUsername "$username" "$desc" || return 1
|
||||||
validatePassword "$password" "$desc" || return 1
|
validatePassword "$password" "$desc" || return 1
|
||||||
|
|
||||||
sifHost=$(escapeSIFValue "$HOST") || return 1
|
sifHost=$(escapeSIFValue "${HOST:-*}") || return 1
|
||||||
sifUsername=$(escapeSIFValue "$username") || return 1
|
sifUsername=$(escapeSIFValue "$username") || return 1
|
||||||
sifPassword=$(escapeSIFValue "$password") || return 1
|
sifPassword=$(escapeSIFValue "$password") || return 1
|
||||||
sifOrganization=$(escapeSIFValue "$APP for $ENGINE") || return 1
|
sifOrganization=$(escapeSIFValue "$APP for $ENGINE") || return 1
|
||||||
|
|||||||
+7
-4
@@ -1184,9 +1184,9 @@ updateXML() {
|
|||||||
|
|
||||||
local asset="$1"
|
local asset="$1"
|
||||||
local language="$2"
|
local language="$2"
|
||||||
local app value culture region keyboard edition key
|
local app value culture region keyboard edition
|
||||||
local user user_xml auth_user admin pass pw
|
local user user_xml auth_user admin pass pw
|
||||||
local domain qualifier host workgroup
|
local domain qualifier host workgroup key
|
||||||
|
|
||||||
[ -z "$WIDTH" ] && WIDTH="1280"
|
[ -z "$WIDTH" ] && WIDTH="1280"
|
||||||
[ -z "$HEIGHT" ] && HEIGHT="720"
|
[ -z "$HEIGHT" ] && HEIGHT="720"
|
||||||
@@ -1199,10 +1199,8 @@ updateXML() {
|
|||||||
validatePassword "$PASSWORD" || return 1
|
validatePassword "$PASSWORD" || return 1
|
||||||
|
|
||||||
app=$(escapeXMLSed "$APP for $ENGINE") || return 1
|
app=$(escapeXMLSed "$APP for $ENGINE") || return 1
|
||||||
host=$(escapeXMLSed "$HOST") || return 1
|
|
||||||
|
|
||||||
sed -i "s|>Windows for Docker<|>$app<|g" "$asset" || return 1
|
sed -i "s|>Windows for Docker<|>$app<|g" "$asset" || return 1
|
||||||
sed -i -E "s|<ComputerName>[^<]*</ComputerName>|<ComputerName>$host</ComputerName>|g" "$asset" || return 1
|
|
||||||
sed -i -E "s|<VerticalResolution>[^<]*</VerticalResolution>|<VerticalResolution>$HEIGHT</VerticalResolution>|g" "$asset" || return 1
|
sed -i -E "s|<VerticalResolution>[^<]*</VerticalResolution>|<VerticalResolution>$HEIGHT</VerticalResolution>|g" "$asset" || return 1
|
||||||
sed -i -E "s|<HorizontalResolution>[^<]*</HorizontalResolution>|<HorizontalResolution>$WIDTH</HorizontalResolution>|g" "$asset" || return 1
|
sed -i -E "s|<HorizontalResolution>[^<]*</HorizontalResolution>|<HorizontalResolution>$WIDTH</HorizontalResolution>|g" "$asset" || return 1
|
||||||
|
|
||||||
@@ -1231,6 +1229,11 @@ updateXML() {
|
|||||||
sed -i "s|<InputLocale>0409:00000409</InputLocale>|<InputLocale>$value</InputLocale>|g" "$asset" || return 1
|
sed -i "s|<InputLocale>0409:00000409</InputLocale>|<InputLocale>$value</InputLocale>|g" "$asset" || return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -n "$HOST" ]; then
|
||||||
|
host=$(escapeXMLSed "$HOST") || return 1
|
||||||
|
sed -i -E "s|<ComputerName>[^<]*</ComputerName>|<ComputerName>$host</ComputerName>|g" "$asset" || return 1
|
||||||
|
fi
|
||||||
|
|
||||||
domain="$DOMAIN"
|
domain="$DOMAIN"
|
||||||
workgroup="$WORKGROUP"
|
workgroup="$WORKGROUP"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user