• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Forwarded to devs Hotlink protection CLI - Multiple entries issue

Hex

Regular Pleskian
Plesk Certified Professional
User name: Hextrator

TITLE

Hotlink protection CLI - Multiple entries issue

PRODUCT, VERSION, OPERATING SYSTEM, ARCHITECTURE

Plesk Obsidian on CentOS7

PROBLEM DESCRIPTION

As per the following command on Linux:
Bash:
plesk bin hotlink_protection --help

This command is unable to include multiple file extensions
Bash:
plesk bin hotlink_protection --update <domain|subdomain> -protected-extensions <ext1;ext2;...>
Example: If hotlink protection is enabled for a domain, all picture file extensions are protected by default:

Bash:
plesk bin hotlink_protection -i <domain|subdomain>
enabled=true
friendly-domains=
protected-extensions=bmp;dib;rle;emf;wmf;gif;jpg;jpeg;jpe;jif;jfif;pcx;png;tga;tiff;tif

If you want to protect all pic files extensions from hotlinking except let say: PNG and GIF only:

Bash:
plesk bin hotlink_protection --update example.com -protected-extensions bmp;dib;rle;emf;wmf;jpg;jpeg;jpe;jif;jfif;pcx;tga;tiff;tif

The command will only accept the first param <png;> and ignore the rest.

STEPS TO REPRODUCE

Exclude PNG and GIF from hotlinking for the domain example.com

Bash:
plesk bin hotlink_protection --update example.com -protected-extensions bmp;dib;rle;emf;wmf;jpg;jpeg;jpe;jif;jfif;pcx;tga;tiff;tif

ACTUAL RESULT

Bash:
[root@centos]# plesk bin hotlink_protection --update example.com -protected-extensions bmp;dib;rle;emf;wmf;jpg;jpeg;jpe;jif;jfif;pcx;tga;tiff;tif
bash: dib: command not found
bash: rle: command not found
bash: emf: command not found
bash: wmf: command not found
bash: jpg: command not found
bash: jpeg: command not found
bash: jpe: command not found
bash: jif: command not found
bash: jfif: command not found
bash: pcx: command not found
bash: tga: command not found
bash: tiff: command not found
bash: tif: command not found

And the only accepted ext is the first param bmp;

Bash:
[root@centos]# plesk bin hotlink_protection -i example.com
enabled=true
friendly-domains=
protected-extensions=bmp
enabled=true
friendly-domains=
protected-extensions=bmp

EXPECTED RESULT

Bash:
plesk bin hotlink_protection -i example.com
enabled=true
friendly-domains=
protected-extensions=bmp;dib;rle;emf;wmf;jpg;jpeg;jpe;jif;jfif;pcx;tga;tiff;tif

All are protected except PNG and GIF.

ANY ADDITIONAL INFORMATION

Example use case:

Source info:


I'm not sure why is not documented for Linux.

YOUR EXPECTATIONS FROM PLESK SERVICE TEAM

Confirm bug
 
Last edited:
Back
Top