gnusocial web server configuration similar to sample
This commit is contained in:
parent
4b3ca5de7d
commit
a26a8738d2
193
src/freedombone
193
src/freedombone
|
@ -8339,116 +8339,103 @@ function install_gnu_social {
|
||||||
|
|
||||||
if [[ $ONION_ONLY == "no" ]]; then
|
if [[ $ONION_ONLY == "no" ]]; then
|
||||||
echo 'server {' > /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
echo 'server {' > /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
||||||
echo ' listen 80;' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
echo ' listen 80;' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
||||||
echo " server_name $MICROBLOG_DOMAIN_NAME;" >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
echo ' listen [::]:80;' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
||||||
echo " root /var/www/$MICROBLOG_DOMAIN_NAME/htdocs;" >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
echo " server_name $MICROBLOG_DOMAIN_NAME;" >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
||||||
echo ' access_log off;' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
echo ' rewrite ^ https://$server_name$request_uri? permanent;' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
||||||
echo " error_log /var/log/nginx/${MICROBLOG_DOMAIN_NAME}_error.log $WEBSERVER_LOG_LEVEL;" >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
|
||||||
echo ' index index.php;' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
|
||||||
echo ' limit_conn conn_limit_per_ip 10;' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
|
||||||
echo ' limit_req zone=req_limit_per_ip burst=10 nodelay;' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
|
||||||
echo '' >> /etc/nginx/sites-available/$FULLBLOG_DOMAIN_NAME
|
|
||||||
echo '' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
|
||||||
echo ' rewrite ^ https://$server_name$request_uri? permanent;' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
|
||||||
echo '}' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
echo '}' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
||||||
echo '' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
echo '' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
||||||
echo 'server {' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
echo 'server {' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
||||||
echo ' listen 443 ssl;' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
echo ' listen 443 ssl;' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
||||||
echo " server_name $MICROBLOG_DOMAIN_NAME;" >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
echo " server_name $MICROBLOG_DOMAIN_NAME;" >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
||||||
echo " root /var/www/$MICROBLOG_DOMAIN_NAME/htdocs;" >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
|
||||||
echo ' index index.php index.html index.htm;' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
|
||||||
echo ' access_log off;' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
|
||||||
echo '' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
echo '' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
||||||
echo ' limit_conn conn_limit_per_ip 10;' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
echo ' # Security' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
||||||
echo ' limit_req zone=req_limit_per_ip burst=10 nodelay;' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
echo ' ssl on;' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
||||||
|
echo " ssl_certificate /etc/ssl/certs/$MICROBLOG_DOMAIN_NAME.pem;" >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
||||||
|
echo " ssl_certificate_key /etc/ssl/private/$MICROBLOG_DOMAIN_NAME.key;" >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
||||||
|
echo " ssl_dhparam /etc/ssl/certs/$MICROBLOG_DOMAIN_NAME.dhparam;" >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
||||||
echo '' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
echo '' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
||||||
echo ' location ~* \.php$ {' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
echo ' ssl_session_timeout 60m;' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
||||||
echo ' # Zero-day exploit defense.' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
echo ' ssl_prefer_server_ciphers on;' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
||||||
echo ' # http://forum.nginx.org/read.php?2,88845,page=3' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
echo ' ssl_session_cache builtin:1000 shared:SSL:10m;' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
||||||
echo ' try_files $uri $uri/ /index.php;' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
echo " ssl_protocols $SSL_PROTOCOLS; # not possible to do exclusive" >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
||||||
echo ' fastcgi_split_path_info ^(.+\.php)(/.+)$;' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
echo " ssl_ciphers '$SSL_CIPHERS';" >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
||||||
echo ' fastcgi_pass unix:/var/run/php5-fpm.sock;' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
echo ' add_header X-Frame-Options DENY;' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
||||||
echo ' include fastcgi_params;' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
echo ' add_header X-Content-Type-Options nosniff;' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
||||||
echo ' fastcgi_index index.php;' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
echo ' add_header Strict-Transport-Security max-age=15768000;' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
||||||
echo ' fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
|
||||||
echo ' fastcgi_read_timeout 300;' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
|
||||||
echo ' }' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
|
||||||
echo '' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
echo '' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
||||||
echo ' ssl on;' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
echo ' # Logs' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
||||||
echo " ssl_certificate /etc/ssl/certs/$MICROBLOG_DOMAIN_NAME.crt;" >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
echo ' access_log off;' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
||||||
echo " ssl_certificate_key /etc/ssl/private/$MICROBLOG_DOMAIN_NAME.key;" >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
echo ' error_log off;' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
||||||
echo " ssl_dhparam /etc/ssl/certs/$MICROBLOG_DOMAIN_NAME.dhparam;" >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
|
||||||
echo '' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
echo '' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
||||||
echo ' ssl_session_timeout 60m;' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
echo ' # Root' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
||||||
echo ' ssl_prefer_server_ciphers on;' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
echo " root /var/www/$MICROBLOG_DOMAIN_NAME/htdocs;" >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
||||||
echo ' ssl_session_cache builtin:1000 shared:SSL:10m;' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
|
||||||
echo " ssl_protocols $SSL_PROTOCOLS; # not possible to do exclusive" >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
|
||||||
echo " ssl_ciphers '$SSL_CIPHERS';" >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
|
||||||
echo ' add_header X-Frame-Options DENY;' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
|
||||||
echo ' add_header X-Content-Type-Options nosniff;' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
|
||||||
echo ' add_header Strict-Transport-Security max-age=15768000;' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
|
||||||
echo '' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
echo '' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
||||||
|
echo ' # Index' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
||||||
|
echo ' index index.php;' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
||||||
|
echo '' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
||||||
|
echo ' # PHP' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
||||||
|
echo ' location ~ \.php {' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
||||||
|
echo ' include snippets/fastcgi-php.conf;' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
||||||
|
echo ' fastcgi_pass unix:/var/run/php5-fpm.sock;' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
||||||
|
echo ' }' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
||||||
|
echo '' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
||||||
|
echo ' # Location' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
||||||
echo ' location / {' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
echo ' location / {' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
||||||
|
echo ' try_files $uri $uri/ @gnusocial;' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
||||||
|
echo ' }' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
||||||
|
echo '' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
||||||
|
echo ' # Fancy URLs' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
||||||
|
echo ' location @gnusocial {' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
||||||
echo ' rewrite ^(.*)$ /index.php?p=$1 last;' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
echo ' rewrite ^(.*)$ /index.php?p=$1 last;' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
||||||
echo ' break;' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
|
||||||
echo ' }' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
echo ' }' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
||||||
echo '' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
echo '' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
||||||
echo ' location ~* ^/(.*)\.(ico|css|js|gif|png|jpg|bmp|JPG|jpeg)$ {' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
echo ' # Restrict access that is unnecessary anyway' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
||||||
echo " root /var/www/$MICROBLOG_DOMAIN_NAME/htdocs;" >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
echo ' location ~ /\.(ht|git) {' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
||||||
echo ' rewrite ^/(.*)$ /$1 break;' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
echo ' deny all;' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
||||||
echo ' access_log off;' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
|
||||||
echo ' expires max;' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
|
||||||
echo ' }' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
echo ' }' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
||||||
echo '' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
echo '' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
||||||
echo ' client_max_body_size 15m;' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
echo ' client_max_body_size 15m;' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
||||||
echo '' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
|
||||||
echo " error_log /var/log/nginx/${MICROBLOG_DOMAIN_NAME}_error_ssl.log $WEBSERVER_LOG_LEVEL;" >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
|
||||||
echo '}' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
echo '}' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
||||||
echo '' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
|
||||||
else
|
else
|
||||||
echo -n '' > /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
echo -n '' > /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
||||||
fi
|
fi
|
||||||
echo 'server {' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
echo 'server {' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
||||||
echo " listen 127.0.0.1:${MICROBLOG_ONION_PORT} default_server;" >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
echo " listen 127.0.0.1:$MICROBLOG_ONION_PORT default_server;" >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
||||||
echo " server_name $MICROBLOG_DOMAIN_NAME;" >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
echo " server_name $MICROBLOG_DOMAIN_NAME;" >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
||||||
echo " root /var/www/$MICROBLOG_DOMAIN_NAME/htdocs;" >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
|
||||||
echo ' index index.php index.html index.htm;' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
|
||||||
echo ' access_log off;' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
|
||||||
echo '' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
echo '' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
||||||
echo ' limit_conn conn_limit_per_ip 10;' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
echo ' # Logs' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
||||||
echo ' limit_req zone=req_limit_per_ip burst=10 nodelay;' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
echo ' access_log off;' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
||||||
|
echo ' error_log off;' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
||||||
echo '' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
echo '' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
||||||
echo ' location ~* \.php$ {' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
echo ' # Root' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
||||||
echo ' # Zero-day exploit defense.' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
echo " root /var/www/$MICROBLOG_DOMAIN_NAME/htdocs;" >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
||||||
echo ' # http://forum.nginx.org/read.php?2,88845,page=3' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
|
||||||
echo ' try_files $uri $uri/ /index.php;' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
|
||||||
echo ' fastcgi_split_path_info ^(.+\.php)(/.+)$;' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
|
||||||
echo ' fastcgi_pass unix:/var/run/php5-fpm.sock;' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
|
||||||
echo ' include fastcgi_params;' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
|
||||||
echo ' fastcgi_index index.php;' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
|
||||||
echo ' fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
|
||||||
echo ' fastcgi_read_timeout 300;' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
|
||||||
echo ' }' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
|
||||||
echo '' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
echo '' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
||||||
echo ' add_header X-Frame-Options DENY;' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
echo ' # Index' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
||||||
echo ' add_header X-Content-Type-Options nosniff;' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
echo ' index index.php;' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
||||||
echo ' add_header Strict-Transport-Security max-age=15768000;' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
|
||||||
echo '' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
echo '' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
||||||
|
echo ' # PHP' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
||||||
|
echo ' location ~ \.php {' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
||||||
|
echo ' include snippets/fastcgi-php.conf;' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
||||||
|
echo ' fastcgi_pass unix:/var/run/php5-fpm.sock;' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
||||||
|
echo ' }' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
||||||
|
echo '' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
||||||
|
echo ' # Location' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
||||||
echo ' location / {' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
echo ' location / {' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
||||||
|
echo ' try_files $uri $uri/ @gnusocial;' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
||||||
|
echo ' }' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
||||||
|
echo '' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
||||||
|
echo ' # Fancy URLs' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
||||||
|
echo ' location @gnusocial {' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
||||||
echo ' rewrite ^(.*)$ /index.php?p=$1 last;' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
echo ' rewrite ^(.*)$ /index.php?p=$1 last;' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
||||||
echo ' break;' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
|
||||||
echo ' }' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
echo ' }' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
||||||
echo '' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
echo '' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
||||||
echo ' location ~* ^/(.*)\.(ico|css|js|gif|png|jpg|bmp|JPG|jpeg)$ {' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
echo ' # Restrict access that is unnecessary anyway' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
||||||
echo " root /var/www/$MICROBLOG_DOMAIN_NAME/htdocs;" >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
echo ' location ~ /\.(ht|git) {' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
||||||
echo ' rewrite ^/(.*)$ /$1 break;' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
echo ' deny all;' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
||||||
echo ' access_log off;' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
|
||||||
echo ' expires max;' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
|
||||||
echo ' }' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
echo ' }' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
||||||
echo '' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
echo '' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
||||||
echo ' client_max_body_size 15m;' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
echo ' client_max_body_size 15m;' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
||||||
echo '' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
|
||||||
echo " error_log /var/log/nginx/${MICROBLOG_DOMAIN_NAME}_error_ssl.log $WEBSERVER_LOG_LEVEL;" >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
|
||||||
echo '}' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
echo '}' >> /etc/nginx/sites-available/$MICROBLOG_DOMAIN_NAME
|
||||||
|
|
||||||
configure_php
|
configure_php
|
||||||
|
@ -8545,17 +8532,23 @@ function install_gnu_social {
|
||||||
exit 72357
|
exit 72357
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Some useful settings
|
||||||
|
microblog_config_file=/var/www/$MICROBLOG_DOMAIN_NAME/htdocs/config.php
|
||||||
if ! grep -q "Recommended GNU social settings" $microblog_config_file; then
|
if ! grep -q "Recommended GNU social settings" $microblog_config_file; then
|
||||||
microblog_config_file=/var/www/$MICROBLOG_DOMAIN_NAME/htdocs/config.php
|
|
||||||
echo "" >> $microblog_config_file
|
echo "" >> $microblog_config_file
|
||||||
echo "// Recommended GNU social settings" >> $microblog_config_file
|
echo "// Recommended GNU social settings" >> $microblog_config_file
|
||||||
echo "$config['thumbnail']['maxsize'] = 3000;" >> $microblog_config_file
|
echo "\$config['thumbnail']['maxsize'] = 3000;" >> $microblog_config_file
|
||||||
echo "$config['profile']['delete'] = true;" >> $microblog_config_file
|
echo "\$config['profile']['delete'] = true;" >> $microblog_config_file
|
||||||
echo "$config['profile']['changenick'] = true;" >> $microblog_config_file
|
echo "\$config['profile']['changenick'] = true;" >> $microblog_config_file
|
||||||
echo "$config['public']['localonly'] = false;" >> $microblog_config_file
|
echo "\$config['public']['localonly'] = false;" >> $microblog_config_file
|
||||||
echo "addPlugin('StoreRemoteMedia');" >> $microblog_config_file
|
echo "addPlugin('StoreRemoteMedia');" >> $microblog_config_file
|
||||||
|
echo "\$config['queue']['enabled'] = true;" >> $microblog_config_file
|
||||||
|
echo "\$config['queue']['daemon'] = true;" >> $microblog_config_file
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# This improves performance
|
||||||
|
sed -i "s|\\\$config['db']['schemacheck'].*|\$config['db']['schemacheck'] = 'script';|g" $microblog_config_file
|
||||||
|
|
||||||
MICROBLOG_ONION_HOSTNAME=$(add_onion_service microblog 80 ${MICROBLOG_ONION_PORT})
|
MICROBLOG_ONION_HOSTNAME=$(add_onion_service microblog 80 ${MICROBLOG_ONION_PORT})
|
||||||
|
|
||||||
systemctl restart php5-fpm
|
systemctl restart php5-fpm
|
||||||
|
@ -8625,21 +8618,21 @@ function install_gnu_social_theme {
|
||||||
echo "" >> $microblog_config_file
|
echo "" >> $microblog_config_file
|
||||||
echo "// Qvitter settings" >> $microblog_config_file
|
echo "// Qvitter settings" >> $microblog_config_file
|
||||||
echo "addPlugin('Qvitter');" >> $microblog_config_file
|
echo "addPlugin('Qvitter');" >> $microblog_config_file
|
||||||
echo "$config['site']['qvitter']['enabledbydefault'] = true;" >> $microblog_config_file
|
echo "\$config['site']['qvitter']['enabledbydefault'] = true;" >> $microblog_config_file
|
||||||
echo "$config['site']['qvitter']['defaultbackgroundcolor'] = '#f4f4f4';" >> $microblog_config_file
|
echo "\$config['site']['qvitter']['defaultbackgroundcolor'] = '#f4f4f4';" >> $microblog_config_file
|
||||||
echo "$config['site']['qvitter']['defaultlinkcolor'] = '#0084B4';" >> $microblog_config_file
|
echo "\$config['site']['qvitter']['defaultlinkcolor'] = '#0084B4';" >> $microblog_config_file
|
||||||
echo "$config['site']['qvitter']['timebetweenpolling'] = 5000;" >> $microblog_config_file
|
echo "\$config['site']['qvitter']['timebetweenpolling'] = 120000; // two minutes" >> $microblog_config_file
|
||||||
echo "$config['site']['qvitter']['urlshortenerapiurl'] = 'http://qttr.at/shortener.php';" >> $microblog_config_file
|
echo "\$config['site']['qvitter']['urlshortenerapiurl'] = 'http://qttr.at/shortener.php';" >> $microblog_config_file
|
||||||
echo "$config['site']['qvitter']['urlshortenersignature'] = 'b6afeec983';" >> $microblog_config_file
|
echo "\$config['site']['qvitter']['urlshortenersignature'] = 'b6afeec983';" >> $microblog_config_file
|
||||||
echo "$config['site']['qvitter']['sitebackground'] = 'img/vagnsmossen.jpg';" >> $microblog_config_file
|
echo "\$config['site']['qvitter']['sitebackground'] = 'img/vagnsmossen.jpg';" >> $microblog_config_file
|
||||||
echo "$config['site']['qvitter']['favicon'] = 'img/favicon.ico?v=4';" >> $microblog_config_file
|
echo "\$config['site']['qvitter']['favicon'] = 'img/favicon.ico?v=4';" >> $microblog_config_file
|
||||||
echo "$config['site']['qvitter']['sprite'] = Plugin::staticPath('Qvitter', '').'img/sprite.png?v=40';" >> $microblog_config_file
|
echo "\$config['site']['qvitter']['sprite'] = Plugin::staticPath('Qvitter', '').'img/sprite.png?v=40';" >> $microblog_config_file
|
||||||
echo "$config['site']['qvitter']['enablewelcometext'] = true;" >> $microblog_config_file
|
echo "\$config['site']['qvitter']['enablewelcometext'] = true;" >> $microblog_config_file
|
||||||
echo "$config['site']['qvitter']['customwelcometext']['en'] = '$MICROBLOG_WELCOME_MESSAGE';" >> $microblog_config_file
|
echo "\$config['site']['qvitter']['customwelcometext']['en'] = '$MICROBLOG_WELCOME_MESSAGE';" >> $microblog_config_file
|
||||||
echo "$config['site']['qvitter']['customwelcometext']['de'] = '$MICROBLOG_WELCOME_MESSAGE';" >> $microblog_config_file
|
echo "\$config['site']['qvitter']['customwelcometext']['de'] = '$MICROBLOG_WELCOME_MESSAGE';" >> $microblog_config_file
|
||||||
echo "$config['site']['qvitter']['customwelcometext']['fr'] = '$MICROBLOG_WELCOME_MESSAGE';" >> $microblog_config_file
|
echo "\$config['site']['qvitter']['customwelcometext']['fr'] = '$MICROBLOG_WELCOME_MESSAGE';" >> $microblog_config_file
|
||||||
echo "$config['site']['qvitter']['customwelcometext']['es'] = '$MICROBLOG_WELCOME_MESSAGE';" >> $microblog_config_file
|
echo "\$config['site']['qvitter']['customwelcometext']['es'] = '$MICROBLOG_WELCOME_MESSAGE';" >> $microblog_config_file
|
||||||
echo "$config['site']['qvitter']['blocked_ips'] = array();" >> $microblog_config_file
|
echo "\$config['site']['qvitter']['blocked_ips'] = array();" >> $microblog_config_file
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! grep -q "GNU Social theme commit" $COMPLETION_FILE; then
|
if ! grep -q "GNU Social theme commit" $COMPLETION_FILE; then
|
||||||
|
|
Loading…
Reference in New Issue