Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update chroot-inside-Debian-Live.hook.chroot #457

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
34 changes: 34 additions & 0 deletions staging/config/hooks/live/chroot-inside-Debian-Live.hook.chroot
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,40 @@ python3 docker-drag/docker_pull.py ghcr.io/stamusnetworks/arkimeviewer:master
mv /opt/selksd/pull/*.tar /opt/selksd/SELKS/docker/tar_images
rm -rf /opt/selksd/pull/


NGINX_CONFIG="/etc/nginx/sites-available/default"

# Backup the default Nginx config
sudo cp "$NGINX_CONFIG" "$NGINX_CONFIG.bak"

# Add HTTP to HTTPS redirect
echo "server {
listen 80 default_server;
listen [::]:80 default_server;
server_name _;

# Redirect to HTTPS
return 301 https://\$host\$request_uri;
}

server {
listen 443 ssl default_server;
listen [::]:443 ssl default_server;

# SSL configurations go here

root /var/www/html;
index index.html index.htm index.nginx-debian.html;
server_name _;

location / {
try_files \$uri \$uri/ =404;
}

# Additional server block configurations go here
}" | sudo tee "$NGINX_CONFIG" > /dev/null


apt-get autoremove -y
apt-get clean && \
cat /dev/null > ~/.bash_history && history -c
Expand Down