+ create wp config & restore perms example helpers scripts
+ gitignore with .idea
This commit is contained in:
		
							
								
								
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@ -0,0 +1 @@
 | 
			
		||||
.idea
 | 
			
		||||
							
								
								
									
										22
									
								
								wp/create-config.sh.example
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								wp/create-config.sh.example
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,22 @@
 | 
			
		||||
#!/bin/bash
 | 
			
		||||
NAME=invatur
 | 
			
		||||
wp core config --dbname=$NAME --dbuser=$NAME --dbpass=$NAME --dbhost=db
 | 
			
		||||
 | 
			
		||||
sed -i 's/<?php//' wp-config.php
 | 
			
		||||
 | 
			
		||||
cat << \EOF | cat - wp-config.php > /tmp/out && mv /tmp/out wp-config.php
 | 
			
		||||
<?php
 | 
			
		||||
if (@$_SERVER['HTTP_HOST']) {
 | 
			
		||||
    define('WP_SITEURL', 'http://'.$_SERVER['HTTP_HOST']);
 | 
			
		||||
    define('WP_HOME', 'http://'.$_SERVER['HTTP_HOST']);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
//if ($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https'){
 | 
			
		||||
//    $_SERVER['HTTPS']       = 'on';
 | 
			
		||||
//    $_SERVER['SERVER_PORT'] = 443;
 | 
			
		||||
//}
 | 
			
		||||
 | 
			
		||||
define('FS_METHOD', 'direct');
 | 
			
		||||
EOF
 | 
			
		||||
 | 
			
		||||
#wp plugin deactivate wp-force-https
 | 
			
		||||
							
								
								
									
										10
									
								
								wp/restore-perms.sh.example
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										10
									
								
								wp/restore-perms.sh.example
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,10 @@
 | 
			
		||||
#!/bin/bash
 | 
			
		||||
DIRS=( wp-content/plugins )
 | 
			
		||||
export WEB_GID=33
 | 
			
		||||
perms() {
 | 
			
		||||
  sudo chown -R $UID:$WEB_GID "$1"
 | 
			
		||||
  sudo chmod -R g+rwx "$1"
 | 
			
		||||
}
 | 
			
		||||
for DIR in "${DIRS[@]}"; do
 | 
			
		||||
  perms "$DIR"
 | 
			
		||||
done
 | 
			
		||||
		Reference in New Issue
	
	Block a user