Cleanup: Remove reverse SSH tunnel code, fix documentation accuracy
Agent-Logs-Url: https://github.com/naturallaw777/staging_alpha/sessions/3941ead1-cb20-4686-92bb-46e447791ae3 Co-authored-by: naturallaw777 <99053422+naturallaw777@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
af14622e45
commit
3ca15d0da4
@@ -151,12 +151,6 @@ in
|
||||
description = "Domain for the Headscale coordination server (e.g. hs.sovransystems.com)";
|
||||
};
|
||||
|
||||
enrollToken = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "";
|
||||
description = "Static enrollment token. If empty, one is auto-generated on first boot.";
|
||||
};
|
||||
|
||||
headscaleUser = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "sovran-deploy";
|
||||
@@ -251,17 +245,13 @@ in
|
||||
script = ''
|
||||
mkdir -p ${cfg.stateDir}
|
||||
|
||||
# Generate enrollment token if not exists and not set statically
|
||||
# Auto-generate enrollment token on first boot if not already present
|
||||
TOKEN_FILE="${cfg.stateDir}/enroll-token"
|
||||
${if cfg.enrollToken != "" then ''
|
||||
echo "${cfg.enrollToken}" > "$TOKEN_FILE"
|
||||
'' else ''
|
||||
if [ ! -f "$TOKEN_FILE" ]; then
|
||||
${pkgs.openssl}/bin/openssl rand -hex 32 > "$TOKEN_FILE"
|
||||
chmod 600 "$TOKEN_FILE"
|
||||
echo "Generated new enrollment token: $(cat $TOKEN_FILE)"
|
||||
fi
|
||||
''}
|
||||
if [ ! -f "$TOKEN_FILE" ]; then
|
||||
${pkgs.openssl}/bin/openssl rand -hex 32 > "$TOKEN_FILE"
|
||||
chmod 600 "$TOKEN_FILE"
|
||||
echo "Generated new enrollment token: $(cat $TOKEN_FILE)"
|
||||
fi
|
||||
|
||||
# Ensure headscale users exist
|
||||
${pkgs.headscale}/bin/headscale users create ${cfg.headscaleUser} 2>/dev/null || true
|
||||
|
||||
Reference in New Issue
Block a user