Quick Start
In this section, we will describe how to install, config and start Bigfile
.
Requirements
The only thing Bigfile needs is Mysql, you should start mysql before starting Bigfile. You can follow the official guide to install it,
Install
There are many ways to install Bigfile
, just as follows.
from Binary
You can download the latest version from the release page.
from HomeBrew
If you work on MacOS, you can install Bigfile
by brew.
brew install bigfile/tap/bigfile
from Snapcraft
Snaps are containerised software packages that are simple to create and install. They auto-update and are safe to run. More detailed information can be found in Official Documentation.
sudo snap install --classic bigfile
from deb/rpm
You can download the .dep
or rpm
file and install it by command dpkg -i
or rpm -i
.
from scoop
If you work on Windows platform, there is an alternative solution for installing Bigfile
by scoop
scoop bucket add bigfile https://github.com/bigfile/bigfile-bucket.git
scoop install bigfile
from Source Code
Start Bigfile
by go run
command
go get -u -v github.com/bigfile/bigfile/artisan
go run artisan/bigfile.go --version
Install Bigfile
by go install
command. This will generate a executable binary file that’s named as artisan
in ${GOPATH}/bin
.
go install -a -v github.com/bigfile/bigfile/artisan
Build Bigfile
by go build
command
go build artisan/bigfile.go
Configuration
Bigfile has a set of default configuration, Here it is:
database:
driver: mysql
host: localhost
user: root
password: root
port: 3306
dbName: bigfile
log:
console:
enable: true
level: info
format: '%{color:bold}[%{time:2006/01/02 15:04:05.000}] %{pid} %{level:.5s} %{color:reset} %{message}'
file:
enable: true
path: storage/logs/bigfile.log
level: warn
format: '[%{time:2006/01/02 15:04:05.000}] %{pid} %{longfile} %{longfunc} %{callpath} ▶ %{level:.4s} %{message}'
maxBytesPerFile: 52428800
http:
apiPrefix: /api/bigfile
accessLogFile: storage/logs/bigfile.http.access.log
limitRateByIPEnable: false
limitRateByIPInterval: 1000
limitRateByIPMaxNum: 100
corsEnable: false
corsAllowOrigins:
- '*'
corsAllowMethods:
- PUT
- PATCH
- DELETE
corsAllowHeaders:
- Origin
corsExposeHeaders:
- 'Content-Length'
corsAllowCredentials: true
corsAllowAllOrigins: false
corsMaxAge: 3600
chunk:
rootPath: storage/chunks
Bigfiel will find configuration file in current directory
, user home
and /etc/bigfile
. You need to place a file named .bigfile.yml
in one of the directories.
If you just want to set database information, you can config it by command line.
like this:
bigfile --db-host 192.168.0.104 --db-name bigfile_tesg ftp:start --tls-enable --cert-file server.pem --key-file server.key
Run
After installation and configuration, it’s time to run Bigfile
. Bigfile
has three services: HTTP Server
, RPC Server
and FTP Server
, you need to start them separately.
Before running Bigfile
, we recommend to generate a series of certificates to use tls/ssl. We provide a simple command for this:
bigfile rpc:make-cert
After this command, six certificate files will be generated in the corresponding directory on the host. The certificate authority is prefixed with ca
. Only the certificate authority has the qualification to issue the certificate. The certificate generated by us is a self-signed certificate. The self-signed certificate is generally not trusted by the system, but you can add it to the system for trust. The server certificate is prefixed with server
, and the server certificate can be added with a trusted IP, specified by the parameter --server-cert-ips
. Client-prefixed for the client, this is mainly used in the RPC service to achieve double-ended authentication. The .pem
suffix indicates the PEM-encoded certificate file, and the .key
suffix indicates the certificate key.
Start HTTP Server
bigfile http:start --cert-file server.pem --cert-key server.key
Start RPC Server
bigfile rpc:start --ca-cert ca.pem --server-cert server.pem --server-key server.key
Start FTP Server
bigfile ftp:start --tls-enable --cert-file server.pem --key-file server.key
Docker
If you are a Docker enthusiast, we have built an official image, you can find a more detailed manual https://hub.docker.com/r/bigfile/bigfile.