rejetto / hfs

HFS is a web file server to run on your computer. Share folders or even a single file thanks to the virtual file system.
GNU General Public License v3.0
1.87k stars 185 forks source link
file-server file-sharing http-server nodejs typescript web

HFS: HTTP File Server (version 3)

logo and motto

Introduction

HFS is the best way via web to access or share files from your disk.

This is a full rewrite of the Delphi version.

How does it work

Features

Installation

NB: minimum Windows version required is 8.1 , Windows Server 2012 R2 (because of Node.js 18)

  1. go to https://github.com/rejetto/hfs/releases
  2. click on Assets
  3. download the right version for your system, unzip and launch hfs file.
    • Mac: if you get "cannot be opened because it is from an unidentified developer", you can hold control key while clicking, then click open.
    • If you cannot find your system in the list, see next section Other systems.
  4. the browser should automatically open on localhost address, so you can configure the rest in the Admin-panel.

    • if a browser cannot be opened on the computer where you are installing HFS, you should enter this command in the HFS console: create-admin <PASSWORD>
    • if you cannot access the console (like when you are running as a service), you can edit the config file to add your admin account
    • if you don't want to use an editor you can create the file with this command:

      echo "create-admin: PASSWORD" > config.yaml

If you access Admin-panel via localhost, by default HFS won't require you to login. If you don't like this behavior, disable it in the Admin-panel or enter this console command config localhost_admin false.

Other systems

If your system is not Windows/Linux/Mac or you just don't want to run the binaries, you can try this alternative version:

  1. install node.js version 18
  2. execute at command line npx hfs@latest

The @latest part is optional, and ensures that you are always up to date.

If this procedure fails, it may be that you are missing one of these requirements.

Configuration and other files will be stored in %HOME%/.vfs

Service

If you want to run HFS at boot (as a service), we suggest the following methods

On Linux

  1. install node.js
  2. create a file /etc/systemd/system/hfs.service with this content

    [Unit]
    Description=HFS
    After=network.target
    
    [Service]
    Type=simple
    Restart=always
    ExecStart=/usr/bin/npx -y hfs@latest
    
    [Install]
    WantedBy=multi-user.target
  3. run sudo systemctl daemon-reload && sudo systemctl enable hfs && sudo systemctl start hfs && sudo systemctl status hfs

NB: update will be attempted at each restart

On Windows

  1. install node.js
  2. run npm -g i hfs
  3. run npx qckwinsvc2 install name="HFS" description="HFS" path="%APPDATA%\npm\node_modules\hfs\src\index.js" args="--cwd %HOMEPATH%\.hfs" now

To update

Console commands

If you have full access to HFS' console, you can enter commands. Start with help to have a full list.

Configuration

For configuration please see file config.md.

Where is it stored

Configuration is stored in the file config.yaml, exception made for custom HTML which is stored in custom.html.

These files are kept in the Current Working Directory (cwd), which is by default the same folder of hfs.exe if you are using this kind of distribution on Windows, or USER_FOLDER/.hfs on other systems. You can decide a different cwd passing --cwd SOME_FOLDER parameter at command line.

You can decide also a different file for config by passing --config SOME_FILE, or inside an env called HFS_CONFIG. Any relative path provided is relative to the cwd.

Check details about config file format.

Internationalization

It is possible to show the Front-end in other languages. Translation for some languages is already provided. If you find an error, consider reporting it or editing the source file.

In the Languages section of the Admin-panel you can install additional language files.

If your language is missing, please consider translating yourself.

Why you should upgrade from HFS 2.x to 3

As you can see from the list of features, we already have some goods that you cannot find in HFS 2. Other than that, you can also consider:

But you may still want to stay with HFS 2.x (so far) for the following reasons

Security

While this project focuses on ease of use, we care about security.

Some actions you can take for improved security:

Hidden features

Contribute

There are several ways to contribute

More