Skip to content

Commit dbdb0f8

Browse files
committed
Split TOS and Privacy into md files
1 parent d009589 commit dbdb0f8

9 files changed

Lines changed: 1148 additions & 260 deletions

File tree

‎API.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ paste has a simple HTTP API which can be used to read and write pastes programma
1010
>
1111
> * You must **provide a `User-Agent` header** to uniquely identify your application in all requests. This should include the application name and contact information, e.g. `ExampleApp (github.com/ExampleUser/ExampleApp)` or `MyExampleScript (github.com/ExampleUser)`.
1212
> * You must **only upload content when prompted by a user action**, e.g. a button click or command line input. Automated or scheduled uploads are not allowed.
13-
> * A **terms of service** applies. In summary:
13+
> * The **[Terms of Service](src/content/tos.md)** and **[Privacy Policy](src/content/privacy.md)** apply. In summary, the terms are:
1414
> * No Illegal Use *(no illegal, harmful or unlawful content)*
1515
> * No Malicious Content *(no malware, phishing, etc.)*
1616
> * No Personal Data *(no personal data, secrets, passwords, tokens, etc.)*

‎README.md‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66

77
Anyone can use paste! The official/public instance can be accessed using the endpoints listed below, but you can also [host your own](#self-hosting) if you like!
88

9+
> [!NOTE]
10+
> Use of the official instance (https://pastes.dev) is subject to the [Terms of Service](src/content/tos.md) and [Privacy Policy](src/content/privacy.md).
11+
912
##### 1) In a Web Browser
1013
Just go to https://pastes.dev!
1114

‎package.json‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,14 @@
2525
"whatwg-mimetype": "^5.0.0"
2626
},
2727
"devDependencies": {
28+
"@mdx-js/rollup": "^3.1.1",
29+
"@types/mdx": "^2.0.14",
2830
"@types/node": "^26.6.6",
2931
"@types/pako": "^3.0.0",
3032
"@types/react": "^19.3.0",
3133
"@types/react-dom": "^19.3.0",
3234
"@types/whatwg-mimetype": "^5.0.0",
33-
"@vitejs/plugin-react-swc": "^4.3.3",
35+
"@vitejs/plugin-react": "^6.1.2",
3436
"oxfmt": "^0.76.0",
3537
"oxlint": "^1.91.0",
3638
"typescript": "~7.0.2",

‎src/components/About.tsx‎

Lines changed: 81 additions & 160 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
import { useCallback, useState } from 'react';
1+
import { useEffect, useState } from 'react';
22
import styled from 'styled-components';
33

4+
import Privacy from '../content/privacy.md';
5+
import Tos from '../content/tos.md';
46
import Button from './Button.tsx';
57

68
const currentYear = new Date().getFullYear();
@@ -9,27 +11,39 @@ interface AboutProps {
911
setVisible: (show: boolean) => void;
1012
}
1113

12-
export default function About({ setVisible }: AboutProps) {
13-
const official = window.location.hostname === 'pastes.dev';
14-
const [notice, setNotice] = useState<'tos' | 'privacy' | null>(null);
15-
16-
const closeNotice = useCallback(() => {
17-
setNotice(null);
18-
}, [setNotice]);
19-
20-
const closeAbout = useCallback(() => {
21-
setVisible(false);
22-
}, [setVisible]);
14+
const notices = { tos: Tos, privacy: Privacy };
15+
type NoticeKey = keyof typeof notices;
2316

24-
if (notice == 'tos') {
25-
return <Tos close={closeNotice} />;
26-
} else if (notice == 'privacy') {
27-
return <Privacy close={closeNotice} />;
17+
export default function About({ setVisible }: AboutProps) {
18+
const official = true || window.location.hostname === 'pastes.dev';
19+
const [notice, setNotice] = useState<NoticeKey | null>(null);
20+
21+
useEffect(() => {
22+
const onKeyDown = (e: KeyboardEvent) => {
23+
if (e.key !== 'Escape') return;
24+
if (notice) {
25+
setNotice(null);
26+
} else {
27+
setVisible(false);
28+
}
29+
};
30+
window.addEventListener('keydown', onKeyDown);
31+
return () => window.removeEventListener('keydown', onKeyDown);
32+
}, [notice, setVisible]);
33+
34+
if (notice) {
35+
const Notice = notices[notice];
36+
return (
37+
<NoticePanel>
38+
<CloseButton callback={() => setNotice(null)} />
39+
<Notice />
40+
</NoticePanel>
41+
);
2842
}
2943

3044
return (
3145
<AboutPanel>
32-
<CloseButton callback={closeAbout} />
46+
<CloseButton callback={() => setVisible(false)} />
3347
<BannerContainer>
3448
<Banner>{'{paste}'}</Banner>
3549
</BannerContainer>
@@ -43,25 +57,13 @@ export default function About({ setVisible }: AboutProps) {
4357
<p>
4458
<b>pastes.dev</b> is the official, publicly accessible paste
4559
instance, and can be used by anyone, subject to the{' '}
46-
<a
47-
href="#"
48-
onClick={e => {
49-
setNotice('tos');
50-
e.preventDefault();
51-
}}
52-
>
60+
<NoticeLink to="tos" show={setNotice}>
5361
Terms of Service
54-
</a>{' '}
62+
</NoticeLink>{' '}
5563
and{' '}
56-
<a
57-
href="#"
58-
onClick={e => {
59-
setNotice('privacy');
60-
e.preventDefault();
61-
}}
62-
>
64+
<NoticeLink to="privacy" show={setNotice}>
6365
Privacy Policy
64-
</a>
66+
</NoticeLink>
6567
.
6668
</p>
6769
<p>
@@ -85,7 +87,7 @@ export default function About({ setVisible }: AboutProps) {
8587
</p>
8688
</>
8789
)}
88-
<p style={{ textAlign: 'center' }}>
90+
<Footer>
8991
<a href="https://github.com/lucko/paste" target="_blank">
9092
paste
9193
</a>{' '}
@@ -103,137 +105,46 @@ export default function About({ setVisible }: AboutProps) {
103105
contributors
104106
</a>
105107
.
106-
</p>
108+
</Footer>
107109
</AboutPanel>
108110
);
109111
}
110112

111-
const Tos = ({ close }: { close: () => void }) => {
112-
return (
113-
<AboutPanel>
114-
<CloseButton callback={close} />
115-
<h1>Terms of Service</h1>
116-
<p>
117-
<em>Last updated: 30 October 2026</em>
118-
</p>
119-
<p>
120-
Welcome to pastes.dev. By using this service, you agree to the following
121-
terms:
122-
</p>
123-
<ol>
124-
<li>
125-
<b>No Illegal Use:</b> You may not use pastes.dev to share, store, or
126-
distribute any content that is illegal, harmful, or violates any laws
127-
or regulations.
128-
</li>
129-
<li>
130-
<b>No Malicious Content:</b> Do not upload or share content intended
131-
to harm others, including but not limited to malware or phishing
132-
links.
133-
</li>
134-
<li>
135-
<b>No Personal Data:</b> Do not upload personal data about other
136-
people, or secrets such as passwords, API keys or tokens. Pastes can
137-
be viewed by anyone with the link, and may be copied or cached by
138-
others before they expire.
139-
</li>
140-
<li>
141-
<b>Content Responsibility:</b> You are solely responsible for the
142-
content you post. We do not review content and are not liable for what
143-
users choose to share.
144-
</li>
145-
<li>
146-
<b>Moderation:</b> We reserve the right to remove any content at our
147-
discretion, and to restrict or terminate access to the service for
148-
abuse or violations of these terms.
149-
</li>
150-
<li>
151-
<b>No Liability:</b> This service is provided "as is" with no
152-
warranties. We do not guarantee uptime, data retention, or
153-
availability.
154-
</li>
155-
</ol>
156-
<p>
157-
By using pastes.dev, you accept these terms. If you do not agree, please
158-
do not use the service.
159-
</p>
160-
<h2>Reporting Abuse</h2>
161-
<p>
162-
If you encounter content that violates these terms, please report it by
163-
email to{' '}
164-
<a href="mailto:report-abuse@pastes.dev" target="_blank">
165-
report-abuse@pastes.dev
166-
</a>{' '}
167-
so that it can be removed.
168-
</p>
169-
</AboutPanel>
170-
);
171-
};
172-
173-
const Privacy = ({ close }: { close: () => void }) => {
174-
return (
175-
<AboutPanel>
176-
<CloseButton callback={close} />
177-
<h1>Privacy Policy</h1>
178-
<p>
179-
<em>Last updated: 30 October 2026</em>
180-
</p>
181-
<h2>What We Process</h2>
182-
<ul>
183-
<li>
184-
<b>Pastes:</b> Content you upload. <b>Pastes are public.</b> Anyone
185-
with the link can view or download them. Do not upload personal data
186-
or secrets (passwords, tokens).
187-
</li>
188-
<li>
189-
<b>Request Logs:</b> Technical data (IP address, user agent,
190-
timestamps) processed for security, rate-limiting, and abuse
191-
prevention.
192-
</li>
193-
</ul>
194-
<h2>Service Providers</h2>
195-
<p>
196-
We use third-party hosting, storage, and CDN providers in Germany, the
197-
Netherlands, and globally, relying on GDPR-compliant safeguards (e.g.,
198-
Standard Contractual Clauses) for international transfers. We do not
199-
sell your data or use it for advertising.
200-
</p>
201-
<h2>Retention</h2>
202-
<p>
203-
Pastes are automatically deleted after a limited period (currently up to
204-
180 days for web pastes; 30 days for API pastes). Logs are kept only as
205-
necessary. We cannot recall third-party cached copies.
206-
</p>
207-
<h2>Your Rights</h2>
208-
<p>
209-
Under UK/EU GDPR, processing is based on our legitimate interests in
210-
securing and delivering the service. You may have rights to access,
211-
delete, or object to processing. To request removal or exercise rights,{' '}
212-
<a href="mailto:report-abuse@pastes.dev" target="_blank">
213-
contact us
214-
</a>{' '}
215-
with the paste link. We may update this policy by publishing a revised
216-
version.
217-
</p>
218-
</AboutPanel>
219-
);
220-
};
113+
const NoticeLink = ({
114+
to,
115+
show,
116+
children,
117+
}: {
118+
to: NoticeKey;
119+
show: (notice: NoticeKey) => void;
120+
children: string;
121+
}) => (
122+
<a
123+
href="#"
124+
onClick={e => {
125+
show(to);
126+
e.preventDefault();
127+
}}
128+
>
129+
{children}
130+
</a>
131+
);
132+
133+
const CloseButton = ({ callback }: { callback: () => void }) => (
134+
<CloseButtonContainer>
135+
<CloseButtonInner onClick={callback}>[X]</CloseButtonInner>
136+
</CloseButtonContainer>
137+
);
138+
139+
const CloseButtonContainer = styled.div`
140+
position: absolute;
141+
top: 5px;
142+
right: 5px;
143+
`;
221144

222-
const CloseButton = ({ callback }: { callback: () => void }) => {
223-
return (
224-
<div
225-
style={{
226-
position: 'absolute',
227-
top: '5px',
228-
right: '5px',
229-
}}
230-
>
231-
<Button style={{ padding: '5px' }} onClick={callback}>
232-
[X]
233-
</Button>
234-
</div>
235-
);
236-
};
145+
const CloseButtonInner = styled(Button)`
146+
padding: 5px;
147+
`;
237148

238149
const AboutPanel = styled.div`
239150
position: absolute;
@@ -258,6 +169,12 @@ const AboutPanel = styled.div`
258169
}
259170
`;
260171

172+
const NoticePanel = styled(AboutPanel)`
173+
width: 900px;
174+
max-width: 100vw;
175+
max-height: 90vh;
176+
`;
177+
261178
const BannerContainer = styled.div`
262179
display: flex;
263180
justify-content: center;
@@ -272,3 +189,7 @@ const Banner = styled.div`
272189
padding: 10px;
273190
font-weight: bold;
274191
`;
192+
193+
const Footer = styled.p`
194+
text-align: center;
195+
`;

‎src/content/privacy.md‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Privacy Policy
2+
3+
_Last updated: 30 October 2026_
4+
5+
## What We Process
6+
7+
- **Pastes:** Content you upload. **Pastes are public.** Anyone with the link can view or download them. Do not upload personal data or secrets (passwords, tokens).
8+
- **Request Logs:** Technical data (IP address, user agent, timestamps) processed for security, rate-limiting, and abuse prevention.
9+
10+
## Service Providers
11+
12+
We use third-party hosting, storage, and CDN providers in Germany, the Netherlands, and globally, relying on GDPR-compliant safeguards (e.g., Standard Contractual Clauses) for international transfers. We do not sell your data or use it for advertising.
13+
14+
## Retention
15+
16+
Pastes are automatically deleted after a limited period (currently up to 180 days for web pastes; 30 days for API pastes). Logs are kept only as necessary. We cannot recall third-party cached copies.
17+
18+
## Your Rights
19+
20+
Under UK/EU GDPR, processing is based on our legitimate interests in securing and delivering the service. You may have rights to access, delete, or object to processing. To request removal or exercise rights, [contact us](mailto:report-abuse@pastes.dev) with the paste link. We may update this policy by publishing a revised version.

‎src/content/tos.md‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Terms of Service
2+
3+
_Last updated: 30 October 2026_
4+
5+
Welcome to pastes.dev. By using this service, you agree to the following terms:
6+
7+
1. **No Illegal Use:** You may not use pastes.dev to share, store, or distribute any content that is illegal, harmful, or violates any laws or regulations.
8+
2. **No Malicious Content:** Do not upload or share content intended to harm others, including but not limited to malware or phishing links.
9+
3. **No Personal Data:** Do not upload personal data about other people, or secrets such as passwords, API keys or tokens. Pastes can be viewed by anyone with the link, and may be copied or cached by others before they expire.
10+
4. **Content Responsibility:** You are solely responsible for the content you post. We do not review content and are not liable for what users choose to share.
11+
5. **Moderation:** We reserve the right to remove any content at our discretion, and to restrict or terminate access to the service for abuse or violations of these terms.
12+
6. **No Liability:** This service is provided "as is" with no warranties. We do not guarantee uptime, data retention, or availability.
13+
7. **API Use:** Identify your application with a unique `User-Agent` header (name and contact info). Only upload when prompted by a user action; automated or scheduled uploads are not allowed.
14+
15+
By using pastes.dev, you accept these terms. If you do not agree, please do not use the service.
16+
17+
## Reporting Abuse
18+
19+
If you encounter content that violates these terms, please report it by email to [report-abuse@pastes.dev](mailto:report-abuse@pastes.dev) so that it can be removed.

‎src/vite-env.d.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/// <reference types="vite/client" />
2+
/// <reference types="mdx" />
23

34
interface ImportMetaEnv {
45
readonly VITE_BYTEBIN_URL?: string;

‎vite.config.ts‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import { fileURLToPath } from 'node:url';
22

3-
import react from '@vitejs/plugin-react-swc';
3+
import mdx from '@mdx-js/rollup';
4+
import react from '@vitejs/plugin-react';
45
import { defineConfig } from 'vite';
56

67
// https://vite.dev/config/
78
export default defineConfig({
8-
plugins: [react()],
9+
plugins: [{ enforce: 'pre', ...mdx({ include: /\.md$/ }) }, react()],
910
resolve: {
1011
alias: {
1112
'monaco-themes/themes': fileURLToPath(

0 commit comments

Comments
 (0)