Skip to content

DM 01 Developer Setup

Esteban Ginocchio Silva edited this page Jun 17, 2023 · 12 revisions

Development Manual

Chapter 1: Machine Setup

  • Install Google Chrome (the only browser we support)
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo apt install ./google-chrome-stable_current_amd64.deb
  • Setup Yubikey (for logging into SL domains)
sudo apt-add-repository ppa:yubico/stable
sudo apt update
sudo apt install yubikey-manager
source <(_YKMAN_COMPLETE=source ykman | sudo tee /etc/bash_completion.d/ykman)
sudo systemctl start pcscd            # This is new!
ykman config mode "FIDO+CCID"         # Prevent accidental OTP output. Do not use if your Yubikey needs OTP.
sudo ykman piv set-pin-retries 8 8    # Set PIN and PUK retries to 8 (use default mgmt. key)
# Reset management key to an unknown 3DES cipher:
sudo ykman piv change-management-key --generate --protect
# Generate an unknown private key and spit out a public key in PEM format
sudo ykman piv generate-key 9a public.pem --pin-policy ALWAYS --touch-policy NEVER
# Generate a public certificate and write it to a file
sudo ykman piv generate-certificate 9a public.pem -s "/CN=SSH key/"
sudo ykman piv export-certificate 9a cert.pem
  • Install OpenSC drivers and setup ssh-agent:
sudo apt install opensc-pkcs11
echo "alias yk='eval \$(ssh-agent -s) ; ssh-add -s /usr/lib/x86_64-linux-gnu/opensc-pkcs11.so ; ssh-add -L'" >> ~/.bashrc
source ~/.bashrc
killall ssh-agent
yk
  • Clone the repositories:
sudo apt install git
mkdir -p ~/Code/machete
cd ~/Code/machete
git clone git@github.com:SavageLearning/machete-compose.git compose
git clone git@github.com:SavageLearning/machete-react-ui.git rx
git clone git@github.com:SavageLearning/machete2.git v2
git clone git@github.com:SavageLearning/Machete.git v1
cd v1
git submodule init
git submodule update
cd ..
ln -s v1/UI ui
cd ~/Downloads
sudo apt install curl
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
sudo usermod -aG docker ${USER}

Now, a bunch of DEBs (from ~/Downloads you can sudo apt -y install ./{filename}):

Now, you can install the .NET 3.1 SDK:

wget https://dotnet.microsoft.com/download/dotnet/scripts/v1/dotnet-install.sh
chmod u+x dotnet-install.sh
./dotnet-install.sh -c 3.1

If you wish, you can now edit the whole Machete suite of applications together in an integrated environment:

cd ~/Code/machete
code .

Finally, in order to run the application you will also need docker-compose:

sudo apt install docker-compose

Mac OS X and Windows

We do not support Windows or Mac OS at this time, especially given the switch from Intel to Apple Silicon.

For platforms other than Ubuntu, we recommend installing VirtualBox and working inside an Ubuntu VM, following the directions above. Any PRs from forks geared toward cross-platform functionality are welcome, but this is not an officially supported path.

Bad Dotnet Install Workaround

We have had issues with .net not running on some ubuntu machines. If this problem persists, the fallback development environment is docker-compose.

Fallback UI dev environment

  • From the Machete/UI directory, run
  • docker-compose build dev_dotnet
  • docker-compose up -d. This spins up the dotnet server along with the sqlserver. angular UI.
  • See the app running on http://localhost:4213/V2
  • To check the status of the docker-compose services, try docker-compose ps
  • To see the server logs, docker-compose logs -f dev_dotnet
  • When you stop all the services with docker-compose down, you will loose all the data in the local dev database