Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
95e6ed75a7 | ||
|
|
b09960e538 | ||
|
|
5e8f5be245 | ||
|
|
e5bc0d3cce | ||
|
|
f67bccf8c5 | ||
|
|
88b97def9e | ||
|
|
1f7904dad2 | ||
|
|
5feaf66575 | ||
|
|
c94870fcfe | ||
|
|
6a76dfeba9 | ||
|
|
e193d43278 | ||
|
|
489af403a1 | ||
|
|
ff2f00498c | ||
|
|
2957b4605b | ||
|
|
099dfb0ae8 | ||
|
|
a4289011ef | ||
|
|
942d59848a |
@@ -34,7 +34,7 @@ jobs:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions/setup-go@v6
|
||||
with:
|
||||
go-version: "1.25.x"
|
||||
go-version: "1.26.x"
|
||||
- uses: golangci/golangci-lint-action@v9
|
||||
with:
|
||||
version: "latest"
|
||||
@@ -46,7 +46,7 @@ jobs:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions/setup-go@v6
|
||||
with:
|
||||
go-version: "1.25.x"
|
||||
go-version: "1.26.x"
|
||||
- run: go test --race ./...
|
||||
|
||||
build:
|
||||
@@ -58,7 +58,7 @@ jobs:
|
||||
fetch-depth: 0
|
||||
- uses: actions/setup-go@v6
|
||||
with:
|
||||
go-version: '1.25'
|
||||
go-version: '1.26'
|
||||
- uses: pnpm/action-setup@v4
|
||||
with:
|
||||
package_json_file: "frontend/package.json"
|
||||
@@ -82,7 +82,7 @@ jobs:
|
||||
fetch-depth: 0
|
||||
- uses: actions/setup-go@v6
|
||||
with:
|
||||
go-version: '1.25'
|
||||
go-version: '1.26'
|
||||
- uses: pnpm/action-setup@v4
|
||||
with:
|
||||
package_json_file: "frontend/package.json"
|
||||
|
||||
@@ -2,6 +2,32 @@
|
||||
|
||||
All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.
|
||||
|
||||
## [2.58.0](https://github.com/filebrowser/filebrowser/compare/v2.57.1...v2.58.0) (2026-02-14)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* nederlands ([88b97de](https://github.com/filebrowser/filebrowser/commit/88b97def9ee72fe6e8094209aebb71830b7305be))
|
||||
* support for multiple encodings in CSV files ([#5756](https://github.com/filebrowser/filebrowser/issues/5756)) ([f67bccf](https://github.com/filebrowser/filebrowser/commit/f67bccf8c5470cb280fe854d92aa2666c270bcf5))
|
||||
* Updates for project File Browser ([#5749](https://github.com/filebrowser/filebrowser/issues/5749)) ([c94870f](https://github.com/filebrowser/filebrowser/commit/c94870fcfe1b4acb2db9ab897b9f7d35e3b75770))
|
||||
* Updates for project File Browser ([#5759](https://github.com/filebrowser/filebrowser/issues/5759)) ([5e8f5be](https://github.com/filebrowser/filebrowser/commit/5e8f5be245fd0126545ef5ca61c2d428ac128ad5))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **frontend:** pnpm lock ([b09960e](https://github.com/filebrowser/filebrowser/commit/b09960e538387ff29371c80be1584720f65181e7))
|
||||
* ignore version.go ([1f7904d](https://github.com/filebrowser/filebrowser/commit/1f7904dad21a87f04e1543ee10b60ce79e5eebe9))
|
||||
* respect Accept-Encoding for pre-compressed JS ([#5750](https://github.com/filebrowser/filebrowser/issues/5750)) ([6a76dfe](https://github.com/filebrowser/filebrowser/commit/6a76dfeba9254a938e320928c67d110f73f83715))
|
||||
* wrap response text in Error before reject ([#5753](https://github.com/filebrowser/filebrowser/issues/5753)) ([e5bc0d3](https://github.com/filebrowser/filebrowser/commit/e5bc0d3cce18fa7b069688b176b99efbb67382d2))
|
||||
|
||||
## [2.57.1](https://github.com/filebrowser/filebrowser/compare/v2.57.0...v2.57.1) (2026-02-08)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* normalize fields capitalization ([ff2f004](https://github.com/filebrowser/filebrowser/commit/ff2f00498cff151e2fb1f5f0b16963bf33c3d6d4))
|
||||
* remove skip clean ([489af40](https://github.com/filebrowser/filebrowser/commit/489af403a19057f6b6b4b1dc0e48cbb26a202ef9))
|
||||
|
||||
## [2.57.0](https://github.com/filebrowser/filebrowser/compare/v2.56.0...v2.57.0) (2026-02-01)
|
||||
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
"@vueuse/core": "^14.0.0",
|
||||
"@vueuse/integrations": "^14.0.0",
|
||||
"ace-builds": "^1.43.2",
|
||||
"csv-parse": "^6.1.0",
|
||||
"dayjs": "^1.11.13",
|
||||
"dompurify": "^3.2.6",
|
||||
"epubjs": "^0.3.93",
|
||||
@@ -71,5 +72,5 @@
|
||||
"vite-plugin-compression2": "^2.3.1",
|
||||
"vue-tsc": "^3.1.3"
|
||||
},
|
||||
"packageManager": "pnpm@10.28.2+sha512.41872f037ad22f7348e3b1debbaf7e867cfd448f2726d9cf74c08f19507c31d2c8e7a11525b983febc2df640b5438dee6023ebb1f84ed43cc2d654d2bc326264"
|
||||
"packageManager": "pnpm@10.29.3+sha512.498e1fb4cca5aa06c1dcf2611e6fafc50972ffe7189998c409e90de74566444298ffe43e6cd2acdc775ba1aa7cc5e092a8b7054c811ba8c5770f84693d33d2dc"
|
||||
}
|
||||
|
||||
Generated
+1126
-1377
File diff suppressed because it is too large
Load Diff
@@ -3,14 +3,25 @@ import { useLayoutStore } from "@/stores/layout";
|
||||
import { baseURL } from "@/utils/constants";
|
||||
import { upload as postTus, useTus } from "./tus";
|
||||
import { createURL, fetchURL, removePrefix, StatusError } from "./utils";
|
||||
import { isEncodableResponse, makeRawResource } from "@/utils/encodings";
|
||||
|
||||
export async function fetch(url: string, signal?: AbortSignal) {
|
||||
const encoding = isEncodableResponse(url);
|
||||
url = removePrefix(url);
|
||||
const res = await fetchURL(`/api/resources${url}`, { signal });
|
||||
const res = await fetchURL(`/api/resources${url}`, {
|
||||
signal,
|
||||
headers: {
|
||||
"X-Encoding": encoding ? "true" : "false",
|
||||
},
|
||||
});
|
||||
|
||||
let data: Resource;
|
||||
try {
|
||||
data = (await res.json()) as Resource;
|
||||
if (res.headers.get("Content-Type") == "application/octet-stream") {
|
||||
data = await makeRawResource(res, url);
|
||||
} else {
|
||||
data = (await res.json()) as Resource;
|
||||
}
|
||||
} catch (e) {
|
||||
// Check if the error is an intentional cancellation
|
||||
if (e instanceof Error && e.name === "AbortError") {
|
||||
@@ -140,9 +151,9 @@ async function postResources(
|
||||
if (request.status === 200) {
|
||||
resolve(request.responseText);
|
||||
} else if (request.status === 409) {
|
||||
reject(request.status);
|
||||
reject(new Error(request.status.toString()));
|
||||
} else {
|
||||
reject(request.responseText);
|
||||
reject(new Error(request.responseText));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -4,35 +4,13 @@
|
||||
<i class="material-icons">error</i>
|
||||
<p>{{ displayError }}</p>
|
||||
</div>
|
||||
<div v-else-if="data.headers.length === 0" class="csv-empty">
|
||||
<div v-else-if="parsed.headers.length === 0" class="csv-empty">
|
||||
<i class="material-icons">description</i>
|
||||
<p>{{ $t("files.lonely") }}</p>
|
||||
</div>
|
||||
<div v-else class="csv-table-container" @wheel.stop @touchmove.stop>
|
||||
<table class="csv-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th v-for="(header, index) in data.headers" :key="index">
|
||||
{{ header || `Column ${index + 1}` }}
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="(row, rowIndex) in data.rows" :key="rowIndex">
|
||||
<td v-for="(cell, cellIndex) in row" :key="cellIndex">
|
||||
{{ cell }}
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="csv-footer">
|
||||
<div class="csv-info" v-if="data.rows.length > 100">
|
||||
<i class="material-icons">info</i>
|
||||
<span>
|
||||
{{ $t("files.showingRows", { count: data.rows.length }) }}</span
|
||||
>
|
||||
</div>
|
||||
<div class="column-separator">
|
||||
<div class="csv-header">
|
||||
<div class="header-select">
|
||||
<label for="columnSeparator">{{ $t("files.columnSeparator") }}</label>
|
||||
<select
|
||||
id="columnSeparator"
|
||||
@@ -50,17 +28,61 @@
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="header-select" v-if="isEncodedContent">
|
||||
<label for="fileEncoding">{{ $t("files.fileEncoding") }}</label>
|
||||
<select
|
||||
id="fileEncoding"
|
||||
class="input input--block"
|
||||
v-model="selectedEncoding"
|
||||
>
|
||||
<option
|
||||
v-for="encoding in availableEncodings"
|
||||
:value="encoding"
|
||||
:key="encoding"
|
||||
>
|
||||
{{ encoding }}
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<table class="csv-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th v-for="(header, index) in parsed.headers" :key="index">
|
||||
{{ header || `Column ${index + 1}` }}
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="(row, rowIndex) in parsed.rows" :key="rowIndex">
|
||||
<td v-for="(cell, cellIndex) in row" :key="cellIndex">
|
||||
{{ cell }}
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="csv-footer">
|
||||
<div class="csv-info" v-if="parsed.rows.length > 100">
|
||||
<i class="material-icons">info</i>
|
||||
<span>
|
||||
{{ $t("files.showingRows", { count: parsed.rows.length }) }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { parseCSV, type CsvData } from "@/utils/csv";
|
||||
import { computed, ref } from "vue";
|
||||
import { computed, ref, watchEffect } from "vue";
|
||||
import { parse } from "csv-parse/browser/esm";
|
||||
import { useI18n } from "vue-i18n";
|
||||
import { availableEncodings, decode } from "@/utils/encodings";
|
||||
|
||||
const { t } = useI18n({});
|
||||
|
||||
interface Props {
|
||||
content: string;
|
||||
content: ArrayBuffer | string;
|
||||
error?: string;
|
||||
}
|
||||
|
||||
@@ -68,31 +90,43 @@ const props = withDefaults(defineProps<Props>(), {
|
||||
error: "",
|
||||
});
|
||||
|
||||
const columnSeparator = ref([","]);
|
||||
const columnSeparator = ref([",", ";"]);
|
||||
|
||||
const data = computed<CsvData>(() => {
|
||||
try {
|
||||
return parseCSV(props.content, columnSeparator.value);
|
||||
} catch (e) {
|
||||
console.error("Failed to parse CSV:", e);
|
||||
return { headers: [], rows: [] };
|
||||
}
|
||||
const selectedEncoding = ref("utf-8");
|
||||
|
||||
const parsed = ref<CsvData>({ headers: [], rows: [] });
|
||||
|
||||
const displayError = ref<string | null>(null);
|
||||
|
||||
const isEncodedContent = computed(() => {
|
||||
return props.content instanceof ArrayBuffer;
|
||||
});
|
||||
|
||||
const displayError = computed(() => {
|
||||
// External error takes priority (e.g., file too large)
|
||||
if (props.error) {
|
||||
return props.error;
|
||||
watchEffect(() => {
|
||||
if (props.content !== "" && columnSeparator.value.length > 0) {
|
||||
const content = isEncodedContent.value
|
||||
? decode(props.content as ArrayBuffer, selectedEncoding.value)
|
||||
: props.content;
|
||||
parse(
|
||||
content as string,
|
||||
{ delimiter: columnSeparator.value, skip_empty_lines: true },
|
||||
(error, output) => {
|
||||
if (error) {
|
||||
console.error("Failed to parse CSV:", error);
|
||||
parsed.value = { headers: [], rows: [] };
|
||||
displayError.value = t("files.csvLoadFailed", {
|
||||
error: error.toString(),
|
||||
});
|
||||
} else {
|
||||
parsed.value = {
|
||||
headers: output[0],
|
||||
rows: output.slice(1),
|
||||
};
|
||||
displayError.value = null;
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
// Check for parse errors
|
||||
if (
|
||||
props.content &&
|
||||
props.content.trim().length > 0 &&
|
||||
data.value.headers.length === 0
|
||||
) {
|
||||
return "Failed to parse CSV file";
|
||||
}
|
||||
return null;
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -213,10 +247,6 @@ const displayError = computed(() => {
|
||||
padding: 0.5rem;
|
||||
}
|
||||
|
||||
.csv-footer > :only-child {
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
.csv-info {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -230,18 +260,25 @@ const displayError = computed(() => {
|
||||
font-size: 0.875rem;
|
||||
}
|
||||
|
||||
.column-separator {
|
||||
.csv-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 0.25rem;
|
||||
}
|
||||
|
||||
.header-select {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
.column-separator > label {
|
||||
.header-select > label {
|
||||
font-size: small;
|
||||
text-align: end;
|
||||
max-width: 80px;
|
||||
}
|
||||
|
||||
.column-separator > select {
|
||||
.header-select > select {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,8 @@ export default {
|
||||
ja: "日本語",
|
||||
ko: "한국어",
|
||||
no: "Norsk",
|
||||
"nl-be": "Dutch (Belgium)",
|
||||
nl: "Nederlands (Nederland)",
|
||||
"nl-be": "Nederlands (België)",
|
||||
pl: "Polski",
|
||||
"pt-br": "Português (Brasil)",
|
||||
pt: "Português (Portugal)",
|
||||
|
||||
@@ -88,7 +88,8 @@
|
||||
"comma": "Comma (,)",
|
||||
"semicolon": "Semicolon (;)",
|
||||
"both": "Both (,) and (;)"
|
||||
}
|
||||
},
|
||||
"fileEncoding": "File Encoding"
|
||||
},
|
||||
"help": {
|
||||
"click": "حدد الملف أو المجلد",
|
||||
|
||||
@@ -88,7 +88,8 @@
|
||||
"comma": "Comma (,)",
|
||||
"semicolon": "Semicolon (;)",
|
||||
"both": "Both (,) and (;)"
|
||||
}
|
||||
},
|
||||
"fileEncoding": "File Encoding"
|
||||
},
|
||||
"help": {
|
||||
"click": "избери файл или директория",
|
||||
|
||||
@@ -88,7 +88,8 @@
|
||||
"comma": "Comma (,)",
|
||||
"semicolon": "Semicolon (;)",
|
||||
"both": "Both (,) and (;)"
|
||||
}
|
||||
},
|
||||
"fileEncoding": "File Encoding"
|
||||
},
|
||||
"help": {
|
||||
"click": "seleccionar fitxer o carpeta",
|
||||
|
||||
@@ -88,7 +88,8 @@
|
||||
"comma": "Comma (,)",
|
||||
"semicolon": "Semicolon (;)",
|
||||
"both": "Both (,) and (;)"
|
||||
}
|
||||
},
|
||||
"fileEncoding": "File Encoding"
|
||||
},
|
||||
"help": {
|
||||
"click": "vyberte soubor nebo adresář",
|
||||
|
||||
@@ -88,7 +88,8 @@
|
||||
"comma": "Komma (,)",
|
||||
"semicolon": "Semikolon (;)",
|
||||
"both": "Beides (,) und (;)"
|
||||
}
|
||||
},
|
||||
"fileEncoding": "File Encoding"
|
||||
},
|
||||
"help": {
|
||||
"click": "Datei oder Verzeichnis auswählen",
|
||||
|
||||
@@ -88,7 +88,8 @@
|
||||
"comma": "Comma (,)",
|
||||
"semicolon": "Semicolon (;)",
|
||||
"both": "Both (,) and (;)"
|
||||
}
|
||||
},
|
||||
"fileEncoding": "File Encoding"
|
||||
},
|
||||
"help": {
|
||||
"click": "επιλέξτε αρχείο ή φάκελο",
|
||||
|
||||
@@ -88,7 +88,8 @@
|
||||
"comma": "Comma (,)",
|
||||
"semicolon": "Semicolon (;)",
|
||||
"both": "Both (,) and (;)"
|
||||
}
|
||||
},
|
||||
"fileEncoding": "File Encoding"
|
||||
},
|
||||
"help": {
|
||||
"click": "select file or directory",
|
||||
|
||||
@@ -88,7 +88,8 @@
|
||||
"comma": "Comma (,)",
|
||||
"semicolon": "Semicolon (;)",
|
||||
"both": "Both (,) and (;)"
|
||||
}
|
||||
},
|
||||
"fileEncoding": "File Encoding"
|
||||
},
|
||||
"help": {
|
||||
"click": "seleccionar archivo o carpeta",
|
||||
|
||||
@@ -88,7 +88,8 @@
|
||||
"comma": "Comma (,)",
|
||||
"semicolon": "Semicolon (;)",
|
||||
"both": "Both (,) and (;)"
|
||||
}
|
||||
},
|
||||
"fileEncoding": "File Encoding"
|
||||
},
|
||||
"help": {
|
||||
"click": "انتخاب فایل یا پوشه",
|
||||
|
||||
@@ -88,7 +88,8 @@
|
||||
"comma": "Virgule (,)",
|
||||
"semicolon": "Point-virgule (;)",
|
||||
"both": "Les (,) et (;)"
|
||||
}
|
||||
},
|
||||
"fileEncoding": "File Encoding"
|
||||
},
|
||||
"help": {
|
||||
"click": "Sélectionner un fichier ou dossier",
|
||||
@@ -232,7 +233,7 @@
|
||||
"permissions": "Permissions",
|
||||
"permissionsHelp": "Vous pouvez définir l'utilisateur·ice comme étant administrateur·ice ou encore choisir les permissions individuellement. Si vous sélectionnez \"Administrateur·ice\", toutes les autres options seront automatiquement activées. La gestion des utilisateur·ices est un privilège que seul l'administrateur·ice possède.\n",
|
||||
"profileSettings": "Paramètres du profil",
|
||||
"redirectAfterCopyMove": "Redirect to destination after copy/move",
|
||||
"redirectAfterCopyMove": "Rediriger vers la destination après une copie/déplacement",
|
||||
"ruleExample1": "Bloque l'accès à tous les fichiers commençant par un point (comme par exemple .git, .gitignore) dans tous les dossiers.\n",
|
||||
"ruleExample2": "Bloque l'accès au fichier nommé \"Caddyfile\" à la racine du dossier utilisateur·ice.",
|
||||
"rules": "Règles",
|
||||
|
||||
@@ -88,7 +88,8 @@
|
||||
"comma": "Comma (,)",
|
||||
"semicolon": "Semicolon (;)",
|
||||
"both": "Both (,) and (;)"
|
||||
}
|
||||
},
|
||||
"fileEncoding": "File Encoding"
|
||||
},
|
||||
"help": {
|
||||
"click": "בחר קובץ או תיקייה",
|
||||
|
||||
@@ -88,7 +88,8 @@
|
||||
"comma": "Zarez (,)",
|
||||
"semicolon": "Točka zarez (;)",
|
||||
"both": "I (,) i (;)"
|
||||
}
|
||||
},
|
||||
"fileEncoding": "File Encoding"
|
||||
},
|
||||
"help": {
|
||||
"click": "odaberi datoteku ili mapu",
|
||||
|
||||
@@ -88,7 +88,8 @@
|
||||
"comma": "Comma (,)",
|
||||
"semicolon": "Semicolon (;)",
|
||||
"both": "Both (,) and (;)"
|
||||
}
|
||||
},
|
||||
"fileEncoding": "File Encoding"
|
||||
},
|
||||
"help": {
|
||||
"click": "mappa vagy fájl kijelölése",
|
||||
|
||||
@@ -17,6 +17,7 @@ import("dayjs/locale/it");
|
||||
import("dayjs/locale/ja");
|
||||
import("dayjs/locale/ko");
|
||||
import("dayjs/locale/nb");
|
||||
import("dayjs/locale/nl");
|
||||
import("dayjs/locale/nl-be");
|
||||
import("dayjs/locale/pl");
|
||||
import("dayjs/locale/pt-br");
|
||||
@@ -110,7 +111,6 @@ export function detectLocale() {
|
||||
case /^uk\b/.test(locale):
|
||||
locale = "uk";
|
||||
break;
|
||||
|
||||
case /^vi\b/.test(locale):
|
||||
locale = "vi";
|
||||
break;
|
||||
@@ -118,6 +118,9 @@ export function detectLocale() {
|
||||
case /^sv\b/.test(locale):
|
||||
locale = "sv";
|
||||
break;
|
||||
case /^nl\b/.test(locale):
|
||||
locale = "nl";
|
||||
break;
|
||||
case /^nl-be\b/.test(locale):
|
||||
locale = "nl-be";
|
||||
break;
|
||||
|
||||
@@ -88,7 +88,8 @@
|
||||
"comma": "Comma (,)",
|
||||
"semicolon": "Semicolon (;)",
|
||||
"both": "Both (,) and (;)"
|
||||
}
|
||||
},
|
||||
"fileEncoding": "File Encoding"
|
||||
},
|
||||
"help": {
|
||||
"click": "velja skjal eða möppu",
|
||||
|
||||
@@ -88,7 +88,8 @@
|
||||
"comma": "Comma (,)",
|
||||
"semicolon": "Semicolon (;)",
|
||||
"both": "Both (,) and (;)"
|
||||
}
|
||||
},
|
||||
"fileEncoding": "File Encoding"
|
||||
},
|
||||
"help": {
|
||||
"click": "seleziona un file o una cartella",
|
||||
|
||||
@@ -88,7 +88,8 @@
|
||||
"comma": "Comma (,)",
|
||||
"semicolon": "Semicolon (;)",
|
||||
"both": "Both (,) and (;)"
|
||||
}
|
||||
},
|
||||
"fileEncoding": "File Encoding"
|
||||
},
|
||||
"help": {
|
||||
"click": "ファイルやフォルダーを選択",
|
||||
|
||||
@@ -88,7 +88,8 @@
|
||||
"comma": "반점 (,)",
|
||||
"semicolon": "쌍반점 (;)",
|
||||
"both": "(,) 및 (;) 모두"
|
||||
}
|
||||
},
|
||||
"fileEncoding": "File Encoding"
|
||||
},
|
||||
"help": {
|
||||
"click": "파일 또는 디렉터리 선택",
|
||||
|
||||
@@ -88,7 +88,8 @@
|
||||
"comma": "Komats (,)",
|
||||
"semicolon": "Semikols (;)",
|
||||
"both": "Gan (,) gan (;)"
|
||||
}
|
||||
},
|
||||
"fileEncoding": "File Encoding"
|
||||
},
|
||||
"help": {
|
||||
"click": "atlasiet failu vai direktoriju",
|
||||
|
||||
@@ -88,7 +88,8 @@
|
||||
"comma": "Komats (,)",
|
||||
"semicolon": "Semikols (;)",
|
||||
"both": "Gan (,) gan (;)"
|
||||
}
|
||||
},
|
||||
"fileEncoding": "File Encoding"
|
||||
},
|
||||
"help": {
|
||||
"click": "atlasiet failu vai direktoriju",
|
||||
|
||||
@@ -88,7 +88,8 @@
|
||||
"comma": "Comma (,)",
|
||||
"semicolon": "Semicolon (;)",
|
||||
"both": "Both (,) and (;)"
|
||||
}
|
||||
},
|
||||
"fileEncoding": "File Encoding"
|
||||
},
|
||||
"help": {
|
||||
"click": "selecteer bestand of map",
|
||||
|
||||
@@ -0,0 +1,289 @@
|
||||
{
|
||||
"buttons": {
|
||||
"cancel": "Annuleren",
|
||||
"clear": "Wissen",
|
||||
"close": "Sluiten",
|
||||
"continue": "Doorgaan",
|
||||
"copy": "Kopiëren",
|
||||
"copyFile": "Bestand kopiëren",
|
||||
"copyToClipboard": "Kopiëren naar klembord",
|
||||
"copyDownloadLinkToClipboard": "Download-link kopiëren naar klembord",
|
||||
"create": "Aanmaken",
|
||||
"delete": "Verwijderen",
|
||||
"download": "Downloaden",
|
||||
"file": "Bestand",
|
||||
"folder": "Map",
|
||||
"fullScreen": "Volledig scherm wisselen",
|
||||
"hideDotfiles": "dot-bestanden verbergen",
|
||||
"info": "Info",
|
||||
"more": "Meer",
|
||||
"move": "Verplaatsen",
|
||||
"moveFile": "Bestand verplaatsen",
|
||||
"new": "Nieuw",
|
||||
"next": "Volgende",
|
||||
"ok": "OK",
|
||||
"permalink": "Permanente link verkrijgen",
|
||||
"previous": "Vorige",
|
||||
"preview": "Voorbeeld",
|
||||
"publish": "Publiceren",
|
||||
"rename": "Hernoemen",
|
||||
"replace": "Vervangen",
|
||||
"reportIssue": "Probleem melden",
|
||||
"save": "Opslaan",
|
||||
"schedule": "Plannen",
|
||||
"search": "Zoeken",
|
||||
"select": "Selecteren",
|
||||
"selectMultiple": "Meervoudige selectie",
|
||||
"share": "Delen",
|
||||
"shell": "Opdrachtvenster wisselen",
|
||||
"submit": "Indienen",
|
||||
"switchView": "Weergave wisselen",
|
||||
"toggleSidebar": "Zijbalk wisselen",
|
||||
"update": "Bijwerken",
|
||||
"upload": "Uploaden",
|
||||
"openFile": "Bestand openen",
|
||||
"discardChanges": "Weggooien",
|
||||
"stopSearch": "Stoppen met zoeken",
|
||||
"saveChanges": "Wijzigingen opslaan",
|
||||
"editAsText": "Als tekst bewerken",
|
||||
"increaseFontSize": "Lettertype vergroten",
|
||||
"decreaseFontSize": "Lettertype verkleinen"
|
||||
},
|
||||
"download": {
|
||||
"downloadFile": "Bestand downloaden",
|
||||
"downloadFolder": "Map downloaden",
|
||||
"downloadSelected": "Selectie downloaden"
|
||||
},
|
||||
"upload": {
|
||||
"abortUpload": "Weet u zeker dat u wilt afbreken?"
|
||||
},
|
||||
"errors": {
|
||||
"forbidden": "U hebt hier geen toegangsrechten.",
|
||||
"internal": "Er ging iets mis.",
|
||||
"notFound": "Deze locatie kan niet worden bereikt.",
|
||||
"connection": "De server kan niet worden bereikt."
|
||||
},
|
||||
"files": {
|
||||
"body": "Inoud",
|
||||
"closePreview": "Voorbeeld sluiten",
|
||||
"files": "Bestanden",
|
||||
"folders": "Mappen",
|
||||
"home": "Thuis",
|
||||
"lastModified": "Laatst aangepast",
|
||||
"loading": "Laden...",
|
||||
"lonely": "Het is hier wat leeg...",
|
||||
"metadata": "Metagegevens",
|
||||
"multipleSelectionEnabled": "Meervoudige selectie ingeschakeld",
|
||||
"name": "Naam",
|
||||
"size": "Grootte",
|
||||
"sortByLastModified": "Sorteren op laatst aangepast",
|
||||
"sortByName": "Sorteren op naam",
|
||||
"sortBySize": "Sorteren op grootte",
|
||||
"noPreview": "Geen voorbeeld beschikbaar voor dit bestand.",
|
||||
"csvTooLarge": "CSV-bestand is te groot voor voorbeeld (>5MB). Download het om het te bekijken.",
|
||||
"csvLoadFailed": "Laden van CSV-bestand is mislukt.",
|
||||
"showingRows": "{count} rij(en) weergeven",
|
||||
"columnSeparator": "Kolom-scheidingsteken",
|
||||
"csvSeparators": {
|
||||
"comma": "Komma (,)",
|
||||
"semicolon": "Puntkomma (;)",
|
||||
"both": "Beide (,) en (;)"
|
||||
},
|
||||
"fileEncoding": "File Encoding"
|
||||
},
|
||||
"help": {
|
||||
"click": "selecteer bestand of map",
|
||||
"ctrl": {
|
||||
"click": "selecteer meerdere bestanden of mappen",
|
||||
"f": "open zoekopdracht",
|
||||
"s": "sla een bestand op of download de huidige map"
|
||||
},
|
||||
"del": "verwijder geselecteerde items",
|
||||
"doubleClick": "open een bestand of map",
|
||||
"esc": "wis de selectie en/of sluit het opdrachtvenster",
|
||||
"f1": "deze informatie",
|
||||
"f2": "hernoem bestand",
|
||||
"help": "Hulp"
|
||||
},
|
||||
"login": {
|
||||
"createAnAccount": "Account aanmaken",
|
||||
"loginInstead": "Heeft al een account",
|
||||
"password": "Wachtwoord",
|
||||
"passwordConfirm": "Wachtwoord bevestigen",
|
||||
"passwordsDontMatch": "Wachtwoorden komen niet overeen",
|
||||
"signup": "Registeren",
|
||||
"submit": "Inloggen",
|
||||
"username": "Gebruikersnaam",
|
||||
"usernameTaken": "Gebruikersnaam reeds in gebruik",
|
||||
"wrongCredentials": "Inloggegevens zijn incorrect",
|
||||
"passwordTooShort": "Wachtwoord moet minstens {min} tekens bevatten",
|
||||
"logout_reasons": {
|
||||
"inactivity": "U bent uitgelogd vanwege inactiviteit."
|
||||
}
|
||||
},
|
||||
"permanent": "Permanent",
|
||||
"prompts": {
|
||||
"copy": "Kopiëren",
|
||||
"copyMessage": "Kies een locatie om uw bestanden te kopiëren:",
|
||||
"currentlyNavigating": "Navigeren op:",
|
||||
"deleteMessageMultiple": "Weet u zeker dat u {count} bestand(en) wilt verwijderen?",
|
||||
"deleteMessageSingle": "Weet u zeker dat u dit bestand/deze map wilt verwijderen?",
|
||||
"deleteMessageShare": "Weet u zeker dat u deze gedeelde map ({path}) wilt verwijderen?",
|
||||
"deleteUser": "Weet u zeker dat u deze gebruiker wilt verwijderen?",
|
||||
"deleteTitle": "Bestanden verwijderen",
|
||||
"displayName": "Weergavenaam:",
|
||||
"download": "Bestanden downloaden",
|
||||
"downloadMessage": "Kies het formaat dat u wilt downloaden.",
|
||||
"error": "Er ging iets fout",
|
||||
"fileInfo": "Bestandsinformatie",
|
||||
"filesSelected": "{count} geselecteerde bestanden.",
|
||||
"lastModified": "Laatst aangepast",
|
||||
"move": "Verplaatsen",
|
||||
"moveMessage": "Kies een nieuw Thuis voor uw bestand(en)/map(pen):",
|
||||
"newArchetype": "Maak een nieuw bericht op basis van een archetype. Uw bestand wordt aangemaakt in de inhoudsmap.",
|
||||
"newDir": "Nieuwe map",
|
||||
"newDirMessage": "Voer een naam in voor de nieuwe map.",
|
||||
"newFile": "Nieuw bestand",
|
||||
"newFileMessage": "Voer een naam in voor het nieuwe bestand.",
|
||||
"numberDirs": "Aantal mappen",
|
||||
"numberFiles": "Aantal bestanden",
|
||||
"rename": "Hernoemen",
|
||||
"renameMessage": "Voer een nieuwe naam in voor",
|
||||
"replace": "Vervangen",
|
||||
"replaceMessage": "Een van de bestanden die u probeert te uploaden, geeft conflicten i.v.m. de naamgeving. Wilt u de bestaande bestanden vervangen?\n",
|
||||
"schedule": "Plannen",
|
||||
"scheduleMessage": "Kies een datum en tijd om de publicatie van dit bericht in te plannen.",
|
||||
"show": "Weergeven",
|
||||
"size": "Grootte",
|
||||
"upload": "Uploaden",
|
||||
"uploadFiles": "{files} bestanden uploaden...",
|
||||
"uploadMessage": "Kies een optie bij de upload.",
|
||||
"optionalPassword": "Optioneel wachtwoord",
|
||||
"resolution": "Resolutie",
|
||||
"discardEditorChanges": "Weet u zeker dat u de door u aangebrachte wijzigingen wilt weggooien?"
|
||||
},
|
||||
"search": {
|
||||
"images": "Afbeeldingen",
|
||||
"music": "Muziek",
|
||||
"pdf": "PDF",
|
||||
"pressToSearch": "Druk op enter om te zoeken...",
|
||||
"search": "Zoeken...",
|
||||
"typeToSearch": "Typ om te zoeken...",
|
||||
"types": "Types",
|
||||
"video": "Video"
|
||||
},
|
||||
"settings": {
|
||||
"aceEditorTheme": "Ace editor-thema",
|
||||
"admin": "Admin",
|
||||
"administrator": "Beheerder",
|
||||
"allowCommands": "Opdrachten uitvoeren",
|
||||
"allowEdit": "Bestanden of mappen bewerken, hernoemen of verwijderen",
|
||||
"allowNew": "Nieuwe bestanden of mappen aanmaken",
|
||||
"allowPublish": "Nieuwe berichten en pagina's publiceren",
|
||||
"allowSignup": "Gebruikers toestaan om zich te registreren",
|
||||
"hideLoginButton": "De inlogknop verbergen van openbare pagina's",
|
||||
"avoidChanges": "(leeg laten om wijzigingen te voorkomen)",
|
||||
"branding": "Branding",
|
||||
"brandingDirectoryPath": "Pad naar map met Branding",
|
||||
"brandingHelp": "U kunt het uiterlijk van uw File Browser aanpassen door de naam te wijzigen, het logo te vervangen, aangepaste stijlen toe te voegen en zelfs externe links naar GitHub uit te schakelen.\nVoor meer informatie over custom branding, bekijk {0}.",
|
||||
"changePassword": "Wachtwoord wijzigen",
|
||||
"commandRunner": "Opdracht uitvoeren",
|
||||
"commandRunnerHelp": "Hier kunt u opdrachten instellen die worden uitgevoerd in de benoemde gebeurtenissen. Noteer één opdracht per regel. De omgevingsvariabelen {0} en {1} zijn beschikbaar, waarbij {0} relatief is ten opzichte van {1}. Raadpleeg {2} voor meer informatie over deze functie en de beschikbare omgevingsvariabelen.",
|
||||
"commandsUpdated": "Opdrachten bijgewerkt!",
|
||||
"createUserDir": "Maak bij het aanmaken van een nieuwe gebruiker automatisch een thuismap aan",
|
||||
"minimumPasswordLength": "Minimale wachtwoordlengte",
|
||||
"tusUploads": "Uploads in brokken",
|
||||
"tusUploadsHelp": "File Browser ondersteunt bestandsuploads in brokken, waardoor efficiënte, betrouwbare, hervatbare bestandsuploads kunnen worden verricht, zelfs over onbetrouwbare netwerken.",
|
||||
"tusUploadsChunkSize": "Geeft de maximale grootte van een verzoek aan (directe uploads worden gebruikt voor kleinere uploads). U kunt een geheel getal invoeren dat de bytegrootte aangeeft, of een tekenreeks zoals 10MB, 1GB enz.",
|
||||
"tusUploadsRetryCount": "Aantal nieuwe pogingen om uit te voeren als een deel niet kan worden geüpload.",
|
||||
"userHomeBasePath": "Basispad voor Thuismappen van de gebruikers",
|
||||
"userScopeGenerationPlaceholder": "Het bereik wordt automatisch gegenereeerd",
|
||||
"createUserHomeDirectory": "Thuismap voor de gebruiker aanmaken",
|
||||
"customStylesheet": "Aangepaste stylesheet",
|
||||
"defaultUserDescription": "Dit zijn de standaardinstellingen voor nieuwe gebruikers.",
|
||||
"disableExternalLinks": "Externe links uitschakelen (behalve documentatie)",
|
||||
"disableUsedDiskPercentage": "Grafiek van gebruikte schijfruimte uitschakelen",
|
||||
"documentation": "documentatie",
|
||||
"examples": "Voorbeelden",
|
||||
"executeOnShell": "Uitvoeren in opdrachtvenster",
|
||||
"executeOnShellDescription": "File Browser voert de opdrachten standaard uit door het rechtstreeks oproepen van hun hun binaire bestanden. Als u ze in plaats daarvan wilt uitvoeren in een opdrachtvenster (zoals Bash of PowerShell), kunt u dit hier definiëren met de vereiste argumenten en vlaggen. Zo wordt de opdracht die u uitvoert, toegevoegd als een argument. Dit is van toepassing op zowel gebruikersopdrachten als event-hooks.",
|
||||
"globalRules": "Dit is een algemene reeks toestaan/niet toestaan-regels welke van toepassing zijn op alle gebruikers. U kunt voor elke gebruiker specifieke regels definiëren om deze te overschrijven.",
|
||||
"globalSettings": "Algemene instellingen",
|
||||
"hideDotfiles": "dot-bestanden verbergen",
|
||||
"insertPath": "Pad invoegen",
|
||||
"insertRegex": "Regex-expressie invoegen",
|
||||
"instanceName": "Naam van de instantie",
|
||||
"language": "Taal",
|
||||
"lockPassword": "Voorkomen dat de gebruiker het wachtwoord wijzigt",
|
||||
"newPassword": "Uw nieuwe wachtwoord",
|
||||
"newPasswordConfirm": "Uw nieuwe wachtwoord bevestigen",
|
||||
"newUser": "Nieuwe gebruiker",
|
||||
"password": "Wachtwoord",
|
||||
"passwordUpdated": "Wachtwoord bijgewerkt!",
|
||||
"path": "Pad",
|
||||
"perm": {
|
||||
"create": "Bestanden en mappen aanmaken",
|
||||
"delete": "Bestanden en mappen verwijderen",
|
||||
"download": "Downloaden",
|
||||
"execute": "Opdrachten uitvoeren",
|
||||
"modify": "Bestanden bewerken",
|
||||
"rename": "Bestanden of mappen hernoemen of verplaatsen",
|
||||
"share": "Bestanden delen"
|
||||
},
|
||||
"permissions": "Machtigingen",
|
||||
"permissionsHelp": " kunt de gebruiker instellen als beheerder of de machtigingen afzonderlijk kiezen. Als u \"Beheerder\" selecteert, worden alle overige opties automatisch ingeschakeld. Het beheer van gebruikers blijft een privilege van een beheerder.\n",
|
||||
"profileSettings": "Profielinstellingen",
|
||||
"redirectAfterCopyMove": "Doorverwijzen naar bestemming na kopiëren/verplaatsen",
|
||||
"ruleExample1": "voorkomt de toegang tot dot-bestanden (zoals .git, .gitignore) in elke map.\n",
|
||||
"ruleExample2": "blokkeert de toegang tot het bestand met de naam Caddyfile in de hoofdmap van het bereik.",
|
||||
"rules": "Regels",
|
||||
"rulesHelp": "Hier kunt u voor deze specifieke gebruiker een reeks toestaan/niet toestaan-regels definiëren. De geblokkeerde bestanden verschijnen niet in de lijsten en zijn niet toegankelijk voor de gebruiker. Regex wordt ondersteund en paden zijn relatief ten opzichte van het bereik van gebruikers.\n",
|
||||
"scope": "Bereik",
|
||||
"setDateFormat": "Exacte datumformaat instellen",
|
||||
"settingsUpdated": "Instellingen bijgewerkt!",
|
||||
"shareDuration": "Duur van het delen",
|
||||
"shareManagement": "Beheer van gedeelde mappen en bestanden",
|
||||
"shareDeleted": "Delen opheffen!",
|
||||
"singleClick": "Bestanden en mappen met een enkele klik openen",
|
||||
"themes": {
|
||||
"default": "Systeem standaard",
|
||||
"dark": "Donker",
|
||||
"light": "Licht",
|
||||
"title": "Thema"
|
||||
},
|
||||
"user": "Gebruiker",
|
||||
"userCommands": "Opdrachten",
|
||||
"userCommandsHelp": "Een lijst met beschikbare opdrachten voor de gebruiker gescheiden door spaties. Voorbeeld:\n",
|
||||
"userCreated": "Gebruiker aangemaakt!",
|
||||
"userDefaults": "Standaardinstellingen van gebruiker",
|
||||
"userDeleted": "Gebruiker verwijderd!",
|
||||
"userManagement": "Gebruikers beheren",
|
||||
"userUpdated": "Gebruiker bijgewerkt!",
|
||||
"username": "Gebruikersnaam",
|
||||
"users": "Gebruikers",
|
||||
"currentPassword": "Uw huidige wachtwoord"
|
||||
},
|
||||
"sidebar": {
|
||||
"help": "Hulp",
|
||||
"hugoNew": "Hugo Nieuw",
|
||||
"login": "Inloggen",
|
||||
"logout": "Uitloggen",
|
||||
"myFiles": "Mijn bestanden",
|
||||
"newFile": "Nieuw bestand",
|
||||
"newFolder": "Nieuwe map",
|
||||
"preview": "Voorbeeld",
|
||||
"settings": "Instellingen",
|
||||
"signup": "Registeren",
|
||||
"siteSettings": "Site-instellingen"
|
||||
},
|
||||
"success": {
|
||||
"linkCopied": "Link gekopieerd!"
|
||||
},
|
||||
"time": {
|
||||
"days": "Dagen",
|
||||
"hours": "Uren",
|
||||
"minutes": "Minuten",
|
||||
"seconds": "Seconden",
|
||||
"unit": "Tijdseenheid"
|
||||
}
|
||||
}
|
||||
@@ -88,7 +88,8 @@
|
||||
"comma": "Comma (,)",
|
||||
"semicolon": "Semicolon (;)",
|
||||
"both": "Both (,) and (;)"
|
||||
}
|
||||
},
|
||||
"fileEncoding": "File Encoding"
|
||||
},
|
||||
"help": {
|
||||
"click": "velg fil eller katalog",
|
||||
|
||||
@@ -88,7 +88,8 @@
|
||||
"comma": "Przecinek (,)",
|
||||
"semicolon": "Średnik (;)",
|
||||
"both": "Zarówno (,), jak i (;)"
|
||||
}
|
||||
},
|
||||
"fileEncoding": "File Encoding"
|
||||
},
|
||||
"help": {
|
||||
"click": "zaznacz plik lub folder",
|
||||
|
||||
@@ -88,7 +88,8 @@
|
||||
"comma": "Comma (,)",
|
||||
"semicolon": "Semicolon (;)",
|
||||
"both": "Both (,) and (;)"
|
||||
}
|
||||
},
|
||||
"fileEncoding": "File Encoding"
|
||||
},
|
||||
"help": {
|
||||
"click": "selecionar pasta ou arquivo",
|
||||
|
||||
@@ -88,7 +88,8 @@
|
||||
"comma": "Comma (,)",
|
||||
"semicolon": "Semicolon (;)",
|
||||
"both": "Both (,) and (;)"
|
||||
}
|
||||
},
|
||||
"fileEncoding": "File Encoding"
|
||||
},
|
||||
"help": {
|
||||
"click": "selecionar pasta ou ficheiro",
|
||||
|
||||
@@ -88,7 +88,8 @@
|
||||
"comma": "Comma (,)",
|
||||
"semicolon": "Semicolon (;)",
|
||||
"both": "Both (,) and (;)"
|
||||
}
|
||||
},
|
||||
"fileEncoding": "File Encoding"
|
||||
},
|
||||
"help": {
|
||||
"click": "alege fișier sau director",
|
||||
|
||||
@@ -88,7 +88,8 @@
|
||||
"comma": "Запятая (,)",
|
||||
"semicolon": "Точка с запятой (;)",
|
||||
"both": "Оба варианта — (,) и (;)"
|
||||
}
|
||||
},
|
||||
"fileEncoding": "File Encoding"
|
||||
},
|
||||
"help": {
|
||||
"click": "выбрать файл или каталог",
|
||||
|
||||
@@ -88,7 +88,8 @@
|
||||
"comma": "Comma (,)",
|
||||
"semicolon": "Semicolon (;)",
|
||||
"both": "Both (,) and (;)"
|
||||
}
|
||||
},
|
||||
"fileEncoding": "File Encoding"
|
||||
},
|
||||
"help": {
|
||||
"click": "vyberie súbor alebo priečinok",
|
||||
|
||||
@@ -88,7 +88,8 @@
|
||||
"comma": "Comma (,)",
|
||||
"semicolon": "Semicolon (;)",
|
||||
"both": "Both (,) and (;)"
|
||||
}
|
||||
},
|
||||
"fileEncoding": "File Encoding"
|
||||
},
|
||||
"help": {
|
||||
"click": "välj fil eller mapp",
|
||||
|
||||
@@ -88,7 +88,8 @@
|
||||
"comma": "Comma (,)",
|
||||
"semicolon": "Semicolon (;)",
|
||||
"both": "Both (,) and (;)"
|
||||
}
|
||||
},
|
||||
"fileEncoding": "File Encoding"
|
||||
},
|
||||
"help": {
|
||||
"click": "dosya veya klasör seçin",
|
||||
|
||||
@@ -88,7 +88,8 @@
|
||||
"comma": "Comma (,)",
|
||||
"semicolon": "Semicolon (;)",
|
||||
"both": "Both (,) and (;)"
|
||||
}
|
||||
},
|
||||
"fileEncoding": "File Encoding"
|
||||
},
|
||||
"help": {
|
||||
"click": "вибрати файл чи каталог",
|
||||
|
||||
@@ -88,7 +88,8 @@
|
||||
"comma": "Comma (,)",
|
||||
"semicolon": "Semicolon (;)",
|
||||
"both": "Both (,) and (;)"
|
||||
}
|
||||
},
|
||||
"fileEncoding": "File Encoding"
|
||||
},
|
||||
"help": {
|
||||
"click": "chọn tập tin hoặc thư mục",
|
||||
|
||||
@@ -88,7 +88,8 @@
|
||||
"comma": "逗号 (,)",
|
||||
"semicolon": "分号 (;)",
|
||||
"both": "逗号 (,) 和分号 (;)"
|
||||
}
|
||||
},
|
||||
"fileEncoding": "File Encoding"
|
||||
},
|
||||
"help": {
|
||||
"click": "选择文件或文件夹",
|
||||
@@ -232,7 +233,7 @@
|
||||
"permissions": "权限",
|
||||
"permissionsHelp": "你可以将该用户设置为管理员或单独选择各项权限。如果你选择了“管理员”,则其他的选项会被自动选中,同时该用户可以管理其他用户。\n",
|
||||
"profileSettings": "个人设置",
|
||||
"redirectAfterCopyMove": "Redirect to destination after copy/move",
|
||||
"redirectAfterCopyMove": "复制/移动后转到目标位置",
|
||||
"ruleExample1": "阻止用户访问所有文件夹下任何以 . 开头的文件(隐藏文件, 例如: .git, .gitignore)。\n",
|
||||
"ruleExample2": "阻止用户访问其目录范围的根目录下名为 Caddyfile 的文件。",
|
||||
"rules": "规则",
|
||||
|
||||
@@ -88,7 +88,8 @@
|
||||
"comma": "Comma (,)",
|
||||
"semicolon": "Semicolon (;)",
|
||||
"both": "Both (,) and (;)"
|
||||
}
|
||||
},
|
||||
"fileEncoding": "File Encoding"
|
||||
},
|
||||
"help": {
|
||||
"click": "選擇檔案或目錄",
|
||||
|
||||
Vendored
+6
@@ -21,6 +21,7 @@ interface Resource extends ResourceBase {
|
||||
index: number;
|
||||
subtitles?: string[];
|
||||
content?: string;
|
||||
rawContent?: ArrayBuffer;
|
||||
}
|
||||
|
||||
interface ResourceItem extends ResourceBase {
|
||||
@@ -57,3 +58,8 @@ interface BreadCrumb {
|
||||
name: string;
|
||||
url: string;
|
||||
}
|
||||
|
||||
interface CsvData {
|
||||
headers: string[];
|
||||
rows: string[][];
|
||||
}
|
||||
|
||||
@@ -1,64 +0,0 @@
|
||||
export interface CsvData {
|
||||
headers: string[];
|
||||
rows: string[][];
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse CSV content into headers and rows
|
||||
* Supports quoted fields and handles commas within quotes
|
||||
*/
|
||||
export function parseCSV(
|
||||
content: string,
|
||||
columnSeparator: Array<string>
|
||||
): CsvData {
|
||||
if (!content || content.trim().length === 0) {
|
||||
return { headers: [], rows: [] };
|
||||
}
|
||||
|
||||
const lines = content.split(/\r?\n/);
|
||||
const result: string[][] = [];
|
||||
|
||||
for (const line of lines) {
|
||||
if (line.trim().length === 0) continue;
|
||||
|
||||
const row: string[] = [];
|
||||
let currentField = "";
|
||||
let inQuotes = false;
|
||||
|
||||
for (let i = 0; i < line.length; i++) {
|
||||
const char = line[i];
|
||||
const nextChar = line[i + 1];
|
||||
|
||||
if (char === '"') {
|
||||
if (inQuotes && nextChar === '"') {
|
||||
// Escaped quote
|
||||
currentField += '"';
|
||||
i++; // Skip next quote
|
||||
} else {
|
||||
// Toggle quote state
|
||||
inQuotes = !inQuotes;
|
||||
}
|
||||
} else if (columnSeparator.includes(char) && !inQuotes) {
|
||||
// Field separator
|
||||
row.push(currentField);
|
||||
currentField = "";
|
||||
} else {
|
||||
currentField += char;
|
||||
}
|
||||
}
|
||||
|
||||
// Add the last field
|
||||
row.push(currentField);
|
||||
result.push(row);
|
||||
}
|
||||
|
||||
if (result.length === 0) {
|
||||
return { headers: [], rows: [] };
|
||||
}
|
||||
|
||||
// First row is headers
|
||||
const headers = result[0];
|
||||
const rows = result.slice(1);
|
||||
|
||||
return { headers, rows };
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
export const availableEncodings = [
|
||||
"utf-8",
|
||||
"ibm866",
|
||||
"iso-8859-2",
|
||||
"iso-8859-3",
|
||||
"iso-8859-4",
|
||||
"iso-8859-5",
|
||||
"iso-8859-6",
|
||||
"iso-8859-7",
|
||||
"iso-8859-8",
|
||||
"iso-8859-8-i",
|
||||
"iso-8859-10",
|
||||
"iso-8859-13",
|
||||
"iso-8859-14",
|
||||
"iso-8859-15",
|
||||
"iso-8859-16",
|
||||
"koi8-r",
|
||||
"koi8-u",
|
||||
"macintosh",
|
||||
"windows-874",
|
||||
"windows-1250",
|
||||
"windows-1251",
|
||||
"windows-1252",
|
||||
"windows-1253",
|
||||
"windows-1254",
|
||||
"windows-1255",
|
||||
"windows-1256",
|
||||
"windows-1257",
|
||||
"windows-1258",
|
||||
"x-mac-cyrillic",
|
||||
"gbk",
|
||||
"gb18030",
|
||||
"big5",
|
||||
"euc-jp",
|
||||
"iso-2022-jp",
|
||||
"shift_jis",
|
||||
"euc-kr",
|
||||
"utf-16be",
|
||||
"utf-16le",
|
||||
];
|
||||
|
||||
export function decode(content: ArrayBuffer, encoding: string): string {
|
||||
const decoder = new TextDecoder(encoding);
|
||||
return decoder.decode(content);
|
||||
}
|
||||
|
||||
export function isEncodableResponse(url: string): boolean {
|
||||
const extensions = [".csv"];
|
||||
|
||||
if (typeof TextDecoder === "undefined") {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (const extension of extensions) {
|
||||
if (url.endsWith(extension)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
export async function makeRawResource(
|
||||
res: Response,
|
||||
url: string
|
||||
): Promise<Resource> {
|
||||
const buffer = await res.arrayBuffer();
|
||||
return {
|
||||
items: [],
|
||||
numDirs: 0,
|
||||
numFiles: 0,
|
||||
sorting: {} as Sorting,
|
||||
index: 0,
|
||||
extension: getExtension(url),
|
||||
isDir: false,
|
||||
isSymlink: false,
|
||||
path: url,
|
||||
size: buffer.byteLength,
|
||||
modified: new Date().toISOString(),
|
||||
name: url.split("/").pop() || "",
|
||||
type: "text",
|
||||
mode: 0,
|
||||
url: `/files${url}`,
|
||||
rawContent: buffer,
|
||||
content: decode(buffer, "utf-8"),
|
||||
};
|
||||
}
|
||||
|
||||
function getExtension(url: string): string {
|
||||
const lastDotIndex = url.lastIndexOf(".");
|
||||
if (lastDotIndex === -1) {
|
||||
return "";
|
||||
}
|
||||
return url.substring(lastDotIndex);
|
||||
}
|
||||
@@ -171,25 +171,19 @@ onMounted(() => {
|
||||
`https://cdn.jsdelivr.net/npm/ace-builds@${ace_version}/src-min-noconflict/`
|
||||
);
|
||||
|
||||
editor.value = ace.edit("editor", {
|
||||
value: fileContent,
|
||||
showPrintMargin: false,
|
||||
readOnly: fileStore.req?.type === "textImmutable",
|
||||
theme: getEditorTheme(authStore.user?.aceEditorTheme ?? ""),
|
||||
mode: modelist.getModeForPath(fileStore.req!.name).mode,
|
||||
wrap: true,
|
||||
enableBasicAutocompletion: true,
|
||||
enableLiveAutocompletion: true,
|
||||
enableSnippets: true,
|
||||
});
|
||||
|
||||
editor.value.setFontSize(fontSize.value);
|
||||
editor.value.focus();
|
||||
|
||||
editor.value.getSelection().on("changeSelection", () => {
|
||||
isSelectionEmpty.value =
|
||||
editor.value == null || editor.value.getSelectedText().length == 0;
|
||||
});
|
||||
if (!layoutStore.loading) {
|
||||
initEditor(fileContent);
|
||||
} else {
|
||||
const unwatch = watchEffect(() => {
|
||||
// Initialize editor when layout is loaded
|
||||
if (!layoutStore.loading) {
|
||||
setTimeout(() => {
|
||||
initEditor(fileContent);
|
||||
unwatch();
|
||||
}, 50);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
@@ -218,6 +212,23 @@ onBeforeRouteUpdate((to, from, next) => {
|
||||
});
|
||||
});
|
||||
|
||||
const initEditor = (fileContent: string) => {
|
||||
editor.value = ace.edit("editor", {
|
||||
value: fileContent,
|
||||
showPrintMargin: false,
|
||||
readOnly: fileStore.req?.type === "textImmutable",
|
||||
theme: getEditorTheme(authStore.user?.aceEditorTheme ?? ""),
|
||||
mode: modelist.getModeForPath(fileStore.req!.name).mode,
|
||||
wrap: true,
|
||||
enableBasicAutocompletion: true,
|
||||
enableLiveAutocompletion: true,
|
||||
enableSnippets: true,
|
||||
});
|
||||
|
||||
editor.value.setFontSize(fontSize.value);
|
||||
editor.value.focus();
|
||||
};
|
||||
|
||||
const keyEvent = (event: KeyboardEvent) => {
|
||||
if (event.code === "Escape") {
|
||||
close();
|
||||
|
||||
@@ -253,7 +253,7 @@ const hoverNav = ref<boolean>(false);
|
||||
const autoPlay = ref<boolean>(false);
|
||||
const previousRaw = ref<string>("");
|
||||
const nextRaw = ref<string>("");
|
||||
const csvContent = ref<string>("");
|
||||
const csvContent = ref<ArrayBuffer | string>("");
|
||||
const csvError = ref<string>("");
|
||||
|
||||
const player = ref<HTMLVideoElement | HTMLAudioElement | null>(null);
|
||||
@@ -393,7 +393,11 @@ const updatePreview = async () => {
|
||||
if (fileStore.req.size > CSV_MAX_SIZE) {
|
||||
csvError.value = t("files.csvTooLarge");
|
||||
} else {
|
||||
csvContent.value = fileStore.req.content ?? "";
|
||||
if (fileStore.req.rawContent != null) {
|
||||
csvContent.value = fileStore.req.rawContent;
|
||||
} else {
|
||||
csvContent.value = fileStore.req.content ?? "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -25,9 +25,9 @@ require (
|
||||
github.com/spf13/viper v1.21.0
|
||||
github.com/stretchr/testify v1.11.1
|
||||
github.com/tomasen/realip v0.0.0-20180522021738-f0c99a92ddce
|
||||
golang.org/x/crypto v0.47.0
|
||||
golang.org/x/image v0.35.0
|
||||
golang.org/x/text v0.33.0
|
||||
golang.org/x/crypto v0.48.0
|
||||
golang.org/x/image v0.36.0
|
||||
golang.org/x/text v0.34.0
|
||||
gopkg.in/natefinch/lumberjack.v2 v2.2.1
|
||||
gopkg.in/yaml.v3 v3.0.1
|
||||
)
|
||||
@@ -76,9 +76,9 @@ require (
|
||||
go.etcd.io/bbolt v1.4.3 // indirect
|
||||
go.yaml.in/yaml/v3 v3.0.4 // indirect
|
||||
go4.org v0.0.0-20230225012048-214862532bf5 // indirect
|
||||
golang.org/x/net v0.48.0 // indirect
|
||||
golang.org/x/net v0.49.0 // indirect
|
||||
golang.org/x/sync v0.19.0 // indirect
|
||||
golang.org/x/sys v0.40.0 // indirect
|
||||
golang.org/x/sys v0.41.0 // indirect
|
||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
|
||||
gopkg.in/yaml.v2 v2.4.0 // indirect
|
||||
)
|
||||
|
||||
@@ -276,8 +276,8 @@ golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8U
|
||||
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
||||
golang.org/x/crypto v0.47.0 h1:V6e3FRj+n4dbpw86FJ8Fv7XVOql7TEwpHapKoMJ/GO8=
|
||||
golang.org/x/crypto v0.47.0/go.mod h1:ff3Y9VzzKbwSSEzWqJsJVBnWmRwRSHt/6Op5n9bQc4A=
|
||||
golang.org/x/crypto v0.48.0 h1:/VRzVqiRSggnhY7gNRxPauEQ5Drw9haKdM0jqfcCFts=
|
||||
golang.org/x/crypto v0.48.0/go.mod h1:r0kV5h3qnFPlQnBSrULhlsRfryS2pmewsg+XfMgkVos=
|
||||
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
|
||||
@@ -289,8 +289,8 @@ golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EH
|
||||
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
|
||||
golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
|
||||
golang.org/x/image v0.0.0-20191009234506-e7c1f5e7dbb8/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
|
||||
golang.org/x/image v0.35.0 h1:LKjiHdgMtO8z7Fh18nGY6KDcoEtVfsgLDPeLyguqb7I=
|
||||
golang.org/x/image v0.35.0/go.mod h1:MwPLTVgvxSASsxdLzKrl8BRFuyqMyGhLwmC+TO1Sybk=
|
||||
golang.org/x/image v0.36.0 h1:Iknbfm1afbgtwPTmHnS2gTM/6PPZfH+z2EFuOkSbqwc=
|
||||
golang.org/x/image v0.36.0/go.mod h1:YsWD2TyyGKiIX1kZlu9QfKIsQ4nAAK9bdgdrIsE7xy4=
|
||||
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
|
||||
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
|
||||
golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
|
||||
@@ -329,8 +329,8 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v
|
||||
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
|
||||
golang.org/x/net v0.0.0-20221002022538-bcab6841153b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk=
|
||||
golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
|
||||
golang.org/x/net v0.48.0 h1:zyQRTTrjc33Lhh0fBgT/H3oZq9WuvRR5gPC70xpDiQU=
|
||||
golang.org/x/net v0.48.0/go.mod h1:+ndRgGjkh8FGtu1w1FGbEC31if4VrNVMuKTgcAAnQRY=
|
||||
golang.org/x/net v0.49.0 h1:eeHFmOGUTtaaPSGNmjBKpbng9MulQsJURQUAfUwY++o=
|
||||
golang.org/x/net v0.49.0/go.mod h1:/ysNB2EvaqvesRkuLAyjI1ycPZlQHM3q01F02UY/MV8=
|
||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
@@ -370,8 +370,8 @@ golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBc
|
||||
golang.org/x/sys v0.0.0-20220928140112-f11e5e49a4ec/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.40.0 h1:DBZZqJ2Rkml6QMQsZywtnjnnGvHza6BTfYFWY9kjEWQ=
|
||||
golang.org/x/sys v0.40.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
|
||||
golang.org/x/sys v0.41.0 h1:Ivj+2Cp/ylzLiEU89QhWblYnOE9zerudt9Ftecq2C6k=
|
||||
golang.org/x/sys v0.41.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
||||
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
|
||||
@@ -382,8 +382,8 @@ golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
|
||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
|
||||
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
|
||||
golang.org/x/text v0.33.0 h1:B3njUFyqtHDUI5jMn1YIr5B0IE2U0qck04r6d4KPAxE=
|
||||
golang.org/x/text v0.33.0/go.mod h1:LuMebE6+rBincTi9+xWTY8TztLzKHc/9C1uBCG27+q8=
|
||||
golang.org/x/text v0.34.0 h1:oL/Qq0Kdaqxa1KbNeMKwQq0reLCCaFtqu2eNuSeNHbk=
|
||||
golang.org/x/text v0.34.0/go.mod h1:homfLqTYRFyVYemLBFl5GgL/DWEiH5wcsQ5gSh1yziA=
|
||||
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
|
||||
@@ -35,11 +35,6 @@ func NewHandler(
|
||||
})
|
||||
index, static := getStaticHandlers(store, server, assetsFs)
|
||||
|
||||
// NOTE: This fixes the issue where it would redirect if people did not put a
|
||||
// trailing slash in the end. I hate this decision since this allows some awful
|
||||
// URLs https://www.gorillatoolkit.org/pkg/mux#Router.SkipClean
|
||||
r = r.SkipClean(true)
|
||||
|
||||
monkey := func(fn handleFunc, prefix string) http.Handler {
|
||||
return handle(fn, prefix, store, server)
|
||||
}
|
||||
|
||||
@@ -36,10 +36,31 @@ var resourceGetHandler = withUser(func(w http.ResponseWriter, r *http.Request, d
|
||||
return errToStatus(err), err
|
||||
}
|
||||
|
||||
encoding := r.Header.Get("X-Encoding")
|
||||
if file.IsDir {
|
||||
file.Sorting = d.user.Sorting
|
||||
file.ApplySort()
|
||||
return renderJSON(w, r, file)
|
||||
} else if encoding == "true" {
|
||||
if file.Type != "text" {
|
||||
return http.StatusUnsupportedMediaType, fmt.Errorf("file is not a text file")
|
||||
}
|
||||
|
||||
f, err := d.user.Fs.Open(r.URL.Path)
|
||||
if err != nil {
|
||||
return errToStatus(err), err
|
||||
}
|
||||
defer f.Close()
|
||||
|
||||
data, err := io.ReadAll(f)
|
||||
if err != nil {
|
||||
return http.StatusInternalServerError, err
|
||||
}
|
||||
|
||||
w.Header().Set("Content-Type", "application/octet-stream")
|
||||
w.WriteHeader(http.StatusOK)
|
||||
_, err = w.Write(data)
|
||||
return 0, err
|
||||
}
|
||||
|
||||
if checksum := r.URL.Query().Get("checksum"); checksum != "" {
|
||||
|
||||
+23
-5
@@ -5,6 +5,8 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"io/fs"
|
||||
"io"
|
||||
"compress/gzip"
|
||||
"log"
|
||||
"net/http"
|
||||
"os"
|
||||
@@ -144,16 +146,32 @@ func getStaticHandlers(store *storage.Storage, server *settings.Server, assetsFs
|
||||
return 0, nil
|
||||
}
|
||||
|
||||
fileContents, err := fs.ReadFile(assetsFs, r.URL.Path+".gz")
|
||||
f, err := assetsFs.Open(r.URL.Path + ".gz")
|
||||
if err != nil {
|
||||
return http.StatusNotFound, err
|
||||
}
|
||||
defer f.Close()
|
||||
|
||||
w.Header().Set("Content-Encoding", "gzip")
|
||||
w.Header().Set("Content-Type", "application/javascript; charset=utf-8")
|
||||
acceptEncoding := r.Header.Get("Accept-Encoding")
|
||||
if strings.Contains(acceptEncoding, "gzip") {
|
||||
w.Header().Set("Content-Encoding", "gzip")
|
||||
w.Header().Set("Content-Type", "application/javascript; charset=utf-8")
|
||||
|
||||
if _, err := w.Write(fileContents); err != nil {
|
||||
return http.StatusInternalServerError, err
|
||||
if _, err := io.Copy(w, f); err != nil {
|
||||
return http.StatusInternalServerError, err
|
||||
}
|
||||
} else {
|
||||
gzReader, err := gzip.NewReader(f)
|
||||
if err != nil {
|
||||
return http.StatusInternalServerError, err
|
||||
}
|
||||
defer gzReader.Close()
|
||||
|
||||
w.Header().Set("Content-Type", "application/javascript; charset=utf-8")
|
||||
|
||||
if _, err := io.Copy(w, gzReader); err != nil {
|
||||
return http.StatusInternalServerError, err
|
||||
}
|
||||
}
|
||||
|
||||
return 0, nil
|
||||
|
||||
+2
-1
@@ -7,6 +7,7 @@ import (
|
||||
"net/http"
|
||||
"sort"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/gorilla/mux"
|
||||
"golang.org/x/text/cases"
|
||||
@@ -190,7 +191,7 @@ var userPutHandler = withSelfOrAdmin(func(w http.ResponseWriter, r *http.Request
|
||||
}
|
||||
|
||||
for _, field := range req.Which {
|
||||
if _, ok := sensibleFields[field]; ok {
|
||||
if _, ok := sensibleFields[strings.ToLower(field)]; ok {
|
||||
if !users.CheckPwd(req.CurrentPassword, d.user.Password) {
|
||||
return http.StatusBadRequest, fberrors.ErrCurrentPasswordIncorrect
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
//nolint:revive
|
||||
package version
|
||||
|
||||
var (
|
||||
|
||||
+115
-1
@@ -40,7 +40,121 @@ Where `X-My-Header` is the HTTP header provided by your proxy with the username.
|
||||
>
|
||||
> File Browser will blindly trust the provided header. If the proxy can be bypassed, an attacker could simply attach the header and get admin access.
|
||||
|
||||
### No Authentication
|
||||
## Hook Authentication
|
||||
|
||||
The Hook Authentication method in FileBrowser allows developers to delegate user authentication to an external script or program. Instead of validating credentials internally, FileBrowser sends the username and password to a custom command defined by the administrator. This command receives the credentials through environment variables and returns key‑value pairs indicating whether the user should be authenticated, blocked, or passed through.
|
||||
|
||||
The hook’s output controls user permissions, scope, locale, and other attributes, making it a powerful and extensible authentication mechanism.
|
||||
|
||||
For example, the following code delegates filebrowser authentication to a PowerShell script on Windows. You can configure any command (for example, a script in Python, Node.js, etc.).
|
||||
|
||||
```sh
|
||||
filebrowser config set --auth.method=hook --auth.command="powershell.exe -File C:\route\to\your\script\auth.ps1"
|
||||
```
|
||||
|
||||
This is the code for the auth.ps1 script
|
||||
|
||||
```sh
|
||||
param()
|
||||
|
||||
# Get FileBrowser credentials from environment variables
|
||||
$username = $env:USERNAME
|
||||
$password = $env:PASSWORD
|
||||
|
||||
# Users dictionary (for testing purposes only)
|
||||
$users = @{
|
||||
"admin" = "kideW48v7-SdE*"
|
||||
"test" = "2sDd3-etrytñK"
|
||||
}
|
||||
|
||||
# Check if the user exists in the dictionary and verify the password
|
||||
if ($users.ContainsKey($username) -and $users[$username] -eq $password) {
|
||||
|
||||
# Successful authentication
|
||||
Write-Output "hook.action=auth" # Hook action (in this case, "auth", is required for successful authentication)
|
||||
|
||||
Write-Output "user.perm.admin=true" # Set admin role (all permissions)
|
||||
#You can also define specific permissions like this:
|
||||
Write-Output "user.perm.execute=true"
|
||||
Write-Output "user.perm.create=true"
|
||||
Write-Output "user.perm.rename=true"
|
||||
Write-Output "user.perm.modify=true"
|
||||
Write-Output "user.perm.delete=true"
|
||||
Write-Output "user.perm.share=true"
|
||||
Write-Output "user.perm.download=true"
|
||||
|
||||
Write-Output "user.locale=es" # Set language
|
||||
Write-Output "user.viewMode=list" # Set view mode
|
||||
Write-Output "user.scope=/" # Set FileBrowser scope
|
||||
Write-Output "user.singleClick=true" # Set single click user configuration
|
||||
Write-Output "user.hideDotfiles=false" # Set hide dot files user configuration
|
||||
|
||||
#Set other configuration
|
||||
} else {
|
||||
# Block authentication
|
||||
Write-Output "hook.action=block"
|
||||
}
|
||||
```
|
||||
|
||||
### Hook Output Format
|
||||
|
||||
A hook authentication script must output a series of key–value pairs, one per line, using the format:
|
||||
|
||||
```
|
||||
key=value
|
||||
```
|
||||
|
||||
FileBrowser reads these lines and applies the corresponding authentication action and user configuration.
|
||||
|
||||
#### Required Fields
|
||||
|
||||
The hook must output one of the following actions:
|
||||
|
||||
| Key | Description |
|
||||
|--------|------------ |
|
||||
| hook.action=auth | Authenticates the user. FileBrowser will create or update the user if needed. |
|
||||
| hook.action=block | Rejects authentication. The login attempt fails. |
|
||||
| hook.action=pass | Delegates authentication to FileBrowser’s internal password validation. |
|
||||
|
||||
For most custom authentication flows, auth or block are used.
|
||||
|
||||
Example of a successful authentication:
|
||||
|
||||
```sh
|
||||
hook.action=auth
|
||||
```
|
||||
|
||||
#### Optional User Fields
|
||||
|
||||
When `hook.action=auth` is returned, the hook may also define additional user attributes. These fields override FileBrowser defaults and allow full customization of the authenticated user.
|
||||
|
||||
1. Permissions
|
||||
```
|
||||
user.perm.admin=true
|
||||
user.perm.execute=true
|
||||
user.perm.create=true
|
||||
user.perm.rename=true
|
||||
user.perm.modify=true
|
||||
user.perm.delete=true
|
||||
user.perm.share=true
|
||||
user.perm.download=true
|
||||
```
|
||||
> Setting user.perm.admin=true automatically enables all permissions.
|
||||
|
||||
2. User Interface and Behavior
|
||||
```
|
||||
user.locale=es
|
||||
user.viewMode=list
|
||||
user.singleClick=true
|
||||
user.hideDotfiles=false
|
||||
```
|
||||
|
||||
3. User Scope
|
||||
```
|
||||
user.scope=/
|
||||
```
|
||||
|
||||
## No Authentication
|
||||
|
||||
We also provide a no authentication mechanism for users that want to use File Browser privately such in a home network. By setting this authentication method, the user with **id 1** will be used as the default users. Creating more users won't have any effect.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user