Compare commits

..

4 Commits

Author SHA1 Message Date
tdehaeze 96f57c1c78 Automatic key generation 2026-04-15 15:07:30 +02:00
tdehaeze f87c433fe8 Might solve some issue with ssh and kitty (tbc) 2026-04-15 14:53:30 +02:00
tdehaeze 2245f91b5b Add Calendar install script 2026-04-15 14:53:19 +02:00
tdehaeze a29050a389 Switch from RSA to ED25519 ssh keys 2026-04-15 14:52:33 +02:00
5 changed files with 144 additions and 44 deletions
+1 -1
View File
@@ -86,7 +86,7 @@ bind '"\e[B": history-search-forward'
** Kitty for SSH ** Kitty for SSH
#+begin_src bash #+begin_src bash
[ "$TERM" = "xterm-kitty" ] && alias ssh="kitty +kitten ssh" [ "$TERM" = "xterm-kitty" ] && [ -n "$KITTY_WINDOW_ID" ] && alias ssh="kitty +kitten ssh"
#+end_src #+end_src
** Aliases ** Aliases
+41
View File
@@ -1,6 +1,47 @@
#+TITLE:Calendar and Contact Configuration #+TITLE:Calendar and Contact Configuration
#+SETUPFILE: ./setup/org-setup-file.org #+SETUPFILE: ./setup/org-setup-file.org
* Calendar Install Script
:PROPERTIES:
:header-args:bash: :tangle scripts/install-calendar.sh :shebang "#!/bin/bash" :mkdirp yes
:END:
Calendar/contact documentation: [[file:calendar-contact.org][calendar-contact.org]]
#+begin_src bash
set -euo pipefail
DOTFILES="${HOME}/.config/literate-dotfiles"
tangle() {
emacs --batch -l org --eval "(org-babel-tangle-file \"${DOTFILES}/$1\")"
}
#+end_src
** Packages
#+begin_src bash
echo "==> Calendar and contacts packages"
paru -S --needed \
vdirsyncer \
khal \
khard
#+end_src
** Tangle Systemd Configs
#+begin_src bash
echo "==> Tangling systemd configs for calendar"
tangle "systemd.org"
#+end_src
** Systemd Timer
#+begin_src bash
echo "==> Enabling vdirsyncer timer"
systemctl --user enable --now vdirsyncer.timer
#+end_src
* =vdirsyncer= - Synchronize calendars and contacts * =vdirsyncer= - Synchronize calendars and contacts
:PROPERTIES: :PROPERTIES:
:header-args: :tangle ~/.config/vdirsyncer/config :header-args: :tangle ~/.config/vdirsyncer/config
+12 -8
View File
@@ -13,31 +13,35 @@ Host backup
hostname pierrick.tdehaeze.xyz hostname pierrick.tdehaeze.xyz
Port 10022 Port 10022
user thomas user thomas
IdentityFile ~/.ssh/id_rsa IdentityFile ~/.ssh/id_ed25519
Host pierrick Host pierrick
hostname pierrick.tdehaeze.xyz hostname pierrick.tdehaeze.xyz
Port 56432 Port 56432
user pierrick user pierrick
IdentityFile ~/.ssh/id_rsa IdentityFile ~/.ssh/id_ed25519
Host homelab Host homelab
hostname <<get-password(passname="ip/homelab")>> hostname <<get-password(passname="ip/homelab")>>
Port 22 Port 22
user thomas user thomas
IdentityFile ~/.ssh/id_rsa IdentityFile ~/.ssh/id_ed25519
Host zotac
hostname 192.168.5.75
Port 22
user thomas
IdentityFile ~/.ssh/id_ed25519
Host router Host router
hostname 192.168.1.1 hostname 192.168.1.1
Port 22 Port 22
user root user root
IdentityFile ~/.ssh/id_rsa IdentityFile ~/.ssh/id_ed25519
PubkeyAcceptedAlgorithms +ssh-rsa
HostkeyAlgorithms +ssh-rsa
Host *.esrf.fr Host *.esrf.fr
User dehaeze User dehaeze
IdentityFile ~/.ssh/id_rsa IdentityFile ~/.ssh/id_ed25519
Host firewall.esrf.fr Host firewall.esrf.fr
Port 5022 Port 5022
@@ -49,7 +53,7 @@ Match host *.esrf.fr !host firewall.esrf.fr !exec "~/.ssh/esrf-test"
Host rnice Host rnice
Port 22 Port 22
user dehaeze user dehaeze
IdentityFile ~/.ssh/id_rsa IdentityFile ~/.ssh/id_ed25519
#+end_src #+end_src
#+begin_src bash :tangle ~/.ssh/esrf-test :comments none :mkdirp yes :shebang "#!/usr/bin/env bash" :tangle-mode (identity #o555) #+begin_src bash :tangle ~/.ssh/esrf-test :comments none :mkdirp yes :shebang "#!/usr/bin/env bash" :tangle-mode (identity #o555)
+77 -33
View File
@@ -105,6 +105,12 @@ i3-msg restart 2>/dev/null || echo " (i3 not running, config will apply on next
#+begin_src bash #+begin_src bash
set -euo pipefail set -euo pipefail
DOTFILES="${HOME}/.config/literate-dotfiles"
tangle() {
emacs --batch -l org --eval "(org-babel-tangle-file \"${DOTFILES}/$1\")"
}
#+end_src #+end_src
** Shell and Terminal ** Shell and Terminal
@@ -337,12 +343,79 @@ paru -S --needed \
mpd mpd
#+end_src #+end_src
** SSH Keys for Tunnels
#+begin_src bash
setup_ssh_key() {
local key_name="$1"
local remote_host="$2"
local remote_port="${3:-22}"
local key_file="$HOME/.ssh/id_ed25519_${key_name}"
echo ""
echo "==> Setting up SSH key for ${key_name}"
# Generate key if it doesn't exist
if [ ! -f "${key_file}" ]; then
read -p "Generate new SSH key for ${key_name}? [y/N] " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
ssh-keygen -t ed25519 -C "${key_name}-tunnel" -f "${key_file}" -N ""
else
echo "Skipping ${key_name} key generation"
return 1
fi
fi
# Check if we can connect without password
if ssh -o BatchMode=yes -o ConnectTimeout=5 -p "${remote_port}" -i "${key_file}" "${remote_host}" exit 2>/dev/null; then
echo "SSH key for ${key_name} is already deployed ✓"
return 0
fi
# Prompt to deploy key
read -p "Deploy SSH key to ${remote_host}? [y/N] " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
ssh-copy-id -i "${key_file}.pub" -p "${remote_port}" "${remote_host}"
else
echo "Skipping ${key_name} key deployment"
return 1
fi
}
# Setup homelab key
setup_ssh_key "homelab" "homelab" 22
HOMELAB_OK=$?
# Setup ESRF key
setup_ssh_key "esrf" "dehaeze@firewall.esrf.fr" 8022
ESRF_OK=$?
#+end_src
** Systemd Services ** Systemd Services
Enable custom systemd services (tangle [[file:systemd.org][systemd.org]] first): #+begin_src bash
#+begin_src bash :tangle no echo "==> Tangling systemd configs"
systemctl --user enable --now homelab-tunnel tangle "systemd.org"
systemctl --user enable --now esrf-tunnel #+end_src
Enable custom =systemd= services:
#+begin_src bash
echo "==> Enabling systemd services"
if [ $HOMELAB_OK -eq 0 ]; then
systemctl --user enable --now homelab-tunnel
else
echo " Skipping homelab-tunnel (SSH key not configured)"
fi
if [ $ESRF_OK -eq 0 ]; then
systemctl --user enable --now esrf-tunnel
else
echo " Skipping esrf-tunnel (SSH key not configured)"
fi
systemctl --user enable --now syncthing systemctl --user enable --now syncthing
#+end_src #+end_src
@@ -399,35 +472,6 @@ systemctl --user enable --now checkmail.timer
systemctl --user enable --now syncmail.timer systemctl --user enable --now syncmail.timer
#+end_src #+end_src
* Calendar Install Script
:PROPERTIES:
:header-args:bash: :tangle scripts/install-calendar.sh :shebang "#!/bin/bash" :mkdirp yes
:END:
Calendar/contact documentation: [[file:calendar-contact.org][calendar-contact.org]]
#+begin_src bash
set -euo pipefail
#+end_src
** Packages
#+begin_src bash
echo "==> Calendar and contacts packages"
paru -S --needed \
vdirsyncer \
khal \
khard \
mu
#+end_src
** Systemd Timer
#+begin_src bash :tangle no
echo "==> Enabling vdirsyncer timer"
systemctl --user enable --now vdirsyncer.timer
#+end_src
* LaTeX Install Script * LaTeX Install Script
:PROPERTIES: :PROPERTIES:
:header-args:bash: :tangle scripts/install-latex.sh :shebang "#!/bin/bash" :mkdirp yes :header-args:bash: :tangle scripts/install-latex.sh :shebang "#!/bin/bash" :mkdirp yes
+13 -2
View File
@@ -1,9 +1,20 @@
#!/bin/bash #!/bin/bash
set -euo pipefail set -euo pipefail
DOTFILES="${HOME}/.config/literate-dotfiles"
tangle() {
emacs --batch -l org --eval "(org-babel-tangle-file \"${DOTFILES}/$1\")"
}
echo "==> Calendar and contacts packages" echo "==> Calendar and contacts packages"
paru -S --needed \ paru -S --needed \
vdirsyncer \ vdirsyncer \
khal \ khal \
khard \ khard
mu
echo "==> Tangling systemd configs for calendar"
tangle "systemd.org"
echo "==> Enabling vdirsyncer timer"
systemctl --user enable --now vdirsyncer.timer