diff --git a/software/nayuos/instance.cfg b/software/nayuos/instance.cfg index d51e875f11d7e85caa5870f94402aef7e1396251..90e528fa9ad81a51253de36094b1636bfaee1b6d 100644 --- a/software/nayuos/instance.cfg +++ b/software/nayuos/instance.cfg @@ -99,7 +99,7 @@ context = recipe = slapos.recipe.template:jinja2 template = {{ software_dir }}/scripts/cros_full_build.in rendered = ${directory:run}/cros_full_build -md5sum = 2a64b5cc0314ec2221a949928956f5c0 +md5sum = ff09ba2bda748af933c78de4df9149fc mode = 0700 context = key bash_path bin:bash @@ -111,6 +111,7 @@ context = key keep_cache parameters:configuration.keep_cache key ebuilds_dir nayuos-ebuilds:location raw scripts_dir {{ software_dir }}/scripts + raw patches_dir {{ software_dir }}/patches raw logo_dir {{ software_dir }}/logo # packages to be copied from our overlay into ChromiuOS' overlay # those packages will be marked as dependency of root filesystem diff --git a/software/nayuos/patches/user-agent.patch b/software/nayuos/patches/user-agent.patch new file mode 100644 index 0000000000000000000000000000000000000000..79f68d5c210da57542a8286ccba51bf97d7e0160 --- /dev/null +++ b/software/nayuos/patches/user-agent.patch @@ -0,0 +1,14 @@ +diff --git a/login_manager/chrome_setup.cc b/login_manager/chrome_setup.cc +index cbe93f471..bd72cbb09 100644 +--- a/login_manager/chrome_setup.cc ++++ b/login_manager/chrome_setup.cc +@@ -341,6 +341,9 @@ void AddSystemFlags(ChromiumCommandBuilder* builder) { + // On developer systems, set a flag to let the browser know. + if (builder->is_developer_end_user()) + builder->AddArg("--system-developer-mode"); ++ //Modify user agent to improve anonimity by preventing fingerprinting ++ const char* useragent = "$USERAGENTSTRING" ++ builder->AddArg(base::StringPrintf("--user-agent=%s",useragent)) + } + + // Adds UI-related flags to the command line. diff --git a/software/nayuos/scripts/cros_full_build.in b/software/nayuos/scripts/cros_full_build.in index fc066d7f17247093288c6c1264135204ca47ba62..83afa7004562e6024029a52280370637d6af2687 100644 --- a/software/nayuos/scripts/cros_full_build.in +++ b/software/nayuos/scripts/cros_full_build.in @@ -152,6 +152,11 @@ increase_revision_number ${CHROMIUM_OVERLAY}/chromeos-base/openssh-server-init/ sed -i -n '/src_install/q;p' $(latest_ebuild ${CHROMIUM_OVERLAY}/chromeos-base/chromeos-sshd-init) increase_revision_number ${CHROMIUM_OVERLAY}/chromeos-base/chromeos-sshd-init/ +# modify user agent to improve anonimity by preventing fingerprinting +# TODO: scrape https://techblog.willshouse.com/2012/01/03/most-common-user-agents/ +NEWUSERAGENT="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36" +sed -i "s!\$USERAGENTSTRING!${NEWUSERAGENT}!" {{patches_dir}}/user-agent.patch +patch {{ cros_location }}/{{ branch }}/src/platform2/login_manager/chrome_setup.cc {{patches_dir}}/user-agent.patch # bashrc modifications BASH_EBUILD_DIR="${PORTAGE_STABLE}/app-shells/bash" diff --git a/software/nayuos/software.cfg b/software/nayuos/software.cfg index fc19946a06fbf18df3b4be696a3739c4ffde0f6d..55921989fe7c3f6537f5bba112b74ffa42078225 100644 --- a/software/nayuos/software.cfg +++ b/software/nayuos/software.cfg @@ -6,6 +6,7 @@ extends = ../../component/libexpat/buildout.cfg ../../component/libaio/buildout.cfg ../../component/boost-lib/buildout.cfg + ../../component/patch/buildout.cfg parts += slapos-cookbook @@ -13,6 +14,7 @@ parts += git curl thin-provisioning-tools + patch versions = versions @@ -26,7 +28,7 @@ recipe = slapos.recipe.template:jinja2 template = ${:_profile_base_location_}/instance.cfg rendered = ${buildout:directory}/instance.cfg mode = 0644 -md5sum = 73f964d73367dbf280d904e408a7f9b8 +md5sum = 30389eea4851d3e353466e1a2712c54e context = key software_dir :_profile_base_location_ key instance_dir buildout:directory