diff --git a/Dockerfile b/Dockerfile index 56d4051..43d9e68 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,5 +12,3 @@ COPY . /opt RUN npm run build RUN npx next telemetry disable - -CMD ["npm","start"] diff --git a/README.md b/README.md index bb085f3..1c7dd8d 100644 --- a/README.md +++ b/README.md @@ -23,14 +23,8 @@ Provides a control panel interface to conveniently manage clusters (groups of id - Maintenance mode, disables proxying for selected domains and serves an "under maintenance" page from haproxy. - Statistics page with server and backend-level breakdowns based on haproxy stats socket data. Ability to export statistics to influxdb. -##### Todo: -- Better Multi-user support - - allow domain/cluster editing (with user dupe check) for non-admins - - problems w/ ip whitelist and blacklist -- Some kind of payment system -- More advanced rules and ability to allow/block/bot mode based on those rules. -- Show statistics from clusters or servers within a cluster. - - Intelligent auto toggling of proteciton modes based on these stats +## License +GNU AGPLv3, see [LICENSE](LICENSE). #### Screenshots diff --git a/components/BackButton.js b/components/BackButton.js index 435b528..15ee3be 100644 --- a/components/BackButton.js +++ b/components/BackButton.js @@ -3,7 +3,7 @@ import Link from 'next/link'; export default function BackButton({ to }) { return ( - + Back diff --git a/components/MenuLinks.js b/components/MenuLinks.js index 5f25e22..d2931cf 100644 --- a/components/MenuLinks.js +++ b/components/MenuLinks.js @@ -31,15 +31,23 @@ export default withRouter(function MenuLinks({ router }) {
diff --git a/pages/dns/[domain]/[zone]/[name].js b/pages/dns/[domain]/[zone]/[name].js
new file mode 100644
index 0000000..da20ccf
--- /dev/null
+++ b/pages/dns/[domain]/[zone]/[name].js
@@ -0,0 +1,7 @@
+export default function EditRecordPage({ domain, name, recordSet }) {
+ return 'todo';
+}
+
+export async function getServerSideProps({ req, res, query, resolvedUrl, locale, locales, defaultLocale}) {
+ return { props: { user: res.locals.user || null, ...query } }
+}
diff --git a/pages/dns/[domain]/index.js b/pages/dns/[domain]/index.js
new file mode 100644
index 0000000..6888ba1
--- /dev/null
+++ b/pages/dns/[domain]/index.js
@@ -0,0 +1,149 @@
+import { useRouter } from "next/router";
+import React, { useState, useEffect } from 'react';
+import Head from 'next/head';
+import RecordSetRow from '../../../components/RecordSetRow.js';
+import BackButton from '../../../components/BackButton.js';
+import ErrorAlert from '../../../components/ErrorAlert.js';
+import * as API from '../../../api.js';
+
+const DnsDomainIndexPage = (props) => {
+
+ const router = useRouter();
+ const { domain } = router.query;
+ const [state, dispatch] = useState({
+ ...props,
+ recordSets: [
+ {
+ "@": {
+ "a": [
+ { "id": "a", "ttl": 300, "ip": "203.28.238.247", "geok": "cn", "geov": ["OC"], "h": true, "fb": ["b", "c"], "sel": 1, "bsel": 3 },
+ { "id": "b", "ttl": 300, "ip": "38.60.199.224", "geok": "cn", "geov": ["AS"], "h": false, "fb": ["a", "c"], "sel": 1, "bsel": 3 },
+ { "id": "c", "ttl": 300, "ip": "45.88.201.168", "geok": "cn", "geov": ["NA"], "h": true, "fb": ["e", "d"], "sel": 1, "bsel": 3 },
+ { "id": "d", "ttl": 300, "ip": "185.125.168.21", "geok": "cn", "geov": ["EU", "AF"], "h": true, "fb": ["c"], "sel": 1, "bsel": 3 },
+ { "id": "e", "ttl": 300, "ip": "38.54.57.171", "geok": "cn", "geov": ["SA", "AF"], "h": true, "fb": [], "sel": 1, "bsel": 3 }
+ ],
+ "aaaa": [
+ { "id": "a", "ttl": 300, "ip": "2a03:94e0:ffff:185:125:168:0:21", "geok": "cn", "geov": ["EU", "AF"], "h": true, "fb": ["b"], "sel": 1, "bsel": 3 },
+ { "id": "b", "ttl": 300, "ip": "2a03:94e1:ffff:45:88:201:0:168", "geok": "cn", "geov": ["NA", "SA", "AS", "OC"], "h": true, "fb": ["a"], "sel": 1, "bsel": 3 }
+ ],
+ "caa": [
+ { "flag": 0, "tag": "issue", "value": "letsencrypt.org" },
+ { "flag": 0, "tag": "iodef", "value": "mailto:tom@69420.me" }
+ ],
+ "soa": { "ttl": 86400, "minttl": 30, "mbox": "root.basedflare.com.", "ns": "esther.kikeflare.com.", "refresh": 86400, "retry": 7200, "expire": 3600 },
+ "txt": [
+ { "ttl": 300, "text": "v=spf1 -all" }
+ ],
+ "ns": [
+ { "ttl": 86400, "host": "esther.kikeflare.com." },
+ { "ttl": 86400, "host": "aronowitz.bfcdn.host." },
+ { "ttl": 86400, "host": "goldberg.fatpeople.lol." }
+ ]
+ }
+ }
+ ]
+ });
+ const [error, setError] = useState();
+
+ useEffect(() => {
+ if (!state.recordSets) {
+ // API.getDomainRecordSets(domain, dispatch, setError, router);
+ }
+ }, [state.recordSets, domain, router]);
+
+ if (state.recordSets == null) {
+ return (
+
+ {error &&
+ );
+ }
+
+ const { user, recordSets, csrf } = state;
+
+ const recordSetRows = recordSets
+ .map(recordSet => {
+ return Object.entries(recordSet)
+ .map(e => {
+ return Object.entries(e[1])
+ .map((recordSet, i) => (
+
+ Loading...
+
+ + {domain} / Records List: ++ + {/* Record sets table */} +
+
+
+ {/* back to account */}
+
|
- {domainCert ? '🔒 '+domainCert.storageName : '-'} + {domainCert + ? {domainCert.storageName} + : No Certificate} + | ++ {d.split('.').length < 2 && + + + DNS + + } |
- HTTPS? + HTTPS Certificate + | ++ Edit DNS | |||||
---|---|---|---|---|---|---|
+ |