Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
4bb587e
Create imaginary.sh
enoch85 Apr 1, 2023
ac1e56b
Add to NONO ports
enoch85 Apr 1, 2023
fde44ea
replace Imagick!
enoch85 Apr 1, 2023
146a25f
NC 24
enoch85 Apr 1, 2023
346a6d3
use a more updated image
enoch85 Apr 1, 2023
b07171e
add previewproviders
enoch85 Apr 1, 2023
7e9c0a4
fix spelling
enoch85 Apr 1, 2023
61c2a87
details!
enoch85 Apr 1, 2023
0accc0e
too tired now :sleeping:
enoch85 Apr 1, 2023
bc28731
only rebuild if previewgenerator was installed before
enoch85 Apr 1, 2023
fb6c37d
some more changes to Imaginary
enoch85 Apr 1, 2023
533584f
move to old
enoch85 Apr 1, 2023
9edf6c8
Create previewgenerator.sh
enoch85 Apr 1, 2023
62439d0
move to apps
enoch85 Apr 1, 2023
b2fa698
learn how to spell :)
enoch85 Apr 1, 2023
0b51e5a
change menu
enoch85 Apr 1, 2023
34ea2a7
typos
enoch85 Apr 1, 2023
10a37a6
update menu
enoch85 Apr 1, 2023
4633b15
more typos
enoch85 Apr 1, 2023
53f9cb9
cleanup testimage
enoch85 Apr 1, 2023
a87d2e3
improve docker prune
enoch85 Apr 1, 2023
475b9d8
update it!
enoch85 Apr 1, 2023
621deb5
change to docker run
enoch85 Apr 1, 2023
846517a
Merge branch 'master' into imaginary
enoch85 Apr 1, 2023
a796c74
only look for previews
enoch85 Apr 1, 2023
54b76d8
commit suggestion
enoch85 Apr 1, 2023
72fad48
SC
enoch85 Apr 1, 2023
332c6ab
remove custom config old
enoch85 Apr 1, 2023
2a3afba
add back providers and split preview generator uninstall
enoch85 Apr 1, 2023
b295dbb
tested and works!
enoch85 Apr 1, 2023
c6ddcac
commit suggestions
enoch85 Apr 1, 2023
4ecdd44
typo
enoch85 Apr 1, 2023
c804f9e
without this tha pp-data scan fails
enoch85 Apr 1, 2023
a66e6b7
fix preview removal
enoch85 Apr 1, 2023
8a7d2e8
remove more leftovers
enoch85 Apr 1, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
change to docker run
Signed-off-by: Daniel Hansson <[email protected]>
  • Loading branch information
enoch85 authored Apr 1, 2023
commit 621deb55e6d6b922a5eeaa3a96203bcde59a2186
112 changes: 46 additions & 66 deletions apps/imaginary.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,81 +36,61 @@ else
# Ask for removal or reinstallation
reinstall_remove_menu "$SCRIPT_NAME"
# Removal
if yesno_box_no "Do you want to remove the Imaginary docker container and settings?"
if yesno_box_yes "Do you want to remove the Imaginary docker container and settings?"
then
if docker-compose_down "$SCRIPTS"/imaginary-docker/docker-compose.yml
# Remove docker container
docker_prune_this 'nextcloud/aio-imaginary'
# reset the preview formats
nextcloud_occ config:system:delete "preview_imaginary_url"
nextcloud_occ config:system:delete "enabledPreviewProviders"
nextcloud_occ config:system:delete "preview_max_x"
nextcloud_occ config:system:delete "preview_max_y"
nextcloud_occ config:system:delete "jpeg_quality"
nextcloud_occ config:system:delete "preview_max_memory"
nextcloud_occ config:system:delete "enable_previews"
# Remove everything that is related to previewgenerator --> LEGACY
nextcloud_occ_no_check app:remove previewgenerator
# Reset the cronjob
crontab -u www-data -l | grep -v 'preview:pre-generate' | crontab -u www-data -
# Remove apps
APPS=(php-imagick libmagickcore-6.q16-3-extra imagemagick-6.q16-extra)
for app in "${APPS[@]}"
do
if is_this_installed "$app"
then
apt-get purge "$app" -y
fi
done
# Remove FFMPEG
if is_this_installed ffmpeg && ! is_app_installed integration_whiteboard
then
countdown "Waiting for the Docker image to be destroyed" "5"
nextcloud_occ config:system:delete enabledPreviewProviders
nextcloud_occ config:system:delete preview_imaginary_url
rm -rf "$SCRIPTS"/imaginary-docker
docker system prune -a -f
apt-get purge ffmpeg -y
apt-get autoremove -y
fi
fi
# Remove everything that's related to previewgenerator - it's now legacy
nextcloud_occ app:remove previewgenerator
# reset the preview formats
nextcloud_occ_no_check config:system:delete "enabledPreviewProviders"
nextcloud_occ config:system:delete preview_max_x
nextcloud_occ config:system:delete preview_max_y
nextcloud_occ config:system:delete jpeg_quality
nextcloud_occ config:system:delete preview_max_memory
nextcloud_occ config:system:delete enable_previews
# reset the cronjob
crontab -u www-data -l | grep -v 'preview:pre-generate' | crontab -u www-data -
# Remove apps
APPS=(php-imagick libmagickcore-6.q16-3-extra imagemagick-6.q16-extra)
for app in "${APPS[@]}"
do
if is_this_installed "$app"
then
apt-get purge "$app" -y
fi
done
if is_this_installed ffmpeg && ! is_app_installed integration_whiteboard
then
apt-get purge ffmpeg -y
fi
apt-get autoremove -y
if yesno_box_yes "Do you want to remove all previews that were generated until now?
# Remove previews
if yesno_box_yes "Do you want to remove all previews that were generated until now?
This will most likely clear a lot of space! Also, pre-generated previews are not needed anymore once Imaginary are installed."
then
countdown "Removing the preview folder. This can take a while..." "5"
rm -rfv "$NCDATA"/appdata_*/preview
print_text_in_color "$ICyan" "Scanning Nextclouds appdata directory after removing all previews. \
then
countdown "Removing the preview folder. This can take a while..." "5"
rm -rfv "$NCDATA"/appdata_*/preview
print_text_in_color "$ICyan" "Scanning Nextclouds appdata directory after removing all previews. \
This can take a while..."
nextcloud_occ files:scan-app-data -vvv
msg_box "All previews were successfully removed."
nextcloud_occ files:scan-app-data -vvv
msg_box "All previews were successfully removed."
fi
# Remove log
rm -f "$VMLOGS"/previewgenerator.log
# Show successful uninstall if applicable
removal_popup "$SCRIPT_NAME"
fi
# Remove log
rm -f "$VMLOGS"/previewgenerator.log
# Show successful uninstall if applicable
removal_popup "$SCRIPT_NAME"
fi

# Generate docker-compose.yml
mkdir -p "$SCRIPTS"/imaginary-docker
if [ ! -f "$SCRIPTS/imaginary-docker/docker-compose.yml" ]
then
touch "$SCRIPTS/imaginary-docker/docker-compose.yml"
cat << IMAGINARY_DOCKER_CREATE > "$SCRIPTS"/imaginary-docker/docker-compose.yml
version: '3.1'
services:
imaginary:
image: nextcloud/aio-imaginary:latest
container_name: imaginary
restart: always
environment:
PORT: 9000
command: -concurrency 50 -enable-url-source -log-level debug
ports:
- 127.0.0.1:9000:9000
IMAGINARY_DOCKER_CREATE
print_text_in_color "$IGreen" "SCRIPTS/imaginary-docker/docker-compose.yml was successfully created."
fi
# Install Docker
install_docker

# Start the container
docker compose -p imaginary -f "$SCRIPTS"/imaginary-docker/docker-compose.yml up -d
# Pull and start
docker pull nextcloud/aio-imaginary:latest
docker run -t -d -p 127.0.0.1:9000:9000 --restart always --name imaginary nextcloud/aio-imaginary -concurrency 50 -enable-url-source -log-level debug

# Test if imaginary is working
countdown "Testing if it works in 3 sedonds" "3"
Expand Down