Expand "federated" to a Federation type with controls

This commit is contained in:
Marquis Kurt 2019-05-08 09:08:20 -04:00
parent 2c279bce60
commit 4987040a39
4 changed files with 13 additions and 52 deletions

View File

@ -1,49 +0,0 @@
# Configuring Hyperspace
Hyperspace 1.0 comes with a new configuration file app providers can use to create a custom experience relatively easy. This is inspired from the way the [Riot](https://github.com/vector-im/riot-web) project handles configurations for their app. The following fields should be in the `config.json` folder at the root of the Hyperspace installation.
> Note: `config.json` can only control and modify so much with the app. If you want further customizations like custom themes, new panels, etc., it is recommended that you fork Hyperspace and work with it that way.
- `version`: The app's version using semantic versioning. This can be used to differentiate between versions of the main Hyperspace app or the custom deployment.
- `branding`: The custom branding for Hyperspace.
- `name`: The name for the brand/app. Affects title bar, about screens, and main interface by replacing the "Hyperspace" text.
- `logo`: The filepath of the brand's logo, relative to the deployment folder. Can be a relative path (`brand/logo.png`) or a URL (`https://www.test.com/brands/logo-hs.png`).
- `background`: The background used on the login page. Can be a relative path (`brand/bg.png`) or a URL (`https://www.test.com/brands/bg-hs.png`)
- `developer`: Whether the version is a developer version or should be put in developer mode. Used to signify unstable releases with new features to play around with.
- `federated`: Whether Hyperspace should enable federating features in its interface for Mastodon. Disabling federation disables the public timeline.
- `registration`: Information regarding registration of accounts.
- `defaultInstance`: The host name of the instance to default to when making accounts. Affects "well-known" sign-in and 'Create account' buttons
- `admin`: Information about the app provider/administrator:
- `name`: The name of the app provider
- `account`: The Account ID of the app provider on Mastodon, in-instance or not
- `license`: Licensing information about the app. Will default to Apache 2.0 if not listed (the standard license for Hyperspace source code).
- `name`: The name of the license.
- `url`: The link to the license for reviewing.
- `repository`: The URL to the source code, if possible.
## Example Config File
```json
{
"version": "1.0.0beta1",
"branding": {
"name": "Hyperspace",
"logo": "logo.svg",
"background": "background.png"
},
"developer": "true",
"federated": "true",
"registration": {
"defaultInstance": "mastodon.social"
},
"admin": {
"name": "Eugen",
"account": "1"
},
"license": {
"name": "Apache 2.0 License",
"url": "https://www.apache.org/licenses/LICENSE-2.0"
},
"repository": "https://github.com/hyperspacedev/hyperspace"
}
```

View File

@ -15,7 +15,7 @@ The 1.0 redesign of Hyperspace acts differently from the current classic version
- **Pages over panels**. Hyperspace 1.0 uses `react-router-dom` to link components of the app via URLs instead of individual components. This means that one could visit the corresponding URL instead of needing to open a set of panels or buttons to do so.
- **Material design**. Hyperspace 1.0 uses Material Design to create a UI that scales across device types. The library used for the UI, `material-ui`, natively supports a dark mode and themes, making Hyperspace 1.0 more customizable in nature.
- **Less intrusive by nature.** Hyperspace 1.0 pushes notifications when the window isn't in focus versus all the time, and the snackbar (toast) notifications are displayed more often when something is happening or when an error occurs. Timelines also no longer keep pushing posts during streaming, letting anyone read the timeline and still be able to get updates with a non-intrusive `View (x) new posts` chip at the top.
- **Configurable at every level.** Hyperspace 1.0 allows anyone to customize their theme and settings to however they like, and admins can customize Hyperspace further with branding, federation support, registration URLs, and more (done via `config.json`). [Learn more ›](CONFIG.md)
- **Configurable at every level.** Hyperspace 1.0 allows anyone to customize their theme and settings to however they like, and admins can customize Hyperspace further with branding, federation support, registration URLs, and more (done via `config.json`). [Learn more ›](https://hyperspace.marquiskurt.net/docs/configure-hyperspace)
This is a growing list and new things will be added over time.

View File

@ -7,7 +7,11 @@
"background": "background.png"
},
"developer": "true",
"federated": "true",
"federation": {
"universalLogin": "true",
"allowPublicPosts": "true",
"enablePublicTimeline": "true"
},
"registration": {
"defaultInstance": "mastodon.social"
},

View File

@ -7,7 +7,7 @@ export type Config = {
background?: string;
};
developer?: string;
federated?: string;
federation: Federation;
registration?: {
defaultInstance?: string;
};
@ -22,4 +22,10 @@ export type Config = {
export type License = {
name: string;
url: string;
}
export type Federation = {
universalLogin: boolean;
allowPublicPosts: boolean;
enablePublicTimeline: boolean;
}