feat: Set a password per default (#309)
This commit is contained in:
parent
7797df5d35
commit
38d03f4bfa
5 changed files with 94 additions and 19 deletions
|
@ -1,5 +1,5 @@
|
|||
FROM scratch
|
||||
COPY --from=qemux/qemu-arm:7.08 / /
|
||||
COPY --from=qemux/qemu-arm:7.09 / /
|
||||
|
||||
ARG VERSION_ARG="0.00"
|
||||
ARG DEBCONF_NOWARNINGS="yes"
|
||||
|
|
|
@ -168,7 +168,7 @@ The example folder `./example` will be available as ` \\host.lan\Data`.
|
|||
|
||||
### How do I configure the username and password?
|
||||
|
||||
By default, a user called `Docker` (with an empty password) is created during installation.
|
||||
By default, a user called `Docker` is created during installation and its password is `admin`.
|
||||
|
||||
If you want to use different credentials, you can configure them in your compose file (only before installation):
|
||||
|
||||
|
@ -247,7 +247,7 @@ The example folder `./example` will be available as ` \\host.lan\Data`.
|
|||
|
||||
The web-viewer is mainly meant to be used during installation, as its picture quality is low, and it has no audio or clipboard for example.
|
||||
|
||||
So for a better experience you can connect using any Microsoft Remote Desktop client to the IP of the container, using the username `Docker` and by leaving the password empty.
|
||||
So for a better experience you can connect using any Microsoft Remote Desktop client to the IP of the container, using the username `Docker` and password `admin`.
|
||||
|
||||
There is a RDP client for [Android](https://play.google.com/store/apps/details?id=com.microsoft.rdc.androidx) available from the Play Store and one for [iOS](https://apps.apple.com/nl/app/microsoft-remote-desktop/id714464092?l=en-GB) in the Apple Store. For Linux you can use [FreeRDP](https://www.freerdp.com/) and on Windows just type `mstsc` in the search box.
|
||||
|
||||
|
|
|
@ -75,6 +75,9 @@ parseVersion() {
|
|||
"xp64" | "xpx64" | "5x64" | "winxp64" | "winxpx64" | "windowsxp64" | "windowsxpx64" )
|
||||
error "Windows XP $msg" && return 1
|
||||
;;
|
||||
"2k" | "2000" | "win2k" | "win2000" | "windows2k" | "windows2000" )
|
||||
error "Windows 2000 $msg" && return 1
|
||||
;;
|
||||
"25" | "2025" | "win25" | "win2025" | "windows2025" | "windows 2025" )
|
||||
error "Windows Server 2025 $msg" && return 1
|
||||
;;
|
||||
|
|
|
@ -128,6 +128,8 @@ finishInstall() {
|
|||
|
||||
rm -f "$STORAGE/windows.old"
|
||||
rm -f "$STORAGE/windows.vga"
|
||||
rm -f "$STORAGE/windows.net"
|
||||
rm -f "$STORAGE/windows.usb"
|
||||
rm -f "$STORAGE/windows.args"
|
||||
rm -f "$STORAGE/windows.base"
|
||||
rm -f "$STORAGE/windows.boot"
|
||||
|
@ -170,10 +172,22 @@ finishInstall() {
|
|||
echo "$ARGS" > "$STORAGE/windows.args"
|
||||
fi
|
||||
|
||||
if [ -n "${VGA:-}" ] && [[ "${VGA:-}" != "virtio"* ]]; then
|
||||
echo "$VGA" > "$STORAGE/windows.vga"
|
||||
fi
|
||||
|
||||
if [ -n "${USB:-}" ] && [[ "${USB:-}" != "qemu-xhci"* ]]; then
|
||||
echo "$USB" > "$STORAGE/windows.usb"
|
||||
fi
|
||||
|
||||
if [ -n "${DISK_TYPE:-}" ] && [[ "${DISK_TYPE:-}" != "scsi" ]]; then
|
||||
echo "$DISK_TYPE" > "$STORAGE/windows.type"
|
||||
fi
|
||||
|
||||
if [ -n "${ADAPTER:-}" ] && [[ "${ADAPTER:-}" != "virtio-net-pci" ]]; then
|
||||
echo "$ADAPTER" > "$STORAGE/windows.net"
|
||||
fi
|
||||
|
||||
rm -rf "$TMP"
|
||||
return 0
|
||||
}
|
||||
|
@ -185,6 +199,7 @@ abortInstall() {
|
|||
local efi
|
||||
|
||||
[[ "${iso,,}" == *".esd" ]] && exit 60
|
||||
[[ "${UNPACK:-}" == [Yy1]* ]] && exit 60
|
||||
|
||||
efi=$(find "$dir" -maxdepth 1 -type d -iname efi | head -n 1)
|
||||
|
||||
|
@ -336,7 +351,7 @@ extractImage() {
|
|||
local dir="$2"
|
||||
local version="$3"
|
||||
local desc="local ISO"
|
||||
local size size_gb space space_gb
|
||||
local file size size_gb space space_gb
|
||||
|
||||
if [ -z "$CUSTOM" ]; then
|
||||
desc="downloaded ISO"
|
||||
|
@ -375,8 +390,27 @@ extractImage() {
|
|||
error "Failed to extract ISO file: $iso" && return 1
|
||||
fi
|
||||
|
||||
if [[ "${UNPACK:-}" != [Yy1]* ]]; then
|
||||
|
||||
LABEL=$(isoinfo -d -i "$iso" | sed -n 's/Volume id: //p')
|
||||
|
||||
else
|
||||
|
||||
file=$(find "$dir" -maxdepth 1 -type f -iname "*.iso" | head -n 1)
|
||||
|
||||
if [ -z "$file" ]; then
|
||||
error "Failed to find any .iso file in archive!" && return 1
|
||||
fi
|
||||
|
||||
if ! 7z x "$file" -o"$dir" > /dev/null; then
|
||||
error "Failed to extract archive!" && return 1
|
||||
fi
|
||||
|
||||
LABEL=$(isoinfo -d -i "$file" | sed -n 's/Volume id: //p')
|
||||
rm -f "$file"
|
||||
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
|
@ -689,16 +723,18 @@ updateXML() {
|
|||
sed -i "s/<Username>Docker<\/Username>/<Username>$user<\/Username>/g" "$asset"
|
||||
fi
|
||||
|
||||
if [ -n "$PASSWORD" ]; then
|
||||
pass=$(printf '%s' "${PASSWORD}Password" | iconv -f utf-8 -t utf-16le | base64 -w 0)
|
||||
admin=$(printf '%s' "${PASSWORD}AdministratorPassword" | iconv -f utf-8 -t utf-16le | base64 -w 0)
|
||||
[ -n "$PASSWORD" ] && pass="$PASSWORD"
|
||||
[ -z "$pass" ] && pass="admin"
|
||||
|
||||
pw=$(printf '%s' "${pass}Password" | iconv -f utf-8 -t utf-16le | base64 -w 0)
|
||||
admin=$(printf '%s' "${pass}AdministratorPassword" | iconv -f utf-8 -t utf-16le | base64 -w 0)
|
||||
|
||||
sed -i "s/<Value>password<\/Value>/<Value>$admin<\/Value>/g" "$asset"
|
||||
sed -i "s/<PlainText>true<\/PlainText>/<PlainText>false<\/PlainText>/g" "$asset"
|
||||
sed -z "s/<Password>...........<Value \/>/<Password>\n <Value>$pass<\/Value>/g" -i "$asset"
|
||||
sed -z "s/<Password>...............<Value \/>/<Password>\n <Value>$pass<\/Value>/g" -i "$asset"
|
||||
sed -z "s/<Password>...........<Value \/>/<Password>\n <Value>$pw<\/Value>/g" -i "$asset"
|
||||
sed -z "s/<Password>...............<Value \/>/<Password>\n <Value>$pw<\/Value>/g" -i "$asset"
|
||||
sed -z "s/<AdministratorPassword>...........<Value \/>/<AdministratorPassword>\n <Value>$admin<\/Value>/g" -i "$asset"
|
||||
sed -z "s/<AdministratorPassword>...............<Value \/>/<AdministratorPassword>\n <Value>$admin<\/Value>/g" -i "$asset"
|
||||
fi
|
||||
|
||||
if [ -n "$EDITION" ]; then
|
||||
[[ "${EDITION^^}" == "CORE" ]] && EDITION="STANDARDCORE"
|
||||
|
@ -801,7 +837,7 @@ addDrivers() {
|
|||
addDriver "$version" "$drivers" "$target" "qxl" || return 1
|
||||
addDriver "$version" "$drivers" "$target" "viofs" || return 1
|
||||
addDriver "$version" "$drivers" "$target" "sriov" || return 1
|
||||
# Disable temporarily : addDriver "$version" "$drivers" "$target" "smbus" || return 1
|
||||
addDriver "$version" "$drivers" "$target" "smbus" || return 1
|
||||
addDriver "$version" "$drivers" "$target" "qxldod" || return 1
|
||||
addDriver "$version" "$drivers" "$target" "viorng" || return 1
|
||||
addDriver "$version" "$drivers" "$target" "viostor" || return 1
|
||||
|
@ -809,7 +845,7 @@ addDrivers() {
|
|||
addDriver "$version" "$drivers" "$target" "NetKVM" || return 1
|
||||
addDriver "$version" "$drivers" "$target" "Balloon" || return 1
|
||||
addDriver "$version" "$drivers" "$target" "vioscsi" || return 1
|
||||
# Disable temporarily : addDriver "$version" "$drivers" "$target" "pvpanic" || return 1
|
||||
addDriver "$version" "$drivers" "$target" "pvpanic" || return 1
|
||||
addDriver "$version" "$drivers" "$target" "vioinput" || return 1
|
||||
addDriver "$version" "$drivers" "$target" "viogpudo" || return 1
|
||||
addDriver "$version" "$drivers" "$target" "vioserial" || return 1
|
||||
|
@ -1034,6 +1070,27 @@ bootWindows() {
|
|||
ARGUMENTS="$ARGS ${ARGUMENTS:-}"
|
||||
fi
|
||||
|
||||
if [ -s "$STORAGE/windows.vga" ] && [ -f "$STORAGE/windows.vga" ]; then
|
||||
if [ -z "${VGA:-}" ]; then
|
||||
VGA=$(<"$STORAGE/windows.vga")
|
||||
VGA="${VGA//[![:print:]]/}"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -s "$STORAGE/windows.usb" ] && [ -f "$STORAGE/windows.usb" ]; then
|
||||
if [ -z "${USB:-}" ]; then
|
||||
USB=$(<"$STORAGE/windows.usb")
|
||||
USB="${USB//[![:print:]]/}"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -s "$STORAGE/windows.net" ] && [ -f "$STORAGE/windows.net" ]; then
|
||||
if [ -z "${ADAPTER:-}" ]; then
|
||||
ADAPTER=$(<"$STORAGE/windows.net")
|
||||
ADAPTER="${ADAPTER//[![:print:]]/}"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -s "$STORAGE/windows.type" ] && [ -f "$STORAGE/windows.type" ]; then
|
||||
if [ -z "${DISK_TYPE:-}" ]; then
|
||||
DISK_TYPE=$(<"$STORAGE/windows.type")
|
||||
|
|
15
src/mido.sh
15
src/mido.sh
|
@ -472,6 +472,18 @@ getESD() {
|
|||
return 0
|
||||
}
|
||||
|
||||
isCompressed() {
|
||||
|
||||
local file="$1"
|
||||
|
||||
case "${file,,}" in
|
||||
*".7z" | *".zip" | *".rar" | *".lzma" | *".bz" | *".bz2" )
|
||||
return 0 ;;
|
||||
esac
|
||||
|
||||
return 1
|
||||
}
|
||||
|
||||
verifyFile() {
|
||||
|
||||
local iso="$1"
|
||||
|
@ -560,6 +572,7 @@ downloadFile() {
|
|||
error "Invalid download link: $url (is only $total_gb ?). Please report this at $SUPPORT/issues." && return 1
|
||||
fi
|
||||
verifyFile "$iso" "$size" "$total" "$sum" || return 1
|
||||
isCompressed "$url" && UNPACK="Y"
|
||||
html "Download finished successfully..." && return 0
|
||||
fi
|
||||
|
||||
|
@ -584,12 +597,14 @@ downloadImage() {
|
|||
local msg="Will retry after $delay seconds..."
|
||||
|
||||
if [[ "${version,,}" == "http"* ]]; then
|
||||
|
||||
base=$(basename "$iso")
|
||||
desc=$(fromFile "$base")
|
||||
downloadFile "$iso" "$version" "" "" "" "$desc" && return 0
|
||||
info "$msg" && html "$msg" && sleep "$delay"
|
||||
downloadFile "$iso" "$version" "" "" "" "$desc" && return 0
|
||||
rm -f "$iso"
|
||||
|
||||
return 1
|
||||
fi
|
||||
|
||||
|
|
Loading…
Reference in a new issue