{"id":20929145,"url":"https://github.com/floofies/hockit","last_synced_at":"2026-04-16T05:34:37.854Z","repository":{"id":57264827,"uuid":"249287459","full_name":"Floofies/hockit","owner":"Floofies","description":"A super simple file sharing server. Working on an improved Version 3.","archived":false,"fork":false,"pushed_at":"2024-02-24T05:31:14.000Z","size":84,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-20T16:02:55.174Z","etag":null,"topics":["file-manager","file-sharing","file-upload","mariadb","nodejs","server"],"latest_commit_sha":null,"homepage":"https://hockit.app","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Floofies.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-03-22T22:51:36.000Z","updated_at":"2024-03-05T15:12:57.000Z","dependencies_parsed_at":"2022-08-25T03:40:25.604Z","dependency_job_id":null,"html_url":"https://github.com/Floofies/hockit","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Floofies%2Fhockit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Floofies%2Fhockit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Floofies%2Fhockit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Floofies%2Fhockit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Floofies","download_url":"https://codeload.github.com/Floofies/hockit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243324270,"owners_count":20273099,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["file-manager","file-sharing","file-upload","mariadb","nodejs","server"],"created_at":"2024-11-18T21:17:31.204Z","updated_at":"2025-12-28T07:26:10.317Z","avatar_url":"https://github.com/Floofies.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# HockIt File Server\r\n\r\nHockIt is super-simple file sharing server software written in NodeJS; it has a web GUI, a JSON API, a CLI, and a standard I/O interface.\r\n\r\n[![NPM](https://nodei.co/npm/hockit.png)](https://nodei.co/npm/hockit/)\r\n\r\n# Install\r\nInstall the package globally to use the `hockit` executable:\r\n\r\n```\r\nnpm i -g hockit\r\n```\r\n\r\nYou can start a HockIt server in two commands.\r\n\r\n- Run `hockit passwd` to set the web GUI password.\r\n- Run `hockit start` to start the HTTP server.\r\n\r\nThe HockIt server should now be listening for HTTP requests on port 8080. Try it out by opening the HockIt web GUI via [localhost](http://localhost:8080)\r\n\r\nA `.hockit` directory containing the default configuration \u0026 webroot directory will be created in the current user's home folder.\r\n\r\nFor setting up HockIt with a HTTPS/SSL certificate, see [SSL Configuration](#ssl-configuration)\r\n\r\n# Hock it up there!\r\n\r\nYou can upload files via CLI in a Terminal, HTTP in a web browser, or via a REST API.\r\n\r\n## Via HTTP\r\n\r\nYou can upload and list files via the web GUI. The default HTTP port is [8080](http://localhost:8080), which you can change via `hockit port`. Before uploading \u0026 listing you must set a password via `hockit passwd`.\r\n\r\n## Via CLI\r\n\r\n```\r\n$ hockit up ~/Documents/hello.txt\r\nhttp://my.website.com/p_9Gm\r\n```\r\n\r\nSee [CLI Commands](#cli-commands)\r\n\r\n\r\n## Via REST API\r\n\r\n```\r\n$ hockit token create helloworld\r\nGenerated new HockIt REST API token.\r\n        helloworld -\u003e hockitApiToken\r\n$ curl http://my.website.com/up -F \"upload=@myfile.png\" -H \"Authorization: hockitApiToken\"\r\n{\"error\":null,\"data\":{\"files\":[{\"name\":\"myfile.png\",\"hash\":\"0Z5kF\",\"date\":1585787847478}],\"total\":5}}\r\n```\r\n\r\nSee [REST API](#rest-api)\r\n\r\n# CLI Commands\r\n\r\nGeneral Syntax: `hockit \u003ccommand\u003e \u003cparameter1\u003e \u003cparameter2\u003e`\r\n\r\n## File Server\r\n\r\n- `list` Lists all uploaded files and their shortlinks.\r\n- `list \u003chash\u003e` Lists a single uploaded file using `hash`.\r\n- `delete \u003chash\u003e` Deletes a file using `hash`.\r\n- `up \u003cpath\u003e` Uploads a file and returns a shortlink to it.\r\n- `start` Starts the HockIt HTTP server on this session. If called via a TTY, a REPL session will be started to allow the input of additional commands while the HTTP server is running.\r\n\r\n## General Configuration\r\n\r\n- `config` Lists the current HockIt configuration status.\r\n- `config reset` Resets all configuration settings to default values and unsets all passwords.\r\n- `passwd` Sets the password for uploading/listing via the web GUI; supplying a blank password  unset it and cause some web GUI features to stop working.\r\n- `domain \u003cfqdn\u003e` Sets the `fqdn` for use in generation of shortlink URLs.\r\n- `port \u003curi\u003e` Binds the HTTP server to `uri`, which can be a port number, host, or socket/handle path.\r\n- `webroot \u003cpath\u003e` Serves files from given path via the HTTP server. Requires both read \u0026 write permissions. The default webroot is located in `~/.hockit/webroot`\r\n\r\n## SSL Configuration\r\n\r\nSyntax: `hockit ssl \u003coption\u003e \u003cparameter\u003e`\r\n\r\nRunning `hockit ssl` without options will check the validity of the current SSL configuration.\r\n\r\n- `enable` Enables HTTPS/SSL and attempts to import the SSL PEM certificate \u0026 key files when `hockit start` is invoked.\r\n- `disables` Disables HTTPS/SSL and ignores any given certificate/key.\r\n- `cert \u003cpath\u003e` Sets the filesystem `path` to the SSL PEM certificate file.\r\n- `cert \u003cunset\u003e` Unsets the filesystem path to the SSL PEM certificate file.\r\n- `key \u003cpath\u003e` Sets the filesystem `path` to the SSL PEM private key file.\r\n- `key \u003cunset\u003e` Unsets the filesystem path to the SSL PEM private key file.\r\n- `pass` Sets the passphrase to the SSL PEM private key file via a TTY.\r\n- `pass \u003cpassphrase\u003e` Sets the passphrase to the SSL PEM private key file via the standard I/O interface.\r\n- `pass \u003cunset\u003e` Unsets the passphrase to the SSL PEM private key file.\r\n\r\n\r\n## API Tokens\r\n\r\nSyntax: `hockit token \u003coption\u003e \u003cparameter\u003e`\r\n\r\nRunning `hockit token` without options will list all valid API tokens and their nicknames.\r\n\r\n- `list` Lists all API tokens.\r\n- `list \u003cnickname\u003e` Searches for an API token usng `nickname`.\r\n- `revoke \u003cnickname\u003e` Permanently revokes an API token using `nickname` from service, denying all future API requests made with that token.\r\n- `create \u003cnickname\u003e` Creates and returns a new API token and indexes it using `nickname`.\r\n\r\n# REST API\r\n\r\nHockit implements a traditional REST API via the Get and Post HTTP request methods; response bodies are in JSON format, and are sometimes omitted in favor of HTTP status codes.\r\n\r\nTo access the API, you must supply a valid API token in the `Authorization` HTTP request header. API tokens can be generated and revoked via the CLI, see [API Tokens](#api-tokens)\r\n\r\n## JSON Response\r\n\r\nTf the HTTP response body is present, it will contain a JSON string with an `error` property and a `data` property. If there was no error, then `error` will be set to `null`.\r\n\r\n## Routes\r\n\r\nURL Syntax: `my.website.com/\u003ccommand\u003e/\u003cparameter\u003e`\r\n\r\n- `/\u003chash\u003e` If a file is found which matches the hash, then GET returns the binary data. Returns HTTP error 404 if no file was found.\r\n- `/up` Uploads a file to the server and redirects to `/uploads` to display it. Excpets the request body to contain data of type `multipart/form-data`.\r\n- `/list` Lists all uploaded files and their hashes. Returns an array of objects with the properties `name`, and `hash`.\r\n- `/list/\u003chash\u003e` Searches for a file using `hash`. Returns an object with the properties `name`, and `hash`.\r\n- `/delete/\u003chash\u003e` Deletes a file using `hash`. Returns HTTP 200 on success, and HTTP 404 if the file does not exist.\r\n- `/_healthcheck` Simply returns an \"OK\" string. Useful for monitoring the HTTP server uptime and checking that it is operating as expected.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffloofies%2Fhockit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffloofies%2Fhockit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffloofies%2Fhockit/lists"}