diff --git a/.env.sample b/.env.sample index 725b82c..ba5a198 100644 --- a/.env.sample +++ b/.env.sample @@ -23,4 +23,7 @@ PB_BURN_AFTER_READING_PRESELECT=false PB_DISCUSSIONS_PRESELECT=false PB_DEFAULT_FORMATTER=plaintext # options: plaintext syntaxhighlighting & markdown -PB_EMAIL_ENABLE=true \ No newline at end of file +PB_EMAIL_ENABLE=true + +# Setting this to true will allow the PrivateBin crawler to add your instance to the public list of PrivateBin instances +PB_PUBLIC_DIRECTORY=false \ No newline at end of file diff --git a/abra.sh b/abra.sh index 9bfbf4b..8b1491a 100644 --- a/abra.sh +++ b/abra.sh @@ -1 +1,2 @@ -export PB_PHP_CONFIG_VERSION=v1 \ No newline at end of file +export PB_PHP_CONFIG_VERSION=v1 +export PB_ROBOTS_VERSION=v1 \ No newline at end of file diff --git a/compose.yml b/compose.yml index 2264497..85d2d6b 100644 --- a/compose.yml +++ b/compose.yml @@ -7,9 +7,14 @@ services: configs: - source: php_config target: /cfg/conf.php + - source: robots + target: /var/www/robots.txt networks: - proxy read_only: true + environment: + - CONFIG_PATH=/cfg/conf.php + - PB_PUBLIC_DIRECTORY deploy: restart_policy: condition: on-failure @@ -42,3 +47,7 @@ configs: name: ${STACK_NAME}_php_config_${PB_PHP_CONFIG_VERSION} file: conf.php.tmpl template_driver: golang + robots: + name: ${STACK_NAME}_robots_${PB_ROBOTS_VERSION} + file: robots.txt.tmpl + template_driver: golang diff --git a/robots.txt.tmpl b/robots.txt.tmpl new file mode 100644 index 0000000..eb17ffb --- /dev/null +++ b/robots.txt.tmpl @@ -0,0 +1,8 @@ +User-agent: * +Disallow: / + +{{ if eq $PB_PUBLIC_DIRECTORY "true" }} +User-agent: PrivateBinDirectoryBot +Disallow: / +{{ else }} +{{ end }}