Browse Source

move tor config to copper

main
Zen 3 years ago
parent
commit
12f6433137
  1. 58
      ingredients/copper
  2. 7
      ingredients/silver
  3. 22
      recipes/ao.sh

58
ingredients/copper

@ -1,3 +1,61 @@
#!/bin/sh
# Bare Metal Alchemist, 2022
#############################################
# Copper - ♀ #
#############################################
# Copper wires form the backbone of electrical systems worldwide
# and much of the internet as a whole.
# This ingredient is focused around scripts that make it easier to
# interact with and create new networks on your system.
locate_torrc() {
if [ -n $TORRCPATH ]; then
if [ -e /usr/local/etc/tor/torrc ]; then
TORRCPATH='/usr/local/etc/tor/torrc'
elif [ -e /etc/tor/torrc ]; then
TORRCPATH='/etc/tor/torrc'
elif [ -e $HOME/.tor/torrc ]; then
TORRCPATH="${HOME}/.tor/torrc"
else
echo -e "${RED}Uh oh...${RESET} I couldn't figure out where your torrc file is. That might cause some issues"
exit 1
fi
fi
echo -e "Your torrc is located at ${BLUE}${TORRCPATH}${RESET}"
echo "TORRCPATH=${TORRCPATH}" > .env
}
configure_tor() {
locate_torrc
echo -e "Your existing torrc file has the following settings: "
echo ""
cat $TORRCPATH | grep '^[^#]'
echo ""
echo -en "Would you like to reset them?: ${BLUE}(y/n)${RESET} "
read torrc_reset
case $torrc_reset in
"Y" | "y")
cp resources/torrc-template .
sudo sed -i "s#USER#${USER}#g" torrc-template
sudo sed -i "s#HOME#${HOME}#g" torrc-template
sudo mv torrc-template $TORRCPATH
echo -e "${GREEN}Torrc file reset!${RESET}"
;;
'*')
echo "Okay, we'll leave it as is."
;;
esac
echo ""
echo -e "Tor configuration ${GREEN}complete!${RESET}"
}
# internet connections? copper wires etc.
# using yggdrasil could maybe fit in here
# nginx setup

7
ingredients/silver

@ -0,0 +1,7 @@
silver corresponds to the moon, and therefore darkness and shadow.
should system daemon creation go in here?
equitable crypto
Eventually, this will implement full moonbeam. for now, moonbeam
as a python script.

22
recipes/ao.sh

@ -4,6 +4,7 @@
# Bare Metal Alchemist, 2022
source ingredients/lead
source ingredients/copper
source ingredients/gold
clear
@ -133,26 +134,7 @@ echo ''
if [ $AO = "3" ] || [ $AO = 'react' ]; then
echo -e "${BOLD}Installing and configuring Tor${RESET}\n"
install_if_needed tor
if [ -e /usr/local/etc/tor/torrc ]; then
TORRCPATH='/usr/local/etc/tor/torrc'
elif [ -e /etc/tor/torrc ]; then
TORRCPATH='/etc/tor/torrc'
fi
# Configure and write torrc file
cp resources/torrc-template .
sudo sed -i "s#USER#${USER}#g" torrc-template
sudo sed -i "s#HOME#${HOME}#g" torrc-template
if [ -z "$TORRCPATH" ]; then
echo -e "${RED}Uh oh...${RESET} I couldn't figure out where your torrc file is. That might cause some issues"
sleep 3
echo -e "\nAnyways...\n"
sleep 2
else
sudo mv torrc-template $TORRCPATH
fi
configure_tor
fi
# ------------------- Step 3 - AO Installation -------------------

Loading…
Cancel
Save