Skip to content

Commit

Permalink
(#1076) Remove the default mount dir for thumbnails being a subdir of…
Browse files Browse the repository at this point in the history
… content
  • Loading branch information
Difegue committed Nov 5, 2024
1 parent 908d335 commit 8818db5
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 14 deletions.
8 changes: 4 additions & 4 deletions lib/LANraragi/Model/Config.pm
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ sub get_redis_internal {
server => &get_redisad,
debug => $ENV{LRR_DEVSERVER} ? "1" : "0",
reconnect => 3,
&get_redispassword ? (password => &get_redispassword) : ()
&get_redispassword ? ( password => &get_redispassword ) : ()
);

# Switch to specced database
Expand Down Expand Up @@ -132,7 +132,7 @@ sub get_userdir {
sub get_thumbdir {

# Content path can be overriden by LRR_THUMB_DIRECTORY
my $dir = &get_redis_conf( "thumbdir", get_userdir() . "/thumb" );
my $dir = &get_redis_conf( "thumbdir", "./thumb" );

if ( $ENV{LRR_THUMB_DIRECTORY} ) {
$dir = $ENV{LRR_THUMB_DIRECTORY};
Expand Down Expand Up @@ -168,8 +168,8 @@ sub get_tagrules {
);
}

sub get_htmltitle { return xml_escape(&get_redis_conf( "htmltitle", "LANraragi" )) }
sub get_motd { return xml_escape(&get_redis_conf( "motd", "Welcome to this Library running LANraragi!" )) }
sub get_htmltitle { return xml_escape( &get_redis_conf( "htmltitle", "LANraragi" ) ) }
sub get_motd { return xml_escape( &get_redis_conf( "motd", "Welcome to this Library running LANraragi!" ) ) }
sub get_tempmaxsize { return &get_redis_conf( "tempmaxsize", "500" ) }
sub get_pagesize { return &get_redis_conf( "pagesize", "100" ) }
sub enable_pass { return &get_redis_conf( "enablepass", "1" ) }
Expand Down
2 changes: 1 addition & 1 deletion tools/Documentation/api-documentation/archive-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ Page you want to make the thumbnail out of. Defaults to 1.
{
"operation": "update_thumbnail",
"success": 1,
"new_thumbnail": "/mnt//lrr/content/thumb/95/9595845d952e8141feeba375767248b960979bc2.jpg"
"new_thumbnail": "/mnt/lrr/thumb/95/9595845d952e8141feeba375767248b960979bc2.jpg"
}
```
{% endswagger-response %}
Expand Down
8 changes: 4 additions & 4 deletions tools/Documentation/installing-lanraragi/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Once you're done, execute:
docker run --name=lanraragi -p 3000:3000 \
--mount type=bind,source=[YOUR_CONTENT_DIRECTORY],target=/home/koyomi/lanraragi/content \
--mount type=bind,source=[YOUR_DATABASE_DIRECTORY],target=/home/koyomi/lanraragi/database \
--mount type=bind,source=[YOUR_THUMBNAIL_DIRECTORY],target=/home/koyomi/lanraragi/content/thumb
--mount type=bind,source=[YOUR_THUMBNAIL_DIRECTORY],target=/home/koyomi/lanraragi/thumb
difegue/lanraragi
```
{% hint style="info" %}
Expand All @@ -45,7 +45,7 @@ services:
- "3000:3000"
volumes:
- [YOUR_CONTENT_DIRECTORY]:/home/koyomi/lanraragi/content
- [YOUR_THUMBNAIL_DIRECTORY]:/home/koyomi/lanraragi/content/thumb
- [YOUR_THUMBNAIL_DIRECTORY]:/home/koyomi/lanraragi/thumb
- [YOUR_DATABASE_DIRECTORY]:/home/koyomi/lanraragi/database
restart: unless-stopped
```
Expand All @@ -63,7 +63,7 @@ docker volume create lrr-thumbnails
docker run --name=lanraragi -p 3000:3000 \
--mount type=bind,source=[YOUR_CONTENT_DIRECTORY],target=/home/koyomi/lanraragi/content \
--mount source=lrr-database,target=/home/koyomi/lanraragi/database \
--mount source=lrr-thumbnails,target=/home/koyomi/lanraragi/content/thumb \
--mount source=lrr-thumbnails,target=/home/koyomi/lanraragi/thumb \
difegue/lanraragi
```

Expand Down Expand Up @@ -141,7 +141,7 @@ docker rm lanraragi
docker run --name=lanraragi -p 3000:3000 \
--mount type=bind,source=[YOUR_CONTENT_DIRECTORY],target=/home/koyomi/lanraragi/content \
--mount type=bind,source=[YOUR_DATABASE_DIRECTORY],target=/home/koyomi/lanraragi/database \
--mount type=bind,source=[YOUR_THUMBNAIL_DIRECTORY],target=/home/koyomi/lanraragi/content/thumb
--mount type=bind,source=[YOUR_THUMBNAIL_DIRECTORY],target=/home/koyomi/lanraragi/thumb
difegue/lanraragi
```

Expand Down
2 changes: 1 addition & 1 deletion tools/build/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,6 @@ COPY /tools/build/docker/s6/cont-init.d/01-lrr-setup /etc/s6-overlay/s6-rc.d/ini

# Persistent volumes
VOLUME [ "/home/koyomi/lanraragi/content" ]
VOLUME [ "/home/koyomi/lanraragi/content/thumb" ]
VOLUME [ "/home/koyomi/lanraragi/thumb" ]
VOLUME [ "/home/koyomi/lanraragi/database"]
VOLUME [ "/home/koyomi/lanraragi/lib/LANraragi/Plugin/Sideloaded" ]
2 changes: 1 addition & 1 deletion tools/build/docker/Dockerfile-legacy
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,5 @@ COPY /tools/build/docker/s6/legacy-services.d/ /etc/services.d/

# Persistent volumes
VOLUME [ "/home/koyomi/lanraragi/content" ]
VOLUME [ "/home/koyomi/lanraragi/content/thumb" ]
VOLUME [ "/home/koyomi/lanraragi/thumb" ]
VOLUME [ "/home/koyomi/lanraragi/database"]
7 changes: 4 additions & 3 deletions tools/build/docker/s6/cont-init.d/01-lrr-setup
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,11 @@ chmod -R u+rwx /home/koyomi/lanraragi/database

if [ "$FIX_PERMS" -eq 1 ]; then
echo "Fixing permissions, hold on!"

#Ensure thumbnail folder is writable
chown -R koyomi /home/koyomi/lanraragi/content/thumb
find /home/koyomi/lanraragi/content/thumb -type f -exec chmod u+rw {} \;
find /home/koyomi/lanraragi/content/thumb -type d -exec chmod u+rwx {} \;
chown -R koyomi /home/koyomi/lanraragi/thumb
find /home/koyomi/lanraragi/thumb -type f -exec chmod u+rw {} \;
find /home/koyomi/lanraragi/thumb -type d -exec chmod u+rwx {} \;

chown -R koyomi /home/koyomi/lanraragi/lib/LANraragi/Plugin/Sideloaded
chmod u+rwx /home/koyomi/lanraragi/lib/LANraragi/Plugin/Sideloaded
Expand Down

0 comments on commit 8818db5

Please sign in to comment.