2020-11-13 13:43:27 +01:00
|
|
|
import React, { useContext } from "react";
|
2020-10-29 18:22:31 +01:00
|
|
|
import KeyValueTable from "./components/key-value-table";
|
2020-11-13 13:43:27 +01:00
|
|
|
import { ServerStatusContext } from '../utils/server-status-context';
|
2020-11-16 23:09:57 +01:00
|
|
|
import { Typography } from 'antd';
|
|
|
|
import Link from 'next/link';
|
|
|
|
|
|
|
|
const { Title } = Typography;
|
2020-10-29 18:16:13 +01:00
|
|
|
|
|
|
|
function Storage({ config }) {
|
2020-11-01 08:01:37 +01:00
|
|
|
if (!config || !config.s3) {
|
2020-10-29 18:16:13 +01:00
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2020-10-29 18:22:31 +01:00
|
|
|
if (!config.s3.enabled) {
|
|
|
|
return (
|
2020-11-16 23:09:57 +01:00
|
|
|
<div>
|
|
|
|
<Title>External Storage</Title>
|
|
|
|
<p>
|
|
|
|
You are currently using the <Link href="/hardware-info">local storage of this Owncast server</Link> to store and distribute video.
|
|
|
|
</p>
|
|
|
|
<p>
|
|
|
|
Owncast can use S3-compatible external storage providers to offload the responsibility of disk and bandwidth utilization from your own server.
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<p>
|
|
|
|
Visit our <a href="https://owncast.online/docs/s3/">storage documentation</a> to learn how to configure this.
|
|
|
|
</p>
|
|
|
|
</div>
|
2020-10-29 18:22:31 +01:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2020-10-29 18:16:13 +01:00
|
|
|
const data = [
|
|
|
|
{
|
|
|
|
name: "Enabled",
|
|
|
|
value: config.s3.enabled.toString(),
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "Endpoint",
|
|
|
|
value: config.s3.endpoint,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "Access Key",
|
|
|
|
value: config.s3.accessKey,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "Secret",
|
|
|
|
value: config.s3.secret,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "Bucket",
|
|
|
|
value: config.s3.bucket,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "Region",
|
|
|
|
value: config.s3.region,
|
|
|
|
},
|
|
|
|
];
|
2021-01-27 06:13:07 +01:00
|
|
|
|
|
|
|
const advanced = [
|
|
|
|
{
|
|
|
|
name: "ACL",
|
|
|
|
value: config.s3.acl
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "Serving Endpoint",
|
|
|
|
value: config.s3.servingEndpoint
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
return (
|
|
|
|
<>
|
|
|
|
<KeyValueTable title="External Storage" data={data} />
|
|
|
|
<KeyValueTable title="Advanced options" data={advanced} />
|
|
|
|
</>
|
|
|
|
);
|
2020-10-29 18:16:13 +01:00
|
|
|
}
|
|
|
|
|
2020-10-29 18:22:31 +01:00
|
|
|
export default function ServerConfig() {
|
2020-11-13 13:43:27 +01:00
|
|
|
const serverStatusData = useContext(ServerStatusContext);
|
|
|
|
const { serverConfig: config } = serverStatusData || {};
|
2020-10-29 18:16:13 +01:00
|
|
|
|
|
|
|
return (
|
|
|
|
<div>
|
|
|
|
<Storage config={config} />
|
|
|
|
</div>
|
2020-10-29 18:22:31 +01:00
|
|
|
);
|
2020-10-29 18:16:13 +01:00
|
|
|
}
|