You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The playbook can install and configure [PrivateBin](https://privatebin.info) for you.
23
+
24
+
PrivateBin is a minimalist, open source online pastebin where the server has zero knowledge of pasted data.
25
+
26
+
See the project's [documentation](https://github.com/PrivateBin/PrivateBin/tree/master/doc) to learn what PrivateBin does and why it might be useful to you.
27
+
28
+
For details about configuring the [Ansible role for PrivateBin](https://codeberg.org/acioustick/ansible-role-privatebin), you can check them via:
PrivateBin instance requires a storage backend to work. The available options: PostgreSQL (default), local filesystem, MySQL, SQLite, Google Cloud Storage, and Amazon S3.
67
+
68
+
As the playbook enables the [PostgreSQL service](postgres.md) on `vars.yml` by default, it is configured to use it as the default backend. If it is fine for you, you do not have to add configuration for the storage.
69
+
70
+
See below for the instruction to use one of the others.
71
+
72
+
#### Local filesystem
73
+
74
+
To use local filesystem database for a storage, you need to add a Docker volume to mount in the container, so that the directory for storing files is shared with the host machine.
75
+
76
+
To add the volume, prepare a directory on the host machine and add the following configuration to your `vars.yml` file, setting the directory path to `src`:
77
+
78
+
```yaml
79
+
privatebin_container_additional_volumes:
80
+
- type: bind
81
+
src: /path/on/the/host
82
+
dst: /srv/data
83
+
options:
84
+
```
85
+
86
+
Make sure permissions of the directory specified to `src`. If not correctly specified, the service returns a permission error while trying to put data to it.
87
+
88
+
#### MySQL
89
+
90
+
To use MySQL for a storage, add the following configuration to your `vars.yml` file:
91
+
92
+
```yaml
93
+
privatebin_config_model: MySQL
94
+
```
95
+
96
+
See [here](mariadb.md) on the role's documentation for details about how to configure a MariaDB instance with the playbook.
97
+
98
+
#### Google Cloud Storage / Amazon S3
99
+
100
+
See [this section](https://github.com/mother-of-all-self-hosting/ansible-role-privatebin/blob/main/docs/configuring-privatebin.md#configure-a-storage-for-pastes) on the role's documentation for details about how to configure a storage at Google Cloud Storage or Amazon S3.
101
+
102
+
### Configure a URL shortener (optional)
103
+
104
+
It is possible to have the PrivateBin instance use a URL shortener such as Bit.ly and a [YOURLS](https://yourls.org) instance, so that users can shorten a URL of a paste with it. **It is recommended to use a self-hosted shortener only and set a password to a paste, as the shortener will leak the paste's encryption key.**
105
+
106
+
YOURLS is available on the playbook. See [here](yourls.md) for details about how to install it.
107
+
108
+
**Notes**
109
+
- YOURLS requires a MariaDB instance (see [here](mariadb.md) for details about configuring it with the playbook); if PostgreSQL is going to be used for PrivateBin (or other services), you need to use both of them.
110
+
- If you are going to install PrivateBin and YOURLS at the same time, **you need to complete installation of YOURLS at first** by visiting its admin UI available at the specified hostname with `/admin/` such as `yourls.example.com/admin/`. Otherwise the function to shorten a paste's URL does not work. See [here](yourls.md#usage) for the instruction to complete instalation.
111
+
112
+
#### Use a private YOURLS instance with API access key
113
+
114
+
If you are using the private YOURLS instance, you might probably want to disallow a third party to use it without credentials. You can configure authentication by adding the following configuration to your `vars.yml` file:
115
+
116
+
```yaml
117
+
privatebin_config_yourlsapi_enabled: true
118
+
119
+
# Set the "signature" (access key) issued by the YOURLS instance for using the account
120
+
privatebin_config_yourlsapi_signature: ''
121
+
122
+
# Set URL of the YOURLS instance's API, called to shorten a paste URL
You can find the "signature" and API's URL on the "Tools" page of the YOURLS instance.
127
+
128
+
### Extending the configuration
129
+
130
+
There are some additional things you may wish to configure about the component.
131
+
132
+
Take a look at:
133
+
134
+
- [PrivateBin](https://github.com/mother-of-all-self-hosting/ansible-role-privatebin)'s [`defaults/main.yml`](https://github.com/mother-of-all-self-hosting/ansible-role-privatebin/blob/main/defaults/main.yml) for some variables that you can customize via your `vars.yml` file.
135
+
136
+
See its [configuration sample file](https://github.com/PrivateBin/PrivateBin/blob/master/cfg/conf.sample.php) and the [documentation](https://github.com/PrivateBin/PrivateBin/wiki/Configuration) for a complete list of PrivateBin's config options such as [discussion](https://github.com/mother-of-all-self-hosting/ansible-role-privatebin/blob/main/docs/configuring-privatebin.md#configure-the-discussion-feature-optional), [password](https://github.com/mother-of-all-self-hosting/ansible-role-privatebin/blob/main/docs/configuring-privatebin.md#configure-the-password-feature-optional), [file upload](https://github.com/mother-of-all-self-hosting/ansible-role-privatebin/blob/main/docs/configuring-privatebin.md#configure-the-file-upload-feature-optional), and [default theme](https://github.com/mother-of-all-self-hosting/ansible-role-privatebin/blob/main/docs/configuring-privatebin.md#configure-the-default-template-optional) features.
137
+
138
+
## Usage
139
+
140
+
After running the command for installation, PrivateBin becomes available at the specified hostname with the prefix (`mash.example.com/bin`).
141
+
142
+
## Troubleshooting
143
+
144
+
See [this section](https://github.com/mother-of-all-self-hosting/ansible-role-privatebin/blob/main/docs/configuring-privatebin.md#troubleshooting) on the role's documentation for details.
|[Postgis](https://postgis.net/)| A spatial database extender for PostgreSQL object-relational database |[Link](services/postgis.md)|
95
95
|[Postgres](https://www.postgresql.org)| A powerful, open source object-relational database system |[Link](services/postgres.md)|
96
96
|[Postgres Backup](https://github.com/prodrigestivill/docker-postgres-backup-local)| A solution for backing up PostgresSQL to local filesystem with periodic backups. |[Link](services/postgres-backup.md)|
97
+
|[PrivateBin](https://privatebin.info/)| Minimalist, open source online pastebin where the server has zero knowledge of pasted data. |[Link](services/privatebin.md)|
97
98
|[Prometheus](https://prometheus.io/)| A metrics collection and alerting monitoring solution |[Link](services/prometheus.md)|
98
99
|[Prometheus Blackbox Exporter](https://github.com/prometheus/blackbox_exporter)| Blackbox probing of HTTP/HTTPS/DNS/TCP/ICMP and gRPC endpoints |[Link](services/prometheus-blackbox-exporter.md)|
99
100
|[Prometheus Node Exporter](https://github.com/prometheus/node_exporter)| Exporter for machine metrics |[Link](services/prometheus-node-exporter.md)|
([mariadb_identifier ~ '.service'] if mariadb_enabled | default(false) and privatebin_database_mysql_hostname == mariadb_identifier else [])
5760
+
+
5761
+
([postgres_identifier ~ '.service'] if postgres_enabled | default(false) and privatebin_database_postgres_hostname == postgres_identifier else [])
5762
+
}}
5763
+
5764
+
privatebin_container_additional_networks_auto: |
5765
+
{{
5766
+
([mash_playbook_reverse_proxyable_services_additional_network] if mash_playbook_reverse_proxyable_services_additional_network else [])
5767
+
+
5768
+
([mariadb_container_network] if mariadb_enabled | default(false) and privatebin_database_mysql_hostname == mariadb_identifier and privatebin_container_network != mariadb_container_network else [])
5769
+
+
5770
+
([postgres_container_network] if postgres_enabled | default(false) and privatebin_database_postgres_hostname == postgres_identifier and privatebin_container_network != postgres_container_network else [])
# Note that valid values for "privatebin_config_model" are Filesystem, GoogleCloudStorage, MySQL, SQLite, PostgreSQL, and S3, meaning neither MySQL (MariaDB) nor Postgres would be a must.
5777
+
privatebin_config_model: PostgreSQL
5778
+
5779
+
# role-specific:mariadb
5780
+
# This is activated only if MariaDB is enabled and "privatebin_config_model" is set to "MySQL".
5781
+
privatebin_database_mysql_hostname: "{{ mariadb_identifier if mariadb_enabled | default(false) and privatebin_config_model == 'MySQL' else '' }}"
0 commit comments