Home

Awesome

Andesite

loc license discord paypal circleci release goreportcard codefactor downloads issuehunt docker_pulls docker_stars

Share folders in an Open Directory without making your entire server public. Manages users with OAuth2.

Getting Started

These instructions will help you get the project up and running. To obtain the binary you will use to run the app, follow the Development or Deployment sections for futher direction. Below, are general directions for all builds.

Options

Use these to configure your Andesite instance. All are optional. "Name" refers to the name of the CLI flag that may be used. "Config Name" refers to the key name inside of your config.json. More on that later.

NameConfig NameTypeDefaultDescription
--root"root"stringnone.Path of root directory for /files/.
--public"public"stringnone.Path of root directory for /public/.
--port"port"int8000Port for web server to bind to.
--base"base"string/HTTP path of app root.
--confign/a.string~/.config/andesite/config.jsonThe path to the config.json file used for app configuration.
--enable-search"search_on"string[]none.Names of roots to scan and add to the file database.
--disable-search"search_off"string[]none.Names of roots to remove from the file database.
"roots_public"string[][]none.Enabled roots that don't lie on /public/ by adding entries [url_path,fs_path].
"roots_private"string[][]none.Enabled roots that don't lie on /filess/ by adding entries [url_path,fs_path].
--verbose"verbose"booleanfalseSet to true to enable verbose logging.
--fsdb-verbose"verbose_fsdb"booleanfalseSet to true to enable verbose fsdb logging.
--disable-hashstring[]none.Any of md5, sha1, sha256, sha512, sha3, blake2b.
--hash-concurrencyintcpu countNumber of hashes to run concurrently.
--custom-root-publicstring[]noneSimilar to "roots_public", passed in the form name=path.
--custom-root-privatestring[]noneSimilar to "roots_private", passed in the form name=path.
--disable-global-searchboolfalseWhen true, /search requires being an admin to use.

Note: for --enable-search and --disable-search, sending values to these flags will trigger a background scan of the root directory you point it at (whether that be public, files, etc). As such, unless content is changed or updated, it is not necessary to pass these flags across multiple runs of the app.

Creating Credentials

In order to create a "closed directory" with Andesite, you will need to create an app on your Identity Provider(s) of choice. See the nektro/go.oauth2 docs for more detailed info on this process on where to go and what data you'll need.

Here you can also fill out a picture and description that will be displayed during the authorization of users on your chosen Identity Provider. When prompted for the "Redirect URI" during the app setup process, the URL to use will be http://andesite/callback, replacing andesite with any origins you wish Andesite to be usable from, such as example.com or localhost:800.

Once you have finished the app creation process you should now have a Client ID and Client Secret. These are passed into Andesite through flags as well.

The Identity Provider IDs used below can be found in the table in the nektro/go.oauth2 documentation under the "Short Code" column.

NameTypeDefaultDescription
--oauth2-clientstring[]none.`idp_id

Deployment

Pre-compiled binaries can be obtained from https://github.com/nektro/andesite/releases/latest.

Or from Docker docker run nektro/andesite

Development

Prerequisites

Installing

Run

$ go get -v -u github.com/nektro/andesite

and then make your way to $GOPATH/src/github.com/nektro/andesite/.

Once there, run:

$ go build
$ ./andesite

Extras

Discord Guild/Role Access Grant

Due to a limitation in the Discord API, in order to determine if a user has a role on a specific server, you must use a bot. To get started, go to https://discordapp.com/developers/applications/ and add a Bot user to your app and copy down the Bot Token. Now, to be able to give file/folder access to entire roles, we are going to be using more flags:

NameConfig NameTypeDefaultDescription
--discord-guild-id"clients[for.discord].extra_1"stringnone.Guild Snowflake.
--discord-bot-token"clients[for.discord].extra_2"stringnone.Bot Token.

Enabling these values will add a section to http://andesite/admin that you can input the role snowflakes and the path you are granting.

Themes

Andesite supports making custom themes for the splash page and the various HTML templates throughout the program. Those are:

All or none of the files may be replaced when using a theme. To enable use of a theme, suppose the value passed to --theme was example. Doing this will tell Andesite to serve files from .andesite/themes/example/.

Built With

Contributing

issues

We listen to issues all the time right here on GitHub. Labels are extensively to show the progress through the fixing process. Question issues are okay but make sure to close the issue when it has been answered! Off-topic and '+1' comments will be deleted. Please use post/comment reactions for this purpose.

Contact

License

Apache 2.0