From 3ded316bb30648771975453ded470c36da26e0b9 Mon Sep 17 00:00:00 2001
From: jmpla <jean-marie.place@univ-lille.fr>
Date: Sat, 20 Jan 2024 09:00:26 +0100
Subject: [PATCH] restore dev data

---
 Vagrantfile | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/Vagrantfile b/Vagrantfile
index e37ad90f..ea24726e 100644
--- a/Vagrantfile
+++ b/Vagrantfile
@@ -88,6 +88,13 @@ Vagrant.configure("2") do |config|
      cp $CONFIG/.bashrc /home/scodoc/.bashrc
      su -c "psql -c 'GRANT postgres TO scodoc;'" postgres
      
+     echo "configure ssh to scodoc"
+     cd /home/vagrant
+     cp -r .ssh /home/scodoc
+     cd /home/scodoc
+     chown -R scodoc:scodoc .ssh
+     echo "%scodoc ALLL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/scodoc
+
      echo 'install development data'
      su -c "createdb SCODOC_DEV" scodoc
      rm /opt/scodoc/.env
@@ -95,5 +102,10 @@ Vagrant.configure("2") do |config|
      cd /opt/scodoc
      yes | tools/restore_scodoc9_data.sh /$CONFIG/SCODOC_DEV.tgz
   SHELL
+
+  VAGRANT_COMMAND = ARGV[0]
+  if VAGRANT_COMMAND == "ssh"
+    config.ssh.username = 'scodoc'
+  end
 end
 
-- 
GitLab