|  | @@ -54,8 +54,15 @@ fedwiki_variables=(FEDWIKI_DOMAIN_NAME
 | 
	
		
			
			| 54 | 54 |                     MY_EMAIL_ADDRESS)
 | 
	
		
			
			| 55 | 55 |  
 | 
	
		
			
			| 56 | 56 |  function fedwiki_remove_bad_links {
 | 
	
		
			
			| 57 |  | -    if [ -f /usr/local/lib/node_modules/wiki/node_modules/wiki-security-friends/client/security.js ]; then
 | 
	
		
			
			| 58 |  | -        sed -i 's|maxcdn.bootstrapcdn.com|localhost|g' /usr/local/lib/node_modules/wiki/node_modules/wiki-security-friends/client/security.js
 | 
	
		
			
			|  | 57 | +    if [[ $ONION_ONLY == 'no' ]]; then
 | 
	
		
			
			|  | 58 | +        sed -i "s|link[href='https://maxcdn.bootstrapcdn.com.*|link[href='https://${FEDWIKI_DOMAIN_NAME}/fonts-font-awesome/css/font-awesome.min.css']\").length) {|g" /usr/local/lib/node_modules/wiki/node_modules/wiki-security-friends/client/security.js
 | 
	
		
			
			|  | 59 | +
 | 
	
		
			
			|  | 60 | +        sed -i "s|\$('<link rel=\"stylesheet\" href=\"https://maxcdn.bootstrapcdn.com.*|\$('<link rel=\"stylesheet\" href=\"https://${FEDWIKI_DOMAIN_NAME}/fonts-font-awesome/css/font-awesome.min.css\">').appendTo(\"head\");|g" /usr/local/lib/node_modules/wiki/node_modules/wiki-security-friends/client/security.js
 | 
	
		
			
			|  | 61 | +    else
 | 
	
		
			
			|  | 62 | +        FEDWIKI_ONION_HOSTNAME=$(cat /var/lib/tor/hidden_service_fedwiki/hostname)
 | 
	
		
			
			|  | 63 | +        sed -i "s|link[href='https://maxcdn.bootstrapcdn.com.*|link[href='http://${FEDWIKI_ONION_HOSTNAME}/fonts-font-awesome/css/font-awesome.min.css']\").length) {|g" /usr/local/lib/node_modules/wiki/node_modules/wiki-security-friends/client/security.js
 | 
	
		
			
			|  | 64 | +
 | 
	
		
			
			|  | 65 | +        sed -i "s|\$('<link rel=\"stylesheet\" href=\"https://maxcdn.bootstrapcdn.com.*|\$('<link rel=\"stylesheet\" href=\"http://${FEDWIKI_ONION_HOSTNAME}/fonts-font-awesome/css/font-awesome.min.css\">').appendTo(\"head\");|g" /usr/local/lib/node_modules/wiki/node_modules/wiki-security-friends/client/security.js
 | 
	
		
			
			| 59 | 66 |      fi
 | 
	
		
			
			| 60 | 67 |  
 | 
	
		
			
			| 61 | 68 |      if [ -f /usr/local/lib/node_modules/wiki/node_modules/localforage/docs/theme/style.css ]; then
 | 
	
	
		
			
			|  | @@ -333,6 +340,10 @@ function fedwiki_setup_web {
 | 
	
		
			
			| 333 | 340 |          echo '  add_header X-Content-Type-Options nosniff;' >> $fedwiki_nginx_file
 | 
	
		
			
			| 334 | 341 |          echo '  add_header Strict-Transport-Security max-age=15768000;' >> $fedwiki_nginx_file
 | 
	
		
			
			| 335 | 342 |          echo '' >> $fedwiki_nginx_file
 | 
	
		
			
			|  | 343 | +        echo '  location /fonts-font-awesome/ {' >> $fedwiki_nginx_file
 | 
	
		
			
			|  | 344 | +        echo '    alias /usr/share/fonts-font-awesome/;' >> $fedwiki_nginx_file
 | 
	
		
			
			|  | 345 | +        echo '  }' >> $fedwiki_nginx_file
 | 
	
		
			
			|  | 346 | +        echo '' >> $fedwiki_nginx_file
 | 
	
		
			
			| 336 | 347 |          echo '  location / {' >> $fedwiki_nginx_file
 | 
	
		
			
			| 337 | 348 |          echo "    proxy_pass http://localhost:${FEDWIKI_PORT};" >> $fedwiki_nginx_file
 | 
	
		
			
			| 338 | 349 |          echo '    proxy_set_header X-Real-IP $remote_addr;' >> $fedwiki_nginx_file
 | 
	
	
		
			
			|  | @@ -354,6 +365,10 @@ function fedwiki_setup_web {
 | 
	
		
			
			| 354 | 365 |      echo '  add_header X-Frame-Options DENY;' >> $fedwiki_nginx_file
 | 
	
		
			
			| 355 | 366 |      echo '  add_header X-Content-Type-Options nosniff;' >> $fedwiki_nginx_file
 | 
	
		
			
			| 356 | 367 |      echo '' >> $fedwiki_nginx_file
 | 
	
		
			
			|  | 368 | +    echo '  location /fonts-font-awesome/ {' >> $fedwiki_nginx_file
 | 
	
		
			
			|  | 369 | +    echo '    alias /usr/share/fonts-font-awesome/;' >> $fedwiki_nginx_file
 | 
	
		
			
			|  | 370 | +    echo '  }' >> $fedwiki_nginx_file
 | 
	
		
			
			|  | 371 | +    echo '' >> $fedwiki_nginx_file
 | 
	
		
			
			| 357 | 372 |      echo '  location / {' >> $fedwiki_nginx_file
 | 
	
		
			
			| 358 | 373 |      echo "    proxy_pass http://localhost:${FEDWIKI_PORT};" >> $fedwiki_nginx_file
 | 
	
		
			
			| 359 | 374 |      echo '    proxy_set_header X-Real-IP $remote_addr;' >> $fedwiki_nginx_file
 | 
	
	
		
			
			|  | @@ -401,6 +416,8 @@ function install_fedwiki {
 | 
	
		
			
			| 401 | 416 |      function_check install_nodejs
 | 
	
		
			
			| 402 | 417 |      install_nodejs fedwiki
 | 
	
		
			
			| 403 | 418 |  
 | 
	
		
			
			|  | 419 | +    apt-get -yq install fonts-font-awesome
 | 
	
		
			
			|  | 420 | +
 | 
	
		
			
			| 404 | 421 |      npm install -g wiki@$FEDWIKI_VERSION
 | 
	
		
			
			| 405 | 422 |      if [ ! "$?" = "0" ]; then
 | 
	
		
			
			| 406 | 423 |          echo $'Failed to install fedwiki'
 |