Last active 1 month ago

Revision 8e62371c9772038830d57b1e16e496b248ca145d

serversetup.sh Raw
1!#/usr/bin/env bash
2
3# mostly for setting up stuff with php and/or js-based stacks
4
5# add caddy repos
6apt install -y debian-keyring debian-archive-keyring apt-transport-https curl
7curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
8curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list
9chmod o+r /usr/share/keyrings/caddy-stable-archive-keyring.gpg
10chmod o+r /etc/apt/sources.list.d/caddy-stable.list
11
12#update apt repo list
13apt update
14
15# apt installs
16apt install caddy
17apt install php8.4-fpm
18apt install unzip
19apt install git
20apt -y install podman
21apt install mariadb-server
22apt install sqlite
23apt install gcc
24apt install make
25apt install clang
26apt install pkg-config
27
28# secure mysql
29mysql_secure_installation
30
31# install fav editor
32wget https://github.com/curlpipe/ox/releases/download/0.7.7/ox_0.7.7-1_amd64.deb
33dpkg -i ox_0.7.7-1_amd64.deb
34rm ox_0.7.7-1_amd64.deb
35
36# setup zsh + omz
37apt install zsh
38sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
39# replace .zshrc with custom config
40~/.zshrc < EOF
41export PATH=$HOME/bin:/usr/local/bin:$PATH
42export ZSH="/Users/zhanchi/.oh-my-zsh"
43ZSH_THEME="duellj"
44plugins=(git gnu-utils zsh-syntax-highlighting zsh-autosuggestions command-not-found composer colored-man-pages perl rust themes wp-cli colored-man-pages deno dotenv iterm2 timer)
45source $ZSH/oh-my-zsh.sh
46export EDITOR='ox'
47alias zshconfig="mate ~/.zshrc"
48alias ohmyzsh="mate ~/.oh-my-zsh"
49EOF
50
51# install bun
52curl -fsSL https://bun.sh/install | bash
53
54# install rust toolchain
55curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
56
57# install composer
58php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
59php -r "if (hash_file('sha384', 'composer-setup.php') === 'ed0feb545ba87161262f2d45a633e34f591ebb3381f2e0063c345ebea4d228dd0043083717770234ec00c5a9f9593792') { echo 'Installer verified'.PHP_EOL; } else { echo 'Installer corrupt'.PHP_EOL; unlink('composer-setup.php'); exit(1); }"
60php composer-setup.php
61php -r "unlink('composer-setup.php');"
62mv composer.phar /usr/local/bin/composer
63
64# setup services
65systemctl stop apache2
66systemctl disable apache2
67systemctl enable caddy # don't start it yet tho because we don't have servers set up