Skip to content

Conversation

@MachX428
Copy link
Contributor

Fixes custom smiley and interwiki icon support

linuxserver.io


  • I have read the contributing guideline and understand that I have made the correct modifications

Description:

Following the official DokuWiki documentation for working with custom smileys (https://www.dokuwiki.org/smileys) and interwiki icons (https://www.dokuwiki.org/interwiki) does not result in the custom icons being displayed. This is because the folders the user is supposed to put the icons into are not properly persisted outside of the docker container. This PR modifies the 50-config file to make these locations persistent.

Benefits of this PR and context:

This fixes an outstanding bug and closes #40.

How Has This Been Tested?

The change has been tested by:

# Testing Smileys
:SMILEYTEST:                local/test.png
  • Create/edit a page in DokuWiki and use the text ":SMILEYTEST:"
====== Test ======

===== Smiley =====

:SMILEYTEST:
  • Verify that the text ":SMILEYTEST:" and a generic icon appears
    • If it was working correctly, the smiley image you saved would appear instead
  • Create an interwiki folder as described in the official documentation: https://www.dokuwiki.org/interwiki
    • config/dokuwiki/lib/images/interwiki
  • Use your favorite paint program to create a 16x16 pixel red square and save it as ubuntu.png
    • Move it to the interwiki folder you created
  • Create a config/dokuwiki/conf/interwiki.local.conf file
# Testing Interwiki's
ubuntu https://wiki.ubuntu.com/{NAME}
  • Edit your DokuWiki test page and add the text "[[ubuntu>teams|Ubuntu Teams]]"
====== Test ======

===== Smiley =====

:SMILEYTEST:  

===== Interwiki =====

[[ubuntu>teams|Ubuntu Teams]]
  • Verify that a generic circle icon appears next to the interwiki link you created
    • If it was working correctly, the red square icon you created would appear instead
  • Build new (local) image from this PR.
  • Shut down and remove the existing container (but don't delete your persistent folders)
  • Clear the image cache:
rm -rf config/dokuwiki/data/cache/*/*.{gif,png,css}
  • Create and start up new container using the local image you just created
  • Go back to your DokuWiki test page
    • You may have to force refresh
  • The correct smiley image and red interwiki icon should now be visible

Source / References:

See issue #40.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for opening this pull request! Be sure to follow the pull request template!

@LinuxServer-CI
Copy link
Collaborator

@github-actions
Copy link

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@MachX428
Copy link
Contributor Author

Is there anything I need to do in order to get this approved? It would be very useful to get this fixed in the repo.

@github-actions
Copy link

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@MachX428
Copy link
Contributor Author

I'm just commenting to indicate I still have interest in this. Is there anything that I can do to help get this approved?

@github-actions
Copy link

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@thelamer
Copy link
Member

This doesn't work for me without:

  [[ ! -d /config/dokuwiki/lib/images/smileys ]]
    mkdir -p /config/dokuwiki/lib/images/smileys

Did you test this ?

@MachX428 MachX428 force-pushed the persist-smileys-interwiki branch from 641c6e5 to eca628a Compare February 25, 2022 19:44
@LinuxServer-CI
Copy link
Collaborator

@MachX428
Copy link
Contributor Author

Thank you. I did indeed check it, but in retrospect my test process was flawed. I started with the non-modified repo, went through the test steps to create the smileys/interwiki's and verified they DIDN'T work. I then rebuilt the repo with the changes, and verified that the previous non-functioning pages now worked. However, since my steps had added the /config/dokuwiki/lib/images folder, it masked the fact I needed to check for that in the 50-config file as well.

I have added the following to 50-config:

[[ ! -d /config/dokuwiki/lib/images/ ]]
mkdir -p /config/dokuwiki/lib/images/

and merged/rebased with the latest. I then started completely from scratch, with no existing folders, rebuilt the container with the changes, ran it, and verified everything works as expected. I then updated my PR branch with the changes. Thanks again for pointing this out.

@github-actions
Copy link

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@LinuxServer-CI
Copy link
Collaborator

@nemchik
Copy link
Member

nemchik commented Oct 4, 2022

@MachX428 this looks fine to me, but it needs to be rebased at this point. Can you rebase and then ping me back?

@github-actions
Copy link

github-actions bot commented Nov 4, 2022

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Fixes custom smiley and interwiki icon support
@MachX428 MachX428 force-pushed the persist-smileys-interwiki branch from eca628a to 6382b25 Compare November 14, 2022 02:40
@LinuxServer-CI
Copy link
Collaborator

@MachX428
Copy link
Contributor Author

@nemchik - I rebased as per requested, and validated all works as expected.

Also fully nest the mkdir check to the parent folder of lib/images/smileys/local
Copy link
Member

@nemchik nemchik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I made two commits to adjust things a bit (the new mkdir logic you added is combined with the one above it, and nested one more level, and the conditionals are switched to using full if syntax).

Once our CI builds the image if you wouldn't mind testing (I'll specifically mention the tag) i'll approve and merge this.

@LinuxServer-CI
Copy link
Collaborator

1 similar comment
@LinuxServer-CI
Copy link
Collaborator

@nemchik
Copy link
Member

nemchik commented Nov 14, 2022

lspipepr/dokuwiki:2022-07-31a-pkg-5b04a879-pr-41 would be the tag to test.

@MachX428
Copy link
Contributor Author

@nemchik - I tested that tag and all works well.

That being said, I'm thinking one more slight change might make this just a little more robust and have less possibility for confusion.

When I originally did the change, I just created the base lib/images directory. If you then follow the official smiley instructions here https://www.dokuwiki.org/smileys and create the /smileys/local directory under /images, and put your smileys there, it works. I figured anybody creating the images/smileys directory would obviously be reading the instructions and also know to create the /local directory under it. But now with your changes, it creates actually the /images/smileys directory for you. And at this point it almost makes it seem like you can just put the custom smileys there since that directory exists. Of course if you do that, it won't work because the symlink is to /images/smileys/local as per the official instructions. So my suggestion is we just bite the bullet and create the whole /images/smileys/local path at this point to just avoid any confusion. It is more intuitive and probably what I should have just done in the first place. I am happy to make the change, test it, and push it up for you if you agree.

@MachX428
Copy link
Contributor Author

I went ahead and made the change I described, and retested. All looks well on my end if you want to add that in.

@LinuxServer-CI
Copy link
Collaborator

@nemchik nemchik merged commit 50812b5 into linuxserver:master Nov 15, 2022
@MachX428 MachX428 deleted the persist-smileys-interwiki branch November 17, 2022 02:43
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Custom Smiley and Interwiki icons do not work because folders not persisted

5 participants