Revert "merge: apply windows standalone service installer and awHostname hardening"

This reverts commit e643576aa9, reversing
changes made to 669501f20a.
This commit is contained in:
igor04091968
2026-05-08 00:41:00 +03:00
parent e643576aa9
commit 6f5e5eb751
71 changed files with 23918 additions and 19579 deletions
+1 -10
View File
@@ -18,12 +18,7 @@ JsonScalar: TypeAlias = str | int | float | bool | None
JsonValue: TypeAlias = JsonScalar | list["JsonValue"] | dict[str, "JsonValue"]
DEFAULT_BUCKET_PREFIXES = (
"aw-file-operations_",
"aw-dlp-incidents_",
"aw-dlp-endpoint-signals_",
"aw-email-monitor_",
)
DEFAULT_BUCKET_PREFIXES = ("aw-file-operations_", "aw-dlp-incidents_")
DEFAULT_SQLITE_PATH = "data/dlp-events.sqlite3"
EVENT_COLUMNS = (
"bucket_id",
@@ -139,10 +134,6 @@ def bucket_stream_type(bucket: Bucket) -> str | None:
return "file_operation"
if bucket.id.startswith("aw-dlp-incidents_") or bucket.type == "aw.dlp.incident":
return "dlp_incident"
if bucket.id.startswith("aw-dlp-endpoint-signals_") or bucket.type == "aw.dlp.endpoint.signal":
return "dlp_endpoint_signal"
if bucket.id.startswith("aw-email-monitor_") or bucket.type == "aw.email.signal":
return "email_monitor"
return None
+1 -28
View File
@@ -4,26 +4,11 @@ set -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
cd "$ROOT_DIR"
# shellcheck disable=SC2034
KIT_DIR="install-kit-awindows-20260427-211240"
PY_BIN="${PY_BIN:-}"
if [[ -z "$PY_BIN" ]]; then
if command -v python3 >/dev/null 2>&1; then
PY_BIN="python3"
elif command -v python >/dev/null 2>&1; then
PY_BIN="python"
else
echo "ERROR: python3/python not found"
exit 127
fi
fi
"$PY_BIN" - <<'PY'
python - <<'PY'
from pathlib import Path
import hashlib
import os
import sys
root=Path('.')
kit=Path('install-kit-awindows-20260427-211240')
@@ -39,13 +24,6 @@ missing_in_repo=[]
for kp in sorted(p for p in kit.rglob('*') if p.is_file() and p.name!='MANIFEST.txt'):
rel=kp.relative_to(kit)
rel_s=str(rel)
if rel_s.startswith("server-configs-192.168.100.21/"):
continue
if rel_s == "README-INSTALL-KIT.txt":
continue
if "__pycache__" in kp.parts or kp.suffix == ".pyc":
continue
rp=root/rel
if not rp.exists():
missing_in_repo.append(str(rel))
@@ -72,9 +50,4 @@ if ps_mismatches:
print('--- PowerShell mismatches ---')
for p in ps_mismatches:
print(p)
strict = os.getenv("ALLOW_KIT_DRIFT", "").lower() not in {"1", "true", "yes"}
if strict and (missing_in_repo or mismatches):
print("ERROR: install-kit drift detected. Set ALLOW_KIT_DRIFT=1 to bypass.")
sys.exit(1)
PY
@@ -49,7 +49,6 @@ while [ "$#" -gt 0 ]; do
esac
done
# shellcheck disable=SC1007
SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
sh "${SCRIPT_DIR}/install_aw_linux_client.sh" \
+2 -14
View File
@@ -21,11 +21,9 @@ prompt_secret() {
if [[ -n "${!var_name:-}" ]]; then
return 0
fi
local _val
read -r -s -p "${prompt}: " _val
read -r -s -p "${prompt}: " "$var_name"
echo
printf -v "$var_name" '%s' "$_val"
declare -gx "$var_name"
export "$var_name"
}
require_cmd git
@@ -35,12 +33,6 @@ require_cmd ansible
log "Repo: ${ROOT_DIR}"
log "Branch: $(git branch --show-current)"
if [[ "${AW_MAINTENANCE_ACK:-}" != "YES" ]]; then
log "ERROR: maintenance window is required."
log "Set AW_MAINTENANCE_ACK=YES to proceed."
exit 4
fi
log "Running local quality gate..."
./scripts/quality-gate.sh | tee -a "${LOG_DIR}/quality-gate.log"
@@ -73,10 +65,6 @@ log "Preflight connectivity..."
ansible -i ansible/inventory.ini aw_server -m ping | tee -a "${LOG_DIR}/ping_aw_server.log"
ansible -i ansible/inventory.ini aw_windows -m win_ping | tee -a "${LOG_DIR}/ping_aw_windows.log"
log "Preflight ActivityWatch API/data checks..."
./check-aw-data.sh | tee -a "${LOG_DIR}/check_aw_data.log"
./check-aw-full.sh | tee -a "${LOG_DIR}/check_aw_full.log"
log "Dry-run aw_server..."
ansible-playbook -i ansible/inventory.ini ansible/deploy_aw_server.yml --check --diff | tee -a "${LOG_DIR}/check_aw_server.log"
+6 -15
View File
@@ -4,42 +4,33 @@ set -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
cd "$ROOT_DIR"
echo "[1/6] Bash syntax check"
echo "[1/4] Bash syntax check"
find aw-server proxmox -type f -name "*.sh" -print0 | xargs -0 -r -n1 bash -n
echo "[2/6] Shellcheck (if available)"
echo "[2/4] Shellcheck (if available)"
if command -v shellcheck >/dev/null 2>&1; then
find aw-server proxmox -type f -name "*.sh" -print0 | xargs -0 -r shellcheck -e SC1007,SC1090,SC2016
else
echo "shellcheck not found, skipping."
fi
echo "[3/6] PowerShell parse check (if pwsh available)"
echo "[3/4] PowerShell parse check (if pwsh available)"
if command -v pwsh >/dev/null 2>&1; then
if ! pwsh -NoLogo -NoProfile -Command '
pwsh -NoLogo -NoProfile -Command '
$ErrorActionPreference = "Stop"
Get-ChildItem windows -Filter *.ps1 | ForEach-Object {
[void][System.Management.Automation.Language.Parser]::ParseFile($_.FullName,[ref]$null,[ref]$null)
}
[void][System.Management.Automation.Language.Parser]::ParseFile((Resolve-Path "windows/ActivityWatch.Windows.Common.psm1"),[ref]$null,[ref]$null)
[void][System.Management.Automation.Language.Parser]::ParseFile((Resolve-Path "windows/ActivityWatch.Windows.Common.psd1"),[ref]$null,[ref]$null)
'; then
echo "pwsh parse check failed due runtime environment; skipping."
fi
'
else
echo "pwsh not found, skipping."
fi
echo "[4/6] Install-kit consistency check"
./scripts/check_install_kit_vs_repo.sh
echo "[5/6] Generated-artifacts guard"
if git status --short | grep -E '^(\\?\\?| M|M ) (\\.graphify_|graphify-out/|reports/|tmp/|data/)'; then
echo "ERROR: generated artifacts detected in working tree. Clean or ignore them before rollout."
exit 1
fi
echo "[6/6] Ansible syntax check (if ansible-playbook available)"
echo "[4/4] Ansible syntax check (if ansible-playbook available)"
if command -v ansible-playbook >/dev/null 2>&1; then
for playbook in ansible/*.yml; do
ansible-playbook --syntax-check "$playbook" -i ansible/inventory.example.ini >/dev/null
-3
View File
@@ -6,10 +6,7 @@ cd "$ROOT_DIR"
KIT_DIR="install-kit-awindows-20260427-211240"
MANIFEST="$KIT_DIR/MANIFEST.txt"
# ZIP/TAR variables are declared for archive checks in this script; keep them for clarity
# shellcheck disable=SC2034
ZIP_ARCHIVE="install-kit-awindows-20260427-211240.zip"
# shellcheck disable=SC2034
TAR_ARCHIVE="install-kit-awindows-20260427-211240.tar.gz"
required_files=(