2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2024-11-21 14:51:51 +00:00

OS config for a new dev machine

This commit is contained in:
Philip Sargent 2022-10-27 12:30:59 +01:00
parent d9ed90b729
commit 275ce87e30
2 changed files with 45 additions and 21 deletions

View File

@ -1,4 +1,4 @@
Updated 19 February 2022 Updated 27 October 2022
Troggle is an application for caving expedition data management, Troggle is an application for caving expedition data management,
originally created for use on Cambridge University Caving Club (CUCC)expeditions originally created for use on Cambridge University Caving Club (CUCC)expeditions
@ -59,10 +59,14 @@ Conventionally on our main master expo server we install everything that we can
[venv description removed - read it in http://expo.survex.com/handbook/troggle/troglaptop.html ] [venv description removed - read it in http://expo.survex.com/handbook/troggle/troglaptop.html ]
READ the os-trog.sh script !
READ the venv-trog.sh script !
Automatic Provisioning and Configuration Automatic Provisioning and Configuration
---------------------------------------- ----------------------------------------
We don't do this - yet. We don't do this - yet.
We don't even have a bash script.
The most appropriate configuration tools today (2021) appear to be Bolt or Ansible The most appropriate configuration tools today (2021) appear to be Bolt or Ansible
https://puppet.com/docs/bolt/latest/bolt.html (declarative, local) https://puppet.com/docs/bolt/latest/bolt.html (declarative, local)
https://docs.ansible.com/ansible/latest/user_guide/intro_getting_started.html (procedural, remote) https://docs.ansible.com/ansible/latest/user_guide/intro_getting_started.html (procedural, remote)
@ -147,19 +151,14 @@ these permissions are set in a different 'info' database which usually is untouc
PERMISSIONS PERMISSIONS
https://linuxize.com/post/usermod-command-in-linux/ https://linuxize.com/post/usermod-command-in-linux/
THIS MAY BE OUT OF DATE - in 2022 we are running Apache as user 'expo' THIS MAY BE OUT OF DATE - in 2022 we are running Apache as user 'expo' not 'www-data'
sudo usermod -a expo www-data
adds expo to the www-data group which is what the webserver uses, and thus so the user troggle is acting as when running live.
So all the /loser/ .svx files need to have permissions like this (664)
-rw-rw-r-- expo www-data
so that the online editing system for SVX files works. so that the online editing system for SVX files works.
The same goes for /expoweb/ files, so that "edit this page" works and the New Cave The same goes for /expoweb/ files, so that "edit this page" works and the New Cave
and New Entrance forms work. and New Entrance forms work.
sudo usermod -a expo expocvs sudo usermod -a expo expocvs
the expocvs group is used for git & hg the expocvs group is used for git
all the users should be in this group all the users should be in this group

View File

@ -1,31 +1,56 @@
#!/bin/bash #!/bin/bash
# Run this in a terminal in the troggle directory: 'bash os-trog.sh' # Run this in a terminal in the troggle directory: 'bash os-trog.sh'
# On WSL, do Shift-click in the file explorer on the troggle folder to open a Linux command line
# 'Open Linux shell here'
echo 'Run this in a terminal in the troggle directory: "bash venv-trog.sh"' echo 'Run this in a terminal in the troggle directory: "bash venv-trog.sh"'
cat /etc/os-release
# Expects an Ubuntu 22.04 relatively clean install. # Expects an Ubuntu 22.04 relatively clean install.
sudo apt install python-is-python3 -y
python --version : ensure python is an alias for python3 not python2.7 python --version : ensure python is an alias for python3 not python2.7
sudo apt update sudo apt update -y
sudo apt dist-upgrade sudo apt dist-upgrade -y
sudo apt install sqlite3 sudo apt autoremove -y
sudo apt install python3-pip sudo apt install sqlite3 -y
sudo apt install python3-pip -y
# this installs a shed-load of other stuff: binutils etc.sudo apt install survex-aven # this installs a shed-load of other stuff: binutils etc.sudo apt install survex-aven
sudo apt install openssh-client tunnelx therion sudo apt install git openssh-client tunnelx therion -y
sudo apt install git sftp
# On a clean debian 11 (bullseye) installation with Xfce & ssh, # On a clean debian 11 (bullseye) installation with Xfce & ssh,
#on ubuntu 20.04:
#Package sftp is not available, but is referred to by another package.
#This may mean that the package is missing, has been obsoleted, or
#is only available from another source
#E: Package 'sftp' has no installation candidate
# On Ubuntu 20.04, with python10, the pip install fails.
# So you ned to get the pip from source
# sudo curl -sS https://bootstrap.pypa.io/get-pip.py | python3.10
# but really you should be using 22.04
# and also, isf using debian,
# sudo python3.10 -m pip install -U virtualenv
# as debian does not install everything that ubuntu does, you need: # as debian does not install everything that ubuntu does, you need:
sudo useradd expo
sudo usermod -a -G sudo expo # to put expo in sudoers group, re-login required sudo usermod -a -G sudo expo # to put expo in sudoers group, re-login required
# default since 22.04 # sudo apt install python3.10 # default since 22.04
sudo apt install python3.10-venv # sudo apt install python3.10
sudo apt install python3.10-dev sudo apt install python3.10-venv -y
sudo apt install python3.10-dev -y
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.10 1 sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.10 1
sudo apt install mariadb-server -y sudo apt install mariadb-server -y
sudo apt install libmariadb-dev sudo apt install libmariadb-dev -y
sudo python -m pip install --upgrade pip sudo python -m pip install --upgrade pip
sudo apt install sftp -y
echo '###'
echo '### NOW INSTALLING tunnel and therion, go and have a cup of tea. Or a 3-course meal.'
echo '###'
sudo apt install tunnelx therion -y
# Go to https://expo.survex.com/handbook/troggle/troglaptop.html#dbtools # Go to https://expo.survex.com/handbook/troggle/troglaptop.html#dbtools
# sudo service mysql start # sudo service mysql start