Coder Social home page Coder Social logo

interaapps / pastefy Goto Github PK

View Code? Open in Web Editor NEW
240.0 3.0 33.0 4.31 MB

Pastefy is an Open Source self-hostable Pastebin.

Home Page: https://pastefy.app

License: MIT License

JavaScript 11.18% Dockerfile 0.25% Vue 42.99% SCSS 8.13% Java 36.36% HTML 1.07%
githubgist-alternative paste pasting pastebin vue javawebstack self-hosted

pastefy's Introduction

!! IMPORTANT !!

Pastefy moved to a new domain:

https://pastefy.app

More information on why here in our article

Pastefy is an open source alternative to Gists or Pastebin.
You want to share some code to your friends or just save it for yourself? Just paste it.

Features

  • Raw-Preview
  • Copy Button
  • Fork
  • An API (Docs)
  • Log in
    • Folders
    • See your created pastes
    • delete created pastes
  • Create paste with curl -F [email protected] pastefy.app

Overview

Screenshots

Deploy

Docker

DockerHub: https://hub.docker.com/r/interaapps/pastefy

docker run -p 8080:80 \
      --env HTTP_SERVER_PORT=80 \
      --env HTTP_SERVER_CORS="*" \
      --env DATABASE_DRIVER=mysql \
      --env DATABASE_NAME=pastefy \
      --env DATABASE_USER=pastefy \
      --env DATABASE_PASSWORD=pastefy \
      --env DATABASE_HOST=host \
      --env DATABASE_PORT=3306 \
      --env AUTH_PROVIDER=NONE \
      --env SERVER_NAME=http://example.com \
      --env OAUTH2_PROVIDER_CLIENT_ID=NONE \
      --env OAUTH2_PROVIDER_CLIENT_SECRET= \
      interaapps/pastefy

Or Pastefy Docker in Host-Mode

Docker-Compose

https://github.com/interaapps/pastefy/blob/master/docker-compose.yml

git clone https://github.com/interaapps/pastefy.git
cd pastefy
docker-compose up

Custom Docker-Compose (Using Docker-Hub)

https://pastefy.ga/Hj9N3bs2

wget https://pastefy.app/Hj9N3bs2/raw -O docker-compose.yml
nano docker-compose.yml
docker-compose up

Kubernetes

You can find an example kubernetes file here https://github.com/interaapps/pastefy/blob/master/deployment/prod.yaml. It's made to use with gitlab CI and cert-manager. With some changes you can use it.

Container-Less

git clone https://github.com/interaapps/pastefy.git
cd pastefy/frontend
npm run install
npm run build
cd ../backend
mvn clean package
cd ..
cp .env.example .env
nano .env
java -jar backend/target/backend.jar

Using intelliJ? Look at Develop

Configuration

Basic Stuff

http.server.port=1337
HTTP_SERVER_CORS=*

DATABASE_DRIVER=mysql
DATABASE_NAME=
DATABASE_USER=
DATABASE_PASSWORD=
DATABASE_HOST=
DATABASE_PORT=3306

SERVER_NAME=http://example.com


# Optional
PASTEFY_INFO_CUSTOM_LOGO=https://urltoimage
PASTEFY_INFO_CUSTOM_NAME=Custom Name
PASTEFY_INFO_CUSTOM_FOOTER=WEBSITE=https://example.org,SEPERATED BY COMMA=https://example.org

# Requires login for read and creation of pastes
PASTEFY_LOGIN_REQUIRED=false
# Login-requirements for specific access types
PASTEFY_LOGIN_REQUIRED_CREATE=false
# This will disable the raw mode as well for browser users
PASTEFY_LOGIN_REQUIRED_READ=false

# Check the encryption checkbox by default
PASTEFY_ENCRYPTION_DEFAULT=false

# Requires every new account being accepted by an administrator
PASTEFY_GRANT_ACCESS_REQUIRED=false

# Allows /paste route listing all pastes
PASTEFY_LIST_PASTES=false

# Makes /app/stats public
PASTEFY_PUBLIC_STATS=false

# Disables public pastes section
PASTEFY_PUBLIC_PASTES=false

Adding login

You can choose between INTERAAPPS (best integration), GOOGLE, GITHUB, DISCORD or TWITCH for the provider (You can use all of them at the same time).

OAUTH2_${provider}_CLIENT_ID=${client_id}
OAUTH2_${provider}_CLIENT_SECRET=${client_secret}

Example

OAUTH2_INTERAAPPS_CLIENT_ID=dan3q9n
OAUTH2_INTERAAPPS_CLIENT_SECRET=ASDFASDF

Develop

Build frontend into the backend

# You might want to build the frontend
cd frontend
npm build prod

Frontend

Run the backend (On port 1337) and then go to the frontend and run

cd frontend
npm run serve

We are using IntelliJ Idea and Visual Studio code.

API

You can find the docs of the Pastefy-Rest-APi here: Github Wiki

Administration

If you want to give yourself the admin role, you have to log into your MySQL server and set type on your account to ADMIN in the pastefy_users table.

You'll find the admin panel under https://YOUR_URL/admin

pastefy's People

Contributors

hello-world69 avatar janholger avatar julianfun123 avatar nickbaumer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

pastefy's Issues

Feature Request - Logout button location

The logout button is currently quite far down in the settings.

From a new user perspective, it may make sense to have the logout button in roughly the same position/text size/font as the login button.

Reverse Proxy

I can access pastefy just fine by going to http://192.168.0.10:9999, but I'm unable to access pastefy with NGINX reverse proxy and, I'm getting file download instead of rendered page... I never had this issue with other 70 containers.

Here's snippet of my docker compose

   pastefy:
     image: interaapps/pastefy:latest
     container_name: pastefy
     ports:
       - "9999:80"
     environment:
       HTTP_SERVER_PORT: 80
       HTTP_SERVER_CORS: "*"
       DATABASE_DRIVER: mysql
       DATABASE_NAME: pastefy
       DATABASE_USER: pastefy
       DATABASE_PASSWORD: XXXXXX
       DATABASE_HOST: mariadb
       DATABASE_PORT: 3306
       SERVER_NAME: "https://pastefy.XXXXX.com"

Snippet of my NGINX reverse proxy

server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;

    server_name pastefy.XXXXXX.com;

    include /config/nginx/ssl.conf;

    client_max_body_size 0;

    include /config/nginx/authelia-server.conf;

    location / {
        include /config/nginx/authelia-location.conf;
        include /config/nginx/proxy.conf;
        include /config/nginx/resolver.conf;
        set $upstream_app pastefy;
        set $upstream_port 80;
        set $upstream_proto http;
        proxy_pass $upstream_proto://$upstream_app:$upstream_port;

    }
}

P.S. my nginx container can access any containers directly using the hostname without exposing external ports and the only thing being exposed to the internet is nginx's port 80 and 443.

Admin: Admin(s) cannot delete encrypted paste

Summary: If a paste is encrypted, then even the admin cannot delete it without a password.

Steps-to-reproduce:
(1) Make an encrypted paste as a user account
(2) Log in to admin account
(3) Try to delete the newly created paste. It prompts for a password.

Demonstration video below

Screencast.from.07-05-23.04.06.43.AM.IST.webm

Still confused how to use it

So in default pastes get deleted after what time?

Also is there a way to set a default delete days or something and is there a way to enable encryption by default

PS: i use docker-compose version

Installation guide

Hello Everyone,
I am trying run application install and build without docker and getting error from npm that install script is missing and I don't see nothing relevant in package.json.

[Feature Request] Disable Signups & Password Protection

Hi.
I do not want random people creating pastes on my server and was wondering if you could make a way so that I can disable new registrations after I register myself. However, I do want a way for people without an account to read my pastes. Lastly, if you could make a way so that I could password protect some of my pastes, like Privatebin does, that would be great! Thanks!

Self-hosted version seems to be missing features shown in your demo

I'm not sure if this has to do with adding the admin user and APIs for interapps, but from the demo I see a lot of features like deleting pastes, a copy url button, and others.

I followed the interapps link and created an account. I saw on the api link some code that appeared to add some of these features, but there wasn't a lot of explanation as to what was happening in the ReadMe. By this I mean, where do the files/code snippets need to go.

If I could get a little guidance on this, I'd be happy to incorporate some of these changes. Especially the syntax highlighting and the programming language drop downs. Thanks for the help.

panel
pastefy

docker-compose file not working

Problem

The docker-compose.yaml file seems to be outdated. I followed the steps to deploy and was given this error:

pastefy-pastefy-1  | Error: at getConnection()[MySQL.java]  SQLException   Could not create connection to database server. Attempted reconnect 5 times. Giving up.

Steps to reproduce

git clone https://github.com/interaapps/pastefy.git
cd pastefy
docker compose up

I noticed that the mariadb documentation (https://github.com/docker-library/docs/blob/master/mariadb/README.md) has environment variables named slightly differently to the pastefy docker-compose.yaml; I tried updating them to match (MARIADB_* instead of MYSQL_*) but I still got the same error.

Paste too long

Hey there!

I've tried creating a somewhat long paste, which always leads to this exception in the log:

java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.javawebstack.orm.Model.save(Model.java:126)
	at de.interaapps.pastefy.controller.FormDataPasteController.createPaste(FormDataPasteController.java:46)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.javawebstack.httpserver.router.RouteBinder$BindMapper.invoke(RouteBinder.java:254)
	at org.javawebstack.httpserver.router.RouteBinder$BindHandler.handle(RouteBinder.java:300)
	at org.javawebstack.httpserver.HTTPServer.execute(HTTPServer.java:338)
	at org.javawebstack.httpserver.HTTPServer$HttpHandler.handle(HTTPServer.java:414)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
	at org.eclipse.jetty.server.Server.handle(Server.java:500)
	at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:383)
	at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:547)
	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:375)
	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:270)
	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)
	at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117)
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:806)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:938)
	at java.lang.Thread.run(Thread.java:748)
Caused by: org.javawebstack.orm.exception.ORMQueryException: Data truncation: Data too long for column 'content' at row 1
	at org.javawebstack.orm.Repo.executeCreate(Repo.java:142)
	at org.javawebstack.orm.Repo.create(Repo.java:106)
	at org.javawebstack.orm.Repo.save(Repo.java:99)
	... 26 more
java.lang.RuntimeException: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
	at org.javawebstack.httpserver.router.RouteBinder$BindMapper.invoke(RouteBinder.java:256)
	at org.javawebstack.httpserver.router.RouteBinder$BindHandler.handle(RouteBinder.java:300)
	at org.javawebstack.httpserver.HTTPServer.execute(HTTPServer.java:338)
	at org.javawebstack.httpserver.HTTPServer$HttpHandler.handle(HTTPServer.java:414)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
	at org.eclipse.jetty.server.Server.handle(Server.java:500)
	at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:383)
	at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:547)
	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:375)
	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:270)
	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)
	at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117)
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:806)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:938)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
	at org.javawebstack.orm.Model.save(Model.java:129)
	at de.interaapps.pastefy.controller.FormDataPasteController.createPaste(FormDataPasteController.java:46)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.javawebstack.httpserver.router.RouteBinder$BindMapper.invoke(RouteBinder.java:254)
	... 15 more
Caused by: java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.javawebstack.orm.Model.save(Model.java:126)
	... 21 more
Caused by: org.javawebstack.orm.exception.ORMQueryException: Data truncation: Data too long for column 'content' at row 1
	at org.javawebstack.orm.Repo.executeCreate(Repo.java:142)
	at org.javawebstack.orm.Repo.create(Repo.java:106)
	at org.javawebstack.orm.Repo.save(Repo.java:99)
	... 26 more
com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Unterminated string at line 1 column 16001 path $.content
	at com.google.gson.Gson.fromJson(Gson.java:947)
	at com.google.gson.Gson.fromJson(Gson.java:897)
	at com.google.gson.Gson.fromJson(Gson.java:846)
	at com.google.gson.Gson.fromJson(Gson.java:817)
	at org.javawebstack.abstractdata.AbstractElement.fromJson(AbstractElement.java:178)
	at org.javawebstack.httpserver.Exchange.body(Exchange.java:75)
	at org.javawebstack.httpserver.router.RouteBinder$BindMapper.invoke(RouteBinder.java:229)
	at org.javawebstack.httpserver.router.RouteBinder$BindHandler.handle(RouteBinder.java:300)
	at org.javawebstack.httpserver.HTTPServer.execute(HTTPServer.java:338)
	at org.javawebstack.httpserver.HTTPServer$HttpHandler.handle(HTTPServer.java:414)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
	at org.eclipse.jetty.server.Server.handle(Server.java:500)
	at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:383)
	at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:547)
	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:375)
	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:270)
	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)
	at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:336)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:313)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:171)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:129)
	at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:388)
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:806)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:938)
	at java.lang.Thread.run(Thread.java:748)
Caused by: com.google.gson.stream.MalformedJsonException: Unterminated string at line 1 column 16001 path $.content
	at com.google.gson.stream.JsonReader.syntaxError(JsonReader.java:1564)
	at com.google.gson.stream.JsonReader.nextQuotedValue(JsonReader.java:1032)
	at com.google.gson.stream.JsonReader.nextString(JsonReader.java:816)
	at com.google.gson.internal.bind.TypeAdapters$29.read(TypeAdapters.java:702)
	at com.google.gson.internal.bind.TypeAdapters$29.read(TypeAdapters.java:723)
	at com.google.gson.internal.bind.TypeAdapters$29.read(TypeAdapters.java:698)
	at com.google.gson.internal.bind.TypeAdapters$35$1.read(TypeAdapters.java:894)
	at com.google.gson.Gson.fromJson(Gson.java:932)
	... 26 more

You can actually reproduce this by creating a paste containing the above stacktrace as its content.

Is there a way to configure the maximum paste size?

I'm running pastefy using the docker image with the tag latest

No Delete/Edit option on my container

I do not have any delete/edit option on any of my pastes.

image

Below is my compose file:

pastefy:
container_name: pastefy
restart: unless-stopped
environment:
HTTP_SERVER_PORT: 80
HTTP_SERVER_CORS: "*"
DATABASE_DRIVER: mysql
DATABASE_NAME: pastefy
DATABASE_USER: pastefy
DATABASE_PASSWORD: $DB_PASSWORD__SECRET
DATABASE_HOST: mariadb
DATABASE_PORT: 3306
SERVER_NAME: $SERVER
AUTH_PROVIDER: NONE
PASTEFY_LOGIN_REQUIRED: false
PASTEFY_LOGIN_REQUIRED_CREATE: false
PASTEFY_LOGIN_REQUIRED_READ: false
PASTEFY_ENCRYPTION_DEFAULT: false
ports:
- 9980:80
depends_on:
- mariadb
image: "interaapps/pastefy:latest"

What am I missing here?

Couple of things - SLF4J failed to load class & launch textbox in fullscreen on initial load of site

Heya,
so I have just started docker image and everything seems to be okay besides an error in docker terminal which says:

pastefy_1 | SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". pastefy_1 | SLF4J: Defaulting to no-operation (NOP) logger implementation pastefy_1 | SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details. pastefy_1 | Apr 28, 2024 2:37:42 PM org.javawebstack.httpserver.HTTPServer start pastefy_1 | INFO: HTTP-Server started on port xxxx

Is there a way to fix this? I'm running docker on Debian 12.
Also would be there a chance to create an env option true/false to full size textbox on page load instead of clicking the full-screen button after the page loads.

Thanks

Paste private throws exception

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Apr 25, 2023 3:28:23 PM org.javawebstack.httpserver.HTTPServer start
INFO: HTTP-Server started on port 80
de.interaapps.pastefy.exceptions.PastePrivateException
 at de.interaapps.pastefy.controller.PasteController.getPaste(PasteController.java:144)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 at java.lang.reflect.Method.invoke(Method.java:498)
 at org.javawebstack.httpserver.router.RouteBinder$BindMapper.invoke(RouteBinder.java:254)
 at org.javawebstack.httpserver.router.RouteBinder$BindHandler.handle(RouteBinder.java:300)
 at org.javawebstack.httpserver.HTTPServer.execute(HTTPServer.java:339)
 at org.javawebstack.httpserver.HTTPServer$HttpHandler.handle(HTTPServer.java:415)
 at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
 at org.eclipse.jetty.server.Server.handle(Server.java:516)
 at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:400)
 at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:645)
 at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:392)
 at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:277)
 at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
 at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105)
 at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104)
 at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:338)
 at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:315)
 at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:173)
 at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131)
 at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:409)
 at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883)
 at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034)
 at java.lang.Thread.run(Thread.java:750)

[Feature] Add an option to show the pastefy url as qr code

I love the design and UI of this program, and it's packed with features I really need ( i.e., login with Google and admin control, fork option, expiry, etc.)

The only missing feature here is a QR code preview of the copied login URL so that I can open it easily from another device without clipboard sync or texting myself the URL. I like the fact that the URL is randomly generated with a length of 8 chars ( safe enough for brute force - although an env variable to adjust the random character length will be GREAT! if possible ), but it's hard to type in the combination on another device.

If this is an easy implementation, please add this feature. Thank you so much for making this awesome piece of software :)

Public pastes (Everyone see everything)

Hi.
This seems like a great app but I need to be able to just dump stuff in the pastebin, and anybody who enters the bin can just see it.

I'm setting this up in my workplace for easily sharing stuff like http responses and bits of code. but pasting it here and then sending them the link to the paste seems redundant .

I thought I could achieve this with

environment:
  PASTEFY_LIST_PASTES: "true"

in my docker compose file, but going to bin.mydomain.lan/paste just writes Loading...
Can I achieve this with this system?

NoSuchElementException for for pastes logger than ~50 rows

After week of usages pastefy has started to throw 500 error codes on some responses

{"success":false,"exception":"NoSuchElementException","error":true,"exists":false}

However very small pastes (like 30 rows) still work.
Sometimes long pastes with code works well.
When I'm trying to save stack trace (about 200 row) it fails very often

I use docker image 6.6.7 with maria-db from compose

Stack trace from server log ``` java.util.NoSuchElementException at java.util.ArrayDeque.removeFirst(ArrayDeque.java:285) at java.util.ArrayDeque.pop(ArrayDeque.java:522) at org.javawebstack.abstractdata.json.JsonParser.parseString(JsonParser.java:134) at org.javawebstack.abstractdata.json.JsonParser.parse(JsonParser.java:44) at org.javawebstack.abstractdata.json.JsonParser.parseObject(JsonParser.java:191) at org.javawebstack.abstractdata.json.JsonParser.parse(JsonParser.java:101) at org.javawebstack.abstractdata.json.JsonParser.parse(JsonParser.java:21) at org.javawebstack.abstractdata.AbstractElement.fromJson(AbstractElement.java:197) at org.javawebstack.httpserver.Exchange.body(Exchange.java:75) at org.javawebstack.httpserver.router.RouteBinder$BindMapper.invoke(RouteBinder.java:229) at org.javawebstack.httpserver.router.RouteBinder$BindHandler.handle(RouteBinder.java:300) at org.javawebstack.httpserver.HTTPServer.execute(HTTPServer.java:339) at org.javawebstack.httpserver.HTTPServer$HttpHandler.handle(HTTPServer.java:415) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127) at org.eclipse.jetty.server.Server.handle(Server.java:516) at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:400) at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:645) at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:392) at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:277) at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311) at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105) at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104) at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:338) at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:315) at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:173) at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131) at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:409) at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883) at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034) at java.lang.Thread.run(Thread.java:750) ```

Folder AES Errors

Fatal error: Uncaught Error: Class 'ulole\core\classes\util\secure\AES' not found in /home/users/interaapps/www/pastefy/resources/views/folder.php:32 Stack trace: #0 /home/users/interaapps/www/pastefy/modules/deverm/Router.php(263): include() #1 /home/users/interaapps/www/pastefy/modules/ulole/bootstrap/bootstrap.php(81): modules\deverm\Router::view('folder', Array) #2

[Feature] Add option for disabling new user registration

Basically, the title. Right now, the best you can do is require approval; why not add a simple option to disable it if someone needs that? I

I don't know how difficult that will be to implement, but It's a useful feature.

Getting error when pasting large text

On-site error message: Error during posting the paste :(

Docker logs:

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Jan 03, 2024 1:09:34 AM org.javawebstack.httpserver.HTTPServer start
INFO: HTTP-Server started on port 80
java.util.NoSuchElementException
        at java.util.ArrayDeque.removeFirst(ArrayDeque.java:285)
        at java.util.ArrayDeque.pop(ArrayDeque.java:522)
        at org.javawebstack.abstractdata.json.JsonParser.parseString(JsonParser.java:134)
        at org.javawebstack.abstractdata.json.JsonParser.parse(JsonParser.java:44)
        at org.javawebstack.abstractdata.json.JsonParser.parseObject(JsonParser.java:191)
        at org.javawebstack.abstractdata.json.JsonParser.parse(JsonParser.java:101)
        at org.javawebstack.abstractdata.json.JsonParser.parse(JsonParser.java:21)
        at org.javawebstack.abstractdata.AbstractElement.fromJson(AbstractElement.java:197)
        at org.javawebstack.httpserver.Exchange.body(Exchange.java:75)
        at org.javawebstack.httpserver.router.RouteBinder$BindMapper.invoke(RouteBinder.java:229)
        at org.javawebstack.httpserver.router.RouteBinder$BindHandler.handle(RouteBinder.java:300)
        at org.javawebstack.httpserver.HTTPServer.execute(HTTPServer.java:339)
        at org.javawebstack.httpserver.HTTPServer$HttpHandler.handle(HTTPServer.java:415)
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
        at org.eclipse.jetty.server.Server.handle(Server.java:516)
        at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:400)
        at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:645)
        at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:392)
        at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:277)
        at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
        at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105)
        at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104)
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:338)
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:315)
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:173)
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131)
        at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:409)
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883)
        at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034)
        at java.lang.Thread.run(Thread.java:750)

docker-compose.yml

version: '3.9'

services:
  db:
    image: mariadb:11
    volumes:
    - dbvol:/var/lib/mysql

    environment:
      MYSQL_ROOT_PASSWORD: pastefy
      MYSQL_DATABASE: pastefy
      MYSQL_USER: pastefy
      MYSQL_PASSWORD: pastefy

  pastefy:
    image: interaapps/pastefy
    ports:
      # Host Post:Container Port. You only want to change the host port
      - "9999:80"
    depends_on:
    - db
    environment:
      HTTP_SERVER_PORT: 80
      HTTP_SERVER_CORS: "*"
      DATABASE_DRIVER: mysql
      DATABASE_NAME: pastefy
      DATABASE_USER: pastefy
      DATABASE_PASSWORD: pastefy
      DATABASE_HOST: db
      DATABASE_PORT: 3306
      # JAVA_OPTS: "-Xmx512m -Xms256m"  # Adjust these values as needed
      # Set this to your domain
      SERVER_NAME: "http://pastefy.mydomain.local:9999"
      # There is INTERAAPPS, GOOGLE, GITHUB, DISCORD, TWITCH
      OAUTH2_PROVIDER_CLIENT_ID:
      OAUTH2_PROVIDER_CLIENT_SECRET:
      # Optional
      # PASTEFY_INFO_CUSTOM_LOGO=https://urltoimage
      # PASTEFY_INFO_CUSTOM_NAME=Custom Name
      # PASTEFY_INFO_CUSTOM_FOOTER=WEBSITE=https://example.org,SEPERATED BY COMMA=https://example.org
      # Requires login for read and creation of pastes
      PASTEFY_LOGIN_REQUIRED: false
      # Login-requirements for specific access types
      PASTEFY_LOGIN_REQUIRED_CREATE: false
      # This will disable the raw mode as well for browser users
      PASTEFY_LOGIN_REQUIRED_READ: false
      # Check the encryption checkbox by default
      PASTEFY_ENCRYPTION_DEFAULT: false
      # Requires every new account being accepted by an administrator
      PASTEFY_GRANT_ACCESS_REQUIRED: false
      # Allows /paste route listing all pastes
      PASTEFY_LIST_PASTES: true
      # Makes /app/stats public
      PASTEFY_PUBLIC_STATS: true
      # Enables public pastes section
      PASTEFY_PUBLIC_PASTES: true

volumes:
  dbvol:

Creating paste fails

Hey guys,

Attempting to paste a rather long test paste (around 3000 lines), and it fails with some backend errors.

today at 20:30:29SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
today at 20:30:29SLF4J: Defaulting to no-operation (NOP) logger implementation
today at 20:30:29SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
today at 20:30:30ADDED google as auth provider
today at 20:30:30Mar 02, 2022 8:30:30 PM org.javawebstack.httpserver.HTTPServer start
today at 20:30:30INFO: HTTP-Server started on port 80
today at 20:30:33AUTH EXCEPTION
today at 20:30:43AUTH EXCEPTION
today at 20:32:13AUTH EXCEPTION
today at 20:32:50AUTH EXCEPTION
today at 20:32:57AUTH EXCEPTION
today at 20:47:31AUTH EXCEPTION
today at 20:47:31AUTH EXCEPTION
today at 20:47:34AUTH EXCEPTION
today at 20:49:19com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Unterminated string at line 1 column 2501 path $.content
today at 20:49:19	at com.google.gson.Gson.fromJson(Gson.java:978)
today at 20:49:19	at com.google.gson.Gson.fromJson(Gson.java:928)
today at 20:49:19	at com.google.gson.Gson.fromJson(Gson.java:877)
today at 20:49:19	at com.google.gson.Gson.fromJson(Gson.java:848)
today at 20:49:19	at org.javawebstack.abstractdata.AbstractElement.fromJson(AbstractElement.java:178)
today at 20:49:19	at org.javawebstack.httpserver.Exchange.body(Exchange.java:75)
today at 20:49:19	at org.javawebstack.httpserver.router.RouteBinder$BindMapper.invoke(RouteBinder.java:229)
today at 20:49:19	at org.javawebstack.httpserver.router.RouteBinder$BindHandler.handle(RouteBinder.java:300)
today at 20:49:19	at org.javawebstack.httpserver.HTTPServer.execute(HTTPServer.java:339)
today at 20:49:19	at org.javawebstack.httpserver.HTTPServer$HttpHandler.handle(HTTPServer.java:415)
today at 20:49:19	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
today at 20:49:19	at org.eclipse.jetty.server.Server.handle(Server.java:516)
today at 20:49:19	at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:400)
today at 20:49:19	at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:645)
today at 20:49:19	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:392)
today at 20:49:19	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:277)
today at 20:49:19	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
today at 20:49:19	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105)
today at 20:49:19	at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104)
today at 20:49:19	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:338)
today at 20:49:19	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:315)
today at 20:49:19	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:173)
today at 20:49:19	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131)
today at 20:49:19	at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:409)
today at 20:49:19	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883)
today at 20:49:19	at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034)
today at 20:49:19	at java.lang.Thread.run(Thread.java:748)
today at 20:49:19Caused by: com.google.gson.stream.MalformedJsonException: Unterminated string at line 1 column 2501 path $.content
today at 20:49:19	at com.google.gson.stream.JsonReader.syntaxError(JsonReader.java:1562)
today at 20:49:19	at com.google.gson.stream.JsonReader.nextQuotedValue(JsonReader.java:1030)
today at 20:49:19	at com.google.gson.stream.JsonReader.nextString(JsonReader.java:814)
today at 20:49:19	at com.google.gson.internal.bind.TypeAdapters$27.read(TypeAdapters.java:663)
today at 20:49:19	at com.google.gson.internal.bind.TypeAdapters$27.read(TypeAdapters.java:684)
today at 20:49:19	at com.google.gson.internal.bind.TypeAdapters$27.read(TypeAdapters.java:655)
today at 20:49:19	at com.google.gson.internal.bind.TypeAdapters$33$1.read(TypeAdapters.java:866)
today at 20:49:19	at com.google.gson.Gson.fromJson(Gson.java:963)
today at 20:49:19	... 26 more
today at 20:49:30com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Unterminated string at line 1 column 2501 path $.content
today at 20:49:30	at com.google.gson.Gson.fromJson(Gson.java:978)
today at 20:49:30	at com.google.gson.Gson.fromJson(Gson.java:928)
today at 20:49:30	at com.google.gson.Gson.fromJson(Gson.java:877)
today at 20:49:30	at com.google.gson.Gson.fromJson(Gson.java:848)
today at 20:49:30	at org.javawebstack.abstractdata.AbstractElement.fromJson(AbstractElement.java:178)
today at 20:49:30	at org.javawebstack.httpserver.Exchange.body(Exchange.java:75)
today at 20:49:30	at org.javawebstack.httpserver.router.RouteBinder$BindMapper.invoke(RouteBinder.java:229)
today at 20:49:30	at org.javawebstack.httpserver.router.RouteBinder$BindHandler.handle(RouteBinder.java:300)
today at 20:49:30	at org.javawebstack.httpserver.HTTPServer.execute(HTTPServer.java:339)
today at 20:49:30	at org.javawebstack.httpserver.HTTPServer$HttpHandler.handle(HTTPServer.java:415)
today at 20:49:30	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
today at 20:49:30	at org.eclipse.jetty.server.Server.handle(Server.java:516)
today at 20:49:30	at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:400)
today at 20:49:30	at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:645)
today at 20:49:30	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:392)
today at 20:49:30	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:277)
today at 20:49:30	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
today at 20:49:30	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105)
today at 20:49:30	at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104)
today at 20:49:30	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:338)
today at 20:49:30	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:315)
today at 20:49:30	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:173)
today at 20:49:30	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131)
today at 20:49:30	at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:409)
today at 20:49:30	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883)
today at 20:49:30	at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034)
today at 20:49:30	at java.lang.Thread.run(Thread.java:748)
today at 20:49:30Caused by: com.google.gson.stream.MalformedJsonException: Unterminated string at line 1 column 2501 path $.content
today at 20:49:30	at com.google.gson.stream.JsonReader.syntaxError(JsonReader.java:1562)
today at 20:49:30	at com.google.gson.stream.JsonReader.nextQuotedValue(JsonReader.java:1030)
today at 20:49:30	at com.google.gson.stream.JsonReader.nextString(JsonReader.java:814)
today at 20:49:30	at com.google.gson.internal.bind.TypeAdapters$27.read(TypeAdapters.java:663)
today at 20:49:30	at com.google.gson.internal.bind.TypeAdapters$27.read(TypeAdapters.java:684)
today at 20:49:30	at com.google.gson.internal.bind.TypeAdapters$27.read(TypeAdapters.java:655)
today at 20:49:30	at com.google.gson.internal.bind.TypeAdapters$33$1.read(TypeAdapters.java:866)
today at 20:49:30	at com.google.gson.Gson.fromJson(Gson.java:963)
today at 20:49:30	... 26 more
today at 20:50:02AUTH EXCEPTION
today at 20:50:02AUTH EXCEPTION
today at 20:50:12com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Unterminated string at line 1 column 2585 path $.content
today at 20:50:12	at com.google.gson.Gson.fromJson(Gson.java:978)
today at 20:50:12	at com.google.gson.Gson.fromJson(Gson.java:928)
today at 20:50:12	at com.google.gson.Gson.fromJson(Gson.java:877)
today at 20:50:12	at com.google.gson.Gson.fromJson(Gson.java:848)
today at 20:50:12	at org.javawebstack.abstractdata.AbstractElement.fromJson(AbstractElement.java:178)
today at 20:50:12	at org.javawebstack.httpserver.Exchange.body(Exchange.java:75)
today at 20:50:12	at org.javawebstack.httpserver.router.RouteBinder$BindMapper.invoke(RouteBinder.java:229)
today at 20:50:12	at org.javawebstack.httpserver.router.RouteBinder$BindHandler.handle(RouteBinder.java:300)
today at 20:50:12	at org.javawebstack.httpserver.HTTPServer.execute(HTTPServer.java:339)
today at 20:50:12	at org.javawebstack.httpserver.HTTPServer$HttpHandler.handle(HTTPServer.java:415)
today at 20:50:12	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
today at 20:50:12	at org.eclipse.jetty.server.Server.handle(Server.java:516)
today at 20:50:12	at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:400)
today at 20:50:12	at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:645)
today at 20:50:12	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:392)
today at 20:50:12	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:277)
today at 20:50:12	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
today at 20:50:12	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105)
today at 20:50:12	at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104)
today at 20:50:12	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:338)
today at 20:50:12	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:315)
today at 20:50:12	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:173)
today at 20:50:12	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131)
today at 20:50:12	at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:409)
today at 20:50:12	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883)
today at 20:50:12	at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034)
today at 20:50:12	at java.lang.Thread.run(Thread.java:748)
today at 20:50:12Caused by: com.google.gson.stream.MalformedJsonException: Unterminated string at line 1 column 2585 path $.content
today at 20:50:12	at com.google.gson.stream.JsonReader.syntaxError(JsonReader.java:1562)
today at 20:50:12	at com.google.gson.stream.JsonReader.nextQuotedValue(JsonReader.java:1030)
today at 20:50:12	at com.google.gson.stream.JsonReader.nextString(JsonReader.java:814)
today at 20:50:12	at com.google.gson.internal.bind.TypeAdapters$27.read(TypeAdapters.java:663)
today at 20:50:12	at com.google.gson.internal.bind.TypeAdapters$27.read(TypeAdapters.java:684)
today at 20:50:12	at com.google.gson.internal.bind.TypeAdapters$27.read(TypeAdapters.java:655)
today at 20:50:12	at com.google.gson.internal.bind.TypeAdapters$33$1.read(TypeAdapters.java:866)
today at 20:50:12	at com.google.gson.Gson.fromJson(Gson.java:963)
today at 20:50:12	... 26 more
today at 20:50:20AUTH EXCEPTION
today at 20:50:28com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Unterminated escape sequence at line 1 column 2509 path $.content
today at 20:50:28	at com.google.gson.Gson.fromJson(Gson.java:978)
today at 20:50:28	at com.google.gson.Gson.fromJson(Gson.java:928)
today at 20:50:28	at com.google.gson.Gson.fromJson(Gson.java:877)
today at 20:50:28	at com.google.gson.Gson.fromJson(Gson.java:848)
today at 20:50:28	at org.javawebstack.abstractdata.AbstractElement.fromJson(AbstractElement.java:178)
today at 20:50:28	at org.javawebstack.httpserver.Exchange.body(Exchange.java:75)
today at 20:50:28	at org.javawebstack.httpserver.router.RouteBinder$BindMapper.invoke(RouteBinder.java:229)
today at 20:50:28	at org.javawebstack.httpserver.router.RouteBinder$BindHandler.handle(RouteBinder.java:300)
today at 20:50:28	at org.javawebstack.httpserver.HTTPServer.execute(HTTPServer.java:339)
today at 20:50:28	at org.javawebstack.httpserver.HTTPServer$HttpHandler.handle(HTTPServer.java:415)
today at 20:50:28	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
today at 20:50:28	at org.eclipse.jetty.server.Server.handle(Server.java:516)
today at 20:50:28	at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:400)
today at 20:50:28	at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:645)
today at 20:50:28	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:392)
today at 20:50:28	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:277)
today at 20:50:28	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
today at 20:50:28	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105)
today at 20:50:28	at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104)
today at 20:50:28	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:338)
today at 20:50:28	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:315)
today at 20:50:28	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:173)
today at 20:50:28	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131)
today at 20:50:28	at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:409)
today at 20:50:28	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883)
today at 20:50:28	at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034)
today at 20:50:28	at java.lang.Thread.run(Thread.java:748)
today at 20:50:28Caused by: com.google.gson.stream.MalformedJsonException: Unterminated escape sequence at line 1 column 2509 path $.content
today at 20:50:28	at com.google.gson.stream.JsonReader.syntaxError(JsonReader.java:1562)
today at 20:50:28	at com.google.gson.stream.JsonReader.readEscapeCharacter(JsonReader.java:1499)
today at 20:50:28	at com.google.gson.stream.JsonReader.nextQuotedValue(JsonReader.java:1013)
today at 20:50:28	at com.google.gson.stream.JsonReader.nextString(JsonReader.java:814)
today at 20:50:28	at com.google.gson.internal.bind.TypeAdapters$27.read(TypeAdapters.java:663)
today at 20:50:28	at com.google.gson.internal.bind.TypeAdapters$27.read(TypeAdapters.java:684)
today at 20:50:28	at com.google.gson.internal.bind.TypeAdapters$27.read(TypeAdapters.java:655)
today at 20:50:28	at com.google.gson.internal.bind.TypeAdapters$33$1.read(TypeAdapters.java:866)
today at 20:50:28	at com.google.gson.Gson.fromJson(Gson.java:963)
today at 20:50:28	... 26 more
today at 20:55:25com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Unterminated escape sequence at line 1 column 2509 path $.content
today at 20:55:25	at com.google.gson.Gson.fromJson(Gson.java:978)
today at 20:55:25	at com.google.gson.Gson.fromJson(Gson.java:928)
today at 20:55:25	at com.google.gson.Gson.fromJson(Gson.java:877)
today at 20:55:25	at com.google.gson.Gson.fromJson(Gson.java:848)
today at 20:55:25	at org.javawebstack.abstractdata.AbstractElement.fromJson(AbstractElement.java:178)
today at 20:55:25	at org.javawebstack.httpserver.Exchange.body(Exchange.java:75)
today at 20:55:25	at org.javawebstack.httpserver.router.RouteBinder$BindMapper.invoke(RouteBinder.java:229)
today at 20:55:25	at org.javawebstack.httpserver.router.RouteBinder$BindHandler.handle(RouteBinder.java:300)
today at 20:55:25	at org.javawebstack.httpserver.HTTPServer.execute(HTTPServer.java:339)
today at 20:55:25	at org.javawebstack.httpserver.HTTPServer$HttpHandler.handle(HTTPServer.java:415)
today at 20:55:25	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
today at 20:55:25	at org.eclipse.jetty.server.Server.handle(Server.java:516)
today at 20:55:25	at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:400)
today at 20:55:25	at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:645)
today at 20:55:25	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:392)
today at 20:55:25	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:277)
today at 20:55:25	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
today at 20:55:25	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105)
today at 20:55:25	at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104)
today at 20:55:25	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:338)
today at 20:55:25	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:315)
today at 20:55:25	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:173)
today at 20:55:25	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131)
today at 20:55:25	at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:409)
today at 20:55:25	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883)
today at 20:55:25	at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034)
today at 20:55:25	at java.lang.Thread.run(Thread.java:748)
today at 20:55:25Caused by: com.google.gson.stream.MalformedJsonException: Unterminated escape sequence at line 1 column 2509 path $.content
today at 20:55:25	at com.google.gson.stream.JsonReader.syntaxError(JsonReader.java:1562)
today at 20:55:25	at com.google.gson.stream.JsonReader.readEscapeCharacter(JsonReader.java:1499)
today at 20:55:25	at com.google.gson.stream.JsonReader.nextQuotedValue(JsonReader.java:1013)
today at 20:55:25	at com.google.gson.stream.JsonReader.nextString(JsonReader.java:814)
today at 20:55:25	at com.google.gson.internal.bind.TypeAdapters$27.read(TypeAdapters.java:663)
today at 20:55:25	at com.google.gson.internal.bind.TypeAdapters$27.read(TypeAdapters.java:684)
today at 20:55:25	at com.google.gson.internal.bind.TypeAdapters$27.read(TypeAdapters.java:655)
today at 20:55:25	at com.google.gson.internal.bind.TypeAdapters$33$1.read(TypeAdapters.java:866)
today at 20:55:25	at com.google.gson.Gson.fromJson(Gson.java:963)
today at 20:55:25	... 26 more
today at 20:55:47com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Unterminated escape sequence at line 1 column 2509 path $.content
today at 20:55:47	at com.google.gson.Gson.fromJson(Gson.java:978)
today at 20:55:47	at com.google.gson.Gson.fromJson(Gson.java:928)
today at 20:55:47	at com.google.gson.Gson.fromJson(Gson.java:877)
today at 20:55:47	at com.google.gson.Gson.fromJson(Gson.java:848)
today at 20:55:47	at org.javawebstack.abstractdata.AbstractElement.fromJson(AbstractElement.java:178)
today at 20:55:47	at org.javawebstack.httpserver.Exchange.body(Exchange.java:75)
today at 20:55:47	at org.javawebstack.httpserver.router.RouteBinder$BindMapper.invoke(RouteBinder.java:229)
today at 20:55:47	at org.javawebstack.httpserver.router.RouteBinder$BindHandler.handle(RouteBinder.java:300)
today at 20:55:47	at org.javawebstack.httpserver.HTTPServer.execute(HTTPServer.java:339)
today at 20:55:47	at org.javawebstack.httpserver.HTTPServer$HttpHandler.handle(HTTPServer.java:415)
today at 20:55:47	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
today at 20:55:47	at org.eclipse.jetty.server.Server.handle(Server.java:516)
today at 20:55:47	at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:400)
today at 20:55:47	at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:645)
today at 20:55:47	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:392)
today at 20:55:47	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:277)
today at 20:55:47	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
today at 20:55:47	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105)
today at 20:55:47	at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104)
today at 20:55:47	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:338)
today at 20:55:47	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:315)
today at 20:55:47	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:173)
today at 20:55:47	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131)
today at 20:55:47	at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:409)
today at 20:55:47	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883)
today at 20:55:47	at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034)
today at 20:55:47	at java.lang.Thread.run(Thread.java:748)
today at 20:55:47Caused by: com.google.gson.stream.MalformedJsonException: Unterminated escape sequence at line 1 column 2509 path $.content
today at 20:55:47	at com.google.gson.stream.JsonReader.syntaxError(JsonReader.java:1562)
today at 20:55:47	at com.google.gson.stream.JsonReader.readEscapeCharacter(JsonReader.java:1499)
today at 20:55:47	at com.google.gson.stream.JsonReader.nextQuotedValue(JsonReader.java:1013)
today at 20:55:47	at com.google.gson.stream.JsonReader.nextString(JsonReader.java:814)
today at 20:55:47	at com.google.gson.internal.bind.TypeAdapters$27.read(TypeAdapters.java:663)
today at 20:55:47	at com.google.gson.internal.bind.TypeAdapters$27.read(TypeAdapters.java:684)
today at 20:55:47	at com.google.gson.internal.bind.TypeAdapters$27.read(TypeAdapters.java:655)
today at 20:55:47	at com.google.gson.internal.bind.TypeAdapters$33$1.read(TypeAdapters.java:866)
today at 20:55:47	at com.google.gson.Gson.fromJson(Gson.java:963)
today at 20:55:47	... 26 more

Seems potentially related to #11 and #13

Google OAuth 2.0 Authorization Error with Google Login Function. Possibly related to redirect URI?

I am encountering an issue with the Google OAuth 2.0 Authorization process when attempting to sign in using the Google Login function on Pastefy. I am currently running Pastefy via Docker-compose with Traefik as a reverse proxy on a Linux server (Ubuntu 22.04). Although the operating system may not be directly related to the issue, I thought it would be useful to provide this information.

Here's a detailed description of my setup and the issue:

I've created a Google project and set the redirect URI to https://pastefy.domain.tld/login/oauth2/code/google. However, upon clicking the Google Login button, I receive the following error:


Access blocked: Authorization Error

You can't sign in to this app because it doesn't comply with Google's OAuth 2.0 policy for keeping apps secure.

You can let the app developer know that this app doesn't comply with one or more Google validation rules.
Learn more about this error

If you are a developer of Pastefy, see error details.
Error 400: invalid_request


Upon inspecting the error details, I found that the redirect_uri is set to https://pastefy.domain.tld/api/v2/auth/oauth2/google/callback.

Having reviewed Google's OAuth 2.0 policy, it seems possible that the issue may be related to an incorrect redirect_uri being sent when clicking the Google Login button. According to the policy, the Redirect URI in the request should match the one specified in the setup. Any discrepancy here can lead to authorization errors. Based on this, should the redirect_uri instead be https://pastefy.domain.tld/login/oauth2/code/google as per my initial setup? This is my interpretation of the policy and I understand that I may have misunderstood some aspects. Please correct me if this is the case.

I welcome any advice or clarification on this matter, as I may have misinterpreted the requirements or made a mistake in the setup process.

Errors are not shown in frontend

Hey there,

if creating a paste fails, for example because it is too long (#11) the frontend keeps showing the loading spinner, so it is not visible that something went wrong:
image

I'm running pastefy using the docker image with the tag latest

Feature Request - UAC/Admin

Would it be possible to have some form of user access control/user admin panel?

E.g. There is already oauth which is awesome, but there's no way to stop a bad actor from creating multiple accounts/unable to manage current user accounts.

An admin panel w/ an "accept/deny new user account", manage users/delete users/pastes or invite link to the service would be awesome.

Issue when trying to delete paste made with curl -F ... as admin

Hey, I have an issue when trying to delete a Paste made with curl

java.lang.NullPointerException
        at de.interaapps.pastefy.controller.PasteController.deletePaste(PasteController.java:128)
        at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.javawebstack.httpserver.router.RouteBinder$BindMapper.invoke(RouteBinder.java:254)
        at org.javawebstack.httpserver.router.RouteBinder$BindHandler.handle(RouteBinder.java:300)
        at org.javawebstack.httpserver.HTTPServer.execute(HTTPServer.java:339)
        at org.javawebstack.httpserver.HTTPServer$HttpHandler.handle(HTTPServer.java:415)
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
        at org.eclipse.jetty.server.Server.handle(Server.java:516)
        at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:400)
        at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:645)
        at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:392)
        at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:277)
        at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
        at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105)
        at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104)
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:338)
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:315)
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:173)
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131)
        at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:409)
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883)
        at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034)
        at java.lang.Thread.run(Thread.java:750)

Edit: Self hosted Instance

Appearance improvements

Input box size problem:

  • chrome
    图片

  • firefox
    图片

Font color under the light theme of mobile browsers:

图片

[Bug] Pastefy not working on Safari/Chrome

Whenever I try to access to access my Pastefy instance using Safari/Chrome, Pastefy just downloads a file to my computer containing the following text:

<strong>We're sorry but frontend doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>

I do have JS enabled on both browsers. When I tried using Firefox to access my Pastefy instance, it does work.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.