Compare commits

..
27 Commits
Author SHA1 Message Date
Henrique Dias 7b16e2de90 chore(release): 2.60.0 2026-02-21 18:18:55 +01:00
renovate[bot] 2470b9eb69 chore(deps): update all non-major dependencies (#5780)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-02-21 18:17:51 +01:00
transifex-integration[bot] 9940bdd663 feat: Updates for project File Browser (#5764)
Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2026-02-21 18:12:43 +01:00
Ariel Leyva 200d501547 fix: modal lifecycle issues, multiple modals, new directory creation and discard changes behavior (#5773) 2026-02-21 18:12:10 +01:00
Ariel Leyva 3169a14a4d fix: always show separators and encoding list in the CSV viewer (#5774) 2026-02-21 18:11:50 +01:00
Henrique Dias 7e78ad97ad chore(release): 2.59.0 2026-02-15 13:54:23 +01:00
NN708 0467326d5c fix: render equations in markdown preview (#5745) 2026-02-15 13:53:36 +01:00
transifex-integration[bot] 63a76ef18c feat: Updates for project File Browser (#5760)
Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2026-02-15 13:28:37 +01:00
renovate[bot] 3cad9a2b0e chore(deps): update dependency eslint to v10 (#5748)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-02-15 13:28:26 +01:00
Marek Baczyński 804b14b698 feat: add 'Open direct' button to images (#5678) 2026-02-15 12:46:39 +01:00
Henrique Dias 95e6ed75a7 chore(release): 2.58.0 2026-02-14 08:42:21 +01:00
Henrique Dias b09960e538 fix(frontend): pnpm lock 2026-02-14 08:41:51 +01:00
transifex-integration[bot] 5e8f5be245 feat: Updates for project File Browser (#5759)
Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2026-02-14 08:27:14 +01:00
Aaron Dill e5bc0d3cce fix: wrap response text in Error before reject (#5753) 2026-02-14 07:40:52 +01:00
Ariel Leyva f67bccf8c5 feat: support for multiple encodings in CSV files (#5756) 2026-02-14 07:37:28 +01:00
Henrique Dias 88b97def9e feat: nederlands 2026-02-14 07:35:42 +01:00
Henrique Dias 1f7904dad2 fix: ignore version.go 2026-02-14 07:35:34 +01:00
renovate[bot] 5feaf66575 chore(deps): update all non-major dependencies (#5758)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-02-14 07:31:45 +01:00
transifex-integration[bot] c94870fcfe feat: Updates for project File Browser (#5749)
Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2026-02-14 07:30:21 +01:00
Nian 6a76dfeba9 fix: respect Accept-Encoding for pre-compressed JS (#5750) 2026-02-14 07:30:10 +01:00
Henrique Dias e193d43278 chore(release): 2.57.1 2026-02-08 08:02:48 +01:00
Henrique Dias 489af403a1 fix: remove skip clean 2026-02-08 08:02:03 +01:00
Henrique Dias ff2f00498c fix: normalize fields capitalization 2026-02-08 07:50:40 +01:00
renovate[bot] 2957b4605b chore(deps): update all non-major dependencies (#5747)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-02-08 07:47:22 +01:00
Henrique Dias 099dfb0ae8 docs: update headers 2026-02-04 22:16:25 +01:00
Henrique Dias a4289011ef docs: fix headers 2026-02-04 22:15:32 +01:00
Ariel Leyva 942d59848a chore(doc): add documentation for hook authentication method (#5742) 2026-02-04 22:12:56 +01:00
64 changed files with 2301 additions and 1951 deletions

No files matched your search

+4 -4
View File
@@ -34,7 +34,7 @@ jobs:
- uses: actions/checkout@v6 - uses: actions/checkout@v6
- uses: actions/setup-go@v6 - uses: actions/setup-go@v6
with: with:
go-version: "1.25.x" go-version: "1.26.x"
- uses: golangci/golangci-lint-action@v9 - uses: golangci/golangci-lint-action@v9
with: with:
version: "latest" version: "latest"
@@ -46,7 +46,7 @@ jobs:
- uses: actions/checkout@v6 - uses: actions/checkout@v6
- uses: actions/setup-go@v6 - uses: actions/setup-go@v6
with: with:
go-version: "1.25.x" go-version: "1.26.x"
- run: go test --race ./... - run: go test --race ./...
build: build:
@@ -58,7 +58,7 @@ jobs:
fetch-depth: 0 fetch-depth: 0
- uses: actions/setup-go@v6 - uses: actions/setup-go@v6
with: with:
go-version: '1.25' go-version: '1.26'
- uses: pnpm/action-setup@v4 - uses: pnpm/action-setup@v4
with: with:
package_json_file: "frontend/package.json" package_json_file: "frontend/package.json"
@@ -82,7 +82,7 @@ jobs:
fetch-depth: 0 fetch-depth: 0
- uses: actions/setup-go@v6 - uses: actions/setup-go@v6
with: with:
go-version: '1.25' go-version: '1.26'
- uses: pnpm/action-setup@v4 - uses: pnpm/action-setup@v4
with: with:
package_json_file: "frontend/package.json" package_json_file: "frontend/package.json"
+52
View File
@@ -2,6 +2,58 @@
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. 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.60.0](https://github.com/filebrowser/filebrowser/compare/v2.59.0...v2.60.0) (2026-02-21)
### Features
* Updates for project File Browser ([#5764](https://github.com/filebrowser/filebrowser/issues/5764)) ([9940bdd](https://github.com/filebrowser/filebrowser/commit/9940bdd663ff5141110778524b8a22c957036e78))
### Bug Fixes
* always show separators and encoding list in the CSV viewer ([#5774](https://github.com/filebrowser/filebrowser/issues/5774)) ([3169a14](https://github.com/filebrowser/filebrowser/commit/3169a14a4d63a0a11a5288f4f3a674c0a0edb972))
* modal lifecycle issues, multiple modals, new directory creation and discard changes behavior ([#5773](https://github.com/filebrowser/filebrowser/issues/5773)) ([200d501](https://github.com/filebrowser/filebrowser/commit/200d5015472c79d5caa683ea291ebf500356a39f))
## [2.59.0](https://github.com/filebrowser/filebrowser/compare/v2.58.0...v2.59.0) (2026-02-15)
### Features
* add 'Open direct' button to images ([#5678](https://github.com/filebrowser/filebrowser/issues/5678)) ([804b14b](https://github.com/filebrowser/filebrowser/commit/804b14b698aa218fa5c2aaba687e72c5f7617f0f))
* Updates for project File Browser ([#5760](https://github.com/filebrowser/filebrowser/issues/5760)) ([63a76ef](https://github.com/filebrowser/filebrowser/commit/63a76ef18c51121e08634810a894c1e22a870428))
### Bug Fixes
* render equations in markdown preview ([#5745](https://github.com/filebrowser/filebrowser/issues/5745)) ([0467326](https://github.com/filebrowser/filebrowser/commit/0467326d5c082c42c0ede88ee2d3472f5fb65600))
## [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) ## [2.57.0](https://github.com/filebrowser/filebrowser/compare/v2.56.0...v2.57.0) (2026-02-01)
+4 -3
View File
@@ -21,6 +21,7 @@
"@vueuse/core": "^14.0.0", "@vueuse/core": "^14.0.0",
"@vueuse/integrations": "^14.0.0", "@vueuse/integrations": "^14.0.0",
"ace-builds": "^1.43.2", "ace-builds": "^1.43.2",
"csv-parse": "^6.1.0",
"dayjs": "^1.11.13", "dayjs": "^1.11.13",
"dompurify": "^3.2.6", "dompurify": "^3.2.6",
"epubjs": "^0.3.93", "epubjs": "^0.3.93",
@@ -29,6 +30,7 @@
"jwt-decode": "^4.0.0", "jwt-decode": "^4.0.0",
"lodash-es": "^4.17.21", "lodash-es": "^4.17.21",
"marked": "^17.0.0", "marked": "^17.0.0",
"marked-katex-extension": "^5.1.6",
"material-icons": "^1.13.14", "material-icons": "^1.13.14",
"normalize.css": "^8.0.1", "normalize.css": "^8.0.1",
"pinia": "^3.0.4", "pinia": "^3.0.4",
@@ -40,7 +42,6 @@
"videojs-hotkeys": "^0.2.28", "videojs-hotkeys": "^0.2.28",
"videojs-mobile-ui": "^1.1.1", "videojs-mobile-ui": "^1.1.1",
"vue": "^3.5.17", "vue": "^3.5.17",
"vue-final-modal": "^4.5.5",
"vue-i18n": "^11.1.10", "vue-i18n": "^11.1.10",
"vue-lazyload": "^3.0.0", "vue-lazyload": "^3.0.0",
"vue-reader": "^1.2.17", "vue-reader": "^1.2.17",
@@ -59,7 +60,7 @@
"@vue/eslint-config-typescript": "^14.6.0", "@vue/eslint-config-typescript": "^14.6.0",
"@vue/tsconfig": "^0.8.1", "@vue/tsconfig": "^0.8.1",
"autoprefixer": "^10.4.21", "autoprefixer": "^10.4.21",
"eslint": "^9.31.0", "eslint": "^10.0.0",
"eslint-config-prettier": "^10.1.5", "eslint-config-prettier": "^10.1.5",
"eslint-plugin-prettier": "^5.5.1", "eslint-plugin-prettier": "^5.5.1",
"eslint-plugin-vue": "^10.5.1", "eslint-plugin-vue": "^10.5.1",
@@ -71,5 +72,5 @@
"vite-plugin-compression2": "^2.3.1", "vite-plugin-compression2": "^2.3.1",
"vue-tsc": "^3.1.3" "vue-tsc": "^3.1.3"
}, },
"packageManager": "pnpm@10.28.2+sha512.41872f037ad22f7348e3b1debbaf7e867cfd448f2726d9cf74c08f19507c31d2c8e7a11525b983febc2df640b5438dee6023ebb1f84ed43cc2d654d2bc326264" "packageManager": "pnpm@10.30.1+sha512.3590e550d5384caa39bd5c7c739f72270234b2f6059e13018f975c313b1eb9fefcc09714048765d4d9efe961382c312e624572c0420762bdc5d5940cdf9be73a"
} }
+1285 -1671
View File
File diff suppressed because it is too large. Load diff
+15 -4
View File
@@ -3,14 +3,25 @@ import { useLayoutStore } from "@/stores/layout";
import { baseURL } from "@/utils/constants"; import { baseURL } from "@/utils/constants";
import { upload as postTus, useTus } from "./tus"; import { upload as postTus, useTus } from "./tus";
import { createURL, fetchURL, removePrefix, StatusError } from "./utils"; import { createURL, fetchURL, removePrefix, StatusError } from "./utils";
import { isEncodableResponse, makeRawResource } from "@/utils/encodings";
export async function fetch(url: string, signal?: AbortSignal) { export async function fetch(url: string, signal?: AbortSignal) {
const encoding = isEncodableResponse(url);
url = removePrefix(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; let data: Resource;
try { 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) { } catch (e) {
// Check if the error is an intentional cancellation // Check if the error is an intentional cancellation
if (e instanceof Error && e.name === "AbortError") { if (e instanceof Error && e.name === "AbortError") {
@@ -140,9 +151,9 @@ async function postResources(
if (request.status === 200) { if (request.status === 200) {
resolve(request.responseText); resolve(request.responseText);
} else if (request.status === 409) { } else if (request.status === 409) {
reject(request.status); reject(new Error(request.status.toString()));
} else { } else {
reject(request.responseText); reject(new Error(request.responseText));
} }
}; };
+93 -56
View File
@@ -1,10 +1,46 @@
<template> <template>
<div class="csv-viewer"> <div class="csv-viewer">
<div class="csv-header">
<div class="header-select">
<label for="columnSeparator">{{ $t("files.columnSeparator") }}</label>
<select
id="columnSeparator"
class="input input--block"
v-model="columnSeparator"
>
<option :value="[',']">
{{ $t("files.csvSeparators.comma") }}
</option>
<option :value="[';']">
{{ $t("files.csvSeparators.semicolon") }}
</option>
<option :value="[',', ';']">
{{ $t("files.csvSeparators.both") }}
</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>
<div v-if="displayError" class="csv-error"> <div v-if="displayError" class="csv-error">
<i class="material-icons">error</i> <i class="material-icons">error</i>
<p>{{ displayError }}</p> <p>{{ displayError }}</p>
</div> </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> <i class="material-icons">description</i>
<p>{{ $t("files.lonely") }}</p> <p>{{ $t("files.lonely") }}</p>
</div> </div>
@@ -12,13 +48,13 @@
<table class="csv-table"> <table class="csv-table">
<thead> <thead>
<tr> <tr>
<th v-for="(header, index) in data.headers" :key="index"> <th v-for="(header, index) in parsed.headers" :key="index">
{{ header || `Column ${index + 1}` }} {{ header || `Column ${index + 1}` }}
</th> </th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr v-for="(row, rowIndex) in data.rows" :key="rowIndex"> <tr v-for="(row, rowIndex) in parsed.rows" :key="rowIndex">
<td v-for="(cell, cellIndex) in row" :key="cellIndex"> <td v-for="(cell, cellIndex) in row" :key="cellIndex">
{{ cell }} {{ cell }}
</td> </td>
@@ -26,29 +62,11 @@
</tbody> </tbody>
</table> </table>
<div class="csv-footer"> <div class="csv-footer">
<div class="csv-info" v-if="data.rows.length > 100"> <div class="csv-info" v-if="parsed.rows.length > 100">
<i class="material-icons">info</i> <i class="material-icons">info</i>
<span> <span>
{{ $t("files.showingRows", { count: data.rows.length }) }}</span {{ $t("files.showingRows", { count: parsed.rows.length }) }}
> </span>
</div>
<div class="column-separator">
<label for="columnSeparator">{{ $t("files.columnSeparator") }}</label>
<select
id="columnSeparator"
class="input input--block"
v-model="columnSeparator"
>
<option :value="[',']">
{{ $t("files.csvSeparators.comma") }}
</option>
<option :value="[';']">
{{ $t("files.csvSeparators.semicolon") }}
</option>
<option :value="[',', ';']">
{{ $t("files.csvSeparators.both") }}
</option>
</select>
</div> </div>
</div> </div>
</div> </div>
@@ -56,11 +74,15 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { parseCSV, type CsvData } from "@/utils/csv"; import { computed, ref, watchEffect } from "vue";
import { computed, ref } 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 { interface Props {
content: string; content: ArrayBuffer | string;
error?: string; error?: string;
} }
@@ -68,31 +90,43 @@ const props = withDefaults(defineProps<Props>(), {
error: "", error: "",
}); });
const columnSeparator = ref([","]); const columnSeparator = ref([",", ";"]);
const data = computed<CsvData>(() => { const selectedEncoding = ref("utf-8");
try {
return parseCSV(props.content, columnSeparator.value); const parsed = ref<CsvData>({ headers: [], rows: [] });
} catch (e) {
console.error("Failed to parse CSV:", e); const displayError = ref<string | null>(null);
return { headers: [], rows: [] };
} const isEncodedContent = computed(() => {
return props.content instanceof ArrayBuffer;
}); });
const displayError = computed(() => { watchEffect(() => {
// External error takes priority (e.g., file too large) if (props.content !== "" && columnSeparator.value.length > 0) {
if (props.error) { const content = isEncodedContent.value
return props.error; ? 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> </script>
@@ -213,10 +247,6 @@ const displayError = computed(() => {
padding: 0.5rem; padding: 0.5rem;
} }
.csv-footer > :only-child {
margin-left: auto;
}
.csv-info { .csv-info {
display: flex; display: flex;
align-items: center; align-items: center;
@@ -230,18 +260,25 @@ const displayError = computed(() => {
font-size: 0.875rem; font-size: 0.875rem;
} }
.column-separator { .csv-header {
display: flex;
justify-content: space-between;
padding: 0.25rem;
}
.header-select {
display: flex; display: flex;
align-items: center; align-items: center;
gap: 0.5rem; gap: 0.5rem;
margin-bottom: 0.5rem;
} }
.column-separator > label { .header-select > label {
font-size: small; font-size: small;
text-align: end; max-width: 80px;
} }
.column-separator > select { .header-select > select {
margin-bottom: 0; margin-bottom: 0;
} }
+55 -15
View File
@@ -1,21 +1,61 @@
<template> <template>
<VueFinalModal <div id="modal-background" @click="backgroundClick">
class="vfm-modal" <div ref="modalContainer">
overlay-transition="vfm-fade" <slot></slot>
content-transition="vfm-fade" </div>
@closed="layoutStore.closeHovers" </div>
:focus-trap="{
initialFocus: '#focus-prompt',
fallbackFocus: 'div.vfm__content',
}"
>
<slot />
</VueFinalModal>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { VueFinalModal } from "vue-final-modal"; import { onMounted, ref } from "vue";
import { useLayoutStore } from "@/stores/layout";
const layoutStore = useLayoutStore(); const emit = defineEmits(["closed"]);
const modalContainer = ref(null);
onMounted(() => {
const element = document.querySelector("#focus-prompt") as HTMLElement | null;
if (element) {
element.focus();
} else if (modalContainer.value) {
(modalContainer.value as HTMLElement).focus();
}
});
const backgroundClick = (event: Event) => {
const target = event.target as HTMLElement;
if (target.id == "modal-background") {
emit("closed");
}
};
window.addEventListener("keydown", (event) => {
if (event.key === "Escape") {
event.stopImmediatePropagation();
emit("closed");
}
});
</script> </script>
<style scoped>
#modal-background {
position: fixed;
inset: 0;
background-color: #00000096;
display: flex;
justify-content: center;
align-items: center;
z-index: 10000;
animation: ease-in 150ms opacity-enter;
}
@keyframes opacity-enter {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
</style>
@@ -35,12 +35,17 @@ const props = defineProps({
type: Boolean, type: Boolean,
default: false, default: false,
}, },
path: {
type: String,
default: null,
},
}); });
const container = ref<HTMLElement | null>(null); const container = ref<HTMLElement | null>(null);
const path = computed(() => { const path = computed(() => {
let basePath = fileStore.isFiles ? route.path : url.removeLastDir(route.path); const routePath = props.path || route.path;
let basePath = fileStore.isFiles ? routePath : url.removeLastDir(routePath);
if (!basePath.endsWith("/")) { if (!basePath.endsWith("/")) {
basePath += "/"; basePath += "/";
} }
+7 -1
View File
@@ -168,7 +168,13 @@ export default {
this.showHover({ this.showHover({
prompt: "newDir", prompt: "newDir",
action: null, action: null,
confirm: null, confirm: (url) => {
const paths = url.split("/");
this.items.push({
name: paths[paths.length - 2],
url: url,
});
},
props: { props: {
redirect: false, redirect: false,
base: this.current === this.$route.path ? null : this.current, base: this.current === this.$route.path ? null : this.current,
+12 -13
View File
@@ -14,7 +14,7 @@
v-model.trim="name" v-model.trim="name"
tabindex="1" tabindex="1"
/> />
<CreateFilePath :name="name" :is-dir="true" /> <CreateFilePath :name="name" :is-dir="true" :path="base" />
</div> </div>
<div class="card-action"> <div class="card-action">
@@ -41,7 +41,7 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { inject, ref } from "vue"; import { computed, inject, ref } from "vue";
import { useFileStore } from "@/stores/file"; import { useFileStore } from "@/stores/file";
import { useLayoutStore } from "@/stores/layout"; import { useLayoutStore } from "@/stores/layout";
@@ -53,17 +53,13 @@ import CreateFilePath from "@/components/prompts/CreateFilePath.vue";
const $showError = inject<IToastError>("$showError")!; const $showError = inject<IToastError>("$showError")!;
const props = defineProps({
base: String,
redirect: {
type: Boolean,
default: true,
},
});
const fileStore = useFileStore(); const fileStore = useFileStore();
const layoutStore = useLayoutStore(); const layoutStore = useLayoutStore();
const base = computed(() => {
return layoutStore.currentPrompt?.props?.base;
});
const route = useRoute(); const route = useRoute();
const router = useRouter(); const router = useRouter();
const { t } = useI18n(); const { t } = useI18n();
@@ -76,7 +72,7 @@ const submit = async (event: Event) => {
// Build the path of the new directory. // Build the path of the new directory.
let uri: string; let uri: string;
if (props.base) uri = props.base; if (base.value) uri = base.value;
else if (fileStore.isFiles) uri = route.path + "/"; else if (fileStore.isFiles) uri = route.path + "/";
else uri = "/"; else uri = "/";
@@ -89,12 +85,15 @@ const submit = async (event: Event) => {
try { try {
await api.post(uri); await api.post(uri);
if (props.redirect) { if (layoutStore.currentPrompt?.props?.redirect) {
router.push({ path: uri }); router.push({ path: uri });
} else if (!props.base) { } else if (!base.value) {
const res = await api.fetch(url.removeLastDir(uri) + "/"); const res = await api.fetch(url.removeLastDir(uri) + "/");
fileStore.updateRequest(res); fileStore.updateRequest(res);
} }
if (layoutStore.currentPrompt?.confirm) {
layoutStore.currentPrompt?.confirm(uri);
}
} catch (e) { } catch (e) {
if (e instanceof Error) { if (e instanceof Error) {
$showError(e); $showError(e);
+13 -22
View File
@@ -1,10 +1,13 @@
<template> <template>
<ModalsContainer /> <base-modal v-if="modal != null" :prompt="currentPromptName" @closed="close">
<keep-alive>
<component :is="modal" />
</keep-alive>
</base-modal>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { watch } from "vue"; import { computed } from "vue";
import { ModalsContainer, useModal } from "vue-final-modal";
import { storeToRefs } from "pinia"; import { storeToRefs } from "pinia";
import { useLayoutStore } from "@/stores/layout"; import { useLayoutStore } from "@/stores/layout";
@@ -49,27 +52,15 @@ const components = new Map<string, any>([
["discardEditorChanges", DiscardEditorChanges], ["discardEditorChanges", DiscardEditorChanges],
]); ]);
watch(currentPromptName, (newValue) => { const modal = computed(() => {
const modal = components.get(newValue!); const modal = components.get(currentPromptName.value!);
if (!modal) return; if (!modal) null;
const { open, close } = useModal({ return modal;
component: BaseModal,
slots: {
default: modal,
},
});
layoutStore.setCloseOnPrompt(close, newValue!);
open();
}); });
window.addEventListener("keydown", (event) => { const close = () => {
if (!layoutStore.currentPrompt) return; if (!layoutStore.currentPrompt) return;
layoutStore.closeHovers();
if (event.key === "Escape") { };
event.stopImmediatePropagation();
layoutStore.closeHovers();
}
});
</script> </script>
@@ -32,7 +32,8 @@ export default {
ja: "日本語", ja: "日本語",
ko: "한국어", ko: "한국어",
no: "Norsk", no: "Norsk",
"nl-be": "Dutch (Belgium)", nl: "Nederlands (Nederland)",
"nl-be": "Nederlands (België)",
pl: "Polski", pl: "Polski",
"pt-br": "Português (Brasil)", "pt-br": "Português (Brasil)",
pt: "Português (Portugal)", pt: "Português (Portugal)",
+5 -4
View File
@@ -182,10 +182,11 @@ html[dir="rtl"] .breadcrumbs a {
background: var(--textSecondary) !important; background: var(--textSecondary) !important;
} }
.vfm-modal {
z-index: 9999999 !important;
}
body > div[style*="z-index: 9990"] { body > div[style*="z-index: 9990"] {
z-index: 10000 !important; z-index: 10000 !important;
} }
#modal-background .button:focus {
outline: 1px solid #2195f32d;
outline-offset: 1px;
}
-1
View File
@@ -1,6 +1,5 @@
@import "normalize.css/normalize.css"; @import "normalize.css/normalize.css";
@import "vue-toastification/dist/index.css"; @import "vue-toastification/dist/index.css";
@import "vue-final-modal/style.css";
@import "./_variables.css"; @import "./_variables.css";
@import "./_buttons.css"; @import "./_buttons.css";
@import "./_inputs.css"; @import "./_inputs.css";
+3 -1
View File
@@ -42,6 +42,7 @@
"update": "تحديث", "update": "تحديث",
"upload": "رفع", "upload": "رفع",
"openFile": "فتح الملف", "openFile": "فتح الملف",
"openDirect": "View raw",
"discardChanges": "إلغاء التغييرات", "discardChanges": "إلغاء التغييرات",
"stopSearch": "توقف عن البحث", "stopSearch": "توقف عن البحث",
"saveChanges": "حفظ التغييرات", "saveChanges": "حفظ التغييرات",
@@ -88,7 +89,8 @@
"comma": "Comma (,)", "comma": "Comma (,)",
"semicolon": "Semicolon (;)", "semicolon": "Semicolon (;)",
"both": "Both (,) and (;)" "both": "Both (,) and (;)"
} },
"fileEncoding": "File Encoding"
}, },
"help": { "help": {
"click": "حدد الملف أو المجلد", "click": "حدد الملف أو المجلد",
+3 -1
View File
@@ -42,6 +42,7 @@
"update": "Обнови", "update": "Обнови",
"upload": "Качи", "upload": "Качи",
"openFile": "Отвори файл", "openFile": "Отвори файл",
"openDirect": "View raw",
"discardChanges": "Изчисти", "discardChanges": "Изчисти",
"stopSearch": "Stop searching", "stopSearch": "Stop searching",
"saveChanges": "Запиши промените", "saveChanges": "Запиши промените",
@@ -88,7 +89,8 @@
"comma": "Comma (,)", "comma": "Comma (,)",
"semicolon": "Semicolon (;)", "semicolon": "Semicolon (;)",
"both": "Both (,) and (;)" "both": "Both (,) and (;)"
} },
"fileEncoding": "File Encoding"
}, },
"help": { "help": {
"click": "избери файл или директория", "click": "избери файл или директория",
+3 -1
View File
@@ -42,6 +42,7 @@
"update": "Actualitzar", "update": "Actualitzar",
"upload": "Pujar", "upload": "Pujar",
"openFile": "Obrir fitxer", "openFile": "Obrir fitxer",
"openDirect": "View raw",
"discardChanges": "Descartar", "discardChanges": "Descartar",
"stopSearch": "Stop searching", "stopSearch": "Stop searching",
"saveChanges": "Save changes", "saveChanges": "Save changes",
@@ -88,7 +89,8 @@
"comma": "Comma (,)", "comma": "Comma (,)",
"semicolon": "Semicolon (;)", "semicolon": "Semicolon (;)",
"both": "Both (,) and (;)" "both": "Both (,) and (;)"
} },
"fileEncoding": "File Encoding"
}, },
"help": { "help": {
"click": "seleccionar fitxer o carpeta", "click": "seleccionar fitxer o carpeta",
+3 -1
View File
@@ -42,6 +42,7 @@
"update": "Aktualizovat", "update": "Aktualizovat",
"upload": "Nahrát", "upload": "Nahrát",
"openFile": "Otevřít soubor", "openFile": "Otevřít soubor",
"openDirect": "View raw",
"discardChanges": "Zrušit změny", "discardChanges": "Zrušit změny",
"stopSearch": "Stop searching", "stopSearch": "Stop searching",
"saveChanges": "Save changes", "saveChanges": "Save changes",
@@ -88,7 +89,8 @@
"comma": "Comma (,)", "comma": "Comma (,)",
"semicolon": "Semicolon (;)", "semicolon": "Semicolon (;)",
"both": "Both (,) and (;)" "both": "Both (,) and (;)"
} },
"fileEncoding": "File Encoding"
}, },
"help": { "help": {
"click": "vyberte soubor nebo adresář", "click": "vyberte soubor nebo adresář",
+3 -1
View File
@@ -42,6 +42,7 @@
"update": "Aktualisieren", "update": "Aktualisieren",
"upload": "Hochladen", "upload": "Hochladen",
"openFile": "Datei öffnen", "openFile": "Datei öffnen",
"openDirect": "Original anzeigen",
"discardChanges": "Verwerfen", "discardChanges": "Verwerfen",
"stopSearch": "Suche beenden", "stopSearch": "Suche beenden",
"saveChanges": "Änderungen speichern", "saveChanges": "Änderungen speichern",
@@ -88,7 +89,8 @@
"comma": "Komma (,)", "comma": "Komma (,)",
"semicolon": "Semikolon (;)", "semicolon": "Semikolon (;)",
"both": "Beides (,) und (;)" "both": "Beides (,) und (;)"
} },
"fileEncoding": "Dateikodierung"
}, },
"help": { "help": {
"click": "Datei oder Verzeichnis auswählen", "click": "Datei oder Verzeichnis auswählen",
+3 -1
View File
@@ -42,6 +42,7 @@
"update": "Ενημέρωση", "update": "Ενημέρωση",
"upload": "Μεταφόρτωση", "upload": "Μεταφόρτωση",
"openFile": "Άνοιγμα αρχείου", "openFile": "Άνοιγμα αρχείου",
"openDirect": "View raw",
"discardChanges": "Discard", "discardChanges": "Discard",
"stopSearch": "Stop searching", "stopSearch": "Stop searching",
"saveChanges": "Save changes", "saveChanges": "Save changes",
@@ -88,7 +89,8 @@
"comma": "Comma (,)", "comma": "Comma (,)",
"semicolon": "Semicolon (;)", "semicolon": "Semicolon (;)",
"both": "Both (,) and (;)" "both": "Both (,) and (;)"
} },
"fileEncoding": "File Encoding"
}, },
"help": { "help": {
"click": "επιλέξτε αρχείο ή φάκελο", "click": "επιλέξτε αρχείο ή φάκελο",
+3 -1
View File
@@ -42,6 +42,7 @@
"update": "Update", "update": "Update",
"upload": "Upload", "upload": "Upload",
"openFile": "Open file", "openFile": "Open file",
"openDirect": "View raw",
"discardChanges": "Discard", "discardChanges": "Discard",
"stopSearch": "Stop searching", "stopSearch": "Stop searching",
"saveChanges": "Save changes", "saveChanges": "Save changes",
@@ -88,7 +89,8 @@
"comma": "Comma (,)", "comma": "Comma (,)",
"semicolon": "Semicolon (;)", "semicolon": "Semicolon (;)",
"both": "Both (,) and (;)" "both": "Both (,) and (;)"
} },
"fileEncoding": "File Encoding"
}, },
"help": { "help": {
"click": "select file or directory", "click": "select file or directory",
+3 -1
View File
@@ -42,6 +42,7 @@
"update": "Actualizar", "update": "Actualizar",
"upload": "Subir", "upload": "Subir",
"openFile": "Abrir archivo", "openFile": "Abrir archivo",
"openDirect": "View raw",
"discardChanges": "Discard", "discardChanges": "Discard",
"stopSearch": "Stop searching", "stopSearch": "Stop searching",
"saveChanges": "Guardar cambios", "saveChanges": "Guardar cambios",
@@ -88,7 +89,8 @@
"comma": "Comma (,)", "comma": "Comma (,)",
"semicolon": "Semicolon (;)", "semicolon": "Semicolon (;)",
"both": "Both (,) and (;)" "both": "Both (,) and (;)"
} },
"fileEncoding": "File Encoding"
}, },
"help": { "help": {
"click": "seleccionar archivo o carpeta", "click": "seleccionar archivo o carpeta",
+3 -1
View File
@@ -42,6 +42,7 @@
"update": "به روز سانی", "update": "به روز سانی",
"upload": "آپلود", "upload": "آپلود",
"openFile": "باز کردن فایل", "openFile": "باز کردن فایل",
"openDirect": "View raw",
"discardChanges": "لغو کردن", "discardChanges": "لغو کردن",
"stopSearch": "Stop searching", "stopSearch": "Stop searching",
"saveChanges": "Save changes", "saveChanges": "Save changes",
@@ -88,7 +89,8 @@
"comma": "Comma (,)", "comma": "Comma (,)",
"semicolon": "Semicolon (;)", "semicolon": "Semicolon (;)",
"both": "Both (,) and (;)" "both": "Both (,) and (;)"
} },
"fileEncoding": "File Encoding"
}, },
"help": { "help": {
"click": "انتخاب فایل یا پوشه", "click": "انتخاب فایل یا پوشه",
+4 -2
View File
@@ -42,6 +42,7 @@
"update": "Mettre à jour", "update": "Mettre à jour",
"upload": "Importer", "upload": "Importer",
"openFile": "Ouvrir le fichier", "openFile": "Ouvrir le fichier",
"openDirect": "View raw",
"discardChanges": "Annuler", "discardChanges": "Annuler",
"stopSearch": "Arrêter recherche", "stopSearch": "Arrêter recherche",
"saveChanges": "Enregistrer changements", "saveChanges": "Enregistrer changements",
@@ -88,7 +89,8 @@
"comma": "Virgule (,)", "comma": "Virgule (,)",
"semicolon": "Point-virgule (;)", "semicolon": "Point-virgule (;)",
"both": "Les (,) et (;)" "both": "Les (,) et (;)"
} },
"fileEncoding": "File Encoding"
}, },
"help": { "help": {
"click": "Sélectionner un fichier ou dossier", "click": "Sélectionner un fichier ou dossier",
@@ -232,7 +234,7 @@
"permissions": "Permissions", "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", "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", "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", "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.", "ruleExample2": "Bloque l'accès au fichier nommé \"Caddyfile\" à la racine du dossier utilisateur·ice.",
"rules": "Règles", "rules": "Règles",
+3 -1
View File
@@ -42,6 +42,7 @@
"update": "עדכון", "update": "עדכון",
"upload": "העלאה", "upload": "העלאה",
"openFile": "פתח קובץ", "openFile": "פתח קובץ",
"openDirect": "View raw",
"discardChanges": "זריקת השינויים", "discardChanges": "זריקת השינויים",
"stopSearch": "Stop searching", "stopSearch": "Stop searching",
"saveChanges": "Save changes", "saveChanges": "Save changes",
@@ -88,7 +89,8 @@
"comma": "Comma (,)", "comma": "Comma (,)",
"semicolon": "Semicolon (;)", "semicolon": "Semicolon (;)",
"both": "Both (,) and (;)" "both": "Both (,) and (;)"
} },
"fileEncoding": "File Encoding"
}, },
"help": { "help": {
"click": "בחר קובץ או תיקייה", "click": "בחר קובץ או תיקייה",
+3 -1
View File
@@ -42,6 +42,7 @@
"update": "Ažuriraj", "update": "Ažuriraj",
"upload": "Prenesi", "upload": "Prenesi",
"openFile": "Otvori datoteku", "openFile": "Otvori datoteku",
"openDirect": "View raw",
"discardChanges": "Odbaci", "discardChanges": "Odbaci",
"stopSearch": "Stop searching", "stopSearch": "Stop searching",
"saveChanges": "Spremi promjene", "saveChanges": "Spremi promjene",
@@ -88,7 +89,8 @@
"comma": "Zarez (,)", "comma": "Zarez (,)",
"semicolon": "Točka zarez (;)", "semicolon": "Točka zarez (;)",
"both": "I (,) i (;)" "both": "I (,) i (;)"
} },
"fileEncoding": "File Encoding"
}, },
"help": { "help": {
"click": "odaberi datoteku ili mapu", "click": "odaberi datoteku ili mapu",
+3 -1
View File
@@ -42,6 +42,7 @@
"update": "Frissítés", "update": "Frissítés",
"upload": "Feltöltés", "upload": "Feltöltés",
"openFile": "Fájl megnyitása", "openFile": "Fájl megnyitása",
"openDirect": "View raw",
"discardChanges": "Discard", "discardChanges": "Discard",
"stopSearch": "Stop searching", "stopSearch": "Stop searching",
"saveChanges": "Save changes", "saveChanges": "Save changes",
@@ -88,7 +89,8 @@
"comma": "Comma (,)", "comma": "Comma (,)",
"semicolon": "Semicolon (;)", "semicolon": "Semicolon (;)",
"both": "Both (,) and (;)" "both": "Both (,) and (;)"
} },
"fileEncoding": "File Encoding"
}, },
"help": { "help": {
"click": "mappa vagy fájl kijelölése", "click": "mappa vagy fájl kijelölése",
+4 -1
View File
@@ -17,6 +17,7 @@ import("dayjs/locale/it");
import("dayjs/locale/ja"); import("dayjs/locale/ja");
import("dayjs/locale/ko"); import("dayjs/locale/ko");
import("dayjs/locale/nb"); import("dayjs/locale/nb");
import("dayjs/locale/nl");
import("dayjs/locale/nl-be"); import("dayjs/locale/nl-be");
import("dayjs/locale/pl"); import("dayjs/locale/pl");
import("dayjs/locale/pt-br"); import("dayjs/locale/pt-br");
@@ -110,7 +111,6 @@ export function detectLocale() {
case /^uk\b/.test(locale): case /^uk\b/.test(locale):
locale = "uk"; locale = "uk";
break; break;
case /^vi\b/.test(locale): case /^vi\b/.test(locale):
locale = "vi"; locale = "vi";
break; break;
@@ -118,6 +118,9 @@ export function detectLocale() {
case /^sv\b/.test(locale): case /^sv\b/.test(locale):
locale = "sv"; locale = "sv";
break; break;
case /^nl\b/.test(locale):
locale = "nl";
break;
case /^nl-be\b/.test(locale): case /^nl-be\b/.test(locale):
locale = "nl-be"; locale = "nl-be";
break; break;
+3 -1
View File
@@ -42,6 +42,7 @@
"update": "Vista", "update": "Vista",
"upload": "Hlaða upp", "upload": "Hlaða upp",
"openFile": "Open file", "openFile": "Open file",
"openDirect": "View raw",
"discardChanges": "Discard", "discardChanges": "Discard",
"stopSearch": "Stop searching", "stopSearch": "Stop searching",
"saveChanges": "Save changes", "saveChanges": "Save changes",
@@ -88,7 +89,8 @@
"comma": "Comma (,)", "comma": "Comma (,)",
"semicolon": "Semicolon (;)", "semicolon": "Semicolon (;)",
"both": "Both (,) and (;)" "both": "Both (,) and (;)"
} },
"fileEncoding": "File Encoding"
}, },
"help": { "help": {
"click": "velja skjal eða möppu", "click": "velja skjal eða möppu",
+3 -1
View File
@@ -42,6 +42,7 @@
"update": "Aggiorna", "update": "Aggiorna",
"upload": "Carica", "upload": "Carica",
"openFile": "Apri file", "openFile": "Apri file",
"openDirect": "View raw",
"discardChanges": "Ignora", "discardChanges": "Ignora",
"stopSearch": "Stop searching", "stopSearch": "Stop searching",
"saveChanges": "Save changes", "saveChanges": "Save changes",
@@ -88,7 +89,8 @@
"comma": "Comma (,)", "comma": "Comma (,)",
"semicolon": "Semicolon (;)", "semicolon": "Semicolon (;)",
"both": "Both (,) and (;)" "both": "Both (,) and (;)"
} },
"fileEncoding": "File Encoding"
}, },
"help": { "help": {
"click": "seleziona un file o una cartella", "click": "seleziona un file o una cartella",
+3 -1
View File
@@ -42,6 +42,7 @@
"update": "更新", "update": "更新",
"upload": "アップロード", "upload": "アップロード",
"openFile": "ファイルを開く", "openFile": "ファイルを開く",
"openDirect": "View raw",
"discardChanges": "Discard", "discardChanges": "Discard",
"stopSearch": "Stop searching", "stopSearch": "Stop searching",
"saveChanges": "Save changes", "saveChanges": "Save changes",
@@ -88,7 +89,8 @@
"comma": "Comma (,)", "comma": "Comma (,)",
"semicolon": "Semicolon (;)", "semicolon": "Semicolon (;)",
"both": "Both (,) and (;)" "both": "Both (,) and (;)"
} },
"fileEncoding": "File Encoding"
}, },
"help": { "help": {
"click": "ファイルやフォルダーを選択", "click": "ファイルやフォルダーを選択",
+3 -1
View File
@@ -42,6 +42,7 @@
"update": "업데이트", "update": "업데이트",
"upload": "업로드", "upload": "업로드",
"openFile": "파일 열기", "openFile": "파일 열기",
"openDirect": "원본 보기",
"discardChanges": "변경 사항 취소", "discardChanges": "변경 사항 취소",
"stopSearch": "검색 중단", "stopSearch": "검색 중단",
"saveChanges": "변경사항 저장", "saveChanges": "변경사항 저장",
@@ -88,7 +89,8 @@
"comma": "반점 (,)", "comma": "반점 (,)",
"semicolon": "쌍반점 (;)", "semicolon": "쌍반점 (;)",
"both": "(,) 및 (;) 모두" "both": "(,) 및 (;) 모두"
} },
"fileEncoding": "파일 인코딩"
}, },
"help": { "help": {
"click": "파일 또는 디렉터리 선택", "click": "파일 또는 디렉터리 선택",
+3 -1
View File
@@ -42,6 +42,7 @@
"update": "Atjaunināt", "update": "Atjaunināt",
"upload": "Augšupielādēt", "upload": "Augšupielādēt",
"openFile": "Atvērt failu", "openFile": "Atvērt failu",
"openDirect": "View raw",
"discardChanges": "Izmest", "discardChanges": "Izmest",
"stopSearch": "Stop searching", "stopSearch": "Stop searching",
"saveChanges": "Saglabāt izmaiņas", "saveChanges": "Saglabāt izmaiņas",
@@ -88,7 +89,8 @@
"comma": "Komats (,)", "comma": "Komats (,)",
"semicolon": "Semikols (;)", "semicolon": "Semikols (;)",
"both": "Gan (,) gan (;)" "both": "Gan (,) gan (;)"
} },
"fileEncoding": "File Encoding"
}, },
"help": { "help": {
"click": "atlasiet failu vai direktoriju", "click": "atlasiet failu vai direktoriju",
+3 -1
View File
@@ -42,6 +42,7 @@
"update": "Atjaunināt", "update": "Atjaunināt",
"upload": "Augšupielādēt", "upload": "Augšupielādēt",
"openFile": "Atvērt failu", "openFile": "Atvērt failu",
"openDirect": "View raw",
"discardChanges": "Izmest", "discardChanges": "Izmest",
"stopSearch": "Beigt meklēšanu", "stopSearch": "Beigt meklēšanu",
"saveChanges": "Saglabāt izmaiņas", "saveChanges": "Saglabāt izmaiņas",
@@ -88,7 +89,8 @@
"comma": "Komats (,)", "comma": "Komats (,)",
"semicolon": "Semikols (;)", "semicolon": "Semikols (;)",
"both": "Gan (,) gan (;)" "both": "Gan (,) gan (;)"
} },
"fileEncoding": "File Encoding"
}, },
"help": { "help": {
"click": "atlasiet failu vai direktoriju", "click": "atlasiet failu vai direktoriju",
+3 -1
View File
@@ -42,6 +42,7 @@
"update": "Updaten", "update": "Updaten",
"upload": "Uploaden", "upload": "Uploaden",
"openFile": "Open file", "openFile": "Open file",
"openDirect": "View raw",
"discardChanges": "Discard", "discardChanges": "Discard",
"stopSearch": "Stop searching", "stopSearch": "Stop searching",
"saveChanges": "Save changes", "saveChanges": "Save changes",
@@ -88,7 +89,8 @@
"comma": "Comma (,)", "comma": "Comma (,)",
"semicolon": "Semicolon (;)", "semicolon": "Semicolon (;)",
"both": "Both (,) and (;)" "both": "Both (,) and (;)"
} },
"fileEncoding": "File Encoding"
}, },
"help": { "help": {
"click": "selecteer bestand of map", "click": "selecteer bestand of map",
+290
View File
@@ -0,0 +1,290 @@
{
"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",
"openDirect": "Raw weergeven",
"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": "Bestandscodering"
},
"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"
}
}
+3 -1
View File
@@ -42,6 +42,7 @@
"update": "Opptater", "update": "Opptater",
"upload": "Last opp", "upload": "Last opp",
"openFile": "Open file", "openFile": "Open file",
"openDirect": "View raw",
"discardChanges": "Slett", "discardChanges": "Slett",
"stopSearch": "Stop searching", "stopSearch": "Stop searching",
"saveChanges": "Lagre Endringane ", "saveChanges": "Lagre Endringane ",
@@ -88,7 +89,8 @@
"comma": "Comma (,)", "comma": "Comma (,)",
"semicolon": "Semicolon (;)", "semicolon": "Semicolon (;)",
"both": "Both (,) and (;)" "both": "Both (,) and (;)"
} },
"fileEncoding": "File Encoding"
}, },
"help": { "help": {
"click": "velg fil eller katalog", "click": "velg fil eller katalog",
+3 -1
View File
@@ -42,6 +42,7 @@
"update": "Aktualizuj", "update": "Aktualizuj",
"upload": "Wyślij", "upload": "Wyślij",
"openFile": "Otwórz plik", "openFile": "Otwórz plik",
"openDirect": "Otwórz bezpośrednio",
"discardChanges": "Odrzuć", "discardChanges": "Odrzuć",
"stopSearch": "Zatrzymaj wyszukiwanie", "stopSearch": "Zatrzymaj wyszukiwanie",
"saveChanges": "Zapisz zmiany", "saveChanges": "Zapisz zmiany",
@@ -88,7 +89,8 @@
"comma": "Przecinek (,)", "comma": "Przecinek (,)",
"semicolon": "Średnik (;)", "semicolon": "Średnik (;)",
"both": "Zarówno (,), jak i (;)" "both": "Zarówno (,), jak i (;)"
} },
"fileEncoding": "Kodowanie pliku"
}, },
"help": { "help": {
"click": "zaznacz plik lub folder", "click": "zaznacz plik lub folder",
+3 -1
View File
@@ -42,6 +42,7 @@
"update": "Atualizar", "update": "Atualizar",
"upload": "Enviar", "upload": "Enviar",
"openFile": "Abrir", "openFile": "Abrir",
"openDirect": "View raw",
"discardChanges": "Discard", "discardChanges": "Discard",
"stopSearch": "Stop searching", "stopSearch": "Stop searching",
"saveChanges": "Save changes", "saveChanges": "Save changes",
@@ -88,7 +89,8 @@
"comma": "Comma (,)", "comma": "Comma (,)",
"semicolon": "Semicolon (;)", "semicolon": "Semicolon (;)",
"both": "Both (,) and (;)" "both": "Both (,) and (;)"
} },
"fileEncoding": "File Encoding"
}, },
"help": { "help": {
"click": "selecionar pasta ou arquivo", "click": "selecionar pasta ou arquivo",
+3 -1
View File
@@ -42,6 +42,7 @@
"update": "Atualizar", "update": "Atualizar",
"upload": "Enviar", "upload": "Enviar",
"openFile": "Open file", "openFile": "Open file",
"openDirect": "View raw",
"discardChanges": "Discard", "discardChanges": "Discard",
"stopSearch": "Stop searching", "stopSearch": "Stop searching",
"saveChanges": "Save changes", "saveChanges": "Save changes",
@@ -88,7 +89,8 @@
"comma": "Comma (,)", "comma": "Comma (,)",
"semicolon": "Semicolon (;)", "semicolon": "Semicolon (;)",
"both": "Both (,) and (;)" "both": "Both (,) and (;)"
} },
"fileEncoding": "File Encoding"
}, },
"help": { "help": {
"click": "selecionar pasta ou ficheiro", "click": "selecionar pasta ou ficheiro",
+3 -1
View File
@@ -42,6 +42,7 @@
"update": "Actualizează", "update": "Actualizează",
"upload": "Încarcă", "upload": "Încarcă",
"openFile": "Open file", "openFile": "Open file",
"openDirect": "View raw",
"discardChanges": "Discard", "discardChanges": "Discard",
"stopSearch": "Stop searching", "stopSearch": "Stop searching",
"saveChanges": "Save changes", "saveChanges": "Save changes",
@@ -88,7 +89,8 @@
"comma": "Comma (,)", "comma": "Comma (,)",
"semicolon": "Semicolon (;)", "semicolon": "Semicolon (;)",
"both": "Both (,) and (;)" "both": "Both (,) and (;)"
} },
"fileEncoding": "File Encoding"
}, },
"help": { "help": {
"click": "alege fișier sau director", "click": "alege fișier sau director",
+3 -1
View File
@@ -42,6 +42,7 @@
"update": "Обновить", "update": "Обновить",
"upload": "Загрузить", "upload": "Загрузить",
"openFile": "Открыть файл", "openFile": "Открыть файл",
"openDirect": "View raw",
"discardChanges": "Отказаться", "discardChanges": "Отказаться",
"stopSearch": "Stop searching", "stopSearch": "Stop searching",
"saveChanges": "Сохранить", "saveChanges": "Сохранить",
@@ -88,7 +89,8 @@
"comma": "Запятая (,)", "comma": "Запятая (,)",
"semicolon": "Точка с запятой (;)", "semicolon": "Точка с запятой (;)",
"both": "Оба варианта — (,) и (;)" "both": "Оба варианта — (,) и (;)"
} },
"fileEncoding": "File Encoding"
}, },
"help": { "help": {
"click": "выбрать файл или каталог", "click": "выбрать файл или каталог",
+3 -1
View File
@@ -42,6 +42,7 @@
"update": "Aktualizovať", "update": "Aktualizovať",
"upload": "Nahrať", "upload": "Nahrať",
"openFile": "Otvoriť súbor", "openFile": "Otvoriť súbor",
"openDirect": "View raw",
"discardChanges": "Zahodiť", "discardChanges": "Zahodiť",
"stopSearch": "Stop searching", "stopSearch": "Stop searching",
"saveChanges": "Uložiť zmeny", "saveChanges": "Uložiť zmeny",
@@ -88,7 +89,8 @@
"comma": "Comma (,)", "comma": "Comma (,)",
"semicolon": "Semicolon (;)", "semicolon": "Semicolon (;)",
"both": "Both (,) and (;)" "both": "Both (,) and (;)"
} },
"fileEncoding": "File Encoding"
}, },
"help": { "help": {
"click": "vyberie súbor alebo priečinok", "click": "vyberie súbor alebo priečinok",
+3 -1
View File
@@ -42,6 +42,7 @@
"update": "Uppdatera", "update": "Uppdatera",
"upload": "Ladda upp", "upload": "Ladda upp",
"openFile": "Öppna fil", "openFile": "Öppna fil",
"openDirect": "View raw",
"discardChanges": "Förkasta", "discardChanges": "Förkasta",
"stopSearch": "Stop searching", "stopSearch": "Stop searching",
"saveChanges": "Spara ändringar", "saveChanges": "Spara ändringar",
@@ -88,7 +89,8 @@
"comma": "Comma (,)", "comma": "Comma (,)",
"semicolon": "Semicolon (;)", "semicolon": "Semicolon (;)",
"both": "Both (,) and (;)" "both": "Both (,) and (;)"
} },
"fileEncoding": "File Encoding"
}, },
"help": { "help": {
"click": "välj fil eller mapp", "click": "välj fil eller mapp",
+3 -1
View File
@@ -42,6 +42,7 @@
"update": "Güncelle", "update": "Güncelle",
"upload": "Yükle", "upload": "Yükle",
"openFile": "Dosyayı aç", "openFile": "Dosyayı aç",
"openDirect": "View raw",
"discardChanges": "Discard", "discardChanges": "Discard",
"stopSearch": "Stop searching", "stopSearch": "Stop searching",
"saveChanges": "Save changes", "saveChanges": "Save changes",
@@ -88,7 +89,8 @@
"comma": "Comma (,)", "comma": "Comma (,)",
"semicolon": "Semicolon (;)", "semicolon": "Semicolon (;)",
"both": "Both (,) and (;)" "both": "Both (,) and (;)"
} },
"fileEncoding": "File Encoding"
}, },
"help": { "help": {
"click": "dosya veya klasör seçin", "click": "dosya veya klasör seçin",
+3 -1
View File
@@ -42,6 +42,7 @@
"update": "Оновити", "update": "Оновити",
"upload": "Вивантажити", "upload": "Вивантажити",
"openFile": "Відкрити файл", "openFile": "Відкрити файл",
"openDirect": "View raw",
"discardChanges": "Скасувати", "discardChanges": "Скасувати",
"stopSearch": "Stop searching", "stopSearch": "Stop searching",
"saveChanges": "Save changes", "saveChanges": "Save changes",
@@ -88,7 +89,8 @@
"comma": "Comma (,)", "comma": "Comma (,)",
"semicolon": "Semicolon (;)", "semicolon": "Semicolon (;)",
"both": "Both (,) and (;)" "both": "Both (,) and (;)"
} },
"fileEncoding": "File Encoding"
}, },
"help": { "help": {
"click": "вибрати файл чи каталог", "click": "вибрати файл чи каталог",
+3 -1
View File
@@ -42,6 +42,7 @@
"update": "Cập nhật", "update": "Cập nhật",
"upload": "Tải lên", "upload": "Tải lên",
"openFile": "Mở tệp", "openFile": "Mở tệp",
"openDirect": "View raw",
"discardChanges": "Hủy bỏ thay đổi", "discardChanges": "Hủy bỏ thay đổi",
"stopSearch": "Stop searching", "stopSearch": "Stop searching",
"saveChanges": "Save changes", "saveChanges": "Save changes",
@@ -88,7 +89,8 @@
"comma": "Comma (,)", "comma": "Comma (,)",
"semicolon": "Semicolon (;)", "semicolon": "Semicolon (;)",
"both": "Both (,) and (;)" "both": "Both (,) and (;)"
} },
"fileEncoding": "File Encoding"
}, },
"help": { "help": {
"click": "chọn tập tin hoặc thư mục", "click": "chọn tập tin hoặc thư mục",
+4 -2
View File
@@ -42,6 +42,7 @@
"update": "更新", "update": "更新",
"upload": "上传", "upload": "上传",
"openFile": "打开文件", "openFile": "打开文件",
"openDirect": "View raw",
"discardChanges": "放弃更改", "discardChanges": "放弃更改",
"stopSearch": "停止搜索", "stopSearch": "停止搜索",
"saveChanges": "保存更改", "saveChanges": "保存更改",
@@ -88,7 +89,8 @@
"comma": "逗号 (,)", "comma": "逗号 (,)",
"semicolon": "分号 (;)", "semicolon": "分号 (;)",
"both": "逗号 (,) 和分号 (;)" "both": "逗号 (,) 和分号 (;)"
} },
"fileEncoding": "File Encoding"
}, },
"help": { "help": {
"click": "选择文件或文件夹", "click": "选择文件或文件夹",
@@ -232,7 +234,7 @@
"permissions": "权限", "permissions": "权限",
"permissionsHelp": "你可以将该用户设置为管理员或单独选择各项权限。如果你选择了“管理员”,则其他的选项会被自动选中,同时该用户可以管理其他用户。\n", "permissionsHelp": "你可以将该用户设置为管理员或单独选择各项权限。如果你选择了“管理员”,则其他的选项会被自动选中,同时该用户可以管理其他用户。\n",
"profileSettings": "个人设置", "profileSettings": "个人设置",
"redirectAfterCopyMove": "Redirect to destination after copy/move", "redirectAfterCopyMove": "复制/移动后转到目标位置",
"ruleExample1": "阻止用户访问所有文件夹下任何以 . 开头的文件(隐藏文件, 例如: .git, .gitignore)。\n", "ruleExample1": "阻止用户访问所有文件夹下任何以 . 开头的文件(隐藏文件, 例如: .git, .gitignore)。\n",
"ruleExample2": "阻止用户访问其目录范围的根目录下名为 Caddyfile 的文件。", "ruleExample2": "阻止用户访问其目录范围的根目录下名为 Caddyfile 的文件。",
"rules": "规则", "rules": "规则",
+3 -1
View File
@@ -42,6 +42,7 @@
"update": "更新", "update": "更新",
"upload": "上傳", "upload": "上傳",
"openFile": "開啟檔案", "openFile": "開啟檔案",
"openDirect": "View raw",
"discardChanges": "放棄變更", "discardChanges": "放棄變更",
"stopSearch": "Stop searching", "stopSearch": "Stop searching",
"saveChanges": "Save changes", "saveChanges": "Save changes",
@@ -88,7 +89,8 @@
"comma": "Comma (,)", "comma": "Comma (,)",
"semicolon": "Semicolon (;)", "semicolon": "Semicolon (;)",
"both": "Both (,) and (;)" "both": "Both (,) and (;)"
} },
"fileEncoding": "File Encoding"
}, },
"help": { "help": {
"click": "選擇檔案或目錄", "click": "選擇檔案或目錄",
-3
View File
@@ -2,7 +2,6 @@ import { disableExternal } from "@/utils/constants";
import { createApp } from "vue"; import { createApp } from "vue";
import VueNumberInput from "@chenfengyuan/vue-number-input"; import VueNumberInput from "@chenfengyuan/vue-number-input";
import VueLazyload from "vue-lazyload"; import VueLazyload from "vue-lazyload";
import { createVfm } from "vue-final-modal";
import Toast, { POSITION, useToast } from "vue-toastification"; import Toast, { POSITION, useToast } from "vue-toastification";
import type { import type {
ToastOptions, ToastOptions,
@@ -27,7 +26,6 @@ dayjs.extend(relativeTime);
dayjs.extend(duration); dayjs.extend(duration);
const pinia = createPinia(router); const pinia = createPinia(router);
const vfm = createVfm();
const app = createApp(App); const app = createApp(App);
@@ -39,7 +37,6 @@ app.use(Toast, {
newestOnTop: true, newestOnTop: true,
} satisfies PluginOptions); } satisfies PluginOptions);
app.use(vfm);
app.use(i18n); app.use(i18n);
app.use(pinia); app.use(pinia);
app.use(router); app.use(router);
+1 -1
View File
@@ -76,7 +76,7 @@ export const useLayoutStore = defineStore("layout", {
}); });
}, },
closeHovers() { closeHovers() {
this.prompts.shift()?.close?.(); this.prompts.pop()?.close?.();
}, },
// easily reset state using `$reset` // easily reset state using `$reset`
clearLayout() { clearLayout() {
+6
View File
@@ -21,6 +21,7 @@ interface Resource extends ResourceBase {
index: number; index: number;
subtitles?: string[]; subtitles?: string[];
content?: string; content?: string;
rawContent?: ArrayBuffer;
} }
interface ResourceItem extends ResourceBase { interface ResourceItem extends ResourceBase {
@@ -57,3 +58,8 @@ interface BreadCrumb {
name: string; name: string;
url: string; url: string;
} }
interface CsvData {
headers: string[];
rows: string[][];
}
-64
View File
@@ -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 };
}
+95
View File
@@ -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);
}
+42 -19
View File
@@ -94,6 +94,7 @@ import { useFileStore } from "@/stores/file";
import { useLayoutStore } from "@/stores/layout"; import { useLayoutStore } from "@/stores/layout";
import { getEditorTheme } from "@/utils/theme"; import { getEditorTheme } from "@/utils/theme";
import { marked } from "marked"; import { marked } from "marked";
import markedKatex from "marked-katex-extension";
import { inject, onBeforeUnmount, onMounted, ref, watchEffect } from "vue"; import { inject, onBeforeUnmount, onMounted, ref, watchEffect } from "vue";
import { useI18n } from "vue-i18n"; import { useI18n } from "vue-i18n";
import { onBeforeRouteUpdate, useRoute, useRouter } from "vue-router"; import { onBeforeRouteUpdate, useRoute, useRouter } from "vue-router";
@@ -118,6 +119,11 @@ const previewContent = ref("");
const isMarkdownFile = const isMarkdownFile =
fileStore.req?.name.endsWith(".md") || fileStore.req?.name.endsWith(".md") ||
fileStore.req?.name.endsWith(".markdown"); fileStore.req?.name.endsWith(".markdown");
const katexOptions = {
output: "mathml" as const,
throwOnError: false,
};
marked.use(markedKatex(katexOptions));
const isSelectionEmpty = ref(true); const isSelectionEmpty = ref(true);
@@ -171,25 +177,19 @@ onMounted(() => {
`https://cdn.jsdelivr.net/npm/ace-builds@${ace_version}/src-min-noconflict/` `https://cdn.jsdelivr.net/npm/ace-builds@${ace_version}/src-min-noconflict/`
); );
editor.value = ace.edit("editor", { if (!layoutStore.loading) {
value: fileContent, initEditor(fileContent);
showPrintMargin: false, } else {
readOnly: fileStore.req?.type === "textImmutable", const unwatch = watchEffect(() => {
theme: getEditorTheme(authStore.user?.aceEditorTheme ?? ""), // Initialize editor when layout is loaded
mode: modelist.getModeForPath(fileStore.req!.name).mode, if (!layoutStore.loading) {
wrap: true, setTimeout(() => {
enableBasicAutocompletion: true, initEditor(fileContent);
enableLiveAutocompletion: true, unwatch();
enableSnippets: true, }, 50);
}); }
});
editor.value.setFontSize(fontSize.value); }
editor.value.focus();
editor.value.getSelection().on("changeSelection", () => {
isSelectionEmpty.value =
editor.value == null || editor.value.getSelectedText().length == 0;
});
}); });
onBeforeUnmount(() => { onBeforeUnmount(() => {
@@ -218,6 +218,28 @@ 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 selection = editor.value?.getSelection();
selection.on("changeSelection", function () {
isSelectionEmpty.value = selection.isEmpty();
});
};
const keyEvent = (event: KeyboardEvent) => { const keyEvent = (event: KeyboardEvent) => {
if (event.code === "Escape") { if (event.code === "Escape") {
close(); close();
@@ -279,6 +301,7 @@ const close = () => {
prompt: "discardEditorChanges", prompt: "discardEditorChanges",
confirm: (event: Event) => { confirm: (event: Event) => {
event.preventDefault(); event.preventDefault();
editor.value?.session.getUndoManager().reset();
finishClose(); finishClose();
}, },
saveAction: async () => { saveAction: async () => {
+21 -2
View File
@@ -46,6 +46,16 @@
:label="$t('buttons.download')" :label="$t('buttons.download')"
@action="download" @action="download"
/> />
<action
:disabled="layoutStore.loading"
v-if="
['image', 'audio', 'video'].includes(fileStore.req?.type || '') &&
authStore.user?.perm.download
"
icon="open_in_new"
:label="t('buttons.openDirect')"
@action="openDirect"
/>
<action <action
:disabled="layoutStore.loading" :disabled="layoutStore.loading"
icon="info" icon="info"
@@ -253,7 +263,7 @@ const hoverNav = ref<boolean>(false);
const autoPlay = ref<boolean>(false); const autoPlay = ref<boolean>(false);
const previousRaw = ref<string>(""); const previousRaw = ref<string>("");
const nextRaw = ref<string>(""); const nextRaw = ref<string>("");
const csvContent = ref<string>(""); const csvContent = ref<ArrayBuffer | string>("");
const csvError = ref<string>(""); const csvError = ref<string>("");
const player = ref<HTMLVideoElement | HTMLAudioElement | null>(null); const player = ref<HTMLVideoElement | HTMLAudioElement | null>(null);
@@ -277,6 +287,10 @@ const downloadUrl = computed(() =>
fileStore.req ? api.getDownloadURL(fileStore.req, false) : "" fileStore.req ? api.getDownloadURL(fileStore.req, false) : ""
); );
const directUrl = computed(() =>
fileStore.req ? api.getDownloadURL(fileStore.req, true) : ""
);
const previewUrl = computed(() => { const previewUrl = computed(() => {
if (!fileStore.req) { if (!fileStore.req) {
return ""; return "";
@@ -393,7 +407,11 @@ const updatePreview = async () => {
if (fileStore.req.size > CSV_MAX_SIZE) { if (fileStore.req.size > CSV_MAX_SIZE) {
csvError.value = t("files.csvTooLarge"); csvError.value = t("files.csvTooLarge");
} else { } else {
csvContent.value = fileStore.req.content ?? ""; if (fileStore.req.rawContent != null) {
csvContent.value = fileStore.req.rawContent;
} else {
csvContent.value = fileStore.req.content ?? "";
}
} }
} }
@@ -466,6 +484,7 @@ const close = () => {
}; };
const download = () => window.open(downloadUrl.value); const download = () => window.open(downloadUrl.value);
const openDirect = () => window.open(directUrl.value);
const editAsText = () => { const editAsText = () => {
router.push({ path: route.path, query: { edit: "true" } }); router.push({ path: route.path, query: { edit: "true" } });
+7 -6
View File
@@ -16,7 +16,7 @@ require (
github.com/marusama/semaphore/v2 v2.5.0 github.com/marusama/semaphore/v2 v2.5.0
github.com/mholt/archives v0.1.5 github.com/mholt/archives v0.1.5
github.com/mitchellh/go-homedir v1.1.0 github.com/mitchellh/go-homedir v1.1.0
github.com/redis/go-redis/v9 v9.17.3 github.com/redis/go-redis/v9 v9.18.0
github.com/samber/lo v1.52.0 github.com/samber/lo v1.52.0
github.com/shirou/gopsutil/v4 v4.26.1 github.com/shirou/gopsutil/v4 v4.26.1
github.com/spf13/afero v1.15.0 github.com/spf13/afero v1.15.0
@@ -25,9 +25,9 @@ require (
github.com/spf13/viper v1.21.0 github.com/spf13/viper v1.21.0
github.com/stretchr/testify v1.11.1 github.com/stretchr/testify v1.11.1
github.com/tomasen/realip v0.0.0-20180522021738-f0c99a92ddce github.com/tomasen/realip v0.0.0-20180522021738-f0c99a92ddce
golang.org/x/crypto v0.47.0 golang.org/x/crypto v0.48.0
golang.org/x/image v0.35.0 golang.org/x/image v0.36.0
golang.org/x/text v0.33.0 golang.org/x/text v0.34.0
gopkg.in/natefinch/lumberjack.v2 v2.2.1 gopkg.in/natefinch/lumberjack.v2 v2.2.1
gopkg.in/yaml.v3 v3.0.1 gopkg.in/yaml.v3 v3.0.1
) )
@@ -74,11 +74,12 @@ require (
github.com/ulikunitz/xz v0.5.15 // indirect github.com/ulikunitz/xz v0.5.15 // indirect
github.com/yusufpapurcu/wmi v1.2.4 // indirect github.com/yusufpapurcu/wmi v1.2.4 // indirect
go.etcd.io/bbolt v1.4.3 // indirect go.etcd.io/bbolt v1.4.3 // indirect
go.uber.org/atomic v1.11.0 // indirect
go.yaml.in/yaml/v3 v3.0.4 // indirect go.yaml.in/yaml/v3 v3.0.4 // indirect
go4.org v0.0.0-20230225012048-214862532bf5 // 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/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/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect
) )
+19 -12
View File
@@ -166,7 +166,10 @@ github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+o
github.com/klauspost/compress v1.4.1/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/compress v1.4.1/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A=
github.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo= github.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo=
github.com/klauspost/compress v1.18.0/go.mod h1:2Pp+KzxcywXVXMr50+X0Q/Lsb43OQHYWRCY2AiWywWQ= github.com/klauspost/compress v1.18.0/go.mod h1:2Pp+KzxcywXVXMr50+X0Q/Lsb43OQHYWRCY2AiWywWQ=
github.com/klauspost/cpuid v1.2.0 h1:NMpwD2G9JSFOE1/TJjGSo5zG7Yb2bTe7eq1jH+irmeE=
github.com/klauspost/cpuid v1.2.0/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/klauspost/cpuid v1.2.0/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek=
github.com/klauspost/cpuid/v2 v2.0.9 h1:lgaqFMSdTdQYdZ04uHyN2d/eKdOMyi2YLSvlQIBFYa4=
github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg=
github.com/klauspost/pgzip v1.2.6 h1:8RXeL5crjEUFnR2/Sn6GJNWtSQ3Dk8pq4CL3jvdDyjU= github.com/klauspost/pgzip v1.2.6 h1:8RXeL5crjEUFnR2/Sn6GJNWtSQ3Dk8pq4CL3jvdDyjU=
github.com/klauspost/pgzip v1.2.6/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= github.com/klauspost/pgzip v1.2.6/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
@@ -202,8 +205,8 @@ github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH
github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 h1:o4JXh1EVt9k/+g42oCprj/FisM4qX9L3sZB3upGN2ZU= github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 h1:o4JXh1EVt9k/+g42oCprj/FisM4qX9L3sZB3upGN2ZU=
github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE=
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/redis/go-redis/v9 v9.17.3 h1:fN29NdNrE17KttK5Ndf20buqfDZwGNgoUr9qjl1DQx4= github.com/redis/go-redis/v9 v9.18.0 h1:pMkxYPkEbMPwRdenAzUNyFNrDgHx9U+DrBabWNfSRQs=
github.com/redis/go-redis/v9 v9.17.3/go.mod h1:u410H11HMLoB+TP67dz8rL9s6QW2j76l0//kSOd3370= github.com/redis/go-redis/v9 v9.18.0/go.mod h1:k3ufPphLU5YXwNTUcCRXGxUoF1fqxnhFQmscfkCoDA0=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8=
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
@@ -257,6 +260,8 @@ github.com/xyproto/randomstring v1.0.5/go.mod h1:rgmS5DeNXLivK7YprL0pY+lTuhNQW3i
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0= github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0=
github.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= github.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0=
github.com/zeebo/xxh3 v1.0.2 h1:xZmwmqxHZA8AI603jOQ0tMqmBr9lPeFwGg6d+xy9DC0=
github.com/zeebo/xxh3 v1.0.2/go.mod h1:5NWz9Sef7zIDm2JHfFlcQvNekmcEl9ekUZQQKCYaDcA=
go.etcd.io/bbolt v1.3.4/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= go.etcd.io/bbolt v1.3.4/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ=
go.etcd.io/bbolt v1.4.3 h1:dEadXpI6G79deX5prL3QRNP6JB8UxVkqo4UPnHaNXJo= go.etcd.io/bbolt v1.4.3 h1:dEadXpI6G79deX5prL3QRNP6JB8UxVkqo4UPnHaNXJo=
go.etcd.io/bbolt v1.4.3/go.mod h1:tKQlpPaYCVFctUIgFKFnAlvbmB3tpy1vkTnDWohtc0E= go.etcd.io/bbolt v1.4.3/go.mod h1:tKQlpPaYCVFctUIgFKFnAlvbmB3tpy1vkTnDWohtc0E=
@@ -264,6 +269,8 @@ go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=
go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE=
go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc= go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc=
@@ -276,8 +283,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-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-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.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.48.0 h1:/VRzVqiRSggnhY7gNRxPauEQ5Drw9haKdM0jqfcCFts=
golang.org/x/crypto v0.47.0/go.mod h1:ff3Y9VzzKbwSSEzWqJsJVBnWmRwRSHt/6Op5n9bQc4A= 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-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-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
@@ -289,8 +296,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-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-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.0.0-20191009234506-e7c1f5e7dbb8/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
golang.org/x/image v0.35.0 h1:LKjiHdgMtO8z7Fh18nGY6KDcoEtVfsgLDPeLyguqb7I= golang.org/x/image v0.36.0 h1:Iknbfm1afbgtwPTmHnS2gTM/6PPZfH+z2EFuOkSbqwc=
golang.org/x/image v0.35.0/go.mod h1:MwPLTVgvxSASsxdLzKrl8BRFuyqMyGhLwmC+TO1Sybk= 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-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-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
@@ -329,8 +336,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-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.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.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.48.0 h1:zyQRTTrjc33Lhh0fBgT/H3oZq9WuvRR5gPC70xpDiQU= golang.org/x/net v0.49.0 h1:eeHFmOGUTtaaPSGNmjBKpbng9MulQsJURQUAfUwY++o=
golang.org/x/net v0.48.0/go.mod h1:+ndRgGjkh8FGtu1w1FGbEC31if4VrNVMuKTgcAAnQRY= 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-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-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
@@ -370,8 +377,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.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.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.5.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.41.0 h1:Ivj+2Cp/ylzLiEU89QhWblYnOE9zerudt9Ftecq2C6k=
golang.org/x/sys v0.40.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= 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-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.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
@@ -382,8 +389,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.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.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.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.33.0 h1:B3njUFyqtHDUI5jMn1YIr5B0IE2U0qck04r6d4KPAxE= golang.org/x/text v0.34.0 h1:oL/Qq0Kdaqxa1KbNeMKwQq0reLCCaFtqu2eNuSeNHbk=
golang.org/x/text v0.33.0/go.mod h1:LuMebE6+rBincTi9+xWTY8TztLzKHc/9C1uBCG27+q8= 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-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/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= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
-5
View File
@@ -35,11 +35,6 @@ func NewHandler(
}) })
index, static := getStaticHandlers(store, server, assetsFs) 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 { monkey := func(fn handleFunc, prefix string) http.Handler {
return handle(fn, prefix, store, server) return handle(fn, prefix, store, server)
} }
+21
View File
@@ -36,10 +36,31 @@ var resourceGetHandler = withUser(func(w http.ResponseWriter, r *http.Request, d
return errToStatus(err), err return errToStatus(err), err
} }
encoding := r.Header.Get("X-Encoding")
if file.IsDir { if file.IsDir {
file.Sorting = d.user.Sorting file.Sorting = d.user.Sorting
file.ApplySort() file.ApplySort()
return renderJSON(w, r, file) 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 != "" { if checksum := r.URL.Query().Get("checksum"); checksum != "" {
+23 -5
View File
@@ -5,6 +5,8 @@ import (
"errors" "errors"
"fmt" "fmt"
"io/fs" "io/fs"
"io"
"compress/gzip"
"log" "log"
"net/http" "net/http"
"os" "os"
@@ -144,16 +146,32 @@ func getStaticHandlers(store *storage.Storage, server *settings.Server, assetsFs
return 0, nil return 0, nil
} }
fileContents, err := fs.ReadFile(assetsFs, r.URL.Path+".gz") f, err := assetsFs.Open(r.URL.Path + ".gz")
if err != nil { if err != nil {
return http.StatusNotFound, err return http.StatusNotFound, err
} }
defer f.Close()
w.Header().Set("Content-Encoding", "gzip") acceptEncoding := r.Header.Get("Accept-Encoding")
w.Header().Set("Content-Type", "application/javascript; charset=utf-8") 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 { if _, err := io.Copy(w, f); err != nil {
return http.StatusInternalServerError, err 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 return 0, nil
+2 -1
View File
@@ -7,6 +7,7 @@ import (
"net/http" "net/http"
"sort" "sort"
"strconv" "strconv"
"strings"
"github.com/gorilla/mux" "github.com/gorilla/mux"
"golang.org/x/text/cases" "golang.org/x/text/cases"
@@ -190,7 +191,7 @@ var userPutHandler = withSelfOrAdmin(func(w http.ResponseWriter, r *http.Request
} }
for _, field := range req.Which { 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) { if !users.CheckPwd(req.CurrentPassword, d.user.Password) {
return http.StatusBadRequest, fberrors.ErrCurrentPasswordIncorrect return http.StatusBadRequest, fberrors.ErrCurrentPasswordIncorrect
} }
+1
View File
@@ -1,3 +1,4 @@
//nolint:revive
package version package version
var ( var (
+115 -1
View File
@@ -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. > 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. 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.