diff --git a/scripts/install b/scripts/install index 913aeb2..74375b8 100755 --- a/scripts/install +++ b/scripts/install @@ -97,11 +97,17 @@ pushd $install_dir php$phpversion artisan migrate -n --force php$phpversion artisan config:clear -n php$phpversion artisan config:cache -n + patch -p1 < "$YNH_CWD/../conf/ffprobe.patch" popd # Setup custom user.css file ynh_add_config --template="../conf/user.css.example" --destination="$install_dir/public/dist/user.css" +ynh_replace_string --match_string="\$ffmpeg = FFMpeg::create();" --replace_string="\$ffmpeg = FFMpeg::create(array(\ + 'ffmpeg.binaries' => '/usr/bin/ffmpeg',\ + 'ffprobe.binaries' => '/usr/bin/ffprobe',\ +));" --target_file="$install_dir/app/Actions/Photo/Extensions/VideoEditing.php" + #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 4169774..53d7d2c 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -52,6 +52,11 @@ then ynh_setup_source --dest_dir="$install_dir" --keep=".env public/dist/user.css" fi +ynh_replace_string --match_string="\$ffmpeg = FFMpeg::create();" --replace_string="\$ffmpeg = FFMpeg::create(array(\ + 'ffmpeg.binaries' => '/usr/bin/ffmpeg',\ + 'ffprobe.binaries' => '/usr/bin/ffprobe',\ +));" --target_file="$install_dir/app/Actions/Photo/Extensions/VideoEditing.php" + chmod 750 "$install_dir/bootstrap/cache" chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" diff --git a/sources/app-00-ffmpeg.patch b/sources/app-00-ffmpeg.patch new file mode 100644 index 0000000..0d1f1a5 --- /dev/null +++ b/sources/app-00-ffmpeg.patch @@ -0,0 +1,16 @@ +diff --git a/app/Actions/Photo/Extensions/VideoEditing.php b/app/Actions/Photo/Extensions/VideoEditing.php +index 1a96769..5842606 100644 +--- a/app/Actions/Photo/Extensions/VideoEditing.php ++++ b/app/Actions/Photo/Extensions/VideoEditing.php +@@ -45,7 +45,10 @@ trait VideoEditing + /** + * ! check if we can use path instead of this ugly thing. + */ +- $ffmpeg = FFMpeg::create(); ++ $ffmpeg = FFMpeg::create(array( ++ 'ffmpeg.binaries' => '/usr/bin/ffmpeg', ++ 'ffprobe.binaries' => '/usr/bin/ffprobe', ++ )); + /** @var Video */ + $video = $ffmpeg->open(Storage::path('big/' . $photo->url)); + if (!($tmp = tempnam(sys_get_temp_dir(), 'lychee')) || \ No newline at end of file