add robots.txt file

This commit is contained in:
brooke 2025-02-22 15:14:49 -05:00
parent 74daef26af
commit 8baa39eeaa
4 changed files with 23 additions and 2 deletions

View File

@ -23,4 +23,7 @@ PB_BURN_AFTER_READING_PRESELECT=false
PB_DISCUSSIONS_PRESELECT=false PB_DISCUSSIONS_PRESELECT=false
PB_DEFAULT_FORMATTER=plaintext # options: plaintext syntaxhighlighting & markdown PB_DEFAULT_FORMATTER=plaintext # options: plaintext syntaxhighlighting & markdown
PB_EMAIL_ENABLE=true 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

View File

@ -1 +1,2 @@
export PB_PHP_CONFIG_VERSION=v1 export PB_PHP_CONFIG_VERSION=v1
export PB_ROBOTS_VERSION=v1

View File

@ -7,9 +7,14 @@ services:
configs: configs:
- source: php_config - source: php_config
target: /cfg/conf.php target: /cfg/conf.php
- source: robots
target: /var/www/robots.txt
networks: networks:
- proxy - proxy
read_only: true read_only: true
environment:
- CONFIG_PATH=/cfg/conf.php
- PB_PUBLIC_DIRECTORY
deploy: deploy:
restart_policy: restart_policy:
condition: on-failure condition: on-failure
@ -42,3 +47,7 @@ configs:
name: ${STACK_NAME}_php_config_${PB_PHP_CONFIG_VERSION} name: ${STACK_NAME}_php_config_${PB_PHP_CONFIG_VERSION}
file: conf.php.tmpl file: conf.php.tmpl
template_driver: golang template_driver: golang
robots:
name: ${STACK_NAME}_robots_${PB_ROBOTS_VERSION}
file: robots.txt.tmpl
template_driver: golang

8
robots.txt.tmpl Normal file
View File

@ -0,0 +1,8 @@
User-agent: *
Disallow: /
{{ if eq $PB_PUBLIC_DIRECTORY "true" }}
User-agent: PrivateBinDirectoryBot
Disallow: /
{{ else }}
{{ end }}