Skip to content
This repository was archived by the owner on May 19, 2026. It is now read-only.

Repository files navigation

Code paste

Self-hosted solution for sharing text and code snippets.

Preview

Paste view

Features

  • Share text and code snippets
  • Paste content encryption
  • SSL only mode
  • Maintenance mode
  • Syntax highlighting

Installation - Development

  1. Clone the repository
  2. Run with docker compose (scripts/docker-start-dev.sh)
  3. Load testing database fixtures (scripts/load-fixtures.sh)

Installation - Production

  1. Clone this repository
  2. Install dependencies npm install && composer install
  3. Build assets npm run build
  4. Create database php bin/console doctrine:database:create --if-not-exists
  5. Migrate database php bin/console doctrine:migrations:migrate --no-interaction
  6. Configure website host apache-site.conf

Installation - Docker

You can build a docker image using the production docker file or use the image available here in github packages.

php:
image: ghcr.io/lukasbecvar/code-paste:latestcontainer_name: code_paste_webserverrestart: alwaysdepends_on:
- mysqlenvironment:
- DATABASE_HOST=127.0.0.1
- DATABASE_PORT=3306
- DATABASE_NAME=code_paste
- DATABASE_USERNAME=root
- DATABASE_PASSWORD=root...volumes:
- ./.docker/services/log:/var/logmem_limit: 1gports:
- "80:80"networks:
- main

Configuration

  1. Create your own .env file with name .env.prod and change app env in main .env
  2. Configure SSL_ONLY false or true if you want allow only SSL traffic
  3. Configure MAINTENANCE_MODE true or false if you want to enable maintenance mode
  4. ENCRYPTION_MODE true or false if you want to enable paste content encryption (key is APP_SECRET value in .env)
  5. Configure DATABASE_DRIVER, DATABASE_HOST, DATABASE_PORT, DATABASE_NAME, DATABASE_USERNAME, DATABASE_PASSWORD

Environment variables

The environment variables are loaded from .env file. You can create .env file in root directory with your configuration.

VariableDescriptionExample value
APP_SECRETSecret key for application security (used for hashing, encryption, etc.)6514635062ba34f218535f9f106fd20b
SSL_ONLYAllow access only via HTTPS protocolfalse
MAINTENANCE_MODEEnable or disable maintenance modefalse
ENCRYPTION_MODEEnable encryption for pasted contenttrue
CONTACT_EMAILAdministrator contact emaillukas@becvar.xyz
EXTERNAL_LOG_ENABLEDEnable external log sendingfalse
EXTERNAL_LOG_URLExternal log API endpointhttps://admin.becvar.xyz/api/external/log
EXTERNAL_LOG_TOKENAuthentication token for external log APIcbd8b08271wefg
METRICS_EXPORTER_ENABLEDEnable metrics exportertrue
METRICS_EXPORTER_ALLOWED_IPIP address allowed to access metrics (% = all)%
VISITOR_TRACKING_ENABLEDEnable visitor trackingfalse
VISITOR_TRACKING_SERVICE_NAMEService name for visitor trackingpaste.becvar.xyz
VISITOR_TRACKING_URLAPI endpoint for visitor trackinghttps://admin.becvar.xyz/api/monitoring/visitor/tracking
DATABASE_DRIVERDatabase driver typepdo_mysql
DATABASE_VERSIONDatabase version8.0.43
DATABASE_HOSTDatabase host address127.0.0.1
DATABASE_PORTDatabase port3306
DATABASE_NAMEDatabase namecode_paste
DATABASE_USERNAMEDatabase usernameroot
DATABASE_PASSWORDDatabase passwordroot

Requirements

  • Apache or Nginx web server with PHP support
  • NodeJS with npm
  • Composer
  • PHP 8.5
  • MySQL

License

This software is licensed under the MIT license.

About

Free webapp service for storing and sharing text and code snippets

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages