Skip to content
139 linesCodeBlameRaw
1/**
2 * Who makes g1t, how to reach them, and the policies that govern it: the
3 * one place the footer, the policy pages, /security, /support and
4 * security.txt read these from.
5 */
6import { type SimpleIcon, siX } from "simple-icons";
7
8/** The company behind g1t. */
9export const COMPANY = {
10 name: "Flagon, Inc.",
11 url: "https://www.flagon.io",
12 /** How the footer describes it. */
13 about: "a small, independent software company",
14 /** Who founded it, named wherever the company is described. */
15 founder: "Chase Pierce",
16};
17
18/** g1t's own accounts elsewhere, drawn as their marks in the footer. */
19export const SOCIAL: { label: string; url: string; icon: SimpleIcon }[] = [{ label: "X", url: "https://x.com/g1t_sh", icon: siX }];
20
21/**
22 * Flagon's other launched products, which the footer's maker line names
23 * ("…, the people behind X and Y"). None yet: add each here when it ships.
24 */
25export const MAKER_PRODUCTS: { name: string; url: string }[] = [];
26
27/** "X", "X and Y", "X, Y and Z". */
28export function listed(names: string[]): string {
29 if (names.length <= 1) return names.join("");
30 return `${names.slice(0, -1).join(", ")} and ${names[names.length - 1]}`;
31}
32
33/** The year in UTC, so a page rendered near midnight on 31 December agrees everywhere. */
34export function copyrightYear(now: Date = new Date()): number {
35 return now.getUTCFullYear();
36}
37
38/** The footer's legal line. */
39export function copyright(now: Date = new Date()): string {
40 return `© ${copyrightYear(now)} ${COMPANY.name} All rights reserved.`;
41}
42
43/**
44 * Where people reach g1t. Each must be a real, watched mailbox. For now
45 * every topic goes to Flagon's one address; give a topic its own address
46 * here once the g1t.sh aliases exist.
47 */
48export const CONTACT = {
49 support: "hey@flagon.io",
50 security: "hey@flagon.io",
51 privacy: "hey@flagon.io",
52 billing: "hey@flagon.io",
53 abuse: "hey@flagon.io",
54 legal: "hey@flagon.io",
55};
56
57export type Policy = {
58 slug: string;
59 title: string;
60 summary: string;
61};
62
63/** The policies, in the order the index lists them. Each is `/policies/<slug>`. */
64export const POLICIES: Policy[] = [
65 {
66 slug: "terms",
67 title: "Terms of Service",
68 summary: "The agreement between you and Flagon, Inc. when you use g1t: accounts, your content, agents, paying, and ending.",
69 },
70 {
71 slug: "privacy",
72 title: "Privacy Policy",
73 summary: "What g1t collects, why, where it goes, how long it is kept, and how to see, export or delete it.",
74 },
75 {
76 slug: "acceptable-use",
77 title: "Acceptable Use Policy",
78 summary: "What g1t may not be used for, from mining cryptocurrency to abuse, and what happens when it is.",
79 },
80 {
81 slug: "refunds",
82 title: "Refunds and Cancellation",
83 summary: "Ending the plan, accidental overages and goodwill credits, and when money goes back to your card.",
84 },
85 {
86 slug: "subprocessors",
87 title: "Subprocessors",
88 summary: "The companies that process data for g1t, what each does, and the services you choose to connect.",
89 },
90];
91
92/** When any policy last changed, `YYYY-MM-DD`. */
93export const POLICIES_UPDATED = "2026-10-09";
94
95/** Every change to the policies, newest first. */
96export const POLICY_HISTORY: { date: string; change: string }[] = [
97 {
98 date: "2026-10-09",
99 change:
100 "Privacy Policy: g1t.sh uses HeyCatch for site analytics, with names removed outside the public pages, and one analytics cookie, set in the EU, EEA, UK and Switzerland only after you allow it. Subprocessors: HeyCatch, Inc. added.",
101 },
102 {
103 date: "2026-10-06",
104 change:
105 "Privacy Policy: request logs are kept 7 days, and database history 30 days. Subprocessors: GitHub listed among the integrations you choose, in place of Slack, which g1t does not connect to.",
106 },
107 {
108 date: "2026-10-05",
109 change:
110 "First published: Terms of Service, Privacy Policy, Acceptable Use Policy, Refunds and Cancellation, and Subprocessors.",
111 },
112];
113
114/** `2026-10-05` as "October 5, 2026". */
115export function longDate(day: string): string {
116 const [year, month, date] = day.split("-").map(Number);
117 const months = [
118 "January", "February", "March", "April", "May", "June",
119 "July", "August", "September", "October", "November", "December",
120 ];
121 return `${months[month - 1]} ${date}, ${year}`;
122}
123
124/**
125 * security.txt (RFC 9116). `Expires` is required and should be less than a
126 * year away, so it is always computed: 180 days from now.
127 */
128export function securityTxt(now: Date = new Date(), site = "https://g1t.sh"): string {
129 const expires = new Date(now.getTime() + 180 * 24 * 60 * 60 * 1000);
130 expires.setUTCHours(0, 0, 0, 0);
131 return [
132 `Contact: mailto:${CONTACT.security}`,
133 `Expires: ${expires.toISOString().replace(".000Z", "Z")}`,
134 "Preferred-Languages: en",
135 `Policy: ${site}/security#responsible-disclosure`,
136 `Canonical: ${site}/.well-known/security.txt`,
137 "",
138 ].join("\n");
139}