Skip to content

Commit

Permalink
change how project name is displayed (#6)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
bemble authored Nov 3, 2022
1 parent 86933af commit a026b76
Show file tree
Hide file tree
Showing 6 changed files with 157 additions and 88 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Short{Paste}
# ShortPaste

[![gh_last_release_svg]][gh_last_release_url]
[![tippin_svg]][tippin_url]
Expand All @@ -11,7 +11,7 @@

> A lightweight personnal URL shortener, pastebin and file uploader.
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.
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.

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!

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

## Securing

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.
Keep in mind that ShortPaste is not secured by any authentication, API key is not enough if ShortPaste is exposed on the internet.

Short{Paste} should run behind a reverse proxy (such as as `nginx-proxy-manager` or `trafeik`).
ShortPaste should run behind a reverse proxy (such as as `nginx-proxy-manager` or `trafeik`).
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.

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

## Credits

Short{Paste} is based on [Adyanth Hosavalike's Short{Paste}](https:/adyanth/shortpaste) but have been nearly completely rewrittent.
ShortPaste is based on [Adyanth Hosavalike's ShortPaste](https:/adyanth/shortpaste) but have been nearly completely rewrittent.
34 changes: 26 additions & 8 deletions front/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,38 @@
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="apple-touch-icon" sizes="180x180" href="%PUBLIC_URL%/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="%PUBLIC_URL%/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="%PUBLIC_URL%/favicon-16x16.png">
<link rel="manifest" href="%PUBLIC_URL%/site.webmanifest">
<link rel="mask-icon" href="%PUBLIC_URL%/safari-pinned-tab.svg" color="#e91e63">
<meta name="msapplication-TileColor" content="#e91e63">
<meta name="theme-color" content="#e91e63">
<link
rel="apple-touch-icon"
sizes="180x180"
href="%PUBLIC_URL%/apple-touch-icon.png"
/>
<link
rel="icon"
type="image/png"
sizes="32x32"
href="%PUBLIC_URL%/favicon-32x32.png"
/>
<link
rel="icon"
type="image/png"
sizes="16x16"
href="%PUBLIC_URL%/favicon-16x16.png"
/>
<link rel="manifest" href="%PUBLIC_URL%/site.webmanifest" />
<link
rel="mask-icon"
href="%PUBLIC_URL%/safari-pinned-tab.svg"
color="#e91e63"
/>
<meta name="msapplication-TileColor" content="#e91e63" />
<meta name="theme-color" content="#e91e63" />

<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta
name="description"
content="A lightweight personnal URL shortener, pastebin and file uploader"
/>
<title>Short{Paste}</title>
<title>ShortPaste</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
Expand Down
4 changes: 2 additions & 2 deletions front/public/site.webmanifest
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Short{Paste}",
"short_name": "Short{Paste}",
"name": "ShortPaste",
"short_name": "ShortPaste",
"icons": [
{
"src": "/android-chrome-192x192.png",
Expand Down
82 changes: 62 additions & 20 deletions front/src/components/main_menu/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,76 @@ import classes from "./styles.module.scss";
import Item from "./item";

import LogoIcon from "../../assets/logo.png";
import {Link as LinkIcon, TextSnippetOutlined as TextIcon, FilePresent as FileIcon} from '@mui/icons-material';
import {
Link as LinkIcon,
TextSnippetOutlined as TextIcon,
FilePresent as FileIcon,
} from "@mui/icons-material";
import { AppBar, Drawer, Toolbar } from "@mui/material";
import { useTranslation } from "react-i18next";

import AppContext from "../../app_context";
import classNames from "classnames";

const MainMenu:React.FC = () => {
const {t} = useTranslation();
const MainMenu: React.FC = () => {
const { t } = useTranslation();
const app = useContext(AppContext);

return <>
<AppBar position="fixed" className={classes.root_bottom} sx={{ display: { xs: 'block', md: 'none' }, top: 'auto', bottom: 0 }}>
<Toolbar>
<Item to="/" color="blue"><LinkIcon />{t("menu.links")}</Item>
<Item to="/texts" color="purple"><TextIcon />{t("menu.texts")}</Item>
<Item to="/files" color="pink"><FileIcon />{t("menu.files")}</Item>
</Toolbar>
</AppBar>
<Drawer variant="permanent" open={true} className={classes.root_left} sx={{ display: { xs: 'none', md: 'block' } }}>
<div className={classes.logo}><img src={LogoIcon} alt="Short{Paste}" /></div>
<Item to="/" color="blue"><LinkIcon />{t("menu.links")}</Item>
<Item to="/texts" color="purple"><TextIcon />{t("menu.texts")}</Item>
<Item to="/files" color="pink"><FileIcon />{t("menu.files")}</Item>
return (
<>
<AppBar
position="fixed"
className={classes.root_bottom}
sx={{ display: { xs: "block", md: "none" }, top: "auto", bottom: 0 }}
>
<Toolbar>
<Item to="/" color="blue">
<LinkIcon />
{t("menu.links")}
</Item>
<Item to="/texts" color="purple">
<TextIcon />
{t("menu.texts")}
</Item>
<Item to="/files" color="pink">
<FileIcon />
{t("menu.files")}
</Item>
</Toolbar>
</AppBar>
<Drawer
variant="permanent"
open={true}
className={classes.root_left}
sx={{ display: { xs: "none", md: "block" } }}
>
<div className={classes.logo}>
<img src={LogoIcon} alt="ShortPaste" />
</div>
<Item to="/" color="blue">
<LinkIcon />
{t("menu.links")}
</Item>
<Item to="/texts" color="purple">
<TextIcon />
{t("menu.texts")}
</Item>
<Item to="/files" color="pink">
<FileIcon />
{t("menu.files")}
</Item>
<div className={classes.spacer} />
<div className={classes.info}><span className={classNames(classes.status, {[classes.up]: app?.status === "up"})} /> {app?.version}</div>
</Drawer>
</>;
<div className={classes.info}>
<span
className={classNames(classes.status, {
[classes.up]: app?.status === "up",
})}
/>{" "}
{app?.version}
</div>
</Drawer>
</>
);
};

export default MainMenu;
export default MainMenu;
57 changes: 30 additions & 27 deletions server/public/templates/file.html
Original file line number Diff line number Diff line change
@@ -1,39 +1,42 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link
rel="stylesheet"
href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900"
/>
<title>File {{ .Name }}</title>
<style>
body {
text-align: center;
font-family: Roboto, sans-serif !important;
}
body {
text-align: center;
font-family: Roboto, sans-serif !important;
}

.title {
font-size: 1.25rem !important;
font-weight: 500;
line-height: 2rem;
letter-spacing: 0.0125em !important;
color: #2c3e50;
}
.title {
font-size: 1.25rem !important;
font-weight: 500;
line-height: 2rem;
letter-spacing: 0.0125em !important;
color: #2c3e50;
}
</style>
</head>

<body>
</head>

<h1 class="title" style="margin: 2em;">
<a href="/" style="color: inherit;text-decoration: inherit;">Short{Paste}</a>
<body>
<h1 class="title" style="margin: 2em">
<a href="/" style="color: inherit; text-decoration: inherit"
>ShortPaste</a
>
</h1>
Click here to download: <a href="{{ .Src }}">"{{ .Name }}"</a> (Size: {{ .Size }})
Click here to download: <a href="{{ .Src }}">"{{ .Name }}"</a> (Size: {{
.Size }})
<br />
{{ if .Image }}
<h3 class="title">Preview</h3>
<img src="{{ .Src }}" style="border: 3px solid black;">
<img src="{{ .Src }}" style="border: 3px solid black" />
{{ end }}
</body>

</html>
</body>
</html>
58 changes: 32 additions & 26 deletions server/public/templates/text.html
Original file line number Diff line number Diff line change
@@ -1,38 +1,44 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Text {{ .ID }}</title>
<link rel="stylesheet" href="//unpkg.com/@highlightjs/[email protected]/styles/default.min.css">
<link
rel="stylesheet"
href="//unpkg.com/@highlightjs/[email protected]/styles/default.min.css"
/>
<script src="//unpkg.com/@highlightjs/[email protected]/highlight.min.js"></script>
<script>hljs.highlightAll();</script>
<script>
hljs.highlightAll();
</script>
<style>
body {
font-family: Roboto, sans-serif !important;
}
body {
font-family: Roboto, sans-serif !important;
}

.title {
font-size: 1.25rem !important;
font-weight: 500;
line-height: 2rem;
letter-spacing: 0.0125em !important;
color: #2c3e50;
}
.title {
font-size: 1.25rem !important;
font-weight: 500;
line-height: 2rem;
letter-spacing: 0.0125em !important;
color: #2c3e50;
}
</style>
</head>
</head>

<body>
<h1 class="title" style="text-align: center; margin: 2em;">
<a href="/" style="color: inherit;text-decoration: inherit;">Short{Paste}</a>
<body>
<h1 class="title" style="text-align: center; margin: 2em">
<a href="/" style="color: inherit; text-decoration: inherit"
>ShortPaste</a
>
</h1>
<h3 class="title" style="text-align: left;">Contents of {{ .ID }}</h3>
Click here to download: <a href="{{ .Src }}">"{{ .Name }}"</a> (Size: {{ .Size }})
<h3 class="title" style="text-align: left">Contents of {{ .ID }}</h3>
Click here to download: <a href="{{ .Src }}">"{{ .Name }}"</a> (Size: {{
.Size }})
<pre>
<code class="{{ .Class }}">{{ .Text }}</code>
</pre>
</body>

</html>
</body>
</html>

0 comments on commit a026b76

Please sign in to comment.