guile-pastebin/README.md

README.md

<!-- SPDX-FileCopyrightText: 2021 Li Ian-Xue (b4283) b4283@pm.me SPDX-FileCopyrightText: 2025 Evgeny Pisemsky mail@pisemsky.site

SPDX-License-Identifier: GPL-3.0-only -->

guile-pastebin

A very simple pastebin written in Guile Scheme.

How to run

Execute one of the following commands in the root of repository:

guile -L modules --no-auto-compile scripts/pastebin <DATA_DIR>
GUILE_LOAD_PATH=modules GUILE_AUTO_COMPILE=0 scripts/pastebin <DATA_DIR>

Then navigate your web browser at http://localhost:8080.

<DATA_DIR> is a writable filesystem location you want to use to store pastes. If it doesn't exist, it will be created.

It was tested on Guile 2.2.7 and 3.0.7. Many thanks to the Guile development team for such great software.

API

Paste a file from command line

Paste a text file from command line and get a URL back: curl -F "text=<helloworld.cs" -F showUrl=1 http://localhost:8080/post

Notice the double-quotes around the parameters because < means IO redirection in sh.

Reverse Proxy

It may be desirable to setup a reverse proxy on Apache Httpd (also a memo for myself), so you don't have to expose the 8080 or whatever port:

<Location "/pastebin">
    ProxyPass "http://your_address:8080"
    ProxyPassReverse "http://your_address:8080"
    ProxyHTMLEnable On
    ProxyHTMLDocType "<!DOCTYPE html>"
    ProxyHTMLURLMap "/" "/pastebin/"
</Location>