diff --git a/.htaccess b/.htaccess index 91e0527..c836f7d 100644 --- a/.htaccess +++ b/.htaccess @@ -2,8 +2,12 @@ Options -Indexes +FollowSymLinks -SymLinksIfOwnerMatch RewriteEngine on -## Sécurité +RewriteCond %{REQUEST_URI} jquery-file-upload.html [NC] +RewriteRule .* - [L] + + +## Sécurité #RewriteRule ^files/([0-9]+-[0-9]{1,2})/.key-[0-9]{12} /index.php?action=403 RewriteRule ^files/(.+) /index.php?action=403 RewriteRule ^(.+).key-[0-9]{12}$ /index.php?action=403 diff --git a/README.md b/README.md index 33e3237..2859316 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,8 @@ PHP file sharing service [free of rights](https://en.wikipedia.org/wiki/Open_sou - HTTP serveur htaccess compatible (url rewriting enable) - PHP 5.6 minimum - - PHP GD lib + - PHP GD lib + - ImageMagick convert binary (option) - No nessecary database ## Installation @@ -45,10 +46,17 @@ to - drag and drop for upload - limit by ip+cookies (sqlite) (limit abuse) - crypt files - - Rendre l'upload progress plus jolie - - Ajout de fichier dans un répetoire déjà uploadé - captcha / anti bot - "signaler un fichier" + - mimeTypes restriction + - 1.0 + - jQuery-File-Upload implemented : https://github.com/blueimp/jQuery-File-Upload/ + - Resize image befor upload + - Preview audio/video/image befor upload + - Config add variable : + - minUploadPerFile, acceptFileTypes, imageAutoOrient + - Deprecated : mimeTypes restriction + - Add on existent sharing - 0.2 - Mod gallery if images - Passowrd for access @@ -88,4 +96,4 @@ David Mercereau [david #arobase# mercereau #point# info](http://david.mercereau. ## Translation * oc : Quentin PAGÈS -* fr/en : David Mercereau \ No newline at end of file +* fr/en : David Mercereau diff --git a/config.yaml.dist b/config.yaml.dist index dbcd33f..8532e56 100644 --- a/config.yaml.dist +++ b/config.yaml.dist @@ -11,47 +11,37 @@ expireCronFreq: 86400 # juste for cron web, in second (exemple 86400 = expireDay: - 1 - 7 + - 15 - 30 - 90 - 180 - - 365 -expireDayDefault : 7 +expireDayDefault : 15 imageResize: # Propose resize images - 0 # 0 = no resize - 300 - 800 - 1024 + - 1920 - 2048 - 4096 passwordUniqKey: uiphv7olXzvghRanRCxF # get random here : https://www.random.org/strings/?num=1&len=20&digits=on&upperalpha=on&loweralpha=on&unique=on&format=html&rnd=new passwordTimeRemember: '+2 hours' # https://www.php.net/manual/fr/function.strtotime.php deleteAfterAccessDefault: 1 imageResizeDefault : 1024 -maxUploadPerFile: 30M # Exemple 100K, 30M, 12G +maxUploadPerFile: 30M +minUploadPerFile: 1 # Exemple 100K, 30M, 12G maxUploadTotal: 90M # Exemple 100K, 30M, 12G maxUploadNb: 100 -mimeTypesConduct: allow # allow = Allow this, deny the rest / deny = Deny this, allow the rest -mimeTypes: # pattern for pgrep_match https://www.php.net/manual/function.preg-match.php - - ^text\/ - - ^image\/ - - ^audio\/ - - ^video\/ - - ^font\/ - - ^application\/x-bzip - - ^application\/x-csh$ - - ^application\/msword$ - - ^application\/vnd.openxmlformats-officedocument. - - ^application\/epub+zip$ - - ^application\/vnd.oasis.opendocument. - - ^application\/ogg - - ^application\/pdf$ - - ^application\/x-rar-compressed$ - - ^application\/vnd.ms-powerpoint$ - - ^application\/x-tar$ - - ^application\/vnd.visio$ - - ^application\/vnd.ms-excel$ - - ^application\/zip$ - - ^application\/x-7z-compressed$ +acceptFileTypes: '/(\.|\/)(pdf|od[a-z]|doc[a-z]?|xls[a-z]?|csv|ppt[a-z]?|7z|zip|bz|bz2|rar|tar|gz|tgz|txt|md|gif|jpe?g|png|bmp|ico|mp3|aac|mid|wav|ov[a-z]|web.?|avi|mp[a-z]?g|mp.+|wm.+|xml|iso|torrent)$/i' +#~ Set to 0 to use the GD library to scale and orient images, +#~ set to 1 to use imagick (if installed, falls back to GD), +#~ set to 2 to use the ImageMagick convert binary directly: +imageLibrary: 0 +#~ If set 2 : +imageConvertBin: 'convert' +imageIdentifyBin: 'identify' +imageAutoOrient: true +checkUpdate: 86400 # in seconds or "false" for disable similarServicesView: true similarServicesLink: - Firefox Send diff --git a/index.php b/index.php index a97b2aa..6ee0711 100644 --- a/index.php +++ b/index.php @@ -1,5 +1,5 @@ var Config_maxUploadTotal = = convertHumain2octect($config['maxUploadTotal']) ?> var Config_maxUploadNb = = $config['maxUploadNb'] ?> - var Config_mimeTypesConduct = '= $config['mimeTypesConduct'] ?>' - var Config_mimeTypes = ['helloWorld']; var Msg_errorFileSize = ''; var Msg_errorTotalSize = ''; var Msg_errorUploadNb = ''; var Msg_errorFileType = ''; + var filesUploadQueu=0; + + @@ -226,9 +228,21 @@ if ($passwordForm == false) { $( document ).tooltip(); } ); + + + + + +
-'._('Protect with password').' :
'._('Delete after access').' :
'. + _('The limit per file is ').$config['maxUploadPerFile'] + .'
'. + _('The total limit per upload is ').$config['maxUploadTotal'] + .'
= _('Online file sharing service free of rights (license Beerware) and free.') ?>
- | = _('Nb of files') ?> | = _('Creation date ') ?> | = _('Expiration date') ?> | = _('Size') ?> | = _('Remaining access') ?> | = _('Password') ?> | = _('Link') ?> |
---|