Set web directory

main
bashrc 2026-02-23 20:55:21 +00:00
parent 6546131ba8
commit 5dfb479bfc
1 changed files with 5 additions and 8 deletions

View File

@ -262,12 +262,9 @@ web_dir=/var/www
if [ -f /usr/bin/pacman ]; then if [ -f /usr/bin/pacman ]; then
web_dir=/srv/http web_dir=/srv/http
fi fi
if [ ! -d /var/www/${ONION_DOMAIN}/htdocs ]; then
mkdir -p /var/www/${ONION_DOMAIN}/htdocs
fi
if [ ! -d /var/www/${ONION_DOMAIN}/htdocs ]; then if [ ! -d "${web_dir}/${ONION_DOMAIN}/htdocs" ]; then
mkdir -p /var/www/${ONION_DOMAIN}/htdocs mkdir -p "${web_dir}/${ONION_DOMAIN}/htdocs"
fi fi
echo "Creating nginx virtual host for ${ONION_DOMAIN}" echo "Creating nginx virtual host for ${ONION_DOMAIN}"
@ -291,7 +288,7 @@ echo "Creating nginx virtual host for ${ONION_DOMAIN}"
echo ' index index.html;'; echo ' index index.html;';
echo ''; echo '';
echo ' location /newsmirror {'; echo ' location /newsmirror {';
echo " root /var/www/${ONION_DOMAIN}/htdocs;"; echo " root ${web_dir}/${ONION_DOMAIN}/htdocs;";
echo ' try_files $uri =404;'; echo ' try_files $uri =404;';
echo ' }'; echo ' }';
echo ''; echo '';
@ -318,12 +315,12 @@ echo "Creating nginx virtual host for ${ONION_DOMAIN}"
echo ' }'; echo ' }';
echo '}'; } > "/etc/nginx/sites-available/${username}" echo '}'; } > "/etc/nginx/sites-available/${username}"
chown -R www-data:www-data /var/www/${ONION_DOMAIN}/htdocs chown -R www-data:www-data ${web_dir}/${ONION_DOMAIN}/htdocs
if [ ! -d ${install_destination}/accounts/newsmirror ]; then if [ ! -d ${install_destination}/accounts/newsmirror ]; then
mkdir -p ${install_destination}/accounts/newsmirror mkdir -p ${install_destination}/accounts/newsmirror
chown -R ${username}:${username} ${install_destination} chown -R ${username}:${username} ${install_destination}
fi fi
ln -s ${install_destination}/newsmirror /var/www/${ONION_DOMAIN}/htdocs/newsmirror ln -s ${install_destination}/newsmirror ${web_dir}/${ONION_DOMAIN}/htdocs/newsmirror
ln -s "/etc/nginx/sites-available/${username}" /etc/nginx/sites-enabled/ ln -s "/etc/nginx/sites-available/${username}" /etc/nginx/sites-enabled/
systemctl restart nginx systemctl restart nginx