Go to file
Henrique Dias 8777050d3e Update README.md
Former-commit-id: 22fba43b4459ee9f6b957a474ca20428778258cf [formerly c6ad29099fb71bd1674737ae84b7e50277cef3c9] [formerly 210afa8e9ed15d4fe59848cb773aad757173d513 [formerly 5c7a0b61d3]]
Former-commit-id: 0aff06fc85f31cf342989ba3c24562cff7a2b06c [formerly 0118f40e7c2ffb9c174df43ba24ef9b11f1f8977]
Former-commit-id: ee823f96ce2ab93a91cd1e5456ee89687f95e100
2017-07-28 14:34:15 +01:00
.github add caddy plugin 2017-06-26 15:39:35 +01:00
assets Better experience (#166) 2017-07-28 11:22:44 +01:00
caddy Better experience (#166) 2017-07-28 11:22:44 +01:00
cmd/filemanager Use fileutils instead 2017-07-27 21:39:23 +01:00
testdata Add gitkeep to testdata 2017-07-25 12:11:20 +01:00
.babelrc update 2017-07-06 08:12:19 +01:00
.dockerignore Add dockerignore 2017-07-27 14:17:41 +01:00
.editorconfig Move fonts and add go to editorconfig 2017-06-30 15:09:00 +01:00
.eslintignore update 2017-07-06 08:12:19 +01:00
.eslintrc.js update 2017-07-06 08:12:19 +01:00
.gitignore Standalone 2017-07-20 09:03:14 +01:00
.travis.yml Update and remove latest 2017-07-27 18:15:51 +01:00
CODE_OF_CONDUCT.md Create CODE_OF_CONDUCT.md 2017-06-25 21:01:54 +01:00
CONTRIBUTING.md Create CONTRIBUTING.md 2017-07-28 14:33:49 +01:00
Docker.json Add Docker.json and update Dockerfile. See #157 2017-07-27 14:03:53 +01:00
Dockerfile Update Dockerfile 2017-07-28 08:06:44 +01:00
LICENSE.md License 2017-06-24 12:13:07 +01:00
README.md Update README.md 2017-07-28 14:34:15 +01:00
auth.go Add some auth tests 2017-07-25 11:57:27 +01:00
auth_test.go Add some auth tests 2017-07-25 11:57:27 +01:00
build.sh update build.sh 2017-07-28 11:21:55 +01:00
doc.go Docs updates and default user updates 2017-07-20 09:52:03 +01:00
download.go Use fileutils instead 2017-07-27 21:39:23 +01:00
file.go Copy and cut files 2017-07-26 15:55:39 +01:00
filemanager.go Use fileutils instead 2017-07-27 21:39:23 +01:00
filemanager_test.go Use fileutils instead 2017-07-27 21:39:23 +01:00
http.go remove comment 2017-07-26 18:01:24 +01:00
package.json Fix some stuff 2017-07-06 08:52:39 +01:00
resource.go Use fileutils instead 2017-07-27 21:39:23 +01:00
rice-box.go.REMOVED.git-id Better experience (#166) 2017-07-28 11:22:44 +01:00
settings.go Plugins settings working 2017-07-18 14:43:16 +01:00
users.go fix users saving error 2017-07-26 18:08:49 +01:00
websockets.go Search by type 2017-07-25 16:15:40 +01:00

README.md

Preview

filemanager

Build Go Report Card Documentation

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.

Table of contents

Getting started

This is a library that can be used on your own applications as a middleware (see the documentation), as a plugin to Caddy web server or as a standalone app.

Once you have everything deployed, the default credentials to login to the filemanager are:

Username: admin Password: admin

Caddy

The easiest way to get started is using this with Caddy web server. You just need to download Caddy from its official website with http.filemanager plugin enabled. For more information about the plugin itself, please refer to its documentation.

Standalone

You can use filemanager as a standalone executable. You just need to download it from the releases page, where you can find multiple releases.

You can either use flags or a JSON configuration file, which should have the following appearance:

{
  "port": 80,
  "address": "127.0.0.1",
  "database": "/path/to/database.db",
  "scope": "/path/to/my/files",
  "allowCommands": true,
  "allowEdit": true,
  "allowNew": true,
  "commands": [
    "git",
    "svn"
  ]
}

The scope, allowCommands, allowEdit, allowNew and commands options are the defaults for new users. To set a configuration file, you will need to pass the path with a flag, like this: filemanager --config=/path/to/config.json.

Otherwise, you may not want to use a configuration file, which can be done using the following flags:

-address string
      Address to listen to (default is all of them)
-allow-commands
      Default allow commands option (default true)
-allow-edit
      Default allow edit option (default true)
-allow-new
      Default allow new option (default true)
-commands string
      Space separated commands available for new users (default "git svn hg")
-database string
      Database path (default "./filemanager.db")
-port string
      HTTP Port (default is random)
-scope string
      Default scope for new users (default ".")

Docker

File Manager is also on Docker Hub so you can just docker pull hacdias/filemanager.

Paths in the container

  • Config: /etc/config.json
  • Database: /etc/database.db
  • Base scope: /srv

Default config.json

{
  "port": 80,
  "address": "",
  "database": "/etc/database.db",
  "scope": "/srv",
  "allowCommands": true,
  "allowEdit": true,
  "allowNew": true,
  "commands": []
}

Usage

If the user wants to use the config.json file:

docker run \
    -v /path/to/sites/root:/srv \
    -v /path/to/config.json:/etc/config.json \
    -v /path/to/database.db:/etc/database.db \
    -p 80:80 \
    hacdias/filemanager

If the user doesn't use the config.json file:

docker run \
    -v /path/to/sites/root:/srv \
    -v /path/to/database.db:/etc/database.db \
    -p 80:80 \
    hacdias/filemanager
    --port 80
    --database /etc/database.db
    --scope /srv
    --other-flag other-value

Features

Easy login system.

Login Page

Listings of your files, available in two styles: mosaic and list. You can delete, move, rename, upload and create new files, as well as directories. Single files can be downloaded directly, and multiple files as .zip, .tar, .tar.gz, .tar.bz2 or .tar.xz.

Mosaic Listing

File Manager editor is powered by Codemirror and if you're working with markdown files with metadata, both parts will be separated from each other so you can focus on the content.

Markdown Editor

On the settings page, a regular user can set its own custom CSS to personalize the experience and change its password. For admins, they can manage the permissions of each user, set commands which can be executed when certain events are triggered (such as before saving and after saving) and change plugin's settings.

Settings

We also allow the users to search in the directories and execute commands if allowed.

Users

We support multiple users and each user can have its own scope and custom stylesheet. The administrator is able to choose which permissions should be given to the users, as well as the commands they can execute. Each user also have a set of rules, in which he can be prevented or allowed to access some directories (regular expressions included!).

Users

FileManager allows you to search through your files and it has some options. By default, your search will be something like this:

this are keywords

If you search for that it will look at every file that contains "this", "are" or "keywords" on their name. If you want to search for an exact term, you should surround your search by double quotes:

"this is the name"

That will search for any file that contains "this is the name" on its name. It won't search for each separated term this time.

By default, every search will be case sensitive. Although, you can make a case insensitive search by adding case:insensitive to the search terms, like this:

this are keywords case:insensitive

Donate

Enjoying this project? You can donate to its creator. He will appreciate.