Lightweight selfhosted Firefox Send alternative without public upload

Gokapi

Available for:

About

Gokapi is a lightweight server to share files, which expire after a set amount of downloads or days. It is similar to the discontinued Firefox Send, with the difference that only the admin is allowed to upload files.

This enables companies or individuals to share their files very easily and having them removed afterwards, therefore saving disk space and having control over who downloads the file from the server.

The project is very new, but can already be used in production. Customization is very easy with HTML/CSS knowledge. Identical files will be deduplicated.

Screenshots

Admin Menuimage Download Linkimage

Installation

Bare Metal

Simply download the latest release for your platform and execute the binary (recommended). If you want to compile the source yourself, clone this repository and execute go build.

Docker

Run the following command to create the container, volumes and execute the initial setup: docker run -it -v gokapi-data:/app/data -v gokapi-config:/app/config -p 127.0.0.1:53842:53842 f0rc3/gokapi:latest. Please note the -it docker argument, which is required for the first start!

With the argument -p 127.0.0.1:53842:53842 the service will only be accessible from the machine it is running on. Normally you will use a reverse proxy to enable SSL - if you want to make the service availabe to other computers in the network without a reverse proxy, replace the argument with -p 127.0.0.1:53842:53842. Please note that traffic will not be encypted that way and data like passwords and transferred files can easily be read by 3rd parties!

Usage

First start

On the first start you will be prompted for the initial configuration.

  • Username: Enter the name for the admin user name (who can upload files)
  • Password: This will be used to enter the admin page
  • Server URL: The external URL for the Gokapi server. Hosting it with a reverse proxy and SSL is strongly recommended! For testing purposes you can enter http://127.0.0.1:53842/
  • Index URL: The URL where the index page redirects to. Leave blank to have it redirect to the Gokapi GitHub page
  • Bind port to localhost: If you choose yes, you can only access Gokapi on the machine or by using a reverse proxy. Strongly recommended! Not displayed when deployed with Docker.

Then you can navigate to http://127.0.0.1:53842/admin in your browser and login with the credentials.

Uploading

To upload, drag and drop a file, folder or multiple files to the Upload Zone. If you want to change the default expiry conditions, this has to be done before uploading. For each file an entry in the table will appear with a download link. You can also delete files on this screen.

Customizing

By default, all files are included in the executable. If you want to change the layout (e.g. add your company logo or change the app name etc.), follow these steps:

  • Clone this repository
  • Copy either the folder static, templates or both to the directory where the executable is located
  • Make changes to the folders. static contains images, CSS files and JavaScript. templates contains the HTML code.
  • Restart the server. If the folders exist, the server will use the local files instead of the embedded files
  • Optional: To embed the files permanently, the executable needs to be recompiled with go build.

Contributors

License

This project is licensed under the GNU GPL3 - see the LICENSE.md file for details

Donations

As with all Free software, the power is less in the finances and more in the collective efforts. I really appreciate every pull request and bug report offered up by our users! If however, you're not one for coding/design/documentation, and would like to contribute financially, you can do so with the link below. Every help is very much appreciated!

paypal LiberaPay

Owner
Comments
  • Serviceworker cannot be loaded from external URL with restrictive Firefox settings

    Serviceworker cannot be loaded from external URL with restrictive Firefox settings

    I'm using docker. When I run this:

    sudo docker run -v gokapi-data:/app/data -v gokapi-config:/app/config -p 53842:53842 f0rc3/gokapi:latest

    it gives me the setup & and I can walk through it. However, when it asks me to pick the storage location, Cloud isn't an option because I didn't build it with that?

    I was able to run this instead to build it with the cloud part set up:

    sudo docker run -d --restart always -it -v gokapi-data:/app/data -v gokapi-config:/app/config -p 53842:53842
    -e GOKAPI_AWS_BUCKET={hiddenBucketName}
    -e GOKAPI_AWS_REGION=us-west-2
    -e GOKAPI_AWS_KEY={hiddenKey}
    -e GOKAPI_AWS_KEY_SECRET={hiddenSecretKey}
    f0rc3/gokapi:latest

    That boots everything up and lets me upload files. The files go into my S3 bucket. But, I can't download them. I set the CORS value to:

    [ { "AllowedHeaders": [ "*" ], "AllowedMethods": [ "GET", "PUT", "POST", "DELETE", "HEAD" ], "AllowedOrigins": [ "https://{domain}", "https://{domain}/*" ], "ExposeHeaders": [] } ]

    But when I try to download, the button just turns dark grey and nothing happens.

  • Setting up on Digital Ocean etc..  W/O Direct LAN access

    Setting up on Digital Ocean etc.. W/O Direct LAN access

    Is there a way to configure this w/o having direct lan access? I only have SSH access to my droplet and it's asking me to visit the lan IP of the machine. Attempting to visit the WAN IP gives me a "this site is in maintenance mode" message. Any help would be greatly appreciated.

  • Always 400 Bad Request with Nginx

    Always 400 Bad Request with Nginx

    Hi,

    Testing with nginx (swag with letsencrypt from linuxserver.io) I always get 400 Bad Request. Accessing via IP it works as it should but of course I cant share on the internet.

    My setup is: No SSL Public facing URL - is my URL used by Nginx Redirection is above URL/admin Authentication is username and password Storage - local storage + As above Encryption - level 0

    I have other apps behind nginx (like 20+ of them) - they all work fine.

    I am not sure what the issues is. limited logs from docker (xxx are my changes):

    ██████  ██████  ██  ██  █████  ██████  ██  ██       ██    ██ ██  ██  ██   ██ ██   ██ ██  ██  ███ ██  ██ █████   ███████ ██████  ██  ██  ██ ██  ██ ██  ██  ██   ██ ██      ██   ██████   ██████  ██  ██ ██  ██ ██  ██                                        Gokapi v1.5.2 starting Please open http://xxx.xxx.xxx.xxx:53842/setup to setup Gokapi. Saving new files to local storage Binding webserver to :53842 Webserver can be accessed at https://xxx.xxxxxx.xxx/admin Press CTRL+C to stop Gokapi

  • Setup with docker

    Setup with docker

    Hi, I was tryting to setup gokapi with docker-compose, but wasn't able to get everything up and running. Starting with docker-compose works fine and it creates a config file, but trying to access gokapi from a different machine does not work at all. Trying to access it with curl on the machine its running on does not work (curl: (7) Failed to connect to 127.0.0.1 port 8084: Verbindungsaufbau abgelehnt). I then tried to run everything with the provided command from the readme with docker run -it -v /home/gokapi/data:/app/data -v /home/gokapi/config:/app/config -p 8084:53842 f0rc3/gokapi:latest with the same result. Config file is the same both ways but I cannot access the sever, neither with an apache reverse proxy nor with ip:port (or on the machine itself). I also tried to run gokapi with the default ports, but same result again.

    Additionally I saw, the LengthId in the config is always 0, despite me setting it in the environment. The created config will never use use my value or the default 15. This happens with both docker run... and docker-compose btw.

    Am I missing something?

    docker-compose.yml:

    version: "3"
    services:
      gokapi:
        image: f0rc3/gokapi:latest
        container_name: gokapi
        restart: unless-stopped
        environment:
          - GOKAPI_USERNAME=Jisagi
          - GOKAPI_PASSWORD=XXXXXX
          - GOKAPI_LENGTH_ID=20
        ports:
          - "8084:53842"
        volumes:
          - /home/gokapi/data:/app/data
          - /home/gokapi/config:/app/config
    

    created config:

    {
        "Port": "127.0.0.1:53842",
        "AdminName": "Jisagi",
        "AdminPassword": "XXXXXXXXXXXXXXXXX",
        "ServerUrl": "http://127.0.0.1:53842/",
        "DefaultDownloads": 1,
        "DefaultExpiry": 14,
        "DefaultPassword": "",
        "RedirectUrl": "https://github.com/Forceu/Gokapi/",
        "Sessions": {},
        "Files": {},
        "Hotlinks": {},
        "ConfigVersion": 4,
        "SaltAdmin": "zsYecQPNEbPxhInpa62nOvWrICDyVCfoDOxotOW",
        "SaltFiles": "2z8CH4B6mkE3YoVHcXLUUg1j8lcVEuNclFe6Umq9",
        "LengthId": 0,
        "DataDir": "data"
    }
    
  • Feature Request: Sqlite config backend

    Feature Request: Sqlite config backend

    Hello.

    Storing files and sessions inside config is not great idea for several reasons:

    1. It's not secure, because read-only access for configs in Linux is a common practice.
    2. It's not good for performance beacuse full rewrite required.
    3. It's, in general, bad practice.

    What do you think about adding new backend. Sqlite will be the simplest one, which can be used for existing configs, mostly, inplace (for example, another .sqlite file in config folder). Also supporting sqlite may lead to supporting normal DBs like Postrgres or MariaDB.

    Benefits:

    1. May increase performance and stability with low-end devices with bad IO which is may relevant for this application.
    2. May increase performance for instances with a lot of files, because config rewrite is not required (adding 1 file to 10000 existing is not a problem)
    3. State isolation is a good technique in general. Many self-hosted application can store almost full state in DB, except user data. And one DB backup script is enough for server backup, but another procedure is required for gokapi

    What do you think? I also can help with this if you wish.

    Regards.

  • Cannot run in docker

    Cannot run in docker

    Hi, I'm trying run gokapi in docker on Synology NAS and neither after maybe tens attempts i'm don't have any success. Can you help me with settings please? I'm runnig many other containers but with this....i don't know.

    My container minimal settings: { "cap_add" : null, "cap_drop" : null, "cmd" : "/app/gokapi", "cpu_priority" : 50, "devices" : null, "enable_publish_all_ports" : false, "enable_restart_policy" : false, "enabled" : true, "env_variables" : [ { "key" : "PATH", "value" : "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" }, { "key" : "GOKAPI_PASSWORD", "value" : "xxxxxxxxxxxxxxxxxx" }, { "key" : "GOKAPI_USERNAME", "value" : "myName" } ], "exporting" : false, "id" : "2379bc3ac01d530858f539bc131313d61cf54dbe0ea20b90694e015ad338875f", "image" : "f0rc3/gokapi:latest", "is_ddsm" : false, "is_package" : false, "links" : [], "memory_limit" : 0, "name" : "f0rc3-gokapi1", "network" : [ { "driver" : "bridge", "name" : "bridge" } ], "network_mode" : "bridge", "port_bindings" : [ { "container_port" : 53842, "host_port" : 0, "type" : "tcp" } ], "privileged" : false, "shortcut" : { "enable_shortcut" : false }, "use_host_network" : false, "volume_bindings" : [] }

    Result: gokapi

    Sorry for my bad eglish.

  • Issue: config.json - unexpected end of JSON input

    Issue: config.json - unexpected end of JSON input

    Hello,

    I'm hoping I can get some support, but I'm running this Unraid template - so I can't be certain my issue can be solved here. The template is essentially Gokapi v1.6.1 using docker-compose.

    My configuration used to work, until a recent update - not sure which. Now, I cannot start the container, and am left with error reading config.json: unexpected end of JSON input in the log. I deleted my config.json and started over using the newish onboarding wizard (which is really nice btw), but I'm still getting this error.

    I don't see anything wrong with the configuration, but maybe I'm missing something.

    config.json:

    {
      "Authentication": {
        "Method": 1,
        "SaltAdmin": "<redacted>",
        "SaltFiles": "<redacted>",
        "Username": "",
        "Password": "",
        "HeaderKey": "",
        "OauthProvider": "https://authentik.domain.tld/application/o/gokapi/",
        "OAuthClientId": "<redacted>",
        "OAuthClientSecret": "<redacted>",
        "HeaderUsers": null,
        "OauthUsers": null
      },
      "Port": ":53842",
      "ServerUrl": "https://g.domain2.tld",
      "RedirectUrl": "https://domain2.tld",
      "ConfigVersion": 12,
      "LengthId": 10,
      "DataDir": "data",
      "MaxMemory": 40,
      "UseSsl": false,
      "MaxFileSizeMB": 102400,
      "Encryption": {
        "Level": 0,
        "Cipher": null,
        "Salt": "",
        "Checksum": "",
        "ChecksumSalt": ""
      },
      "PicturesAlwaysLocal": true
    }
    

    Thank you for any help you can provide.

  • Redirected to a broken HTTPS page when using public domain

    Redirected to a broken HTTPS page when using public domain

    Hi. I just ran gokapi on a Debian 10 box with apache already installed and it works fine when using the internal IP address to connect, however, when I use my domain to try and connect to it, it changes my connection from being an HTTP connection to an HTTPS connection and FireFox throws the error: SSL_ERROR_RX_RECORD_TOO_LONG I'm not sure whats wrong here, as it runs perfectly fine when using my internal IP, however, this defeats the purpose of using it to share files with others. All of the settings are default except it is not bound only to localhost and I'm not using a reverse proxy. Port 53842 is port forwarded.

  • Feature Request: Copy directlink for non image files (button)

    Feature Request: Copy directlink for non image files (button)

    Hi, would it be possible to add a fourth button to be able to copy the direct link to a non image file? This would make it easier to download files in a console. I currently create the link manually with https://host.tld/downloadFile?id=<ID>.

    It does not necessarily have to be another button, but a possibility in general to copy the above link in the frontend. On that note, you could also add DownloadUrl to the json response when uploading via the api, so custom upload scripts can use it as well.

  • Hotlink URL not showing Error message after file expiration

    Hotlink URL not showing Error message after file expiration

    When trying to use a hotlink URL after the file has been deleted from the server (max download 1), it shows a page of this:

    image

    If you use the regular file URL for the same file, it redirects to /error with "Sorry, this file cannot be found. Either the link has expired or it has been downloaded already".

  • Feature Request: Show amount of downloads for unlimited files

    Feature Request: Show amount of downloads for unlimited files

    It would be quite helpful if I could see the number of downloads for files without download limits. Since just putting the number of downloads into the "Downloads remaining" column wouldn't make much sense, I was thinking that a sensable change would be to rename the column to something like "Downloads/Limit" and change each row to "x/limit" for files with download restrictions or "x/Unlimited" for files without restrictions. Thank you!

  • UI suggestion

    UI suggestion

    Here's a humble suggestion to improve the design of uploaded items.

    1. Not enough space for full filename
    2. Slight overlap between progress bar and filename
    3. Size units can stay in MB until file size actually reaches 1GB
    gokapi-upload-item
  • Timeout when uploading large files to cloud storage

    Timeout when uploading large files to cloud storage

    Hi, I decided to configure Gokapi to use Cloudflare R2, with auto set as the S3 region. When the file is successfully uploaded to the Gokapi server, the server returns an error (504 Gateway Timeout as I used Nginx).

    Looking at the logs, I see the following warning, in which I have configured my server with the correct access key and secret access key. Requesting a new one from Cloudflare doesn't fix the issue as well:

    caused by: SignatureDoesNotMatch: The request signature we calculated does not match the signature you provided. Check your secret access key and signing method.

  • Feature Request: Oauth: Allowed Groups

    Feature Request: Oauth: Allowed Groups

    instead of limiting the access to certain users, restrict the access to certain groups would be helpful. perhaps using the non-standard? groups claim.

    https://github.com/Forceu/Gokapi/blob/49f11e94dab4762bb16d13762a67d43c858ace67/internal/webserver/authentication/Authentication.go#L78

  • Feature request: User management & permissions

    Feature request: User management & permissions

    Hello,

    it would be very nice to have the possibilites to add new user that can access the admin board

    And : remove a user, edit user passwords could be cool too

    Thanks !

Generate PlantUML diagrams from Chrome or Firefox network inspections

hoofli Generate PlantUML diagrams from Chrome or Firefox network inspections This tool reads browser HAR files stored on your local disk and transform

Nov 15, 2022
a benchmarking&stressing tool that can send raw HTTP requests

reqstress reqstress is a benchmarking&stressing tool that can send raw HTTP requests. It's written in Go and uses fasthttp library instead of Go's def

Dec 18, 2022
Send keyboard events with Golang
Send keyboard events with Golang

sendkeys sendkeys is a cross-platform usability wrapper for the keybd_event Go library. Summary Use this library to turn full strings into simulated k

Dec 12, 2022
Test your code without writing mocks with ephemeral Docker containers 📦 Setup popular services with just a couple lines of code ⏱️ No bash, no yaml, only code 💻

Gnomock – tests without mocks ??️ Spin up entire dependency stack ?? Setup initial dependency state – easily! ?? Test against actual, close to product

Dec 29, 2022
Backpulse's core. Backpulse is an API Based CMS. Build you own website without worrying about the content administration system.

Backpulse core Backpulse is an API Based / Headless CMS. Your site's content is accessible directly via our RESTful API, on any web framework and any

Sep 11, 2022
How we can run unit tests in parallel mode with failpoint injection taking effect and without injection race

This is a simple demo to show how we can run unit tests in parallel mode with failpoint injection taking effect and without injection race. The basic

Oct 31, 2021
Lightweight service virtualization/API simulation tool for developers and testers
Lightweight service virtualization/API simulation tool for developers and testers

API simulations for development and testing Hoverfly is a lightweight, open source API simulation tool. Using Hoverfly, you can create realistic simul

Dec 28, 2022
A lightweight load balancer used to create big Selenium clusters
A lightweight load balancer used to create big Selenium clusters

Go Grid Router Go Grid Router (aka Ggr) is a lightweight active load balancer used to create scalable and highly-available Selenium clusters. Articles

Dec 28, 2022
Professional lightweight testing mini-framework for Go.
Professional lightweight testing mini-framework for Go.

is Professional lightweight testing mini-framework for Go. Easy to write and read Beautifully simple API with everything you need: is.Equal, is.True,

Dec 28, 2022
Lightweight HTTP mocking in Go (aka golang)

httpmock This library builds on Go's built-in httptest library, adding a more mockable interface that can be used easily with other mocking tools like

Dec 16, 2022
A basic lightweight HTTP client for Go with included mock features.

A basic lightweight HTTP client for Go with included mock features. Features Support almost all http method like G

May 2, 2022
create temporary Firefox profile, install user.js and extensions, launch Firefox

tmpfox tmpfox is a Firefox wrapper that: Creates a temporary Firefox profile Installs user.js configuration file from Arkenfox for increased privacy a

Jul 27, 2022
Node is where client will send data to, create block send to miner, create block send to parent and receive tick from validator and do validate

Node Receive Tick from validator Validate POH of tick send result to validator Receive confirm block from validator Send Checked block to validator Ho

Dec 31, 2021
Selfhosted collaborative browser - room management for n.eko
Selfhosted collaborative browser - room management for n.eko

neko-rooms Simple room management system for n.eko. Self hosted rabb.it alternative. How to start You need to have installed Docker and docker-compose

Dec 20, 2022
Playwright for Go a browser automation library to control Chromium, Firefox and WebKit with a single API.
Playwright for Go a browser automation library to control Chromium, Firefox and WebKit with a single API.

?? Playwright for API reference | Example recipes Playwright is a Go library to automate Chromium, Firefox and WebKit with a single API. Playwright is

Jan 1, 2023
Build apps that run everywhere with Go and a browser engine of your choice (Chrome, Firefox, Epiphany or Android WebView).

hydrapp Build apps that run everywhere with Go and a browser engine of your choice (Chrome, Firefox, Epiphany or Android WebView). Overview ?? This pr

Dec 14, 2022
Generate PlantUML diagrams from Chrome or Firefox network inspections

hoofli Generate PlantUML diagrams from Chrome or Firefox network inspections This tool reads browser HAR files stored on your local disk and transform

Nov 15, 2022
The open source public cloud platform. An AWS alternative for the next generation of developers.
The open source public cloud platform. An AWS alternative for the next generation of developers.

M3O M3O is an open source public cloud platform. We are building an AWS alternative for the next generation of developers. Overview AWS was a first ge

Jan 2, 2023
A lightweight, universal OneDrive upload tool for all platforms

简体中文 OneDriveUploader MoeClub wrote a very good version, but unfortunately it's not open source and hasn't been updated in a while. This project is a

Dec 18, 2022
A lightweight, universal cloud drive upload tool for all platforms

简体中文 LightUploader MoeClub wrote a very good version, but unfortunately it's not open source and hasn't been updated in a while. This project is a sim

Jan 3, 2023