Skip to content

Commit

Permalink
Update install & uninstall scripts
Browse files Browse the repository at this point in the history
Signed-off-by: celenity <[email protected]>
  • Loading branch information
celenityy committed Dec 16, 2024
1 parent 2d6a69b commit 56f54a6
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 260 deletions.
28 changes: 2 additions & 26 deletions installer_scripts/arch_install_paru.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,32 +24,8 @@ error_fn() {


## Install Phoenix
echo_green_text "Downloading phoenix.cfg..."
wget -nv https://phoenix.celenity.dev/phoenix.cfg || error_fn
echo

echo_green_text "Moving phoenix.cfg to /usr/lib/firefox/phoenix.cfg..."
sudo mv -v phoenix.cfg /usr/lib/firefox/phoenix.cfg || error_fn
echo

echo_green_text "Downloading phoenix.js..."
wget -nv https://phoenix.celenity.dev/defaults/pref/phoenix.js || error_fn
echo

echo_green_text "Creating /etc/firefox/defaults/pref directory..."
sudo mkdir -v -p /etc/firefox/defaults/pref || error_fn
echo

echo_green_text "Changing permissions of /etc/firefox/defaults/pref to 655..."
sudo chmod -v 655 /etc/firefox/defaults/pref || error_fn
echo

echo_green_text "Moving phoenix.js to /etc/firefox/defaults/pref/phoenix.js..."
sudo mv -v phoenix.js /etc/firefox/defaults/pref/phoenix.js || error_fn
echo

echo_green_text "Installing phoenix-policies from the AUR..."
paru -S phoenix-policies || error_fn
echo_green_text "Installing phoenix-arch from the AUR..."
paru -S phoenix-arch || error_fn
echo

echo_green_text "All done. :) Congratulations, you've successfully installed Phoenix.\nWhat comes next is for you to decide. I would strongly recommend taking a look at some of the user.js files we offer, such as our 'Hardened' option for more comprehensive protection, at the cost of minimal breakage.\nYou can learn more here https://phoenix.celenity.dev/#complete-coverage.\n"
28 changes: 2 additions & 26 deletions installer_scripts/arch_install_yay.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,32 +24,8 @@ error_fn() {


## Install Phoenix
echo_green_text "Downloading phoenix.cfg..."
wget -nv https://phoenix.celenity.dev/phoenix.cfg || error_fn
echo

echo_green_text "Moving phoenix.cfg to /usr/lib/firefox/phoenix.cfg..."
sudo mv -v phoenix.cfg /usr/lib/firefox/phoenix.cfg || error_fn
echo

echo_green_text "Downloading phoenix.js..."
wget -nv https://phoenix.celenity.dev/defaults/pref/phoenix.js || error_fn
echo

echo_green_text "Creating /etc/firefox/defaults/pref directory..."
sudo mkdir -v -p /etc/firefox/defaults/pref || error_fn
echo

echo_green_text "Changing permissions of /etc/firefox/defaults/pref to 655..."
sudo chmod -v 655 /etc/firefox/defaults/pref || error_fn
echo

echo_green_text "Moving phoenix.js to /etc/firefox/defaults/pref/phoenix.js..."
sudo mv -v phoenix.js /etc/firefox/defaults/pref/phoenix.js || error_fn
echo

echo_green_text "Installing phoenix-policies from the AUR..."
yay -S phoenix-policies || error_fn
echo_green_text "Installing phoenix-arch from the AUR..."
yay -S phoenix-arch || error_fn
echo

echo_green_text "All done. :) Congratulations, you've successfully installed Phoenix.\nWhat comes next is for you to decide. I would strongly recommend taking a look at some of the user.js files we offer, such as our 'Hardened' option for more comprehensive protection, at the cost of minimal breakage.\nYou can learn more here https://phoenix.celenity.dev/#complete-coverage.\n"
32 changes: 4 additions & 28 deletions installer_scripts/fedora_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,40 +54,16 @@ fi


## Install Phoenix
echo_green_text "Downloading phoenix.cfg..."
wget -nv https://phoenix.celenity.dev/phoenix.cfg || error_fn
echo

echo_green_text "Moving phoenix.cfg to /usr/lib64/firefox/phoenix.cfg..."
sudo mv -v phoenix.cfg /usr/lib64/firefox/phoenix.cfg || error_fn
echo

echo_green_text "Downloading phoenix.js..."
wget -nv https://phoenix.celenity.dev/defaults/pref/phoenix.js || error_fn
echo

echo_green_text "Creating /etc/firefox/defaults/pref directory..."
sudo mkdir -v -p /etc/firefox/defaults/pref || error_fn
echo

echo_green_text "Changing permissions of /etc/firefox/defaults/pref to 655..."
sudo chmod -v 655 /etc/firefox/defaults/pref || error_fn
echo

echo_green_text "Moving phoenix.js to /etc/firefox/defaults/pref/phoenix.js..."
sudo mv -v phoenix.js /etc/firefox/defaults/pref/phoenix.js || error_fn
echo

echo_green_text "Adding Phoenix-Policies COPR Repo to DNF..."
sudo dnf copr enable celenity/phoenix-policies || error_fn
echo_green_text "Adding Phoenix COPR Repo to DNF..."
sudo dnf copr enable celenity/copr || error_fn
echo

echo_green_text "Updating DNF cache..."
sudo dnf update --refresh || error_fn
echo

echo_green_text "Installing phoenix-policies package..."
sudo dnf install phoenix-policies || error_fn
echo_green_text "Installing phoenix package..."
sudo dnf install phoenix || error_fn
echo

echo_green_text "All done. :) Congratulations, you've successfully installed Phoenix.\nWhat comes next is for you to decide. I would strongly recommend taking a look at some of the user.js files we offer, such as our 'Hardened' option for more comprehensive protection, at the cost of minimal breakage.\nYou can learn more here https://phoenix.celenity.dev/#complete-coverage.\n"
74 changes: 2 additions & 72 deletions installer_scripts/macos_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,30 +23,6 @@ error_fn() {
}

## Install Phoenix
echo_green_text "Downloading phoenix.cfg..."
wget -nv https://phoenix.celenity.dev/phoenix.cfg || error_fn
echo

echo_green_text "Moving phoenix.cfg to /Applications/Firefox.app/Contents/Resources/phoenix.cfg..."
sudo mv -v phoenix.cfg /Applications/Firefox.app/Contents/Resources/phoenix.cfg || error_fn
echo

echo_green_text "Downloading phoenix.js..."
wget -nv https://phoenix.celenity.dev/defaults/pref/phoenix.js || error_fn
echo

echo_green_text "Creating /Applications/Firefox.app/Contents/Resources/defaults/pref directory..."
sudo mkdir -v -p /Applications/Firefox.app/Contents/Resources/defaults/pref || error_fn
echo

echo_green_text "Changing permissions of /Applications/Firefox.app/Contents/Resources/defaults/pref to 655..."
sudo chmod -v 655 /Applications/Firefox.app/Contents/Resources/defaults/pref || error_fn
echo

echo_green_text "Moving phoenix.js to /Applications/Firefox.app/Contents/Resources/defaults/pref/phoenix.js..."
sudo mv -v phoenix.js /Applications/Firefox.app/Contents/Resources/defaults/pref/phoenix.js || error_fn
echo

echo_green_text "Adding celenity's Tap to Homebrew..."
brew tap celenity/tap https://codeberg.org/celenity/tap || error_fn
echo
Expand All @@ -55,54 +31,8 @@ echo_green_text "Updating Homebrew cache..."
brew update && brew upgrade --force --verbose || error_fn
echo

echo_green_text "Installing phoenix-policies package..."
brew install phoenix-policies || error_fn
echo

echo_green_text "Moving Phoenix's policies.json from /opt/homebrew/opt/phoenix-policies/etc/firefox/distribution/policies.json to /Applications/Firefox.app/Contents/Resources/distribution/policies.json..."
cp /opt/homebrew/opt/phoenix-policies/etc/firefox/distribution/policies.json /Applications/Firefox.app/Contents/Resources/distribution/policies.json || error_fn
echo

echo_green_text "Creating a script to automatically copy Phoenix's policies.json from /opt/homebrew/opt/phoenix-policies/etc/firefox/distribution/policies.json to /Applications/Firefox.app/Contents/Resources/distribution/policies.json for updates..."
cat << 'EOF' > /usr/local/sbin/update_policies_phoenix.sh
#!/bin/zsh
cp /opt/homebrew/opt/phoenix-policies/etc/firefox/distribution/policies.json /Applications/Firefox.app/Contents/Resources/distribution/policies.json
EOF || error_fn
echo

echo_green_text "Making /usr/local/sbin/update_policies_phoenix.sh executable..."
sudo chmod -v +x /usr/local/sbin/update_policies_phoenix.sh || error_fn
echo

echo_green_text "Creating a launch agent to automatically copy Phoenix's policies.json from /opt/homebrew/opt/phoenix-policies/etc/firefox/distribution/policies.json to /Applications/Firefox.app/Contents/Resources/distribution/policies.json for updates..."
cat << 'EOF' > ~/Library/LaunchAgents/com.user.updatepoliciesphoenix.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.user.updatepoliciesphoenix</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/sbin/update_policies_phoenix.sh</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>StartInterval</key>
<integer>21600</integer> <!-- 6 hours in seconds -->
</dict>
</plist>
EOF || error_fn
echo

echo_green_text "Loading ~/Library/LaunchAgents/com.user.updatepoliciesphoenix.plist..."
launchctl load ~/Library/LaunchAgents/com.user.updatepoliciesphoenix.plist || error_fn
echo

echo_green_text "Setting a 'phoenix-up' alias to easily update Phoenix's policies..."
echo 'alias phoenix-up="cp /opt/homebrew/opt/phoenix-policies/etc/firefox/distribution/policies.json /Applications/Firefox.app/Contents/Resources/distribution/policies.json"' >> ~/.zshrc || error_fn
echo_green_text "Installing phoenix-osx package..."
brew install phoenix-osx || error_fn
echo

echo_green_text "All done. :) Congratulations, you've successfully installed Phoenix.\nWhat comes next is for you to decide. I would strongly recommend taking a look at some of the user.js files we offer, such as our 'Hardened' option for more comprehensive protection, at the cost of minimal breakage.\nYou can learn more here https://phoenix.celenity.dev/#complete-coverage.\n"

echo_green_text "NOTE: Due to macOS limitations, by default, your policies will only update every 6 hours or on device boot. If you want to enforce a policies update, you can run "phoenix-up" after the update is downloaded download with Homebrew.\nYou can also set an alias in your ~/.zshrc to make this easier, such as:\nalias update='brew update && brew upgrade --force --verbose && phoenix-up'"
20 changes: 2 additions & 18 deletions uninstaller_scripts/arch_uninstall_paru.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,8 @@ error_fn() {


## Uninstall Phoenix
echo_green_text "Removing phoenix.cfg..."
sudo rm -f /usr/lib/firefox/phoenix.cfg || error_fn
echo

echo_green_text "Removing phoenix.js..."
sudo rm -f /etc/firefox/defaults/pref/phoenix.js || error_fn
echo

echo_green_text "Removing legacy mozilla.cfg if installed..."
sudo rm -f /usr/lib/firefox/mozilla.cfg || error_fn
echo

echo_green_text "Removing legacy local-settings.js if installed..."
sudo rm -f /usr/lib/firefox/defaults/pref/local-settings.js || error_fn
echo

echo_green_text "Uninstalling phoenix-policies..."
paru -Rcns phoenix-policies || error_fn
echo_green_text "Uninstalling phoenix-arch..."
paru -Rcns phoenix-arch || error_fn
echo

echo_green_text "Thanks for giving Phoenix a shot. Sorry to see you go :(. Please leave feedback on how we can improve! https://phoenix.celenity.dev/issues"
20 changes: 2 additions & 18 deletions uninstaller_scripts/arch_uninstall_yay.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,8 @@ error_fn() {


## Uninstall Phoenix
echo_green_text "Removing phoenix.cfg..."
sudo rm -f /usr/lib/firefox/phoenix.cfg || error_fn
echo

echo_green_text "Removing phoenix.js..."
sudo rm -f /etc/firefox/defaults/pref/phoenix.js || error_fn
echo

echo_green_text "Removing legacy mozilla.cfg if installed..."
sudo rm -f /usr/lib/firefox/mozilla.cfg || error_fn
echo

echo_green_text "Removing legacy local-settings.js if installed..."
sudo rm -f /usr/lib/firefox/defaults/pref/local-settings.js || error_fn
echo

echo_green_text "Uninstalling phoenix-policies..."
yay -Rcns phoenix-policies || error_fn
echo_green_text "Uninstalling phoenix-arch..."
yay -Rcns phoenix-arch || error_fn
echo

echo_green_text "Thanks for giving Phoenix a shot. Sorry to see you go :(. Please leave feedback on how we can improve! https://phoenix.celenity.dev/issues"
28 changes: 2 additions & 26 deletions uninstaller_scripts/fedora_uninstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,32 +20,8 @@ error_fn() {


## Uninstall Phoenix
echo_green_text "Removing phoenix.cfg..."
sudo rm -f /usr/lib64/firefox/phoenix.cfg || error_fn
echo

echo_green_text "Removing phoenix.js..."
sudo rm -f /etc/firefox/defaults/pref/phoenix.js || error_fn
echo

echo_green_text "Removing legacy mozilla.cfg if installed..."
sudo rm -f /usr/lib64/firefox/mozilla.cfg || error_fn
echo

echo_green_text "Removing legacy local-settings.js if installed..."
sudo rm -f /usr/lib64/firefox/defaults/pref/local-settings.js || error_fn
echo

echo_green_text "Uninstalling phoenix-policies..."
sudo dnf remove phoenix-policies || error_fn
echo

echo_green_text "Removing Phoenix-Policies COPR Repo..."
sudo dnf copr remove celenity/phoenix-policies || error_fn
echo

echo_green_text "Updating DNF cache..."
sudo dnf update --refresh || error_fn
echo_green_text "Uninstalling phoenix..."
sudo dnf remove phoenix || error_fn
echo

echo_green_text "Thanks for giving Phoenix a shot. Sorry to see you go :(. Please leave feedback on how we can improve! https://phoenix.celenity.dev/issues"
48 changes: 2 additions & 46 deletions uninstaller_scripts/macos_uninstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,52 +20,8 @@ error_fn() {


## Uninstall Phoenix
echo_green_text "Removing phoenix.cfg..."
sudo rm -f /Applications/Firefox.app/Contents/Resources/phoenix.cfg || error_fn
echo

echo_green_text "Removing phoenix.js..."
sudo rm -f /Applications/Firefox.app/Contents/Resources/defaults/pref/phoenix.js || error_fn
echo

echo_green_text "Removing legacy mozilla.cfg if installed..."
sudo rm -f /Applications/Firefox.app/Contents/Resources/mozilla.cfg || error_fn
echo

echo_green_text "Removing legacy local-settings.js if installed..."
sudo rm -f /Applications/Firefox.app/Contents/Resources/defaults/pref/local-settings.js || error_fn
echo

echo_green_text "Unloading ~/Library/LaunchAgents/com.user.updatepoliciesphoenix.plist..."
sudo launchctl unload -w ~/Library/LaunchAgents/com.user.updatepoliciesphoenix.plist || error_fn
echo

echo_green_text "Removing ~/Library/LaunchAgents/com.user.updatepoliciesphoenix.plist..."
sudo rm -f ~/Library/LaunchAgents/com.user.updatepoliciesphoenix.plist || error_fn
echo

echo_green_text "Removing /usr/local/sbin/update_policies_phoenix.sh..."
sudo rm -f /usr/local/sbin/update_policies_phoenix.sh || error_fn
echo

echo_green_text "Removing policies.json..."
sudo rm -f /Applications/Firefox.app/Contents/Resources/distribution/policies.json || error_fn
echo

echo_green_text "Uninstalling phoenix-policies..."
brew uninstall phoenix-policies || error_fn
echo

echo_green_text "Removing celenity's Tap from Homebrew..."
brew untap celenity/tap || error_fn
echo

echo_green_text "Removing legacy Phoenix-Policies-macOS Tap from Homebrew if installed..."
brew untap celenity/Phoenix-Policies-macOS || error_fn
echo

echo_green_text "Updating Homebrew cache..."
brew update || error_fn
echo_green_text "Uninstalling phoenix-osx..."
brew uninstall phoenix-osx || error_fn
echo

echo_green_text "Thanks for giving Phoenix a shot. Sorry to see you go :(. Please leave feedback on how we can improve! https://phoenix.celenity.dev/issues"

0 comments on commit 56f54a6

Please sign in to comment.