|
| 1 | +<?php |
| 2 | +error_reporting(E_ERROR | E_PARSE); |
| 3 | +//Default Configuration |
| 4 | +$CONFIG = '{"lang":"UI_LANG","error_reporting":false,"show_hidden":false,"hide_Cols":true,"theme":"light"}'; |
| 5 | + |
| 6 | +define('VERSION', '2.5.3-offspot'); |
| 7 | +define('APP_TITLE', 'File Manager'); |
| 8 | +$app_url = 'APP_URL'; |
| 9 | +if ($app_url) { |
| 10 | + define('FM_SELF_URL', $app_url); |
| 11 | +} |
| 12 | + |
| 13 | +// include auth file to switch modes |
| 14 | +$auth_file = __DIR__.'/auth.php'; |
| 15 | +// echo $auth_file; |
| 16 | +if (is_readable($auth_file)) { |
| 17 | + @include($auth_file); |
| 18 | +} |
| 19 | + |
| 20 | +// Readonly users |
| 21 | +// e.g. array('users', 'guest', ...) |
| 22 | +$readonly_users = array( |
| 23 | +); |
| 24 | + |
| 25 | +// user specific directories |
| 26 | +// array('Username' => 'Directory path', 'Username2' => 'Directory path', ...) |
| 27 | +$directories_users = array(); |
| 28 | + |
| 29 | +// Enable highlight.js (https://highlightjs.org/) on view's page |
| 30 | +$use_highlightjs = true; |
| 31 | + |
| 32 | +// highlight.js style |
| 33 | +// for dark theme use 'ir-black' |
| 34 | +$highlightjs_style = 'vs'; |
| 35 | + |
| 36 | +// Enable ace.js (https://ace.c9.io/) on view's page |
| 37 | +$edit_files = true; |
| 38 | + |
| 39 | +// Default timezone for date() and time() |
| 40 | +// Doc - http://php.net/manual/en/timezones.php |
| 41 | +$default_timezone = 'UI_TIMEZONE'; |
| 42 | + |
| 43 | +// Root path for file manager |
| 44 | +// use absolute path of directory i.e: '/var/www/folder' or $_SERVER['DOCUMENT_ROOT'].'/folder' |
| 45 | +$root_path = '/data'; |
| 46 | + |
| 47 | +// Root url for links in file manager.Relative to $http_host. Variants: '', 'path/to/subfolder' |
| 48 | +// Will not working if $root_path will be outside of server document root |
| 49 | +$root_url = '/_download'; |
| 50 | + |
| 51 | +// Server hostname. Can set manually if wrong |
| 52 | +// $_SERVER['HTTP_HOST'].'/folder' |
| 53 | +$http_host = $_SERVER['HTTP_HOST']; |
| 54 | + |
| 55 | +// input encoding for iconv |
| 56 | +$iconv_input_encoding = 'UTF-8'; |
| 57 | + |
| 58 | +// date() format for file modification date |
| 59 | +// Doc - https://www.php.net/manual/en/function.date.php |
| 60 | +$datetime_format = 'd/m/Y g:i A'; |
| 61 | + |
| 62 | +// Path display mode when viewing file information |
| 63 | +// 'full' => show full path |
| 64 | +// 'relative' => show path relative to root_path |
| 65 | +// 'host' => show path on the host |
| 66 | +$path_display_mode = 'relative'; |
| 67 | + |
| 68 | +// Allowed file extensions for create and rename files |
| 69 | +// e.g. 'txt,html,css,js' |
| 70 | +$allowed_file_extensions = ''; |
| 71 | + |
| 72 | +// Allowed file extensions for upload files |
| 73 | +// e.g. 'gif,png,jpg,html,txt' |
| 74 | +$allowed_upload_extensions = ''; |
| 75 | + |
| 76 | +// Favicon path. This can be either a full url to an .PNG image, or a path based on the document root. |
| 77 | +// full path, e.g http://example.com/favicon.png |
| 78 | +// local path, e.g images/icons/favicon.png |
| 79 | +$favicon_path = ''; |
| 80 | + |
| 81 | +// Files and folders to excluded from listing |
| 82 | +// e.g. array('myfile.html', 'personal-folder', '*.php', ...) |
| 83 | +$exclude_items = array(); |
| 84 | + |
| 85 | +// Online office Docs Viewer |
| 86 | +// Availabe rules are 'google', 'microsoft' or false |
| 87 | +// Google => View documents using Google Docs Viewer |
| 88 | +// Microsoft => View documents using Microsoft Web Apps Viewer |
| 89 | +// false => disable online doc viewer |
| 90 | +$online_viewer = 'false'; |
| 91 | + |
| 92 | +// Sticky Nav bar |
| 93 | +// true => enable sticky header |
| 94 | +// false => disable sticky header |
| 95 | +$sticky_navbar = false; |
| 96 | + |
| 97 | +// Maximum file upload size |
| 98 | +// Increase the following values in php.ini to work properly |
| 99 | +// memory_limit, upload_max_filesize, post_max_size |
| 100 | +$max_upload_size_bytes = 20000000000; // size 5,000,000,000 bytes (~5GB) |
| 101 | + |
| 102 | +// chunk size used for upload |
| 103 | +// eg. decrease to 1MB if nginx reports problem 413 entity too large |
| 104 | +$upload_chunk_size_bytes = 2000000; // chunk size 2,000,000 bytes (~2MB) |
| 105 | + |
| 106 | +// Possible rules are 'OFF', 'AND' or 'OR' |
| 107 | +// OFF => Don't check connection IP, defaults to OFF |
| 108 | +// AND => Connection must be on the whitelist, and not on the blacklist |
| 109 | +// OR => Connection must be on the whitelist, or not on the blacklist |
| 110 | +$ip_ruleset = 'OFF'; |
| 111 | + |
| 112 | +// Should users be notified of their block? |
| 113 | +$ip_silent = true; |
| 114 | + |
| 115 | +// IP-addresses, both ipv4 and ipv6 |
| 116 | +$ip_whitelist = array( |
| 117 | + '127.0.0.1', // local ipv4 |
| 118 | + '::1' // local ipv6 |
| 119 | +); |
| 120 | + |
| 121 | +// IP-addresses, both ipv4 and ipv6 |
| 122 | +$ip_blacklist = array( |
| 123 | + '0.0.0.0', // non-routable meta ipv4 |
| 124 | + '::' // non-routable meta ipv6 |
| 125 | +); |
| 126 | + |
| 127 | +// External CDN resources that can be used in the HTML (replace for GDPR compliance) |
| 128 | +$external = array( |
| 129 | + 'css-bootstrap' => '<link href="/assets/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-Zenh87qX5JnK2Jl0vWa8Ck2rdkQ2Bzep5IDxbcnCeuOxjzrPF/et3URy9Bv1WTRi" crossorigin="anonymous">', |
| 130 | + 'css-dropzone' => '<link href="/assets/css/dropzone.min.css" rel="stylesheet">', |
| 131 | + 'css-font-awesome' => '<link rel="stylesheet" href="/assets/css/font-awesome.min.css" crossorigin="anonymous">', |
| 132 | + 'css-highlightjs' => '<link rel="stylesheet" href="/assets/css/' . $highlightjs_style . '.min.css">', |
| 133 | + 'js-ace' => '<script src="/assets/js/ace.js"></script>', |
| 134 | + 'js-bootstrap' => '<script src="/assets/js/bootstrap.bundle.min.js" integrity="sha384-OERcA2EqjJCMA+/3y+gxIOqMEjwtxJY7qPCqsdltbNJuaOe923+mo//f6V8Qbsw3" crossorigin="anonymous"></script>', |
| 135 | + 'js-dropzone' => '<script src="/assets/js/dropzone.min.js"></script>', |
| 136 | + 'js-jquery' => '<script src="/assets/js/jquery-3.6.1.min.js" integrity="sha256-o88AwQnZB+VDvE9tvIXrMQaPlFFSUTR+nldQm1LuPXQ=" crossorigin="anonymous"></script>', |
| 137 | + 'js-jquery-datatables' => '<script src="/assets/js/jquery.dataTables.min.js" crossorigin="anonymous" defer></script>', |
| 138 | + 'js-highlightjs' => '<script src="/assets/js/highlight.min.js"></script>', |
| 139 | + 'pre-jsdelivr' => '<style type="text/css">form[action*="dl="], a[href*="&dl="] { background-color: red; display:none !important; }\na[href*="/_download/"] { } i.fa.fa-link::before { content: "\f019" !important; }</style>', |
| 140 | + 'pre-cloudflare' => '' |
| 141 | +); |
| 142 | + |
| 143 | +?> |
0 commit comments