[FEATURE] provide details for bug opening

refs #235

Signed-off-by: Jerome Jutteau <jerome@jutteau.fr>
This commit is contained in:
Jerome Jutteau 2020-12-05 14:13:49 +01:00
parent cd86d83c47
commit 9a51f6fc76
51 changed files with 154 additions and 0 deletions

View File

@ -210,6 +210,8 @@ Hint: To create a custom theme just copy the »courgette« folder and name your
### I found a bug, what should I do?
Feel free to open a bug in the [GitLab's issues](https://gitlab.com/mojo42/Jirafeau/issues).
If you can, please copy-paste informations related to bug opening provided in admin interface.
Admin interface can be reached by accessing `/admin.php`.
### How to set maximum file size?

View File

@ -219,6 +219,19 @@ if (php_sapi_name() == "cli") {
</td>
</tr>
</form>
<form method="post">
<tr>
<input type = "hidden" name = "action" value = "bug_report_info"/>
<?php echo jirafeau_admin_csrf_field() ?>
<td class = "info">
<?php echo t('REPORTING_AN_ISSUE'); ?>
</td>
<td></td>
<td>
<input type = "submit" value = "<?php echo t('INFO'); ?>" />
</td>
</tr>
</form>
</table>
<form method="post">
<input type = "hidden" name = "action" value = "logout" />
@ -282,6 +295,8 @@ if (php_sapi_name() == "cli") {
fclose($r);
}
exit;
} elseif (strcmp($_POST['action'], 'bug_report_info') == 0) {
echo jirafeau_admin_bug_report($cfg);
}
}

View File

@ -788,6 +788,95 @@ function jirafeau_admin_clean_async()
}
return $count;
}
/**
* Better strval function for debug purposes
*/
function jirafeau_strval($value)
{
if (gettype($value) == "boolean") {
return $value ? 'true' : 'false';
}
return strval($value);
}
/**
* Show file/folder permissions
*/
function jirafeau_fileperms($path)
{
$out = substr(sprintf("%o", @fileperms($path)), -4) . ", ";
$out .= "read " . (is_readable($path) ? "OK" : "KO") . ", ";
$out .= "write " . (is_writable($path) ? "OK" : "KO");
return $out;
}
/**
* Show some useful informations for bug reporting.
*/
function jirafeau_admin_bug_report($cfg)
{
$out = "<fieldset><legend>" . t('REPORTING_AN_ISSUE') . "</legend>";
$out .= "If you have a problem related to Jirafeau, please <a href='https://gitlab.com/mojo42/Jirafeau/-/issues'>open an issue</a>, explain your problem in english and copy-paste the following content:<br/><br/><code>";
$out .= "# Jirafeau<br/>";
$out .= "- version: " . JIRAFEAU_VERSION . "<br/>";
$jirafeau_options = [
'debug',
'file_hash',
'litespeed_workaround',
'store_uploader_ip',
'installation_done',
'enable_crypt',
'preview',
'maximal_upload_size',
'store_uploader_ip'
];
foreach ($jirafeau_options as &$o) {
$v = $cfg[$o];
$out .= "- $o: " . jirafeau_strval($v) . " (" . gettype($v) . ")<br/>";
}
$out .= "<br/>";
$out .= "# PHP options<br/>";
$out .= "- php version: " . phpversion() . "<br/>";
$out .= "- mcrypt version: " . phpversion('mcrypt') . "<br/>";
$php_options = [
'post_max_size',
'upload_max_filesize'
];
foreach ($php_options as &$o) {
$v = ini_get($o);
$out .= "- $o: " . jirafeau_strval($v) . " (" . gettype($v). ")<br/>";
}
$out .= "<br/>";
$out .= "# File permissions<br/>";
$out .= "- 'var' folder permissions: " . jirafeau_fileperms($cfg['var_root']) . "<br/>";
$out .= "- 'file' folder permissions: " . jirafeau_fileperms(VAR_FILES) . "<br/>";
$out .= "- 'links' folder permissions: " . jirafeau_fileperms(VAR_LINKS) . "<br/>";
$out .= "- 'async' folder permissions: " . jirafeau_fileperms(VAR_ASYNC) . "<br/>";
$out .= "<br/>";
$out .= "# Server details<br/>";
$out .= "- server software: " . $_SERVER["SERVER_SOFTWARE"] . "<br/>";
$out .= "<br/>";
$out .= "# OS details<br/>";
$out .= "- OS: " . php_uname() . "<br/>";
$out .= "<br/>";
$out .= "# Browser details<br/>";
$out .= "<script type='text/javascript' lang='Javascript'>
// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL-v3-or-Later
document.write('- HTML5 support: ' + (check_html5_file_api() ? 'yes' : 'no') + '<br/>');
document.write('- User agent: ' + navigator.userAgent + '<br/>');
// @license-end
</script>";
$out .= "</code></fieldset>";
return $out;
}
/**
* Read async transfert informations
* @return array containing informations.

View File

@ -1,4 +1,5 @@
{
"REPORTING_AN_ISSUE": "",
"SIZE_DATA": "حجم البيانات",
"INCOMPATIBLE_OPTIONS_W": "",
"NO_BROWSER_SUPPORT": "قد لا يدعم متصفحك HTML5، لذا فإن الحد الأقصى لحجم الملف هو ",

View File

@ -1,4 +1,5 @@
{
"REPORTING_AN_ISSUE": "",
"SIZE_DATA": "",
"INCOMPATIBLE_OPTIONS_W": "",
"NO_BROWSER_SUPPORT": "Ваш браўзер не падтрымлівае HTML5, таму максімальны памер файла ",

View File

@ -1,4 +1,5 @@
{
"REPORTING_AN_ISSUE": "",
"SIZE_DATA": "",
"INCOMPATIBLE_OPTIONS_W": "",
"NO_BROWSER_SUPPORT": "আপনার ব্রাউজার HTML5 সমর্থন নাও করতে পারে, তাই সর্বোচ্চ ফাইলের আকার ",

View File

@ -1,4 +1,5 @@
{
"REPORTING_AN_ISSUE": "",
"SIZE_DATA": "",
"INCOMPATIBLE_OPTIONS_W": "",
"NO_BROWSER_SUPPORT": "",

View File

@ -1,4 +1,5 @@
{
"REPORTING_AN_ISSUE": "",
"SIZE_DATA": "",
"INCOMPATIBLE_OPTIONS_W": "",
"NO_BROWSER_SUPPORT": "El teu navegador no és compatible amb HTML5, per tant, la mida màxima del fitxers és ",

View File

@ -1,4 +1,5 @@
{
"REPORTING_AN_ISSUE": "",
"SIZE_DATA": "",
"INCOMPATIBLE_OPTIONS_W": "",
"NO_BROWSER_SUPPORT": "Váš prohlížeč nepodporuje HTML5, proto je maximílní velikost souboru ",

View File

@ -1,4 +1,5 @@
{
"REPORTING_AN_ISSUE": "",
"SIZE_DATA": "",
"INCOMPATIBLE_OPTIONS_W": "",
"NO_BROWSER_SUPPORT": "",

View File

@ -1,4 +1,5 @@
{
"REPORTING_AN_ISSUE": "",
"SIZE_DATA": "Datengröße",
"INCOMPATIBLE_OPTIONS_W": "Die folgenden Konfigurationsoptionen sind nicht kompatibel:",
"NO_BROWSER_SUPPORT": "Dein Browser unterstützt möglicherweise kein HTML5, demnach beträgt die maximale Dateigröße ",

View File

@ -1,4 +1,5 @@
{
"REPORTING_AN_ISSUE": "",
"SIZE_DATA": "",
"INCOMPATIBLE_OPTIONS_W": "",
"NO_BROWSER_SUPPORT": "",

View File

@ -1,4 +1,5 @@
{
"REPORTING_AN_ISSUE": "Reporting an issue",
"SIZE_DATA": "Data size",
"INCOMPATIBLE_OPTIONS_W": "The following configuration options are incompatible:",
"NO_BROWSER_SUPPORT": "Your browser may not support HTML5, so the maximum file size is ",

View File

@ -1,4 +1,5 @@
{
"REPORTING_AN_ISSUE": "",
"SIZE_DATA": "",
"INCOMPATIBLE_OPTIONS_W": "",
"NO_BROWSER_SUPPORT": "Tu navegador puede no soportar HTML5, debido a esto el tamaño máximo de archivo es ",

View File

@ -1,4 +1,5 @@
{
"REPORTING_AN_ISSUE": "",
"SIZE_DATA": "",
"INCOMPATIBLE_OPTIONS_W": "",
"NO_BROWSER_SUPPORT": "",

View File

@ -1,4 +1,5 @@
{
"REPORTING_AN_ISSUE": "",
"SIZE_DATA": "",
"INCOMPATIBLE_OPTIONS_W": "",
"NO_BROWSER_SUPPORT": "",

View File

@ -1,4 +1,5 @@
{
"REPORTING_AN_ISSUE": "Rapporter un bogue",
"SIZE_DATA": "Volume de données",
"INCOMPATIBLE_OPTIONS_W": "Les options de configuration suivantes sont incompatibles :",
"NO_BROWSER_SUPPORT": "Votre navigateur ne supporte apparemment pas HTML5, la taille maximale de fichier téléchargable est de ",

View File

@ -1,4 +1,5 @@
{
"REPORTING_AN_ISSUE": "",
"SIZE_DATA": "גודל הנתונים",
"INCOMPATIBLE_OPTIONS_W": "אפשרויות ההגדרה הבאות אינן תואמות:",
"NO_BROWSER_SUPPORT": "יתכן שהדפדפן שלך אינו תומך ב־HTML5, לכן גודל הקובץ המרבי הוא ",

View File

@ -1,4 +1,5 @@
{
"REPORTING_AN_ISSUE": "",
"SIZE_DATA": "",
"INCOMPATIBLE_OPTIONS_W": "",
"NO_BROWSER_SUPPORT": "",

View File

@ -1,4 +1,5 @@
{
"REPORTING_AN_ISSUE": "",
"SIZE_DATA": "Veličina podataka",
"INCOMPATIBLE_OPTIONS_W": "Sljedeće opcije konfiguracije su nekompatibilne:",
"NO_BROWSER_SUPPORT": "Preglednik možda ne podržava HTML5, stoga je maksimalna veličina datoteke ",

View File

@ -1,4 +1,5 @@
{
"REPORTING_AN_ISSUE": "",
"SIZE_DATA": "",
"INCOMPATIBLE_OPTIONS_W": "",
"NO_BROWSER_SUPPORT": "",

View File

@ -1,4 +1,5 @@
{
"REPORTING_AN_ISSUE": "",
"SIZE_DATA": "",
"INCOMPATIBLE_OPTIONS_W": "",
"NO_BROWSER_SUPPORT": "",

View File

@ -1,4 +1,5 @@
{
"REPORTING_AN_ISSUE": "",
"SIZE_DATA": "Dimensione dei dati",
"INCOMPATIBLE_OPTIONS_W": "Le seguenti opzioni di configurazione sono incompatibili:",
"NO_BROWSER_SUPPORT": "Il tuo browser potrebbe non supportare HTML5, quindi la dimensione massima del file è ",

View File

@ -1,4 +1,5 @@
{
"REPORTING_AN_ISSUE": "",
"SIZE_DATA": "",
"INCOMPATIBLE_OPTIONS_W": "",
"NO_BROWSER_SUPPORT": "",

View File

@ -1,4 +1,5 @@
{
"REPORTING_AN_ISSUE": "",
"SIZE_DATA": "",
"INCOMPATIBLE_OPTIONS_W": "",
"NO_BROWSER_SUPPORT": "",

View File

@ -1,4 +1,5 @@
{
"REPORTING_AN_ISSUE": "",
"SIZE_DATA": "",
"INCOMPATIBLE_OPTIONS_W": "",
"NO_BROWSER_SUPPORT": "",

View File

@ -1,4 +1,5 @@
{
"REPORTING_AN_ISSUE": "",
"SIZE_DATA": "",
"INCOMPATIBLE_OPTIONS_W": "",
"NO_BROWSER_SUPPORT": "",

View File

@ -1,4 +1,5 @@
{
"REPORTING_AN_ISSUE": "",
"SIZE_DATA": "",
"INCOMPATIBLE_OPTIONS_W": "",
"NO_BROWSER_SUPPORT": "",

View File

@ -1,4 +1,5 @@
{
"REPORTING_AN_ISSUE": "",
"SIZE_DATA": "",
"INCOMPATIBLE_OPTIONS_W": "",
"NO_BROWSER_SUPPORT": "",

View File

@ -1,4 +1,5 @@
{
"REPORTING_AN_ISSUE": "",
"SIZE_DATA": "Datastørrelse",
"INCOMPATIBLE_OPTIONS_W": "Følgende oppsettsvalg er ikke kompatible:",
"NO_BROWSER_SUPPORT": "Det kan hende at nettleseren din ikke støtter HTML5, så største tillatte filstørrelse er ",

View File

@ -1,4 +1,5 @@
{
"REPORTING_AN_ISSUE": "",
"SIZE_DATA": "",
"INCOMPATIBLE_OPTIONS_W": "",
"NO_BROWSER_SUPPORT": "",

View File

@ -1,4 +1,5 @@
{
"REPORTING_AN_ISSUE": "",
"SIZE_DATA": "Rozmiar danych",
"INCOMPATIBLE_OPTIONS_W": "Następujące opcje konfiguracji są niezgodne:",
"NO_BROWSER_SUPPORT": "Twoja przeglądarka może nie obsługiwać HTML5, więc maksymalny rozmiar pliku to ",

View File

@ -1,4 +1,5 @@
{
"REPORTING_AN_ISSUE": "",
"SIZE_DATA": "",
"INCOMPATIBLE_OPTIONS_W": "",
"NO_BROWSER_SUPPORT": "",

View File

@ -1,4 +1,5 @@
{
"REPORTING_AN_ISSUE": "",
"SIZE_DATA": "Tamanho dos dados",
"NO_BROWSER_SUPPORT": "O seu navegador pode não suportar HTML5, então o tamanho máximo do ficheiro é ",
"INCOMPATIBLE_OPTIONS_W": "As seguintes opções de configuração são incompatíveis:",

View File

@ -1,4 +1,5 @@
{
"REPORTING_AN_ISSUE": "",
"SIZE_DATA": "",
"INCOMPATIBLE_OPTIONS_W": "",
"NO_BROWSER_SUPPORT": "Seu navegador pode não suportar HTML5, portanto, o tamanho máximo do arquivo é ",

View File

@ -1,4 +1,5 @@
{
"REPORTING_AN_ISSUE": "",
"SIZE_DATA": "Mărime date",
"INCOMPATIBLE_OPTIONS_W": "Următoarele opţiuni de configurare sunt incompatibile:",
"NO_BROWSER_SUPPORT": "Este posibil ca browserul dvs. să nu accepte HTML5, astfel încât dimensiunea maximă a fișierului este ",

View File

@ -1,4 +1,5 @@
{
"REPORTING_AN_ISSUE": "",
"SIZE_DATA": "",
"INCOMPATIBLE_OPTIONS_W": "",
"NO_BROWSER_SUPPORT": "",

View File

@ -1,4 +1,5 @@
{
"REPORTING_AN_ISSUE": "",
"SIZE_DATA": "",
"INCOMPATIBLE_OPTIONS_W": "",
"NO_BROWSER_SUPPORT": "",

View File

@ -1,4 +1,5 @@
{
"REPORTING_AN_ISSUE": "",
"SIZE_DATA": "",
"INCOMPATIBLE_OPTIONS_W": "",
"NO_BROWSER_SUPPORT": "Zdá sa, že Váš prehliadač nepodporuje HTML5. Maximálna veľkosť súboru je preto obmedzená na ",

View File

@ -1,4 +1,5 @@
{
"REPORTING_AN_ISSUE": "",
"SIZE_DATA": "",
"INCOMPATIBLE_OPTIONS_W": "",
"NO_BROWSER_SUPPORT": "",

View File

@ -1,4 +1,5 @@
{
"REPORTING_AN_ISSUE": "",
"SIZE_DATA": "",
"INCOMPATIBLE_OPTIONS_W": "",
"NO_BROWSER_SUPPORT": "",

View File

@ -1,4 +1,5 @@
{
"REPORTING_AN_ISSUE": "",
"SIZE_DATA": "",
"INCOMPATIBLE_OPTIONS_W": "",
"NO_BROWSER_SUPPORT": "",

View File

@ -1,4 +1,5 @@
{
"REPORTING_AN_ISSUE": "",
"SIZE_DATA": "Data storlek",
"INCOMPATIBLE_OPTIONS_W": "Följande inställningar är inkompatibla:",
"NO_BROWSER_SUPPORT": "Din webbläsare verkar inte stödja HTML5, så max filstorlek är ",

View File

@ -1,4 +1,5 @@
{
"REPORTING_AN_ISSUE": "",
"SIZE_DATA": "",
"INCOMPATIBLE_OPTIONS_W": "",
"NO_BROWSER_SUPPORT": "",

View File

@ -1,4 +1,5 @@
{
"REPORTING_AN_ISSUE": "",
"SIZE_DATA": "",
"INCOMPATIBLE_OPTIONS_W": "",
"NO_BROWSER_SUPPORT": "",

View File

@ -1,4 +1,5 @@
{
"REPORTING_AN_ISSUE": "",
"SIZE_DATA": "",
"INCOMPATIBLE_OPTIONS_W": "",
"NO_BROWSER_SUPPORT": "",

View File

@ -1,4 +1,5 @@
{
"REPORTING_AN_ISSUE": "",
"SIZE_DATA": "Veri boyutu",
"INCOMPATIBLE_OPTIONS_W": "Aşağıdaki yapılandırma seçenekleri uyumsuz:",
"NO_BROWSER_SUPPORT": "Tarayıcınız HTML5'i desteklemeyebilir, bu nedenle en fazla dosya boyutu ",

View File

@ -1,4 +1,5 @@
{
"REPORTING_AN_ISSUE": "",
"SIZE_DATA": "Розмір даних",
"NO_BROWSER_SUPPORT": "Ваш веб-переглядач може не підтримує HTML5, тому найбільший розмір файлу - це ",
"PLURAL_ENDING": "(-ів)",

View File

@ -1,4 +1,5 @@
{
"REPORTING_AN_ISSUE": "",
"SIZE_DATA": "",
"INCOMPATIBLE_OPTIONS_W": "",
"NO_BROWSER_SUPPORT": "",

View File

@ -1,4 +1,5 @@
{
"REPORTING_AN_ISSUE": "",
"SIZE_DATA": "",
"INCOMPATIBLE_OPTIONS_W": "",
"NO_BROWSER_SUPPORT": "您的浏览器可能不支持 HTML5因此文件最大为 ",

View File

@ -1,4 +1,5 @@
{
"REPORTING_AN_ISSUE": "",
"SIZE_DATA": "",
"INCOMPATIBLE_OPTIONS_W": "",
"NO_BROWSER_SUPPORT": "您的瀏覽器可能不支持 HTML5因此文件最大為 ",