Popularity
7.7
Declining
Activity
7.1
-
1,381
34
162

Programming language: Go
License: GNU General Public License v3.0 or later
Latest version: v1.3.1

Plik alternatives and similar packages

Based on the "Other Software" category.
Alternatively, view Plik alternatives based on common mentions on social networks and blogs.

  • syncthing

    Open Source Continuous File Synchronization
  • hugo

    The world’s fastest framework for building websites.
  • Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
    Promo www.influxdata.com
    InfluxDB Logo
  • croc

    Easily and securely send things from one computer to another :crocodile: :package:
  • restic

    Fast, secure, efficient backup program
  • Gor

    GoReplay is an open-source tool for capturing and replaying live HTTP traffic into a test environment in order to continuously test your system with real data. It can be used to increase confidence in code deployments, configuration changes and infrastructure changes.
  • Seaweed File System

    DISCONTINUED. SeaweedFS is a fast distributed storage system for blobs, objects, files, and data lake, for billions of files! Blob store has O(1) disk seek, cloud tiering. Filer supports Cloud Drive, cross-DC active-active replication, Kubernetes, POSIX FUSE mount, S3 API, S3 Gateway, Hadoop, WebDAV, encryption, Erasure Coding. [Moved to: https://github.com/seaweedfs/seaweedfs]
  • limetext

    Open source API-compatible alternative to the text editor Sublime Text
  • rkt

    DISCONTINUED. An App Container runtime that integrates with init systems, is compatible with other container formats like Docker, and supports alternative execution engines like KVM.
  • toxiproxy

    :alarm_clock: :fire: A TCP proxy to simulate network and system conditions for chaos and resiliency testing
  • confd

    Manage local application configuration files using templates and data from etcd or consul
  • LiteIDE

    LiteIDE is a simple, open source, cross-platform Go IDE.
  • Comcast

    Simulating shitty network connections so you can build better systems.
  • drive

    Google Drive client for the commandline
  • scc

    Sloc, Cloc and Code: scc is a very fast accurate code counter with complexity calculations and COCOMO estimates written in pure Go
  • nes

    NES emulator written in Go.
  • Duplicacy

    A new generation cloud backup tool
  • heka

    DISCONTINUED. DEPRECATED: Data collection and processing made easy.
  • fleet

    DISCONTINUED. A Distributed init System.
  • blocky

    Fast and lightweight DNS proxy as ad-blocker for local network with many features
  • Docker

    Notary is a project that allows anyone to have trust over arbitrary collections of data
  • myLG

    Network Diagnostic Tool
  • Juju

    Orchestration engine that enables the deployment, integration and lifecycle management of applications at any scale, on any infrastructure (Kubernetes or otherwise).
  • Stack Up

    Super simple deployment tool - think of it like 'make' for a network of servers
  • snap

    DISCONTINUED. The open telemetry framework
  • lgo

    Interactive Go programming with Jupyter
  • GoBoy

    Multi-platform Nintendo Game Boy Color emulator written in Go
  • Circuit

    Circuit: Dynamic cloud orchestration http://gocircuit.org
  • Documize

    Modern Confluence alternative designed for internal & external docs, built with Go + EmberJS
  • GoDNS

    A dynamic DNS client tool that supports AliDNS, Cloudflare, Google Domains, DNSPod, HE.net & DuckDNS & DreamHost, etc, written in Go.
  • borg

    Search and save shell snippets without leaving your terminal
  • vFlow

    Enterprise Network Flow Collector (IPFIX, sFlow, Netflow)
  • shell2http

    Executing shell commands via HTTP server
  • peg

    Peg, Parsing Expression Grammar, is an implementation of a Packrat parser generator.
  • portal

    Portal is a quick and easy command-line file transfer utility from any computer to another.
  • Gokapi

    Lightweight selfhosted Firefox Send alternative without public upload. AWS S3 supported.
  • Go Package Store

    An app that displays updates for the Go packages in your GOPATH.
  • Leaps

    A pair programming service using operational transforms
  • Guora

    🖖🏻 A self-hosted Quora like web application written in Go 基于 Golang 类似知乎的私有部署问答应用 包含问答、评论、点赞、管理后台等功能
  • Postman

    CLI tool for batch-sending email via any SMTP server.
  • gfile

    Direct file transfer over WebRTC
  • gocc

    Parser / Scanner Generator
  • mockingjay

    Fake server, Consumer Driven Contracts and help with testing performance from one configuration file with zero system dependencies and no coding whatsoever
  • sake

    :robot: sake is a task runner for local and remote hosts
  • Gebug

    Debug Dockerized Go applications better
  • yai

    Your AI powered terminal assistant.
  • ipe

    DISCONTINUED. An open source Pusher server implementation compatible with Pusher client libraries written in GO
  • woke

    Detect non-inclusive language in your source code.
  • GoNB

    GoNB, a Go Notebook Kernel for Jupyter
  • ide

    A Go code editor. With debugging and Autocomplete. 一个 Go 代码编辑器,具有 DEBUGGING 和 AUTOCOMPLETE
  • Cherry

    A tiny webchat server in Go.

Do you think we are missing an alternative of Plik or a related project?

Add another 'Other Software' Package

README

Mentioned in Awesome Go Build Go Report Docker Pulls GoDoc License

Want to chat with us ? Telegram channel : https://t.me/plik_rootgg

Plik

Plik is a scalable & friendly temporary file upload system (Wetransfer like) in golang.

Main features

  • Powerful command line client
  • Easy to use web UI
  • Multiple data backend : File, OpenStack Swift, S3, Google Cloud Storage
  • Multiple metadata backend : Sqlite3, PostgreSQL, MySQL
  • OneShot : Files are destructed after the first download
  • Stream : Files are streamed from the uploader to the downloader (nothing stored server side)
  • Removable : Give the ability to the uploader to remove files at any time
  • TTL : Custom expiration date
  • Password : Protect upload with login/pasgisword (Auth Basic)
  • Comments : Add custom message (in Markdown format)
  • User authentication : Local / Google / OVH
  • Upload restriction : Source IP / Token
  • Administrator CLI and web UI
  • Server side encryption (with S3 data backend)
  • ShareX Uploader : Directly integrated into ShareX
  • plikSharp : A .NET API client for Plik
  • Filelink for Plik : Thunderbird Addon to upload attachments to Plik

Content Table

  1. Installation
  2. Configuration
  3. Data Backends
  4. Metadata Backends
  5. Client CLI
  6. Go Client
  7. HTTP API
  8. Admin CLI
  9. Authentication
  10. Security
  11. Cross Compilation
  12. FAQ
  13. How To Contribute

Installation

From release

To run plik, it's very simple :

$ wget https://github.com/root-gg/plik/releases/download/1.3.6/plik-1.3.6-linux-amd64.tar.gz
$ tar xzvf plik-1.3.6-linux-amd64.tar.gz
$ cd plik-1.3.6-linux-amd64/server
$ ./plikd

Et voilà ! You now have a fully functional instance of Plik running on http://127.0.0.1:8080.
You can edit server/plikd.cfg to adapt the configuration to your needs (ports, ssl, ttl, backend params,...)

From sources

To compile plik from sources, you'll need golang and npm installed on your system

Git clone or go get the project and simply run make :

$ make
$ cd server && ./plikd
Docker

Plik comes with multiarch docker images built for linux amd64/i386/arm/arm64:

  • rootgg/plik:latest (latest release)
  • rootgg/plik:{version} (release)
  • rootgg/plik:dev (latest commit of master)

See the [Plik Docker reference](documentation/docker.md)

Plik also comes with some useful scripts to test backend in standalone docker instances :

See the [Plik Docker backend testing](testing)

Configuration

The configuration is managed using a TOML file [plikd.cfg](server/plikd.cfg)

Defining configuration parameters using environment variables

One can specify configuration parameters using env variable with the configuration parameter in screaming snake case

    PLIKD_DEBUG_REQUESTS=true ./plikd

For Arrays and config maps they must be provided in json format. Arrays are overridden but maps are merged

    PLIKD_DATA_BACKEND_CONFIG='{"Directory":"/var/files"}' ./plikd

Data backends

Plik is shipped with multiple data backend for uploaded files and metadata backend for the upload metadata.

  • File databackend :

Store uploaded files in a local or mounted file system directory.

Openstack Swift is a highly available, distributed, eventually consistent object/blob store which supports Server Side Encryption

  • Amazon S3

  • Google Cloud Storage

Metadata backends

  • Sqlite3

Suitable for standalone deployment.

  • PostgreSQL / Mysql

Suitable for distributed / High Availability deployment.

Cli client

Plik is shipped with a powerful golang multiplatform cli client (downloadable in web interface) :

Usage:
  plik [options] [FILE] ...

Options:
  -h --help                 Show this help
  -d --debug                Enable debug mode
  -q --quiet                Enable quiet mode
  -o, --oneshot             Enable OneShot ( Each file will be deleted on first download )
  -r, --removable           Enable Removable upload ( Each file can be deleted by anyone at anymoment )
  -S, --stream              Enable Streaming ( It will block until remote user starts downloading )
  -t, --ttl TTL             Time before expiration (Upload will be removed in m|h|d)
  -n, --name NAME           Set file name when piping from STDIN
  --server SERVER           Overrides plik url
  --token TOKEN             Specify an upload token
  --comments COMMENT        Set comments of the upload ( MarkDown compatible )
  -p                        Protect the upload with login and password
  --password PASSWD         Protect the upload with login:password ( if omitted default login is "plik" )
  -a                        Archive upload using default archive params ( see ~/.plikrc )
  --archive MODE            Archive upload using specified archive backend : tar|zip
  --compress MODE           [tar] Compression codec : gzip|bzip2|xz|lzip|lzma|lzop|compress|no
  --archive-options OPTIONS [tar|zip] Additional command line options
  -s                        Encrypt upload usnig default encrypt params ( see ~/.plikrc )
  --not-secure              Do not encrypt upload regardless of ~/.plikrc configurations
  --secure MODE             Archive upload using specified archive backend : openssl|pgp
  --cipher CIPHER           [openssl] Openssl cipher to use ( see openssl help )
  --passphrase PASSPHRASE   [openssl] Passphrase or '-' to be prompted for a passphrase
  --recipient RECIPIENT     [pgp] Set recipient for pgp backend ( example : --recipient Bob )
  --secure-options OPTIONS  [openssl|pgp] Additional command line options
  --update                  Update client
  -v --version              Show client version

For example to create directory tar.gz archive and encrypt it with openssl :

$ plik -a -s mydirectory/
Passphrase : 30ICoKdFeoKaKNdnFf36n0kMH
Upload successfully created : 
    https://127.0.0.1:8080/#/?id=0KfNj6eMb93ilCrl

mydirectory.tar.gz : 15.70 MB 5.92 MB/s

Commands :
curl -s 'https://127.0.0.1:8080/file/0KfNj6eMb93ilCrl/q73tEBEqM04b22GP/mydirectory.tar.gz' | openssl aes-256-cbc -d -pass pass:30ICoKdFeoKaKNdnFf36n0kMH | tar xvf - --gzip

Client configuration and preferences are stored at ~/.plikrc or /etc/plik/plikrc ( overridable with PLIKRC environement variable )

Quick upload using curl only

curl --form 'file=@/path/to/file' http://127.0.0.1:8080

When Authentication is used and NoAnonymousUploads are enabled you can quick upload using user tokens:

curl --form 'file=@/path/to/file' --header 'X-PlikToken: xxxx-xxx-xxxx-xxxxx-xxxxxxxx' http://127.0.0.1:8080

DownloadDomain configuration option must be set for this to properly work.

Go client

Plik now comes with a golang library above which the cli client is built

See the [Plik library reference](plik/README.md)

API

Plik server expose a HTTP API to manage uploads and get files :

See the [Plik API reference](documentation/api.md)

Admin CLI

Using the ./plikd server binary it's possible to :

  • create/list/delete local accounts
  • create/list/delete user CLI tokens
  • create/list/delete files and uploads
  • import / export metadata

See help for more details

Authentication

Plik can authenticate users using Local accounts or using Google or OVH APIs.

If source IP address restriction is enabled, user accounts can only be created from trusted IPs and then authenticated users can upload files without source IP restriction.

It possible to deny unauthenticated uploads totally ( NoAnonymousUploads ).

Admin users can access the admin dashboard and manipulate every uploads.

  • Local :

    • You can manipulate local users with the server command line
      $ ./plikd --config ./plikd.cfg user create --login root --name Admin --admin    
      Generated password for user root is 08ybEyh2KkiMho8dzpdQaJZm78HmvWGC
    
  • Google :

    • You'll need to create a new application in the Google Developper Console
    • You'll be handed a Google API ClientID and a Google API ClientSecret that you'll need to put in the plikd.cfg file.
    • Do not forget to whitelist valid origin and redirect url ( https://yourdomain/auth/google/callback ) for your domain.
    • It is possible to whitelist only one or more email domains.
  • OVH :

    • You'll need to create a new application in the OVH API : https://eu.api.ovh.com/createApp/
    • You'll be handed an OVH application key and an OVH application secret key that you'll need to put in the plikd.cfg file.

Once authenticated a user can generate upload tokens that can be specified in the ~/.plikrc file to authenticate the command line client.

Token = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"

Security

Plik allow users to upload and serve any content as-is, but hosting untrusted HTML raises some well known security concerns.

Plik will try to avoid HTML rendering by overriding Content-Type to "text-plain" instead of "text/html".

By default Plik sets a couple of security HTTP headers like X-Content-Type-Options, X-XSS-Protection, X-Frame-Options, Content-Security-Policy to disable sensible features of most recent browsers like resource loading, xhr requests, iframes,... This will however break features like audio/video playback, pdf rendering so it's possible to disable this behavior by setting the EnhancedWebSecurity configuration parameter to false

Along with that it is also strongly advised to serve uploaded files on a separate (sub-)domain to fight against phishing links and to protect Plik's session cookie with the DownloadDomain configuration parameter.

Cross compilation

All binary are now statically linked. Clients can be safely cross-compiled for all os/architectures as they do not rely on GCO (sqlite) Servers rely on CGO/sqlite need a cross-compilation ready environment.

make release will build release archives for amd64,i386,arm,arm64

To build a release with only specific architectures of the client

    CLIENT_TARGETS="linux/amd64" releaser/release.sh

To build only specific for only specific architectures

    TARGETS="linux/amd64" releaser/release.sh

To build with a specific cross compiler toolchain

    TARGETS="linux/arm/v6" CC=arm-linux-gnueabihf-gcc releaser/release.sh

FAQ

  • Why is stream mode broken in multiple instance deployement ?

Beacause stream mode isn't stateless. As the uploader request will block on one plik instance the downloader request MUST go to the same instance to succeed. The load balancing strategy MUST be aware of this and route stream requests to the same instance by hashing the file id.

Here is an example of how to achieve this using nginx and a little piece of LUA. Make sure your nginx server is built with LUA scripting support. You might want to install the "nginx-extras" Debian package (>1.7.2) with built-in LUA support.

upstream plik {
    server 127.0.0.1:8080;
    server 127.0.0.1:8081;
}

upstream stream {
    server 127.0.0.1:8080;
    server 127.0.0.1:8081;
    hash $hash_key;
}

server {
    listen 9000;

    location / {
        set $upstream "";
        set $hash_key "";
        access_by_lua '
            _,_,file_id = string.find(ngx.var.request_uri, "^/stream/[a-zA-Z0-9]+/([a-zA-Z0-9]+)/.*$")
            if file_id == nil then
                ngx.var.upstream = "plik"
            else
                ngx.var.upstream = "stream"
                ngx.var.hash_key = file_id
            end
        ';
        proxy_pass http://$upstream;
    }
}
  • Redirection loops with DownloadDomain enforcement and reverse proxy
Invalid download domain 127.0.0.1:8080, expected plik.root.gg

DownloadDomain check the Host header of the incoming HTTP request, by default reverse proxies like Nginx or Apache mod_proxy does not forward this Header. Check the following configuration directive :

Apache mod_proxy : ProxyPreserveHost On
Nginx : proxy_set_header Host $host;
  • I have an error when uploading from client : "Unable to upload file : HTTP error 411 Length Required"

Under nginx < 1.3.9, you must enable HttpChunkin module to allow transfer-encoding "chunked".
You might want to install the "nginx-extras" Debian package with built-in HttpChunkin module.

And add in your server configuration :

chunkin on;
error_page 411 = @my_411_error;
location @my_411_error {
        chunkin_resume;
}
  • How to disable nginx buffering ?

By default nginx buffers large HTTP requests and reponses to a temporary file. This behaviour leads to unnecessary disk load and slower transfers. This should be turned off (>1.7.12) for /file and /stream paths. You might also want to increase buffers size.

Detailed documentation : http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_buffering

proxy_buffering off;
proxy_request_buffering off;
proxy_http_version 1.1;
proxy_buffer_size 1M;
proxy_buffers 8 1M;
client_body_buffer_size 1M;
  • Why authentication does not work with HTTP connections when EnhancedWebSecurity is set ?

Plik session cookies have the "secure" flag set when EnhancedWebSecurity is set so they can only be transmitted over secure HTTPS connections.

  • Build failure "/usr/bin/env: ‘node’: No such file or directory"

Debian users might need to install the nodejs-legacy package.

This package contains a symlink for legacy Node.js code requiring
binary to be /usr/bin/node (not /usr/bin/nodejs as provided in Debian).
  • How to take and upload screenshots like a boss ?
alias pshot="scrot -s -e 'plik -q \$f | xclip ; xclip -o ; rm \$f'"

Requires you to have plik, scrot and xclip installed in your $PATH.
scrot -s allow you to "Interactively select a window or rectangle with the mouse" then Plik will upload the screenshot and the url will be directly copied to your clipboard and displayed by xclip. The screenshot is then removed of your home directory to avoid garbage.

How to contribute to the project ?

Contributions are welcome, feel free to open issues and/or submit pull requests. Please be sure to also run/update the test suite :

    make fmt
    make lint
    make test
    make test-backends


*Note that all licence references and agreements mentioned in the Plik README section above are relevant to that project's source code only.