freedombone/src/freedombone-app-privatebin

466 lines
16 KiB
Plaintext
Raw Normal View History

2018-01-10 22:00:56 +01:00
#!/bin/bash
2018-04-08 14:30:21 +02:00
# _____ _ _
# | __|___ ___ ___ _| |___ _____| |_ ___ ___ ___
# | __| _| -_| -_| . | . | | . | . | | -_|
# |__| |_| |___|___|___|___|_|_|_|___|___|_|_|___|
2018-01-10 22:00:56 +01:00
#
2018-04-08 14:30:21 +02:00
# Freedom in the Cloud
2018-01-10 22:00:56 +01:00
#
# privatebin application
#
# License
# =======
#
# Copyright (C) 2018 Bob Mottram <bob@freedombone.net>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
VARIANTS='full full-vim writer'
IN_DEFAULT_INSTALL=0
SHOW_ON_ABOUT=1
PRIVATEBIN_DOMAIN_NAME=
PRIVATEBIN_CODE=
PRIVATEBIN_ONION_PORT=8150
PRIVATEBIN_REPO="https://github.com/PrivateBin/PrivateBin"
PRIVATEBIN_COMMIT='9c132cd839fd5e91da18e4a1e8ebef64fce605fb'
PRIVATEBIN_ADMIN_PASSWORD=
PRIVATEBIN_SHORT_DESCRIPTION=$'PrivateBin'
PRIVATEBIN_DESCRIPTION=$'PrivateBin zero knowledge pastebin'
PRIVATEBIN_MOBILE_APP_URL=
2018-01-10 22:00:56 +01:00
privatebin_variables=(ONION_ONLY
PRIVATEBIN_DOMAIN_NAME
PRIVATEBIN_CODE
DDNS_PROVIDER
MY_USERNAME)
function secure_privatebin {
pbpath="/var/www/$PRIVATEBIN_DOMAIN_NAME/htdocs"
pbdata="/var/www/$PRIVATEBIN_DOMAIN_NAME/htdocs/data"
htgroup='www-data'
rootuser='root'
find "${pbpath}/" -type f -print0 | xargs -0 chmod 0640
find "${pbpath}/" -type d -print0 | xargs -0 chmod 0550
chown -R ${rootuser}:${htgroup} "${pbpath}/"
2018-03-01 00:17:49 +01:00
chown -R www-data:www-data "${pbdata}"
chmod 755 "${pbdata}"
2018-01-10 22:00:56 +01:00
}
function logging_on_privatebin {
echo -n ''
}
function logging_off_privatebin {
echo -n ''
}
function remove_user_privatebin {
2018-03-01 00:17:49 +01:00
echo -n ''
# remove_username="$1"
2018-01-10 22:00:56 +01:00
}
function add_user_privatebin {
2018-03-01 00:17:49 +01:00
# new_username="$1"
# new_user_password="$2"
2018-01-10 22:00:56 +01:00
echo '0'
}
function install_interactive_privatebin {
2018-03-01 00:17:49 +01:00
if [ ! "$ONION_ONLY" ]; then
2018-01-10 22:00:56 +01:00
ONION_ONLY='no'
fi
2018-03-01 00:17:49 +01:00
if [[ "$ONION_ONLY" != "no" ]]; then
2018-01-10 22:00:56 +01:00
PRIVATEBIN_DOMAIN_NAME='privatebin.local'
else
PRIVATEBIN_DETAILS_COMPLETE=
while [ ! $PRIVATEBIN_DETAILS_COMPLETE ]
do
2018-03-01 00:17:49 +01:00
data=$(mktemp 2>/dev/null)
2018-05-12 18:48:20 +02:00
if [[ "$DDNS_PROVIDER" == *"freedns"* ]]; then
2018-01-10 22:00:56 +01:00
dialog --backtitle $"Freedombone Configuration" \
--title $"PrivateBin Configuration" \
2018-03-01 00:17:49 +01:00
--form $"\\nPlease enter your PrivateBin details. The background image URL can be left blank.\\n\\nIMPORTANT: This should be a domain name which is supported by Let's Encrypt:" 14 65 2 \
2018-01-10 22:11:49 +01:00
$"Domain:" 1 1 "$(grep 'PRIVATEBIN_DOMAIN_NAME' temp.cfg | awk -F '=' '{print $2}')" 1 15 33 40 \
$"Code:" 2 1 "$(grep 'PRIVATEBIN_CODE' temp.cfg | awk -F '=' '{print $2}')" 2 15 33 255 \
2018-03-01 00:17:49 +01:00
2> "$data"
2018-01-10 22:00:56 +01:00
else
dialog --backtitle $"Freedombone Configuration" \
--title $"PrivateBin Configuration" \
2018-03-01 00:17:49 +01:00
--form $"\\nPlease enter your PrivateBin details. The background image URL can be left blank.\\n\\nIMPORTANT: This should be a domain name which is supported by Let's Encrypt:" 14 65 2 \
2018-01-10 22:11:49 +01:00
$"Domain:" 1 1 "$(grep 'PRIVATEBIN_DOMAIN_NAME' temp.cfg | awk -F '=' '{print $2}')" 1 15 33 40 \
2018-03-01 00:17:49 +01:00
2> "$data"
2018-01-10 22:00:56 +01:00
fi
sel=$?
case $sel in
2018-03-01 00:17:49 +01:00
1) rm -f "$data"
exit 1;;
255) rm -f "$data"
exit 1;;
2018-01-10 22:00:56 +01:00
esac
2018-03-01 00:17:49 +01:00
PRIVATEBIN_DOMAIN_NAME=$(sed -n 1p < "$data")
if [ "$PRIVATEBIN_DOMAIN_NAME" ]; then
if [[ "$PRIVATEBIN_DOMAIN_NAME" == "$HUBZILLA_DOMAIN_NAME" ]]; then
2018-01-10 22:00:56 +01:00
PRIVATEBIN_DOMAIN_NAME=""
fi
TEST_DOMAIN_NAME=$PRIVATEBIN_DOMAIN_NAME
validate_domain_name
2018-03-01 00:17:49 +01:00
if [[ "$TEST_DOMAIN_NAME" != "$PRIVATEBIN_DOMAIN_NAME" ]]; then
2018-01-10 22:00:56 +01:00
PRIVATEBIN_DOMAIN_NAME=
dialog --title $"Domain name validation" --msgbox "$TEST_DOMAIN_NAME" 15 50
else
2018-05-12 18:48:20 +02:00
if [[ "$DDNS_PROVIDER" == *"freedns"* ]]; then
2018-03-01 00:17:49 +01:00
PRIVATEBIN_CODE=$(sed -n 2p < "$data")
2018-01-10 22:00:56 +01:00
validate_freedns_code "$PRIVATEBIN_CODE"
2018-03-01 00:17:49 +01:00
if [ ! "$VALID_CODE" ]; then
2018-01-10 22:00:56 +01:00
PRIVATEBIN_DOMAIN_NAME=
fi
fi
fi
fi
if [ $PRIVATEBIN_DOMAIN_NAME ]; then
PRIVATEBIN_DETAILS_COMPLETE="yes"
fi
2018-03-01 00:17:49 +01:00
rm -f "$data"
2018-01-10 22:00:56 +01:00
done
write_config_param "PRIVATEBIN_CODE" "$PRIVATEBIN_CODE"
fi
write_config_param "PRIVATEBIN_DOMAIN_NAME" "$PRIVATEBIN_DOMAIN_NAME"
APP_INSTALLED=1
}
function change_password_privatebin {
2018-03-01 00:17:49 +01:00
# curr_username="$1"
# new_user_password="$2"
echo -n ''
2018-01-10 22:00:56 +01:00
}
function reconfigure_privatebin {
echo -n ''
}
function upgrade_privatebin {
if grep -q "privatebin domain" "$COMPLETION_FILE"; then
PRIVATEBIN_DOMAIN_NAME=$(get_completion_param "privatebin domain")
fi
chmod 755 "/var/www/$PRIVATEBIN_DOMAIN_NAME/htdocs/data"
2018-01-10 22:00:56 +01:00
CURR_PRIVATEBIN_COMMIT=$(get_completion_param "privatebin commit")
if [[ "$CURR_PRIVATEBIN_COMMIT" == "$PRIVATEBIN_COMMIT" ]]; then
return
fi
# update to the next commit
function_check set_repo_commit
2018-03-01 00:17:49 +01:00
set_repo_commit "/var/www/$PRIVATEBIN_DOMAIN_NAME/htdocs" "privatebin commit" "$PRIVATEBIN_COMMIT" "$PRIVATEBIN_REPO"
2018-01-10 22:00:56 +01:00
secure_privatebin
}
function backup_local_privatebin {
PRIVATEBIN_DOMAIN_NAME='privatebin'
2018-03-01 00:17:49 +01:00
if grep -q "privatebin domain" "$COMPLETION_FILE"; then
2018-01-10 22:00:56 +01:00
PRIVATEBIN_DOMAIN_NAME=$(get_completion_param "privatebin domain")
fi
2018-03-01 00:17:49 +01:00
source_directory="/var/www/${PRIVATEBIN_DOMAIN_NAME}/htdocs/data"
2018-01-10 22:00:56 +01:00
function_check suspend_site
2018-03-01 00:17:49 +01:00
suspend_site "${PRIVATEBIN_DOMAIN_NAME}"
2018-01-10 22:00:56 +01:00
function_check backup_directory_to_usb
dest_directory=privatebin
2018-03-01 00:17:49 +01:00
backup_directory_to_usb "$source_directory" "$dest_directory"
2018-01-10 22:00:56 +01:00
function_check restart_site
restart_site
}
function restore_local_privatebin {
2018-03-01 00:17:49 +01:00
if ! grep -q "privatebin domain" "$COMPLETION_FILE"; then
2018-01-10 22:00:56 +01:00
return
fi
PRIVATEBIN_DOMAIN_NAME=$(get_completion_param "privatebin domain")
2018-03-01 00:17:49 +01:00
if [ "$PRIVATEBIN_DOMAIN_NAME" ]; then
2018-01-10 22:00:56 +01:00
echo $"Restoring privatebin"
temp_restore_dir=/root/tempprivatebin
2018-03-01 00:17:49 +01:00
privatebin_dir="/var/www/${PRIVATEBIN_DOMAIN_NAME}/htdocs/data"
2018-01-10 22:00:56 +01:00
function_check restore_directory_from_usb
restore_directory_from_usb $temp_restore_dir privatebin
if [ -d $temp_restore_dir ]; then
2018-03-01 00:17:49 +01:00
if [ -d "$temp_restore_dir$privatebin_dir" ]; then
2018-03-03 12:49:17 +01:00
cp -rp "$temp_restore_dir$privatebin_dir/"* "$privatebin_dir/"
2018-01-10 22:00:56 +01:00
else
2018-03-03 12:49:17 +01:00
cp -rp "$temp_restore_dir/"* "$privatebin_dir/"
2018-01-10 22:00:56 +01:00
fi
secure_privatebin
rm -rf $temp_restore_dir
fi
echo $"Restore of privatebin complete"
fi
}
function backup_remote_privatebin {
PRIVATEBIN_DOMAIN_NAME='privatebin'
2018-03-01 00:17:49 +01:00
if grep -q "privatebin domain" "$COMPLETION_FILE"; then
2018-01-10 22:00:56 +01:00
PRIVATEBIN_DOMAIN_NAME=$(get_completion_param "privatebin domain")
fi
2018-03-01 00:17:49 +01:00
source_directory="/var/www/${PRIVATEBIN_DOMAIN_NAME}/htdocs/data"
2018-01-10 22:00:56 +01:00
function_check suspend_site
2018-03-01 00:17:49 +01:00
suspend_site "${PRIVATEBIN_DOMAIN_NAME}"
2018-01-10 22:00:56 +01:00
function_check backup_directory_to_friend
dest_directory=privatebin
2018-03-01 00:17:49 +01:00
backup_directory_to_friend "$source_directory" "$dest_directory"
2018-01-10 22:00:56 +01:00
function_check restart_site
restart_site
}
function restore_remote_privatebin {
2018-03-01 00:17:49 +01:00
if ! grep -q "privatebin domain" "$COMPLETION_FILE"; then
2018-01-10 22:00:56 +01:00
return
fi
PRIVATEBIN_DOMAIN_NAME=$(get_completion_param "privatebin domain")
2018-03-01 00:17:49 +01:00
if [ "$PRIVATEBIN_DOMAIN_NAME" ]; then
2018-01-10 22:00:56 +01:00
temp_restore_dir=/root/tempprivatebin
privatebin_dir=/var/www/${PRIVATEBIN_DOMAIN_NAME}/htdocs/data
function_check restore_directory_from_friend
restore_directory_from_friend $temp_restore_dir privatebin
if [ -d $temp_restore_dir ]; then
2018-03-01 00:17:49 +01:00
if [ -d "$temp_restore_dir$privatebin_dir" ]; then
2018-03-03 12:49:17 +01:00
cp -rp "$temp_restore_dir$privatebin_dir/"* "$privatebin_dir/"
2018-01-10 22:00:56 +01:00
else
2018-03-03 12:49:17 +01:00
cp -rp "$temp_restore_dir/"* "$privatebin_dir/"
2018-01-10 22:00:56 +01:00
fi
secure_privatebin
rm -rf $temp_restore_dir
fi
fi
}
function remove_privatebin {
if [ ${#PRIVATEBIN_DOMAIN_NAME} -eq 0 ]; then
return
fi
read_config_param "PRIVATEBIN_DOMAIN_NAME"
read_config_param "MY_USERNAME"
echo "Removing $PRIVATEBIN_DOMAIN_NAME"
2018-03-01 00:17:49 +01:00
nginx_dissite "$PRIVATEBIN_DOMAIN_NAME"
remove_certs "$PRIVATEBIN_DOMAIN_NAME"
2018-01-10 22:00:56 +01:00
2018-03-01 00:17:49 +01:00
if [ -d "/var/www/$PRIVATEBIN_DOMAIN_NAME" ]; then
rm -rf "/var/www/$PRIVATEBIN_DOMAIN_NAME"
2018-01-10 22:00:56 +01:00
fi
2018-03-01 00:17:49 +01:00
if [ -f "/etc/nginx/sites-available/$PRIVATEBIN_DOMAIN_NAME" ]; then
rm "/etc/nginx/sites-available/$PRIVATEBIN_DOMAIN_NAME"
2018-01-10 22:00:56 +01:00
fi
function_check remove_onion_service
remove_onion_service privatebin ${PRIVATEBIN_ONION_PORT}
if grep -q "privatebin" /etc/crontab; then
sed -i "/privatebin/d" /etc/crontab
fi
remove_app privatebin
remove_completion_param install_privatebin
2018-03-01 00:17:49 +01:00
sed -i '/privatebin/d' "$COMPLETION_FILE"
2018-01-10 22:00:56 +01:00
function_check remove_ddns_domain
2018-03-01 00:17:49 +01:00
remove_ddns_domain "$PRIVATEBIN_DOMAIN_NAME"
2018-01-10 22:00:56 +01:00
}
function install_privatebin {
2018-03-01 00:17:49 +01:00
if [ ! "$ONION_ONLY" ]; then
2018-01-10 22:00:56 +01:00
ONION_ONLY='no'
fi
2018-03-01 00:17:49 +01:00
if [ ! "$PRIVATEBIN_DOMAIN_NAME" ]; then
2018-01-10 22:00:56 +01:00
echo $'No domain name was given for privatebin'
exit 7359
fi
apt-get -yq install php-gettext php-curl php-gd php-mysql git curl
apt-get -yq install memcached php-memcached php-intl exiftool libfcgi0ldbl
2018-01-10 22:24:43 +01:00
apt-get -yq install php-libsodium libsodium18 php-mcrypt
2018-01-10 22:00:56 +01:00
2018-03-01 00:17:49 +01:00
if [ ! -d "/var/www/$PRIVATEBIN_DOMAIN_NAME" ]; then
mkdir "/var/www/$PRIVATEBIN_DOMAIN_NAME"
2018-01-10 22:00:56 +01:00
fi
2018-03-01 00:17:49 +01:00
if [ ! -d "/var/www/$PRIVATEBIN_DOMAIN_NAME/htdocs" ]; then
2018-01-10 22:00:56 +01:00
if [ -d /repos/privatebin ]; then
2018-03-01 00:17:49 +01:00
mkdir "/var/www/$PRIVATEBIN_DOMAIN_NAME/htdocs"
cp -r -p /repos/privatebin/. "/var/www/$PRIVATEBIN_DOMAIN_NAME/htdocs"
cd "/var/www/$PRIVATEBIN_DOMAIN_NAME/htdocs" || exit 3468246824
2018-01-10 22:00:56 +01:00
git pull
else
function_check git_clone
2018-03-01 00:17:49 +01:00
git_clone "$PRIVATEBIN_REPO" "/var/www/$PRIVATEBIN_DOMAIN_NAME/htdocs"
2018-01-10 22:00:56 +01:00
fi
2018-03-01 00:17:49 +01:00
if [ ! -d "/var/www/$PRIVATEBIN_DOMAIN_NAME/htdocs" ]; then
2018-01-10 22:00:56 +01:00
echo $'Unable to clone privatebin repo'
exit 63763873
fi
fi
2018-03-01 00:17:49 +01:00
cd "/var/www/$PRIVATEBIN_DOMAIN_NAME/htdocs" || exit 24682462
git checkout "$PRIVATEBIN_COMMIT" -b "$PRIVATEBIN_COMMIT"
2018-01-10 22:00:56 +01:00
set_completion_param "privatebin commit" "$PRIVATEBIN_COMMIT"
2018-03-01 00:17:49 +01:00
chmod g+w "/var/www/$PRIVATEBIN_DOMAIN_NAME/htdocs"
chown -R www-data:www-data "/var/www/$PRIVATEBIN_DOMAIN_NAME/htdocs"
2018-01-10 22:00:56 +01:00
function_check add_ddns_domain
2018-03-01 00:17:49 +01:00
add_ddns_domain "$PRIVATEBIN_DOMAIN_NAME"
2018-01-10 22:00:56 +01:00
PRIVATEBIN_ONION_HOSTNAME=$(add_onion_service privatebin 80 ${PRIVATEBIN_ONION_PORT})
privatebin_nginx_site=/etc/nginx/sites-available/$PRIVATEBIN_DOMAIN_NAME
if [[ $ONION_ONLY == "no" ]]; then
function_check nginx_http_redirect
2018-03-01 00:17:49 +01:00
nginx_http_redirect "$PRIVATEBIN_DOMAIN_NAME" "index index.php"
{ echo 'server {';
echo ' listen 443 ssl;';
echo ' #listen [::]:443 ssl;';
echo " server_name $PRIVATEBIN_DOMAIN_NAME;";
echo ''; } >> "$privatebin_nginx_site"
2018-01-10 22:00:56 +01:00
function_check nginx_compress
2018-03-01 00:17:49 +01:00
nginx_compress "$PRIVATEBIN_DOMAIN_NAME"
echo '' >> "$privatebin_nginx_site"
echo ' # Security' >> "$privatebin_nginx_site"
2018-01-10 22:00:56 +01:00
function_check nginx_ssl
2018-03-01 00:17:49 +01:00
nginx_ssl "$PRIVATEBIN_DOMAIN_NAME"
2018-01-10 22:00:56 +01:00
2018-03-05 19:15:29 +01:00
function_check nginx_security_options
nginx_security_options "$PRIVATEBIN_DOMAIN_NAME"
2018-03-01 00:17:49 +01:00
{ echo ' add_header Strict-Transport-Security max-age=15768000;';
echo '';
echo ' # Logs';
echo ' access_log /dev/null;';
echo ' error_log /dev/null;';
echo '';
echo " root /var/www/$PRIVATEBIN_DOMAIN_NAME/htdocs;";
echo '';
echo ' index index.php;';
echo '';
echo ' location ~ \.php {';
echo ' include snippets/fastcgi-php.conf;';
echo ' fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;';
echo ' fastcgi_read_timeout 30;';
echo ' }';
echo '';
echo ' # Location';
echo ' location / {'; } >> "$privatebin_nginx_site"
2018-01-10 22:00:56 +01:00
function_check nginx_limits
2018-03-01 00:17:49 +01:00
nginx_limits "$PRIVATEBIN_DOMAIN_NAME" '15m'
2018-03-02 21:09:25 +01:00
{ echo " try_files \$uri \$uri/ @privatebin;";
2018-03-01 00:17:49 +01:00
echo ' }';
echo '';
echo ' # Restrict access that is unnecessary anyway';
echo ' location ~ /\.(ht|git) {';
echo ' deny all;';
echo ' }';
echo '}';
echo ''; } >> "$privatebin_nginx_site"
2018-01-10 22:00:56 +01:00
else
2018-03-01 00:17:49 +01:00
echo -n '' > "$privatebin_nginx_site"
2018-01-10 22:00:56 +01:00
fi
2018-03-01 00:17:49 +01:00
{ echo 'server {';
echo " listen 127.0.0.1:$PRIVATEBIN_ONION_PORT default_server;";
echo " server_name $PRIVATEBIN_ONION_HOSTNAME;";
echo ''; } >> "$privatebin_nginx_site"
2018-01-10 22:00:56 +01:00
function_check nginx_compress
2018-03-01 00:17:49 +01:00
nginx_compress "$PRIVATEBIN_DOMAIN_NAME"
echo '' >> "$privatebin_nginx_site"
2018-03-05 19:15:29 +01:00
function_check nginx_security_options
nginx_security_options "$PRIVATEBIN_DOMAIN_NAME"
2018-03-01 00:17:49 +01:00
{ echo '';
echo ' # Logs';
echo ' access_log /dev/null;';
echo ' error_log /dev/null;';
echo '';
echo " root /var/www/$PRIVATEBIN_DOMAIN_NAME/htdocs;";
echo '';
echo ' index index.php;';
echo '';
echo ' location ~ \.php {';
echo ' include snippets/fastcgi-php.conf;';
echo ' fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;';
echo ' fastcgi_read_timeout 30;';
echo ' }';
echo '';
echo ' # Location';
echo ' location / {'; } >> "$privatebin_nginx_site"
2018-01-10 22:00:56 +01:00
function_check nginx_limits
2018-03-01 00:17:49 +01:00
nginx_limits "$PRIVATEBIN_DOMAIN_NAME" '15m'
2018-03-02 21:09:25 +01:00
{ echo " try_files \$uri \$uri/ @privatebin;";
2018-03-01 00:17:49 +01:00
echo ' }';
echo '';
echo ' # Restrict access that is unnecessary anyway';
echo ' location ~ /\.(ht|git) {';
echo ' deny all;';
echo ' }';
echo '}'; } >> "$privatebin_nginx_site"
2018-01-10 22:00:56 +01:00
function_check configure_php
configure_php
function_check create_site_certificate
2018-03-01 00:17:49 +01:00
create_site_certificate "$PRIVATEBIN_DOMAIN_NAME" 'yes'
2018-01-10 22:00:56 +01:00
function_check nginx_ensite
2018-03-01 00:17:49 +01:00
nginx_ensite "$PRIVATEBIN_DOMAIN_NAME"
2018-01-10 22:00:56 +01:00
2018-03-01 00:17:49 +01:00
cp "/var/www/$PRIVATEBIN_DOMAIN_NAME/htdocs/cfg/conf.sample.php" "/var/www/$PRIVATEBIN_DOMAIN_NAME/htdocs/cfg/conf.php"
2018-01-10 22:00:56 +01:00
# Change some defaults
2018-03-01 00:17:49 +01:00
sed -i 's|; qrcode|qrcode|g' "/var/www/$PRIVATEBIN_DOMAIN_NAME/htdocs/cfg/conf.php"
sed -i 's|default =.*|default = "1day"|g' "/var/www/$PRIVATEBIN_DOMAIN_NAME/htdocs/cfg/conf.php"
sed -i 's|languagedefault =.*|languagedefault = "en"|g' "/var/www/$PRIVATEBIN_DOMAIN_NAME/htdocs/cfg/conf.php"
sed -i 's|1year =|; 1year =|g' "/var/www/$PRIVATEBIN_DOMAIN_NAME/htdocs/cfg/conf.php"
sed -i 's|never =|; never =|g' "/var/www/$PRIVATEBIN_DOMAIN_NAME/htdocs/cfg/conf.php"
sed -i 's|limit = 10|limit = 30|g' "/var/www/$PRIVATEBIN_DOMAIN_NAME/htdocs/cfg/conf.php"
sed -i 's|limit = 300|limit = 0|g' "/var/www/$PRIVATEBIN_DOMAIN_NAME/htdocs/cfg/conf.php"
sed -i 's|batchsize =.*|batchsize = 100|g' "/var/www/$PRIVATEBIN_DOMAIN_NAME/htdocs/cfg/conf.php"
sed -i 's|sizelimit =.*|sizelimit = 32768|g' "/var/www/$PRIVATEBIN_DOMAIN_NAME/htdocs/cfg/conf.php"
sed -i 's|defaultformatter =.*|defaultformatter = "markdown"|g' "/var/www/$PRIVATEBIN_DOMAIN_NAME/htdocs/cfg/conf.php"
mkdir -p "/var/www/$PRIVATEBIN_DOMAIN_NAME/htdocs/data"
2018-01-10 22:36:50 +01:00
2018-01-10 22:00:56 +01:00
secure_privatebin
systemctl restart php7.0-fpm
systemctl restart nginx
set_completion_param "privatebin domain" "$PRIVATEBIN_DOMAIN_NAME"
APP_INSTALLED=1
}
# NOTE: deliberately there is no "exit 0"