Skip to content
💾 Easily manage access to your open directory through OAuth2
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
docs
www
.gitignore
LICENSE
README.md
fswatch.go
handlers.go
main.go
sqlite_util.go
type_httpfileinfo.go
type_oauth2handler.go
type_rootdir.go
types.go

README.md

Andesite

loc license discord

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

buymeacoffee

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

Installing

Go to the developers dashboard of your choosing for the authentication platform you wish to use from the list below.

Identity Provider Short Code Developer Dashboard
Discord discord https://discordapp.com/developers/applications/
Reddit reddit https://www.reddit.com/prefs/apps
GitHub github https://github.com/settings/developers
Google google https://console.developers.google.com
Facebook facebook https://developers.facebook.com/apps/
Microsoft microsoft https://apps.dev.microsoft.com/

Once there, create an application and obtain the Client ID and Client Secret. 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 and obtained the Client ID and Client Secret, create a folder in your home directory at the path of ~/.config/andesite/. All of Andesite's config and local save files will go here. This directory will be referred to at .andesite going forward.

In the .andesite folder make a config.json file and put the following data inside, replacing AUTH with whichever Identity Provider you chose, such as discord, reddit, etc. And CLIENT_ID and CLIENT_SECRET with their respective values. Do not worry, this folder will remain entirely private, even to users with full access.

{
    "auth": "{AUTH}",
    "{AUTH}": {
        "id": "{CLIENT_ID}",
        "secret": "{CLIENT_SECRET}"
    }
}

Note: You may currently only use one Identity Provider at a time!

Run

$ go get -u github.com/gobuffalo/packr/v2/packr2
$ go get -u github.com/nektro/andesite

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

Once there, run:

$ packr2 build
$ ./andesite

packr2 build, and by proxy go build is used here instead of go run main.go because go run creates a new binary every time which, since this program is a server, will request a firewall exception on every run. Using go build overwrites the same binary ./andesite over and over again as changes are made.

packr2 build is used here over go build so that packr2 can generate the resources necessary to embed the static resources into the resulting binary. This will allow the Andesite program to be run from anywhere.

Options

There are a number of options that are also required and can be used to configure your Andesite instance from within your config.json. They are listed here.

Name Type Default Description
"root" string Required. A relative or absolute path to where the data root Andesite should serve from is.
"port" uint 8000 The port to bind to. A webserver will be launched accessible from localhost:{port}.
"theme" []string A array of names to load themes from. Read more about themes below.
"base" string / The root path Andesite will be served from. See deployment.md for more info.
"providers" []Provider An array of custom OAuth2 providers that you may use as your "auth".
"custom" []OA2Config An array of OA2 app configs, that can be used with providers created in "providers". See providers.md for more info.

Themes

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

  • index.html - Default Source
    • The main page shown to all users at the root of the server.
  • response.hbs - Default Source
    • A generic page used to show errors and message to the user.
  • listing.hbs - Default Source
    • The main directory listing page.
  • admin.hbs - Default Source
    • The admin dashboard that allows editing the access of users

Using A Theme

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/.

Deployment

See deployment.md

Built With

Contributing

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

issues

When making a pull request, please have it be associated with an issue and make a comment on the issue saying that you're working on it so everyone else knows what's going on :D

pulls

Donate

buymeacoffee

Contact

License

Apache 2.0

You can’t perform that action at this time.