Thanks to visit codestin.com
Credit goes to github.com

Skip to content

hironico/nico.drive

Repository files navigation

nico.drive

Hironico's nico.drive is a webdav server running on nodejs. It features full support of WebDAV protocol plus additional exclusive features to ease display and search of hosted files. To take full advantage of the additional APIs, the server comes with its own web application embbedded (aka the nico.drive.client project).

It's an all-in-one solution to backup important files and memories yet very simple to install and use.

Features

  • WebDAV compliant server compatible with all WebDav enabled devices such as NAS (Synology, QNap etc...)
  • Out of the box ready to run but also highly configurable (see dotenv-sample file)
  • Additional features as additional REST api :
    • image thumbnail generator
    • image metadata API support for EXIF and XMP
    • digital camera raw file formats support for thumbs
  • Embedded WebDAV explorer web application, optimized for mobile. More info
  • Multi protocol authentication support : basic and oauth can be used at the same time

Getting started

In order to get it up and running in your environment, you need :

  • A server box : private cloud or dedicated machine, the choice is yours. For instance, we use a Linux dedicated box.
  • An SSL certificate (with its key). Self signed for development/testing or use Let's Encrypt for production.

Assuming you have configured your box with a dedicated user ; to run your server, then you need to:

  • Git clone the repository
  • COPY the "dotenv-sample" file into a file named ".env", then adapt to reflect your current setup.
  • COPY the "users_config.json.default" file into a file named "users_config.json". See "Users and directories config" below for more information.
  • npm install
  • npm run build
  • npm run start

Alternatively you can use the start.sh and stop.sh scripts.

  • Connect WebDav client to your new server (follow vendor instructions)

    or

    Point you browser at the root url of your server (see .env file for setup)

Configuration options

The configuration is splitted into two parts:

  • server config : network ports, certificates ...
  • user config : user access and root directories for each user

Each configuration has examples in a dedicated sample file that can be customized. See below.

Server config

COPY the dotenv.sample file to create a file named '.env' (dot env litterally).

IMPORTANT:

  • Never expose the .env in your webserver in any way.
  • Never expose the users_config.json file in your webserver in any way.

Then you can customize the .env file to suit your needs.

Users and directories config

COPY the user_config.json.default into a file named users_config.json

Assign each user one or more root directories for storing/sharing files from/to your server.

Users can have the following roles:

  • all : user is admin user for this root directory. Not only it has write access but also can create shares to existing other users.
  • canRead : readonly access
  • CanWrite: read and write access but not possible to create shares.

Each user is assigned a quota in bytes. If the quota is exceeded then no more upload is possible for that user.

User federation and social login

  • hybrid authentication protocols : basic and oauth are supported !
  • keycloak support for user federation : use keycloak as identity provider for nico.drive
  • server can be accessed with basic user/password (ie NAS synchronization) and oauth using keycloack
  • this enables usage of social login to get into nico.drive
  • can work with basic login only ; oauth and keycloack are OPTIONAL

See the .env-sample file to setup keycloak support Also there are docker files for podman install of keycloak to your server

Developper information

The following is developper instructions about the way Nico's Drive has been built. Is contains various links where the author found instructions on how to setup the development environment, code, libraries used etc...

Build issues (and their solutions)

  • Namespace 'serveStatic' has no exported member 'RequestHandlerConstructor See : DefinitelyTyped/DefinitelyTyped#49595 Run th efollowing commands to solve:
    • npm update @types/express-serve-static-core --depth 2
    • npm update @types/serve-static --depth 2

Full documentation reference (educational)

About

WebDAV server and its Web client with additional features such as thumbnail generation, picture metadata

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 37

Languages