Browse Source

make flask is working up to debug mode

main
Zen 3 years ago
parent
commit
84cdf7bc0a
  1. 4
      Makefile
  2. 2
      ingredients/copper
  3. 2
      ingredients/iron
  4. 16
      ingredients/lead
  5. 57
      recipes/init.sh

4
Makefile

@ -31,6 +31,10 @@ prosperity:
free:
@echo "This will install freespace, once it exists"
flask:
@chmod +x recipes/flask.sh
@recipes/flask.sh
manifest:
@chmod +x recipes/wordpress.sh

2
ingredients/copper

@ -281,4 +281,6 @@ check_ports() {
fi
}
# TODO Expose ports via firewalld
# using yggdrasil could maybe fit in here

2
ingredients/iron

@ -59,9 +59,7 @@ build_service_from_template() {
read reset
case $reset in
"Y" | "y")
cat /etc/systemd/system/
sudo rm $SERVICE_FILE
cat /etc/systemd/system/
;;
"N" | "n")
echo "Okay, we'll leave it as is."

16
ingredients/lead

@ -121,6 +121,14 @@ source_env
check_for() {
command -v "$1" >/dev/null
}
if [ "$EUID" -eq 0 ]; then
echo -e "${RED}Woah there!${RESET} Seems you're running this script as a superuser."
echo ""
echo "That might cause some issues with permissions and whatnot. Run this script as your default user (without sudo) and I'll ask you when I need superuser permissions"
echo ""
exit 1
fi
# This one installs utilities to your OS (If you need them!)
install_if_needed() {
@ -194,12 +202,12 @@ remember() {
say "Keys must consist only of capital letters and underscores"
fi
if [[ ! $VALUE =~ ^[A-Za-z0-9/_.:]+$ ]]; then
say "Valid characters for env values: letters, numbers, \".\",\"/\",\"_\"",\":\"
if [[ ! $VALUE =~ ^[A-Za-z0-9/_.:-]+$ ]]; then
say "Valid characters for env values: letters, numbers, \".\",\"/\",\"_\"",\":\", \"-\"
fi
# If we're setting a valid key/value pair
if [[ ${1} =~ ^[A-Z_]+\=[A-Za-z0-9/._:]*$ ]]; then
if [[ ${1} =~ ^[A-Z_]+\=[A-Za-z0-9/._:-]*$ ]]; then
DOTENV_ENTRY=$(cat .env | grep ${KEY})
# If something already exists and we're trying to set it to something new
@ -230,3 +238,5 @@ remember() {
}
LEAD=1
# Confirm? Something to automate the y/n dialog

57
recipes/init.sh

@ -3,48 +3,7 @@
# This is a script to be run on a fresh installation of Raspbian in order to make it suitable (to me) for CLI development
# ~ Zen, 2022
if [ -f "/etc/debian_version" ]; then
DISTRO="debian"
echo "Debian, Ubuntu, or Raspbian OS detected."
elif [ -f "/etc/arch-release" ]; then
DISTRO="arch"
echo "Arch- or Manjaro-based OS detected."
elif [ $(uname | grep -c "Darwin") -eq 1 ]; then
DISTRO="mac"
echo "MacOS detected."
else
echo "I don't know what OS you're running! Cancelling this operation."
exit 1
fi
echo ""
# This makes sure that ctrl+C exits the entire script
trap "exit" INT
install_if_needed() {
for package in "$@"
do
if [ -z $(which $package) ]; then
echo "installing" $package
case $DISTRO in
"debian")
sudo apt install -y $package
;;
"arch")
sudo pacman -S $package --noconfirm
;;
"mac")
brew install $package
;;
esac
else
echo $package 'already installed!'
fi
done
}
source ingredients/lead
echo "Updating the repositories..."
case $DISTRO in
@ -66,13 +25,13 @@ echo ""
echo "Making sure we've got the basics..."
case $DISTRO in
"debian")
install_if_needed make vim tmux zsh git silversearcher-ag
install_if_needed vim tmux zsh git silversearcher-ag
;;
"arch")
install_if_needed make vim tmux zsh git the_silver_searcher
install_if_needed vim tmux zsh git the_silver_searcher
;;
"mac")
install_if_needed make vim tmux zsh git the_silver_searcher
install_if_needed vim tmux zsh git the_silver_searcher
;;
esac
echo ""
@ -90,9 +49,9 @@ cp resources/tmux.conf $HOME/.tmux.conf
cp resources/tmux-powerline-theme.sh $HOME/.tmux/tmux-powerline/themes/default.sh
echo ""
# TODO is this neededd? can we install p10k on base zsh?
echo "Installing Oh My Zsh for theming - this could take a moment"
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
# TODO is this needed? can we install p10k on base zsh?
#echo "Installing Oh My Zsh for theming - this could take a moment"
#sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
cat resources/zshrc-extras >> $HOME/.zshrc
echo ""
@ -101,4 +60,4 @@ git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$
sed -i 's/^ZSH_THEME.*/ZSH_THEME="powerlevel10k\/powerlevel10k"/' $HOME/.zshrc
echo ""
echo "...and we're back! Now that you've installed everything you need, try closing your connection to the terminal and re-opening."
$SHELL

Loading…
Cancel
Save