Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions SOLDOUT_waiting_for_stock.list
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# name date
Love potion 7/12/1215
Excalibur 30/05/542
Philosopher's Stone 02/02/600
2 changes: 1 addition & 1 deletion product.list
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# product price
arrow 1
bow 25
philosopher's_stone 100
philosopher's_stone 0
91 changes: 91 additions & 0 deletions setup_ssh
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
#!/usr/bin/env sh

# Run by the player, from inside the game, as "./setup_ssh".
# Creates a dedicated ssh key for github and the matching ~/.ssh/config entry.
#
# Inside the game $HOME is the game's World directory, so "~/.ssh" is the
# game's own .ssh. The player chooses whether that should be a real directory
# (the key stays inside the game) or a symbolic link to their real ~/.ssh (the
# key also works outside the game).

printf '%s' "Do you want to setup the ssh authentification method to work outside of the game (y/n)? "
read -r globalinstall

if [ "$globalinstall" = "y" ]
then
if [ ! -d "${REAL_HOME}/.ssh" ]
then
echo "creating ~/.ssh directory (outside the game)"
mkdir "${REAL_HOME}/.ssh"
chmod 700 "${REAL_HOME}/.ssh"
fi
# replace the game's .ssh (real directory or stale symlink) by a link to
# the real one
if [ -L "${GSH_HOME}/.ssh" ]
then
rm -f "${GSH_HOME}/.ssh"
elif [ -e "${GSH_HOME}/.ssh" ]
then
rm -rf "${GSH_HOME}/.ssh"
fi
ln -s "${REAL_HOME}/.ssh" "${GSH_HOME}/.ssh"
identityfile_path="${REAL_HOME}/.ssh/id_rsa.git"
else
# the key stays inside the game: .ssh has to be a real directory
if [ -L "${GSH_HOME}/.ssh" ]
then
rm -f "${GSH_HOME}/.ssh"
elif [ -e "${GSH_HOME}/.ssh" ]
then
rm -rf "${GSH_HOME}/.ssh"
fi
mkdir "${GSH_HOME}/.ssh"
chmod 700 "${GSH_HOME}/.ssh"
identityfile_path="${GSH_HOME}/.ssh/id_rsa.git"
fi

# create ~/.ssh/id_rsa.git
if [ ! -e ~/.ssh/id_rsa.git ]
then
ssh-keygen -t rsa -f ~/.ssh/id_rsa.git -N ""
chmod 600 ~/.ssh/id_rsa.git
fi

# "IdentitiesOnly yes" matters: without it ssh still offers every key held by
# ssh-agent, and github accepts one of those instead of the key we just made.
# A player who already works with github on this machine would then silently
# keep using their other account -- the mission would pass without the new key
# ever being tried, and the pushes of the next missions would go elsewhere.
github_config() {
echo "Host github.com"
echo " Hostname github.com"
echo " User git"
echo " IdentityFile ${identityfile_path}"
echo " IdentitiesOnly yes"
}

if [ ! -e ~/.ssh/config ]
then
github_config >> ~/.ssh/config
elif grep -q github.com ~/.ssh/config
then
echo "file ~/.ssh/config already has instruction for github: The script did not try to edit it."
echo "We do expect the following lines: (please check)"
github_config
else
echo "adding configuration for github in ssh config file"
{
echo ""
github_config
} >> ~/.ssh/config
fi

echo ""
echo "Step 1 completed. Now you can do Step 2:"
echo ""
echo "go to https://github.com/settings/keys"
echo 'click on "New ssh key", put as title the name of this machine'
echo "and paste the following content:"
echo ""
echo ""
cat ~/.ssh/id_rsa.git.pub
8 changes: 8 additions & 0 deletions status
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
I have succeed level 1
I have succeed level 14 on Mon Sep 28 04:26:30 PM CEST 2026
I have succeed level 14 on Mon Sep 28 04:30:10 PM CEST 2026
I have succeed level 14 on Mon Sep 28 04:31:39 PM CEST 2026
I have succeed level 14 on Mon Sep 28 04:35:50 PM CEST 2026
I have succeed level 14 on Mon Sep 28 04:37:03 PM CEST 2026
I have succeed level 14 on Mon Sep 28 04:43:23 PM CEST 2026
I have succeed level 14 on Mon Sep 28 04:46:05 PM CEST 2026
I have succeed level 14 on Mon Sep 28 04:48:16 PM CEST 2026
Loading