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