Skip to content

Commit a026b76

Browse files
authored
change how project name is displayed (#6)
As seen with @adyanth, project fork will be broken from original project, to allow users to fork mine etc. Project name remains the same, but its display change to reduce confusion between the to project.
1 parent 86933af commit a026b76

File tree

6 files changed

+157
-88
lines changed

6 files changed

+157
-88
lines changed

README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Short{Paste}
1+
# ShortPaste
22

33
[![gh_last_release_svg]][gh_last_release_url]
44
[![tippin_svg]][tippin_url]
@@ -11,7 +11,7 @@
1111

1212
> A lightweight personnal URL shortener, pastebin and file uploader.
1313
14-
Short{Paste} is open-source software written in Go and React. It is a minimalistic shortener that combines three things that need shortening: links, files, and text. It is a self-hosted alternative to many popular services like bitly, paste bin and using dropbox to send a file to someone quickly.
14+
ShortPaste is open-source software written in Go and React. It is a minimalistic shortener that combines three things that need shortening: links, files, and text. It is a self-hosted alternative to many popular services like bitly, paste bin and using dropbox to send a file to someone quickly.
1515

1616
The Go backend handles saving files, links, and text in DB and filesystem as needed, while the React UI provides a pretty view for you to add and review content. Added bonus, it tracks hit counts too!
1717

@@ -62,9 +62,9 @@ You can customize the behavior using environment variables:.
6262

6363
## Securing
6464

65-
Keep in mind that Short{Paste} is not secured by any authentication, API key is not enough if Short{Paste} is exposed on the internet.
65+
Keep in mind that ShortPaste is not secured by any authentication, API key is not enough if ShortPaste is exposed on the internet.
6666

67-
Short{Paste} should run behind a reverse proxy (such as as `nginx-proxy-manager` or `trafeik`).
67+
ShortPaste should run behind a reverse proxy (such as as `nginx-proxy-manager` or `trafeik`).
6868
Configure your reverse proxy to directly expose only `/l/*`, `/t/*` and `/f/*`. All other routes (most important `/api`) should wether not be exposed on the internet or with an authentication layer.
6969

7070
## Screenshots
@@ -150,4 +150,4 @@ Your web browser should open on `http://localhost:3000`. The app is configured t
150150

151151
## Credits
152152

153-
Short{Paste} is based on [Adyanth Hosavalike's Short{Paste}](https://github.com/adyanth/shortpaste) but have been nearly completely rewrittent.
153+
ShortPaste is based on [Adyanth Hosavalike's ShortPaste](https://github.com/adyanth/shortpaste) but have been nearly completely rewrittent.

front/public/index.html

+26-8
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,38 @@
22
<html lang="en">
33
<head>
44
<meta charset="utf-8" />
5-
<link rel="apple-touch-icon" sizes="180x180" href="%PUBLIC_URL%/apple-touch-icon.png">
6-
<link rel="icon" type="image/png" sizes="32x32" href="%PUBLIC_URL%/favicon-32x32.png">
7-
<link rel="icon" type="image/png" sizes="16x16" href="%PUBLIC_URL%/favicon-16x16.png">
8-
<link rel="manifest" href="%PUBLIC_URL%/site.webmanifest">
9-
<link rel="mask-icon" href="%PUBLIC_URL%/safari-pinned-tab.svg" color="#e91e63">
10-
<meta name="msapplication-TileColor" content="#e91e63">
11-
<meta name="theme-color" content="#e91e63">
5+
<link
6+
rel="apple-touch-icon"
7+
sizes="180x180"
8+
href="%PUBLIC_URL%/apple-touch-icon.png"
9+
/>
10+
<link
11+
rel="icon"
12+
type="image/png"
13+
sizes="32x32"
14+
href="%PUBLIC_URL%/favicon-32x32.png"
15+
/>
16+
<link
17+
rel="icon"
18+
type="image/png"
19+
sizes="16x16"
20+
href="%PUBLIC_URL%/favicon-16x16.png"
21+
/>
22+
<link rel="manifest" href="%PUBLIC_URL%/site.webmanifest" />
23+
<link
24+
rel="mask-icon"
25+
href="%PUBLIC_URL%/safari-pinned-tab.svg"
26+
color="#e91e63"
27+
/>
28+
<meta name="msapplication-TileColor" content="#e91e63" />
29+
<meta name="theme-color" content="#e91e63" />
1230

1331
<meta name="viewport" content="width=device-width, initial-scale=1" />
1432
<meta
1533
name="description"
1634
content="A lightweight personnal URL shortener, pastebin and file uploader"
1735
/>
18-
<title>Short{Paste}</title>
36+
<title>ShortPaste</title>
1937
</head>
2038
<body>
2139
<noscript>You need to enable JavaScript to run this app.</noscript>

front/public/site.webmanifest

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"name": "Short{Paste}",
3-
"short_name": "Short{Paste}",
2+
"name": "ShortPaste",
3+
"short_name": "ShortPaste",
44
"icons": [
55
{
66
"src": "/android-chrome-192x192.png",

front/src/components/main_menu/index.tsx

+62-20
Original file line numberDiff line numberDiff line change
@@ -3,34 +3,76 @@ import classes from "./styles.module.scss";
33
import Item from "./item";
44

55
import LogoIcon from "../../assets/logo.png";
6-
import {Link as LinkIcon, TextSnippetOutlined as TextIcon, FilePresent as FileIcon} from '@mui/icons-material';
6+
import {
7+
Link as LinkIcon,
8+
TextSnippetOutlined as TextIcon,
9+
FilePresent as FileIcon,
10+
} from "@mui/icons-material";
711
import { AppBar, Drawer, Toolbar } from "@mui/material";
812
import { useTranslation } from "react-i18next";
913

1014
import AppContext from "../../app_context";
1115
import classNames from "classnames";
1216

13-
const MainMenu:React.FC = () => {
14-
const {t} = useTranslation();
17+
const MainMenu: React.FC = () => {
18+
const { t } = useTranslation();
1519
const app = useContext(AppContext);
1620

17-
return <>
18-
<AppBar position="fixed" className={classes.root_bottom} sx={{ display: { xs: 'block', md: 'none' }, top: 'auto', bottom: 0 }}>
19-
<Toolbar>
20-
<Item to="/" color="blue"><LinkIcon />{t("menu.links")}</Item>
21-
<Item to="/texts" color="purple"><TextIcon />{t("menu.texts")}</Item>
22-
<Item to="/files" color="pink"><FileIcon />{t("menu.files")}</Item>
23-
</Toolbar>
24-
</AppBar>
25-
<Drawer variant="permanent" open={true} className={classes.root_left} sx={{ display: { xs: 'none', md: 'block' } }}>
26-
<div className={classes.logo}><img src={LogoIcon} alt="Short{Paste}" /></div>
27-
<Item to="/" color="blue"><LinkIcon />{t("menu.links")}</Item>
28-
<Item to="/texts" color="purple"><TextIcon />{t("menu.texts")}</Item>
29-
<Item to="/files" color="pink"><FileIcon />{t("menu.files")}</Item>
21+
return (
22+
<>
23+
<AppBar
24+
position="fixed"
25+
className={classes.root_bottom}
26+
sx={{ display: { xs: "block", md: "none" }, top: "auto", bottom: 0 }}
27+
>
28+
<Toolbar>
29+
<Item to="/" color="blue">
30+
<LinkIcon />
31+
{t("menu.links")}
32+
</Item>
33+
<Item to="/texts" color="purple">
34+
<TextIcon />
35+
{t("menu.texts")}
36+
</Item>
37+
<Item to="/files" color="pink">
38+
<FileIcon />
39+
{t("menu.files")}
40+
</Item>
41+
</Toolbar>
42+
</AppBar>
43+
<Drawer
44+
variant="permanent"
45+
open={true}
46+
className={classes.root_left}
47+
sx={{ display: { xs: "none", md: "block" } }}
48+
>
49+
<div className={classes.logo}>
50+
<img src={LogoIcon} alt="ShortPaste" />
51+
</div>
52+
<Item to="/" color="blue">
53+
<LinkIcon />
54+
{t("menu.links")}
55+
</Item>
56+
<Item to="/texts" color="purple">
57+
<TextIcon />
58+
{t("menu.texts")}
59+
</Item>
60+
<Item to="/files" color="pink">
61+
<FileIcon />
62+
{t("menu.files")}
63+
</Item>
3064
<div className={classes.spacer} />
31-
<div className={classes.info}><span className={classNames(classes.status, {[classes.up]: app?.status === "up"})} /> {app?.version}</div>
32-
</Drawer>
33-
</>;
65+
<div className={classes.info}>
66+
<span
67+
className={classNames(classes.status, {
68+
[classes.up]: app?.status === "up",
69+
})}
70+
/>{" "}
71+
{app?.version}
72+
</div>
73+
</Drawer>
74+
</>
75+
);
3476
};
3577

36-
export default MainMenu;
78+
export default MainMenu;

server/public/templates/file.html

+30-27
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,42 @@
11
<!DOCTYPE html>
22
<html lang="en">
3-
4-
<head>
5-
<meta charset="UTF-8">
6-
<meta http-equiv="X-UA-Compatible" content="IE=edge">
7-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
8-
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<link
8+
rel="stylesheet"
9+
href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900"
10+
/>
911
<title>File {{ .Name }}</title>
1012
<style>
11-
body {
12-
text-align: center;
13-
font-family: Roboto, sans-serif !important;
14-
}
13+
body {
14+
text-align: center;
15+
font-family: Roboto, sans-serif !important;
16+
}
1517

16-
.title {
17-
font-size: 1.25rem !important;
18-
font-weight: 500;
19-
line-height: 2rem;
20-
letter-spacing: 0.0125em !important;
21-
color: #2c3e50;
22-
}
18+
.title {
19+
font-size: 1.25rem !important;
20+
font-weight: 500;
21+
line-height: 2rem;
22+
letter-spacing: 0.0125em !important;
23+
color: #2c3e50;
24+
}
2325
</style>
24-
</head>
25-
26-
<body>
26+
</head>
2727

28-
<h1 class="title" style="margin: 2em;">
29-
<a href="/" style="color: inherit;text-decoration: inherit;">Short{Paste}</a>
28+
<body>
29+
<h1 class="title" style="margin: 2em">
30+
<a href="/" style="color: inherit; text-decoration: inherit"
31+
>ShortPaste</a
32+
>
3033
</h1>
31-
Click here to download: <a href="{{ .Src }}">"{{ .Name }}"</a> (Size: {{ .Size }})
34+
Click here to download: <a href="{{ .Src }}">"{{ .Name }}"</a> (Size: {{
35+
.Size }})
3236
<br />
3337
{{ if .Image }}
3438
<h3 class="title">Preview</h3>
35-
<img src="{{ .Src }}" style="border: 3px solid black;">
39+
<img src="{{ .Src }}" style="border: 3px solid black" />
3640
{{ end }}
37-
</body>
38-
39-
</html>
41+
</body>
42+
</html>

server/public/templates/text.html

+32-26
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,44 @@
11
<!DOCTYPE html>
22
<html lang="en">
3-
4-
<head>
5-
<meta charset="UTF-8">
6-
<meta http-equiv="X-UA-Compatible" content="IE=edge">
7-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
87
<title>Text {{ .ID }}</title>
9-
<link rel="stylesheet" href="//unpkg.com/@highlightjs/[email protected]/styles/default.min.css">
8+
<link
9+
rel="stylesheet"
10+
href="//unpkg.com/@highlightjs/[email protected]/styles/default.min.css"
11+
/>
1012
<script src="//unpkg.com/@highlightjs/[email protected]/highlight.min.js"></script>
11-
<script>hljs.highlightAll();</script>
13+
<script>
14+
hljs.highlightAll();
15+
</script>
1216
<style>
13-
body {
14-
font-family: Roboto, sans-serif !important;
15-
}
17+
body {
18+
font-family: Roboto, sans-serif !important;
19+
}
1620

17-
.title {
18-
font-size: 1.25rem !important;
19-
font-weight: 500;
20-
line-height: 2rem;
21-
letter-spacing: 0.0125em !important;
22-
color: #2c3e50;
23-
}
21+
.title {
22+
font-size: 1.25rem !important;
23+
font-weight: 500;
24+
line-height: 2rem;
25+
letter-spacing: 0.0125em !important;
26+
color: #2c3e50;
27+
}
2428
</style>
25-
</head>
29+
</head>
2630

27-
<body>
28-
<h1 class="title" style="text-align: center; margin: 2em;">
29-
<a href="/" style="color: inherit;text-decoration: inherit;">Short{Paste}</a>
31+
<body>
32+
<h1 class="title" style="text-align: center; margin: 2em">
33+
<a href="/" style="color: inherit; text-decoration: inherit"
34+
>ShortPaste</a
35+
>
3036
</h1>
31-
<h3 class="title" style="text-align: left;">Contents of {{ .ID }}</h3>
32-
Click here to download: <a href="{{ .Src }}">"{{ .Name }}"</a> (Size: {{ .Size }})
37+
<h3 class="title" style="text-align: left">Contents of {{ .ID }}</h3>
38+
Click here to download: <a href="{{ .Src }}">"{{ .Name }}"</a> (Size: {{
39+
.Size }})
3340
<pre>
3441
<code class="{{ .Class }}">{{ .Text }}</code>
3542
</pre>
36-
</body>
37-
38-
</html>
43+
</body>
44+
</html>

0 commit comments

Comments
 (0)