{"id":19065614,"url":"https://github.com/caiorss/fserver","last_synced_at":"2026-05-15T07:30:16.124Z","repository":{"id":90043007,"uuid":"222565431","full_name":"caiorss/fserver","owner":"caiorss","description":"Standalone, single-file file sharing web server written in Kotlin and Javalin web framework.","archived":false,"fork":false,"pushed_at":"2019-12-17T03:03:33.000Z","size":366,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-02T14:15:20.457Z","etag":null,"topics":["file","java","kotlin","server","sharing","utility","web"],"latest_commit_sha":null,"homepage":null,"language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/caiorss.png","metadata":{"files":{"readme":"README.org","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-11-18T23:32:17.000Z","updated_at":"2024-06-17T03:39:04.000Z","dependencies_parsed_at":"2024-04-21T02:48:33.283Z","dependency_job_id":null,"html_url":"https://github.com/caiorss/fserver","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caiorss%2Ffserver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caiorss%2Ffserver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caiorss%2Ffserver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caiorss%2Ffserver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/caiorss","download_url":"https://codeload.github.com/caiorss/fserver/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240118431,"owners_count":19750491,"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","java","kotlin","server","sharing","utility","web"],"created_at":"2024-11-09T00:51:21.461Z","updated_at":"2026-05-15T07:30:16.043Z","avatar_url":"https://github.com/caiorss.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"* FServer - Micro File Sharing Server \n** Overview \n\nFServer is a micro file sharing web server for sharing files and\ndirectories on the local network or over the internet. FServer is\neasier to modify and maintain as it is written in Kotlin.\n\n *Features*\n\n   + Easier usage, not required any system administration or\n     complicated configuration files. \n\n   + Single-jar file and zero dependencies.\n\n   + Sharing multiple directories \n\n   + Serve static web sites or any directory containing an index.html file.\n\n   + File upload\n\n   + Hide/display pictures\n\n   + Optional: session/based and form-based authentication.\n\n   + Image thumbnail of PDF files, requires --pdf\n     command line switch. [EXPERIMENTAL]\n\n   + Response web page layout which makes it mobile-friendly and\n     usable from tablets and smartphones.\n\n\n *Implementation*\n\n   + Written in Kotlin for JVM (Java Virtual Machine)\n\n   + Build System: Gradle + Gradle-Kotlin DSL\n\n *Libraries Used*\n\n  + Web Framework:\n    + https://javalin.io/\n\n  + Command Line:\n    + https://ajalt.github.io/clikt/\n\n  + Logging:\n    + http://www.slf4j.org/\n\n  + Toml configuration file:\n    + https://github.com/mwanji/toml4j\n\n  + Apache PDFBox library for manipulating and displaying PDF files\n    + https://pdfbox.apache.org/\n\n  + Javascript library for pan, zooming and pinching on mobile/touchscreen devices.\n    + https://github.com/hammerjs/hammer.js\n\n** Download Binary Release \n\nBinary Releases can be download from: \n\n  + https://github.com/caiorss/fserver/releases/\n\n  +  [[https://github.com/caiorss/fserver/releases/download/v0.1/][Release v0.1]] - Artifact: [[https://github.com/caiorss/fserver/releases/download/v0.1/fserver.jsh][fserver.jsh]]\n\n *Example: Donwload and running artifact from command line*\n\nDownload artifact: \n\n#+BEGIN_SRC sh \n  $ curl -O -L https://github.com/caiorss/fserver/releases/download/v0.1/fserver.js\n  $ chmod +x fserver.jsh \n#+END_SRC\n\nRun the server: \n  + $ ./fserver.jsh  [PARAMETERS] ...\n  + $ sh fserver.jsh [PARAMETERS] ...\n  + $ java -jar fserver.jsh [PARAMETERS] ...\n\n#+BEGIN_SRC sh \n   $ sh ./fserver.jsh                                                               \n  Usage: fserver [OPTIONS] COMMAND [ARGS]...\n\n    FServer - micro file sharing server\n\n  Options:\n    -h, --help  Show this message and exit\n\n  Commands:\n    dir     Serve a single directory\n    mdir    Serve multiple directories\n    config  Start server from user-provided configuration file.\n    test    Run server in demonstration mode.\n    dummy   Dummy command\n#+END_SRC\n\nShare single directory (current directory):\n + The site will be available in the URL http://localhost:9042 or\n   ~http://\u003cLOCAL_IP_ADDRESS\u003e:9042/~, in this case:\n   http://192.165.15.154:9042. \n\n#+BEGIN_SRC sh \n  $  ./fserver.jsh dir ~/Documents --port=9042                                   \n  [main] INFO io.javalin.Javalin - \n             __                      __ _\n            / /____ _ _   __ ____ _ / /(_)____\n       __  / // __ `/| | / // __ `// // // __ \\\n      / /_/ // /_/ / | |/ // /_/ // // // / / /\n      \\____/ \\__,_/  |___/ \\__,_//_//_//_/ /_/\n\n          https://javalin.io/documentation\n\n  [main] INFO org.eclipse.jetty.util.log - Logging initialized @286ms to org.eclipse.jetty.util.log.Slf4jLog\n  [main] INFO io.javalin.Javalin - Starting Javalin ...\n   [INFO] File Web Server URL =\u003e http://192.165.15.154:9042 \n  ... ... ... ... ... \n#+END_SRC\n\n** Example: Serve multiple directories \n\n + Part 1: Start the server.\n\n   + --port=9025\n     + =\u003e Server listent to port 9025 (default 9080)\n\n   + --upload\n     + =\u003e Enable upload which is disabled by default.\n\n   + --auth=myuser:mypass\n     + =\u003e Enable authentication with 'myuser' as  login and 'mypass' as password.\n\n   + etc:/etc\n     + =\u003e Shares the directory /etc which is mapped to the URL http://localhost:9025/directory/etc\n\n   + downloads:~/Downloads\n     + =\u003e Shares the directory ~/Downloads which  is mapped to the URL http://localhost:9025/directory/downloads\n\n#+BEGIN_SRC sh \n  $ java -jar build/libs/fserver-fat.jar mdir --port=9025 \\\n                                               --upload \\\n                                               --showpath \\\n                                               --auth=myuser:mypass \\\n                                               etc:/etc currentdir:. downloads:~/Downloads \n#+END_SRC\n\nOutput: \n\n#+BEGIN_SRC sh \n\n  [main] INFO io.javalin.Javalin - \n             __                      __ _\n            / /____ _ _   __ ____ _ / /(_)____\n       __  / // __ `/| | / // __ `// // // __ \\\n      / /_/ // /_/ / | |/ // /_/ // // // / / /\n      \\____/ \\__,_/  |___/ \\__,_//_//_//_/ /_/\n\n          https://javalin.io/documentation\n\n  [main] INFO org.eclipse.jetty.util.log - Logging initialized @309ms to org.eclipse.jetty.util.log.Slf4jLog\n  [main] INFO io.javalin.Javalin - Starting Javalin ...\n  [main] INFO io.javalin.Javalin - Listening on http://localhost:9025/\n  [main] INFO io.javalin.Javalin - Javalin started in 190ms \\o/\n  [qtp214074868-15] INFO org.eclipse.jetty.util.TypeUtil - JVM Runtime does not support Modules\n  ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... \n#+END_SRC\n\nTo enable TSL, use command line option --tslcert=\u003cPASSWORD\u003e:\u003cCERTFICATE-FILE\u003e: \n  + When the TSL is enabled, the URL becomes 'https' instead of\n    'http'. So the site is also acessible from https://localhost:9025\n    (Local host).\n  + The web browser scary warning can be ignored as in this case, the\n    TSL is being used to _encrypt the connection_ over the local network\n    (LAN) or the over the internet. \n\n#+BEGIN_SRC sh \n  $ java -jar build/libs/fserver-fat.jar mdir --port=9025 \\\n                                              --tslcert=mypassword:./cert-test.tsl\n                                               --upload \\\n                                               --showpath \\\n                                               --auth=myuser:mypass \\\n                                               etc:/etc currentdir:. downloads:~/Downloads \n\n#+END_SRC\n\n\n + Part 2: Browser the URL http://localhost.com:9025 or  http://\u003cmy_local_ip_address\u003e:9025 \n\nLogin Page: \n\n[[file:images/page_login.png][file:images/page_login.png]]\n\nIndex page: contains the shared directories pages. \n\n[[file:images/page_index.png][file:images/page_index.png]]\n\nDirectory listing 1: \n\n[[file:images/page_directory1.png][file:images/page_directory1.png]]\n\nDirectory listing 2: \n\n[[file:images/page_directory2.png][file:images/page_directory2.png]]\n\nDirectory listing 3: (Mobile, responsive design mode)\n\n[[file:images/page_mobile.png][file:images/page_mobile.png]]\n\n** Example: Start server from configuration file \n\nThe FServer application can also be initialized from a TOML configuration\nfile, which is a human-readable format. \n\nFile: server-conf.toml \n\n#+BEGIN_SRC sh \n   [FSERVER]\n   # Current port that the server will listen to.\n   port  = 9080\n\n   # Authentication (Optiona): \u003cUSER\u003e:\u003cPASSWORD\u003e\n   auth  = \"myuser:mypassword\"\n\n   # Show/hide path of shared directories in the index page.\n   showdirectory = false\n\n   # Enable/disable upload \n   upload = true \n\n   # Enable PDF Thumbnail [EXPERIMENTAL FEATURE]\n   pdfthumbnail = true\n\n   # Key-value pairs\n   #   \u003cDIRECTORY-LABEL\u003e:\u003cDIRECTORY_PATH\u003e\n   paths = [\n          , \"desk:~/Desktop\"\n          , \"files:~/Downloads/firefox/\"\n          # Static web site html (contains an index.html file)\n          , \"conf:/etc\"       \n   ] \n#+END_SRC\n\nThis configuration:\n\n  + Listen incoming http connection at port 9080\n\n  + Set authentication: 'myuser' as username and 'mypassword' as\n    password. This field can be disabled by commenting it.\n\n  + Creates the following pages/URLs\n    + http://localhost:9090/directory/desk =\u003e Shows the content of the directory ~/Desktop\n    + http://localhost:9090/directory/files =\u003e Shows the content of the directory ~/Downloads/firefox\n    + http://localhost:9090/directory/conf =\u003e Shows the content of the  directory /etc\n\nRunning: \n\n  + $ java -jar build/libs/fserver-fat.jar config server-conf.toml\n\n#+BEGIN_SRC sh \n  $ java -jar build/libs/fserver-fat.jar config server-conf.toml \n\n   [INFO] Server listening port: 9080 =\u003e URL: http://localhost:9080 \n   [INFO] Server authentication login = user:pass \n   Shared directories = \n     =\u003e desk:~/Desktop\n     =\u003e files:~/Downloads\n     =\u003e wiki:~/Documents/wiki\n     =\u003e etc:/etc\n   ------------------------------------------------------------\n  [main] INFO io.javalin.Javalin - \n             __                      __ _\n            / /____ _ _   __ ____ _ / /(_)____\n       __  / // __ `/| | / // __ `// // // __ \\\n      / /_/ // /_/ / | |/ // /_/ // // // / / /\n      \\____/ \\__,_/  |___/ \\__,_//_//_//_/ /_/\n\n          https://javalin.io/documentation\n\n  [main] INFO org.eclipse.jetty.util.log - Logging initialized @342ms to org.eclipse.jetty.util.log.Slf4jLog\n  [main] INFO io.javalin.Javalin - Starting Javalin ...\n  [main] INFO io.javalin.Javalin - Listening on http://localhost:9080/\n  [main] INFO io.javalin.Javalin - Javalin started in 189ms \\o/\n  [qtp2042495840-16] INFO org.eclipse.jetty.util.TypeUtil - JVM Runtime does not support Modules\n\n#+END_SRC\n\n** Example: Start server from configuration file with SSL/TSL \n\n *STEP 1:* Create a self-signed certificate by running the following\ncommand and typing 'yes' to the final prompt. If there is already an\nexisting one, skip this step. This step generates the certificate file\ntest-cert.jks with password set to 'mypassword'.\n\n#+BEGIN_SRC sh \n  $ keytool -genkey -keyalg RSA -storetype PKCS12 -alias sec_server  \\\n            -keystore test-cert.jks \\\n            -storepass mypassword \\\n             -validity 1000000 -keysize 2048\n#+END_SRC\n\n\n *STEP 2:* Create the configuration file server-conf.toml with the\n following content:\n\nFile: server-conf.toml\n\n#+BEGIN_SRC sh \n   [FSERVER]\n   # Current port that the server will listen to.\n   port  = 9080\n\n   # Authentication (Optiona): \u003cUSER\u003e:\u003cPASSWORD\u003e\n   auth  = \"myuser:mypassword\"\n\n   # Show/hide path of shared directories in the index page.\n   showdirectory = false\n\n   # Enable/disable upload \n   upload = true \n\n   # \u003cOPTIONAL\u003e If 'tslcert' variable is set with \u003cPASSWORD\u003e:\u003cCERTIFICATE-FILE\u003e\n   # it enables SSL/TSL which makes the connection encrypted.\n   #\n   # The server URL becomes 'https://\u003cSERVER-ADDR\u003e:\u003cPORT\u003e'\n   # instead of 'http://\u003cSERVER-ADDR\u003e:\u003cPORT\u003e'\n   tslcert = \"mypassword:./test-cert.jks\"\n\n   # Key-value pairs\n   #   \u003cDIRECTORY-LABEL\u003e:\u003cDIRECTORY_PATH\u003e\n   paths = [\n          , \"desk:~/Desktop\"\n          , \"files:~/Downloads/firefox/\"\n          # Static web site html (contains an index.html file)\n          , \"conf:/etc\"       \n   ] \n#+END_SRC\n\n *STEP 3:* Run server. When SSL/TSL is enabled, the server URL becomes\n https://server-address:9080 or https://localhost:9080 when accessing\n from local host.\n\n#+BEGIN_SRC sh \n  $ java -jar build/libs/fserver-fat.jar config config.toml \n#+END_SRC\n\n** Building \n\nNote: The compilation requires a gradle and Kotlin installation: \n\n *Build* \n\n#+BEGIN_SRC sh \n  $ gradle build\n#+END_SRC\n\n *Test* \n  \n  + $ java -jar build/libs/fserver-fat.jar \n \n#+BEGIN_SRC sh \n  $ java -jar build/libs/fserver-fat.jar \n\n  Usage: commandmain [OPTIONS] COMMAND [ARGS]...\n\n  Options:\n    -h, --help  Show this message and exit\n\n  Commands:\n    dir     Serve a single directory\n    mdir    Serve multiple directories\n    config  Start server from user-provided configuration file.\n    test    Run server in demonstration mode.\n    dummy   Dummy command\n\n#+END_SRC\n** Show help \n\n *Show help for all commands* \n\n#+BEGIN_SRC \n  $ java -jar build/libs/fserver-fat.jar\n  Usage: fserver [OPTIONS] COMMAND [ARGS]...\n\n    FServer - micro file sharing server\n\n  Options:\n    -h, --help  Show this message and exit\n\n  Commands:\n    dir     Serve a single directory\n    mdir    Serve multiple directories\n    config  Start server from user-provided configuration file.\n    test    Run server in demonstration mode.\n    dummy   Dummy command\n\n#+END_SRC\n\n *Show help for the command 'dir*'\n\n  + $ java -jar build/libs/fserver-fat.jar dir --help\n\n#+BEGIN_SRC txt \n  $ java -jar build/libs/fserver-fat.jar dir -h\n  Usage: fserver dir [OPTIONS] PATH\n\n    Serve a single directory\n\n  Options:\n    --port INT   Http Server port (default 9080)\n    --auth TEXT  Enable Authentication. \u003cUSERNAME\u003e:\u003cPASSWORD\u003e\n    --upload     Enable upload\n    --showpath   Show absolute paths of shared directories\n    --pdf        Render thumbnails of PDF files of listed directories\n    -h, --help   Show this message and exit\n\n  Arguments:\n    PATH  Directory to be served\n\n#+END_SRC\n\n *Show help for the command mdir* \n\n#+BEGIN_SRC txt \n  $ java -jar build/libs/fserver-fat.jar mdir -h\n  Usage: fserver mdir [OPTIONS] [PATHLIST]...\n\n    Serve multiple directories\n\n  Options:\n    --port INT      Http Server port (default 9080)\n    --auth TEXT     Enable Authentication. \u003cUSERNAME\u003e:\u003cPASSWORD\u003e\n    --upload        Enable upload\n    --showpath      Show absolute paths of shared directories\n    --pdf           Render thumbnails of PDF files of listed directories\n    --tslcert TEXT  TSL/SSL Certificate and passwrod \u003cPASSWORD\u003e:\u003cFILE\u003e\n    -h, --help      Show this message and exit\n\n  Arguments:\n    PATHLIST  Directories =\u003e \u003clabel\u003e:\u003cdirectory\u003e to be served\n\n#+END_SRC\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcaiorss%2Ffserver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcaiorss%2Ffserver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcaiorss%2Ffserver/lists"}