Git Product home page Git Product logo

nfile's Introduction

NFile

Build Status

A file system based on nodejs & easyui. You can use it to edit / view / upload / download file.

how to run it.

# prepare directory(it makes deploy more easier.)
mkdir -p /shushanfx/node/data
cd /shushanfx/node
# check out from github 
git clone "https://github.com/shushanfx/nfile.git"
# install dependencies and start it.
cd nfile
npm install && npm start

use npm run dev for development and make use you have already installed supervisor.

config

You can adjust the config as your wish. Config is placed in server.json.

{
    "port": 18081,
    "name": "File System",
    "cnName": "文件管理系统",
    "company": "shushanfx.com",
    "description": "文件管理系统",
    "base": "/", // you can set to /nfile
    "workspace": {
        "path": "/shushanfx/node/data", // file path.
        "workspace": "/shushanfx/node/nfile"
    }
}

When the base parameter is not null or /, it means that you have set a prefix for your webside, thus you must browser your website by http://${host}:${port}/${base}

preview

It looks like the follow:
index.png contextmenu.png

Add a new preview path/file/list, it can display like this:

list.png

Thanks

Thanks to those who made contribution a lot:

  • [shushanfx]
  • [dengjianxin]

Deloy with docker

Those days, i tried to delopy the project on docker, fortunately, it successed. The deploy command as follow:

# docker command
docker run --name shushanfx-node -v /shushanfx/node/data:/shushanfx/node/data -v /shushanfx/node/nfile:/usr/src/app -p 127.0.0.1:18081:18081 -d node:onbuild sh -c "npm install && npm start"
  • Mount two direcories:/shushanfx/node/data to /shushanfx/node/data(in docker container), /shushanfx/node/nfile to /usr/src/app(in docker container).
  • Parameter -d means run in background
  • The command sh -c "npm install && npm start", which execute two commands in one time, you must use sh -c [parameter], or the second command will be executed in docker container.

SSH into docker image

In case you need to ssh into the docker image you can do so:

# asume the docker name is shushanfx-node
docker exec -t -i shushanfx-node /bin/bash

You can refer docker exec command here

With Nginx

If you want to deloy the server by nginx, you can make the nginx config like this:

upstream node_file {
        server 127.0.0.1:18081;
        keepalive 10;
}

server {
        listen 80;
        server_name your.server.name;

        # use nginx to server static file. 
        root /shushanfx/node/nfile/static;

        location ~* \.(js|css|png|gif|jpg|ico) {
                expires 30d;
        }
        location / {
                proxy_pass http://node_file;
                proxy_set_header Host "your.server.name";
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_connect_timeout 2;
                proxy_read_timeout 5;
        }
}

Change logs

Please refer to change logs

nfile's People

Contributors

shushanfx avatar stulang avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.