diff --git a/MainMenu.nib/designable.nib b/MainMenu.nib/designable.nib index 2f1894d..1f8472c 100644 --- a/MainMenu.nib/designable.nib +++ b/MainMenu.nib/designable.nib @@ -120,7 +120,7 @@ Gw - + @@ -158,13 +158,12 @@ Gw - - + - + diff --git a/MainMenu.nib/keyedobjects.nib b/MainMenu.nib/keyedobjects.nib index de94f15..65b70bb 100644 Binary files a/MainMenu.nib/keyedobjects.nib and b/MainMenu.nib/keyedobjects.nib differ diff --git a/README.md b/README.md index 0f4cc77..1115d30 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ **Yuba** generates a web-browsable SQLite database from an HFS+ filesystem. Its client application gathers forensic-quality data about a locally attached disk, properly interpreting bundles, reading Spotlight data, Finder flags, labels, and other contextual information. It can generate hashes, thumbnails, and gather 3rd party metadata with exiftool and mediainfo. Yuba's filesystem catalogues are comprehensive, lightweight, optimized for massive (1 million+) trees, and reflect incremental changes to contents and metadata. A server-side PHP script is provided, which allows familiar, Finder-style browsing of a catalogue. -* **⇩ [Download Yuba 0.7.11](http://www.profiteroles.org/downloads/Yuba_0.7.11.zip)** +* **⇩ [Download Yuba 0.7.12](http://www.profiteroles.org/downloads/Yuba_0.7.12.zip)** ## Features diff --git a/Yuba.php b/Yuba.php index 9d3b378..23827b6 100755 --- a/Yuba.php +++ b/Yuba.php @@ -3,7 +3,7 @@ // Yuba // // ////////////////////////////////////////// -$version = "0.7.11.5"; +$version = file_get_contents(__DIR__."/version.txt"); ini_set('memory_limit', '10240M'); date_default_timezone_set("America/Los_Angeles"); @@ -11,7 +11,9 @@ date_default_timezone_set("America/Los_Angeles"); // Includes & Prefs ////////////////////////////////////////// -$p = unserialize(file_get_contents("prefs.php")); +$p = unserialize(file_get_contents(__DIR__."/prefs.php")); + +$p['phpbin'] = "/usr/bin/php"; require("functions.php"); require("filetypes.php"); @@ -21,6 +23,33 @@ $wopt_currstep = 1; $parser = new plistParser(); +// Menu options +////////////////////////////////////////// + +// Preferences + +if (@$argv[1] == "Preferences...") { + exec($p['phpbin']." ".__DIR__."/YubaPrefs.php 2>&1"); + die; + } + +// Version check + +if (@$argv[1] == "Check for Updates...") { + + $curr_version = file_get_contents("http://git.profiteroles.org/profiteroles/Yuba/raw/branch/master/version.txt"); + if ($curr_version > $version) { + if(askMulti("Yuba ".$curr_version." is available (you have ".$version.")", array("Cancel","Download")) == 1) { + exec("open http://git.profiteroles.org/profiteroles/Yuba"); + die; + } + } else { + alert($version." is the latest version","Up-to-date"); + die; + } + + } + // Path & application variables ////////////////////////////////////////// @@ -28,8 +57,8 @@ $stamp = date("Y-m-d_H-i-s", time()); if (!isset($argv[1])) { echo "No input"; die; } $zpath = realpath(@$argv[1]); -if (@$argv[2]) { $bdest = realpath($argv[2]); } else { $bdest = realpath($p['bdest']); } -if (!is_dir($zpath) | !is_dir($bdest)) { echo "Filepath error"; die; } +if ($p['bdest']) { $bdest = realpath($p['bdest']); } else { $bdest = "/Users/".get_current_user()."/Documents/Yuba/"; } +if (!is_dir($bdest)) { if (!mkdir($bdest)) { echo "Error creating directory: ".$bdest; die; } } // Check for bundle if ($zpath == "/") { $blabel = "root"; } else { $blabel = preg_replace("/[^A-Za-z0-9\.]/", "_", basename($zpath)); } @@ -48,7 +77,6 @@ $bin_ffmpeg = __DIR__."/bin/ffmpeg"; $bin_qlthumb = __DIR__."/bin/ql-thumbnail"; // Logfile - $messages_log_file = $bpath."/".$stamp."_messages.log"; $error_log_file = $bpath."/".$stamp."_error.log"; error_reporting(E_ALL); @@ -59,6 +87,8 @@ ini_set("error_log", $error_log_file); // Banner ////////////////////////////////////////// +if (!is_dir($zpath) | !is_dir($bdest)) { echo "Filepath error"; die; } + $banner = "Yuba: ".$zpath." -> ".$bpath; echo msg($banner."\n".str_repeat("-", strlen($banner))); @@ -509,9 +539,7 @@ if ($p['thumbs']) { if (!is_dir($tpath)) { mkdir($tpath); } $tfile = $tpath."/".$fid.".jpg"; - // HACK for ql-thumbnail bug - $t_skip = array("emlx","flac"); - if (count($t_skip) && in_array($ext, $t_skip)) { + if (count($p['t_skip']) && in_array($ext, $p['t_skip'])) { echo ProgressBar::next("Skipping ".shortlabel($pathname)); continue; } @@ -589,7 +617,8 @@ if ($p['contents']) { $cfile = $cpath."/".$fid.".zip"; if (in_array($ext, $p['c_files'])) { if (!is_dir($cpath)) { mkdir($cpath); } - if (!file_exists($cfile) && filesize($pathname) < 25000) { + $max_size = $p['contents_limit'] * 1000; + if (!file_exists($cfile) && filesize($pathname) < $max_size) { msg("Zipping ".$pathname); @@ -972,7 +1001,7 @@ foreach ($files as $splFileInfo) { $yes_contents = $dbp->query("SELECT relative_path FROM contents WHERE fid='".$fid."'")->fetch()[0]; $stmt->BindValue(":contents_filename",$yes_contents); - if (!in_array($extension, $t_skip)) { + if (!in_array($extension, $p['t_skip'])) { $fetch_thumb = $dbp->query("SELECT * FROM thumbs WHERE fid='".$fid."'")->fetch(); } if (@$fetch_thumb['relative_path']) { @@ -1188,7 +1217,7 @@ $dbo->exec("UPDATE _skim SET status='completed_in_".$seconds."'"); // rsync -if ($p['rsync_dest']) { +if ($p['postflight'] == 2 && $p['rsync_dest']) { echo msg("rsync..."); $command = "rsync -avv -e ssh ".$bpath." ".$p['rsync_dest']; $count = trim(shell_exec("find ".escapeshellarg($bpath)." | wc -l")); @@ -1197,6 +1226,8 @@ if ($p['rsync_dest']) { while(fgets($pipe, 2048)) { echo ProgressBar::next(true); } pclose($pipe); echo ProgressBar::finish(); + } elseif ($p['postflight'] == 1) { + exec("open -R ".escapeshellarg($bpath)); } $done = "Finished ".$zpath." in ".$seconds." seconds"; diff --git a/YubaPrefs.php b/YubaPrefs.php index e69de29..fd0161c 100644 --- a/YubaPrefs.php +++ b/YubaPrefs.php @@ -0,0 +1,53 @@ + \ No newline at end of file diff --git a/filetypes.php b/filetypes.php index 2c7e5ea..aaba245 100755 --- a/filetypes.php +++ b/filetypes.php @@ -1,7 +1,7 @@ \ No newline at end of file diff --git a/functions.pashua.php b/functions.pashua.php new file mode 100755 index 0000000..89d0e50 --- /dev/null +++ b/functions.pashua.php @@ -0,0 +1,191 @@ + \ No newline at end of file diff --git a/functions.php b/functions.php index a6276dd..0fdeb60 100755 --- a/functions.php +++ b/functions.php @@ -1,7 +1,7 @@ \ No newline at end of file diff --git a/version.txt b/version.txt index 66fc364..6f30e95 100755 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -0.7.11.5 \ No newline at end of file +0.7.12 \ No newline at end of file