updated sp

This commit is contained in:
naturallaw77 2023-07-10 00:52:30 -07:00
parent 2c4b58370a
commit 1166765e7d

View File

@ -8,29 +8,31 @@ ENDCOLOR="\e[0m"
pushd /etc/nixos/ pushd /etc/nixos/
sudo wget https://git.sovransystems.com/Sovran_Systems/Sovran_SystemsOS/raw/branch/main/For_NEW_Sovran_Pros_Upload/flake.nix wget https://git.sovransystems.com/Sovran_Systems/Sovran_SystemsOS/raw/branch/main/flake.nix
sudo chown root:root /etc/nixos/ -R chown root:root /etc/nixos/ -R
sudo chmod 770 /etc/nixos/ -R chmod 770 /etc/nixos/ -R
popd popd
# #
sudo rsync -av -e "ssh -i /root/sovransystems" root@192.168.1.32:/home/ /home rsync -av -e "ssh -i /root/factory_login_install" root@192.168.0.103:/home/ /home
sudo rsync -av -e "ssh -i /root/sovransystems" root@192.168.1.32:/var/lib/www/ /var/lib/www rsync -av -e "ssh -i /root/factory_login_install" root@192.168.0.103:/var/lib/www/ /var/lib/www
sudo rsync -av -e "ssh -i /root/sovransystems" root@192.168.1.32:/var/lib/domains/ /var/lib/domains rsync -av -e "ssh -i /root/factory_login_install" root@192.168.0.103:/var/lib/domains/ /var/lib/domains
sudo rsync -av -e "ssh -i /root/sovransystems" root@192.168.1.32:/var/lib/nextcloudaddition/ /var/lib/nextcloudaddition rsync -av -e "ssh -i /root/factory_login_install" root@192.168.0.103:/var/lib/nextcloudaddition/ /var/lib/nextcloudaddition
sudo rsync -av -e "ssh -i /root/sovransystems" root@192.168.1.32:/var/lib/njalla/ /var/lib/njalla rsync -av -e "ssh -i /root/factory_login_install" root@192.168.0.103:/var/lib/njalla/ /var/lib/njalla
sudo rsync -av -e "ssh -i /root/sovransystems" root@192.168.1.32:/var/lib/external_ip/ /var/lib/external_ip rsync -av -e "ssh -i /root/factory_login_install" root@192.168.0.103:/var/lib/external_ip/ /var/lib/external_ip
sudo rsync -av -e "ssh -i /root/sovransystems" root@192.168.1.32:/var/lib/secrets/ /var/lib/secrets rsync -av -e "ssh -i /root/factory_login_install" root@192.168.0.103:/var/lib/secrets/ /var/lib/secrets
rsync -av -e "ssh -i /root/factory_login_install" root@192.168.0.103:/var/lib/agenix-secrets/ /var/lib/agenix-secrets
# #
@ -38,116 +40,114 @@ nixos-rebuild switch --impure
# #
sudo chown root:root /var/lib/secrets/main -R chown root:root /var/lib/secrets/main -R
sudo chown matrix-synapse:matrix-synapse /var/lib/secrets/matrix_reg_secret -R chown root:root /var/lib/secrets/external_ip -R
sudo chown matrix-synapse:matrix-synapse /var/lib/secrets/matrixdb -R chown matrix-synapse:matrix-synapse /var/lib/secrets/matrix_reg_secret -R
sudo chown postgres:postgres /var/lib/secrets/nextclouddb -R chown matrix-synapse:matrix-synapse /var/lib/secrets/matrixdb -R
sudo chown turnserver:turnserver /var/lib/secrets/turn -R chown postgres:postgres /var/lib/secrets/nextclouddb -R
sudo chown mysql:mysql /var/lib/secrets/wordpressdb -R chown turnserver:turnserver /var/lib/secrets/turn -R
sudo chown vaultwarden:vaultwarden /var/lib/secrets/vaultwarden -R chown mysql:mysql /var/lib/secrets/wordpressdb -R
sudo chown onlyoffice:onlyoffice /var/lib/secrets/onlyofficejwtSecretFile chown vaultwarden:vaultwarden /var/lib/secrets/vaultwarden -R
sudo chmod 770 /var/lib/secrets/ -R chown onlyoffice:onlyoffice /var/lib/secrets/onlyofficejwtSecretFile
chmod 770 /var/lib/secrets/ -R
# #
sudo echo -e "${GREEN}What is your New Matrix (Element Chat) domain name?${ENDCOLOR}" echo -e "${GREEN}What is your New Matrix (Element Chat) domain name?${ENDCOLOR}"
read read
sudo echo -n $REPLY > /var/lib/domains/matrix echo -n $REPLY > /var/lib/domains/matrix
sudo echo -e "${GREEN}What is your New Wordpress domain name?${ENDCOLOR}" echo -e "${GREEN}What is your New Wordpress domain name?${ENDCOLOR}"
read read
sudo echo -n $REPLY > /var/lib/domains/wordpress echo -n $REPLY > /var/lib/domains/wordpress
sudo echo -e "${GREEN}What is your New Nextcloud domain name?${ENDCOLOR}" echo -e "${GREEN}What is your New Nextcloud domain name?${ENDCOLOR}"
read read
sudo echo -n $REPLY > /var/lib/domains/nextcloud echo -n $REPLY > /var/lib/domains/nextcloud
sudo echo -e "${GREEN}What is your New BTCPayserver domain name?${ENDCOLOR}" echo -e "${GREEN}What is your New BTCPayserver domain name?${ENDCOLOR}"
read read
sudo echo -n $REPLY > /var/lib/domains/btcpayserver echo -n $REPLY > /var/lib/domains/btcpayserver
sudo echo -e "${GREEN}What is your New Vaultwarden domain name?${ENDCOLOR}" echo -e "${GREEN}What is your New Vaultwarden domain name?${ENDCOLOR}"
read read
sudo echo -n $REPLY > /var/lib/domains/vaultwarden echo -n $REPLY > /var/lib/domains/vaultwarden
sudo echo -e "${GREEN}What is your New OnlyOffice domain name?${ENDCOLOR}" echo -e "${GREEN}What is your New OnlyOffice domain name?${ENDCOLOR}"
read read
sudo echo -n $REPLY > /var/lib/domains/onlyoffice echo -n $REPLY > /var/lib/domains/onlyoffice
sudo echo -e "${GREEN}What is the email you would like to use to manage the SSL certificates for your domains?${ENDCOLOR}" echo -e "${GREEN}What is the email you would like to use to manage the SSL certificates for your domains?${ENDCOLOR}"
read read
sudo echo -n $REPLY > /var/lib/domains/sslemail echo -n $REPLY > /var/lib/domains/sslemail
sudo chown caddy:php /var/lib/domains -R chown caddy:php /var/lib/domains -R
sudo chmod 770 /var/lib/domains -R chmod 770 /var/lib/domains -R
# #
set -x set -x
sudo rm -rf /home/free/.config/BraveSoftware rm -rf /home/free/.config/BraveSoftware
sudo rm -rf /home/free/.local/share/fish/fish_history rm -rf /home/free/.local/share/fish/fish_history
# #
sudo rm -rf /var/lib/www/wordpress/wp-config.php rm -rf /var/lib/www/wordpress/wp-config.php
sudo rm -rf /var/lib/www/nextcloud/config/config.php rm -rf /var/lib/www/nextcloud/config/config.php
sudo touch /var/lib/www/nextcloud/config/CAN_INSTALL touch /var/lib/www/nextcloud/config/CAN_INSTALL
sudo sed -i '$e cat /var/lib/nextcloudaddition/nextcloudaddition' /var/lib/www/nextcloud/config/config.php
sudo chown caddy:php /var/lib/www -R chown caddy:php /var/lib/www -R
sudo chmod 770 /var/lib/www -R chmod 770 /var/lib/www -R
# #
sudo mkdir /var/lib/nextcloud mkdir /var/lib/nextcloud
sudo chown caddy:php /var/lib/nextcloud -R chown caddy:php /var/lib/nextcloud -R
sudo chmod 770 /var/lib/nextcloud -R chmod 770 /var/lib/nextcloud -R
# #
sudo mkdir /var/lib/coturn mkdir /var/lib/coturn
sudo chown turnserver:turnserver /var/lib/coturn -R chown turnserver:turnserver /var/lib/coturn -R
sudo chmod 770 /var/lib/coturn -R chmod 770 /var/lib/coturn -R
###### Add coturn .pem from certificates
# #
sudo echo -n $(pwgen -s 17 -1) > /var/lib/secrets/nextclouddb echo -n $(pwgen -s 17 -1) > /var/lib/secrets/nextclouddb
sudo echo -n $(pwgen -s 17 -1) > /var/lib/secrets/wordpressdb echo -n $(pwgen -s 17 -1) > /var/lib/secrets/wordpressdb
sudo echo -n $(pwgen -s 17 -1) > /var/lib/secrets/matrixdb echo -n $(pwgen -s 17 -1) > /var/lib/secrets/matrixdb
sudo echo -n $(pwgen -s 17 -1) > /var/lib/secrets/turn echo -n $(pwgen -s 17 -1) > /var/lib/secrets/turn
sudo echo -n $(pwgen -s 17 -1) > /var/lib/secrets/matrix_reg_secret echo -n $(pwgen -s 17 -1) > /var/lib/secrets/matrix_reg_secret
sudo echo -n $(pwgen -s 17 -1) > /var/lib/secrets/main echo -n $(pwgen -s 17 -1) > /var/lib/secrets/main
sudo echo -n $(pwgen -s 17 -1) > /var/lib/secrets/onlyofficejwtSecretFile echo -n $(pwgen -s 17 -1) > /var/lib/secrets/onlyofficejwtSecretFile
sudo echo -n ADMIN_TOKEN=$(openssl rand -base64 48 echo -n ADMIN_TOKEN=$(openssl rand -base64 48
) > /var/lib/secrets/vaultwarden/vaultwarden.env ) > /var/lib/secrets/vaultwarden/vaultwarden.env
# #
sudo echo "root:$(cat /var/lib/secrets/main)" | chpasswd -c SHA512 echo "root:$(cat /var/lib/secrets/main)" | chpasswd -c SHA512
# #
@ -156,45 +156,45 @@ flatpak update
# #
sudo echo "free:a" | chpasswd -c SHA512 ssh-keygen -q -N "gosovransytems" -t ed25519 -f /home/free/.ssh/factory_login
sed -i -e "0,/ssh-ed25519.*/{ s::$(cat /home/free/.ssh/factory_login.pub): }" /root/.ssh/authorized_keys'
# #
sudo rm -rf /root/sp echo "free:a" | chpasswd -c SHA512
sudo rm -rf /root/Step_2_psp #
sudo rm -rf /root/.ssh rm -rf /root/sp
sudo rm -rf /home/free/.ssh rm -rf /root/factory_login
sudo rm -rf /root/sovransystems
sudo chown bitcoin:bitcoin /run/media/Second_Drive/BTCEcoandBackup/Bitcoin_Node -R chown bitcoin:bitcoin /run/media/Second_Drive/BTCEcoandBackup/Bitcoin_Node -R
sudo chmod 770 /run/media/Second_Drive/BTCEcoandBackup/Bitcoin_Node -R chmod 770 /run/media/Second_Drive/BTCEcoandBackup/Bitcoin_Node -R
sudo chown electrs:electrs /run/media/Second_Drive/BTCEcoandBackup/Electrs_Data -R chown electrs:electrs /run/media/Second_Drive/BTCEcoandBackup/Electrs_Data -R
sudo chmod 770 /run/media/Second_Drive/BTCEcoandBackup/Electrs_Data -R chmod 770 /run/media/Second_Drive/BTCEcoandBackup/Electrs_Data -R
nixos-rebuild switch --flake '/etc/nixos/#' --impure --update-input Sovran_Systems --commit-lock-file nixos-rebuild switch --impure
# #
set +x set +x
sudo echo -e "${GREEN}These four passwords are generated for convenience to use for the Web front end setup UI accounts for Nextcloud, Wordpress, VaultWarden, and BTCPayserver (if you want to use them).${ENDCOLOR} \n" echo -e "${GREEN}These four passwords are generated for convenience to use for the Web front end setup UI accounts for Nextcloud, Wordpress, VaultWarden, and BTCPayserver (if you want to use them).${ENDCOLOR} \n"
sudo echo -e "$(pwgen -s 17 -1) \n" echo -e "$(pwgen -s 17 -1) \n"
sudo echo -e "$(pwgen -s 17 -1) \n" echo -e "$(pwgen -s 17 -1) \n"
sudo echo -e "$(pwgen -s 17 -1) \n" echo -e "$(pwgen -s 17 -1) \n"
sudo echo -e "$(pwgen -s 17 -1) \n" echo -e "$(pwgen -s 17 -1) \n"
# #
sudo echo -e "${LIGHTBLUE}One last thing, you need to put the Njalla DDNS info from Njalla into njalla.sh.${ENDCOLOR} \n" echo -e "${LIGHTBLUE}One last thing, you need to put the Njalla DDNS info from Njalla into njalla.sh.${ENDCOLOR} \n"
sudo echo -e "${GREEN}All Finished! Please Reboot then Enjoy your New Sovran Pro!${ENDCOLOR} \n" echo -e "${GREEN}All Finished! Please Reboot then Enjoy your New Sovran Pro!${ENDCOLOR} \n"