fmajor is a self-hosted file upload service. It is basic, but easy
to install.
-
Upload, download and delete files all from the web interface. Only users with a password can upload and delete file but everyone can download all uploaded files assuming they have the link.
-
fmajoris compiled to one static binary, which includes all resources. This makes deployment easy, no need for containers or virtual machines. -
Doesn't require a database. All data is stored on the file system.
fmajordoes not include transport encryption (i.e. HTTPS). Please use a proxy likenginxwith TLS enabled to ensure that nobody listens to your login password.
You will need go version 1.18 or later. With go on your PATH, you should
only have to run
$ go install github.com/kissen/fmajor@latest
Above command installs the fmajor binary to $GOPATH/bin. If you do not have
$GOPATH set, $GOPATH defaults to $HOME/go on Linux and macOS.
The following instructions were tested on Debian 10 and assume that
you know how to proxy and secure HTTP services with something like
nginx.
-
Build
fmajorlike explained in the previous section. You can do this on your workstation. -
Move the
fmajorbinary to a reasonable place on your server. This tutorial assumes that place to be/usr/bin/fmajor. All following commands need to be run on your server asroot. -
Create a dedicated user for running
fmajor.# adduser --home /var/lib/fmajor --shell /sbin/nologin --disabled-password fmajorThis creates a user named
fmajorwith home directory/var/lib/fmajorwhich is where we will letfmajorput all its uploads. -
Copy the default configuration file to
/etc.# wget https://raw.githubusercontent.com/kissen/fmajor/master/doc/fmajor.conf # mv fmajor.conf /etc/fmajor.confYou should now have a configuration file
/etc/fmajor.conf. -
You need to set up at least one password. Without a password, you will not be able to log in and therefore upload files.
The easiest way is to use the
htpasswdtool to generate the hash. On Debian, you can gethtpasswdwith theapache2-utilspackage. With it installed, run$ htpasswd -n -B -C 12 "" | tr -d ':\n'and you will be prompted for the password. The hash is printed to
stdout.Open
/etc/fmajor.confwith a text editor and edit sectionPassHashesaccordingly. It should look something likePassHashes = [ "$2y$12$uTLL4JVVyJg9aunt.hyraej3m0yW6siY2cAQ1MakmUxtxgR4EoPbK" ] -
Install the
systemdservice file.# wget https://raw.githubusercontent.com/kissen/fmajor/master/doc/fmajor.service # mv fmajor.service /lib/systemd/system/fmajor.service # systemctl daemon-reload -
You can now start the
fmajorservice with# systemctl start fmajorwhich will make
systemdtake care of keeping your logs. Access the logs using# journalctl -u fmajor.serviceIf you want
fmajorto start during boot, enable the service withsystemctllike so# systemctl enable fmajor -
fmajorlistens to theListenAddressdefined in configuration file/etc/fmajor.conf. Per default, this islocalhostwhich of course isn't very useful. To makefmajoraccessible on the open internet, configure your reverse proxy (e.g.nginx) to forward requests toListenAddress.You should configure your reverse proxy to use HTTPS, otherwise third parties will be able to spy on your interactions with
fmajor. Let's Encrypt with Certbot is the canonical choice.
(c) 2020 - 2022 Andreas Schärtl
This program (fmajor) is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option) any
later version. For a copy of this license, see LICENSE.
Excluded from above copyright notice are included icons derived from the Feather icon set licensed under the following terms.
The MIT License (MIT)
Copyright (c) 2013-2017 Cole Bemis
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
The affected files are
/static/svg/trash-2.svg /static/svg/paperclip.svg /static/svg/upload-cloud.svg
/static/svg/log-out.svg
This repository includes fonts from the golang/image repository.
-
/static/fonts/Go-Regular.woffis based on font Go Regular. -
/static/fonts/Go-Mono.woffis based on font Go Mono.
Both fonts are distributed under the following terms and conditions.
These fonts were created by the Bigelow & Holmes foundry specifically for the
Go project. See https://blog.golang.org/go-fonts for details.
They are licensed under the same open source license as the rest of the Go
project's software:
Copyright (c) 2016 Bigelow & Holmes Inc.. All rights reserved.
Distribution of this font is governed by the following license. If you do not
agree to this license, including the disclaimer, do not distribute or modify
this font.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of Google Inc. nor the names of its contributors may be
used to endorse or promote products derived from this software without
specific prior written permission.
DISCLAIMER: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
