[Tails-dev] Bookmarks persistence - help needed

Delete this message

Reply to this message
Autor: Alessandro Grassi
Data:  
A: tails-dev
Assumpte: [Tails-dev] Bookmarks persistence - help needed
Hi devs,
attached patch "0001-Added-bookmarks-preset.patch" adds a "Browser
bookmarks" preset in tails-persistence-setup.

It creates a "bookmarks" folder in the persistent volume and links
files from this folder to /home/amnesia/.mozilla/firefox/default. It
needs the "0001-generate-iceweasel-profile-at-build-time.patch" to be
applied to Tails (see "generate Iceweasel profile at build time"
discussion).

The "bookmarks" folder is supposed to contain the "places.sqlite" file
alone. If it's not there when preset is turned on, a default one
should be copied (creating an empty file won't work). I think it can
be done in the "go_button_pressed" method in
lib/Tails/Persistence/Step/Configure.pm, but I'm not confident with
perl. Hope someone else can do it.

Greetings
Alessandro
From 701d39c9645ecb52cddb776a0ce9ee6f4fee08a7 Mon Sep 17 00:00:00 2001
From: Tails developers <amnesia@???>
Date: Fri, 5 Oct 2012 12:11:12 +0200
Subject: [PATCH] Added bookmarks preset

---
lib/Tails/Persistence/Configuration/Presets.pm | 10 ++++++++++
1 file changed, 10 insertions(+)

diff --git a/lib/Tails/Persistence/Configuration/Presets.pm b/lib/Tails/Persistence/Configuration/Presets.pm
index 5113828..5fd45da 100644
--- a/lib/Tails/Persistence/Configuration/Presets.pm
+++ b/lib/Tails/Persistence/Configuration/Presets.pm
@@ -114,6 +114,16 @@ method _build__presets {
             enabled     => 0,
             icon_name   => 'network-wired',
         },
+    {
+            name        => $self->encoding->decode(gettext(q{Browser bookmarks})),
+            description => $self->encoding->decode(gettext(
+                q{Bookmarks saved in Iceweasel browser}
+            )),
+            destination => '/home/amnesia/.mozilla/firefox/default',
+            options     => [ 'source=bookmarks', "link" ],
+            enabled     => 0,
+            icon_name   => 'user-bookmarks',
+        },
         {
             name        => $self->encoding->decode(gettext(q{APT Packages})),
             description => $self->encoding->decode(gettext(
-- 
1.7.10.4


From c8394e520dd15fdbf80bd1e2651a464499a4a010 Mon Sep 17 00:00:00 2001
From: Alessandro Grassi <alessandro.g89@???>
Date: Sun, 30 Sep 2012 20:09:08 +0200
Subject: [PATCH] generate iceweasel profile at build time

---
config/chroot_local-hooks/14-generate-iceweasel-profile | 11 +++++++++++
1 file changed, 11 insertions(+)
create mode 100755 config/chroot_local-hooks/14-generate-iceweasel-profile

diff --git a/config/chroot_local-hooks/14-generate-iceweasel-profile b/config/chroot_local-hooks/14-generate-iceweasel-profile
new file mode 100755
index 0000000..d910076
--- /dev/null
+++ b/config/chroot_local-hooks/14-generate-iceweasel-profile
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+#generate iceweasel profile at build time, so that it has a fixed name
+
+set -e
+apt-get --yes install xvfb
+xvfb-run 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
--
1.7.10.4