Stupid simple pastebin service written in go.
Fastest way of deploying is via the deploy_pasta.sh script.
The easiest way of self-hosting a pasta server is via the docker image. All you need to do is
data directorydata directory as /dataAssuming your data is in /srv/pasta/ you can do
docker container run -d -v /srv/pasta:/data -p 127.0.0.1:8199:8199 grisu48/pasta
Configure your reverse proxy (e.g. nginx) then accordingly. I don't recomment to publish pastad on port 80 without a reverse proxy.
Let's assume we have /dev/sda for the system and /dev/sdb for data.
cloud-init.yaml to system storage$ sudo parted /dev/sdb
# mktable - gpt - mkpart - 1 - 0% - 100%
$ sudo mkfs.ext4 /dev/sdb1
$ sudo ros install -d /dev/sda -c cloud-init.yaml
We build openSUSE package at build.opensuse.org. To install follow the instructions from software.opensuse.org or the following snippet:
# Tumbleweed
zypper addrepo zypper addrepo https://download.opensuse.org/repositories/home:ph03nix:tools/openSUSE_Tumbleweed/home:ph03nix:tools.repo
zypper refresh && zypper install pasta
make pastad # Server
make pasta # Client
make # all
make static # static binaries
Then create a pastad.toml file using the provided example (pastad.toml.example) and run the server with
./pastad
make docker
Or manually:
docker build . -t feldspaten.org/pasta # Build docker container
Create or run the container with
docker container create --name pasta -p 8199:8199 -v ABSOLUTE_PATH_TO_DATA_DIR:/data feldspaten.org/pasta
docker container run --name pasta -p 8199:8199 -v ABSOLUTE_PATH_TO_DATA_DIR:/data feldspaten.org/pasta
The container needs a data directory with a valid pastad.toml (See the example file, otherwise default values will be used).
Assuing the server runs on http://localhost:8199, you can use the pasta tool or simply curl :
curl -X POST 'http://localhost:8199' --data-binary @README.md
pasta is the CLI utility for easy handling. For instance, if you want to push the README.md file and create a pasta out of it:
pasta README.md
pasta -r http://localhost:8199 REAME.md
pasta reads the ~/.pasta.toml file (see the example file)
Content type
Image
Digest
sha256:3087894d0…
Size
2.2 MB
Last updated
over 2 years ago
docker pull grisu48/pasta