You've already forked mastodon-utils
							
							
				mirror of
				https://github.com/jakejarvis/mastodon-utils.git
				synced 2025-11-04 10:20:11 -05:00 
			
		
		
		
	apply patches during upgrade script
This commit is contained in:
		
							
								
								
									
										14
									
								
								nginx/sites-available/default.conf
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								nginx/sites-available/default.conf
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,14 @@
 | 
			
		||||
# don't respond to direct IP address requests
 | 
			
		||||
 | 
			
		||||
server {
 | 
			
		||||
  listen 80 default_server;
 | 
			
		||||
  listen [::]:80 default_server;
 | 
			
		||||
 | 
			
		||||
  listen 443 default_server;
 | 
			
		||||
  listen [::]:443 default_server;
 | 
			
		||||
 | 
			
		||||
  ssl_reject_handshake on;
 | 
			
		||||
 | 
			
		||||
  server_name _;
 | 
			
		||||
  return 444;
 | 
			
		||||
}
 | 
			
		||||
@@ -14,8 +14,8 @@ upstream streaming {
 | 
			
		||||
proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=CACHE:10m inactive=7d max_size=1g;
 | 
			
		||||
 | 
			
		||||
server {
 | 
			
		||||
  listen 80;
 | 
			
		||||
  listen [::]:80;
 | 
			
		||||
  listen 80;
 | 
			
		||||
 | 
			
		||||
  server_name fediverse.jarv.is;
 | 
			
		||||
 | 
			
		||||
@@ -33,11 +33,11 @@ server {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
server {
 | 
			
		||||
  server_name fediverse.jarv.is;
 | 
			
		||||
 | 
			
		||||
  listen [::]:443 ssl; # managed by Certbot
 | 
			
		||||
  listen 443 ssl; # managed by Certbot
 | 
			
		||||
 | 
			
		||||
  server_name fediverse.jarv.is;
 | 
			
		||||
 | 
			
		||||
  ssl_certificate /etc/letsencrypt/live/fediverse.jarv.is/fullchain.pem; # managed by Certbot
 | 
			
		||||
  ssl_certificate_key /etc/letsencrypt/live/fediverse.jarv.is/privkey.pem; # managed by Certbot
 | 
			
		||||
  include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
 | 
			
		||||
@@ -47,8 +47,6 @@ server {
 | 
			
		||||
  ssl_stapling on;
 | 
			
		||||
  ssl_stapling_verify on;
 | 
			
		||||
  ssl_trusted_certificate /etc/letsencrypt/live/fediverse.jarv.is/chain.pem;
 | 
			
		||||
  # resolver 1.1.1.1 1.0.0.1 [2606:4700:4700::1111] [2606:4700:4700::1001] valid=300s; # Cloudflare
 | 
			
		||||
  # resolver_timeout 5s;
 | 
			
		||||
 | 
			
		||||
  keepalive_timeout    70;
 | 
			
		||||
  sendfile             on;
 | 
			
		||||
@@ -73,6 +71,11 @@ server {
 | 
			
		||||
    try_files $uri @proxy;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  # jake: added
 | 
			
		||||
  location ~ ^/dashboard/?$ {
 | 
			
		||||
    return 302 https://grafana.pipe.fail/public-dashboards/b5ca7a7c8e844f90b0973d2ab02bad0a;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  # If Docker is used for deployment and Rails serves static files,
 | 
			
		||||
  # then needed must replace line `try_files $uri =404;` with `try_files $uri @proxy;`.
 | 
			
		||||
  location = /sw.js {
 | 
			
		||||
@@ -170,7 +173,7 @@ server {
 | 
			
		||||
    proxy_cache_use_stale error timeout updating http_500 http_502 http_503 http_504;
 | 
			
		||||
    add_header X-Cached $upstream_cache_status;
 | 
			
		||||
 | 
			
		||||
    # jake: added
 | 
			
		||||
    # jake: added :)
 | 
			
		||||
    add_header X-Got-Milk "2%";
 | 
			
		||||
 | 
			
		||||
    tcp_nodelay on;
 | 
			
		||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										21
									
								
								scripts/apply_patches.sh
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										21
									
								
								scripts/apply_patches.sh
									
									
									
									
									
										Executable file
									
								
							@@ -0,0 +1,21 @@
 | 
			
		||||
#!/bin/bash
 | 
			
		||||
 | 
			
		||||
# exit when any step fails
 | 
			
		||||
set -euo pipefail
 | 
			
		||||
 | 
			
		||||
# default paths
 | 
			
		||||
MASTODON_ROOT=/home/mastodon
 | 
			
		||||
 | 
			
		||||
if [ ! -d "$MASTODON_ROOT/scripts" ]
 | 
			
		||||
then
 | 
			
		||||
  sudo -u mastodon git clone https://github.com/jakejarvis/mastodon-scripts.git ./scripts
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
# pull latest patches
 | 
			
		||||
cd "$MASTODON_ROOT/scripts"
 | 
			
		||||
sudo -u mastodon git fetch --all
 | 
			
		||||
sudo -u mastodon git pull origin main
 | 
			
		||||
 | 
			
		||||
# apply custom patches
 | 
			
		||||
cd "$MASTODON_ROOT/live"
 | 
			
		||||
sudo -u mastodon git apply --allow-binary-replacement --whitespace=warn "$MASTODON_ROOT"/mastodon-scripts/patches/*.patch || true
 | 
			
		||||
							
								
								
									
										0
									
								
								scripts/tootctl_shim.sh
									
									
									
									
									
										
										
										Normal file → Executable file
									
								
							
							
						
						
									
										0
									
								
								scripts/tootctl_shim.sh
									
									
									
									
									
										
										
										Normal file → Executable file
									
								
							
							
								
								
									
										3
									
								
								scripts/upgrade_glitch.sh
									
									
									
									
									
										
										
										Normal file → Executable file
									
								
							
							
						
						
									
										3
									
								
								scripts/upgrade_glitch.sh
									
									
									
									
									
										
										
										Normal file → Executable file
									
								
							@@ -20,6 +20,9 @@ sudo -u mastodon git fetch --all
 | 
			
		||||
sudo -u mastodon git checkout glitch-soc/main
 | 
			
		||||
sudo -u mastodon git pull glitch-soc main
 | 
			
		||||
 | 
			
		||||
# pull & apply latest patches
 | 
			
		||||
. $(dirname "$0")/apply_patches.sh
 | 
			
		||||
 | 
			
		||||
# update dependencies
 | 
			
		||||
echo "Updating deps..."
 | 
			
		||||
sudo -u mastodon "$RBENV_ROOT/shims/bundle" install --jobs "$(getconf _NPROCESSORS_ONLN)"
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										0
									
								
								scripts/version.sh
									
									
									
									
									
										
										
										Normal file → Executable file
									
								
							
							
						
						
									
										0
									
								
								scripts/version.sh
									
									
									
									
									
										
										
										Normal file → Executable file
									
								
							
							
								
								
									
										0
									
								
								scripts/weekly_cleanup.sh
									
									
									
									
									
										
										
										Normal file → Executable file
									
								
							
							
						
						
									
										0
									
								
								scripts/weekly_cleanup.sh
									
									
									
									
									
										
										
										Normal file → Executable file
									
								
							
		Reference in New Issue
	
	Block a user