Commit ebc34a1e authored by Tails developers's avatar Tails developers
Browse files

Merge remote-tracking branch 'origin/devel' into testing

parents 69fca000 eb4674a8
......@@ -45,3 +45,5 @@
/config/chroot_local-includes/usr/share/desktop-directories/Tails.directory
/tmp/
# Files generated during the test suite
/features/misc_files/video.mp4
......@@ -344,45 +344,3 @@ namespace :vm do
abort "'vagrant destroy' failed" unless result
end
end
namespace :basebox do
task :create_preseed_cfg => 'validate_http_proxy' do
require 'erb'
preseed_cfg_path = File.expand_path('../vagrant/definitions/squeeze/preseed.cfg', __FILE__)
template = ERB.new(File.read("#{preseed_cfg_path}.erb"))
File.open(preseed_cfg_path, 'w') do |f|
f.write template.result
end
end
desc 'Create virtual machine template (a.k.a. basebox)'
task :create_basebox => [:create_preseed_cfg] do
# veewee is pretty stupid regarding path handling
Dir.chdir(VAGRANT_PATH) do
require 'veewee'
# Veewee assumes a separate process for each task. So we mimic that.
env = Vagrant::Environment.new(:ui_class => Vagrant::UI::Basic)
Process.fork do
env.cli('basebox', 'build', 'squeeze')
end
Process.wait
abort "Building the basebox failed (exit code: #{$?.exitstatus})." if $?.exitstatus != 0
Process.fork do
env.cli('basebox', 'validate', 'squeeze')
end
Process.wait
abort "Validating the basebox failed (exit code: #{$?.exitstatus})." if $?.exitstatus != 0
Process.fork do
env.cli('basebox', 'export', 'squeeze')
end
Process.wait
abort "Exporting the basebox failed (exit code: #{$?.exitstatus})." if $?.exitstatus != 0
end
end
end
......@@ -65,7 +65,7 @@ chmod -R go+rX config/chroot_sources
# build the image
: ${MKSQUASHFS_OPTIONS:='-comp xz'}
: ${MKSQUASHFS_OPTIONS:='-comp xz -Xbcj x86 -b 1024K -Xdict-size 1024K'}
MKSQUASHFS_OPTIONS="${MKSQUASHFS_OPTIONS} -wildcards -ef chroot/usr/share/amnesia/build/mksquashfs-excludes"
export MKSQUASHFS_OPTIONS
......
......@@ -43,11 +43,13 @@ cp "$CHROOT_SYSLINUX_MBR" "$BINARY_MBR_DIR/mbr.bin"
cat chroot/etc/apt/sources.list chroot/etc/apt/sources.list.d/*.list \
| sed --regexp-extended -e 's,^deb(\s+),deb-src\1,' \
> "$CHROOT_TEMP_APT_SOURCES"
mv chroot/etc/apt/apt.conf.d/{,.}0000runtime-proxy
Chroot chroot apt-get --yes update
Chroot chroot apt-get --yes install dpkg-dev
Chroot chroot apt-get source syslinux="$(syslinux_deb_version_in_chroot)"
cp chroot/syslinux-*/bios/win32/syslinux.exe "$WIN32_BINARY_UTILS_DIR/"
rm -r chroot/syslinux*
rm "$CHROOT_TEMP_APT_SOURCES"
mv chroot/etc/apt/apt.conf.d/{.,}0000runtime-proxy
Chroot chroot apt-get --yes update
Chroot chroot apt-get --yes purge dpkg-dev make # dpkg-dev depends on make
......@@ -33,7 +33,7 @@ esac
# Main
mkdir -p binary/EFI/BOOT
cp chroot/usr/lib/SYSLINUX/efi64/syslinux.efi binary/EFI/BOOT/bootx64.efi
cp chroot/usr/lib/SYSLINUX.EFI/efi64/syslinux.efi binary/EFI/BOOT/bootx64.efi
cp chroot/usr/share/tails/bootx64.png binary/EFI/BOOT/
cp "$SYSLINUX_PATH"/* binary/EFI/BOOT/
cp -f chroot/usr/lib/syslinux/modules/efi64/* binary/EFI/BOOT/
......
This diff is collapsed.
......@@ -18,6 +18,14 @@ Package: bilibop-udev
Pin: release o=Debian Backports,n=wheezy-backports
Pin-Priority: 999
Package: cryptsetup
Pin: release o=Debian Backports,n=wheezy-backports
Pin-Priority: 999
Package: cryptsetup-bin
Pin: release o=Debian Backports,n=wheezy-backports
Pin-Priority: 999
Package: florence
Pin: release o=Debian Backports,n=wheezy-backports
Pin-Priority: 999
......@@ -94,6 +102,10 @@ Package: iucode-tool
Pin: release o=Debian Backports,n=wheezy-backports
Pin-Priority: 999
Package: libcryptsetup4
Pin: release o=Debian Backports,n=wheezy-backports
Pin-Priority: 999
Package: linux-base
Pin: release o=Debian,a=unstable
Pin-Priority: 999
......@@ -198,10 +210,6 @@ Package: ttdnsd
Pin: release o=TorProject,a=unstable
Pin-Priority: 999
Package: xul-ext-foxyproxy-standard
Pin: release o=Debian,a=experimental
Pin-Priority: 999
Package: xul-ext-https-everywhere
Pin: release o=Debian,a=unstable
Pin-Priority: 999
......@@ -210,6 +218,11 @@ Package: xul-ext-noscript
Pin: release o=Debian Backports,n=wheezy-backports
Pin-Priority: 999
Explanation: Block installation of iceweasel until it has been removed from our APT repo
Package: iceweasel
Pin: origin deb.tails.boum.org
Pin-Priority: -1
Explanation: weirdness in chroot_apt install-binary
Package: *
Pin: release o=chroot_local-packages
......@@ -220,11 +233,11 @@ Pin: origin deb.tails.boum.org
Pin-Priority: 1005
Package: *
Pin: origin mozilla.debian.net
Pin: release o=Debian,n=wheezy-updates
Pin-Priority: 990
Package: *
Pin: release o=Debian,n=wheezy-updates
Pin: release o=Debian,n=wheezy-proposed-updates
Pin-Priority: 990
Package: *
......
#!/bin/sh
set -e
# Create the i2pbrowser user.
#
# We run i2p-browser under this user
echo "Creating the i2pbrowser user"
adduser --system --quiet --group i2pbrowser
#!/bin/sh
set -eu
echo "Install the Tor Browser"
# Get the below with `grep "tor-browser-linux32-.*\.tar.xz" sha256sums.txt`
BUNDLES="$(cat <<EOF
473780a5145859a8d516e76cb27be25b0baf16007ba50cd8ba78a536bc806fc5 tor-browser-linux32-tbb-nightly_ar.tar.xz
3e3d6fd1ea47067fc00625b8cd62d23079ef71dc91734bfb823542c26ce192cf tor-browser-linux32-tbb-nightly_en-US.tar.xz
df4745725e7b3fe99c218166ffbe38eef8e9d636c42b72c8a2b8229fc3bdd83b tor-browser-linux32-tbb-nightly_ru.tar.xz
b624b1f9a16e4ff4cffb3478f63249ed73ae902732b64fca0f183ad73ed1b5ac tor-browser-linux32-tbb-nightly_zh-CN.tar.xz
EOF
)"
MAIN_BUNDLE="$(echo "${BUNDLES}" | grep -o "tor-browser-linux32-.*_en-US.tar.xz")"
#VERSION="$(echo "${MAIN_BUNDLE}" | sed 's/tor-browser-linux32-\(.*\)_en-US.tar.xz/\1/')"
VERSION=tbb-nightly-2014-10-07
# Note that we cannot use https here since apt-cacher-ng (used by vagrant)
# gets confused and throws a 403. It doesn't matter, though, since we verify
# the checksums of each file downloaded.
#TBB_DIST_URL="http://archive.torproject.org/tor-package-archive/torbrowser/${VERSION}"
#TBB_DIST_URL="http://www.torproject.org/dist/torbrowser/${VERSION}/"
#TBB_DIST_URL="http://people.torproject.org/~mikeperry/builds/${VERSION}/"
#TBB_DIST_URL="http://people.torproject.org/~gk/testbuilds/${VERSION}"
TBB_DIST_URL="http://people.torproject.org/~linus/builds/${VERSION}"
# Import the TBB_INSTALL, TBB_PROFILE and TBB_EXT variables, which
# contains the paths we will split TBB's actual browser (binaries
# etc), user data and extension into. While this differs from how the
# TBB organizes the files, the end result will be the same, and it's
# practical since when creating a new browser profile we can simply
# copy the profile directory without duplicating all extensions.
. /usr/local/lib/tails-shell-library/tor-browser.sh
mkdir -p "${TBB_INSTALL}" "${TBB_PROFILE}" "${TBB_EXT}"
# Use the builder's caching APT proxy, if any
APT_PROXY="$(apt-config --format '%v' dump Acquire::http::Proxy)"
if [ -n "${APT_PROXY}" ]; then
export HTTP_PROXY="${APT_PROXY}"
export http_proxy="${APT_PROXY}"
export HTTPS_PROXY="${APT_PROXY}"
export https_proxy="${APT_PROXY}"
fi
TMP="$(mktemp -d)"
echo "${BUNDLES}" | while read expected_sha256 tarball; do
(
cd "${TMP}"
echo "Fetching ${TBB_DIST_URL}/${tarball} ..."
curl --remote-name "${TBB_DIST_URL}/${tarball}"
)
actual_sha256="$(sha256sum "${TMP}/${tarball}" | cut -d' ' -f1)"
if [ "${actual_sha256}" != "${expected_sha256}" ]; then
echo "SHA256 mismatch for ${tarball}" >&2
exit 1
fi
done
# We'll use the en-US bundle as our basis...
tar -xf "${TMP}/${MAIN_BUNDLE}" -C "${TMP}" tor-browser_en-US
TBB_PREP="${TMP}"/tor-browser_en-US
# ... only extracting the localization addon from the other ones, which
# we'll put in a global extensions directory that we'll symlink to so
# we don't have to deal with wasteful copies.
for tarball in "${TMP}"/tor-browser-*.tar.xz; do
locale="$(echo "${tarball}" | sed "s@^.*/tor-browser-.*_\(.*\)\.tar\.xz@\1@")"
if [ "${locale}" = en-US ]; then
continue
fi
xpi="tor-browser_${locale}/Browser/TorBrowser/Data/Browser/profile.default/extensions/langpack-${locale}@firefox.mozilla.org.xpi"
(
cd "${TMP}"
tar -xf "${tarball}" "${xpi}"
mv "${xpi}" "${TBB_EXT}"
)
done
# Enable our myspell/hunspell dictionaries. TBB only provides the one
# for en-US, but Debian's seems more comprehensive, so we'll only use
# Debian's dictionaries.
rm -f "${TBB_PREP}"/Browser/dictionaries/*
for f in /usr/share/hunspell/*.aff /usr/share/hunspell/*.dic; do
name="$(basename "${f}")"
ln -s "${f}" "${TBB_PREP}"/Browser/dictionaries/"${name}"
done
# We don't want tor-launcher to be part of the regular browser
# profile. Moreover, for the stand-alone tor-launcher we use, we need
# our patched version. So, the version shipped in the TB really is not
# useful for us.
rm "${TBB_PREP}/Browser/TorBrowser/Data/Browser/profile.default/extensions/tor-launcher@torproject.org.xpi"
# Remove TBB's torbutton since the "Tor test" will fail and about:tor
# will report an error. We'll install our own Torbutton later, which
# has the extensions.torbutton.test_enabled boolean pref as a workaround.
rm "${TBB_PREP}/Browser/TorBrowser/Data/Browser/profile.default/extensions/torbutton@torproject.org.xpi"
# See comment below why we need the Browser sub-dir
mv "${TBB_PREP}/Browser" "${TBB_INSTALL}"/Browser
# The Tor Browser will fail, complaining about an incomplete profile,
# unless there's a readable Browser/TorBrowser/Data/Browser/Caches
# in the directory where the firefox executable is located.
mkdir -p "${TBB_INSTALL}"/Browser/TorBrowser/Data/Browser/Caches
# Let's put all the bundled extensions in the global extensions directory
mv "${TBB_INSTALL}"/Browser/TorBrowser/Data/Browser/profile.default/extensions/* "${TBB_EXT}"
rmdir "${TBB_INSTALL}"/Browser/TorBrowser/Data/Browser/profile.default/extensions
# Create and install a fake iceweasel package so we can install our
# desired Debian-packaged Iceweasel addons
apt-get install --yes equivs
FAKE_ICEWEASEL_VERSION=$(sed -n 's/^Version=\(.*\)$/\1/p' "${TBB_INSTALL}"/Browser/application.ini)+fake1
cat > "${TMP}"/iceweasel.control << EOF
Section: web
Priority: optional
Homepage: https://tails.boum.org/
Standards-Version: 3.6.2
Package: iceweasel
Version: ${FAKE_ICEWEASEL_VERSION}
Maintainer: Tails developers <amnesia@boum.org>
Architecture: all
Description: (Fake) Iceweasel
Make it possible to install Debian's Iceweasel addons without having to
install a real Iceweasel.
EOF
(
cd "${TMP}"
equivs-build "${TMP}"/iceweasel.control
dpkg -i "${TMP}"/iceweasel_"${FAKE_ICEWEASEL_VERSION}"_all.deb
)
apt-get install --yes xul-ext-adblock-plus xul-ext-torbutton
ln -s /usr/share/xul-ext/adblock-plus/ "${TBB_EXT}"/'{d10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d}'
ln -s /usr/share/xul-ext/torbutton/ "${TBB_EXT}"/torbutton@torproject.org
rsync -a --exclude bookmarks.html --exclude extensions \
"${TBB_INSTALL}"/Browser/TorBrowser/Data/Browser/profile.default/ \
"${TBB_PROFILE}"/
# Remove TBB's default bridges
sed -i '/extensions\.torlauncher\.default_bridge\./d' "${TBB_PROFILE}"/preferences/extension-overrides.js
mkdir -p "${TBB_PROFILE}"/extensions
for ext in "${TBB_EXT}"/*; do
ln -s "${ext}" "${TBB_PROFILE}"/extensions/
done
chown -R root:root "${TBB_INSTALL}" "${TBB_PROFILE}" "${TBB_EXT}"
chmod -R a+rX "${TBB_INSTALL}" "${TBB_PROFILE}" "${TBB_EXT}"
rm -r "${TMP}"
update-alternatives --install /usr/bin/x-www-browser x-www-browser /usr/local/bin/tor-browser 99
update-alternatives --install /usr/bin/gnome-www-browser gnome-www-browser /usr/local/bin/tor-browser 99
#!/bin/sh
set -e
# Remove unwanted browser search plugins.
echo "Removing unwanted browser search plugins"
# Import the TBB_INSTALL variable
. /usr/local/lib/tails-shell-library/tor-browser.sh
PLUGIN_DIR="${TBB_INSTALL}"/Browser/browser/searchplugins
rm "${PLUGIN_DIR}"/amazon*.xml
rm "${PLUGIN_DIR}"/bing*.xml
rm "${PLUGIN_DIR}"/eBay*.xml
rm "${PLUGIN_DIR}"/yahoo*.xml
#!/bin/sh
set -e
# Remove unwanted iceweasel search plugins.
echo "Removing unwanted iceweasel search plugins"
rm /etc/iceweasel/searchplugins/common/duckduckgo.xml
rm /etc/iceweasel/searchplugins/locale/*/amazon*.xml
rm /etc/iceweasel/searchplugins/locale/*/answers.xml
rm /etc/iceweasel/searchplugins/locale/*/bing*.xml
rm /etc/iceweasel/searchplugins/locale/*/eBay*.xml
rm /etc/iceweasel/searchplugins/locale/*/yahoo*.xml
#!/bin/sh
set -e
# Build binary sqlite iceweasel files from plain text SQL files.
echo "Building iceweasel sqlite files"
INSTALLED_PACKAGES="sqlite3"
SQL_SRC_DIR=/usr/share/amnesia/iceweasel/sql
ICEWEASEL_PROFILE_DIR=/etc/iceweasel/profile
[ -d "${SQL_SRC_DIR}" ] || exit 11
apt-get install --yes $INSTALLED_PACKAGES
for sql_src_file in ${SQL_SRC_DIR}/*.sql ; do
db="$(basename ${sql_src_file} | sed -e 's|\.sql$||')"
dst_file="${ICEWEASEL_PROFILE_DIR}/${db}.sqlite"
sqlite3 "${dst_file}" < "${sql_src_file}"
done
rm -rf ${SQL_SRC_DIR}
apt-get --yes purge $INSTALLED_PACKAGES
......@@ -6,5 +6,5 @@ echo "Overriding TBB branding with our own"
install --owner root --group root --mode 0755 --directory /etc/xul-ext
install --owner root --group root --mode 0644 \
/etc/iceweasel/profile/extensions/branding@amnesia.boum.org/defaults/preferences/prefs.js \
/etc/tor-browser/profile/extensions/branding@amnesia.boum.org/defaults/preferences/prefs.js \
/etc/xul-ext/torbutton.js
#!/bin/sh
set -e
echo "Setting up localized browser search plugins"
# Link localized Tails searchplugins to the proper localization directories:
# e.g. files in '/usr/share/amnesia/browser/searchplugins/locale/es' will be
# linked in '/etc/tor-browser/profile/searchplugins/locale/es-AR',
# '/etc/tor-browser/profile/searchplugins/locale/es-ES', etc.
# Import the TBB_INSTALL and TBB_EXT variables
. /usr/local/lib/tails-shell-library/tor-browser.sh
locales_for_lang() {
local locale="$1"
local langpacks
find "${TBB_EXT}" -maxdepth 1 -type f -name 'langpack-*@firefox.mozilla.org.xpi' -printf "%P\n" |
sed -n -e "s/^langpack-\($locale\)\(-[A-Z]\+\)\?@firefox.mozilla.org.xpi/\1\2/p"
}
for LANGUAGE in $(find /usr/share/amnesia/browser/searchplugins/locale -maxdepth 1 -type d -printf "%P\n"); do
LOCALES="$(locales_for_lang "$LANGUAGE")"
if [ -z "$LOCALES" ]; then
echo "Unable to find a matching locale for $LANGUAGE." >&2
continue
fi
for LOCALE in $LOCALES; do
mkdir -p "${TBB_INSTALL}"/Browser/distribution/searchplugins/locale/$LOCALE
for SEARCHPLUGIN in $(find "/usr/share/amnesia/browser/searchplugins/locale/$LANGUAGE" -maxdepth 1 -type f); do
ln -s "$SEARCHPLUGIN" "${TBB_INSTALL}"/Browser/distribution/searchplugins/locale/$LOCALE
done
done
done
#!/bin/sh
set -e
echo "Setting up localized iceweasel search plugins"
# Link localized Tails searchplugins to the proper localization directories:
# e.g. files in '/usr/share/amnesia/iceweasel/searchplugins/locale/es' will be
# linked in '/etc/iceweasel/searchplugins/locale/es-AR',
# '/etc/iceweasel/searchplugins/locale/es-ES', etc.
locales_for_lang() {
local locale="$1"
local langpacks
find /usr/lib/iceweasel/browser/extensions -maxdepth 1 -type f -name 'langpack-*@iceweasel.mozilla.org.xpi' -printf "%P\n" |
sed -n -e "s/^langpack-\($locale\)\(-[A-Z]\+\)\?@iceweasel.mozilla.org.xpi/\1\2/p"
}
for LANGUAGE in $(find /usr/share/amnesia/iceweasel/searchplugins/locale -maxdepth 1 -type d -printf "%P\n"); do
LOCALES="$(locales_for_lang "$LANGUAGE")"
if [ -z "$LOCALES" ]; then
echo "Unable to find a matching locale for $LANGUAGE." >&2
exit 1
fi
for LOCALE in $LOCALES; do
mkdir -p /etc/iceweasel/searchplugins/locale/$LOCALE
for SEARCHPLUGIN in $(find "/usr/share/amnesia/iceweasel/searchplugins/locale/$LANGUAGE" -maxdepth 1 -type f); do
ln -s "$SEARCHPLUGIN" /etc/iceweasel/searchplugins/locale/$LOCALE
done
done
done
#!/bin/sh
echo "Generating iceweasel profile"
#generate iceweasel profile at build time, so that it has a fixed name
set -e
apt-get --yes install xvfb
TOR_SOCKS_HOST='127.0.0.1' TOR_SOCKS_PORT='9151' xvfb-run /usr/bin/iceweasel -CreateProfile default
mv ~/.mozilla/firefox/*.default ~/.mozilla/firefox/default
sed -i "s@Path=.*\.default@Path=default@" ~/.mozilla/firefox/profiles.ini
mv ~/.mozilla /etc/skel
apt-get --yes purge xvfb
#!/bin/sh
echo "Generating Tor Browser profile"
# Generate Tor Browser profile at build time so it won't reside in RAM
set -e
/usr/local/bin/generate-tor-browser-profile
mv ~/.tor-browser /etc/skel
#!/bin/sh
echo "Creating symbolic link for potentially persistent iceweasel bookmarks"
echo "Creating symbolic link for potentially persistent browser bookmarks"
#create a symlink to places.sqlite in iceweasel profile
#create a symlink to places.sqlite in browser profile
#from a dedicated "bookmarks" directory, so that
#it can be easily made persistent
set -e
ln -s /home/amnesia/.mozilla/firefox/bookmarks/places.sqlite /etc/skel/.mozilla/firefox/default/places.sqlite
mkdir /etc/skel/.mozilla/firefox/bookmarks
ln -s /home/amnesia/.mozilla/firefox/bookmarks/places.sqlite /etc/skel/.tor-browser/profile.default/places.sqlite
mkdir -p /etc/skel/.mozilla/firefox/bookmarks
......@@ -10,12 +10,15 @@ WRAPPER="/etc/i2p/wrapper.config"
# This must be set in order for the i2p init script to work
sed -i 's/^RUN_DAEMON=.*$/RUN_DAEMON="true"/' /etc/default/i2p
# Remove the false.i2p outproxy from i2ptunnel
sed -i '/^tunnel.0.proxyList/d' "$I2P/i2ptunnel.config"
# Remove the outproxy from the tunnel on port 4444
# This will remove the following lines:
# tunnel.0.proxyList=false.i2p
# tunnel.0.option.i2ptunnel.httpclient.SSLOutproxies=false.i2p
# The SSLOutproxies option was first set in I2P 0.9.15
sed -i '/^.*tunnel\.0\.\(proxyList\|option\.i2ptunnel\.httpclient\.SSLOutproxies\)/d' "$I2P/i2ptunnel.config"
# Disable the https outproxy
# We go out through Tor so this is redundant.
sed -i 's|^.*\(tunnel.6.startOnLoad\).*|\1=false|' "$I2P/i2ptunnel.config"
# Disable the https outproxy (port 4445)
sed -i 's|^.*\(tunnel\.6\.startOnLoad\).*|\1=false|' "$I2P/i2ptunnel.config"
# Don't serve the router console on IPv6
sed -i 's|^clientApp\.0\.args=7657\s\+::1,127\.0\.0\.1|clientApp.0.args=7657 127.0.0.1|' "$I2P/clients.config"
......@@ -30,6 +33,7 @@ sed -i 's|^.*\(wrapper\.java\.additional\.6=-Djava\.net\.preferIPv6Addresses=\).
# * HiddenMode: Enabled
# * In-I2P Network Updates: Disabled
# * Inbound connections: Disabled (setting is "i2cp.ntcp.autoip")
# * Disable I2P plugins
cat > "$I2P/router.config" << EOF
# NOTE: This I2P config file must use UTF-8 encoding
i2cp.disableInterface=true
......@@ -38,4 +42,9 @@ i2np.ntcp.autoip=false
i2np.udp.ipv6=false
router.isHidden=true
router.updateDisabled=true
router.enablePlugins=false
EOF
cat > "$I2P/susimail.config" << EOF
susimail.pop3.leave.on.server=true
EOF
......@@ -67,5 +67,9 @@ rm -r /var/lib/dkms/virtualbox-guest/
# built binary module; let's delete it before the package gets purged.
rm /var/lib/dpkg/info/virtualbox-guest-dkms.prerm
# Also copy the udev rules installed by virtualbox-guest-dkms to enable guest
# additions by default.
cp -a /lib/udev/rules.d/60-virtualbox-guest-dkms.rules /etc/udev/rules.d/
# remove temporary workaround
rm /usr/bin/gcc-${wanted_gcc_version}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment