项目作者: gmemstr

项目描述 :
Merge filesystems together.
高级语言: Go
项目地址: git://github.com/gmemstr/sliproad.git
创建时间: 2019-02-24T08:23:09Z
项目社区:https://github.com/gmemstr/sliproad

开源协议:GNU General Public License v3.0

下载


Sliproad

Merging filesystems together

About

This project aims to be an easy-to-use web API and frontend that allows the
management of cloud storage alongside local filesystems. While this is intended
mostly for my own use, I am documenting it in a way that I hope allows others
to use it!

Configuration

Sliproad uses “Providers” to support various filesystems “types”, whether it be
remote or local. Currently, three exist - disk for filesystems local to the
machine, backblaze to leverage Backblaze B2 file storage and s3 for AWS S3
(and other compatible providers).

An example of leveraging all three, in various forms, can be found below. As
more are added, this example will be updated, and more examples can be found in
the assets/config_examples directory.

  1. disk:
  2. provider: disk
  3. path: /tmp/nas
  4. backblaze:
  5. provider: backblaze
  6. config:
  7. bucket: some-bucket
  8. applicationKeyId: application-key-id
  9. applicationKey: application-key
  10. s3:
  11. provider: s3
  12. config:
  13. region: eu-west-2
  14. bucket: some-bucket
  15. # An example of an S3 compatible API, doesn't have to be Backblaze.
  16. backblazes3:
  17. provider: s3
  18. config:
  19. bucket: some-bucket
  20. region: us-west-000
  21. endpoint: s3.us-west-000.backblazeb2.com
  22. keyid: key-id
  23. keysecret: key-secret

Running

After configuring the providers you would like to utilize, simply run
./sliproad. This will spin up the webserver at 127.0.0.1:3000, listening on
all addresses.

Frontend

The frontend is a very lightweight JavaScript application and aims to be very
functional, if a bit rough around the edges.

Screenshot_2021-05-29 Sliproad

It should scale reasonably well for smaller devices. Because it’s now bundled
into the binary (as opposed to distributed alongside), it’s no longer possible
to swap it out for a custom frontend without serving the frontend seperately.

API

This project is largely API-first, and documentation can be found here:

https://github.com/gmemstr/sliproad/wiki/API

Building

This project leverages a Makefile to macro common commands for running, testing
and building this project.

  • make will build the project for your system’s architecture.
  • make run will run the project with go run
  • make pi will build the project with the GOOS=linux GOARCH=arm GOARM=5 go flags set for Raspberry Pi.
  • make dist will build and package the binaries for distribution.

Adding Providers

New file providers can be implemented by building off the
FileProviderInterface struct, as the existing providers demonstrate. You can
then instruct the TranslateProvider() function
that it exists and how to configure it.

Authentication [!]

Authentication is a bit tricky and due to be reworked in the next iteration of
this project. Currently, support for Keycloak is
implemented, if a bit naively. You can turn this authentication requirement on
by adding auth.yml alongside your providers.yml file with the following:

  1. provider_url: "https://url-of-keycloak"
  2. realm: "keycloak-realm"
  3. redirect_base_url: "https://location-of-sliproad"

Keycloak support is not currently actively supported, and is due to be removed
in the next major release of Sliproad. That said, if you encounter any major
bugs utilizing it before this, please open an issue so I can dig in further.

Credits

SVG Icons provided by Paweł Kuna: https://github.com/tabler/tabler-icons (see assets/web/icons/README.md)