summaryrefslogtreecommitdiff
path: root/index.html
blob: 7af0ffefda7a070e50e0e0300e66d97a44f66641 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
<!doctype html>
<html lang="en">
	<head>
		<meta charset="UTF-8" />
		<meta
			name="viewport"
			content="width=device-width, initial-scale=1"
		/>
		<link
			rel="shortcut icon"
			href="torlogo.png"
			type="image/png"
		/>
		<title>tor.toufy.me</title>
		<style
			type="text/css"
			media="all"
		>
			:root {
				--background: #38383d;
				--text: #ececec;
				--text-alt: #868689;
				--primary: #cc80ff;
				--accent: #68b030;
				::selection {
					background-color: var(--primary);
					color: var(--background);
				}
				background-color: var(--background);
				color: var(--text);
				text-align: center;
				a {
					color: var(--primary);
				}
			}
		</style>
	</head>
	<body style="padding: 5px">
		<div
			style="
				display: flex;
				flex-direction: column;
				width: 100%;
				place-content: center;
				place-items: center;
			"
		>
			<img
				src="torlogo.png"
				alt="the onion from TOR project logo"
				style="max-width: 100px"
			/>
			<h1 style="color: var(--primary)">tor.toufy.me</h1>
		</div>

		<div
			style="
				display: flex;
				flex-direction: column;
				width: 100%;
				place-content: center;
				place-items: center;
			"
		>
			<p>
				<a
					href="https://git.toufy.me/toufy/adonis"
					target="_blank"
					>adonis</a
				>
				runs a tor relay node and a snowflake proxy.<br />
				this helps people stay anonymous and circumvent censorship:<br />
				<span
					style="
						color: var(--accent);
						font-weight: bolder;
						text-decoration: underline;
						text-decoration-color: var(--accent);
					"
					id="snowflake_conns"
				></span>
				<span style="color: var(--text-alt); font-weight: bolder"
					>snowflake connections since last restart</span
				>
				<br />
			</p>
		</div>

		<div
			style="
				display: flex;
				flex-direction: column;
				width: 100%;
				place-items: center;
				place-content: center;
			"
		>
			<p style="font-weight: bolder">
				you can help by turning on the toggle below and keeping this tab
				open.<br />
				this will spin up your own snowflake.
			</p>
			<iframe
				src="https://snowflake.torproject.org/embed.html"
				width="320"
				height="240"
				frameborder="0"
				scrolling="no"
			></iframe>
		</div>
	</body>
	<script>
		async function fetchSnowflakeConnections() {
			try {
				const res = await fetch("https://tor.toufy.me/metrics.php", {
					method: "GET",
					headers: { Accept: "application/json" }
				});
				if (!res.ok) {
					snowflake_conns.innerHTML = 0;
					return;
				}
				snowflake_conns.innerHTML = (await res.json()).snowflake_connections;
			} catch (_) {
				snowflake_conns.innerHTML = 0;
			}
		}
		fetchSnowflakeConnections();
		setInterval(() => {
			fetchSnowflakeConnections();
		}, 10000);
	</script>
</html>