Update readme

Former-commit-id: e88efbe384ea35b4a19c4547e6323e00ca0ee960 [formerly c18bfec3508f09554b4453cffb3bc29825cf2d07] [formerly 2ee6a01866e7e460525d499379d21defb1f85850 [formerly 94ab0297f9]]
Former-commit-id: 7ad31383405484b0b95a166ca75e9fadad49a709 [formerly 5ae4d839ec0ef1c1e81a8592fc57474c0546b594]
Former-commit-id: bcc1b0c070c77eb61a6df6159556bd0552e2d2d4
pull/726/head
Henrique Dias 2017-07-28 21:07:29 +01:00
parent ea72ff6990
commit 1755d52019
1 changed files with 1 additions and 111 deletions

112
README.md
View File

@ -11,8 +11,6 @@ filemanager provides a file managing interface within a specified directory and
# Table of contents
+ [Getting started](#getting-started)
- [Caddy](#caddy)
- [Standalone](#standalone)
+ [Features](#features)
- [Users](#users)
- [Search](#search)
@ -21,115 +19,7 @@ filemanager provides a file managing interface within a specified directory and
# Getting started
This is a library that can be used on your own applications as a middleware (see the [documentation](http://godoc.org/github.com/hacdias/filemanager)), 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](https://caddyserver.com/download) with `http.filemanager` plugin enabled. For more information about the plugin itself, please refer to its [documentation](https://caddyserver.com/docs/http.filemanager).
## Standalone
You can use filemanager as a standalone executable. You just need to download it from the [releases page](https://github.com/hacdias/filemanager/releases), where you can find multiple releases.
You can either use flags or a JSON configuration file, which should have the following appearance:
```json
{
"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](https://hub.docker.com/r/hacdias/filemanager/) 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
```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:
```shell
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:
```shell
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
```
You can find the Getting Started guide on the [documentation](https://henriquedias.com/filemanager/getting-started/).
# Features