Bookmarks with Nextcloud

From Wurst-Wasser.net
Revision as of 21:06, 21 June 2023 by Heiko (talk | contribs) (→‎HowTo)
Jump to navigation Jump to search

About

Nextcloud can handle all your bookmarks...this is REALLY handy if you use multiple devices, Terminal Servers and such.

You can learn all about the built-in and third-party apps here: https://apps.nextcloud.com/apps/bookmarks

iOS or Android devices

Since the usual floccus-Plugins won't work on mobile device browsers[1] there are special apps to manage your bookmarks. This works just fine, but is a bit "unhandy".

However, you can export these bookmarks on a daily basis to HTML and use it otherwise...

HowTo

ℹ️ The idea is to make backups from Nextcloud-bookmarks and make them (not so much) protected available on the website...
  • Make sure, your bookmarks are backupped:
    Nc bookmarks settings backup.png
  • Create a .htpasswd in your public path
deep-thought bookmarks # cat .htaccess 
AuthType Basic
AuthName "Wurst-Wasser.net Bookmarks"
AuthUserFile /var/www/_htaccess/bookmarksUsers
Require valid-user
deep-thought bookmarks # 
  • Set a password:
deep-thought _htaccess # htpasswd bookmarksUsers heiko
New password: 
Re-type new password: 
Adding password for user heiko
deep-thought _htaccess # 
  • Run this script nightly:
#!/bin/bash
#set -x

# Documentation: https://www.wurst-wasser.net//wiki/index.php/Bookmarks_with_Nextcloud

# Globals
GFOLDERTARGET="/var/www/html/bookmarks"
GFILETARGET="${GFOLDERTARGET}/index.html"
GFOLDERSOURCE="/home/nextcloud-data/heiko/files/Bookmarks Backups"

# Functions

# Main
GFILEBOOKMARKS="`find "${GFOLDERSOURCE}" -type f | sort | tail -1`"

echo "Newest bookmarks file: \"${GFILEBOOKMARKS}\"."

echo "Publishing bookmarks file: \"${GFILEBOOKMARKS}\" to \"${GFILETARGET}\""
cp "${GFILEBOOKMARKS}" "${GFILETARGET}"




#EOF
  • Might want to use a cronjob like this:
# Publish bookmarks
0 7 * * *   /root/bin/publishBookmarks.sh >> /dev/null 2>&1

Footer