Pastefy is an feature-rich Open Source self-hostable Pastebin.
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.
Try out the public instance https://pastefy.app
curl -F [email protected] pastefy.app
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
https://github.com/interaapps/pastefy/blob/master/docker-compose.yml
git clone https://github.com/interaapps/pastefy.git
cd pastefy
docker-compose up
wget https://pastefy.app/Hj9N3bs2/raw -O docker-compose.yml
nano docker-compose.yml
docker-compose up
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.
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
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
# Disables sql automigration. Then you have to do it manually via pastefy.jar automigrate
PASTEFY_AUTOMIGRATE=false
# Optional extras
REDIS_HOST=localhost
REDIS_PORT=6379
# When using minio you must use elasticsearch as well for search and paste previews.
MINIO_SERVER=https://...your minio s3 server
MINIO_REGION=de
MINIO_BUCKET=pastefy
MINIO_ACCESS_KEY=
MINIO_SECRET_KEY=
ELASTICSEARCH_URL=http://...
ELASTICSEARCH_USER=elastic
ELASTICSEARCH_PASSWORD=pw
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}
OAUTH2_INTERAAPPS_CLIENT_ID=dan3q9n
OAUTH2_INTERAAPPS_CLIENT_SECRET=ASDFASDF
OAUTH2_CUSTOM_CLIENT_ID=CLIENT_ID
OAUTH2_CUSTOM_CLIENT_SECRET=SECRET
OAUTH2_CUSTOM_AUTH_ENDPOINT=https://accounts.interaapps.de/auth/oauth2
OAUTH2_CUSTOM_TOKEN_ENDPOINT=https://accounts.interaapps.de/api/v2/authorization/oauth2/access_token
OAUTH2_CUSTOM_USERINFO_ENDPOINT=https://accounts.interaapps.de/api/v2/oidc/userinfo
# You might want to build the frontend
cd frontend
npm build prod
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.
You can find the docs of the Pastefy-Rest-APi here: Github Wiki
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
curl -F [email protected] pastefy.app
configure: nano ~/.config/asciinema/config
[api]
url = https://pastefy.app
Using asciinema
asciinema rec test.cast
# ...
asciinema upload test.cast
# Authenticate via Pastefy
# Pastefy will request you to set the install-id via `echo YOUR_PASTEFY_API_KEY > ~/.config/asciinema/install-id`
asciinema auth
asciinema upload test.cast