Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
23a2c60d9f | ||
|
|
54e66bbc05 | ||
|
|
69b262f91a | ||
|
|
731cc45e05 | ||
|
|
a3960ff9a3 | ||
|
|
5f986901e9 | ||
|
|
0b4d8df22d | ||
|
|
9619b4ee1d | ||
|
|
c75f3e0f59 | ||
|
|
6d71ab08ce | ||
|
|
121c695c1a | ||
|
|
6a1f9bbf69 | ||
|
|
ab54bc3c57 | ||
|
|
8a10baa815 | ||
|
|
98c22ece8d | ||
|
|
63247f6e8c | ||
|
|
58dd812008 | ||
|
|
1575fafec8 | ||
|
|
8c935eb51d | ||
|
|
7f3a26e1c0 | ||
|
|
fe834aa244 | ||
|
|
6620a1bf41 | ||
|
|
dab08325b7 | ||
|
|
ddb4685257 | ||
|
|
39dbca3b15 | ||
|
|
a02bdfc8d5 | ||
|
|
f88721cc83 | ||
|
|
95544bfed5 | ||
|
|
999ee1c2f5 | ||
|
|
a61ade62e5 | ||
|
|
08de5efeb4 | ||
|
|
74f690a71b | ||
|
|
1d4a3005ff | ||
|
|
7447a530ee | ||
|
|
fa9396f0f4 | ||
|
|
172bbb1828 | ||
|
|
410aa5d9da | ||
|
|
736cef7127 | ||
|
|
f4ceb7163e | ||
|
|
7bd4fbc0cb | ||
|
|
2ed4658369 | ||
|
|
735312982c | ||
|
|
4ddb3f5a34 | ||
|
|
c947228ac4 | ||
|
|
505af7d9d7 | ||
|
|
2c13ac4ac1 | ||
|
|
b5fbab2072 |
No files matched your search
@@ -8,3 +8,5 @@ yarn-debug.log*
|
|||||||
yarn-error.log*
|
yarn-error.log*
|
||||||
.idea
|
.idea
|
||||||
.vscode
|
.vscode
|
||||||
|
package-lock.json
|
||||||
|
yarn.lock
|
||||||
@@ -8,11 +8,17 @@ build:
|
|||||||
- freebsd
|
- freebsd
|
||||||
- netbsd
|
- netbsd
|
||||||
- openbsd
|
- openbsd
|
||||||
|
- dragonfly
|
||||||
|
- solaris
|
||||||
goarch:
|
goarch:
|
||||||
- amd64
|
- amd64
|
||||||
- 386
|
- 386
|
||||||
- arm
|
- arm
|
||||||
- arm64
|
- arm64
|
||||||
|
- mips
|
||||||
|
- mips64
|
||||||
|
- mipsle
|
||||||
|
- mips64le
|
||||||
ignore:
|
ignore:
|
||||||
- goos: openbsd
|
- goos: openbsd
|
||||||
goarch: arm
|
goarch: arm
|
||||||
@@ -20,6 +26,8 @@ build:
|
|||||||
- goos: freebsd
|
- goos: freebsd
|
||||||
goarch: arm
|
goarch: arm
|
||||||
goarm: 6
|
goarm: 6
|
||||||
|
- goos: linux
|
||||||
|
goarch: arm64
|
||||||
|
|
||||||
archive:
|
archive:
|
||||||
name_template: "{{.Os}}-{{.Arch}}-{{ .ProjectName }}"
|
name_template: "{{.Os}}-{{.Arch}}-{{ .ProjectName }}"
|
||||||
|
|||||||
+1
-1
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
If you want to contribute or want to build the code from source, you will need to have the most recent version of Go and, if you want to change the static assets (JS, CSS, ...), Node.js installed on your computer. To start developing, you just need to do the following:
|
If you want to contribute or want to build the code from source, you will need to have the most recent version of Go and, if you want to change the static assets (JS, CSS, ...), Node.js installed on your computer. To start developing, you just need to do the following:
|
||||||
|
|
||||||
1. `go get github.com/hacdias/filemanager`
|
1. `go get github.com/hacdias/filemanager/cmd/filemanager`
|
||||||
2. `cd $GOPATH/src/github.com/hacdias/filemanager`
|
2. `cd $GOPATH/src/github.com/hacdias/filemanager`
|
||||||
3. `npm install`
|
3. `npm install`
|
||||||
4. `npm run dev` - regenerates the static assets automatically
|
4. `npm run dev` - regenerates the static assets automatically
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
[](https://travis-ci.org/hacdias/filemanager)
|
[](https://travis-ci.org/hacdias/filemanager)
|
||||||
[](https://goreportcard.com/report/hacdias/filemanager)
|
[](https://goreportcard.com/report/hacdias/filemanager)
|
||||||
[](http://godoc.org/github.com/hacdias/filemanager)
|
[](http://godoc.org/github.com/hacdias/filemanager)
|
||||||
|
[](https://github.com/hacdias/filemanager/releases/latest)
|
||||||
|
|
||||||
filemanager provides a file managing interface within a specified directory and it can be used to upload, delete, preview, rename and edit your files. It allows the creation of multiple users and each user can have its own directory. It can be used as a standalone app or as a middleware.
|
filemanager provides a file managing interface within a specified directory and it can be used to upload, delete, preview, rename and edit your files. It allows the creation of multiple users and each user can have its own directory. It can be used as a standalone app or as a middleware.
|
||||||
|
|
||||||
@@ -72,7 +73,3 @@ this are keywords case:insensitive
|
|||||||
# Contributing
|
# Contributing
|
||||||
|
|
||||||
The contributing guidelines can be found [here](https://github.com/hacdias/filemanager/blob/master/CONTRIBUTING.md).
|
The contributing guidelines can be found [here](https://github.com/hacdias/filemanager/blob/master/CONTRIBUTING.md).
|
||||||
|
|
||||||
# Donate
|
|
||||||
|
|
||||||
Enjoying this project? You can [donate to its creator](https://henriquedias.com/donate/). He will appreciate.
|
|
||||||
@@ -6,6 +6,7 @@
|
|||||||
<option value="ja">{{ $t('languages.ja') }}</option>
|
<option value="ja">{{ $t('languages.ja') }}</option>
|
||||||
<option value="zh-cn">{{ $t('languages.zhCN') }}</option>
|
<option value="zh-cn">{{ $t('languages.zhCN') }}</option>
|
||||||
<option value="zh-tw">{{ $t('languages.zhTW') }}</option>
|
<option value="zh-tw">{{ $t('languages.zhTW') }}</option>
|
||||||
|
<option value="es">{{ $t('languages.es') }}</option>
|
||||||
</select>
|
</select>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
@@ -48,6 +48,10 @@ export default {
|
|||||||
new (url, type) {
|
new (url, type) {
|
||||||
url = removePrefix(url)
|
url = removePrefix(url)
|
||||||
|
|
||||||
|
if (!url.endsWith('.md') && !url.endsWith('.markdown')) {
|
||||||
|
url += '.markdown'
|
||||||
|
}
|
||||||
|
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
let request = new window.XMLHttpRequest()
|
let request = new window.XMLHttpRequest()
|
||||||
request.open('POST', `${this.$store.state.baseURL}/api/resource${url}`, true)
|
request.open('POST', `${this.$store.state.baseURL}/api/resource${url}`, true)
|
||||||
|
|||||||
@@ -192,6 +192,7 @@ languages:
|
|||||||
ja: 日本語
|
ja: 日本語
|
||||||
zhCN: 中文 (简体)
|
zhCN: 中文 (简体)
|
||||||
zhTW: 中文 (繁體)
|
zhTW: 中文 (繁體)
|
||||||
|
es: Español
|
||||||
time:
|
time:
|
||||||
unit: Time Unit
|
unit: Time Unit
|
||||||
seconds: Seconds
|
seconds: Seconds
|
||||||
|
|||||||
@@ -0,0 +1,202 @@
|
|||||||
|
permanent: Permanente
|
||||||
|
buttons:
|
||||||
|
cancel: Cancelar
|
||||||
|
close: Cerrar
|
||||||
|
copy: Copiar
|
||||||
|
copyFile: Copiar archivo
|
||||||
|
copyToClipboard: Copiar al portapapeles
|
||||||
|
create: Crear
|
||||||
|
delete: Borrar
|
||||||
|
download: Descargar
|
||||||
|
info: Info
|
||||||
|
more: Más
|
||||||
|
move: Mover
|
||||||
|
moveFile: Mover archivo
|
||||||
|
new: Nuevo
|
||||||
|
next: Siguiente
|
||||||
|
ok: OK
|
||||||
|
replace: Reemplazar
|
||||||
|
previous: Anterior
|
||||||
|
rename: Renombrar
|
||||||
|
reportIssue: Reportar problema
|
||||||
|
save: Guardar
|
||||||
|
search: Buscar
|
||||||
|
select: Seleccionar
|
||||||
|
share: Compartir
|
||||||
|
publish: Publicar
|
||||||
|
selectMultiple: Selección múltiple
|
||||||
|
schedule: Programar
|
||||||
|
switchView: Cambiar vista
|
||||||
|
toggleSidebar: Mostrar/Ocultar menú
|
||||||
|
update: Actualizar
|
||||||
|
upload: Subir
|
||||||
|
permalink: Link permanente
|
||||||
|
success:
|
||||||
|
linkCopied: ¡Link copiado!
|
||||||
|
errors:
|
||||||
|
forbidden: No eres bienvenido aquí.
|
||||||
|
internal: La verdad es que algo ha ido mal.
|
||||||
|
notFound: No se puede acceder a este lugar.
|
||||||
|
files:
|
||||||
|
folders: Carpetas
|
||||||
|
files: Archivos
|
||||||
|
body: Cuerpo
|
||||||
|
clear: Limpiar
|
||||||
|
closePreview: Cerrar vista previa
|
||||||
|
home: Inicio
|
||||||
|
lastModified: Última modificación
|
||||||
|
loading: Cargando...
|
||||||
|
lonely: Uno se siente muy sólo aquí...
|
||||||
|
metadata: Metadatos
|
||||||
|
multipleSelectionEnabled: Selección múltiple activada
|
||||||
|
name: Nombre
|
||||||
|
size: Tamaño
|
||||||
|
sortByName: Ordenar por nombre
|
||||||
|
sortBySize: Ordenar por tamaño
|
||||||
|
sortByLastModified: Ordenar por última modificación
|
||||||
|
help:
|
||||||
|
click: seleccionar archivo o carpeta
|
||||||
|
ctrl:
|
||||||
|
click: seleccionar múltiples archivos o carpetas
|
||||||
|
f: abre la búsqueda
|
||||||
|
s: guarda un archivo o lo descarga a la carpeta en la que estás
|
||||||
|
del: elimina los items seleccionados
|
||||||
|
doubleClick: abre un archivo o carpeta
|
||||||
|
esc: limpia la selección y/o cierra la ventana
|
||||||
|
f1: esta información
|
||||||
|
f2: renombrar archivo
|
||||||
|
help: Ayuda
|
||||||
|
login:
|
||||||
|
password: Contraseña
|
||||||
|
submit: Iniciar sesión
|
||||||
|
username: Usuario
|
||||||
|
wrongCredentials: Usuario y/o contraseña incorrectos
|
||||||
|
prompts:
|
||||||
|
copy: Copiar
|
||||||
|
copyMessage: 'Elige el lugar donde quieres copiar tus archivos:'
|
||||||
|
currentlyNavigating: 'Actualmente estás en:'
|
||||||
|
deleteMessageMultiple: ¿Estás seguro que quieres eliminar {count} archivo(s)?
|
||||||
|
deleteMessageSingle: ¿Estás seguro que quieres eliminar este archivo/carpeta?
|
||||||
|
deleteTitle: Borrar archivos
|
||||||
|
displayName: 'Nombre:'
|
||||||
|
download: Descargar archivos
|
||||||
|
downloadMessage: Elige el formato de descarga.
|
||||||
|
error: Algo ha fallado
|
||||||
|
fileInfo: Información del archivo
|
||||||
|
filesSelected: "{count} archivos seleccionados."
|
||||||
|
lastModified: Última modificación
|
||||||
|
move: Mover
|
||||||
|
moveMessage: 'Elige una nueva casa para tus archivo(s)/carpeta(s):'
|
||||||
|
newDir: Nueva carpeta
|
||||||
|
newDirMessage: Escribe el nombre de la nueva carpeta.
|
||||||
|
newFile: Nuevo archivo
|
||||||
|
newFileMessage: Escribe el nombre del nuevo archivo.
|
||||||
|
numberDirs: Número de carpetas
|
||||||
|
numberFiles: Número de archivos
|
||||||
|
replace: Reemplazar
|
||||||
|
replaceMessage: >
|
||||||
|
Uno de los archivos ue intentas subir está creando conflicto por su nombre.
|
||||||
|
¿Quieres cambiar el nombre del ya existente?
|
||||||
|
rename: Renombrar
|
||||||
|
renameMessage: Escribe el nuevo nombre para
|
||||||
|
show: Mostrar
|
||||||
|
size: Tamaño
|
||||||
|
schedule: Programar
|
||||||
|
scheduleMessage: Elige una hora y fecha para programar la publicación de este post.
|
||||||
|
newArchetype: Crea un nuevo post basado en un arquetipo. Tu archivo será creado en la carpeta de contenido.
|
||||||
|
settings:
|
||||||
|
admin: Admin
|
||||||
|
administrator: Administrador
|
||||||
|
allowCommands: Ejecutar comandos
|
||||||
|
allowEdit: Editar, renombrar y borrar archivos o carpetas
|
||||||
|
allowNew: Crear nuevos archivos y carpetas
|
||||||
|
allowPublish: Publicar nuevos posts y páginas
|
||||||
|
avoidChanges: "(dejar en blanco para evitar cambios)"
|
||||||
|
changePassword: Cambiar contraseña
|
||||||
|
commands: Comandos
|
||||||
|
commandsHelp: >
|
||||||
|
Aquí puedes crear comandos que serán ejecutados en los eventos. Debes
|
||||||
|
escribir un comando por linea. Si el evento está relacionado con archivos, como
|
||||||
|
por ejemplo, antes y después de guardar, la variable de entorno "FILE" estará
|
||||||
|
disponible en la ruta del archivo.
|
||||||
|
commandsUpdated: ¡Comandos actualizados!
|
||||||
|
customStylesheet: Modificar hoja de estilos
|
||||||
|
examples: Ejemplos
|
||||||
|
globalSettings: Ajustes globales
|
||||||
|
language: Idioma
|
||||||
|
lockPassword: Evitar que el usuario cambie la contraseña
|
||||||
|
newPassword: Tu nueva contraseña
|
||||||
|
newPasswordConfirm: Confirma tu contraseña
|
||||||
|
newUser: Nuevo usuario
|
||||||
|
password: Contraseña
|
||||||
|
passwordUpdated: ¡Contraseña actualizada!
|
||||||
|
permissions: Permisos
|
||||||
|
permissionsHelp: >
|
||||||
|
Puedes nombrar al usuario como administrador o elegir los permisos
|
||||||
|
individualmente. Si seleccionas "Administrador", todas las otras opciones
|
||||||
|
serán activadas automáticamente. La administración de usuarios es un privilegio de administrador.
|
||||||
|
profileSettings: Ajustes del perfil
|
||||||
|
ruleExample1: >
|
||||||
|
previene el acceso a una extensión de archivo (Como .git) en
|
||||||
|
cada carpeta.
|
||||||
|
ruleExample2: bloquea el acceso al archivo llamado Caddyfile en la carpeta raíz.
|
||||||
|
rules: Reglas
|
||||||
|
rulesHelp1: >
|
||||||
|
Aquí puedes definir un conjunto de reglas de permisos para este usuario
|
||||||
|
específico. Los archivos bloqueados no se mostrarán en las listas y no serán accesibles
|
||||||
|
por el usuario. Puedes utilizar regex y rutas relativas a la raíz del usuario.
|
||||||
|
rulesHelp2: >
|
||||||
|
Cada regla va en una línea diferente, y debe comenzar con la palabra clave
|
||||||
|
{0} or {1}. Entonces, debes escribir {2} si estás usando una expresión regular (REGEX) y
|
||||||
|
luego la expresión o la ruta.
|
||||||
|
scope: Raíz
|
||||||
|
settingsUpdated: ¡Ajustes actualizados!
|
||||||
|
user: Usuario
|
||||||
|
userCommands: Comandos
|
||||||
|
userCommandsHelp: >
|
||||||
|
Una lista separada por espacios con los comandos permitidos para este usuario.
|
||||||
|
Ejemplo:
|
||||||
|
userCreated: ¡Usuario creado!
|
||||||
|
userDeleted: ¡Usuario eliminado!
|
||||||
|
userManagement: Administración de usuarios
|
||||||
|
username: Usuario
|
||||||
|
users: Usuarios
|
||||||
|
userUpdated: ¡Usuario actualizado!
|
||||||
|
sidebar:
|
||||||
|
help: Ayuda
|
||||||
|
logout: Cerrar sesión
|
||||||
|
myFiles: Mis archivos
|
||||||
|
newFile: Nuevo archivo
|
||||||
|
newFolder: Nueva carpeta
|
||||||
|
settings: Ajustes
|
||||||
|
siteSettings: Ajustes del sitio
|
||||||
|
hugoNew: Nuevo Hugo
|
||||||
|
preview: Vista previa
|
||||||
|
search:
|
||||||
|
images: Images
|
||||||
|
music: Música
|
||||||
|
pdf: PDF
|
||||||
|
pressToExecute: Presiona enter para ejecutar.
|
||||||
|
pressToSearch: Presiona enter para buscar.
|
||||||
|
search: Buscar...
|
||||||
|
searchOrCommand: Buscar o ejecutar un comando...
|
||||||
|
searchOrSupportedCommand: 'Buscar o ejecutar uno de los comandos soportados:'
|
||||||
|
type: Escribe y presiona enter para buscar.
|
||||||
|
types: Tipos
|
||||||
|
video: Vídeo
|
||||||
|
writeToSearch: Escribe aquí para buscar
|
||||||
|
languages:
|
||||||
|
en: English
|
||||||
|
fr: Français
|
||||||
|
pt: Português
|
||||||
|
es: Español
|
||||||
|
ja: 日本語
|
||||||
|
zhCN: 中文 (简体)
|
||||||
|
zhTW: 中文 (繁體)
|
||||||
|
|
||||||
|
time:
|
||||||
|
unit: Unidad
|
||||||
|
seconds: Segundos
|
||||||
|
minutes: Minutos
|
||||||
|
hours: Horas
|
||||||
|
days: Días
|
||||||
@@ -185,6 +185,7 @@ languages:
|
|||||||
ja: 日本語
|
ja: 日本語
|
||||||
zhCN: 中文 (简体)
|
zhCN: 中文 (简体)
|
||||||
zhTW: 中文 (繁體)
|
zhTW: 中文 (繁體)
|
||||||
|
es: Español
|
||||||
time:
|
time:
|
||||||
unit: Unité de temps
|
unit: Unité de temps
|
||||||
seconds: Secondes
|
seconds: Secondes
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import pt from './pt.yaml'
|
|||||||
import ja from './ja.yaml'
|
import ja from './ja.yaml'
|
||||||
import zhCN from './zh-cn.yaml'
|
import zhCN from './zh-cn.yaml'
|
||||||
import zhTW from './zh-tw.yaml'
|
import zhTW from './zh-tw.yaml'
|
||||||
|
import es from './es.yaml'
|
||||||
|
|
||||||
Vue.use(VueI18n)
|
Vue.use(VueI18n)
|
||||||
|
|
||||||
@@ -33,6 +34,9 @@ export function detectLocale () {
|
|||||||
case /^zh.*/i.test(locale):
|
case /^zh.*/i.test(locale):
|
||||||
locale = 'zh-cn'
|
locale = 'zh-cn'
|
||||||
break
|
break
|
||||||
|
case /^es.*/i.test(locale):
|
||||||
|
locale = 'es'
|
||||||
|
break
|
||||||
default:
|
default:
|
||||||
locale = 'en'
|
locale = 'en'
|
||||||
}
|
}
|
||||||
@@ -49,7 +53,8 @@ const i18n = new VueI18n({
|
|||||||
'pt': pt,
|
'pt': pt,
|
||||||
'ja': ja,
|
'ja': ja,
|
||||||
'zh-cn': zhCN,
|
'zh-cn': zhCN,
|
||||||
'zh-tw': zhTW
|
'zh-tw': zhTW,
|
||||||
|
'es': es
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -192,6 +192,7 @@ languages:
|
|||||||
ja: 日本語
|
ja: 日本語
|
||||||
zhCN: 中文 (简体)
|
zhCN: 中文 (简体)
|
||||||
zhTW: 中文 (繁體)
|
zhTW: 中文 (繁體)
|
||||||
|
es: Español
|
||||||
time:
|
time:
|
||||||
unit: 時間単位
|
unit: 時間単位
|
||||||
seconds: 秒
|
seconds: 秒
|
||||||
|
|||||||
@@ -73,6 +73,7 @@ languages:
|
|||||||
ja: 日本語
|
ja: 日本語
|
||||||
zhCN: 中文 (简体)
|
zhCN: 中文 (简体)
|
||||||
zhTW: 中文 (繁體)
|
zhTW: 中文 (繁體)
|
||||||
|
es: Español
|
||||||
login:
|
login:
|
||||||
password: Palavra-passe
|
password: Palavra-passe
|
||||||
submit: Login
|
submit: Login
|
||||||
|
|||||||
@@ -134,7 +134,7 @@ settings:
|
|||||||
您可以将该用户设置为管理员,也可以单独选择各项权限。\
|
您可以将该用户设置为管理员,也可以单独选择各项权限。\
|
||||||
如果选择了“管理员”,则其他的选项会被自动勾上,\
|
如果选择了“管理员”,则其他的选项会被自动勾上,\
|
||||||
同时该用户可以管理其他用户。"
|
同时该用户可以管理其他用户。"
|
||||||
profileSettings: 配置文件设置
|
profileSettings: 个人设置
|
||||||
ruleExample1: "\
|
ruleExample1: "\
|
||||||
阻止用户访问所有文件夹下任何以 . 开头的文件\
|
阻止用户访问所有文件夹下任何以 . 开头的文件\
|
||||||
(隐藏文件, 例如: .git, .gitignore)。"
|
(隐藏文件, 例如: .git, .gitignore)。"
|
||||||
@@ -190,6 +190,7 @@ languages:
|
|||||||
ja: 日本語
|
ja: 日本語
|
||||||
zhCN: 中文 (简体)
|
zhCN: 中文 (简体)
|
||||||
zhTW: 中文 (繁體)
|
zhTW: 中文 (繁體)
|
||||||
|
es: Español
|
||||||
time:
|
time:
|
||||||
unit: 时间单位
|
unit: 时间单位
|
||||||
seconds: 秒
|
seconds: 秒
|
||||||
|
|||||||
@@ -134,7 +134,7 @@ settings:
|
|||||||
您可以將該使用者設置為管理員,也可以單獨選擇各項權限。\
|
您可以將該使用者設置為管理員,也可以單獨選擇各項權限。\
|
||||||
如果選擇了“管理員”,則其他的選項會被自動勾上,\
|
如果選擇了“管理員”,則其他的選項會被自動勾上,\
|
||||||
同時該使用者可以管理其他使用者。"
|
同時該使用者可以管理其他使用者。"
|
||||||
profileSettings: 設定檔設定
|
profileSettings: 個人設定
|
||||||
ruleExample1: "\
|
ruleExample1: "\
|
||||||
封鎖使用者存取所有資料夾下任何以 . 開頭的檔案\
|
封鎖使用者存取所有資料夾下任何以 . 開頭的檔案\
|
||||||
(隱藏文件, 例如: .git, .gitignore)。"
|
(隱藏文件, 例如: .git, .gitignore)。"
|
||||||
@@ -190,6 +190,7 @@ languages:
|
|||||||
ja: 日本語
|
ja: 日本語
|
||||||
zhCN: 中文 (简体)
|
zhCN: 中文 (简体)
|
||||||
zhTW: 中文 (繁體)
|
zhTW: 中文 (繁體)
|
||||||
|
es: Español
|
||||||
time:
|
time:
|
||||||
unit: 時間單位
|
unit: 時間單位
|
||||||
seconds: 秒
|
seconds: 秒
|
||||||
|
|||||||
@@ -1,13 +1,18 @@
|
|||||||
import cookie from './cookie'
|
import cookie from './cookie'
|
||||||
import store from '@/store'
|
import store from '@/store'
|
||||||
import router from '@/router'
|
import router from '@/router'
|
||||||
|
import { Base64 } from 'js-base64'
|
||||||
|
|
||||||
function parseToken (token) {
|
function parseToken (token) {
|
||||||
let path = store.state.baseURL
|
let path = store.state.baseURL
|
||||||
if (path === '') path = '/'
|
if (path === '') path = '/'
|
||||||
document.cookie = `auth=${token}; max-age=86400; path=${path}`
|
document.cookie = `auth=${token}; max-age=86400; path=${path}`
|
||||||
let res = token.split('.')
|
let res = token.split('.')
|
||||||
let user = JSON.parse(window.atob(res[1]))
|
let user = JSON.parse(Base64.decode(res[1]))
|
||||||
|
if (!user.commands) {
|
||||||
|
user.commands = []
|
||||||
|
}
|
||||||
|
|
||||||
store.commit('setJWT', token)
|
store.commit('setJWT', token)
|
||||||
store.commit('setUser', user)
|
store.commit('setUser', user)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,7 +53,7 @@
|
|||||||
<p class="small"><strong>{{ $t('settings.examples') }}</strong></p>
|
<p class="small"><strong>{{ $t('settings.examples') }}</strong></p>
|
||||||
|
|
||||||
<ul class="small">
|
<ul class="small">
|
||||||
<li><code>disallow regex \\/\\..+</code> - {{ $t('settings.ruleExample1') }}</li>
|
<li><code>disallow regex [\\\/]\..+</code> - {{ $t('settings.ruleExample1') }}</li>
|
||||||
<li><code>disallow /Caddyfile</code> - {{ $t('settings.ruleExample2') }}</li>
|
<li><code>disallow /Caddyfile</code> - {{ $t('settings.ruleExample2') }}</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
@@ -163,11 +163,14 @@ export default {
|
|||||||
this.lockPassword = user.lockPassword
|
this.lockPassword = user.lockPassword
|
||||||
this.filesystem = user.filesystem
|
this.filesystem = user.filesystem
|
||||||
this.username = user.username
|
this.username = user.username
|
||||||
this.commands = user.commands.join(' ')
|
|
||||||
this.css = user.css
|
this.css = user.css
|
||||||
this.permissions = user.permissions
|
this.permissions = user.permissions
|
||||||
this.locale = user.locale
|
this.locale = user.locale
|
||||||
|
|
||||||
|
if (user.commands) {
|
||||||
|
this.commands = user.commands.join(' ')
|
||||||
|
}
|
||||||
|
|
||||||
for (let rule of user.rules) {
|
for (let rule of user.rules) {
|
||||||
if (rule.allow) {
|
if (rule.allow) {
|
||||||
this.rules += 'allow '
|
this.rules += 'allow '
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
# Install rice tool if not present
|
# Install rice tool if not present
|
||||||
if ! [ -x "$(command -v rice)" ]; then
|
if ! [ -x "$(command -v rice)" ]; then
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ func Parse(c *caddy.Controller, plugin string) ([]*filemanager.FileManager, erro
|
|||||||
AllowPublish: true,
|
AllowPublish: true,
|
||||||
Commands: []string{"git", "svn", "hg"},
|
Commands: []string{"git", "svn", "hg"},
|
||||||
CSS: "",
|
CSS: "",
|
||||||
|
ViewMode: "mosaic",
|
||||||
Rules: []*filemanager.Rule{{
|
Rules: []*filemanager.Rule{{
|
||||||
Regex: true,
|
Regex: true,
|
||||||
Allow: false,
|
Allow: false,
|
||||||
|
|||||||
@@ -197,7 +197,6 @@ func (i *File) GetEditor() error {
|
|||||||
// If there is an error, just ignore it and return nil.
|
// If there is an error, just ignore it and return nil.
|
||||||
// This way, the file can be served for editing.
|
// This way, the file can be served for editing.
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -261,15 +260,12 @@ func (i *File) GetFileType(checkContent bool) error {
|
|||||||
|
|
||||||
// If the type isn't text (and is blob for example), it will check some
|
// If the type isn't text (and is blob for example), it will check some
|
||||||
// common types that are mistaken not to be text.
|
// common types that are mistaken not to be text.
|
||||||
for _, extension := range textExtensions {
|
if isInTextExtensions(i.Name) {
|
||||||
if strings.HasSuffix(i.Name, extension) {
|
i.Type = "text"
|
||||||
i.Type = "text"
|
} else {
|
||||||
goto End
|
i.Type = "blob"
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
i.Type = "blob"
|
|
||||||
|
|
||||||
End:
|
End:
|
||||||
// If the file type is text, save its content.
|
// If the file type is text, save its content.
|
||||||
if i.Type == "text" {
|
if i.Type == "text" {
|
||||||
@@ -415,22 +411,38 @@ func (l byModified) Less(i, j int) bool {
|
|||||||
return iModified.Sub(jModified) < 0
|
return iModified.Sub(jModified) < 0
|
||||||
}
|
}
|
||||||
|
|
||||||
var textExtensions = [...]string{
|
// textExtensions is the sorted list of text extensions which
|
||||||
".md", ".markdown", ".mdown", ".mmark",
|
// can be edited.
|
||||||
".asciidoc", ".adoc", ".ad",
|
var textExtensions = []string{
|
||||||
".rst",
|
".ad", ".ada", ".adoc", ".asciidoc",
|
||||||
".json", ".toml", ".yaml", ".csv", ".xml", ".rss", ".conf", ".ini",
|
".bas", ".bash", ".bat",
|
||||||
".tex", ".sty",
|
".c", ".cc", ".cmd", ".conf", ".cpp", ".cr", ".cs", ".css", ".csv",
|
||||||
".css", ".sass", ".scss",
|
".d",
|
||||||
".js",
|
".f", ".f90",
|
||||||
".html",
|
".h", ".hh", ".hpp", ".htaccess", ".html",
|
||||||
".txt", ".rtf",
|
".ini",
|
||||||
".sh", ".bash", ".ps1", ".bat", ".cmd",
|
".java", ".js", ".json",
|
||||||
".php", ".pl", ".py",
|
".markdown", ".md", ".mdown", ".mmark",
|
||||||
|
".nim",
|
||||||
|
".php", ".pl", ".ps1", ".py",
|
||||||
|
".rss", ".rst", ".rtf",
|
||||||
|
".sass", ".scss", ".sh", ".sty",
|
||||||
|
".tex", ".tml", ".toml", ".txt",
|
||||||
|
".vala", ".vapi",
|
||||||
|
".xml",
|
||||||
|
".yaml", ".yml",
|
||||||
"Caddyfile",
|
"Caddyfile",
|
||||||
".htaccess",
|
}
|
||||||
".c", ".cc", ".h", ".hh", ".cpp", ".hpp", ".f90",
|
|
||||||
".f", ".bas", ".d", ".ada", ".nim", ".cr", ".java", ".cs", ".vala", ".vapi",
|
// isInTextExtensions checks if a file can be edited by its extensions.
|
||||||
|
func isInTextExtensions(name string) bool {
|
||||||
|
search := filepath.Ext(name)
|
||||||
|
if search == "" {
|
||||||
|
search = name
|
||||||
|
}
|
||||||
|
|
||||||
|
i := sort.SearchStrings(textExtensions, search)
|
||||||
|
return i < len(textExtensions) && textExtensions[i] == search
|
||||||
}
|
}
|
||||||
|
|
||||||
// hasRune checks if the file has the frontmatter rune
|
// hasRune checks if the file has the frontmatter rune
|
||||||
|
|||||||
+1
-1
@@ -23,7 +23,7 @@ import (
|
|||||||
|
|
||||||
const (
|
const (
|
||||||
// Version is the current File Manager version.
|
// Version is the current File Manager version.
|
||||||
Version = "1.3.10"
|
Version = "1.4.5"
|
||||||
|
|
||||||
ListViewMode = "list"
|
ListViewMode = "list"
|
||||||
MosaicViewMode = "mosaic"
|
MosaicViewMode = "mosaic"
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package http
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
"strings"
|
"strings"
|
||||||
@@ -75,7 +74,6 @@ func authHandler(c *fm.Context, w http.ResponseWriter, r *http.Request) (int, er
|
|||||||
if len(c.ReCaptchaSecret) > 0 {
|
if len(c.ReCaptchaSecret) > 0 {
|
||||||
ok, err := reCaptcha(c.ReCaptchaSecret, cred.ReCaptcha)
|
ok, err := reCaptcha(c.ReCaptchaSecret, cred.ReCaptcha)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println(err)
|
|
||||||
return http.StatusForbidden, err
|
return http.StatusForbidden, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+27
-40
@@ -1,8 +1,6 @@
|
|||||||
package http
|
package http
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"io"
|
|
||||||
"io/ioutil"
|
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
"os"
|
"os"
|
||||||
@@ -45,72 +43,61 @@ func downloadHandler(c *fm.Context, w http.ResponseWriter, r *http.Request) (int
|
|||||||
files = append(files, c.File.Path)
|
files = append(files, c.File.Path)
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the format is true, just set it to "zip".
|
|
||||||
if query == "true" || query == "" {
|
|
||||||
query = "zip"
|
|
||||||
}
|
|
||||||
|
|
||||||
var (
|
var (
|
||||||
extension string
|
extension string
|
||||||
temp string
|
ar archiver.Archiver
|
||||||
err error
|
|
||||||
tempfile string
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Create a temporary directory.
|
|
||||||
temp, err = ioutil.TempDir("", "")
|
|
||||||
if err != nil {
|
|
||||||
return http.StatusInternalServerError, err
|
|
||||||
}
|
|
||||||
defer os.RemoveAll(temp)
|
|
||||||
|
|
||||||
tempfile = filepath.Join(temp, "temp")
|
|
||||||
|
|
||||||
switch query {
|
switch query {
|
||||||
case "zip":
|
// If the format is true, just set it to "zip".
|
||||||
extension, err = ".zip", archiver.Zip.Make(tempfile, files)
|
case "zip", "true", "":
|
||||||
|
extension, ar = ".zip", archiver.Zip
|
||||||
case "tar":
|
case "tar":
|
||||||
extension, err = ".tar", archiver.Tar.Make(tempfile, files)
|
extension, ar = ".tar", archiver.Tar
|
||||||
case "targz":
|
case "targz":
|
||||||
extension, err = ".tar.gz", archiver.TarGz.Make(tempfile, files)
|
extension, ar = ".tar.gz", archiver.TarGz
|
||||||
case "tarbz2":
|
case "tarbz2":
|
||||||
extension, err = ".tar.bz2", archiver.TarBz2.Make(tempfile, files)
|
extension, ar = ".tar.bz2", archiver.TarBz2
|
||||||
case "tarxz":
|
case "tarxz":
|
||||||
extension, err = ".tar.xz", archiver.TarXZ.Make(tempfile, files)
|
extension, ar = ".tar.xz", archiver.TarXZ
|
||||||
default:
|
default:
|
||||||
return http.StatusNotImplemented, nil
|
return http.StatusNotImplemented, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
if err != nil {
|
|
||||||
return http.StatusInternalServerError, err
|
|
||||||
}
|
|
||||||
|
|
||||||
// Defines the file name.
|
// Defines the file name.
|
||||||
name := c.File.Name
|
name := c.File.Name
|
||||||
if name == "." || name == "" {
|
if name == "." || name == "" {
|
||||||
name = "download"
|
name = "archive"
|
||||||
}
|
}
|
||||||
name += extension
|
name += extension
|
||||||
|
|
||||||
// Opens the file so it can be downloaded.
|
w.Header().Set("Content-Disposition", "attachment; filename*=utf-8''"+url.QueryEscape(name))
|
||||||
file, err := os.Open(temp + "/temp")
|
err := ar.Write(w, files)
|
||||||
if err != nil {
|
|
||||||
return http.StatusInternalServerError, err
|
|
||||||
}
|
|
||||||
defer file.Close()
|
|
||||||
|
|
||||||
w.Header().Set("Content-Disposition", "attachment; filename=\""+name+"\"")
|
|
||||||
_, err = io.Copy(w, file)
|
|
||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func downloadFileHandler(c *fm.Context, w http.ResponseWriter, r *http.Request) (int, error) {
|
func downloadFileHandler(c *fm.Context, w http.ResponseWriter, r *http.Request) (int, error) {
|
||||||
|
file, err := os.Open(c.File.Path)
|
||||||
|
defer file.Close()
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
return http.StatusInternalServerError, err
|
||||||
|
}
|
||||||
|
|
||||||
|
stat, err := file.Stat()
|
||||||
|
if err != nil {
|
||||||
|
return http.StatusInternalServerError, err
|
||||||
|
}
|
||||||
|
|
||||||
if r.URL.Query().Get("inline") == "true" {
|
if r.URL.Query().Get("inline") == "true" {
|
||||||
w.Header().Set("Content-Disposition", "inline")
|
w.Header().Set("Content-Disposition", "inline")
|
||||||
} else {
|
} else {
|
||||||
w.Header().Set("Content-Disposition", `attachment; filename="`+c.File.Name+`"`)
|
// As per RFC6266 section 4.3
|
||||||
|
w.Header().Set("Content-Disposition", "attachment; filename*=utf-8''"+url.QueryEscape(c.File.Name))
|
||||||
}
|
}
|
||||||
|
|
||||||
http.ServeFile(w, r, c.File.Path)
|
http.ServeContent(w, r, stat.Name(), stat.ModTime(), file)
|
||||||
|
|
||||||
return 0, nil
|
return 0, nil
|
||||||
}
|
}
|
||||||
Generated
-9161
File diff suppressed because it is too large.
Load diff
+48
-47
@@ -10,62 +10,63 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"clipboard": "^1.7.1",
|
"clipboard": "^1.7.1",
|
||||||
"codemirror": "^5.27.4",
|
"codemirror": "^5.31.0",
|
||||||
"filesize": "^3.5.10",
|
"filesize": "^3.5.11",
|
||||||
"moment": "^2.18.1",
|
"js-base64": "^2.4.0",
|
||||||
|
"moment": "^2.19.2",
|
||||||
"normalize.css": "^7.0.0",
|
"normalize.css": "^7.0.0",
|
||||||
"noty": "^3.1.2",
|
"noty": "^3.1.4",
|
||||||
"vue": "^2.3.3",
|
"vue": "^2.5.8",
|
||||||
"vue-i18n": "^7.1.0",
|
"vue-i18n": "^7.3.4",
|
||||||
"vue-router": "^2.7.0",
|
"vue-router": "^3.0.1",
|
||||||
"vuex": "^2.3.1"
|
"vuex": "^3.0.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"autoprefixer": "^7.1.2",
|
"autoprefixer": "^7.1.6",
|
||||||
"babel-core": "^6.22.1",
|
"babel-core": "^6.26.0",
|
||||||
"babel-eslint": "^7.1.1",
|
"babel-eslint": "^8.0.2",
|
||||||
"babel-loader": "^7.1.1",
|
"babel-loader": "^7.1.2",
|
||||||
"babel-plugin-transform-runtime": "^6.22.0",
|
"babel-plugin-transform-runtime": "^6.23.0",
|
||||||
"babel-preset-env": "^1.3.2",
|
"babel-preset-env": "^1.6.1",
|
||||||
"babel-preset-stage-2": "^6.22.0",
|
"babel-preset-stage-2": "^6.24.1",
|
||||||
"babel-register": "^6.22.0",
|
"babel-register": "^6.26.0",
|
||||||
"chalk": "^2.0.1",
|
"chalk": "^2.3.0",
|
||||||
"connect-history-api-fallback": "^1.3.0",
|
"connect-history-api-fallback": "^1.5.0",
|
||||||
"copy-webpack-plugin": "^4.0.1",
|
"copy-webpack-plugin": "^4.2.1",
|
||||||
"css-loader": "^0.28.0",
|
"css-loader": "^0.28.7",
|
||||||
"eslint": "^4.3.0",
|
"eslint": "^4.15.0",
|
||||||
"eslint-config-standard": "^10.2.1",
|
"eslint-config-standard": "^10.2.1",
|
||||||
"eslint-friendly-formatter": "^3.0.0",
|
"eslint-friendly-formatter": "^3.0.0",
|
||||||
"eslint-loader": "^1.7.1",
|
"eslint-loader": "^1.9.0",
|
||||||
"eslint-plugin-html": "^3.1.1",
|
"eslint-plugin-html": "^4.0.0",
|
||||||
"eslint-plugin-import": "^2.7.0",
|
"eslint-plugin-import": "^2.8.0",
|
||||||
"eslint-plugin-node": "^5.1.1",
|
"eslint-plugin-node": "^5.2.1",
|
||||||
"eslint-plugin-promise": "^3.4.0",
|
"eslint-plugin-promise": "^3.6.0",
|
||||||
"eslint-plugin-standard": "^3.0.1",
|
"eslint-plugin-standard": "^3.0.1",
|
||||||
"eventsource-polyfill": "^0.9.6",
|
"eventsource-polyfill": "^0.9.6",
|
||||||
"express": "^4.14.1",
|
"express": "^4.16.2",
|
||||||
"extract-text-webpack-plugin": "^3.0.0",
|
"extract-text-webpack-plugin": "^3.0.2",
|
||||||
"file-loader": "^0.11.1",
|
"file-loader": "^1.1.5",
|
||||||
"friendly-errors-webpack-plugin": "^1.1.3",
|
"friendly-errors-webpack-plugin": "^1.6.1",
|
||||||
"html-webpack-plugin": "^2.28.0",
|
"html-webpack-plugin": "^2.30.1",
|
||||||
"http-proxy-middleware": "^0.17.3",
|
"http-proxy-middleware": "^0.17.4",
|
||||||
"opn": "^5.1.0",
|
"opn": "^5.1.0",
|
||||||
"optimize-css-assets-webpack-plugin": "^3.0.0",
|
"optimize-css-assets-webpack-plugin": "^3.2.0",
|
||||||
"ora": "^1.2.0",
|
"ora": "^1.3.0",
|
||||||
"rimraf": "^2.6.0",
|
"rimraf": "^2.6.2",
|
||||||
"semver": "^5.3.0",
|
"semver": "^5.4.1",
|
||||||
"shelljs": "^0.7.6",
|
"shelljs": "^0.7.8",
|
||||||
"sw-precache-webpack-plugin": "^0.11.4",
|
"sw-precache-webpack-plugin": "^0.11.4",
|
||||||
"uglify-js": "^3.0.23",
|
"uglify-js": "^3.1.10",
|
||||||
"url-loader": "^0.5.8",
|
"url-loader": "^0.6.2",
|
||||||
"vue-loader": "^13.0.2",
|
"vue-loader": "^13.5.0",
|
||||||
"vue-style-loader": "^3.0.1",
|
"vue-style-loader": "^3.0.3",
|
||||||
"vue-template-compiler": "^2.3.3",
|
"vue-template-compiler": "^2.5.8",
|
||||||
"webpack": "^3.4.1",
|
"webpack": "^3.8.1",
|
||||||
"webpack-bundle-analyzer": "^2.2.1",
|
"webpack-bundle-analyzer": "^2.9.1",
|
||||||
"webpack-dev-middleware": "^1.10.0",
|
"webpack-dev-middleware": "^2.0.4",
|
||||||
"webpack-hot-middleware": "^2.18.0",
|
"webpack-hot-middleware": "^2.20.0",
|
||||||
"webpack-merge": "^4.1.0",
|
"webpack-merge": "^4.1.1",
|
||||||
"yml-loader": "^2.1.0"
|
"yml-loader": "^2.1.0"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
|
|||||||
+3
-2
@@ -1,4 +1,5 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
echo "Building assets"
|
echo "Building assets"
|
||||||
./build.sh
|
./build.sh
|
||||||
@@ -8,7 +9,7 @@ sed -i "s|(untracked)|$1|g" filemanager.go
|
|||||||
|
|
||||||
echo "Commiting..."
|
echo "Commiting..."
|
||||||
git add -A
|
git add -A
|
||||||
git commit -m "Version $1"
|
git commit -m "chore: version $1"
|
||||||
git push
|
git push
|
||||||
|
|
||||||
echo "Creating the tag..."
|
echo "Creating the tag..."
|
||||||
@@ -18,7 +19,7 @@ git push --tags
|
|||||||
echo "Commiting untracked version notice..."
|
echo "Commiting untracked version notice..."
|
||||||
sed -i "s|$1|(untracked)|g" filemanager.go
|
sed -i "s|$1|(untracked)|g" filemanager.go
|
||||||
git add -A
|
git add -A
|
||||||
git commit -m "[ci skip] auto: setting untracked version"
|
git commit -m "chore: setting untracked version [ci skip]"
|
||||||
git push
|
git push
|
||||||
|
|
||||||
echo "Done!"
|
echo "Done!"
|
||||||
@@ -1 +1 @@
|
|||||||
46ab215d06908088047a47fa5a4bf4fc8c66b727
|
0333464bb0a238393150731bc833fa4aa3b7ec60
|
||||||
+2
-1
@@ -84,7 +84,8 @@ func (h Hugo) Hook(c *fm.Context, w http.ResponseWriter, r *http.Request) (int,
|
|||||||
return http.StatusForbidden, nil
|
return http.StatusForbidden, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
filename := filepath.Join(c.User.Scope, r.URL.Path)
|
filename := filepath.Clean(r.URL.Path)
|
||||||
|
filename = strings.TrimPrefix(filename, string(filepath.Separator))
|
||||||
archetype := r.Header.Get("archetype")
|
archetype := r.Header.Get("archetype")
|
||||||
|
|
||||||
ext := filepath.Ext(filename)
|
ext := filepath.Ext(filename)
|
||||||
|
|||||||
Reference in new issue
Block a user