Compare commits
22 commits
9341cb310c
...
aef10ffbe2
Author | SHA1 | Date | |
---|---|---|---|
aef10ffbe2 | |||
498f299889 | |||
42442d63c6 | |||
f02e703943 | |||
4e062482d2 | |||
2442b6aa03 | |||
9d29c55307 | |||
1f378ad416 | |||
770c5a0b13 | |||
c91a228ab4 | |||
dc56b219b5 | |||
52774d95e7 | |||
10ad86d1e9 | |||
dc1524c3d4 | |||
62d56ef860 | |||
07d90bdd3a | |||
|
ef4367ace7 | ||
|
767826f049 | ||
|
44486ba59a | ||
|
c1ce2fed3d | ||
d7b8ffc9f2 | |||
f94fa6cec8 |
28 changed files with 965 additions and 204 deletions
.env.gitignore.goreleaser.yaml
.woodpecker
deployement/goreleaser
docker
front
go.modgo.suminternal
plakken.servicestatic
2
.env
2
.env
|
@ -1,4 +1,4 @@
|
|||
PLAKKEN_LISTEN=:3000
|
||||
PLAKKEN_LISTEN=:5000
|
||||
PLAKKEN_REDIS_ADDRESS=localhost:6379
|
||||
PLAKKEN_REDIS_USER=
|
||||
PLAKKEN_REDIS_PASSWORD=
|
||||
|
|
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -22,3 +22,5 @@ plakken
|
|||
# Go workspace file
|
||||
go.work
|
||||
.idea/discord.xml
|
||||
|
||||
dist/
|
||||
|
|
68
.goreleaser.yaml
Normal file
68
.goreleaser.yaml
Normal file
|
@ -0,0 +1,68 @@
|
|||
gitea_urls:
|
||||
api: https://git.gnous.eu/api/v1
|
||||
download: https://git.gnous.eu
|
||||
skip_tls_verify: false
|
||||
|
||||
before:
|
||||
hooks:
|
||||
# You may remove this if you don't use go modules.
|
||||
- go mod tidy
|
||||
|
||||
builds:
|
||||
-
|
||||
env:
|
||||
- CGO_ENABLED=0
|
||||
goos:
|
||||
- linux
|
||||
- windows
|
||||
- darwin
|
||||
goarch:
|
||||
- amd64
|
||||
- arm
|
||||
- arm64
|
||||
|
||||
archives:
|
||||
- format: tar.gz
|
||||
format_overrides:
|
||||
-
|
||||
goos: windows
|
||||
format: zip
|
||||
|
||||
nfpms:
|
||||
-
|
||||
id: plakken
|
||||
package_name: plakken
|
||||
file_name_template: "{{ .ConventionalFileName }}"
|
||||
vendor: GnousEU
|
||||
homepage: https://git.gnous.eu/plakken/
|
||||
maintainer: GnousEU <contact@gnous.eu>
|
||||
description: A light paste server
|
||||
license: AGPLv3
|
||||
formats:
|
||||
- deb
|
||||
- rpm
|
||||
- archlinux
|
||||
umask: 0o002
|
||||
provides:
|
||||
- plakken
|
||||
suggests:
|
||||
- redis
|
||||
contents:
|
||||
- src: .env
|
||||
dst: /etc/plakken/env
|
||||
- src: plakken.service
|
||||
dst: /usr/lib/systemd/system/plakken.service
|
||||
scripts:
|
||||
preinstall: "deployement/goreleaser/preinstall.sh"
|
||||
preremove: "deployement/goreleaser/preremove.sh"
|
||||
postremove: "deployement/goreleaser/postremove.sh"
|
||||
|
||||
checksum:
|
||||
algorithm: sha256
|
||||
|
||||
changelog:
|
||||
sort: asc
|
||||
filters:
|
||||
exclude:
|
||||
- "^docs:"
|
||||
- "^test:"
|
|
@ -11,22 +11,7 @@ steps:
|
|||
from_secret: docker_username
|
||||
password:
|
||||
from_secret: docker_password
|
||||
debug: true
|
||||
when:
|
||||
branch: ${CI_REPO_DEFAULT_BRANCH}
|
||||
event: push
|
||||
- name: publish_image_tag
|
||||
image: woodpeckerci/plugin-docker-buildx
|
||||
settings:
|
||||
repo: git.gnous.eu/${CI_REPO_OWNER}/plakken
|
||||
dockerfile: docker/Dockerfile
|
||||
platforms: linux/amd64,linux/arm64/v8,linux/arm
|
||||
registry: https://git.gnous.eu
|
||||
tags:
|
||||
- ${CI_COMMIT_TAG##v} # Remove v from tag
|
||||
- stable
|
||||
username:
|
||||
from_secret: docker_username
|
||||
password:
|
||||
from_secret: docker_password
|
||||
when:
|
||||
event: tag
|
||||
|
|
|
@ -1,24 +1,25 @@
|
|||
steps:
|
||||
- name: Build
|
||||
- name: Release
|
||||
image: golang:1.22
|
||||
commands:
|
||||
- go mod download
|
||||
- CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "-w -s" -o plakken-linux-amd64 # Enable static binary, target Linux, remove debug information and strip binary
|
||||
- CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -ldflags "-w -s" -o plakken-linux-arm64
|
||||
- CGO_ENABLED=0 GOOS=linux GOARCH=arm go build -ldflags "-w -s" -o plakken-linux-arm
|
||||
- CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "-w -s" -o plakken-windows-amd64.exe
|
||||
- CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -ldflags "-w -s" -o plakken-windows-arm64.exe
|
||||
- CGO_ENABLED=0 GOOS=linux GOARCH=arm go build -ldflags "-w -s" -o plakken-windows-arm.exe
|
||||
- go install github.com/goreleaser/goreleaser@latest
|
||||
- goreleaser release
|
||||
secrets: [ gitea_token ]
|
||||
when:
|
||||
event: tag
|
||||
- name: Release
|
||||
image: woodpeckerci/plugin-gitea-release
|
||||
- name: publish_image_tag
|
||||
image: woodpeckerci/plugin-docker-buildx
|
||||
settings:
|
||||
base_url: https://git.gnous.eu
|
||||
files:
|
||||
- "plakken*"
|
||||
api_key:
|
||||
from_secret: release_token
|
||||
target: main
|
||||
repo: git.gnous.eu/${CI_REPO_OWNER}/plakken
|
||||
dockerfile: docker/Dockerfile
|
||||
platforms: linux/amd64,linux/arm64/v8,linux/arm
|
||||
registry: https://git.gnous.eu
|
||||
tags:
|
||||
- ${CI_COMMIT_TAG##v} # Remove v from tag
|
||||
- stable
|
||||
username:
|
||||
from_secret: docker_username
|
||||
password:
|
||||
from_secret: docker_password
|
||||
when:
|
||||
event: tag
|
1
deployement/goreleaser/postremove.sh
Normal file
1
deployement/goreleaser/postremove.sh
Normal file
|
@ -0,0 +1 @@
|
|||
userdel -r plakken
|
8
deployement/goreleaser/preinstall.sh
Normal file
8
deployement/goreleaser/preinstall.sh
Normal file
|
@ -0,0 +1,8 @@
|
|||
if ! getent passwd plakken > /dev/null; then
|
||||
useradd -r -d /var/lib/plakken -s /sbin/nologin -U plakken
|
||||
fi
|
||||
if ! test -d /var/lib/plakken; then
|
||||
mkdir -p /var/lib/plakken
|
||||
chmod 0750 /var/lib/plakken
|
||||
chown -R plakken:plakken /var/lib/plakken
|
||||
fi
|
1
deployement/goreleaser/preremove.sh
Normal file
1
deployement/goreleaser/preremove.sh
Normal file
|
@ -0,0 +1 @@
|
|||
systemctl stop plakken
|
|
@ -20,7 +20,6 @@ services:
|
|||
- "3000:3000"
|
||||
environment:
|
||||
- PLAKKEN_REDIS_ADDRESS=redis:6379
|
||||
- POSTGRES_PASSWORD=gitea
|
||||
- PLAKKEN_REDIS_DB=0
|
||||
- PLAKKEN_URL_LENGTH=5
|
||||
depends_on:
|
||||
|
|
5
front/_colors.scss
Normal file
5
front/_colors.scss
Normal file
|
@ -0,0 +1,5 @@
|
|||
$accent: #d30f45;
|
||||
$background: #0f0f0f;
|
||||
$border: #363636;
|
||||
$text: #e5e5e7;
|
||||
$placeholder: #888;
|
0
front/_inputs.scss
Normal file
0
front/_inputs.scss
Normal file
23
front/_misc.scss
Normal file
23
front/_misc.scss
Normal file
|
@ -0,0 +1,23 @@
|
|||
@use 'colors' as *;
|
||||
|
||||
::selection {
|
||||
background-color: $accent;
|
||||
color: $text;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar {
|
||||
width: 9px;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-track {
|
||||
background-color: $background;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb {
|
||||
background-color: #444;
|
||||
border-radius: 9px;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb:hover {
|
||||
background-color: $text;
|
||||
}
|
65
front/_recents.scss
Normal file
65
front/_recents.scss
Normal file
|
@ -0,0 +1,65 @@
|
|||
@use 'colors' as *;
|
||||
|
||||
section#recent-plaks {
|
||||
bottom: 1rem;
|
||||
display: flex;
|
||||
flex-flow: column wrap;
|
||||
gap: 9px;
|
||||
position: absolute;
|
||||
right: 1rem;
|
||||
transition: .15s ease-in-out;
|
||||
user-select: none;
|
||||
|
||||
.title {
|
||||
align-items: center;
|
||||
gap: 18px;
|
||||
transition: .15s ease-in-out;
|
||||
|
||||
&:hover {
|
||||
border-color: #555;
|
||||
}
|
||||
}
|
||||
|
||||
.recent-plak {
|
||||
align-items: center;
|
||||
border: 3px solid $border;
|
||||
font-weight: 500;
|
||||
justify-content: space-between;
|
||||
outline: none;
|
||||
padding: 8px 18px;
|
||||
text-decoration: none;
|
||||
transition: .15s ease-in-out;
|
||||
width: 12rem;
|
||||
|
||||
&:focus-visible {
|
||||
border: 2px solid #bbb;
|
||||
}
|
||||
|
||||
svg {
|
||||
border-radius: 15px;
|
||||
cursor: pointer;
|
||||
height: 22px;
|
||||
padding: 5px;
|
||||
stroke: $text;
|
||||
stroke-width: 2.25;
|
||||
width: 22px;
|
||||
transition: .1s ease-in-out;
|
||||
|
||||
&:hover {
|
||||
background-color: $border;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
a {
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
}
|
||||
}
|
||||
|
||||
h3 {
|
||||
font-size: 1.5rem;
|
||||
margin: 0;
|
||||
transition: .15s ease-in-out;
|
||||
width: fit-content;
|
||||
}
|
60
front/index.html
Normal file
60
front/index.html
Normal file
|
@ -0,0 +1,60 @@
|
|||
<!doctype html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta content="Plakken, paste, pastebin" name="keywords">
|
||||
<meta content="Plakken is a simple open-source paste service where you can store text for a set period of time."
|
||||
name="description">
|
||||
<meta content="Gnous EU" name="author">
|
||||
<meta content="width=device-width, initial-scale=1.0" name="viewport">
|
||||
<link href="/static/favicon.svg" rel="icon">
|
||||
<title>New paste</title>
|
||||
<link href="style.css" rel="stylesheet">
|
||||
<script async src="../static/app.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<form action="/create/" class="fr" method="post">
|
||||
<div id="line-numbers">1</div>
|
||||
<label for="content"><textarea autofocus id="content" name="content"
|
||||
placeholder="Type your paste here"></textarea></label>
|
||||
|
||||
<div class="menu fr">
|
||||
<label for="filename"><input id="filename" name="filename" placeholder="Filename" type="text"></label>
|
||||
<!--<label for="password"><input id="password" placeholder="Password" type="password"></label>-->
|
||||
<label for="exp"><input id="exp" name="exp" placeholder="Expiration (1d1h1m1s)" type="text"></label>
|
||||
<label for="type">
|
||||
<select id="type" name="type">zz
|
||||
<option value="c">C/C++</option>
|
||||
<option value="csharp">C#</option>
|
||||
<option value="css">CSS</option>
|
||||
<option value="go">Go</option>
|
||||
<option value="java">Java</option>
|
||||
<option value="js">Javascript</option>
|
||||
<option value="html">HTML</option>
|
||||
<option selected value="pt">Plaintext</option>
|
||||
<option value="py">Python</option>
|
||||
<option value="rb">Ruby</option>
|
||||
<option value="rs">Rust</option>
|
||||
<option value="sh">Shell</option>
|
||||
<option value="sql">SQL</option>
|
||||
<option value="ts">Typescript</option>
|
||||
<option value="xml">XML</option>
|
||||
<option value="yml">YAML</option>
|
||||
</select>
|
||||
</label>
|
||||
<button title="Save plak" type="submit">Save</button>
|
||||
</div>
|
||||
</form>
|
||||
<section id="recent-plaks">
|
||||
<div class="title fr">
|
||||
<h3>Recent plaks</h3>
|
||||
<svg height="32" stroke="currentColor" stroke-width="2.5" viewBox="0 0 24 24" width="32">
|
||||
<polyline points="6 9 12 15 18 9"></polyline>
|
||||
</svg>
|
||||
</div>
|
||||
</section>
|
||||
</body>
|
||||
|
||||
</html>
|
202
front/style.css
Normal file
202
front/style.css
Normal file
|
@ -0,0 +1,202 @@
|
|||
section#recent-plaks {
|
||||
bottom: 1rem;
|
||||
display: flex;
|
||||
flex-flow: column wrap;
|
||||
gap: 9px;
|
||||
position: absolute;
|
||||
right: 1rem;
|
||||
transition: 0.15s ease-in-out;
|
||||
user-select: none;
|
||||
}
|
||||
section#recent-plaks .title {
|
||||
align-items: center;
|
||||
gap: 18px;
|
||||
transition: 0.15s ease-in-out;
|
||||
}
|
||||
section#recent-plaks .title:hover {
|
||||
border-color: #555;
|
||||
}
|
||||
section#recent-plaks .recent-plak {
|
||||
align-items: center;
|
||||
border: 3px solid #363636;
|
||||
font-weight: 500;
|
||||
justify-content: space-between;
|
||||
outline: none;
|
||||
padding: 8px 18px;
|
||||
text-decoration: none;
|
||||
transition: 0.15s ease-in-out;
|
||||
width: 12rem;
|
||||
}
|
||||
section#recent-plaks .recent-plak:focus-visible {
|
||||
border: 2px solid #bbb;
|
||||
}
|
||||
section#recent-plaks .recent-plak svg {
|
||||
border-radius: 15px;
|
||||
cursor: pointer;
|
||||
height: 22px;
|
||||
padding: 5px;
|
||||
stroke: #e5e5e7;
|
||||
stroke-width: 2.25;
|
||||
width: 22px;
|
||||
transition: 0.1s ease-in-out;
|
||||
}
|
||||
section#recent-plaks .recent-plak svg:hover {
|
||||
background-color: #363636;
|
||||
}
|
||||
section#recent-plaks a {
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
h3 {
|
||||
font-size: 1.5rem;
|
||||
margin: 0;
|
||||
transition: 0.15s ease-in-out;
|
||||
width: fit-content;
|
||||
}
|
||||
|
||||
::selection {
|
||||
background-color: #d30f45;
|
||||
color: #e5e5e7;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar {
|
||||
width: 9px;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-track {
|
||||
background-color: #0f0f0f;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb {
|
||||
background-color: #444;
|
||||
border-radius: 9px;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb:hover {
|
||||
background-color: #e5e5e7;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: "Inter";
|
||||
font-style: normal;
|
||||
font-weight: 400 700;
|
||||
font-display: swap;
|
||||
src: url(inter.woff2) format("woff2");
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
||||
}
|
||||
@font-face {
|
||||
font-family: "JetBrains Mono";
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
font-display: swap;
|
||||
src: url(jetbrainsmono.woff2) format("woff2");
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
||||
}
|
||||
body {
|
||||
background-color: #0f0f0f;
|
||||
color: #e5e5e7;
|
||||
font: 400 16px/2 "Inter", "system-ui", sans-serif;
|
||||
margin: 0;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
.fr {
|
||||
display: flex;
|
||||
flex-flow: row wrap;
|
||||
}
|
||||
|
||||
#line-numbers,
|
||||
#content {
|
||||
font: 400 14px/1.6 "JetBrains Mono", monospace;
|
||||
}
|
||||
|
||||
#line-numbers {
|
||||
color: #888;
|
||||
padding: 16px 1px;
|
||||
text-align: center;
|
||||
white-space: pre;
|
||||
width: 30px;
|
||||
}
|
||||
|
||||
#content {
|
||||
color: #e5e5e7;
|
||||
height: 100%;
|
||||
min-height: 90vh;
|
||||
padding: 16px 16px 0 16px;
|
||||
width: calc(100vw - 65px);
|
||||
}
|
||||
|
||||
.menu {
|
||||
gap: 18px;
|
||||
position: fixed;
|
||||
right: 16px;
|
||||
top: 16px;
|
||||
}
|
||||
.menu svg {
|
||||
cursor: pointer;
|
||||
height: 24px;
|
||||
fill: none;
|
||||
margin-bottom: -6px;
|
||||
stroke: #e5e5e7;
|
||||
stroke-width: 2;
|
||||
width: 24px;
|
||||
}
|
||||
|
||||
button,
|
||||
input,
|
||||
select {
|
||||
background-color: #0f0f0f;
|
||||
border: 2px solid #363636;
|
||||
color: #e5e5e7;
|
||||
font: 500 14px/2 "Inter", "system-ui", sans-serif;
|
||||
max-width: 145px;
|
||||
outline: none;
|
||||
padding: 3px 10px;
|
||||
transition: border 0.15s ease;
|
||||
width: min-content;
|
||||
}
|
||||
button::placeholder,
|
||||
input::placeholder,
|
||||
select::placeholder {
|
||||
color: #888;
|
||||
}
|
||||
button:hover,
|
||||
input:hover,
|
||||
select:hover {
|
||||
border-color: #777;
|
||||
}
|
||||
button:focus-visible,
|
||||
input:focus-visible,
|
||||
select:focus-visible {
|
||||
border: 2px solid #bbb;
|
||||
}
|
||||
|
||||
select {
|
||||
padding: 8px 10px;
|
||||
width: fit-content;
|
||||
}
|
||||
|
||||
select:focus {
|
||||
background-color: #0f0f0f;
|
||||
transition: none;
|
||||
}
|
||||
|
||||
option {
|
||||
background-color: #0f0f0f;
|
||||
color: #e5e5e7;
|
||||
}
|
||||
option:focus {
|
||||
background-color: #d30f45;
|
||||
color: #0f0f0f;
|
||||
}
|
||||
|
||||
textarea {
|
||||
background-color: inherit;
|
||||
border: none;
|
||||
margin: 0;
|
||||
outline: none;
|
||||
resize: none;
|
||||
}
|
||||
|
||||
/*# sourceMappingURL=style.css.map */
|
130
front/style.scss
Normal file
130
front/style.scss
Normal file
|
@ -0,0 +1,130 @@
|
|||
@use 'colors' as *;
|
||||
|
||||
@use 'inputs';
|
||||
@use 'recents';
|
||||
@use 'misc';
|
||||
|
||||
@font-face {
|
||||
font-family: 'Inter';
|
||||
font-style: normal;
|
||||
font-weight: 400 700;
|
||||
font-display: swap;
|
||||
src: url(inter.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'JetBrains Mono';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
font-display: swap;
|
||||
src: url(jetbrainsmono.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
||||
}
|
||||
|
||||
|
||||
body {
|
||||
background-color: $background;
|
||||
color: $text;
|
||||
font: 400 16px/2 "Inter", "system-ui", sans-serif;
|
||||
margin: 0;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
.fr {
|
||||
display: flex;
|
||||
flex-flow: row wrap;
|
||||
}
|
||||
|
||||
#line-numbers,
|
||||
#content {
|
||||
font: 400 14px/1.6 "JetBrains Mono", monospace;
|
||||
}
|
||||
|
||||
#line-numbers {
|
||||
color: $placeholder;
|
||||
padding: 16px 1px;
|
||||
text-align: center;
|
||||
white-space: pre;
|
||||
width: 30px;
|
||||
}
|
||||
|
||||
#content {
|
||||
color: $text;
|
||||
height: 100%;
|
||||
min-height: 90vh;
|
||||
padding: 16px 16px 0 16px;
|
||||
width: calc(100vw - 65px);
|
||||
}
|
||||
|
||||
.menu {
|
||||
gap: 18px;
|
||||
position: fixed;
|
||||
right: 16px;
|
||||
top: 16px;
|
||||
|
||||
svg {
|
||||
cursor: pointer;
|
||||
height: 24px;
|
||||
fill: none;
|
||||
margin-bottom: -6px;
|
||||
stroke: $text;
|
||||
stroke-width: 2;
|
||||
width: 24px;
|
||||
}
|
||||
}
|
||||
|
||||
button,
|
||||
input,
|
||||
select {
|
||||
background-color: $background;
|
||||
border: 2px solid $border;
|
||||
color: $text;
|
||||
font: 500 14px/2 "Inter", "system-ui", sans-serif;
|
||||
max-width: 145px;
|
||||
outline: none;
|
||||
padding: 3px 10px;
|
||||
transition: border .15s ease;
|
||||
width: min-content;
|
||||
|
||||
|
||||
&::placeholder {
|
||||
color: $placeholder;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
border-color: #777;
|
||||
}
|
||||
|
||||
&:focus-visible {
|
||||
border: 2px solid #bbb;
|
||||
}
|
||||
}
|
||||
|
||||
select {
|
||||
padding: 8px 10px;
|
||||
width: fit-content;
|
||||
}
|
||||
|
||||
select:focus {
|
||||
background-color: $background;
|
||||
transition: none;
|
||||
}
|
||||
|
||||
option {
|
||||
background-color: $background;
|
||||
color: $text;
|
||||
|
||||
&:focus {
|
||||
background-color: $accent;
|
||||
color: $background;
|
||||
}
|
||||
}
|
||||
|
||||
textarea {
|
||||
background-color: inherit;
|
||||
border: none;
|
||||
margin: 0;
|
||||
outline: none;
|
||||
resize: none;
|
||||
}
|
1
go.mod
1
go.mod
|
@ -3,6 +3,7 @@ module git.gnous.eu/gnouseu/plakken
|
|||
go 1.22
|
||||
|
||||
require (
|
||||
github.com/joho/godotenv v1.5.1
|
||||
github.com/redis/go-redis/v9 v9.5.1
|
||||
golang.org/x/crypto v0.22.0
|
||||
)
|
||||
|
|
2
go.sum
2
go.sum
|
@ -6,6 +6,8 @@ github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UF
|
|||
github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
|
||||
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78=
|
||||
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc=
|
||||
github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0=
|
||||
github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4=
|
||||
github.com/redis/go-redis/v9 v9.5.1 h1:H1X4D3yHPaYrkL5X06Wh6xNVM/pX0Ft4RV0vMGvLBh8=
|
||||
github.com/redis/go-redis/v9 v9.5.1/go.mod h1:hdY0cQFCN4fnSYT6TkisLufl/4W5UIXyv0b/CLO2V2M=
|
||||
golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30=
|
||||
|
|
|
@ -6,6 +6,8 @@ import (
|
|||
"strconv"
|
||||
|
||||
"git.gnous.eu/gnouseu/plakken/internal/constant"
|
||||
"git.gnous.eu/gnouseu/plakken/internal/utils"
|
||||
"github.com/joho/godotenv"
|
||||
)
|
||||
|
||||
// InitConfig Structure for program initialisation.
|
||||
|
@ -20,6 +22,13 @@ type InitConfig struct {
|
|||
|
||||
// GetConfig Initialise configuration form .env.
|
||||
func GetConfig() InitConfig {
|
||||
if utils.FileExist(".env") {
|
||||
err := godotenv.Load()
|
||||
if err != nil {
|
||||
log.Fatalf("Error loading .env file: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
listenAddress := os.Getenv("PLAKKEN_LISTEN")
|
||||
redisAddress := os.Getenv("PLAKKEN_REDIS_ADDRESS")
|
||||
db := os.Getenv("PLAKKEN_REDIS_DB")
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
package utils
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"log"
|
||||
mathrand "math/rand/v2"
|
||||
"os"
|
||||
"regexp"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
@ -106,3 +108,10 @@ func ValidKey(key string) bool {
|
|||
|
||||
return result
|
||||
}
|
||||
|
||||
// FileExist verify if a file exist.
|
||||
func FileExist(path string) bool {
|
||||
_, err := os.Stat(path)
|
||||
|
||||
return !errors.Is(err, os.ErrNotExist)
|
||||
}
|
||||
|
|
54
plakken.service
Normal file
54
plakken.service
Normal file
|
@ -0,0 +1,54 @@
|
|||
# /usr/lib/systemd/system/plakken.service
|
||||
[Unit]
|
||||
Description=A paste server
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=plakken
|
||||
|
||||
ExecStart=/usr/bin/plakken
|
||||
|
||||
|
||||
EnvironmentFile=/etc/plakken/env
|
||||
|
||||
ProtectSystem=strict
|
||||
ProtectHome=true
|
||||
NoNewPrivileges=yes
|
||||
RestrictNamespaces=true
|
||||
PrivateTmp=true
|
||||
PrivateDevices=true
|
||||
PrivateUsers=true
|
||||
ProtectClock=true
|
||||
ProtectControlGroups=true
|
||||
ProtectKernelTunables=true
|
||||
ProtectKernelLogs=true
|
||||
ProtectKernelModules=true
|
||||
LockPersonality=true
|
||||
RestrictSUIDSGID=true
|
||||
RemoveIPC=true
|
||||
RestrictRealtime=true
|
||||
SystemCallArchitectures=native
|
||||
MemoryDenyWriteExecute=true
|
||||
UMask=177
|
||||
ProtectProc=invisible
|
||||
CapabilityBoundingSet=
|
||||
ProtectHostname=true
|
||||
RestrictAddressFamilies=~AF_(INET|INET6)
|
||||
RestrictAddressFamilies=~…
|
||||
RestrictAddressFamilies=~AF_UNIX
|
||||
RestrictAddressFamilies=~AF_NETLINK
|
||||
RestrictAddressFamilies=~AF_PACKET
|
||||
SystemCallFilter=~@reboot
|
||||
SystemCallFilter=~@obsolete
|
||||
SystemCallFilter=~@mount
|
||||
SystemCallFilter=~@module
|
||||
SystemCallFilter=~@debug
|
||||
SystemCallFilter=~@cpu-emulation
|
||||
SystemCallFilter=~@clock
|
||||
SystemCallFilter=~@swap
|
||||
SystemCallFilter=~@privileged
|
||||
ProcSubset=pid
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
|
@ -1,31 +1,71 @@
|
|||
const codeEditor = document.getElementById('content');
|
||||
const lineCounter = document.getElementById('lines');
|
||||
const editor = document.getElementById('content');
|
||||
const filenameSelector = document.getElementById('filename');
|
||||
const recentPlaksDiv = document.getElementById('recent-plaks');
|
||||
const lineNumbersDiv = document.getElementById('line-numbers');
|
||||
|
||||
let lineCountCache = 0;
|
||||
function updateLn() {
|
||||
const lines = editor.value.split('\n').length;
|
||||
const lineNumbers = Array.from({ length: lines }, (_, i) => i + 1).join('\n');
|
||||
|
||||
// Update line counter
|
||||
function updateLineCounter() {
|
||||
const lineCount = codeEditor.value.split('\n').length;
|
||||
|
||||
if (lineCountCache !== lineCount) {
|
||||
const outarr = Array.from({length: lineCount}, (_, index) => index + 1);
|
||||
lineCounter.value = outarr.join('\n');
|
||||
}
|
||||
|
||||
lineCountCache = lineCount;
|
||||
lineNumbersDiv.textContent = lineNumbers;
|
||||
}
|
||||
|
||||
codeEditor.addEventListener('input', updateLineCounter);
|
||||
function updateTitle() {
|
||||
document.title = filenameSelector.value == '' ? 'New paste' : ` ${filenameSelector.value} (Unsaved) - Plakken`;
|
||||
}
|
||||
|
||||
codeEditor.addEventListener('keydown', (e) => {
|
||||
if (e.key === 'Tab') {
|
||||
e.preventDefault();
|
||||
function getRecentPlaksFromStorage() {
|
||||
return new Set(JSON.parse(localStorage.getItem('recentPlaks')) || []);
|
||||
}
|
||||
|
||||
const {value, selectionStart, selectionEnd} = codeEditor;
|
||||
codeEditor.value = `${value.slice(0, selectionStart)}\t${value.slice(selectionEnd)}`;
|
||||
codeEditor.setSelectionRange(selectionStart + 1, selectionStart + 1);
|
||||
updateLineCounter();
|
||||
}
|
||||
});
|
||||
function updateLocalStorage() {
|
||||
localStorage.setItem('recentPlaks', JSON.stringify(Array.from(recentPlaks)));
|
||||
}
|
||||
|
||||
updateLineCounter();
|
||||
function addRecentPlak(plakId) {
|
||||
recentPlaks.add(plakId);
|
||||
updateLocalStorage();
|
||||
}
|
||||
|
||||
function deleteRecentPlak(plakId) {
|
||||
const plak = document.querySelector(`[href="/${plakId}/"]`).parentElement;
|
||||
|
||||
plak.style.transform = 'translateX(150%)';
|
||||
setTimeout(() => plak.remove(), 250);
|
||||
|
||||
recentPlaks.delete(plakId);
|
||||
updateLocalStorage();
|
||||
}
|
||||
|
||||
function createRecentPlakComponent(plak) {
|
||||
const div = document.createElement('div');
|
||||
div.classList.add('recent-plak', 'fr');
|
||||
|
||||
const a = document.createElement('a');
|
||||
a.href = `/${plak}/`;
|
||||
a.textContent = plak;
|
||||
|
||||
const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
|
||||
svg.innerHTML = `<line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line>`;
|
||||
svg.id = 'cross';
|
||||
svg.setAttribute('viewBox', '0 0 24 24');
|
||||
svg.onclick = () => deleteRecentPlak(plak);
|
||||
|
||||
div.appendChild(a);
|
||||
div.appendChild(svg);
|
||||
|
||||
return div;
|
||||
}
|
||||
|
||||
filenameSelector.addEventListener('input', updateTitle);
|
||||
editor.addEventListener('input', updateLn);
|
||||
|
||||
let recentPlaks = getRecentPlaksFromStorage();
|
||||
|
||||
if (recentPlaks === null) {
|
||||
recentPlaks = [];
|
||||
localStorage.setItem('recentPlaks', JSON.stringify(recentPlaks));
|
||||
} else {
|
||||
for (const plak of recentPlaks)
|
||||
recentPlaksDiv.appendChild(createRecentPlakComponent(plak));
|
||||
}
|
||||
|
|
BIN
static/favicon.ico
Normal file
BIN
static/favicon.ico
Normal file
Binary file not shown.
After Width: 32px | Height: 32px | Size: 4.2 KiB |
1
static/favicon.svg
Normal file
1
static/favicon.svg
Normal file
|
@ -0,0 +1 @@
|
|||
<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg"><path class="b" d="m777.387 609.18c-5.427 2.039-9.716 6.229-11.803 11.531l-80.287 203.948c-6.755 17.159-31.604 17.16-38.359 0l-80.287-203.948c-2.087-5.302-6.376-9.492-11.803-11.531l-208.746-78.442c-17.564-6.599-17.564-30.877 0-37.476l208.746-78.442c5.427-2.039 9.716-6.229 11.803-11.531l80.287-203.948c6.755-17.159 31.604-17.159 38.359 0l80.287 203.948c2.087 5.302 6.376 9.492 11.803 11.531l208.747 78.442c17.566 6.599 17.566 30.877 0 37.477z"/><g class="s"><path d="m192.121 342.82c-6.756 17.16-31.604 17.16-38.359 0l-28.915-73.449c-2.087-5.302-6.376-9.492-11.803-11.532l-75.1777-28.25c-17.5631-6.599-17.5631-30.877 0-37.477l75.1777-28.249c5.427-2.04 9.716-6.23 11.803-11.532l28.915-73.4498c6.755-17.1594 31.603-17.1593 38.359.0001l28.914 73.4497c2.087 5.302 6.376 9.492 11.803 11.532l75.178 28.249c17.563 6.6 17.563 30.878 0 37.477l-75.178 28.25c-5.427 2.04-9.716 6.23-11.803 11.532z"/><path d="m356.132 860.138c-5.427 2.039-9.715 6.229-11.803 11.531l-28.914 73.45c-6.755 17.159-31.604 17.159-38.359 0l-28.915-73.45c-2.087-5.302-6.376-9.492-11.802-11.531l-75.179-28.25c-17.563-6.6-17.563-30.877 0-37.477l75.179-28.25c5.426-2.039 9.715-6.229 11.802-11.531l28.915-73.45c6.755-17.16 31.604-17.16 38.359 0l28.914 73.45c2.088 5.302 6.376 9.492 11.803 11.531l75.178 28.25c17.563 6.6 17.563 30.877 0 37.477z"/></g><style xmlns="http://www.w3.org/2000/svg">.b{fill:#ff9500}.s{fill:#ffBf00}@media(prefers-color-scheme:dark){.b{fill:#ffbf00}.s{fill:#ff9500}}</style></svg>
|
After (image error) Size: 1.5 KiB |
|
@ -1,67 +1,60 @@
|
|||
<!doctype html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta content="Plakken, paste, pastebin" name="keywords">
|
||||
<meta content="Plakken is a simple open-source paste service where you can store store text for a set period of time."
|
||||
<meta content="Plakken is a simple open-source paste service where you can store text for a set period of time."
|
||||
name="description">
|
||||
<meta content="Plakken" name="author">
|
||||
<meta content="Gnous EU" name="author">
|
||||
<meta content="width=device-width, initial-scale=1.0" name="viewport">
|
||||
<title>New plak • Plakken</title><script async src="/static/app.js"></script>
|
||||
<link href="/static/favicon.svg" rel="icon">
|
||||
<title>New paste</title>
|
||||
<link href="/static/style.css" rel="stylesheet">
|
||||
<script async src="/static/app.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<form action="/create/" method="post">
|
||||
<div>
|
||||
<label for="lines"></label>
|
||||
<textarea id="lines" readonly wrap="hard">1</textarea>
|
||||
</div>
|
||||
<div>
|
||||
<label for="content"></label>
|
||||
<textarea autofocus id="content" name="content" placeholder="Type your paste here"></textarea>
|
||||
<nav>
|
||||
<ul>
|
||||
<li>
|
||||
<label for="password">
|
||||
<input id="password" placeholder="Password" type="text">
|
||||
</label>
|
||||
</li>
|
||||
<li>
|
||||
<label for="exp">
|
||||
<input id="exp" name="exp" placeholder="Expiration (1d1h1m1s)" type="text">
|
||||
</label>
|
||||
</li>
|
||||
<li>
|
||||
<label for="type">
|
||||
<select id="type" name="type">
|
||||
<option value="c">C</option>
|
||||
<option value="cpp">C++</option>
|
||||
<option value="csharp">C#</option>
|
||||
<option value="css">CSS</option>
|
||||
<option value="go">Go</option>
|
||||
<option value="java">Java</option>
|
||||
<option value="js">Javascript</option>
|
||||
<option value="html">HTML</option>
|
||||
<option selected value="plain">Plaintext</option>
|
||||
<option value="python">Python</option>
|
||||
<option value="rb">Ruby</option>
|
||||
<option value="rs">Rust</option>
|
||||
<option value="sh">Shell</option>
|
||||
<option value="sql">SQL</option>
|
||||
<option value="ts">Typescript</option>
|
||||
<option value="xml">XML</option>
|
||||
<option value="yml">YAML</option>
|
||||
</select>
|
||||
</label>
|
||||
</li>
|
||||
</ul>
|
||||
<button title="Save plak" type="submit">
|
||||
<svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425z"></path>
|
||||
</svg>
|
||||
</button>
|
||||
</nav>
|
||||
<form action="/create/" class="fr" method="post">
|
||||
<div id="line-numbers">1</div>
|
||||
<label for="content"><textarea autofocus id="content" name="content"
|
||||
placeholder="Type your paste here"></textarea></label>
|
||||
|
||||
<div class="menu fr">
|
||||
<label for="filename"><input id="filename" name="filename" placeholder="Filename" type="text"></label>
|
||||
<!--<label for="password"><input id="password" placeholder="Password" type="password"></label>-->
|
||||
<label for="exp"><input id="exp" name="exp" placeholder="Expiration (1d1h1m1s)" type="text"></label>
|
||||
<label for="type">
|
||||
<select id="type" name="type">zz
|
||||
<option value="c">C/C++</option>
|
||||
<option value="csharp">C#</option>
|
||||
<option value="css">CSS</option>
|
||||
<option value="go">Go</option>
|
||||
<option value="java">Java</option>
|
||||
<option value="js">Javascript</option>
|
||||
<option value="html">HTML</option>
|
||||
<option selected value="pt">Plaintext</option>
|
||||
<option value="py">Python</option>
|
||||
<option value="rb">Ruby</option>
|
||||
<option value="rs">Rust</option>
|
||||
<option value="sh">Shell</option>
|
||||
<option value="sql">SQL</option>
|
||||
<option value="ts">Typescript</option>
|
||||
<option value="xml">XML</option>
|
||||
<option value="yml">YAML</option>
|
||||
</select>
|
||||
</label>
|
||||
<button title="Save plak" type="submit">Save</button>
|
||||
</div>
|
||||
</form>
|
||||
<section id="recent-plaks">
|
||||
<div class="title fr">
|
||||
<h3>Recent plaks</h3>
|
||||
<svg height="32" stroke="currentColor" stroke-width="2.5" viewBox="0 0 24 24" width="32">
|
||||
<polyline points="6 9 12 15 18 9"></polyline>
|
||||
</svg>
|
||||
</div>
|
||||
</section>
|
||||
</body>
|
||||
|
||||
</html>
|
BIN
static/inter.woff2
Normal file
BIN
static/inter.woff2
Normal file
Binary file not shown.
BIN
static/jetbrainsmono.woff2
Normal file
BIN
static/jetbrainsmono.woff2
Normal file
Binary file not shown.
288
static/style.css
288
static/style.css
|
@ -1,98 +1,200 @@
|
|||
:root {
|
||||
--accent: #be0560;
|
||||
--background: #121212;
|
||||
--border: #333;
|
||||
--text: #e6e6e6;
|
||||
--placeholder: #666;
|
||||
section#recent-plaks {
|
||||
bottom: 1rem;
|
||||
display: flex;
|
||||
flex-flow: column wrap;
|
||||
gap: 9px;
|
||||
position: absolute;
|
||||
right: 1rem;
|
||||
transition: 0.15s ease-in-out;
|
||||
user-select: none;
|
||||
}
|
||||
section#recent-plaks .title {
|
||||
align-items: center;
|
||||
gap: 18px;
|
||||
transition: 0.15s ease-in-out;
|
||||
}
|
||||
section#recent-plaks .title:hover {
|
||||
border-color: #555;
|
||||
}
|
||||
section#recent-plaks .recent-plak {
|
||||
align-items: center;
|
||||
border: 3px solid #363636;
|
||||
font-weight: 500;
|
||||
justify-content: space-between;
|
||||
outline: none;
|
||||
padding: 8px 18px;
|
||||
text-decoration: none;
|
||||
transition: 0.15s ease-in-out;
|
||||
width: 12rem;
|
||||
}
|
||||
section#recent-plaks .recent-plak:focus-visible {
|
||||
border: 2px solid #bbb;
|
||||
}
|
||||
section#recent-plaks .recent-plak svg {
|
||||
border-radius: 15px;
|
||||
cursor: pointer;
|
||||
height: 22px;
|
||||
padding: 5px;
|
||||
stroke: #e5e5e7;
|
||||
stroke-width: 2.25;
|
||||
width: 22px;
|
||||
transition: 0.1s ease-in-out;
|
||||
}
|
||||
section#recent-plaks .recent-plak svg:hover {
|
||||
background-color: #363636;
|
||||
}
|
||||
section#recent-plaks a {
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
body {
|
||||
background-color: var(--background);
|
||||
color: var(--text);
|
||||
font: 400 15px/2 "system-ui", monospace;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
form {
|
||||
display: flex;
|
||||
flex-flow: row wrap;
|
||||
}
|
||||
|
||||
#lines {
|
||||
color: var(--placeholder);
|
||||
font: 400 14px/1.6 "JetBrains Mono", monospace;
|
||||
height: calc(100vh - 29px);
|
||||
overflow-y: hidden;
|
||||
padding: 8px 0;
|
||||
text-align: center;
|
||||
user-select: none;
|
||||
width: 26px;
|
||||
}
|
||||
|
||||
input, select {
|
||||
background-color: var(--background);
|
||||
border: 2px solid var(--border);
|
||||
border-radius: 2px;
|
||||
color: var(--text);
|
||||
font-size: 13px;
|
||||
outline: none;
|
||||
padding: 6px 8px;
|
||||
transition: border .15s ease;
|
||||
}
|
||||
|
||||
input:hover, select:hover {
|
||||
border-color: var(--text);
|
||||
}
|
||||
|
||||
button, textarea {
|
||||
background-color: inherit;
|
||||
border: none;
|
||||
outline: none;
|
||||
resize: none;
|
||||
}
|
||||
|
||||
#content {
|
||||
color: var(--text);
|
||||
font: 400 14px/1.6 "JetBrains Mono", monospace;
|
||||
height: calc(100vh - 29px);
|
||||
padding: 8px;
|
||||
width: calc(100vw - 45px);
|
||||
}
|
||||
|
||||
nav {
|
||||
top: 1rem;
|
||||
display: flex;
|
||||
flex-flow: row wrap;
|
||||
position: absolute;
|
||||
right: 12px;
|
||||
}
|
||||
|
||||
ul {
|
||||
display: flex;
|
||||
flex-flow: row wrap;
|
||||
gap: 36px;
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 0 1.9rem;
|
||||
}
|
||||
|
||||
svg {
|
||||
cursor: pointer;
|
||||
height: 24px;
|
||||
fill: var(--text);
|
||||
transition: .15s ease;
|
||||
width: 24px;
|
||||
}
|
||||
|
||||
svg:hover {
|
||||
stroke: #fff;
|
||||
}
|
||||
|
||||
input:focus-visible, select:focus-visible {
|
||||
border: 2px solid var(--text);
|
||||
h3 {
|
||||
font-size: 1.5rem;
|
||||
margin: 0;
|
||||
transition: 0.15s ease-in-out;
|
||||
width: fit-content;
|
||||
}
|
||||
|
||||
::selection {
|
||||
background-color: var(--accent);
|
||||
color: #fff;
|
||||
}
|
||||
background-color: #d30f45;
|
||||
color: #e5e5e7;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar {
|
||||
width: 9px;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-track {
|
||||
background-color: #0f0f0f;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb {
|
||||
background-color: #444;
|
||||
border-radius: 9px;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb:hover {
|
||||
background-color: #e5e5e7;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: "Inter";
|
||||
font-style: normal;
|
||||
font-weight: 400 700;
|
||||
font-display: swap;
|
||||
src: url(inter.woff2) format("woff2");
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
||||
}
|
||||
@font-face {
|
||||
font-family: "JetBrains Mono";
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
font-display: swap;
|
||||
src: url(jetbrainsmono.woff2) format("woff2");
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
||||
}
|
||||
body {
|
||||
background-color: #0f0f0f;
|
||||
color: #e5e5e7;
|
||||
font: 400 16px/2 "Inter", "system-ui", sans-serif;
|
||||
margin: 0;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
.fr {
|
||||
display: flex;
|
||||
flex-flow: row wrap;
|
||||
}
|
||||
|
||||
#line-numbers,
|
||||
#content {
|
||||
font: 400 14px/1.6 "JetBrains Mono", monospace;
|
||||
}
|
||||
|
||||
#line-numbers {
|
||||
color: #888;
|
||||
padding: 16px 1px;
|
||||
text-align: center;
|
||||
white-space: pre;
|
||||
width: 30px;
|
||||
}
|
||||
|
||||
#content {
|
||||
color: #e5e5e7;
|
||||
height: 100%;
|
||||
min-height: 90vh;
|
||||
padding: 16px 16px 0 16px;
|
||||
width: calc(100vw - 65px);
|
||||
}
|
||||
|
||||
.menu {
|
||||
gap: 18px;
|
||||
position: fixed;
|
||||
right: 16px;
|
||||
top: 16px;
|
||||
}
|
||||
.menu svg {
|
||||
cursor: pointer;
|
||||
height: 24px;
|
||||
fill: none;
|
||||
margin-bottom: -6px;
|
||||
stroke: #e5e5e7;
|
||||
stroke-width: 2;
|
||||
width: 24px;
|
||||
}
|
||||
|
||||
button,
|
||||
input,
|
||||
select {
|
||||
background-color: #0f0f0f;
|
||||
border: 2px solid #363636;
|
||||
color: #e5e5e7;
|
||||
font: 500 14px/2 "Inter", "system-ui", sans-serif;
|
||||
max-width: 145px;
|
||||
outline: none;
|
||||
padding: 3px 10px;
|
||||
transition: border 0.15s ease;
|
||||
width: min-content;
|
||||
}
|
||||
button::placeholder,
|
||||
input::placeholder,
|
||||
select::placeholder {
|
||||
color: #888;
|
||||
}
|
||||
button:hover,
|
||||
input:hover,
|
||||
select:hover {
|
||||
border-color: #777;
|
||||
}
|
||||
button:focus-visible,
|
||||
input:focus-visible,
|
||||
select:focus-visible {
|
||||
border: 2px solid #bbb;
|
||||
}
|
||||
|
||||
select {
|
||||
padding: 8px 10px;
|
||||
width: fit-content;
|
||||
}
|
||||
|
||||
select:focus {
|
||||
background-color: #0f0f0f;
|
||||
transition: none;
|
||||
}
|
||||
|
||||
option {
|
||||
background-color: #0f0f0f;
|
||||
color: #e5e5e7;
|
||||
}
|
||||
option:focus {
|
||||
background-color: #d30f45;
|
||||
color: #0f0f0f;
|
||||
}
|
||||
|
||||
textarea {
|
||||
background-color: inherit;
|
||||
border: none;
|
||||
margin: 0;
|
||||
outline: none;
|
||||
resize: none;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue