From 2dfc6b6155349d7fa57f1e9ca63bf21a73b8f0b4 Mon Sep 17 00:00:00 2001 From: wizzdom Date: Wed, 13 Mar 2024 05:41:54 +0000 Subject: [PATCH 1/2] add privatebin docs --- docs/services/paste.md | 48 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 docs/services/paste.md diff --git a/docs/services/paste.md b/docs/services/paste.md new file mode 100644 index 00000000..e00edffd --- /dev/null +++ b/docs/services/paste.md @@ -0,0 +1,48 @@ +--- +title: Pastebin +author: + - wizzdom +tags: + - aperture + - nomad + - docker +--- + +# Pastebin - `wizzdom` + +Redbrick currently uses [Privatebin](https://github.com/PrivateBin/PrivateBin) as a paste utility accessible at [paste.redbrick.dcu.ie](https://paste.redbrick.dcu.ie) and [paste.rb.dcu.ie](https://paste.rb.dcu.ie) + +## Privatebin + +The Privatebin instance is deployed with [nomad](nomad.md) on [`aperture`](../hardware/aperture/index.md). Its configuration is available [here](https://github.com/redbrick/nomad/blob/master/jobs/services/privatebin.hcl). Privatebin doesn't support full configuration via environment variables but instead uses a `conf.php` file. This is passed in using [nomad templates](https://developer.hashicorp.com/nomad/docs/job-specification/template) . + +All sensitive variables are stored in the [`consul`](consul.md) KV store. + +The main points are as follows: + +- configure URL shortener ([`shlink`](shlink.md)) + +```php +urlshortener = "https://s.rb.dcu.ie/rest/v1/short-urls/shorten?apiKey={{ key "privatebin/shlink/api" }}&format=txt&longUrl=" +``` + +- enable file upload, set file size limit and enable compression + +```php +fileupload = true +sizelimit = 10485760 +compression = "zlib" +``` + +- Connect to PostgreSQL database + +```php +[model] +class = Database +[model_options] +dsn = "pgsql:host=postgres.service.consul;dbname={{ key "privatebin/db/name" }}" +tbl = "privatebin_" ; table prefix +usr = "{{ key "privatebin/db/user" }}" +pwd = "{{ key "privatebin/db/password" }}" +opt[12] = true ; PDO::ATTR_PERSISTENT ; use persistent connections - default +``` From 3de7cf40587bbc332f4c0fe4addb9b954d73cb67 Mon Sep 17 00:00:00 2001 From: wizzdom Date: Wed, 13 Mar 2024 06:04:14 +0000 Subject: [PATCH 2/2] Update docs/services/paste.md Co-authored-by: James Hackett --- docs/services/paste.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/services/paste.md b/docs/services/paste.md index e00edffd..a861ca1e 100644 --- a/docs/services/paste.md +++ b/docs/services/paste.md @@ -14,7 +14,7 @@ Redbrick currently uses [Privatebin](https://github.com/PrivateBin/PrivateBin) a ## Privatebin -The Privatebin instance is deployed with [nomad](nomad.md) on [`aperture`](../hardware/aperture/index.md). Its configuration is available [here](https://github.com/redbrick/nomad/blob/master/jobs/services/privatebin.hcl). Privatebin doesn't support full configuration via environment variables but instead uses a `conf.php` file. This is passed in using [nomad templates](https://developer.hashicorp.com/nomad/docs/job-specification/template) . +The Privatebin instance is deployed with [nomad](nomad.md) on [`aperture`](../hardware/aperture/index.md). Its configuration is available [here](https://github.com/redbrick/nomad/blob/master/jobs/services/privatebin.hcl). Privatebin doesn't support full configuration via environment variables but instead uses a `conf.php` file. This is passed in using [nomad templates](https://developer.hashicorp.com/nomad/docs/job-specification/template). All sensitive variables are stored in the [`consul`](consul.md) KV store.