Restricting Special Characters in Shared File/Folder Passwords

Hello everyone,

I have a question regarding the password feature when sharing files or folders on Nextcloud. Is there a way to restrict certain characters in these passwords? We have a specific use case where we need to send these passwords via an email service that removes characters resembling HTML code, and we want to ensure the passwords remain intact.

Your insights and guidance on how to achieve this would be greatly appreciated.

Thank you in advance for your assistance.

Best regards,

I would recommend to create images from the passwords and sent it to the users instead of sending it in clear text. This would also prevent any kind of automatic script processing.

1 Like

HI, this seems over-complicated for my case. any other solution ?

Regards

Because of security reason it is not a good idea to send the Nextcloud share and the password both over email. Anyone trying to find in malware in html-email should consider whether it makes sense to send Nextcloud password with email.

Do you want to write how the recipient gets the URL?

It’s only overcomplicated as long as you don’t know how to do it :wink:

You need convert (apt-get install imagemagick-6.q16 on Ubuntu)

With convert you can create png files with the text of your choice:

FONT="/usr/share/fonts/truetype/dejavu/DejaVuSansMono-Bold.ttf"
PASSWORD="cZ\/&</>@$"
convert -size 300x50 canvas:none -font "$FONT" -pointsize 36 -draw "gravity Center text 2,-3 '$PASSWORD'" -channel RGBA -blur 0x6 -fill cyan -stroke darkblue -draw "gravity Center text -3,2 '$PASSWORD'" /path/to/outfile

gives this result:

image

So with that example, it should be a piece of cake, making a script that automates it. You can even integrate it inside of your cloud with the files_scripts app.

Much luck,
ernolf

thanks a lot.

but the tools I have to use ton send the email only allow plain text… :frowning: