Do not ignore setting file permissions when running on single-user mode.
Fix the build-agent upload problem by decoupling from home directory; fix environment related problems; better handle the secrets for the bld-agent.