Compare commits

...

5 commits

Author SHA1 Message Date
bef7646420 Customization 2022-05-24 21:32:57 +02:00
Leopere
68f6fe2b96
Don't track docker-compose.override.yml (#416)
This allows end users who need to build Hastebin for their deployments as an image in a private registry or any other changes without needing to collide with the ability to upgrade their local cached copy of the hastebin repo.
2022-05-09 12:28:41 +04:00
Filipe Chagas
7286385833 Add GHA workflow to mark and close inactive PRs and Issues 2022-03-08 11:45:42 -03:00
Linus J
3dcc43578b
Parse the expiration time as an INT (#392)
* handle expire time as int

* Removed logging

* Update lib/document_stores/postgres.js
2022-02-14 16:48:23 -03:00
Bryce
1ea6b6e99d
FIXED: Document post failing because expire parameter is string. (#366)
Specifically fixes docker example that uses memcached.

Co-authored-by: Bryce Leo <bryce.leo@trainingvault.us>
2022-02-14 15:19:42 -03:00
8 changed files with 225 additions and 12 deletions

30
.github/workflows/close-inactive.yaml vendored Normal file
View file

@ -0,0 +1,30 @@
name: Close inactive issues and PRs
on:
workflow_dispatch:
schedule:
- cron: "30 1 * * *"
jobs:
close-stale:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- uses: actions/stale@v3
with:
days-before-stale: 30
days-before-close: 14
stale-issue-label: "stale"
stale-pr-label: "stale"
exempt-issue-labels: backlog,triage,nostale
exempt-pr-labels: backlog,triage,nostale
stale-pr-message: "This PR is stale because it has been open for 30 days with no activity."
close-pr-message: "This PR was closed because it has been inactive for 14 days since being marked as stale."
stale-issue-message: "This issue is stale because it has been open for 30 days with no activity."
close-issue-message: "This issue was closed because it has been inactive for 14 days since being marked as stale."
repo-token: ${{ secrets.GITHUB_TOKEN }}

1
.gitignore vendored
View file

@ -4,3 +4,4 @@ node_modules
*.swo
data
*.DS_Store
docker-compose.override.yml

View file

@ -33,13 +33,13 @@ const {
const config = {
host: HOST,
port: PORT,
port: Number(PORT),
keyLength: KEY_LENGTH,
keyLength: Number(KEY_LENGTH),
maxLength: MAX_LENGTH,
maxLength: Number(MAX_LENGTH),
staticMaxAge: STATIC_MAX_AGE,
staticMaxAge: Number(STATIC_MAX_AGE),
recompressStaticAssets: RECOMPRESS_STATIC_ASSETS,
@ -86,8 +86,8 @@ const config = {
storage: {
type: STORAGE_TYPE,
host: STORAGE_HOST,
port: STORAGE_PORT,
expire: STORAGE_EXPIRE_SECONDS,
port: Number(STORAGE_PORT),
expire: Number(STORAGE_EXPIRE_SECONDS),
bucket: STORAGE_AWS_BUCKET,
region: STORAGE_AWS_REGION,
connectionUrl: `postgres://${STORAGE_USERNAME}:${STORAGE_PASSWORD}@${STORAGE_HOST}:${STORAGE_PORT}/${STORAGE_DB}`,

View file

@ -7,7 +7,7 @@ const {Pool} = require('pg');
// A postgres document store
var PostgresDocumentStore = function (options) {
this.expireJS = options.expire;
this.expireJS = parseInt(options.expire, 10);
const connectionString = process.env.DATABASE_URL || options.connectionUrl;
this.pool = new Pool({connectionString});

View file

@ -1,5 +1,5 @@
body {
background: #002B36;
background: #2D2D2D;
padding: 20px 50px;
margin: 0px;
}
@ -9,7 +9,7 @@ body {
textarea {
background: transparent;
border: 0px;
color: #fff;
color: #D3D0C8;
padding: 0px;
width: 100%;
height: 100%;
@ -24,7 +24,7 @@ textarea {
/* the line numbers */
#linenos {
color: #7d7d7d;
color: #747369;
z-index: -1000;
position: absolute;
top: 20px;

178
static/eighties.css Normal file
View file

@ -0,0 +1,178 @@
/*!
Theme: Eighties
Author: Chris Kempson (http://chriskempson.com)
License: ~ MIT (or more permissive) [via base16-schemes-source]
Maintainer: @highlightjs/core-team
Version: 2021.09.0
*/
/*
WARNING: DO NOT EDIT THIS FILE DIRECTLY.
This theme file was auto-generated from the Base16 scheme eighties
by the Highlight.js Base16 template builder.
- https://github.com/highlightjs/base16-highlightjs
*/
/*
base00 #2d2d2d Default Background
base01 #393939 Lighter Background (Used for status bars, line number and folding marks)
base02 #515151 Selection Background
base03 #747369 Comments, Invisibles, Line Highlighting
base04 #a09f93 Dark Foreground (Used for status bars)
base05 #d3d0c8 Default Foreground, Caret, Delimiters, Operators
base06 #e8e6df Light Foreground (Not often used)
base07 #f2f0ec Light Background (Not often used)
base08 #f2777a Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted
base09 #f99157 Integers, Boolean, Constants, XML Attributes, Markup Link Url
base0A #ffcc66 Classes, Markup Bold, Search Text Background
base0B #99cc99 Strings, Inherited Class, Markup Code, Diff Inserted
base0C #66cccc Support, Regular Expressions, Escape Characters, Markup Quotes
base0D #6699cc Functions, Methods, Attribute IDs, Headings
base0E #cc99cc Keywords, Storage, Selector, Markup Italic, Diff Changed
base0F #d27b53 Deprecated, Opening/Closing Embedded Language Tags, e.g. <?php ?>
*/
pre code.hljs {
display: block;
overflow-x: auto;
padding: 1em;
}
code.hljs {
padding: 3px 5px;
}
.hljs {
color: #d3d0c8;
background: #2d2d2d;
}
.hljs::selection,
.hljs ::selection {
background-color: #515151;
color: #d3d0c8;
}
/* purposely do not highlight these things */
.hljs-formula,
.hljs-params,
.hljs-property
{}
/* base03 - #747369 - Comments, Invisibles, Line Highlighting */
.hljs-comment {
color: #747369;
}
/* base04 - #a09f93 - Dark Foreground (Used for status bars) */
.hljs-tag {
color: #a09f93;
}
/* base05 - #d3d0c8 - Default Foreground, Caret, Delimiters, Operators */
.hljs-subst,
.hljs-punctuation,
.hljs-operator {
color: #d3d0c8;
}
.hljs-operator {
opacity: 0.7;
}
/* base08 - Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted */
.hljs-bullet,
.hljs-variable,
.hljs-template-variable,
.hljs-selector-tag,
.hljs-name,
.hljs-deletion {
color: #f2777a;
}
/* base09 - Integers, Boolean, Constants, XML Attributes, Markup Link Url */
.hljs-symbol,
.hljs-number,
.hljs-link,
.hljs-attr,
.hljs-variable.constant_,
.hljs-literal {
color: #f99157;
}
/* base0A - Classes, Markup Bold, Search Text Background */
.hljs-title,
.hljs-class .hljs-title,
.hljs-title.class_
{
color: #ffcc66;
}
.hljs-strong {
font-weight:bold;
color: #ffcc66;
}
/* base0B - Strings, Inherited Class, Markup Code, Diff Inserted */
.hljs-code,
.hljs-addition,
.hljs-title.class_.inherited__,
.hljs-string {
color: #99cc99;
}
/* base0C - Support, Regular Expressions, Escape Characters, Markup Quotes */
.hljs-built_in,
.hljs-doctag, /* guessing */
.hljs-quote,
.hljs-keyword.hljs-atrule,
.hljs-regexp {
color: #66cccc;
}
/* base0D - Functions, Methods, Attribute IDs, Headings */
.hljs-function .hljs-title,
.hljs-attribute,
.ruby .hljs-property,
.hljs-title.function_,
.hljs-section {
color: #6699cc;
}
/* base0E - Keywords, Storage, Selector, Markup Italic, Diff Changed */
.hljs-type,
/* .hljs-selector-id, */
/* .hljs-selector-class, */
/* .hljs-selector-attr, */
/* .hljs-selector-pseudo, */
.hljs-template-tag,
.diff .hljs-meta,
.hljs-keyword {
color: #cc99cc;
}
.hljs-emphasis {
color: #cc99cc;
font-style: italic;
}
/* base0F - Deprecated, Opening/Closing Embedded Language Tags, e.g. <?php ?> */
.hljs-meta,
/*
prevent top level .keyword and .string scopes
from leaking into meta by accident
*/
.hljs-meta .hljs-keyword,
.hljs-meta .hljs-string
{
color: #d27b53;
}
.hljs-meta .hljs-keyword,
/* for v10 compatible themes */
.hljs-meta-keyword {
font-weight: bold;
}

View file

@ -4,10 +4,10 @@
<title>hastebin</title>
<meta charset="utf-8" />
<link rel="stylesheet" type="text/css" href="solarized_dark.css"/>
<link rel="stylesheet" type="text/css" href="eighties.css"/>
<link rel="stylesheet" type="text/css" href="application.css"/>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript" src="jquery.min.js"></script>
<script type="text/javascript" src="highlight.min.js"></script>
<script type="text/javascript" src="application.min.js"></script>

4
static/jquery.min.js vendored Normal file

File diff suppressed because one or more lines are too long