You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Enable export to PDF and copying of attachments (#11)
Use wkhtmltopdf for PDF support because it has the easiest emoji solution (via twemoji).
heic2jpg.go is untested as it is largely copied from upstream, and I have a PR open to create an interface upstream: adrium/goheif#2
goheif also has issues vendoring because there is no Go code in some of the required C++ subdirectories: golang/go#26366. This should also be fixed upstream, but as a stopgap, we need to use the cp and chmod commands (vendor makefile target).
* Enable output to PDF
* Add support or jpegs in PDFs
* Switch to wkhtmltopdf for emoji support
* Implement copying attachments
* Convert HEIC attachments to JPEG for PDF output
* Update example to match new defaults
* Add "attached" text to attachment references in outfiles
* Update dependencies
* Install wkhtmltopdf in Travis CI
* Use xvfb in Travis CI
for more details. To to backup your messages, you have two options:
29
-
### Option 1 (recommended): Copy chat.db
28
+
for more details. Additionally, attachments can be located in various protected
29
+
places on your filesystem.
30
+
31
+
To to backup your messages, you have two options. If you wish to export to PDFs
32
+
with images (`--pdf`), or to copy attachments (`--copy-attachments`), you must use
33
+
the first option.
34
+
### Option 1 (required for attachments): Give your terminal emulator full disk access
35
+
From [osxdaily.com](https://osxdaily.com/2018/10/09/fix-operation-not-permitted-terminal-error-macos/):
36
+
1. Pull down the Apple menu and choose "System Preferences"
37
+
1. Choose "Security & Privacy" control panel
38
+
1. Now select the "Privacy" tab, then from the left-side menu select "Full Disk Access"
39
+
1. Click the lock icon in the lower left corner of the preference panel and authenticate with an admin level login
40
+
1. Now click the [+] plus button to add an application with full disk access
41
+
1. Navigate to the /Applications/Utilities/ folder and choose "Terminal" (or your terminal emulator of choice) to grant your terminal with Full Disk Access privileges
42
+
1. Relaunch your terminal emulator, and the “Operation not permitted” error messages will be gone
43
+
44
+
If you choose this option, bagoup will be able to open **chat.db** in its
45
+
default location, and the `--db-path` flag is not needed.
46
+
### Option 2 (more secure if attachments are not desired): Copy chat.db
30
47
Copy the Messages database to an unprotected folder in Finder, and provide the
31
48
path to the copy via the `--db-path` flag.
32
49
@@ -37,19 +54,6 @@ path to the copy via the `--db-path` flag.
37
54
1. Right-click in the unprotected folder, and click **Paste Item** in the
38
55
context menu.
39
56
40
-
### Option 2 (less secure): Give your terminal full disk access
41
-
From [osxdaily.com](https://osxdaily.com/2018/10/09/fix-operation-not-permitted-terminal-error-macos/):
42
-
1. Pull down the Apple menu and choose ‘System Preferences’
43
-
1. Choose “Security & Privacy” control panel
44
-
1. Now select the “Privacy” tab, then from the left-side menu select “Full Disk Access”
45
-
1. Click the lock icon in the lower left corner of the preference panel and authenticate with an admin level login
46
-
1. Now click the [+] plus button to add an application with full disk access
47
-
1. Navigate to the /Applications/Utilities/ folder and choose “Terminal” to grant Terminal with Full Disk Access privileges
48
-
1. Relaunch Terminal, the “Operation not permitted” error messages will be gone
49
-
50
-
If you choose this option, bagoup will be able to open **chat.db** in its
51
-
default location, and the `--db-path` flag is not needed.
52
-
53
57
## Contact Information (optional)
54
58
If you provide your contacts via the `--contacts-path` flag, bagoup will attempt
55
59
to match the handles from the Messages database with full names from your
@@ -65,15 +69,18 @@ Usage:
65
69
bagoup [OPTIONS]
66
70
67
71
Application Options:
68
-
-i, --db-path= Path to the Messages chat database file (default: ~/Library/Messages/chat.db)
69
-
-o, --export-path= Path to which the Messages will be exported (default: backup)
70
-
-m, --mac-os-version= Version of Mac OS, e.g. '10.15', from which the Messages chat database file was copied (not needed if bagoup is running on the same Mac)
71
-
-c, --contacts-path= Path to the contacts vCard file
72
-
-s, --self-handle= Prefix to use for for messages sent by you (default: Me)
73
-
--separate-chats Do not merge chats with the same contact into a single file, e.g. iMessage and SMS
72
+
-i, --db-path= Path to the Messages chat database file (default: ~/Library/Messages/chat.db)
73
+
-o, --export-path= Path to which the Messages will be exported (default: messages-export)
74
+
-m, --mac-os-version= Version of Mac OS, e.g. '10.15', from which the Messages chat database file was copied (not needed if bagoup is running on the same Mac)
75
+
-c, --contacts-path= Path to the contacts vCard file
76
+
-s, --self-handle= Prefix to use for for messages sent by you (default: Me)
77
+
--separate-chats Do not merge chats with the same contact (e.g. iMessage and SMS) into a single file
78
+
-p, --pdf Export text and images to PDF files (requires full disk access)
79
+
--include-ppa Include plugin payload attachments (e.g. link previews) in generated PDFs
80
+
-a, --copy-attachments Copy attachments to the same folder as the chat which included them (requires full disk access)
74
81
75
82
Help Options:
76
-
-h, --help Show this help message
83
+
-h, --help Show this help message
77
84
```
78
85
All conversations will be exported as text files to the specified export path.
79
86
See https://github.com/tagatac/bagoup/tree/master/example-export for an example
return"", "", errors.Wrapf(err, "read data for attachment ID %d", attachmentID)
275
+
}
276
+
ifattachments.Next() {
277
+
return"", "", fmt.Errorf("multiple attachments with the same ID: %d - attachment ID uniqueness assumption violated - %s", attachmentID, _githubIssueMsg)
sMock.ExpectQuery("SELECT message_id, attachment_id FROM message_attachment_join").WillReturnRows(rows)
450
+
},
451
+
wantErr: `read data from message_attachment_join table: sql: Scan error on column index 1, name "attachment_id": converting NULL to int is unsupported`,
sMock.ExpectQuery(`SELECT filename, COALESCE\(mime_type, ''\) FROM attachment WHERE ROWID\=2`).WillReturnRows(rows)
482
+
},
483
+
wantErr: `get path for attachment 2 to message 1: read data for attachment ID 2: sql: Scan error on column index 1, name "mime_type": converting NULL to string is unsupported`,
sMock.ExpectQuery(`SELECT filename, COALESCE\(mime_type, ''\) FROM attachment WHERE ROWID\=2`).WillReturnRows(rows)
500
+
},
501
+
wantErr: "get path for attachment 2 to message 1: multiple attachments with the same ID: 2 - attachment ID uniqueness assumption violated - open an issue at https://github.com/tagatac/bagoup/issues",
0 commit comments