Merge filesystems together.
Find a file
Gabriel Simmer 9cd7ab75e8
Better error messages for Backblaze, int64.
Ran into an issue when running on a Raspberry Pi - occaisonally, the
int size for the files being provided from Backblaze (which is in
bytes) will be too large. This is fixed by upgrading the int to int64.
As a part of this debugging process, I upgraded the error handling when
fetching the Backblaze file listing to actually print the errors rather
than failing silently.
2020-03-23 10:53:58 +00:00
assets/web Responsive media queries for grid. 2020-03-22 21:26:00 +00:00
auth Directory listing in new frontend 2019-07-27 21:43:05 -07:00
common Initial commit of basic functional file listing 2019-02-24 00:25:39 -08:00
files Better error messages for Backblaze, int64. 2020-03-23 10:53:58 +00:00
router Implement new frontend, "/" at end of provider. 2020-03-22 00:18:19 +00:00
.gitignore Implement new frontend, "/" at end of provider. 2020-03-22 00:18:19 +00:00
go.mod Refactoring file storage to enable different providers 2020-02-24 18:07:47 +00:00
go.sum Refactoring file storage to enable different providers 2020-02-24 18:07:47 +00:00
LICENSE Initial commit 2019-02-24 00:23:09 -08:00
Makefile Rewrite file provider to proxy data download (rather than redirect) 2020-03-15 23:49:00 +00:00
README.md Subdirectory handling in frontend, README 2020-03-22 21:15:31 +00:00
webserver.go Implement Setup() function for providers, cleanup 2020-03-21 00:31:24 +00:00

nas

small go nas platform for my raspberry pi

usage

configuration

unlike the initial version of this project, the current build uses providers to determine how to handle various functions related to files. currently, two are implemented, disk and backblaze, since they are the primary providers i use myself. the providers you would like to use can be added to providers.yml alongside the binary.

for example, here is a sample configuration implementing both of them:

disk:
  provider: disk
  path: /tmp/nas
backblaze:
  provider: backblaze
  config:
    appKeyId: APP_KEY_ID
    appId: APP_ID
    bucket: BUCKET_ID

(read more here: #providers)

running

after adding the providers you would like to use, the application can be run simply with ./nas.

building

this project uses go modules and a makefile, so building should be relatively straightforward.

  • make will build the project for your system's architecture.
  • make pi will build the project with the GOOS=linux GOARCH=arm GOARM=5 go flags set for raspberry pis.

providers

there are a few built-in providers, and more can be added by opening a pull request.

name service configuration example
disk local filesystem disk.yml
backblaze backblaze b2 backblaze.yml

custom provider

custom file providers can be implemented by adding a new go file to the files module. it should implement the FileProviderInterface interface.