Skip to content

Instantly share code, notes, and snippets.

@Konctantin
Last active February 3, 2023 07:04
Show Gist options
  • Save Konctantin/1dbe04612704de59e8906e2d82241d11 to your computer and use it in GitHub Desktop.
Save Konctantin/1dbe04612704de59e8906e2d82241d11 to your computer and use it in GitHub Desktop.

WSL Preparation

Install go

wget https://dl.google.com/go/go1.20.linux-amd64.tar.gz
sudo tar -xvf go1.20.linux-amd64.tar.gz
sudo mv go /usr/local

Config

Open /home/<USER>/.bashrc and add it to the end of the file:

export GOROOT=/usr/local/go
export GOPATH=$HOME/go
export PATH=$GOPATH/bin:$GOROOT/bin:$PATH

Install NodeJS

sudo apt-get install curl
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash
# reload wsl
wsl --shutdown

nvm install 14.17.6

Install GCC

sudo apt-get update && sudo apt-get upgrade -y
sudo apt autoremove -y
sudo apt-get install gcc -y
gcc --version

WSL permissions to allow start ssl server

sudo setcap CAP_NET_BIND_SERVICE=+eip /$gitea_dir$/gitea

Gitea

git clone https://github.com/go-gitea/gitea.git
cd ./gitea
TAGS="bindata sqlite sqlite_unlock_notify" make build

GOOS=windows GOARCH=amd64 TAGS="bindata sqlite sqlite_unlock_notify" make build

LDFLAGS="-linkmode external -extldflags '-static' $LDFLAGS" GOOS=windows GOARCH=amd64 TAGS="bindata sqli
te sqlite_unlock_notify" make build

./gitea web
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment