<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://wiki.bathcs.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Pcs47</id>
	<title>Bath Wiki - User contributions [en-gb]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.bathcs.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Pcs47"/>
	<link rel="alternate" type="text/html" href="https://wiki.bathcs.com/wiki/Special:Contributions/Pcs47"/>
	<updated>2026-08-26T06:10:31Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.46.0</generator>
	<entry>
		<id>https://wiki.bathcs.com/index.php?title=StrongSwan_VPN_on_Linux&amp;diff=178</id>
		<title>StrongSwan VPN on Linux</title>
		<link rel="alternate" type="text/html" href="https://wiki.bathcs.com/index.php?title=StrongSwan_VPN_on_Linux&amp;diff=178"/>
		<updated>2026-06-19T17:24:26Z</updated>

		<summary type="html">&lt;p&gt;Pcs47: Move strongswan package warning higher up.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The GlobalProtect VPN has been decommissioned by DDaT. Unfortunately, this was the only easily working VPN on Linux. The new strongSwan VPN &#039;&#039;should&#039;&#039; just work on popular distros like Mint with the instructions given at https://connect.bath.ac.uk/. Unfortunately, for the rest of us, it often does not “just work”.&lt;br /&gt;
&lt;br /&gt;
This page contains troubleshooting steps for if a basic connection doesn’t work.&lt;br /&gt;
&lt;br /&gt;
= Connect instructions =&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Before starting&#039;&#039;&#039;, make sure you have Microsoft Authenticator enabled. Then, navigate to https://mysignins.microsoft.com/security-info. Make sure that the sign-in method fallback is set to &amp;quot;Microsoft Authenticator - notification&amp;quot; (via the &amp;quot;Change&amp;quot; link). This is something not listed on https://connect.bath.ac.uk and may cause later steps to fail.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;If you&#039;re on Ubuntu&#039;&#039;&#039;, you should also install the following packages that aren&#039;t mentioned by the DDaT instructions: &amp;lt;code&amp;gt;libstrongswan-standard-plugins&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;libstrongswan-extra-plugins&amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
You should then follow the instructions at https://connect.bath.ac.uk.&lt;br /&gt;
&lt;br /&gt;
The instructions give the following troubleshooting advice:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;You may also need to run the command below if you find DNS lookups fail for some university resources:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sh&amp;quot;&amp;gt;sudo ln -sfv /run/systemd/resolve/resolv.conf /etc/resolv.conf&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Though, we’re not sure this is a great idea, and it will not work on any distro. Ubuntu is currently the only distro actively supported by DDaT, though they have been known to respond to tickets for other distros.&lt;br /&gt;
&lt;br /&gt;
== What to expect ==&lt;br /&gt;
&lt;br /&gt;
Now that you’ve followed the university’s instructions, you should be able to connect using the NetworkManager GUI, it should ask you for a username and password (if you haven’t already supplied the username in the configuration), put your university credentials in (the username should be &#039;&#039;&#039;without&#039;&#039;&#039; the &amp;lt;code&amp;gt;@bath.ac.uk&amp;lt;/code&amp;gt;), and you should get a Microsoft authenticator request via the app.&lt;br /&gt;
&lt;br /&gt;
To confirm you are connected to the university VPN correctly, check you can visit any internal site. For example, go to https://2024-25.moodle-archive.bath.ac.uk/. If the page loads, you’re connected! If not, you’ll need to do some troubleshooting.&lt;br /&gt;
&lt;br /&gt;
= Troubleshooting =&lt;br /&gt;
&lt;br /&gt;
First, wipe the slate clean (delete the connection), update your system, and reboot. Once you’ve done that, try again. This should narrow the chances of your system being in some weird state. If it works, great! If not, it’s time to get troubleshooting.&lt;br /&gt;
&lt;br /&gt;
Some of the following sections will require the use of the command line. If you’re unfamiliar, there are plenty of good guides out there and unfortunately teaching the command line is out of scope for this document. We assume basic command line competence from here on out.&lt;br /&gt;
&lt;br /&gt;
== I can’t add the connection whatsoever ==&lt;br /&gt;
&lt;br /&gt;
First of all, check if &amp;lt;code&amp;gt;NetworkManager&amp;lt;/code&amp;gt; has the connection saved, you can list connections with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sh&amp;quot;&amp;gt;nmcli connection&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Or, &amp;lt;code&amp;gt;nmcli&amp;lt;/code&amp;gt; has short-hand commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sh&amp;quot;&amp;gt;nmcli c&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This should list all your connections, look for one with the name you gave it (which would be &amp;lt;code&amp;gt;University of Bath VPN&amp;lt;/code&amp;gt; if you followed the instructions in [[#connect-instructions|the first section]]). If it does exist, try connecting with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sh&amp;quot;&amp;gt;nmcli c up &amp;quot;University of Bath VPN&amp;quot; --ask&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
You’ll be asked for your password and you should get a Microsoft authenticator request. If you get a successful connection as per [[#what-to-expect|this section]], great! If not and you didn’t get a Microsoft authenticator request, carry on reading this section. If you didn’t get a successful connection but did get a Microsoft authenticator request, check the next section.&lt;br /&gt;
&lt;br /&gt;
First, let’s clean the slate. Check your connections with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sh&amp;quot;&amp;gt;nmcli c&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Then delete the VPN connections by their UUID (UUIDs look something like &amp;lt;code&amp;gt;7abdc95a-4b2a-42bb-9a4a-38104d288737&amp;lt;/code&amp;gt;, yours will be different):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sh&amp;quot;&amp;gt;nmcli c delete &amp;lt;uuid of the VPN connection&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Now, we’d suggest adding the connection via &amp;lt;code&amp;gt;nmcli&amp;lt;/code&amp;gt;, the command line for &amp;lt;code&amp;gt;NetworkManager&amp;lt;/code&amp;gt;. To do this, you can use the following command. &#039;&#039;&#039;Note that you’ll have replace the placeholder text with your Bath username&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sh&amp;quot;&amp;gt;nmcli connection add \&lt;br /&gt;
    con-name &amp;quot;University of Bath VPN&amp;quot; \&lt;br /&gt;
    type vpn \&lt;br /&gt;
    vpn-type org.freedesktop.NetworkManager.strongswan \&lt;br /&gt;
    ifname &amp;quot;*&amp;quot; \&lt;br /&gt;
    ipv4.dns &amp;quot;138.38.1.1,138.38.1.2&amp;quot; \&lt;br /&gt;
    ipv4.ignore-auto-dns yes \&lt;br /&gt;
    vpn.data &amp;quot;address=vpn.bath.ac.uk, method=eap, user=&amp;lt;your bath username without the @bath.ac.uk&amp;gt;, encap=yes, virtual=yes&amp;quot;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This sets up a strongSwan VPN connection using the university’s DNS servers and the &amp;lt;code&amp;gt;vpn.bath.ac.uk&amp;lt;/code&amp;gt; VPN server. It should also use your username, set UDP encapsulation enforcement, and should request an inner IP.&lt;br /&gt;
&lt;br /&gt;
You can now attempt to connect again, following the same steps as before. If you get a connection, great! If not, look for the section that best describes your issue.&lt;br /&gt;
&lt;br /&gt;
== I keep getting connection failed for an unknown reason ==&lt;br /&gt;
&lt;br /&gt;
You may want to check the output of the following command (on systemd machines):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sh&amp;quot;&amp;gt;&lt;br /&gt;
journalctl -u NetworkManager | grep charon &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you see anything like &amp;lt;code&amp;gt;EAP/FAIL&amp;lt;/code&amp;gt; but certificates are good, you should [[#file-a-ticket|file a ticket]]. If certificates are bad, you can try the instructions in [[StrongSwan VPN on Linux#I’m not getting a Microsoft authenticator request|this section]].&lt;br /&gt;
&lt;br /&gt;
== I’m not getting a Microsoft authenticator request ==&lt;br /&gt;
&lt;br /&gt;
Before you start this section, make sure to follow the instructions in the previous subsection so you’re in a known state.&lt;br /&gt;
&lt;br /&gt;
When you connect with &amp;lt;code&amp;gt;nmcli c up &amp;amp;quot;University of Bath VPN --ask&amp;amp;quot;&amp;lt;/code&amp;gt;, if you get an error such as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Error: Connection activation failed: No valid secrets&amp;lt;/pre&amp;gt;&lt;br /&gt;
You might need a certificate, or you may have entered your password incorrectly. To check the latter, delete the VPN connection and try again.&lt;br /&gt;
&lt;br /&gt;
If you’re not getting a Microsoft authenticator request still, you might need a certificate. The university uses Sectigo certificates for the strongSwan VPN. These &#039;&#039;should&#039;&#039; be bundled in your distro’s trust store, but either &amp;lt;code&amp;gt;charon-nm&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;NetworkManager&amp;lt;/code&amp;gt; might not be checking for them properly and so your connection might be failing. Unfortunately, there is no easy way with a VPN connection to get around this.&lt;br /&gt;
&lt;br /&gt;
The following instructions are a bit messy, but are mostly distro-agnostic and &#039;&#039;should&#039;&#039; resolve the issue &#039;&#039;if it is a certificate problem&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
There are some extra steps you can do first to confirm it is a certificate issue, though different distros package software differently and so this isn’t guaranteed to give results:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sh&amp;quot;&amp;gt;# look for anything that suggests a certificate is missing or untrusted&lt;br /&gt;
journalctl -u NetworkManager | grep charon&lt;br /&gt;
&lt;br /&gt;
# if the above doesn&#039;t show anything, try just looking through NetworkManager&#039;s logs&lt;br /&gt;
journalctl -u NetworkManager&lt;br /&gt;
&lt;br /&gt;
# if that doesn&#039;t immediately show anything, you can try the following&lt;br /&gt;
journalctl | grep Sectigo&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Anything that &#039;&#039;does&#039;&#039; come up may be useful to DDaT for troubleshooting if our troubleshooting steps don’t resolve the issue.&lt;br /&gt;
&lt;br /&gt;
Firstly, you’ll have to download the &amp;lt;code&amp;gt;Sectigo Public Server Authentication Root R46&amp;lt;/code&amp;gt; certificate. This can be found here: https://crt.sh/?d=4256644734. If you don’t trust us or the certificate has changed, find the correct certificate on this page: https://www.sectigo.com/knowledge-base/detail/Sectigo-Public-Intermediates-and-Roots.&lt;br /&gt;
&lt;br /&gt;
Once you’ve got the certificate, move it somewhere you won’t accidentally delete it. We recommend something like &amp;lt;code&amp;gt;~/.uni-vpn/sectigo-root.crt&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Now, delete your VPN connection (again, just to make sure you’re in a known state) and add the following connection. &#039;&#039;&#039;You will need to replace your username AND the path to the Sectigo root certificate&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sh&amp;quot;&amp;gt;nmcli connection add \&lt;br /&gt;
    con-name &amp;quot;University of Bath VPN&amp;quot; \&lt;br /&gt;
    type vpn \&lt;br /&gt;
    vpn-type org.freedesktop.NetworkManager.strongswan \&lt;br /&gt;
    ifname &amp;quot;*&amp;quot; \&lt;br /&gt;
    ipv4.dns &amp;quot;138.38.1.1,138.38.1.2&amp;quot; \&lt;br /&gt;
    ipv4.ignore-auto-dns yes \&lt;br /&gt;
    vpn.data &amp;quot;address=vpn.bath.ac.uk, method=eap, user=&amp;lt;your bath username without the @bath.ac.uk&amp;gt;, encap=yes, virtual=yes, certificate=/full/path/to/sectigo-root.crt&amp;quot;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
If you used our suggested location, you can replace the certificate path with &amp;lt;code&amp;gt;$HOME/.uni-vpn/sectigo-root.crt&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Attempt to connect as before. If you get a Microsoft authenticator request but don’t get a connection afterwards, go to the next section. If you don’t get a Microsoft authenticator request, [[#file-a-ticket|file a ticket]].&lt;br /&gt;
&lt;br /&gt;
== I get a Microsoft authenticator request, but no connection ==&lt;br /&gt;
&lt;br /&gt;
Firstly, try to connect again, accept the Microsoft authenticator request, and then wait ~40-50 seconds without retrying. If you get a secondary Microsoft authenticator request, this may be due to a routing misconfiguration.&lt;br /&gt;
&lt;br /&gt;
First, check for a rule under &amp;lt;code&amp;gt;210&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;220&amp;lt;/code&amp;gt; with the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sh&amp;quot;&amp;gt;ip rule&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
If you don’t see a line similar to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;210:    not from all fwmark 0xd2 lookup 210&amp;lt;/pre&amp;gt;&lt;br /&gt;
You may have a configuration or routing issue. Double check you’ve installed all the correct packages for your distro.&lt;br /&gt;
&lt;br /&gt;
To test if routing is your issue, you can add the following route:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sh&amp;quot;&amp;gt;ip route add 138.38.3.176/28 via &amp;lt;default gateway&amp;gt; table 210&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Replacing the default gateway with the IP after “default via” from running &amp;lt;code&amp;gt;ip r&amp;lt;/code&amp;gt;. Then, try connecting again. If that doesn’t work, [[#file-a-ticket|file a ticket]]. If that works, &#039;&#039;&#039;disconnect and delete the route&#039;&#039;&#039; by replacing the &amp;lt;code&amp;gt;add&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;del&amp;lt;/code&amp;gt; in the above command. You can configure &amp;lt;code&amp;gt;NetworkManager&amp;lt;/code&amp;gt; to create the route for you when you connect to the VPN, this way it won’t be forever lingering on your system.&lt;br /&gt;
&lt;br /&gt;
To do so, you can run the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sh&amp;quot;&amp;gt;nmcli c modify &amp;quot;University of Bath VPN&amp;quot; ipv4.route-table 210&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
You may need to restart the &amp;lt;code&amp;gt;NetworkManager&amp;lt;/code&amp;gt; daemon, &#039;&#039;&#039;this will temporarily disconnect you&#039;&#039;&#039;. On a &amp;lt;code&amp;gt;systemd&amp;lt;/code&amp;gt; based system, this can be done with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sh&amp;quot;&amp;gt;systemctl restart NetworkManager.service&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Now, you should be able to connect to the VPN without issues. If not, [[#file-a-ticket|file a ticket]].&lt;br /&gt;
&lt;br /&gt;
= File a ticket =&lt;br /&gt;
&lt;br /&gt;
If the troubleshooting steps given here don’t work, you should file a ticket with DDaT at: https://topdesk.bath.ac.uk/ (&amp;lt;code&amp;gt;DDaT Support: IT &amp;amp;amp; Audio Visual &amp;amp;gt; Report an Issue &amp;amp;gt; Report a Network Issue&amp;lt;/code&amp;gt;).&lt;/div&gt;</summary>
		<author><name>Pcs47</name></author>
	</entry>
	<entry>
		<id>https://wiki.bathcs.com/index.php?title=StrongSwan_VPN_on_Linux&amp;diff=177</id>
		<title>StrongSwan VPN on Linux</title>
		<link rel="alternate" type="text/html" href="https://wiki.bathcs.com/index.php?title=StrongSwan_VPN_on_Linux&amp;diff=177"/>
		<updated>2026-06-19T17:20:53Z</updated>

		<summary type="html">&lt;p&gt;Pcs47: Update connect instructions to not restate connect.bath.ac.uk and also add a warning about MS authenticator.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The GlobalProtect VPN has been decommissioned by DDaT. Unfortunately, this was the only easily working VPN on Linux. The new strongSwan VPN &#039;&#039;should&#039;&#039; just work on popular distros like Mint with the instructions given at https://connect.bath.ac.uk/. Unfortunately, for the rest of us, it often does not “just work”.&lt;br /&gt;
&lt;br /&gt;
This page contains troubleshooting steps for if a basic connection doesn’t work.&lt;br /&gt;
&lt;br /&gt;
= Connect instructions =&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Before starting&#039;&#039;&#039;, make sure you have Microsoft Authenticator enabled. Then, navigate to https://mysignins.microsoft.com/security-info. Make sure that the sign-in method fallback is set to &amp;quot;Microsoft Authenticator - notification&amp;quot; (via the &amp;quot;Change&amp;quot; link). This is something not listed on https://connect.bath.ac.uk and may cause later steps to fail.&lt;br /&gt;
&lt;br /&gt;
You should then follow the instructions at https://connect.bath.ac.uk.&lt;br /&gt;
&lt;br /&gt;
The instructions give the following troubleshooting advice:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;You may also need to run the command below if you find DNS lookups fail for some university resources:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sh&amp;quot;&amp;gt;sudo ln -sfv /run/systemd/resolve/resolv.conf /etc/resolv.conf&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Though, we’re not sure this is a great idea, and it will not work on any distro. Ubuntu is currently the only distro actively supported by DDaT, though they have been known to respond to tickets for other distros.&lt;br /&gt;
&lt;br /&gt;
== What to expect ==&lt;br /&gt;
&lt;br /&gt;
Now that you’ve followed the university’s instructions, you should be able to connect using the NetworkManager GUI, it should ask you for a username and password (if you haven’t already supplied the username in the configuration), put your university credentials in (the username should be &#039;&#039;&#039;without&#039;&#039;&#039; the &amp;lt;code&amp;gt;@bath.ac.uk&amp;lt;/code&amp;gt;), and you should get a Microsoft authenticator request via the app.&lt;br /&gt;
&lt;br /&gt;
To confirm you are connected to the university VPN correctly, check you can visit any internal site. For example, go to https://2024-25.moodle-archive.bath.ac.uk/. If the page loads, you’re connected! If not, you’ll need to do some troubleshooting.&lt;br /&gt;
&lt;br /&gt;
= Troubleshooting =&lt;br /&gt;
&lt;br /&gt;
First, wipe the slate clean (delete the connection), update your system, and reboot. Once you’ve done that, try again. This should narrow the chances of your system being in some weird state. If it works, great! If not, it’s time to get troubleshooting.&lt;br /&gt;
&lt;br /&gt;
Some of the following sections will require the use of the command line. If you’re unfamiliar, there are plenty of good guides out there and unfortunately teaching the command line is out of scope for this document. We assume basic command line competence from here on out.&lt;br /&gt;
&lt;br /&gt;
== I can’t add the connection whatsoever ==&lt;br /&gt;
&lt;br /&gt;
First of all, check if &amp;lt;code&amp;gt;NetworkManager&amp;lt;/code&amp;gt; has the connection saved, you can list connections with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sh&amp;quot;&amp;gt;nmcli connection&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Or, &amp;lt;code&amp;gt;nmcli&amp;lt;/code&amp;gt; has short-hand commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sh&amp;quot;&amp;gt;nmcli c&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This should list all your connections, look for one with the name you gave it (which would be &amp;lt;code&amp;gt;University of Bath VPN&amp;lt;/code&amp;gt; if you followed the instructions in [[#connect-instructions|the first section]]). If it does exist, try connecting with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sh&amp;quot;&amp;gt;nmcli c up &amp;quot;University of Bath VPN&amp;quot; --ask&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
You’ll be asked for your password and you should get a Microsoft authenticator request. If you get a successful connection as per [[#what-to-expect|this section]], great! If not and you didn’t get a Microsoft authenticator request, carry on reading this section. If you didn’t get a successful connection but did get a Microsoft authenticator request, check the next section.&lt;br /&gt;
&lt;br /&gt;
First, let’s clean the slate. Check your connections with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sh&amp;quot;&amp;gt;nmcli c&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Then delete the VPN connections by their UUID (UUIDs look something like &amp;lt;code&amp;gt;7abdc95a-4b2a-42bb-9a4a-38104d288737&amp;lt;/code&amp;gt;, yours will be different):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sh&amp;quot;&amp;gt;nmcli c delete &amp;lt;uuid of the VPN connection&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Now, we’d suggest adding the connection via &amp;lt;code&amp;gt;nmcli&amp;lt;/code&amp;gt;, the command line for &amp;lt;code&amp;gt;NetworkManager&amp;lt;/code&amp;gt;. To do this, you can use the following command. &#039;&#039;&#039;Note that you’ll have replace the placeholder text with your Bath username&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sh&amp;quot;&amp;gt;nmcli connection add \&lt;br /&gt;
    con-name &amp;quot;University of Bath VPN&amp;quot; \&lt;br /&gt;
    type vpn \&lt;br /&gt;
    vpn-type org.freedesktop.NetworkManager.strongswan \&lt;br /&gt;
    ifname &amp;quot;*&amp;quot; \&lt;br /&gt;
    ipv4.dns &amp;quot;138.38.1.1,138.38.1.2&amp;quot; \&lt;br /&gt;
    ipv4.ignore-auto-dns yes \&lt;br /&gt;
    vpn.data &amp;quot;address=vpn.bath.ac.uk, method=eap, user=&amp;lt;your bath username without the @bath.ac.uk&amp;gt;, encap=yes, virtual=yes&amp;quot;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This sets up a strongSwan VPN connection using the university’s DNS servers and the &amp;lt;code&amp;gt;vpn.bath.ac.uk&amp;lt;/code&amp;gt; VPN server. It should also use your username, set UDP encapsulation enforcement, and should request an inner IP.&lt;br /&gt;
&lt;br /&gt;
You can now attempt to connect again, following the same steps as before. If you get a connection, great! If not, look for the section that best describes your issue.&lt;br /&gt;
&lt;br /&gt;
== I keep getting connection failed for an unknown reason ==&lt;br /&gt;
&lt;br /&gt;
This may happen on Ubuntu, the https://connect.bath.ac.uk/ instructions only mention installing a few packages, namely: &amp;lt;code&amp;gt;libcharon-extra-plugins&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;network-manager-strongswan&amp;lt;/code&amp;gt;, and possibly &amp;lt;code&amp;gt;network-manager-strongswan-gnome&amp;lt;/code&amp;gt;. However, to fetch the Sectigo certificate used for the VPN automatically, you will also need to install the following: &amp;lt;code&amp;gt;libstrongswan-standard-plugins&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;libstrongswan-extra-plugins&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Try to connect again once installed, and see if you get any further. You may want to check the output of the following command (on systemd machines):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sh&amp;quot;&amp;gt;&lt;br /&gt;
journalctl -u NetworkManager | grep charon &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you see anything like &amp;lt;code&amp;gt;EAP/FAIL&amp;lt;/code&amp;gt; but certificates are good, you should [[#file-a-ticket|file a ticket]]. If certificates are bad, you can try the instructions in [[StrongSwan VPN on Linux#I’m not getting a Microsoft authenticator request|this section]].&lt;br /&gt;
&lt;br /&gt;
== I’m not getting a Microsoft authenticator request ==&lt;br /&gt;
&lt;br /&gt;
Before you start this section, make sure to follow the instructions in the previous subsection so you’re in a known state.&lt;br /&gt;
&lt;br /&gt;
When you connect with &amp;lt;code&amp;gt;nmcli c up &amp;amp;quot;University of Bath VPN --ask&amp;amp;quot;&amp;lt;/code&amp;gt;, if you get an error such as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Error: Connection activation failed: No valid secrets&amp;lt;/pre&amp;gt;&lt;br /&gt;
You might need a certificate, or you may have entered your password incorrectly. To check the latter, delete the VPN connection and try again.&lt;br /&gt;
&lt;br /&gt;
If you’re not getting a Microsoft authenticator request still, you might need a certificate. The university uses Sectigo certificates for the strongSwan VPN. These &#039;&#039;should&#039;&#039; be bundled in your distro’s trust store, but either &amp;lt;code&amp;gt;charon-nm&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;NetworkManager&amp;lt;/code&amp;gt; might not be checking for them properly and so your connection might be failing. Unfortunately, there is no easy way with a VPN connection to get around this.&lt;br /&gt;
&lt;br /&gt;
The following instructions are a bit messy, but are mostly distro-agnostic and &#039;&#039;should&#039;&#039; resolve the issue &#039;&#039;if it is a certificate problem&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
There are some extra steps you can do first to confirm it is a certificate issue, though different distros package software differently and so this isn’t guaranteed to give results:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sh&amp;quot;&amp;gt;# look for anything that suggests a certificate is missing or untrusted&lt;br /&gt;
journalctl -u NetworkManager | grep charon&lt;br /&gt;
&lt;br /&gt;
# if the above doesn&#039;t show anything, try just looking through NetworkManager&#039;s logs&lt;br /&gt;
journalctl -u NetworkManager&lt;br /&gt;
&lt;br /&gt;
# if that doesn&#039;t immediately show anything, you can try the following&lt;br /&gt;
journalctl | grep Sectigo&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Anything that &#039;&#039;does&#039;&#039; come up may be useful to DDaT for troubleshooting if our troubleshooting steps don’t resolve the issue.&lt;br /&gt;
&lt;br /&gt;
Firstly, you’ll have to download the &amp;lt;code&amp;gt;Sectigo Public Server Authentication Root R46&amp;lt;/code&amp;gt; certificate. This can be found here: https://crt.sh/?d=4256644734. If you don’t trust us or the certificate has changed, find the correct certificate on this page: https://www.sectigo.com/knowledge-base/detail/Sectigo-Public-Intermediates-and-Roots.&lt;br /&gt;
&lt;br /&gt;
Once you’ve got the certificate, move it somewhere you won’t accidentally delete it. We recommend something like &amp;lt;code&amp;gt;~/.uni-vpn/sectigo-root.crt&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Now, delete your VPN connection (again, just to make sure you’re in a known state) and add the following connection. &#039;&#039;&#039;You will need to replace your username AND the path to the Sectigo root certificate&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sh&amp;quot;&amp;gt;nmcli connection add \&lt;br /&gt;
    con-name &amp;quot;University of Bath VPN&amp;quot; \&lt;br /&gt;
    type vpn \&lt;br /&gt;
    vpn-type org.freedesktop.NetworkManager.strongswan \&lt;br /&gt;
    ifname &amp;quot;*&amp;quot; \&lt;br /&gt;
    ipv4.dns &amp;quot;138.38.1.1,138.38.1.2&amp;quot; \&lt;br /&gt;
    ipv4.ignore-auto-dns yes \&lt;br /&gt;
    vpn.data &amp;quot;address=vpn.bath.ac.uk, method=eap, user=&amp;lt;your bath username without the @bath.ac.uk&amp;gt;, encap=yes, virtual=yes, certificate=/full/path/to/sectigo-root.crt&amp;quot;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
If you used our suggested location, you can replace the certificate path with &amp;lt;code&amp;gt;$HOME/.uni-vpn/sectigo-root.crt&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Attempt to connect as before. If you get a Microsoft authenticator request but don’t get a connection afterwards, go to the next section. If you don’t get a Microsoft authenticator request, [[#file-a-ticket|file a ticket]].&lt;br /&gt;
&lt;br /&gt;
== I get a Microsoft authenticator request, but no connection ==&lt;br /&gt;
&lt;br /&gt;
Firstly, try to connect again, accept the Microsoft authenticator request, and then wait ~40-50 seconds without retrying. If you get a secondary Microsoft authenticator request, this may be due to a routing misconfiguration.&lt;br /&gt;
&lt;br /&gt;
First, check for a rule under &amp;lt;code&amp;gt;210&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;220&amp;lt;/code&amp;gt; with the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sh&amp;quot;&amp;gt;ip rule&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
If you don’t see a line similar to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;210:    not from all fwmark 0xd2 lookup 210&amp;lt;/pre&amp;gt;&lt;br /&gt;
You may have a configuration or routing issue. Double check you’ve installed all the correct packages for your distro.&lt;br /&gt;
&lt;br /&gt;
To test if routing is your issue, you can add the following route:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sh&amp;quot;&amp;gt;ip route add 138.38.3.176/28 via &amp;lt;default gateway&amp;gt; table 210&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Replacing the default gateway with the IP after “default via” from running &amp;lt;code&amp;gt;ip r&amp;lt;/code&amp;gt;. Then, try connecting again. If that doesn’t work, [[#file-a-ticket|file a ticket]]. If that works, &#039;&#039;&#039;disconnect and delete the route&#039;&#039;&#039; by replacing the &amp;lt;code&amp;gt;add&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;del&amp;lt;/code&amp;gt; in the above command. You can configure &amp;lt;code&amp;gt;NetworkManager&amp;lt;/code&amp;gt; to create the route for you when you connect to the VPN, this way it won’t be forever lingering on your system.&lt;br /&gt;
&lt;br /&gt;
To do so, you can run the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sh&amp;quot;&amp;gt;nmcli c modify &amp;quot;University of Bath VPN&amp;quot; ipv4.route-table 210&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
You may need to restart the &amp;lt;code&amp;gt;NetworkManager&amp;lt;/code&amp;gt; daemon, &#039;&#039;&#039;this will temporarily disconnect you&#039;&#039;&#039;. On a &amp;lt;code&amp;gt;systemd&amp;lt;/code&amp;gt; based system, this can be done with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sh&amp;quot;&amp;gt;systemctl restart NetworkManager.service&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Now, you should be able to connect to the VPN without issues. If not, [[#file-a-ticket|file a ticket]].&lt;br /&gt;
&lt;br /&gt;
= File a ticket =&lt;br /&gt;
&lt;br /&gt;
If the troubleshooting steps given here don’t work, you should file a ticket with DDaT at: https://topdesk.bath.ac.uk/ (&amp;lt;code&amp;gt;DDaT Support: IT &amp;amp;amp; Audio Visual &amp;amp;gt; Report an Issue &amp;amp;gt; Report a Network Issue&amp;lt;/code&amp;gt;).&lt;/div&gt;</summary>
		<author><name>Pcs47</name></author>
	</entry>
	<entry>
		<id>https://wiki.bathcs.com/index.php?title=StrongSwan_VPN_on_Linux&amp;diff=176</id>
		<title>StrongSwan VPN on Linux</title>
		<link rel="alternate" type="text/html" href="https://wiki.bathcs.com/index.php?title=StrongSwan_VPN_on_Linux&amp;diff=176"/>
		<updated>2026-06-19T17:12:54Z</updated>

		<summary type="html">&lt;p&gt;Pcs47: /* I keep getting connection failed for an unknown reason */ Update link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The GlobalProtect VPN has been decommissioned by DDaT. Unfortunately, this was the only easily working VPN on Linux. The new strongSwan VPN &#039;&#039;should&#039;&#039; just work on popular distros like Mint with the instructions given at https://connect.bath.ac.uk/. Unfortunately, for the rest of us, it often does not “just work”.&lt;br /&gt;
&lt;br /&gt;
This page contains troubleshooting steps for if a basic connection doesn’t work.&lt;br /&gt;
&lt;br /&gt;
= Connect instructions =&lt;br /&gt;
&lt;br /&gt;
This section covers the basic connection instructions from https://connect.bath.ac.uk and what to expect for a successful connection. This might help your troubleshooting. If it doesn’t, giving DDaT information about what happens here might be useful.&lt;br /&gt;
&lt;br /&gt;
# Install the correct packages. The name of these packages differs from distro to distro, so you might have to do some searching. These packages (in the Ubuntu &amp;lt;code&amp;gt;apt&amp;lt;/code&amp;gt; repositories) are &amp;lt;code&amp;gt;libcharon-extra-plugins&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;network-manager-strongswan&amp;lt;/code&amp;gt;, and possibly &amp;lt;code&amp;gt;network-manager-strongswan-gnome&amp;lt;/code&amp;gt; (if you’re using the Gnome desktop environment).&lt;br /&gt;
# Using the NetworkManager GUI (might just be called network settings or similar), add a VPN connection with the following:&lt;br /&gt;
#* Connection Name: University of Bath VPN&lt;br /&gt;
#* Server Name: vpn.bath.ac.uk&lt;br /&gt;
#* VPN Type: IKEv2&lt;br /&gt;
#* Type of sign-in: Username and Password/EAP-MSCHAPv2 or simply “EAP”&lt;br /&gt;
#* Other Options: Request an inner IP address, Enforce UDP encapsulation&lt;br /&gt;
# You may need to use the university’s DNS servers (&amp;lt;code&amp;gt;138.38.1.1&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;138.38.1.2&amp;lt;/code&amp;gt;) or a public DNS server like Cloudflare’s &amp;lt;code&amp;gt;1.1.1.1&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The instructions also give the following troubleshooting advice:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;You may also need to run the command below if you find DNS lookups fail for some university resources:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sh&amp;quot;&amp;gt;sudo ln -sfv /run/systemd/resolve/resolv.conf /etc/resolv.conf&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
Though, we’re not sure this is a great idea, nor are we sure this will work on any distro.&lt;br /&gt;
&lt;br /&gt;
== What to expect ==&lt;br /&gt;
&lt;br /&gt;
Now that you’ve followed the university’s instructions, you should be able to connect using the NetworkManager GUI, it should ask you for a username and password (if you haven’t already supplied the username in the configuration), put your university credentials in (the username should be &#039;&#039;&#039;without&#039;&#039;&#039; the &amp;lt;code&amp;gt;@bath.ac.uk&amp;lt;/code&amp;gt;), and you should get a Microsoft authenticator request via the app.&lt;br /&gt;
&lt;br /&gt;
To confirm you are connected to the university VPN correctly, check you can visit any internal site. For example, go to https://2024-25.moodle-archive.bath.ac.uk/. If the page loads, you’re connected! If not, you’ll need to do some troubleshooting.&lt;br /&gt;
&lt;br /&gt;
= Troubleshooting =&lt;br /&gt;
&lt;br /&gt;
First, wipe the slate clean (delete the connection), update your system, and reboot. Once you’ve done that, try again. This should narrow the chances of your system being in some weird state. If it works, great! If not, it’s time to get troubleshooting.&lt;br /&gt;
&lt;br /&gt;
Some of the following sections will require the use of the command line. If you’re unfamiliar, there are plenty of good guides out there and unfortunately teaching the command line is out of scope for this document. We assume basic command line competence from here on out.&lt;br /&gt;
&lt;br /&gt;
== I can’t add the connection whatsoever ==&lt;br /&gt;
&lt;br /&gt;
First of all, check if &amp;lt;code&amp;gt;NetworkManager&amp;lt;/code&amp;gt; has the connection saved, you can list connections with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sh&amp;quot;&amp;gt;nmcli connection&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Or, &amp;lt;code&amp;gt;nmcli&amp;lt;/code&amp;gt; has short-hand commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sh&amp;quot;&amp;gt;nmcli c&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This should list all your connections, look for one with the name you gave it (which would be &amp;lt;code&amp;gt;University of Bath VPN&amp;lt;/code&amp;gt; if you followed the instructions in [[#connect-instructions|the first section]]). If it does exist, try connecting with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sh&amp;quot;&amp;gt;nmcli c up &amp;quot;University of Bath VPN&amp;quot; --ask&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
You’ll be asked for your password and you should get a Microsoft authenticator request. If you get a successful connection as per [[#what-to-expect|this section]], great! If not and you didn’t get a Microsoft authenticator request, carry on reading this section. If you didn’t get a successful connection but did get a Microsoft authenticator request, check the next section.&lt;br /&gt;
&lt;br /&gt;
First, let’s clean the slate. Check your connections with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sh&amp;quot;&amp;gt;nmcli c&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Then delete the VPN connections by their UUID (UUIDs look something like &amp;lt;code&amp;gt;7abdc95a-4b2a-42bb-9a4a-38104d288737&amp;lt;/code&amp;gt;, yours will be different):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sh&amp;quot;&amp;gt;nmcli c delete &amp;lt;uuid of the VPN connection&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Now, we’d suggest adding the connection via &amp;lt;code&amp;gt;nmcli&amp;lt;/code&amp;gt;, the command line for &amp;lt;code&amp;gt;NetworkManager&amp;lt;/code&amp;gt;. To do this, you can use the following command. &#039;&#039;&#039;Note that you’ll have replace the placeholder text with your Bath username&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sh&amp;quot;&amp;gt;nmcli connection add \&lt;br /&gt;
    con-name &amp;quot;University of Bath VPN&amp;quot; \&lt;br /&gt;
    type vpn \&lt;br /&gt;
    vpn-type org.freedesktop.NetworkManager.strongswan \&lt;br /&gt;
    ifname &amp;quot;*&amp;quot; \&lt;br /&gt;
    ipv4.dns &amp;quot;138.38.1.1,138.38.1.2&amp;quot; \&lt;br /&gt;
    ipv4.ignore-auto-dns yes \&lt;br /&gt;
    vpn.data &amp;quot;address=vpn.bath.ac.uk, method=eap, user=&amp;lt;your bath username without the @bath.ac.uk&amp;gt;, encap=yes, virtual=yes&amp;quot;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This sets up a strongSwan VPN connection using the university’s DNS servers and the &amp;lt;code&amp;gt;vpn.bath.ac.uk&amp;lt;/code&amp;gt; VPN server. It should also use your username, set UDP encapsulation enforcement, and should request an inner IP.&lt;br /&gt;
&lt;br /&gt;
You can now attempt to connect again, following the same steps as before. If you get a connection, great! If not, look for the section that best describes your issue.&lt;br /&gt;
&lt;br /&gt;
== I keep getting connection failed for an unknown reason ==&lt;br /&gt;
&lt;br /&gt;
This may happen on Ubuntu, the https://connect.bath.ac.uk/ instructions only mention installing a few packages, namely: &amp;lt;code&amp;gt;libcharon-extra-plugins&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;network-manager-strongswan&amp;lt;/code&amp;gt;, and possibly &amp;lt;code&amp;gt;network-manager-strongswan-gnome&amp;lt;/code&amp;gt;. However, to fetch the Sectigo certificate used for the VPN automatically, you will also need to install the following: &amp;lt;code&amp;gt;libstrongswan-standard-plugins&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;libstrongswan-extra-plugins&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Try to connect again once installed, and see if you get any further. You may want to check the output of the following command (on systemd machines):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sh&amp;quot;&amp;gt;&lt;br /&gt;
journalctl -u NetworkManager | grep charon &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you see anything like &amp;lt;code&amp;gt;EAP/FAIL&amp;lt;/code&amp;gt; but certificates are good, you should [[#file-a-ticket|file a ticket]]. If certificates are bad, you can try the instructions in [[StrongSwan VPN on Linux#I’m not getting a Microsoft authenticator request|this section]].&lt;br /&gt;
&lt;br /&gt;
== I’m not getting a Microsoft authenticator request ==&lt;br /&gt;
&lt;br /&gt;
Before you start this section, make sure to follow the instructions in the previous subsection so you’re in a known state.&lt;br /&gt;
&lt;br /&gt;
When you connect with &amp;lt;code&amp;gt;nmcli c up &amp;amp;quot;University of Bath VPN --ask&amp;amp;quot;&amp;lt;/code&amp;gt;, if you get an error such as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Error: Connection activation failed: No valid secrets&amp;lt;/pre&amp;gt;&lt;br /&gt;
You might need a certificate, or you may have entered your password incorrectly. To check the latter, delete the VPN connection and try again.&lt;br /&gt;
&lt;br /&gt;
If you’re not getting a Microsoft authenticator request still, you might need a certificate. The university uses Sectigo certificates for the strongSwan VPN. These &#039;&#039;should&#039;&#039; be bundled in your distro’s trust store, but either &amp;lt;code&amp;gt;charon-nm&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;NetworkManager&amp;lt;/code&amp;gt; might not be checking for them properly and so your connection might be failing. Unfortunately, there is no easy way with a VPN connection to get around this.&lt;br /&gt;
&lt;br /&gt;
The following instructions are a bit messy, but are mostly distro-agnostic and &#039;&#039;should&#039;&#039; resolve the issue &#039;&#039;if it is a certificate problem&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
There are some extra steps you can do first to confirm it is a certificate issue, though different distros package software differently and so this isn’t guaranteed to give results:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sh&amp;quot;&amp;gt;# look for anything that suggests a certificate is missing or untrusted&lt;br /&gt;
journalctl -u NetworkManager | grep charon&lt;br /&gt;
&lt;br /&gt;
# if the above doesn&#039;t show anything, try just looking through NetworkManager&#039;s logs&lt;br /&gt;
journalctl -u NetworkManager&lt;br /&gt;
&lt;br /&gt;
# if that doesn&#039;t immediately show anything, you can try the following&lt;br /&gt;
journalctl | grep Sectigo&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Anything that &#039;&#039;does&#039;&#039; come up may be useful to DDaT for troubleshooting if our troubleshooting steps don’t resolve the issue.&lt;br /&gt;
&lt;br /&gt;
Firstly, you’ll have to download the &amp;lt;code&amp;gt;Sectigo Public Server Authentication Root R46&amp;lt;/code&amp;gt; certificate. This can be found here: https://crt.sh/?d=4256644734. If you don’t trust us or the certificate has changed, find the correct certificate on this page: https://www.sectigo.com/knowledge-base/detail/Sectigo-Public-Intermediates-and-Roots.&lt;br /&gt;
&lt;br /&gt;
Once you’ve got the certificate, move it somewhere you won’t accidentally delete it. We recommend something like &amp;lt;code&amp;gt;~/.uni-vpn/sectigo-root.crt&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Now, delete your VPN connection (again, just to make sure you’re in a known state) and add the following connection. &#039;&#039;&#039;You will need to replace your username AND the path to the Sectigo root certificate&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sh&amp;quot;&amp;gt;nmcli connection add \&lt;br /&gt;
    con-name &amp;quot;University of Bath VPN&amp;quot; \&lt;br /&gt;
    type vpn \&lt;br /&gt;
    vpn-type org.freedesktop.NetworkManager.strongswan \&lt;br /&gt;
    ifname &amp;quot;*&amp;quot; \&lt;br /&gt;
    ipv4.dns &amp;quot;138.38.1.1,138.38.1.2&amp;quot; \&lt;br /&gt;
    ipv4.ignore-auto-dns yes \&lt;br /&gt;
    vpn.data &amp;quot;address=vpn.bath.ac.uk, method=eap, user=&amp;lt;your bath username without the @bath.ac.uk&amp;gt;, encap=yes, virtual=yes, certificate=/full/path/to/sectigo-root.crt&amp;quot;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
If you used our suggested location, you can replace the certificate path with &amp;lt;code&amp;gt;$HOME/.uni-vpn/sectigo-root.crt&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Attempt to connect as before. If you get a Microsoft authenticator request but don’t get a connection afterwards, go to the next section. If you don’t get a Microsoft authenticator request, [[#file-a-ticket|file a ticket]].&lt;br /&gt;
&lt;br /&gt;
== I get a Microsoft authenticator request, but no connection ==&lt;br /&gt;
&lt;br /&gt;
Firstly, try to connect again, accept the Microsoft authenticator request, and then wait ~40-50 seconds without retrying. If you get a secondary Microsoft authenticator request, this may be due to a routing misconfiguration.&lt;br /&gt;
&lt;br /&gt;
First, check for a rule under &amp;lt;code&amp;gt;210&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;220&amp;lt;/code&amp;gt; with the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sh&amp;quot;&amp;gt;ip rule&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
If you don’t see a line similar to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;210:    not from all fwmark 0xd2 lookup 210&amp;lt;/pre&amp;gt;&lt;br /&gt;
You may have a configuration or routing issue. Double check you’ve installed all the correct packages for your distro.&lt;br /&gt;
&lt;br /&gt;
To test if routing is your issue, you can add the following route:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sh&amp;quot;&amp;gt;ip route add 138.38.3.176/28 via &amp;lt;default gateway&amp;gt; table 210&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Replacing the default gateway with the IP after “default via” from running &amp;lt;code&amp;gt;ip r&amp;lt;/code&amp;gt;. Then, try connecting again. If that doesn’t work, [[#file-a-ticket|file a ticket]]. If that works, &#039;&#039;&#039;disconnect and delete the route&#039;&#039;&#039; by replacing the &amp;lt;code&amp;gt;add&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;del&amp;lt;/code&amp;gt; in the above command. You can configure &amp;lt;code&amp;gt;NetworkManager&amp;lt;/code&amp;gt; to create the route for you when you connect to the VPN, this way it won’t be forever lingering on your system.&lt;br /&gt;
&lt;br /&gt;
To do so, you can run the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sh&amp;quot;&amp;gt;nmcli c modify &amp;quot;University of Bath VPN&amp;quot; ipv4.route-table 210&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
You may need to restart the &amp;lt;code&amp;gt;NetworkManager&amp;lt;/code&amp;gt; daemon, &#039;&#039;&#039;this will temporarily disconnect you&#039;&#039;&#039;. On a &amp;lt;code&amp;gt;systemd&amp;lt;/code&amp;gt; based system, this can be done with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sh&amp;quot;&amp;gt;systemctl restart NetworkManager.service&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Now, you should be able to connect to the VPN without issues. If not, [[#file-a-ticket|file a ticket]].&lt;br /&gt;
&lt;br /&gt;
= File a ticket =&lt;br /&gt;
&lt;br /&gt;
If the troubleshooting steps given here don’t work, you should file a ticket with DDaT at: https://topdesk.bath.ac.uk/ (&amp;lt;code&amp;gt;DDaT Support: IT &amp;amp;amp; Audio Visual &amp;amp;gt; Report an Issue &amp;amp;gt; Report a Network Issue&amp;lt;/code&amp;gt;).&lt;/div&gt;</summary>
		<author><name>Pcs47</name></author>
	</entry>
	<entry>
		<id>https://wiki.bathcs.com/index.php?title=StrongSwan_VPN_on_Linux&amp;diff=175</id>
		<title>StrongSwan VPN on Linux</title>
		<link rel="alternate" type="text/html" href="https://wiki.bathcs.com/index.php?title=StrongSwan_VPN_on_Linux&amp;diff=175"/>
		<updated>2026-06-19T16:57:57Z</updated>

		<summary type="html">&lt;p&gt;Pcs47: Add issues encountered while setting up VPN for someone on Ubuntu.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The GlobalProtect VPN has been decommissioned by DDaT. Unfortunately, this was the only easily working VPN on Linux. The new strongSwan VPN &#039;&#039;should&#039;&#039; just work on popular distros like Mint with the instructions given at https://connect.bath.ac.uk/. Unfortunately, for the rest of us, it often does not “just work”.&lt;br /&gt;
&lt;br /&gt;
This page contains troubleshooting steps for if a basic connection doesn’t work.&lt;br /&gt;
&lt;br /&gt;
= Connect instructions =&lt;br /&gt;
&lt;br /&gt;
This section covers the basic connection instructions from https://connect.bath.ac.uk and what to expect for a successful connection. This might help your troubleshooting. If it doesn’t, giving DDaT information about what happens here might be useful.&lt;br /&gt;
&lt;br /&gt;
# Install the correct packages. The name of these packages differs from distro to distro, so you might have to do some searching. These packages (in the Ubuntu &amp;lt;code&amp;gt;apt&amp;lt;/code&amp;gt; repositories) are &amp;lt;code&amp;gt;libcharon-extra-plugins&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;network-manager-strongswan&amp;lt;/code&amp;gt;, and possibly &amp;lt;code&amp;gt;network-manager-strongswan-gnome&amp;lt;/code&amp;gt; (if you’re using the Gnome desktop environment).&lt;br /&gt;
# Using the NetworkManager GUI (might just be called network settings or similar), add a VPN connection with the following:&lt;br /&gt;
#* Connection Name: University of Bath VPN&lt;br /&gt;
#* Server Name: vpn.bath.ac.uk&lt;br /&gt;
#* VPN Type: IKEv2&lt;br /&gt;
#* Type of sign-in: Username and Password/EAP-MSCHAPv2 or simply “EAP”&lt;br /&gt;
#* Other Options: Request an inner IP address, Enforce UDP encapsulation&lt;br /&gt;
# You may need to use the university’s DNS servers (&amp;lt;code&amp;gt;138.38.1.1&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;138.38.1.2&amp;lt;/code&amp;gt;) or a public DNS server like Cloudflare’s &amp;lt;code&amp;gt;1.1.1.1&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The instructions also give the following troubleshooting advice:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;You may also need to run the command below if you find DNS lookups fail for some university resources:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sh&amp;quot;&amp;gt;sudo ln -sfv /run/systemd/resolve/resolv.conf /etc/resolv.conf&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
Though, we’re not sure this is a great idea, nor are we sure this will work on any distro.&lt;br /&gt;
&lt;br /&gt;
== What to expect ==&lt;br /&gt;
&lt;br /&gt;
Now that you’ve followed the university’s instructions, you should be able to connect using the NetworkManager GUI, it should ask you for a username and password (if you haven’t already supplied the username in the configuration), put your university credentials in (the username should be &#039;&#039;&#039;without&#039;&#039;&#039; the &amp;lt;code&amp;gt;@bath.ac.uk&amp;lt;/code&amp;gt;), and you should get a Microsoft authenticator request via the app.&lt;br /&gt;
&lt;br /&gt;
To confirm you are connected to the university VPN correctly, check you can visit any internal site. For example, go to https://2024-25.moodle-archive.bath.ac.uk/. If the page loads, you’re connected! If not, you’ll need to do some troubleshooting.&lt;br /&gt;
&lt;br /&gt;
= Troubleshooting =&lt;br /&gt;
&lt;br /&gt;
First, wipe the slate clean (delete the connection), update your system, and reboot. Once you’ve done that, try again. This should narrow the chances of your system being in some weird state. If it works, great! If not, it’s time to get troubleshooting.&lt;br /&gt;
&lt;br /&gt;
Some of the following sections will require the use of the command line. If you’re unfamiliar, there are plenty of good guides out there and unfortunately teaching the command line is out of scope for this document. We assume basic command line competence from here on out.&lt;br /&gt;
&lt;br /&gt;
== I can’t add the connection whatsoever ==&lt;br /&gt;
&lt;br /&gt;
First of all, check if &amp;lt;code&amp;gt;NetworkManager&amp;lt;/code&amp;gt; has the connection saved, you can list connections with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sh&amp;quot;&amp;gt;nmcli connection&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Or, &amp;lt;code&amp;gt;nmcli&amp;lt;/code&amp;gt; has short-hand commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sh&amp;quot;&amp;gt;nmcli c&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This should list all your connections, look for one with the name you gave it (which would be &amp;lt;code&amp;gt;University of Bath VPN&amp;lt;/code&amp;gt; if you followed the instructions in [[#connect-instructions|the first section]]). If it does exist, try connecting with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sh&amp;quot;&amp;gt;nmcli c up &amp;quot;University of Bath VPN&amp;quot; --ask&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
You’ll be asked for your password and you should get a Microsoft authenticator request. If you get a successful connection as per [[#what-to-expect|this section]], great! If not and you didn’t get a Microsoft authenticator request, carry on reading this section. If you didn’t get a successful connection but did get a Microsoft authenticator request, check the next section.&lt;br /&gt;
&lt;br /&gt;
First, let’s clean the slate. Check your connections with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sh&amp;quot;&amp;gt;nmcli c&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Then delete the VPN connections by their UUID (UUIDs look something like &amp;lt;code&amp;gt;7abdc95a-4b2a-42bb-9a4a-38104d288737&amp;lt;/code&amp;gt;, yours will be different):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sh&amp;quot;&amp;gt;nmcli c delete &amp;lt;uuid of the VPN connection&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Now, we’d suggest adding the connection via &amp;lt;code&amp;gt;nmcli&amp;lt;/code&amp;gt;, the command line for &amp;lt;code&amp;gt;NetworkManager&amp;lt;/code&amp;gt;. To do this, you can use the following command. &#039;&#039;&#039;Note that you’ll have replace the placeholder text with your Bath username&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sh&amp;quot;&amp;gt;nmcli connection add \&lt;br /&gt;
    con-name &amp;quot;University of Bath VPN&amp;quot; \&lt;br /&gt;
    type vpn \&lt;br /&gt;
    vpn-type org.freedesktop.NetworkManager.strongswan \&lt;br /&gt;
    ifname &amp;quot;*&amp;quot; \&lt;br /&gt;
    ipv4.dns &amp;quot;138.38.1.1,138.38.1.2&amp;quot; \&lt;br /&gt;
    ipv4.ignore-auto-dns yes \&lt;br /&gt;
    vpn.data &amp;quot;address=vpn.bath.ac.uk, method=eap, user=&amp;lt;your bath username without the @bath.ac.uk&amp;gt;, encap=yes, virtual=yes&amp;quot;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This sets up a strongSwan VPN connection using the university’s DNS servers and the &amp;lt;code&amp;gt;vpn.bath.ac.uk&amp;lt;/code&amp;gt; VPN server. It should also use your username, set UDP encapsulation enforcement, and should request an inner IP.&lt;br /&gt;
&lt;br /&gt;
You can now attempt to connect again, following the same steps as before. If you get a connection, great! If not, look for the section that best describes your issue.&lt;br /&gt;
&lt;br /&gt;
== I keep getting connection failed for an unknown reason ==&lt;br /&gt;
&lt;br /&gt;
This may happen on Ubuntu, the https://connect.bath.ac.uk/ instructions only mention installing a few packages, namely: &amp;lt;code&amp;gt;libcharon-extra-plugins&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;network-manager-strongswan&amp;lt;/code&amp;gt;, and possibly &amp;lt;code&amp;gt;network-manager-strongswan-gnome&amp;lt;/code&amp;gt;. However, to fetch the Sectigo certificate used for the VPN automatically, you will also need to install the following: &amp;lt;code&amp;gt;libstrongswan-standard-plugins&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;libstrongswan-extra-plugins&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Try to connect again once installed, and see if you get any further. You may want to check the output of the following command (on systemd machines):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sh&amp;quot;&amp;gt;&lt;br /&gt;
journalctl -u NetworkManager | grep charon &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you see anything like &amp;lt;code&amp;gt;EAP/FAIL&amp;lt;/code&amp;gt; but certificates are good, you should [[#file-a-ticket|file a ticket]]. If certificates are bad, you can try the instructions in [[#im-not-getting-a-microsoft-authenticator-request|this section]].&lt;br /&gt;
&lt;br /&gt;
== I’m not getting a Microsoft authenticator request ==&lt;br /&gt;
&lt;br /&gt;
Before you start this section, make sure to follow the instructions in the previous subsection so you’re in a known state.&lt;br /&gt;
&lt;br /&gt;
When you connect with &amp;lt;code&amp;gt;nmcli c up &amp;amp;quot;University of Bath VPN --ask&amp;amp;quot;&amp;lt;/code&amp;gt;, if you get an error such as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Error: Connection activation failed: No valid secrets&amp;lt;/pre&amp;gt;&lt;br /&gt;
You might need a certificate, or you may have entered your password incorrectly. To check the latter, delete the VPN connection and try again.&lt;br /&gt;
&lt;br /&gt;
If you’re not getting a Microsoft authenticator request still, you might need a certificate. The university uses Sectigo certificates for the strongSwan VPN. These &#039;&#039;should&#039;&#039; be bundled in your distro’s trust store, but either &amp;lt;code&amp;gt;charon-nm&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;NetworkManager&amp;lt;/code&amp;gt; might not be checking for them properly and so your connection might be failing. Unfortunately, there is no easy way with a VPN connection to get around this.&lt;br /&gt;
&lt;br /&gt;
The following instructions are a bit messy, but are mostly distro-agnostic and &#039;&#039;should&#039;&#039; resolve the issue &#039;&#039;if it is a certificate problem&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
There are some extra steps you can do first to confirm it is a certificate issue, though different distros package software differently and so this isn’t guaranteed to give results:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sh&amp;quot;&amp;gt;# look for anything that suggests a certificate is missing or untrusted&lt;br /&gt;
journalctl -u NetworkManager | grep charon&lt;br /&gt;
&lt;br /&gt;
# if the above doesn&#039;t show anything, try just looking through NetworkManager&#039;s logs&lt;br /&gt;
journalctl -u NetworkManager&lt;br /&gt;
&lt;br /&gt;
# if that doesn&#039;t immediately show anything, you can try the following&lt;br /&gt;
journalctl | grep Sectigo&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Anything that &#039;&#039;does&#039;&#039; come up may be useful to DDaT for troubleshooting if our troubleshooting steps don’t resolve the issue.&lt;br /&gt;
&lt;br /&gt;
Firstly, you’ll have to download the &amp;lt;code&amp;gt;Sectigo Public Server Authentication Root R46&amp;lt;/code&amp;gt; certificate. This can be found here: https://crt.sh/?d=4256644734. If you don’t trust us or the certificate has changed, find the correct certificate on this page: https://www.sectigo.com/knowledge-base/detail/Sectigo-Public-Intermediates-and-Roots.&lt;br /&gt;
&lt;br /&gt;
Once you’ve got the certificate, move it somewhere you won’t accidentally delete it. We recommend something like &amp;lt;code&amp;gt;~/.uni-vpn/sectigo-root.crt&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Now, delete your VPN connection (again, just to make sure you’re in a known state) and add the following connection. &#039;&#039;&#039;You will need to replace your username AND the path to the Sectigo root certificate&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sh&amp;quot;&amp;gt;nmcli connection add \&lt;br /&gt;
    con-name &amp;quot;University of Bath VPN&amp;quot; \&lt;br /&gt;
    type vpn \&lt;br /&gt;
    vpn-type org.freedesktop.NetworkManager.strongswan \&lt;br /&gt;
    ifname &amp;quot;*&amp;quot; \&lt;br /&gt;
    ipv4.dns &amp;quot;138.38.1.1,138.38.1.2&amp;quot; \&lt;br /&gt;
    ipv4.ignore-auto-dns yes \&lt;br /&gt;
    vpn.data &amp;quot;address=vpn.bath.ac.uk, method=eap, user=&amp;lt;your bath username without the @bath.ac.uk&amp;gt;, encap=yes, virtual=yes, certificate=/full/path/to/sectigo-root.crt&amp;quot;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
If you used our suggested location, you can replace the certificate path with &amp;lt;code&amp;gt;$HOME/.uni-vpn/sectigo-root.crt&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Attempt to connect as before. If you get a Microsoft authenticator request but don’t get a connection afterwards, go to the next section. If you don’t get a Microsoft authenticator request, [[#file-a-ticket|file a ticket]].&lt;br /&gt;
&lt;br /&gt;
== I get a Microsoft authenticator request, but no connection ==&lt;br /&gt;
&lt;br /&gt;
Firstly, try to connect again, accept the Microsoft authenticator request, and then wait ~40-50 seconds without retrying. If you get a secondary Microsoft authenticator request, this may be due to a routing misconfiguration.&lt;br /&gt;
&lt;br /&gt;
First, check for a rule under &amp;lt;code&amp;gt;210&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;220&amp;lt;/code&amp;gt; with the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sh&amp;quot;&amp;gt;ip rule&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
If you don’t see a line similar to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;210:    not from all fwmark 0xd2 lookup 210&amp;lt;/pre&amp;gt;&lt;br /&gt;
You may have a configuration or routing issue. Double check you’ve installed all the correct packages for your distro.&lt;br /&gt;
&lt;br /&gt;
To test if routing is your issue, you can add the following route:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sh&amp;quot;&amp;gt;ip route add 138.38.3.176/28 via &amp;lt;default gateway&amp;gt; table 210&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Replacing the default gateway with the IP after “default via” from running &amp;lt;code&amp;gt;ip r&amp;lt;/code&amp;gt;. Then, try connecting again. If that doesn’t work, [[#file-a-ticket|file a ticket]]. If that works, &#039;&#039;&#039;disconnect and delete the route&#039;&#039;&#039; by replacing the &amp;lt;code&amp;gt;add&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;del&amp;lt;/code&amp;gt; in the above command. You can configure &amp;lt;code&amp;gt;NetworkManager&amp;lt;/code&amp;gt; to create the route for you when you connect to the VPN, this way it won’t be forever lingering on your system.&lt;br /&gt;
&lt;br /&gt;
To do so, you can run the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sh&amp;quot;&amp;gt;nmcli c modify &amp;quot;University of Bath VPN&amp;quot; ipv4.route-table 210&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
You may need to restart the &amp;lt;code&amp;gt;NetworkManager&amp;lt;/code&amp;gt; daemon, &#039;&#039;&#039;this will temporarily disconnect you&#039;&#039;&#039;. On a &amp;lt;code&amp;gt;systemd&amp;lt;/code&amp;gt; based system, this can be done with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sh&amp;quot;&amp;gt;systemctl restart NetworkManager.service&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Now, you should be able to connect to the VPN without issues. If not, [[#file-a-ticket|file a ticket]].&lt;br /&gt;
&lt;br /&gt;
= File a ticket =&lt;br /&gt;
&lt;br /&gt;
If the troubleshooting steps given here don’t work, you should file a ticket with DDaT at: https://topdesk.bath.ac.uk/ (&amp;lt;code&amp;gt;DDaT Support: IT &amp;amp;amp; Audio Visual &amp;amp;gt; Report an Issue &amp;amp;gt; Report a Network Issue&amp;lt;/code&amp;gt;).&lt;/div&gt;</summary>
		<author><name>Pcs47</name></author>
	</entry>
	<entry>
		<id>https://wiki.bathcs.com/index.php?title=Terraform&amp;diff=174</id>
		<title>Terraform</title>
		<link rel="alternate" type="text/html" href="https://wiki.bathcs.com/index.php?title=Terraform&amp;diff=174"/>
		<updated>2026-06-12T00:49:12Z</updated>

		<summary type="html">&lt;p&gt;Pcs47: Add info about the recreation footgun.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[BOSS]] uses terraform (actually [https://opentofu.org/ &amp;lt;code&amp;gt;opentofu&amp;lt;/code&amp;gt;]) to deploy all the resources onto [[BOSS/Hosting/Cluster|their kubernetes cluster]], which tries to be the language in which you can deploy anything and everything and if you need to quickly redeploy a whole machine you can with a simple command. In practise it doesn’t work like that, but its good enough for our needs.&lt;br /&gt;
&lt;br /&gt;
You can find the [https://gitlab.bath.ac.uk/cs/int/terraform terraform repo on gitlab], this page was originally taken from the README as it got too long.&lt;br /&gt;
&lt;br /&gt;
== Other resources ==&lt;br /&gt;
&lt;br /&gt;
* [https://developer.hashicorp.com/terraform/tutorials Hashicorp (the maker of the closed source terraform) has some good tutorials on their site]&lt;br /&gt;
&lt;br /&gt;
Basically that’s it really, the rest of this will be looking at how to deploy an application with our configuration.&lt;br /&gt;
&lt;br /&gt;
== Terraform and its woes ==&lt;br /&gt;
&lt;br /&gt;
Before we get into making an app, I must briefly explain terraform and its benefits/issues/confusing behaviours.&lt;br /&gt;
&lt;br /&gt;
This expects you to have a rough idea around how terraform works. But here is a quick explainer: terraform is build around &#039;&#039;&#039;resources&#039;&#039;&#039;, provided by &#039;&#039;&#039;providers&#039;&#039;&#039;. These resources have a state stored locally in a state file, whether they are deployed, generated values etc. (note that these can literally be anything e.g. from random passwords to HTTP reequests to kubernetes resources to DNS records). These resources can then be organised into modules, which (can) have outputs from values generated by the resources. There are also “data”, but this is basically a reference to another resource which doesn’t have the controls.&lt;br /&gt;
&lt;br /&gt;
When deploying, terraform will then check the state of all the current deployed modules (even pinging servers if needed) and find anything that has changed (e.g. new resources or updated values) and deploy everything.&lt;br /&gt;
&lt;br /&gt;
=== Module structure ===&lt;br /&gt;
&lt;br /&gt;
Modules are the core of terraform and can be a bit tricky to get your head around, as initially they are quite limited (e.g. there is no such thing as a global variable).&lt;br /&gt;
&lt;br /&gt;
But basically a module has a list of inputs as and a list of outputs (and then providers). So it is expected that your module deploys some resources which are then used to output something. E.g. in [https://gitlab.bath.ac.uk/cs/int/terraform/-/blob/main/utils/ldap/user|our ldap user module] the module generates a random password, creates the user and assigns them to a group, then outputs the username, email and password to be used later in another resource.&lt;br /&gt;
&lt;br /&gt;
So e.g.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;terraform&amp;quot;&amp;gt;module &amp;quot;user&amp;quot; {&lt;br /&gt;
  source = &amp;quot;../../utils/ldap/user&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  display   = &amp;quot;Example&amp;quot;&lt;br /&gt;
  username  = &amp;quot;example&amp;quot;&lt;br /&gt;
  group_ids = var.ldap_group_ids&lt;br /&gt;
&lt;br /&gt;
  providers = {&lt;br /&gt;
    // Note passing providers act somewhat like global constants, passing configuration (e.g. what ldap server we mean)&lt;br /&gt;
    // to the module&lt;br /&gt;
    lldap = lldap&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// You can then use the email by: module.user.email or password: module.user.password&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;: All files within a module (the folder) are treated as one global space, similar to how Go works. You can reference variables, locals and resources throughout all files within a module which makes it quite difficult to organise nicely.&lt;br /&gt;
&lt;br /&gt;
The modules are usually structure in the way:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;init.tf&amp;lt;/code&amp;gt; – Usually where your &amp;lt;code&amp;gt;providers&amp;lt;/code&amp;gt; go and if you are lazy (like me), everything else&lt;br /&gt;
* &amp;lt;code&amp;gt;vars.tf&amp;lt;/code&amp;gt;/&amp;lt;code&amp;gt;variables.tf&amp;lt;/code&amp;gt; – Where you put all your variables. As explained in [[#Variable madness|Variable madness]], I really don’t like this and so commonly ignore&lt;br /&gt;
* &amp;lt;code&amp;gt;outputs.tf&amp;lt;/code&amp;gt; – All your outputs go here&lt;br /&gt;
* &amp;lt;code&amp;gt;*.tf&amp;lt;/code&amp;gt; – Anything else, if you want to split it out nicely into other files&lt;br /&gt;
&lt;br /&gt;
=== Variable madness ===&lt;br /&gt;
&lt;br /&gt;
Terraform variables suck.&lt;br /&gt;
&lt;br /&gt;
Anyway, so basically terraform requires you do a full definition for every variable:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;terraform&amp;quot;&amp;gt;variable &amp;quot;my_var&amp;quot; {&lt;br /&gt;
  type = string&lt;br /&gt;
&lt;br /&gt;
  description = &amp;quot;Something&amp;quot;&lt;br /&gt;
  nullable = false&lt;br /&gt;
&lt;br /&gt;
  sensitive = false # If something is sensitive MAKE THIS TRUE&lt;br /&gt;
}&lt;br /&gt;
// You can then later reference it with var.my_var&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This defines something that must be inputed by the user, either through the module or your &amp;lt;code&amp;gt;tfvars&amp;lt;/code&amp;gt; file (if in the root directory).&lt;br /&gt;
&lt;br /&gt;
Due to this verbosity, and sometimes complex nature of the interfaces I like to create, I have used the &amp;lt;code&amp;gt;object&amp;lt;/code&amp;gt; type e.g.:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;terraform&amp;quot;&amp;gt;variable &amp;quot;my_var&amp;quot; {&lt;br /&gt;
  type = object({&lt;br /&gt;
    l = list(string)&lt;br /&gt;
    m = map(bool) # string -&amp;gt; bool. Same syntax as object, just more flexible&lt;br /&gt;
    s = set(string) # Yes this is different to list but using the same []&lt;br /&gt;
    option = optional(string, &amp;quot;my_default&amp;quot;)&lt;br /&gt;
  })&lt;br /&gt;
  // ...&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
But even then you can’t define nice defaults for each sub item and the description is for the whole variable, so it has to be done as so. This is just raw pain and not particularly great syntax in my opinion. Also you cannot enable/disable sensitive nature of values for sub items, this means the whole object must be defined as sensitive if you have one password.&lt;br /&gt;
&lt;br /&gt;
And due to the lack of global constants, you must define every variable in every sub project and duplicate the types (yes there is &#039;&#039;&#039;no&#039;&#039;&#039; way to define a type to use throughout the project).&lt;br /&gt;
&lt;br /&gt;
It is also recommended that you put all variables in a &amp;lt;code&amp;gt;vars.tf&amp;lt;/code&amp;gt; file. Which sure does make sense for small modules, but if its that small I find it easier to just chuck at the top of the &amp;lt;code&amp;gt;init.tf&amp;lt;/code&amp;gt; file (as the terraform syntax highlighter is soooo broken). Then if its large, I find it more useful to put the variables where they are actually used – but then again this is confusing because the syntax and tooling is so bad.&lt;br /&gt;
&lt;br /&gt;
Oh yeah sorry and then there are &#039;&#039;&#039;locals&#039;&#039;&#039; which are constants you can define from resources/variables and will be calculated when the information is ready. E.g.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;terraform&amp;quot;&amp;gt;locals {&lt;br /&gt;
  temp_val = &amp;quot;hi&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
// Then you can reference with local.temp_val&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Depends on and its pains ===&lt;br /&gt;
&lt;br /&gt;
The one issue with terraform is that its really slow with large projects with this. But the nature of the design encourages large projects (as you want to reference things throughout the smaller apps).&lt;br /&gt;
&lt;br /&gt;
This is due to it having to create a dependency graph where objects wait on their dependencies. These dependencies can be defined by &amp;lt;code&amp;gt;depends_on&amp;lt;/code&amp;gt; in any resource or just referencing a value from another resource.&lt;br /&gt;
&lt;br /&gt;
This is really useful so deployments are not actually deployed until all the secrets are deployed. Due to my perferable of not repeating myself, I heavily use the inferred dependency from the referring to resource names e.g. &amp;lt;code&amp;gt;kubernetes_secret_v1.secret.metadata[0].name&amp;lt;/code&amp;gt; (yes this is why I don’t just do the simple thing and use the shorter name, its good to know where the value comes from).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;BUT&#039;&#039;&#039; you cannot rely on this, as some things take time to actually deploy even if it says its successful. Therefore you may need to use timers instead. I usually don’t bother due to the numerous other issues with terraform making it so its not actually perfect so there’s minimal point actually making it easy to deploy from scratch.&lt;br /&gt;
&lt;br /&gt;
=== Timeouts ===&lt;br /&gt;
&lt;br /&gt;
If something goes wrong during deployment, e.g. you make a typo, you will have to wait the FULL timeout time. This is really painful when you typo the hostname to the db causing the pod to crashloop in a helm config and you have to wait 10 minutes for terraform to give up. You can Ctrl-C, Ctrl-C, but this causes more issues as you will have to manually intervene and delete the helm chart/deployment before you run the command again.&lt;br /&gt;
&lt;br /&gt;
Instead I recommend shortening the timeouts for the deployment/helm to one more applicable to the application. A lot of our first-party stuff usually deploys in a few seconds and if it doesn’t, something has gone very wrong.&lt;br /&gt;
&lt;br /&gt;
=== Commas or no commas? ===&lt;br /&gt;
&lt;br /&gt;
The terraform syntax is… interesting. Commas are optional in most cases. So I would recommend, not typing commas where they optional.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;BUT&#039;&#039;&#039; within lists/sets (basically between &amp;lt;code&amp;gt;[]&amp;lt;/code&amp;gt;) you have to type commas, and if this is across multiple lines &#039;&#039;&#039;PLEASE ADD TRAILING COMMAS&#039;&#039;&#039;. The reason? Git histories look sooooooo much better.&lt;br /&gt;
&lt;br /&gt;
=== The recreation footgun ===&lt;br /&gt;
&lt;br /&gt;
If you are new to terraform, you might make the following change without thinking too much:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;terraform&amp;quot;&amp;gt;&lt;br /&gt;
resource &amp;quot;aws_db_instance&amp;quot; &amp;quot;old_name&amp;quot; {&lt;br /&gt;
  # configuration goes here&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
into&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;terraform&amp;quot;&amp;gt;&lt;br /&gt;
resource &amp;quot;aws_db_instance&amp;quot; &amp;quot;cool_new_name&amp;quot; {&lt;br /&gt;
  # EXACT SAME configuration goes here&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will actually completely wipe that database instance from the face of the planet if you just blindly run &amp;lt;code&amp;gt;tofu plan&amp;lt;/code&amp;gt; then &amp;lt;code&amp;gt;tofu apply&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
What terraform actually does is:&lt;br /&gt;
&lt;br /&gt;
# Oh, &amp;lt;code&amp;gt;old_name&amp;lt;/code&amp;gt; doesn&#039;t exist anymore? I&#039;ll delete that instance then.&lt;br /&gt;
# Ah, a new &amp;lt;code&amp;gt;cool_new_name&amp;lt;/code&amp;gt; instance! I&#039;ll make that fresh then.&lt;br /&gt;
&lt;br /&gt;
You are now left with no data (unless you made backups).&lt;br /&gt;
&lt;br /&gt;
To avoid this, we have a couple options. The first and generally preferred option is to use a [https://developer.hashicorp.com/terraform/language/block/moved &amp;lt;code&amp;gt;moved&amp;lt;/code&amp;gt; block]. For the above example, we can do:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;terraform&amp;quot;&amp;gt;&lt;br /&gt;
moved {&lt;br /&gt;
  from = aws_db_instance.old_name&lt;br /&gt;
  to = aws_db_instance.cool_new_name&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
resource &amp;quot;aws_db_instance&amp;quot; &amp;quot;cool_new_name&amp;quot; {&lt;br /&gt;
  # original configuration goes here&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These may litter the code and so they should be removed after a while and are only really preferred if multiple people are working on the terraform. For example, it shows a reviewer that you&#039;ve renamed a resource and if they deploy it, they won&#039;t mess it up.&lt;br /&gt;
&lt;br /&gt;
The other option is to rename it in the code and just run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sh&amp;quot;&amp;gt;&lt;br /&gt;
tofu state mv aws_db_instance.old_name aws_db_instance.cool_new_name&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, when you &amp;lt;code&amp;gt;tofu plan&amp;lt;/code&amp;gt; you shouldn&#039;t see any deletion for the old resource.&lt;br /&gt;
&lt;br /&gt;
== How to create a basic project ==&lt;br /&gt;
&lt;br /&gt;
=== Creating a namespace ===&lt;br /&gt;
&lt;br /&gt;
There is a handy util module for this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;terraform&amp;quot;&amp;gt;module &amp;quot;example_namespace&amp;quot; {&lt;br /&gt;
  source = &amp;quot;./utils/namespace&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  name = &amp;quot;example&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  enable_dns = true&lt;br /&gt;
  enable_mail = true&lt;br /&gt;
  enable_lldap = true&lt;br /&gt;
  bkp = {&lt;br /&gt;
    // ...&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  providers = {&lt;br /&gt;
    kubernetes = kubernetes&lt;br /&gt;
  }&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This allows you to enable or disable features for your namespace, e.g. if your pods need to communicate with the outside world, enabling the DNS. All of these features are disabled by default and its heavily encouraged to only enable the features if the namespace needs it.&lt;br /&gt;
&lt;br /&gt;
The next thing is to configure backups through this, to reduce our dependence and costs from our s3 provider, it is recommended that backups are disabled for all namespaces whos data can be regenerated (e.g. froom). If you do enable it, it is then encouraged that you disable backups for any database or pvc that you don’t need backing up with the &amp;lt;code&amp;gt;k8up.io/backup=false&amp;lt;/code&amp;gt; annotation (you may notice that all &amp;lt;code&amp;gt;valkey&amp;lt;/code&amp;gt; instances set this by default if you are using the &amp;lt;code&amp;gt;app/valkey&amp;lt;/code&amp;gt; module).&lt;br /&gt;
&lt;br /&gt;
==== Placement ====&lt;br /&gt;
&lt;br /&gt;
Within this repository, it is tradition to put the namespace creation at the highest level, e.g. &amp;lt;code&amp;gt;20_apps.tf&amp;lt;/code&amp;gt;. This means that the apps themselves do not control the namespace they are created in. It is mostly just a personal preference from me after years of configuring k8s on terraform.&lt;br /&gt;
&lt;br /&gt;
=== Using Helm ===&lt;br /&gt;
&lt;br /&gt;
Helm is by far the easiest way to deploy third-party tools, and is used throught this repo despite it’s drawbacks when combined with terraform (it’s just so easy).&lt;br /&gt;
&lt;br /&gt;
You just add helm to the providers list (which defines what terraform modules you are integrating with):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;terraform&amp;quot;&amp;gt;terraform {&lt;br /&gt;
  required_providers {&lt;br /&gt;
    helm = {&lt;br /&gt;
      source  = &amp;quot;hashicorp/helm&amp;quot;&lt;br /&gt;
      version = &amp;quot;~&amp;gt;3.1.1&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
You can then use the &amp;lt;code&amp;gt;helm_release&amp;lt;/code&amp;gt; resource, which takes the form:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;terraform&amp;quot;&amp;gt;resource &amp;quot;helm_release&amp;quot; &amp;quot;my_app&amp;quot; {&lt;br /&gt;
  name      = &amp;quot;my_app&amp;quot;&lt;br /&gt;
  namespace = var.namespace&lt;br /&gt;
&lt;br /&gt;
  repository = &amp;quot;https://charts.example.com&amp;quot;&lt;br /&gt;
  chart      = &amp;quot;the_app&amp;quot;&lt;br /&gt;
  version    = &amp;quot;version&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  values = [yamlencode({&lt;br /&gt;
    // Values go here written within the terraform config language&lt;br /&gt;
  })]&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This deploys all the resources an application needs and manages and restarting if a secret or config map changes, providing all the configuration at your fingertips.&lt;br /&gt;
&lt;br /&gt;
However this comes at a cost:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;SECRETS SHOULD NOT GO IN THE HELM CONFIG&#039;&#039;&#039;. This is a big one, all values are easily accessible unencrypted on the cluster, therefore any secrets &#039;&#039;&#039;MUST&#039;&#039;&#039; go in a &amp;lt;code&amp;gt;kubernetes_secrets_v1&amp;lt;/code&amp;gt; object and you should use a &amp;lt;code&amp;gt;secretsRef&amp;lt;/code&amp;gt; or similar to link it. If the helm chart does not support this &#039;&#039;&#039;DO NOT USE IT&#039;&#039;&#039;. Helm also stores the history of all values, therefore if you put it temporarily within helm values for testing, you must to a password rotation.&lt;br /&gt;
* You have no power over the types of resources and the structure in which it deploys. This means that if a feature or support for our strict network policies are not implemented, you have to either not use the helm chart completely or fork your own (which we definitely don’t want to do).&lt;br /&gt;
* If the helm chart gets deleted, all pvc related &#039;&#039;might&#039;&#039; also get deleted (unless they have the &amp;lt;code&amp;gt;Retain&amp;lt;/code&amp;gt; policy, which should be the case for everything).&lt;br /&gt;
* Sometimes they don’t have the proper security contexts/network policies by default so you will have to add them youself (see the below section)&lt;br /&gt;
&lt;br /&gt;
Overall, helm is pretty good, just use with caution and understand what templates you are inflicting. Note, you will probably have to get pretty good at reading not only default values, but schemas and the templating language of helm itself, as sometimes the charts are not particularly well documented.&lt;br /&gt;
&lt;br /&gt;
=== Using kubernetes ===&lt;br /&gt;
&lt;br /&gt;
For this you need to understand a bit of structure of how kubernetes works. I will assume that you are deploying a pod. If that pod needs storage attached (and not through SQL or Redis), then you will need to use a [https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/ &amp;lt;code&amp;gt;StatefulSet&amp;lt;/code&amp;gt;]. If you have no storage or are just communicating with a postgres server or redis, you can instead use a [https://kubernetes.io/docs/concepts/workloads/controllers/deployment/ &amp;lt;code&amp;gt;Deployment&amp;lt;/code&amp;gt;].&lt;br /&gt;
&lt;br /&gt;
The difference between these two concepts are not particularly seen in the world of a single node cluster, but basically deployments are free to spin up another even if the previous one is still terminating or if the node is non responsive. On the other hand, statefulsets must ensure that no two nodes are trying to access the same data, therefore cannot automatically start up if a node goes down.&lt;br /&gt;
&lt;br /&gt;
This also means that it is much easier to scale a deployment to multiple nodes, vs a statefulsets which must have separate volumes per pod.&lt;br /&gt;
&lt;br /&gt;
Anyway, both statefulsets and deployments have a template configuration for creating the pod associated with itself. This pod has a label which is used to monitor and track the associated pods with its parent. So the structure is as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;terraform&amp;quot;&amp;gt;resource &amp;quot;kubernetes_deployment_v1&amp;quot; &amp;quot;my_deployment&amp;quot; {&lt;br /&gt;
  metadata {&lt;br /&gt;
    name      = &amp;quot;my_deployment&amp;quot;&lt;br /&gt;
    namespace = var.namespace&lt;br /&gt;
  }&lt;br /&gt;
  spec {&lt;br /&gt;
    replicas = 1&lt;br /&gt;
    selector {&lt;br /&gt;
      match_labels = {&lt;br /&gt;
        app = &amp;quot;the_deployment&amp;quot;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
    // This doesn&#039;t really matter in a one node cluster with a replicas = 1&lt;br /&gt;
    strategy {&lt;br /&gt;
      type = &amp;quot;RollingUpdate&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
    template {&lt;br /&gt;
      metadata {&lt;br /&gt;
        labels = {&lt;br /&gt;
          app = &amp;quot;the_deployment&amp;quot;&lt;br /&gt;
        }&lt;br /&gt;
      }&lt;br /&gt;
      spec {&lt;br /&gt;
        container {&lt;br /&gt;
          name              = &amp;quot;my_deployment&amp;quot;&lt;br /&gt;
          image             = &amp;quot;bathbcss/my_image:latest&amp;quot;&lt;br /&gt;
          image_pull_policy = &amp;quot;Always&amp;quot; // Should only be set if the above is &amp;quot;latest&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          // This should be the default security context to comply with our pod security policies&lt;br /&gt;
          security_context {&lt;br /&gt;
            run_as_user                = 1000&lt;br /&gt;
            run_as_non_root            = true&lt;br /&gt;
            allow_privilege_escalation = false&lt;br /&gt;
            seccomp_profile {&lt;br /&gt;
              type = &amp;quot;RuntimeDefault&amp;quot;&lt;br /&gt;
            }&lt;br /&gt;
            capabilities {&lt;br /&gt;
              drop = [&amp;quot;ALL&amp;quot;]&lt;br /&gt;
            }&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
          // This is how the pod is checked its alive, so if something happens,&lt;br /&gt;
          // e.g. job which causes it to become unresponsive, it will be automatically killed off and replaced&lt;br /&gt;
          liveness_probe {&lt;br /&gt;
            http_get {&lt;br /&gt;
              path = &amp;quot;/healthz&amp;quot;&lt;br /&gt;
              port = 8080&lt;br /&gt;
            }&lt;br /&gt;
            initial_delay_seconds = 5&lt;br /&gt;
            period_seconds        = 10&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
          // This allows the tracking of when the pod starts, so we wait until the pod is ready to receive requests&lt;br /&gt;
          startup_probe {&lt;br /&gt;
            http_get {&lt;br /&gt;
              path = &amp;quot;/healthz&amp;quot;&lt;br /&gt;
              port = 8080&lt;br /&gt;
            }&lt;br /&gt;
            // 3 * 30 = 90 seconds to start&lt;br /&gt;
            failure_threshold = 30&lt;br /&gt;
            // If it takes a while to startup, increase this time&lt;br /&gt;
            period_seconds = 3&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
          // If exposing a port the port to expose&lt;br /&gt;
          port {&lt;br /&gt;
            container_port = 8080&lt;br /&gt;
            // Make sure to give it a name so we can use the name in services&lt;br /&gt;
            name           = &amp;quot;web&amp;quot;&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
          // env and env_from definitions&lt;br /&gt;
        }&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&#039;&#039;Quick side note: &amp;lt;code&amp;gt;kubernetes_\*_v1&amp;lt;/code&amp;gt;is the preferred resouce name, any resource that does not have&amp;lt;code&amp;gt;\_v1&amp;lt;/code&amp;gt; on the end is deprecated and should not be used.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It is recommended that the version of the image is actually set and &amp;lt;code&amp;gt;latest&amp;lt;/code&amp;gt; is not used, however to reduce the admin overhead, for internal projects it can be easier to set to &amp;lt;code&amp;gt;latest&amp;lt;/code&amp;gt; with an image pull policy of &amp;lt;code&amp;gt;Always&amp;lt;/code&amp;gt;. However this means if you want the latest version, you must have access to the cluster to restart a pod.&lt;br /&gt;
&lt;br /&gt;
If you are exposing pods, this should be tied with a &amp;lt;code&amp;gt;Service&amp;lt;/code&amp;gt;, as seen below.&lt;br /&gt;
&lt;br /&gt;
==== Security context ====&lt;br /&gt;
&lt;br /&gt;
As you will notice in the example above, we have a security context set. This is &#039;&#039;&#039;required&#039;&#039;&#039; by the pod security contenxt, otherwise it will not deploy. In most cases you can copy either of the two following policies, depending on whether it is within a kubernetes resource or helm/kubernetes manifest resource:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;terraform&amp;quot;&amp;gt;resource &amp;quot;kubernetes_deployment_v1&amp;quot; &amp;quot;my_deployment&amp;quot; {&lt;br /&gt;
  // ....&lt;br /&gt;
&lt;br /&gt;
  security_context {&lt;br /&gt;
    run_as_user                = 1000&lt;br /&gt;
    run_as_non_root            = true&lt;br /&gt;
    allow_privilege_escalation = false&lt;br /&gt;
    seccomp_profile {&lt;br /&gt;
      type = &amp;quot;RuntimeDefault&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
    capabilities {&lt;br /&gt;
      drop = [&amp;quot;ALL&amp;quot;]&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  // ....&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Or&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;terraform&amp;quot;&amp;gt;resource &amp;quot;kubernetes_manifest&amp;quot; &amp;quot;my_deployment&amp;quot; {&lt;br /&gt;
  manifest = {&lt;br /&gt;
    // ....&lt;br /&gt;
&lt;br /&gt;
    securityContext = {&lt;br /&gt;
      runAsUser                = 1000&lt;br /&gt;
      runAsNonRoot             = true&lt;br /&gt;
      allowPrivilegeEscalation = false&lt;br /&gt;
      seccompProfile = {&lt;br /&gt;
        type = &amp;quot;RuntimeDefault&amp;quot;&lt;br /&gt;
      }&lt;br /&gt;
      capabilities = {&lt;br /&gt;
        drop = [&amp;quot;ALL&amp;quot;]&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // ....&lt;br /&gt;
  }&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Note that we are running as a user (not root), setting the default seccompProfile (you &#039;&#039;should&#039;&#039; only need the default unless you are doing weird things with the host machine) as well as dropping all capabilities (you may need to add some back in but I will leave to you as you probably know more than me – NOTE: Some are disabled by our pod security policy but can be override with &amp;lt;code&amp;gt;baseline&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
==== Liveness and startup probe ====&lt;br /&gt;
&lt;br /&gt;
The liveness and startup probes are not necessary, but is a nice to have. The liveness probe allows the cluster to detect if a pod becomes unresponsive and is then able to kill it if that is the case. Whereas a startup probe makes it so the cluster knows exactly when the pod is able to receive responses.&lt;br /&gt;
&lt;br /&gt;
Please see the [https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/ kubernetes docs on probes] for more information on the options. But in most cases the HTTP get option should suffice, which just looks for a status 2xx code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;terraform&amp;quot;&amp;gt;resource &amp;quot;kubernetes_deployment_v1&amp;quot; &amp;quot;my_deployment&amp;quot; {&lt;br /&gt;
  // ....&lt;br /&gt;
&lt;br /&gt;
  liveness_probe {&lt;br /&gt;
    http_get {&lt;br /&gt;
      port = 8080&lt;br /&gt;
    }&lt;br /&gt;
    initial_delay_seconds = 5&lt;br /&gt;
    period_seconds        = 10&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  startup_probe {&lt;br /&gt;
    http_get {&lt;br /&gt;
      port = 8080&lt;br /&gt;
    }&lt;br /&gt;
    failure_threshold = 30&lt;br /&gt;
    period_seconds = 3&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  // ....&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Or&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;terraform&amp;quot;&amp;gt;resource &amp;quot;kubernetes_manifest&amp;quot; &amp;quot;my_deployment&amp;quot; {&lt;br /&gt;
  manifest = {&lt;br /&gt;
    // ....&lt;br /&gt;
&lt;br /&gt;
    livenessProbe = {&lt;br /&gt;
      httpGet = {&lt;br /&gt;
        port = 8080&lt;br /&gt;
      }&lt;br /&gt;
      initialDelaySeconds = 5&lt;br /&gt;
      periodSeconds       = 10&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    startupProbe = {&lt;br /&gt;
      httpGet = {&lt;br /&gt;
        port = 8080&lt;br /&gt;
      }&lt;br /&gt;
      failureThreshold = 30&lt;br /&gt;
      periodSeconds    = 3&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // ....&lt;br /&gt;
  }&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
==== Environmental variables ====&lt;br /&gt;
&lt;br /&gt;
When configuring deployments, you will want to set environmental variables. There are a few ways to do it, but note &#039;&#039;&#039;ANY PASSWORDS/API KEYS GO IN SECRETS&#039;&#039;&#039; not the environmental variables. As you will see I will example how to do this.&lt;br /&gt;
&lt;br /&gt;
By default the &amp;lt;code&amp;gt;env&amp;lt;/code&amp;gt; list can be used to set a single environmental variable e.g.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;terraform&amp;quot;&amp;gt;resource &amp;quot;kubernetes_deployment_v1&amp;quot; &amp;quot;my_deployment&amp;quot; {&lt;br /&gt;
  // ....&lt;br /&gt;
&lt;br /&gt;
  env {&lt;br /&gt;
    name = &amp;quot;TEST&amp;quot;&lt;br /&gt;
    value = &amp;quot;my_value&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  // ....&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
However, this is quite verbose and takes a lot of space, so if you are configuring a lot of variables or have secrets, you will want to use the &amp;lt;code&amp;gt;env_from&amp;lt;/code&amp;gt; list. This allows you to reference a config map or secrets (this is the most basic form).&lt;br /&gt;
&lt;br /&gt;
These look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;terraform&amp;quot;&amp;gt;resource &amp;quot;kubernetes_secret_v1&amp;quot; &amp;quot;module&amp;quot; {&lt;br /&gt;
  metadata {&lt;br /&gt;
    name      = &amp;quot;deployment-db&amp;quot;&lt;br /&gt;
    namespace = var.namespace&lt;br /&gt;
  }&lt;br /&gt;
  data = {&lt;br /&gt;
    DATABASE_URL = module.database.url&lt;br /&gt;
  }&lt;br /&gt;
  type = &amp;quot;Opaque&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
resource &amp;quot;kubernetes_config_map_v1&amp;quot; &amp;quot;module&amp;quot; {&lt;br /&gt;
  metadata {&lt;br /&gt;
    name      = &amp;quot;deployment-config&amp;quot;&lt;br /&gt;
    namespace = var.namespace&lt;br /&gt;
  }&lt;br /&gt;
  data = {&lt;br /&gt;
    PUBLIC_VALUE   = &amp;quot;yoooo&amp;quot;&lt;br /&gt;
    ROCKET_ADDRESS = &amp;quot;::&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
resource &amp;quot;kubernetes_deployment_v1&amp;quot; &amp;quot;my_deployment&amp;quot; {&lt;br /&gt;
  // ....&lt;br /&gt;
&lt;br /&gt;
  env_from {&lt;br /&gt;
    secret_ref {&lt;br /&gt;
      name = kubernetes_secret_v1.module.metadata[0].name&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
  env_from {&lt;br /&gt;
    config_map_ref {&lt;br /&gt;
      name = kubernetes_config_map_v1.module.metadata[0].name&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  // ....&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Or&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;terraform&amp;quot;&amp;gt;resource &amp;quot;kubernetes_manifest&amp;quot; &amp;quot;my_deployment&amp;quot; {&lt;br /&gt;
  manifest = {&lt;br /&gt;
    // ....&lt;br /&gt;
&lt;br /&gt;
    envFrom = [&lt;br /&gt;
      {&lt;br /&gt;
        secretRef = {&lt;br /&gt;
          name = kubernetes_secret_v1.module.metadata[0].name&lt;br /&gt;
        }&lt;br /&gt;
      },&lt;br /&gt;
      {&lt;br /&gt;
        configMapRef = {&lt;br /&gt;
          name = kubernetes_config_map_v1.module.metadata[0].name&lt;br /&gt;
        }&lt;br /&gt;
      },&lt;br /&gt;
    ]&lt;br /&gt;
&lt;br /&gt;
    // ....&lt;br /&gt;
  }&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Note that you can set the value of a environmental variable from a secret on an individual basis, which can be useful if you are storing environmental variables as well as files inside your secret. E.g:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;terraform&amp;quot;&amp;gt;resource &amp;quot;kubernetes_deployment_v1&amp;quot; &amp;quot;my_deployment&amp;quot; {&lt;br /&gt;
  // ....&lt;br /&gt;
&lt;br /&gt;
  env {&lt;br /&gt;
    name = &amp;quot;DB_PASSWORD&amp;quot;&lt;br /&gt;
    value_from {&lt;br /&gt;
      secret_key_ref {&lt;br /&gt;
        name = kubernetes_secret_v1.module.metadata[0].name&lt;br /&gt;
        key  = &amp;quot;password&amp;quot;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  // ....&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
==== Third-party CRDs ====&lt;br /&gt;
&lt;br /&gt;
Now this is is where terraform becomes less good. Basically when deploying using the kubernetes API, the checks will make sure the CRDs (so the like api and kind are installed and supported on the kubernetes cluster). This means that you won’t even be able to run.&lt;br /&gt;
&lt;br /&gt;
Basically it means that you need to comment out manifests that reference these resources until the CRDs are deployed (usually though a helm chart or something).&lt;br /&gt;
&lt;br /&gt;
==== PVCs ====&lt;br /&gt;
&lt;br /&gt;
Please remember &#039;&#039;&#039;ANY PASSWORDS/API KEYS/CERTIFICATES GO IN SECRETS&#039;&#039;&#039; not in the storage (this also means its configurable by us and yes they can be mounted as read only volumes).&lt;br /&gt;
&lt;br /&gt;
So, kubernetes storage works around persistant volumes which are requested by persistant volume claims. On our k3s single node, we are just using the k3s filesystem class. This means it’s a bit basic but does the job.&lt;br /&gt;
&lt;br /&gt;
Things to note:&lt;br /&gt;
&lt;br /&gt;
* You probably should be manually creating persistant volume claims (and definitely not persistant volumes), instead using &amp;lt;code&amp;gt;statefulsets&amp;lt;/code&amp;gt;&lt;br /&gt;
* It’s really hard to change persistant volumes post fact, so please go through testing phase if you are unsure about anything.&lt;br /&gt;
* K3s does not support the storage limit, so please &#039;&#039;&#039;DON’T RELY ON IT&#039;&#039;&#039; to stop abusive behaviour.&lt;br /&gt;
* If you are defining yourself, do not accidentally make your deployment depend on the persistant volume claim, as the pvc will not be created until it is used in something. See [https://gitlab.bath.ac.uk/cs/int/terraform/-/blob/main/services/mail/mailserver.tf|the mailserver module] of how to handle it. &#039;&#039;&#039;NOTE&#039;&#039;&#039;: If you reference the pvc config in your deployment, terraform will add that automatically to the &amp;lt;code&amp;gt;depends_on&amp;lt;/code&amp;gt; list.&lt;br /&gt;
* If it is critical data you will need to &#039;&#039;&#039;manually update the pv to “retain” its data&#039;&#039;&#039; if the pvc gets deleted. This just adds a bit of safety if you mess up a deployment. This can be done in &amp;lt;code&amp;gt;k9s&amp;lt;/code&amp;gt; by an admin, updating the &amp;lt;code&amp;gt;persistentVolumeReclaimPolicy&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;Retain&amp;lt;/code&amp;gt; instead of &amp;lt;code&amp;gt;Delete&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
So how you should be using pvc, in statefulsets:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;terraform&amp;quot;&amp;gt;resource &amp;quot;kubernetes_stateful_set_v1&amp;quot; &amp;quot;module&amp;quot; {&lt;br /&gt;
  metadata {&lt;br /&gt;
    name      = var.name&lt;br /&gt;
    namespace = var.namespace&lt;br /&gt;
  }&lt;br /&gt;
  spec {&lt;br /&gt;
    service_name = var.name&lt;br /&gt;
    replicas     = 1&lt;br /&gt;
    selector {&lt;br /&gt;
      match_labels = {&lt;br /&gt;
        app = var.name&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
    template {&lt;br /&gt;
      metadata {&lt;br /&gt;
        labels = {&lt;br /&gt;
          app = var.name&lt;br /&gt;
        }&lt;br /&gt;
      }&lt;br /&gt;
      spec {&lt;br /&gt;
        container {&lt;br /&gt;
          name  = &amp;quot;my_app&amp;quot;&lt;br /&gt;
          image = &amp;quot;bathbcss/my_app:1.0.0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          // ...&lt;br /&gt;
&lt;br /&gt;
          volume_mount {&lt;br /&gt;
            name       = &amp;quot;data&amp;quot;&lt;br /&gt;
            mount_path = &amp;quot;/data&amp;quot;&lt;br /&gt;
          }&lt;br /&gt;
        }&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
    volume_claim_template {&lt;br /&gt;
      metadata {&lt;br /&gt;
        name = &amp;quot;data&amp;quot;&lt;br /&gt;
      }&lt;br /&gt;
      spec {&lt;br /&gt;
        access_modes = [&amp;quot;ReadWriteOnce&amp;quot;]&lt;br /&gt;
        resources {&lt;br /&gt;
          requests = {&lt;br /&gt;
            storage = &amp;quot;10Gi&amp;quot;&lt;br /&gt;
          }&lt;br /&gt;
        }&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
==== Services ====&lt;br /&gt;
&lt;br /&gt;
Servies are the first way to adding an ingress, and helps give a common endpoint if you have multiple pods running (though we don’t do this). If using within the cluster you can access a service with the address &amp;lt;code&amp;gt;service_name.namespace.svc.cluster.local&amp;lt;/code&amp;gt;. Note that if you are accessing it from within the same namespace you can just use the &amp;lt;code&amp;gt;service_name&amp;lt;/code&amp;gt; as the hostname (and it is better on a network policy basis).&lt;br /&gt;
&lt;br /&gt;
For a namespace you just need a label to select on (note we have to define an &amp;lt;code&amp;gt;app&amp;lt;/code&amp;gt; label for the statefulset/deployment anyway so you can just use this).&lt;br /&gt;
&lt;br /&gt;
So it should look like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;terraform&amp;quot;&amp;gt;resource &amp;quot;kubernetes_service_v1&amp;quot; &amp;quot;module&amp;quot; {&lt;br /&gt;
  metadata {&lt;br /&gt;
    name      = var.name&lt;br /&gt;
    namespace = var.namespace&lt;br /&gt;
  }&lt;br /&gt;
  spec {&lt;br /&gt;
    port {&lt;br /&gt;
      port = 8080&lt;br /&gt;
      name = &amp;quot;web&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
    selector = {&lt;br /&gt;
      app = var.name&lt;br /&gt;
    }&lt;br /&gt;
    type = &amp;quot;ClusterIP&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
And then you can just access the port by &amp;lt;code&amp;gt;service_name:8080&amp;lt;/code&amp;gt;. Note that you can also set a &amp;lt;code&amp;gt;target_port&amp;lt;/code&amp;gt; if you want to change the port from the deployment and service (but like why?).&lt;br /&gt;
&lt;br /&gt;
Also giving it a &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt; is important, so in the ingress we can just use the name instead of the port number itself, increasing readability.&lt;br /&gt;
&lt;br /&gt;
==== Network policies ====&lt;br /&gt;
&lt;br /&gt;
Now comes the pain. If a helm chart has a network policy, use that (but please actually read what permissions it gives).&lt;br /&gt;
&lt;br /&gt;
Network policies, either grant, or block network “ingress” (stuff going into the pod) and “egress” (stuff going out of the pod). By default, due to our security, ingress to our pods is denied (so anything in the cluster), but egress to the outside world is allowed.&lt;br /&gt;
&lt;br /&gt;
You then use either pod selectors or namespace selectors to allow traffic from a pod (which is how &amp;lt;code&amp;gt;enable_dns,lldap,mail&amp;lt;/code&amp;gt; works). In most cases egress can be left alone, unless you want to block a node from doing something in particular.&lt;br /&gt;
&lt;br /&gt;
As talked about in the next section, for postgres and valkey, we create these policies, limited to pods with the &amp;lt;code&amp;gt;${name}-${service}-client=true&amp;lt;/code&amp;gt; label allowing only inter-namespace communication.&lt;br /&gt;
&lt;br /&gt;
If you do have to write one, which I really hope you don’t, please read [https://kubernetes.io/docs/concepts/services-networking/network-policies/ kubernetes documentation on Network Policies].&lt;br /&gt;
&lt;br /&gt;
=== Postgres and Redis/Valkey ===&lt;br /&gt;
&lt;br /&gt;
We have utilities for [https://gitlab.bath.ac.uk/cs/int/terraform/-/blob/main/apps/postgres|postgres] and redis (through [https://gitlab.bath.ac.uk/cs/int/terraform/-/blob/main/apps/valkey|valkey] due to redis being really hard to run).&lt;br /&gt;
&lt;br /&gt;
If you require these, we highly recommend the above (though postgres needs moving away from bitnami due to the requirement of money for stability). These setup the network policies you need as well as generating secure passwords and you can look at the &amp;lt;code&amp;gt;outputs.tf&amp;lt;/code&amp;gt; file to see the outputs you can use from a module.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; If using this, for any pod accessing the data, it must be in the same namespace and have the labels &amp;lt;code&amp;gt;${name}-postgresql-client=true&amp;lt;/code&amp;gt; and/or &amp;lt;code&amp;gt;${name}-valkey-client=true&amp;lt;/code&amp;gt;, otherwise the traffic will be denied by the network policies.&lt;br /&gt;
&lt;br /&gt;
E.g.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;terraform&amp;quot;&amp;gt;module &amp;quot;database&amp;quot; {&lt;br /&gt;
  source = &amp;quot;../postgres&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  namespace = var.namespace&lt;br /&gt;
  prefix    = var.name&lt;br /&gt;
  username  = &amp;quot;user&amp;quot;&lt;br /&gt;
  database  = &amp;quot;db_name&amp;quot;&lt;br /&gt;
  size      = &amp;quot;250Mi&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  providers = {&lt;br /&gt;
    helm = helm&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Create a secret with module.database.url&lt;br /&gt;
&lt;br /&gt;
resource &amp;quot;kubernetes_deployment_v1&amp;quot; &amp;quot;module&amp;quot; {&lt;br /&gt;
  metadata {&lt;br /&gt;
    name      = var.name&lt;br /&gt;
    namespace = var.namespace&lt;br /&gt;
  }&lt;br /&gt;
  spec {&lt;br /&gt;
    selector {&lt;br /&gt;
      match_labels = {&lt;br /&gt;
        app = var.name&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
    template {&lt;br /&gt;
      metadata {&lt;br /&gt;
        labels = {&lt;br /&gt;
          app = var.name&lt;br /&gt;
          // This **MUST** be defined otherwise you&#039;ll get weird errors&lt;br /&gt;
          froom-pg-postgresql-client = true&lt;br /&gt;
        }&lt;br /&gt;
      }&lt;br /&gt;
      // ...&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Side note: the namespace will also need to have &amp;lt;code&amp;gt;enable_dns&amp;lt;/code&amp;gt; to be able to access it&lt;br /&gt;
&lt;br /&gt;
=== Adding ingress ===&lt;br /&gt;
&lt;br /&gt;
Adding ingress to service basically means that you are making it accessible to the outside world.&lt;br /&gt;
&lt;br /&gt;
If you are doing this, please consider security heavily:&lt;br /&gt;
&lt;br /&gt;
* Can any user alter the DB? Are you doing proper type checking on the inputs?&lt;br /&gt;
* Do you make sure to not expose any secrets e.g. db urls&lt;br /&gt;
* Do you really need to expose this pod? Or can you leave it to k9s port forwarding?&lt;br /&gt;
&lt;br /&gt;
Then you need to ask:&lt;br /&gt;
&lt;br /&gt;
* Just expose it to people within the bath network e.g. on &amp;lt;code&amp;gt;*.k8s.bathcs.com&amp;lt;/code&amp;gt;&lt;br /&gt;
* Expose it to the whole world &amp;lt;code&amp;gt;*.bathcs.com&amp;lt;/code&amp;gt; (note coordination with backstage to get them to update their traefik will be necessary)&lt;br /&gt;
&lt;br /&gt;
Please expose to the utter minimum people.&lt;br /&gt;
&lt;br /&gt;
If exposing to the full network please note the flow is:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;app.bathcs.com&amp;lt;/code&amp;gt; &amp;amp;lt;- You should accept this domain in the ingress&lt;br /&gt;
* &amp;lt;code&amp;gt;app.bcss.su.bath.ac.uk&amp;lt;/code&amp;gt; &amp;amp;lt;- You should accept this domain in the ingress&lt;br /&gt;
* &amp;lt;code&amp;gt;app.k8s.bathcs.com&amp;lt;/code&amp;gt; &amp;amp;lt;- This is what the certificate you should be giving (due to this is hostname that backstage is requesting)&lt;br /&gt;
&lt;br /&gt;
Depending on the chosen level, please look at the [https://gitlab.bath.ac.uk/cs/int/terraform/-/blob/main/utils/ingress|&amp;lt;code&amp;gt;utils/ingress/*&amp;lt;/code&amp;gt; modules] as these handle this most of this flow for you.&lt;br /&gt;
&lt;br /&gt;
E.g. making it internal to bath uni only:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;terraform&amp;quot;&amp;gt;module &amp;quot;dns&amp;quot; {&lt;br /&gt;
  source = &amp;quot;../../utils/ingress/dns_flow&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  subdomain = var.subdomain&lt;br /&gt;
  # We don&#039;t want public one, so don&#039;t specify cloudflare_zone_id&lt;br /&gt;
  k8s_cloudflare_zone_id = var.cloudflare_zone_id&lt;br /&gt;
&lt;br /&gt;
  # Expanded for effect&lt;br /&gt;
  domains = {&lt;br /&gt;
    uni = var.domains.uni&lt;br /&gt;
    k8s = var.domains.k8s&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  providers = {&lt;br /&gt;
    cloudflare = cloudflare,&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
module &amp;quot;ingress&amp;quot; {&lt;br /&gt;
  source = &amp;quot;../../utils/ingress/tls&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  name                     = var.subdomain&lt;br /&gt;
  entry_points             = [&amp;quot;websecure&amp;quot;]&lt;br /&gt;
  namespace                = var.namespace&lt;br /&gt;
  host                     = module.dns.hosts.k8s&lt;br /&gt;
  additional_ingress_hosts = [module.dns.hosts.uni]&lt;br /&gt;
  service = {&lt;br /&gt;
    name = kubernetes_service_v1.module.metadata[0].name&lt;br /&gt;
    port = &amp;quot;http&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
  cert_issuer = var.cert_issuer&lt;br /&gt;
&lt;br /&gt;
  providers = {&lt;br /&gt;
    kubernetes = kubernetes,&lt;br /&gt;
  }&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
If using a helm repo you may have to manually define the certificate, which is quite easy:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;terraform&amp;quot;&amp;gt;resource &amp;quot;kubernetes_manifest&amp;quot; &amp;quot;cert&amp;quot; {&lt;br /&gt;
  manifest = {&lt;br /&gt;
    apiVersion = &amp;quot;cert-manager.io/v1&amp;quot;&lt;br /&gt;
    kind       = &amp;quot;Certificate&amp;quot;&lt;br /&gt;
    metadata = {&lt;br /&gt;
      name      = &amp;quot;${var.name}-cert&amp;quot;&lt;br /&gt;
      namespace = var.namespace&lt;br /&gt;
    }&lt;br /&gt;
    spec = {&lt;br /&gt;
      secretName = &amp;quot;${var.name}-cert-secret&amp;quot;&lt;br /&gt;
      issuerRef  = var.cert_issuer&lt;br /&gt;
      dnsNames   = [var.host]&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Which outputs the cert to the secret with name &amp;lt;code&amp;gt;${var.name}-cert-secret&amp;lt;/code&amp;gt;. You can also use &amp;lt;code&amp;gt;kubernetes_manifest.cert.manifest.spec.secretName&amp;lt;/code&amp;gt; (you can guess what I prefer).&lt;br /&gt;
&lt;br /&gt;
If you are making it publically accessible, you can use the full flow which does both dns and ingress records:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;terraform&amp;quot;&amp;gt;module &amp;quot;ingress&amp;quot; {&lt;br /&gt;
  source = &amp;quot;../../utils/ingress/full_flow&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  cloudflare_zone_id = var.cloudflare_zone_id&lt;br /&gt;
  namespace          = var.namespace&lt;br /&gt;
  domains            = var.domains&lt;br /&gt;
  subdomain          = var.subdomain&lt;br /&gt;
&lt;br /&gt;
  service = {&lt;br /&gt;
    name = kubernetes_service_v1.module.metadata[0].name&lt;br /&gt;
    port = &amp;quot;web&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
  cert_issuer = var.cert_issuer&lt;br /&gt;
&lt;br /&gt;
  providers = {&lt;br /&gt;
    kubernetes = kubernetes,&lt;br /&gt;
    cloudflare = cloudflare&lt;br /&gt;
  }&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
==== Putting it behind authelia ====&lt;br /&gt;
&lt;br /&gt;
If the application doesn’t have oauth integration build in and you are wanting to protect it behind authelia you can add middleware of &amp;lt;code&amp;gt;auth-forwardauth-authelia@kubernetescrd&amp;lt;/code&amp;gt; to require them to go through authelia.&lt;br /&gt;
&lt;br /&gt;
You will then have to add an access control rule to authelia e.g.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rules = [&lt;br /&gt;
  {&lt;br /&gt;
    domain = &amp;amp;quot;app.k8s.bathcs.com&amp;amp;quot;&lt;br /&gt;
    subject = [&amp;amp;quot;group:boss-example-group&amp;amp;quot;, &amp;amp;quot;user:hw2210&amp;amp;quot;]&lt;br /&gt;
  },&lt;br /&gt;
]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;: you can create and manage groups on [https://www.bath.ac.uk/groupmanager/ Bath&#039;s group manager], which creates a unix group that can be seen in the LDAP server.&lt;br /&gt;
&lt;br /&gt;
=== Cloudflare dns records ===&lt;br /&gt;
&lt;br /&gt;
Cloudflare provider is an actual pain. You would’ve hoped it would be good, but its not amazing (has previously caused updates on every &amp;lt;code&amp;gt;apply&amp;lt;/code&amp;gt;). Basically when creating a dns record you should use the whole address e.g. &amp;lt;code&amp;gt;app.bathcs.com&amp;lt;/code&amp;gt; instead of &amp;lt;code&amp;gt;app&amp;lt;/code&amp;gt;. This is because it will cause an update on the second application, changing the &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt; value (which we use to get the full domain).&lt;br /&gt;
&lt;br /&gt;
It sucks because theres an additional useless variable ontop of the &amp;lt;code&amp;gt;cloudflare_zone_id&amp;lt;/code&amp;gt; (yes you can use the “data” thing to solve this but still).&lt;br /&gt;
&lt;br /&gt;
Additionally for long TXT records, it will add additional quotes, and terraform will continually think you need to change that if you don’t yourself add the quotes into the data.&lt;br /&gt;
&lt;br /&gt;
=== Sending mail ===&lt;br /&gt;
&lt;br /&gt;
Sending mail is somewhat weird.&lt;br /&gt;
&lt;br /&gt;
Basically just because I can, the authentication is managed by &amp;lt;code&amp;gt;lldap&amp;lt;/code&amp;gt; (a really fast ldap implementation). This should not be confused with the ldap service that Authelia is hooked up with, as it is not.&lt;br /&gt;
&lt;br /&gt;
Once you’ve enabled mail in the namespace you then have to create an ldap user:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;terraform&amp;quot;&amp;gt;module &amp;quot;user&amp;quot; {&lt;br /&gt;
  source = &amp;quot;../../utils/ldap/user&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  display   = &amp;quot;Example&amp;quot;&lt;br /&gt;
  username  = &amp;quot;example&amp;quot;&lt;br /&gt;
  group_ids = var.ldap_group_ids&lt;br /&gt;
&lt;br /&gt;
  providers = {&lt;br /&gt;
    lldap = lldap&lt;br /&gt;
  }&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
You can then use this to access the mail with &amp;lt;code&amp;gt;module.user.name&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;module.user.password&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;module.user.email&amp;lt;/code&amp;gt;. &#039;&#039;&#039;NOTE&#039;&#039;&#039; due to it not being exposed, we must use the kubernetes domain certificate, which means that you normally have to disable tls verification it or set the expected domain to &amp;lt;code&amp;gt;bathcs.com&amp;lt;/code&amp;gt; (as seen in authelia).&lt;br /&gt;
&lt;br /&gt;
=== Creating an oauth client ===&lt;br /&gt;
&lt;br /&gt;
I have created a [https://gitlab.bath.ac.uk/cs/int/terraform/-/blob/main/utils/oauth/client|OAuth client module] for generating all the secret data you need and generate the client config (under the &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; output) you can then pass up and then into the authelia module (see &amp;lt;code&amp;gt;grafana&amp;lt;/code&amp;gt; as an example).&lt;br /&gt;
&lt;br /&gt;
But basically please read [https://www.authelia.com/integration/openid-connect/introduction/ the authelia oidc docs] for a full explanation of how it works.&lt;/div&gt;</summary>
		<author><name>Pcs47</name></author>
	</entry>
	<entry>
		<id>https://wiki.bathcs.com/index.php?title=Category:Help_needed&amp;diff=173</id>
		<title>Category:Help needed</title>
		<link rel="alternate" type="text/html" href="https://wiki.bathcs.com/index.php?title=Category:Help_needed&amp;diff=173"/>
		<updated>2026-06-12T00:28:55Z</updated>

		<summary type="html">&lt;p&gt;Pcs47: Init&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Pcs47</name></author>
	</entry>
	<entry>
		<id>https://wiki.bathcs.com/index.php?title=BOSS/Languages/Rust&amp;diff=172</id>
		<title>BOSS/Languages/Rust</title>
		<link rel="alternate" type="text/html" href="https://wiki.bathcs.com/index.php?title=BOSS/Languages/Rust&amp;diff=172"/>
		<updated>2026-06-12T00:25:33Z</updated>

		<summary type="html">&lt;p&gt;Pcs47: Update and add sections on useful tools.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Rust compiler is pretty pedantic by default, however, we have a few recommendations:&lt;br /&gt;
&lt;br /&gt;
* Change the default check command in VSCode (instead of check use &amp;lt;code&amp;gt;clippy&amp;lt;/code&amp;gt;).&lt;br /&gt;
* 4 spaces for tabs.&lt;br /&gt;
* Macros are cool but don’t overuse them.&lt;br /&gt;
* Use rustfmt: &amp;lt;code&amp;gt;cargo fmt&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
= Recommended tools =&lt;br /&gt;
== Bacon ==&lt;br /&gt;
Get [https://github.com/Canop/bacon bacon], open it in another terminal window, leave it running while you edit. It will save you recompiling constantly to get the verbose compiler output.&lt;br /&gt;
&lt;br /&gt;
It also has handy features:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;a&amp;lt;/code&amp;gt; - to check all.&lt;br /&gt;
* &amp;lt;code&amp;gt;c&amp;lt;/code&amp;gt; - to clippy all.&lt;br /&gt;
* &amp;lt;code&amp;gt;t&amp;lt;/code&amp;gt; - to run tests.&lt;br /&gt;
* &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt; - to run tests via [https://nexte.st/ &amp;lt;code&amp;gt;cargo-nextest&amp;lt;/code&amp;gt;].&lt;br /&gt;
&lt;br /&gt;
You can also make it run pedantic checks with &amp;lt;code&amp;gt;bacon pedantic&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Audit ==&lt;br /&gt;
&amp;lt;code&amp;gt;cargo install cargo-audit&amp;lt;/code&amp;gt; (or use [https://github.com/cargo-bins/cargo-binstall &amp;lt;code&amp;gt;cargo-binstall&amp;lt;/code&amp;gt;]).&lt;br /&gt;
&lt;br /&gt;
You can then run &amp;lt;code&amp;gt;cargo audit&amp;lt;/code&amp;gt; to audit your dependencies for security vulnerabilities.&lt;br /&gt;
&lt;br /&gt;
== Flamegraph ==&lt;br /&gt;
&amp;lt;code&amp;gt;cargo install cargo-flamegraph&amp;lt;/code&amp;gt; (or use [https://github.com/cargo-bins/cargo-binstall &amp;lt;code&amp;gt;cargo-binstall&amp;lt;/code&amp;gt;]).&lt;br /&gt;
&lt;br /&gt;
You can then use &amp;lt;code&amp;gt;CARGO_PROFILE_RELEASE_DEBUG=true cargo flamegraph [-- args-for-your-project]&amp;lt;/code&amp;gt; to generate a [https://www.brendangregg.com/flamegraphs.html Flamegraph] for profiling and optimising your project.&lt;br /&gt;
&lt;br /&gt;
== Machete ==&lt;br /&gt;
&amp;lt;code&amp;gt;cargo install cargo-machete&amp;lt;/code&amp;gt; (or use [https://github.com/cargo-bins/cargo-binstall &amp;lt;code&amp;gt;cargo-binstall&amp;lt;/code&amp;gt;]).&lt;br /&gt;
&lt;br /&gt;
You can then use &amp;lt;code&amp;gt;cargo machete&amp;lt;/code&amp;gt; to remove unused dependencies.&lt;/div&gt;</summary>
		<author><name>Pcs47</name></author>
	</entry>
	<entry>
		<id>https://wiki.bathcs.com/index.php?title=Main_Page&amp;diff=171</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.bathcs.com/index.php?title=Main_Page&amp;diff=171"/>
		<updated>2026-06-12T00:05:07Z</updated>

		<summary type="html">&lt;p&gt;Pcs47: Remove random tag.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Welcome to the wiki hosted by students of the University of Bath. It is managed by [[Bath Open Source Society]], and any student is free to login and edit pages. This is designed as a space where societies can store knowledge that can easily be passed down, or even students can share fun facts they have learnt while studying at Bath.&lt;br /&gt;
&lt;br /&gt;
There is minimal restriction to what can be uploaded to this wiki, we just ask that you be polite and follow the [https://www.bath.ac.uk/legal-information/dignity-and-respect-policy/ Dignity and Respect policy]. All edits are associated with your University login and we will follow standard University procedures in the event of serious misconduct.&lt;br /&gt;
&lt;br /&gt;
If you would like help with anything, please contact [mailto:su-boss@bath.ac.uk su-boss@bath.ac.uk].&lt;br /&gt;
&lt;br /&gt;
== Contributing ==&lt;br /&gt;
To get started with this wiki, you just need to log in at the top right. You will then have permission to edit almost any page.&lt;br /&gt;
&lt;br /&gt;
For ideas of places you can contribute, see [[Special:WantedPages]] and [[:Category:Help needed]].&lt;/div&gt;</summary>
		<author><name>Pcs47</name></author>
	</entry>
	<entry>
		<id>https://wiki.bathcs.com/index.php?title=Main_Page&amp;diff=170</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.bathcs.com/index.php?title=Main_Page&amp;diff=170"/>
		<updated>2026-06-12T00:04:46Z</updated>

		<summary type="html">&lt;p&gt;Pcs47: Fix link.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Welcome to the wiki hosted by students of the University of Bath. It is managed by [[Bath Open Source Society]], and any student is free to login and edit pages. This is designed as a space where societies can store knowledge that can easily be passed down, or even students can share fun facts they have learnt while studying at Bath.&lt;br /&gt;
&lt;br /&gt;
There is minimal restriction to what can be uploaded to this wiki, we just ask that you be polite and follow the [https://www.bath.ac.uk/legal-information/dignity-and-respect-policy/ Dignity and Respect policy]. All edits are associated with your University login and we will follow standard University procedures in the event of serious misconduct.&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you would like help with anything, please contact [mailto:su-boss@bath.ac.uk su-boss@bath.ac.uk].&lt;br /&gt;
&lt;br /&gt;
== Contributing ==&lt;br /&gt;
To get started with this wiki, you just need to log in at the top right. You will then have permission to edit almost any page.&lt;br /&gt;
&lt;br /&gt;
For ideas of places you can contribute, see [[Special:WantedPages]] and [[:Category:Help needed]].&lt;/div&gt;</summary>
		<author><name>Pcs47</name></author>
	</entry>
	<entry>
		<id>https://wiki.bathcs.com/index.php?title=Main_Page&amp;diff=169</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.bathcs.com/index.php?title=Main_Page&amp;diff=169"/>
		<updated>2026-06-12T00:04:16Z</updated>

		<summary type="html">&lt;p&gt;Pcs47: Add a link to the dignity and respect policy.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Welcome to the wiki hosted by students of the University of Bath. It is managed by [[Bath Open Source Society]], and any student is free to login and edit pages. This is designed as a space where societies can store knowledge that can easily be passed down, or even students can share fun facts they have learnt while studying at Bath.&lt;br /&gt;
&lt;br /&gt;
There is minimal restriction to what can be uploaded to this wiki, we just ask that you be polite and follow the [https://www.bath.ac.uk/legal-information/dignity-and-respect-policy/&amp;lt;nowiki&amp;gt; Dignity and Respect policy]. All edits are associated with your University login and we will follow standard University procedures in the event of serious misconduct.&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you would like help with anything, please contact [mailto:su-boss@bath.ac.uk su-boss@bath.ac.uk].&lt;br /&gt;
&lt;br /&gt;
== Contributing ==&lt;br /&gt;
To get started with this wiki, you just need to log in at the top right. You will then have permission to edit almost any page.&lt;br /&gt;
&lt;br /&gt;
For ideas of places you can contribute, see [[Special:WantedPages]] and [[:Category:Help needed]].&lt;/div&gt;</summary>
		<author><name>Pcs47</name></author>
	</entry>
	<entry>
		<id>https://wiki.bathcs.com/index.php?title=User:Pcs47&amp;diff=168</id>
		<title>User:Pcs47</title>
		<link rel="alternate" type="text/html" href="https://wiki.bathcs.com/index.php?title=User:Pcs47&amp;diff=168"/>
		<updated>2026-06-11T23:04:45Z</updated>

		<summary type="html">&lt;p&gt;Pcs47: Improve userbox contrast.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Peter =&lt;br /&gt;
&lt;br /&gt;
{{userbox&lt;br /&gt;
| border-c      = #000&lt;br /&gt;
| border-s      = 2&lt;br /&gt;
| id            = BOSS&lt;br /&gt;
| id-c          = #CCF&lt;br /&gt;
| id-s          = 20&lt;br /&gt;
| info          = &#039;&#039;this user is a [[BOSS]] committee member&#039;&#039;&lt;br /&gt;
| info-c        = #FFC&lt;br /&gt;
| info-s        = 12&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Pcs47</name></author>
	</entry>
	<entry>
		<id>https://wiki.bathcs.com/index.php?title=Bath_Open_Source_Society&amp;diff=167</id>
		<title>Bath Open Source Society</title>
		<link rel="alternate" type="text/html" href="https://wiki.bathcs.com/index.php?title=Bath_Open_Source_Society&amp;diff=167"/>
		<updated>2026-06-11T23:03:44Z</updated>

		<summary type="html">&lt;p&gt;Pcs47: /* Contributing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Bath Open Source Society (BOSS), is a society focused on providing computer services to students and societies. Their members and committee build and provide websites and tools which students and societies can use.&lt;br /&gt;
&lt;br /&gt;
All services are hosted under [https://bathcs.com bathcs.com], which is a domain owned by the society, as well as [https://bcss.su.bath.ac.uk bcss.su.bath.ac.uk].&lt;br /&gt;
&lt;br /&gt;
The committee&#039;s contact details can be found on their [https://thesubath.com/boss SU page].&lt;br /&gt;
&lt;br /&gt;
== Services ==&lt;br /&gt;
There are many services maintained by BOSS, students are free to use most of them, with only a few requiring permission.&lt;br /&gt;
&lt;br /&gt;
=== General ===&lt;br /&gt;
&lt;br /&gt;
* [https://froom.bathcs.com Froom], a tool to help you find free unbookable rooms on campus if you just need a room for brief meetings or some quite time.&lt;br /&gt;
* [[Main Page|Wiki]], this mediawiki instance, where students can store general knowledge and information about university life&lt;br /&gt;
&lt;br /&gt;
=== Society tools ===&lt;br /&gt;
&lt;br /&gt;
* [https://vault.bathcs.com VaultTub], a hosted password manager compatible with [https://bitwarden.com/ Bitwarden], allows societies to easily share password&#039;s with other committee members and perform handovers relatively simply. If your society wants to use this, please email [mailto:su-boss@bath.ac.uk su-boss@bath.ac.uk] and we can set you up with an organisation.&lt;br /&gt;
&lt;br /&gt;
* [https://signin.bathcs.com Sign me in!], a tool created for societies to check and track people signed up for a ticketed event and is compatible with the SU&#039;s library card reader for even faster signin process.&lt;br /&gt;
* [https://gitlab.bath.ac.uk/cs/services/timetable-heater Timetable Heatmap], a tool to find the best times for weekly events with a chosen audience. Please note that this does require some programming knowledge to be able to use.&lt;br /&gt;
&lt;br /&gt;
=== Departmental tools ===&lt;br /&gt;
We also have tools for general departmental student activity, if departments want to use these tools, please contact [mailto:su-boss@bath.ac.uk su-boss@bath.ac.uk] and we can set you up with it.&lt;br /&gt;
&lt;br /&gt;
* [https://gitlab.bath.ac.uk/cs/pm/peer-mentor-website Peer Mentor Grouper], this is a basic site that allows freshers to choose preferred peer mentors and then assigns the best combination to achieve most people&#039;s preferred choice.&lt;br /&gt;
&lt;br /&gt;
=== Custom ===&lt;br /&gt;
If a society wants a custom website or tool for an event they are running, please get in contact with [mailto:su-boss@bath.ac.uk su-boss@bath.ac.uk]. Though your dream may not be completely achieved, BOSS will try to fit your needs.&lt;br /&gt;
&lt;br /&gt;
With this, we are able to create and host services such as:&lt;br /&gt;
&lt;br /&gt;
* Basic webpage for advertising your events or just your society&lt;br /&gt;
* Websites with integration with [https://auth.bath.ac.uk auth.bath.ac.uk] to provide minimal account system (as long as it complies with GDPR).&lt;br /&gt;
* Provide graphs which track website performance&lt;br /&gt;
* Send emails from &amp;lt;code&amp;gt;bathcs.com&amp;lt;/code&amp;gt; domain, with reduced likelihood of going into spam.&lt;br /&gt;
* Websites with restricted user access (e.g. only committee members)&lt;br /&gt;
&lt;br /&gt;
Websites we have previously helped:&lt;br /&gt;
&lt;br /&gt;
* Bath Hack 24-26&lt;br /&gt;
* Witathon 25-26&lt;br /&gt;
&lt;br /&gt;
Although, we do have limited resources and so we can only build a few projects from scratch each year, but if you are somewhat technical and have already built a website, we are happy to help you host it.&lt;br /&gt;
&lt;br /&gt;
=== Future ===&lt;br /&gt;
BOSS tracks all of its potential future projects on its [https://gitlab.bath.ac.uk/cs/planning/ planning board], which any student can contribute to or discuss the projects.&lt;br /&gt;
&lt;br /&gt;
== Contributing ==&lt;br /&gt;
As a society, BOSS members can contribute to any project to help them improve and grow, there are many ways you can contribute, even without any technical knowledge. We track all our issues and store all our code on [https://gitlab.bath.ac.uk/cs Bath&#039;s GitLab instance], under the &amp;lt;code&amp;gt;cs&amp;lt;/code&amp;gt; organisation and all conversation is done through our hosted Matrix instance.&lt;br /&gt;
&lt;br /&gt;
=== Get Started ===&lt;br /&gt;
&amp;lt;!-- This needs to be written --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Tester/stakeholder ===&lt;br /&gt;
If you want to provide invaluable source of information about up and coming projects, you can get involved by joining our group chats and respond to questions around design. You can checkout current project ideas on our [https://gitlab.bath.ac.uk/cs/planning/ planning board].&lt;br /&gt;
&lt;br /&gt;
This makes sure our new projects are useful and relavent to you as a student.&lt;br /&gt;
&lt;br /&gt;
=== Bug reporter/Feature requester ===&lt;br /&gt;
If you find a bug or issue with a service we provide, or even just want to see a specific feature added, please see [[Creating a work item]]. This provides tasks for other students to complete and makes sure that our services are of the highest quality. Please be patient though, development takes time, especially when no one is paid to work on any specific feature.&lt;br /&gt;
&lt;br /&gt;
=== Designer ===&lt;br /&gt;
If you are good at art (unlike a lot of Computer Scientists), you can get involved by creating logos or even working with a developer to improve the style of our websites, through CSS and HTML. We are always looking to making our sites more intuitive and this is an invaluable source of help with that.&lt;br /&gt;
&lt;br /&gt;
=== Documenter ===&lt;br /&gt;
Computer scientists commonly struggle at writing long essays, though they love talking about their inventions. So you can help out by creating wiki pages about how to use a piece of software, or even read some code that is created and add documentation to the functions explaining what they do and how they work. As students leave every year, we need to make sure our code is as readable as possible.&lt;br /&gt;
&lt;br /&gt;
=== Developer ===&lt;br /&gt;
The core of our members, those who are just learning to code for a bit of fun, or wanting to get some practice before going to work at a real company. We work in a range of languages as we believe you should choose the right language for the job, but we tend to use Rust and TypeScript as they are the fun cool languages on the block.&lt;br /&gt;
&lt;br /&gt;
Before you contribute to any of our projects however, you must agree to the [https://boss.bathcs.com/policies/licenses/#developers-certificate-of-origin Developer Certificate of Origin] and understand our [https://boss.bathcs.com/policies/genai/ generative AI Policy]. But you are free to fork any of our projects, make your changes and then submit an MR. If you are wanting to fix an issue, please send a message on that specific work item to state you are working on it, and make sure no one else is doing the same thing.&lt;br /&gt;
&lt;br /&gt;
If it is a large feature that is not an issue, please get in touch with the project owner or committee to discuss if it is wanted, as we do not want to waste your time.&lt;br /&gt;
&lt;br /&gt;
=== Project Owner ===&lt;br /&gt;
If you are assigned this role, you will be responsible for managing work items, reviewing merge requests and publishing releases of your projects. This role is not elected as we want the people with the most knowledge and understanding of the project.&lt;br /&gt;
&lt;br /&gt;
Project owners will be chosen each year and trained up before the previous owner leaves.&lt;br /&gt;
&lt;br /&gt;
=== Sysadmin ===&lt;br /&gt;
If you much prefer configuring systems, managing deployments and putting out fires (hopefully not literally), you can apply to become a system administrator. We aim to make this role as easy as possible, relying on automated deployments where ever possible. Although, many other factors can go wrong with 4 servers, and so we need people regularly checking in on them and making sure they have not been hacked or something.&lt;br /&gt;
&lt;br /&gt;
You will need specific knowledge of linux commands, ssh and maybe even kubernetes and FreeBSD (but that&#039;s generally easy to learn and we offer training). You will get varying levels of access to our production and staging kubernetes clusters as well as the machines that run them.&lt;/div&gt;</summary>
		<author><name>Pcs47</name></author>
	</entry>
	<entry>
		<id>https://wiki.bathcs.com/index.php?title=User:Pcs47&amp;diff=166</id>
		<title>User:Pcs47</title>
		<link rel="alternate" type="text/html" href="https://wiki.bathcs.com/index.php?title=User:Pcs47&amp;diff=166"/>
		<updated>2026-06-11T23:01:21Z</updated>

		<summary type="html">&lt;p&gt;Pcs47: Init user page.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Peter =&lt;br /&gt;
&lt;br /&gt;
{{userbox&lt;br /&gt;
| border-c      = #000&lt;br /&gt;
| border-s      = 2&lt;br /&gt;
| id            = BOSS&lt;br /&gt;
| id-c          = #AAF&lt;br /&gt;
| id-s          = 20&lt;br /&gt;
| info          = &#039;&#039;this user is a [[BOSS]] committee member&#039;&#039;&lt;br /&gt;
| info-c        = #FFA&lt;br /&gt;
| info-s        = 12&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Pcs47</name></author>
	</entry>
	<entry>
		<id>https://wiki.bathcs.com/index.php?title=Template:Userbox&amp;diff=165</id>
		<title>Template:Userbox</title>
		<link rel="alternate" type="text/html" href="https://wiki.bathcs.com/index.php?title=Template:Userbox&amp;diff=165"/>
		<updated>2026-06-11T22:59:56Z</updated>

		<summary type="html">&lt;p&gt;Pcs47: Add link to Mediawiki documentation.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;width:238px; background:{{{info-background|{{{2|{{{info-c|#EEE}}}}}}}}}; float:{{{float|none}}}; border:{{{border-width|{{{border-s|1}}}}}}px solid {{{border-color|{{{1|{{{border-c|{{{id-c|#999}}}}}}}}}}}}; margin:1px;&amp;quot; class=&amp;quot;wikipediauserbox {{{bodyclass|}}}&amp;quot;&lt;br /&gt;
{{#if:{{{logo|{{{3|{{{id|id}}}}}}}}}|&lt;br /&gt;
! style=&amp;quot;width:{{{logo-width|{{{id-w|45}}}}}}px; height:{{{logo-height|{{{id-h|45}}}}}}px; background:{{{logo-background|{{{1|{{{id-c|#DDD}}}}}}}}}; text-align:{{{id-a|center}}}; font-size:{{{logo-size|{{{5|{{{id-s|14}}}}}}}}}pt; color:{{{logo-color|{{{id-fc|black}}}}}}; padding:{{{logo-padding|{{{id-p|1px}}}}}}; line-height:{{{logo-line-height|{{{id-lh|1.25em}}}}}}; vertical-align: middle; {{{logo-other-param|{{{id-op|}}}}}}&amp;quot; {{!}} {{{logo|{{{3|{{{id|id}}}}}}}}}&lt;br /&gt;
}}&lt;br /&gt;
| style=&amp;quot;text-align:{{{info-a|left}}}; font-size:{{{info-size|{{{info-s|8}}}}}}pt; padding:{{{info-padding|{{{info-p|4px}}}}}}; height:{{{logo-height|{{{id-h|45}}}}}}px; line-height:{{{info-line-height|{{{info-lh|1.25em}}}}}}; color:{{{info-color|{{{info-fc|black}}}}}}; vertical-align: middle; {{{info-other-param|{{{info-op|}}}}}}&amp;quot; | {{{info|{{{4|{{{info|&#039;&#039;info&#039;&#039;}}}}}}}}}&lt;br /&gt;
|}{{#if:{{{nocat|}}}||{{#if:{{{usercategory|}}}|{{#switch:{{NAMESPACE}}&lt;br /&gt;
 |User = [[Category:{{{usercategory}}}]]&lt;br /&gt;
 |Template = [[Category:Userboxes{{#translation:}}| ]]&lt;br /&gt;
}}}}}}&amp;lt;noinclude&amp;gt;&lt;br /&gt;
See [https://www.mediawiki.org/wiki/Template:Userbox] for documentation.&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Pcs47</name></author>
	</entry>
	<entry>
		<id>https://wiki.bathcs.com/index.php?title=Template:Userbox&amp;diff=164</id>
		<title>Template:Userbox</title>
		<link rel="alternate" type="text/html" href="https://wiki.bathcs.com/index.php?title=Template:Userbox&amp;diff=164"/>
		<updated>2026-06-11T22:55:43Z</updated>

		<summary type="html">&lt;p&gt;Pcs47: Add userbox template&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;width:238px; background:{{{info-background|{{{2|{{{info-c|#EEE}}}}}}}}}; float:{{{float|none}}}; border:{{{border-width|{{{border-s|1}}}}}}px solid {{{border-color|{{{1|{{{border-c|{{{id-c|#999}}}}}}}}}}}}; margin:1px;&amp;quot; class=&amp;quot;wikipediauserbox {{{bodyclass|}}}&amp;quot;&lt;br /&gt;
{{#if:{{{logo|{{{3|{{{id|id}}}}}}}}}|&lt;br /&gt;
! style=&amp;quot;width:{{{logo-width|{{{id-w|45}}}}}}px; height:{{{logo-height|{{{id-h|45}}}}}}px; background:{{{logo-background|{{{1|{{{id-c|#DDD}}}}}}}}}; text-align:{{{id-a|center}}}; font-size:{{{logo-size|{{{5|{{{id-s|14}}}}}}}}}pt; color:{{{logo-color|{{{id-fc|black}}}}}}; padding:{{{logo-padding|{{{id-p|1px}}}}}}; line-height:{{{logo-line-height|{{{id-lh|1.25em}}}}}}; vertical-align: middle; {{{logo-other-param|{{{id-op|}}}}}}&amp;quot; {{!}} {{{logo|{{{3|{{{id|id}}}}}}}}}&lt;br /&gt;
}}&lt;br /&gt;
| style=&amp;quot;text-align:{{{info-a|left}}}; font-size:{{{info-size|{{{info-s|8}}}}}}pt; padding:{{{info-padding|{{{info-p|4px}}}}}}; height:{{{logo-height|{{{id-h|45}}}}}}px; line-height:{{{info-line-height|{{{info-lh|1.25em}}}}}}; color:{{{info-color|{{{info-fc|black}}}}}}; vertical-align: middle; {{{info-other-param|{{{info-op|}}}}}}&amp;quot; | {{{info|{{{4|{{{info|&#039;&#039;info&#039;&#039;}}}}}}}}}&lt;br /&gt;
|}{{#if:{{{nocat|}}}||{{#if:{{{usercategory|}}}|{{#switch:{{NAMESPACE}}&lt;br /&gt;
 |User = [[Category:{{{usercategory}}}]]&lt;br /&gt;
 |Template = [[Category:Userboxes{{#translation:}}| ]]&lt;br /&gt;
}}}}}}&lt;/div&gt;</summary>
		<author><name>Pcs47</name></author>
	</entry>
	<entry>
		<id>https://wiki.bathcs.com/index.php?title=Git/GitLab&amp;diff=163</id>
		<title>Git/GitLab</title>
		<link rel="alternate" type="text/html" href="https://wiki.bathcs.com/index.php?title=Git/GitLab&amp;diff=163"/>
		<updated>2026-06-11T22:50:58Z</updated>

		<summary type="html">&lt;p&gt;Pcs47: /* Issue + MR Templates */ Add note about BOSS license policy.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;We require that the websites hosted on bathcs.com should be stored in [https://gitlab.bath.ac.uk/cs the cs organisation on Bath’s GitLab instance]. Any project used by student-led initiatives can also be stored on here.&lt;br /&gt;
&lt;br /&gt;
GitLab was chosen because it has a lot more (useful) features than GitHub. However this does mean that it is aimed at people who has a basic knowledge of how to properly manage git projects.&lt;br /&gt;
&lt;br /&gt;
Therefore you will need to be able to use GitLab.&lt;br /&gt;
&lt;br /&gt;
{{Note|type=warn|text=&lt;br /&gt;
You cannot push or pull to the GitLab outside of the VPN, even though you can access the page.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
&lt;br /&gt;
You might have set this up when handing over, if you haven’t, here are the instructions. Note you will have to ask an organisation manager to add you to the organisation if you are going to be editing any current projects.&lt;br /&gt;
&lt;br /&gt;
* Go to https://gitlab.bath.ac.uk&lt;br /&gt;
* Login with your University credentials&lt;br /&gt;
* Setup TOTP as your 2FA (one time codes). See [[2FA#TOTP|our 2FA section]] for more information about what this is and how to add one (you can skip to the section where it says “Once you see a QR code”)&lt;br /&gt;
&lt;br /&gt;
Once you have logged in, your account will be created and so can be added to organisations or tagged (using @username).&lt;br /&gt;
&lt;br /&gt;
=== SSH Keys ===&lt;br /&gt;
&lt;br /&gt;
If you want to commit or clone repos, you will also need to setup an SSH key:&lt;br /&gt;
&lt;br /&gt;
# Create an SSH key: see [[SSH keys|our documentation]] for information on how to set one up.&lt;br /&gt;
# Go to your preferences (click profile icon then click preferences).&lt;br /&gt;
# Click “SSH Keys”.&lt;br /&gt;
# Copy and paste the public key into the “Key” section.&lt;br /&gt;
# Give it a title.&lt;br /&gt;
# Change usage type to “Authentication only”.&lt;br /&gt;
# Click “Add key”.&lt;br /&gt;
&lt;br /&gt;
By default this will expire in a year, after which you will have to add another key in the same way.&lt;br /&gt;
&lt;br /&gt;
=== Extra Emails ===&lt;br /&gt;
&lt;br /&gt;
You may have already set up git with your personal email address or you have a git signing key with a specific email. You probably don’t want to edit the configuration on a per project basis.&lt;br /&gt;
&lt;br /&gt;
To solve this, GitLab and GitHub allow you to have multiple email addresses linked to your account, this can be found by going to preferences (click the profile icon then preferences) then clicking “Emails”.&lt;br /&gt;
&lt;br /&gt;
You can then type in another email into the box and click “Add email address”. You will then have to verify the email by clicking the link it gives you.&lt;br /&gt;
&lt;br /&gt;
== The CS Organisation ==&lt;br /&gt;
&lt;br /&gt;
All Student Led Initiative projects are stored on the [https://gitlab.bath.ac.uk/cs Computer Science SLI organisation]. If you are a committee member you should have been given access to it. If not please contact the current owners, who can be found by going “Group information &amp;amp;gt; Members”.&lt;br /&gt;
&lt;br /&gt;
[[File:git-gitlab_members.gif|Members page on GitLab showing the current owners and maintainers found by going to Members in the navigation group “Group Information”|764x764px]]&lt;br /&gt;
&lt;br /&gt;
The organisation or group has subgroups for all societies or student-led initiatives. You should have developer rights on all initiatives which you are a part of, which allows you to create branches on the existing projects and push to them. If you ask nicely you may get maintainer rights, which will allow you to create new projects and merge MRs into main (however you still can’t push to the &amp;lt;code&amp;gt;main&amp;lt;/code&amp;gt; branch).&lt;br /&gt;
&lt;br /&gt;
There are some projects which live outside the subgroups (e.g. this wiki) as they don’t have a organisation apart of. You will have to specifically ask permission to access individual projects for security reasons.&lt;br /&gt;
&lt;br /&gt;
== Issues ==&lt;br /&gt;
&lt;br /&gt;
=== Creating ===&lt;br /&gt;
&lt;br /&gt;
[[File:git-create_issue.gif|gif showing the steps of going to the issues menu under pinned and clicking new issue button|728x728px]]&lt;br /&gt;
&lt;br /&gt;
Creating an issue is easy, you can click on the “Issues” tab under “pinned” and click “New Issue” and start typing. The description is written in markdown. You can [https://docs.gitlab.com/ee/user/markdown.html learn markdown on the GitLab website].&lt;br /&gt;
&lt;br /&gt;
If the project is configured with templates, there should be a dropdown for you to choose the one most relavent to your issue type.&lt;br /&gt;
&lt;br /&gt;
[[File:git-mr_templates.gif|gif showing the dropdown to select the template to use above the description|491x491px]]&lt;br /&gt;
&lt;br /&gt;
You can then assign someone an issue from the menu if you know who will be working on it. Labels are also available, but these are mostly for the maintainers of the project to use.&lt;br /&gt;
&lt;br /&gt;
Once the issue is created, it will assign the issue a number (you can see this in the URL), which you can use to cross-reference issues or MRs by putting a &amp;lt;code&amp;gt;#&amp;lt;/code&amp;gt; before it. GitLab will pick this up and turn it into a link (you can also just put the link and it will be sortened). Note that issues on other projects can also be referenced.&lt;br /&gt;
&lt;br /&gt;
=== Managing Issues ===&lt;br /&gt;
&lt;br /&gt;
There is not much to say about managing issues. All conversations about the issue should be done on the issue itself.&lt;br /&gt;
&lt;br /&gt;
Once someone is working on it, they should be assigned the issue and it should be referenced in the MR which fixes it.&lt;br /&gt;
&lt;br /&gt;
If “Closes” is put before the link to the issue on an MR, once it is merged, the issue should automatically be closed (but please always do check all the related issues are closed).&lt;br /&gt;
&lt;br /&gt;
== Forking + Branches ==&lt;br /&gt;
&lt;br /&gt;
If you are a developer or maintainer on a project, you should be able to create a branch on the project (but just not push directly main). Branches should be under the format &amp;lt;code&amp;gt;&amp;amp;lt;username&amp;amp;gt;/&amp;amp;lt;fix_summary&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you are not a developer but would like to contribute to a project, you should be able to fork the repository into your own space to create make any edits you wish.&lt;br /&gt;
&lt;br /&gt;
== Merge Requests ==&lt;br /&gt;
&lt;br /&gt;
=== Creating ===&lt;br /&gt;
&lt;br /&gt;
[[File:git-create_mr.gif|gif showing the steps of going to the merge requests menu under pinned and clicking new merge request button and choosing a branch to merge into main|820x820px]]&lt;br /&gt;
&lt;br /&gt;
Once you have created a fork or branch, you can create a merge request, either by clicking the link which is shown after pushing, or going onto the project and clicking “Merge requests” at the left and choosing “New merge request”. You can then choose the branch you want to merge from and the one you are merging to (most likely &amp;lt;code&amp;gt;main&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
The interface is very similar to issues, with the summary written in markdown and templates available.&lt;br /&gt;
&lt;br /&gt;
If the Merge Request is not finished, and so still a work in progress, you can click the “Mark Draft” button or put “DRAFT:” at the start of the summary.&lt;br /&gt;
&lt;br /&gt;
You can then assign the MR to yourself (as you will be managing it). You then also want to set the reviewer to a maintainer who can then merge the issue.&lt;br /&gt;
&lt;br /&gt;
If the MR depends on another MR to be merged beforehand, please add the “blocked” label and mention what its blocked on in a comment or the issue directly.&lt;br /&gt;
&lt;br /&gt;
=== Managing ===&lt;br /&gt;
&lt;br /&gt;
Sadly as the university does not pay for premium GitLab, we have to do most security practices as manual steps. So please do not go against these procedures, we beg of you.&lt;br /&gt;
&lt;br /&gt;
If you are the reviewer of a MR, you can go onto the “Changes” tab where you can see all the differences between this and the main branch. There is a settings button where you can change parts of the look. I recommend enabling “show whitespace changes” to help find where people have accidentally left trailing whitespace.&lt;br /&gt;
&lt;br /&gt;
You can then add a comment on a line by hovering over the line and clicking the comment button on the left hand side. You can also do this on images if you wish.&lt;br /&gt;
&lt;br /&gt;
When adding a comment you have the option to “start a review” which is recommended if you are going to be making multiple comments as it send them out all at once instead of having a separate email for each comment (which is a lot).&lt;br /&gt;
&lt;br /&gt;
If you drag the comment, you can also select multiple lines which is useful for segments of code which need changing.&lt;br /&gt;
&lt;br /&gt;
[[File:git-start_review.gif|gif showing going to commits tab and adding a comment to the review, selecting multiple lines|524x524px]]&lt;br /&gt;
&lt;br /&gt;
It is expected that the assignee will then resolve all of these issues so it is not up to the reviewer (but as we are students they may need chasing).&lt;br /&gt;
&lt;br /&gt;
Once you are happy with the MR, you can then approve the merge request before merging it.&lt;br /&gt;
&lt;br /&gt;
Please make sure that:&lt;br /&gt;
&lt;br /&gt;
* You don’t approve your own MR&lt;br /&gt;
* Don’t merge something without approval (if it is going into &amp;lt;code&amp;gt;main&amp;lt;/code&amp;gt;)&lt;br /&gt;
* Don’t approve without actually reading all the changes&lt;br /&gt;
&lt;br /&gt;
== Creating a new Project ==&lt;br /&gt;
&lt;br /&gt;
Over time we may want to add more projects to the organisation. This page focuses on creating projects from scratch. If you are just wanting to mirror, see the [[Git/Mirrors|page about mirrors]].&lt;br /&gt;
&lt;br /&gt;
When creating a new repo or project, you need to decide which subgroup it should go under. This should be quite simple, however you may decide a new subgroup is required.&lt;br /&gt;
&lt;br /&gt;
If you are not a maintainer in a repository, you will have to find the maintainers of the subgroup and ask one of them to set up the repo for you and then add you to the access list.&lt;br /&gt;
&lt;br /&gt;
Other things to consider when creating a project:&lt;br /&gt;
&lt;br /&gt;
* Name (please make this understandable about what it is for)&lt;br /&gt;
* Visibility level:&lt;br /&gt;
** &#039;&#039;&#039;Private&#039;&#039;&#039;: only people with access can see it (preferably not), however is understandable if you are just testing out a project.&lt;br /&gt;
** &#039;&#039;&#039;Internal&#039;&#039;&#039;: Only bath students can see it when logged in, this is useful for things which interact with University of Bath services which they may not want known to the public.&lt;br /&gt;
** &#039;&#039;&#039;Public&#039;&#039;&#039;: This should be used for most projects to encourage the open source nature of the community.&lt;br /&gt;
&lt;br /&gt;
Once a repository is created you can add it as a remote to your repo or clone it.&lt;br /&gt;
&lt;br /&gt;
You should then:&lt;br /&gt;
&lt;br /&gt;
* Go to “Settings &amp;amp;gt; Repository &amp;amp;gt; Protected branches” and change “Allowed to push and merge” to be “No one” and make sure “Merge MRs” is set to “Maintainers only”.&lt;br /&gt;
* Add a description or logo in the “Settings &amp;amp;gt; General” tab&lt;br /&gt;
* Add a license as explained [[Git/Special files#license|here]].&lt;br /&gt;
&lt;br /&gt;
[[File:git-setup_new_project.gif|gif showing the process of editing the protected branches to only allow maintainers to merge to main and no one to push to the main|627x627px]]&lt;br /&gt;
&lt;br /&gt;
=== Manage Access ===&lt;br /&gt;
&lt;br /&gt;
You can choose who can access the repository in “Manage &amp;amp;gt; Members” if you are a Maintainer or Owner.&lt;br /&gt;
&lt;br /&gt;
To add new person you can click “Invite members” and type in their username (they will need to have signed into GitLab for their username to appear).&lt;br /&gt;
&lt;br /&gt;
You then need to choose their role. It is recommended to put them as “Developer” unless you want them to be able to merge requests into &amp;lt;code&amp;gt;main&amp;lt;/code&amp;gt;, then put them as “Maintainer”.&lt;br /&gt;
&lt;br /&gt;
=== Labels ===&lt;br /&gt;
&lt;br /&gt;
Under “Manage &amp;amp;gt; Labels” you can add or create labels which can be used on merge requests or issues. You should inherit any labels from the parent group, and preferably labels should be group wide. But you can create a label and ask an Owner to upgrade the label to a group label by clicking the 3 dots.&lt;br /&gt;
&lt;br /&gt;
=== Issue + MR Templates ===&lt;br /&gt;
&lt;br /&gt;
In your project, you may want to have templates for people creating issues or MRs to save them time and to standardise them.&lt;br /&gt;
&lt;br /&gt;
This is quite simple to do in GitLab as explained [https://docs.gitlab.com/ee/user/project/description_templates.html here].&lt;br /&gt;
&lt;br /&gt;
In short, you need to add markdown files to &amp;lt;code&amp;gt;.gitlab/issue_templates/&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;.gitlab/merge_request_templates/&amp;lt;/code&amp;gt;. The default should be named &amp;lt;code&amp;gt;default.md&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;&amp;lt;code&amp;gt;.gitlab/issue_templates/default.md&amp;lt;/code&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre class=&amp;quot;md&amp;quot;&amp;gt;### Summary&lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;!--Add brief summary explaining the issue--&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
### Steps to reproduce&lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;!-- Add brief instructions to reproduce the issue --&amp;amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;&amp;lt;code&amp;gt;.gitlab/merge_request_templates/default.md&amp;lt;/code&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre class=&amp;quot;md&amp;quot;&amp;gt;### Related Issue&lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;!--Replace with the related issue number--&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
Closes #&lt;br /&gt;
&lt;br /&gt;
### Summary&lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;!-- Summary of what the MR does --&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
### Testing&lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;!-- Summary of the testing done to validate the MR --&amp;amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;&amp;lt;code&amp;gt;.gitlab/merge_request_templates/bug_fix.md&amp;lt;/code&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre class=&amp;quot;md&amp;quot;&amp;gt;### Summary&lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;!-- Summary of what the the bug was --&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
### Testing&lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;!-- Summary of the testing done to validate the MR --&amp;amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For projects specific to [[BOSS]], they must also include a checkbox for [https://developercertificate.org/ DCO] acknowledgement according to the [https://boss.bathcs.com/policies/licenses/ BOSS license policy].&lt;br /&gt;
&lt;br /&gt;
=== CI Pipelines ===&lt;br /&gt;
&lt;br /&gt;
GitLab pipelines are super powerful and I don’t think I could write better documentation than GitLab themselves (which can be found [https://docs.gitlab.com/ee/ci/pipelines/ here]).&lt;br /&gt;
&lt;br /&gt;
This is just here to say they do exist and they should be used for automated testing or even deployment.&lt;br /&gt;
&lt;br /&gt;
The configuration can be found in the &amp;lt;code&amp;gt;.gitlab-ci.yml&amp;lt;/code&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
{{Special:PrefixIndex|prefix=Git|namespace=0|hideredirects=1}}&lt;br /&gt;
[[Category:Tutorial]]&lt;/div&gt;</summary>
		<author><name>Pcs47</name></author>
	</entry>
	<entry>
		<id>https://wiki.bathcs.com/index.php?title=BOSS/Languages/Markdown&amp;diff=162</id>
		<title>BOSS/Languages/Markdown</title>
		<link rel="alternate" type="text/html" href="https://wiki.bathcs.com/index.php?title=BOSS/Languages/Markdown&amp;diff=162"/>
		<updated>2026-06-11T22:46:38Z</updated>

		<summary type="html">&lt;p&gt;Pcs47: No longer written in markdown.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is not a programming language, but all READMEs should be written in markdown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Tab size to 2 spaces&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Use &amp;lt;code&amp;gt;-&amp;lt;/code&amp;gt; over &amp;lt;code&amp;gt;*&amp;lt;/code&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Max line length should be 80&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Use blank lines to space things out!&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre class=&amp;quot;md&amp;quot;&amp;gt;## A title&lt;br /&gt;
&lt;br /&gt;
Some text&lt;br /&gt;
&lt;br /&gt;
- point1&lt;br /&gt;
- point2&amp;lt;/pre&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Code blocks should always have a filetype&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre class=&amp;quot;md&amp;quot;&amp;gt;```py&lt;br /&gt;
print(&amp;amp;quot;Hi&amp;amp;quot;)&lt;br /&gt;
```&amp;lt;/pre&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Anything relating to the point above should be indented and blank space left&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre class=&amp;quot;md&amp;quot;&amp;gt;- point1&lt;br /&gt;
&lt;br /&gt;
  some other paragraph&lt;br /&gt;
&lt;br /&gt;
- point2&amp;lt;/pre&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Formatters do exist (e.g. [https://prettier.io/ prettier] or [https://biomejs.dev/ biome]) so use them please!&lt;/div&gt;</summary>
		<author><name>Pcs47</name></author>
	</entry>
	<entry>
		<id>https://wiki.bathcs.com/index.php?title=Git/Mirrors&amp;diff=161</id>
		<title>Git/Mirrors</title>
		<link rel="alternate" type="text/html" href="https://wiki.bathcs.com/index.php?title=Git/Mirrors&amp;diff=161"/>
		<updated>2026-06-11T22:43:44Z</updated>

		<summary type="html">&lt;p&gt;Pcs47: Change from bathcs.com to gitlab.bath.ac.uk.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Some projects could be a student’s heart and soul. We do not want to take this away from them, instead we just want to store a copy of the current version on [https://gitlab.bath.ac.uk the university&#039;s Gitlab].&lt;br /&gt;
&lt;br /&gt;
So the solution to this is to have a mirror repo.&lt;br /&gt;
&lt;br /&gt;
There are multiple ways to solve this:&lt;br /&gt;
&lt;br /&gt;
== GitLab Mirror ==&lt;br /&gt;
&lt;br /&gt;
In GitLab go to “Settings &amp;amp;gt; Repository &amp;amp;gt; Mirroring Repositories”, you can see there is an option to “push” to another repo.&lt;br /&gt;
&lt;br /&gt;
This means that if the student has their own GitLab instance where they store their own version, they can setup this pushing feature to push to a repo on the GitLab.&lt;br /&gt;
&lt;br /&gt;
However, due to security restrictions, this only works when the other server is connected to the University Intranet, so it is not feasible.&lt;br /&gt;
&lt;br /&gt;
== Just do it manually ==&lt;br /&gt;
&lt;br /&gt;
When doing it manually, you can just push to two separate repositories when making changes locally, by going:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sh&amp;quot;&amp;gt;git add remote bath git@gitlab.bath.ac.uk:cs/wiki&lt;br /&gt;
git push&lt;br /&gt;
git push bath&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
If you were wanting to have a specialised branch which has some extra features, you can do something like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sh&amp;quot;&amp;gt;git checkout branch-name&lt;br /&gt;
git push bath HEAD:main&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
{{Special:PrefixIndex|prefix=Git|namespace=0|hideredirects=1}}&lt;br /&gt;
[[Category:Tutorial]]&lt;/div&gt;</summary>
		<author><name>Pcs47</name></author>
	</entry>
	<entry>
		<id>https://wiki.bathcs.com/index.php?title=VaultTub&amp;diff=160</id>
		<title>VaultTub</title>
		<link rel="alternate" type="text/html" href="https://wiki.bathcs.com/index.php?title=VaultTub&amp;diff=160"/>
		<updated>2026-06-11T22:38:01Z</updated>

		<summary type="html">&lt;p&gt;Pcs47: /* Rotating passwords */ Add link to passwords page and TL;DR it here.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;VaultTub is a password manager managed by [[Bath Open Source Society]] which allows societies to store and share passwords securely. It can be accessed at [https://vault.bathcs.com vault.bathcs.com].&lt;br /&gt;
&lt;br /&gt;
For more detailed instructions, see [https://bitwarden.com/help/ BitWarden’s documentation].&lt;br /&gt;
&lt;br /&gt;
== Quick setup ==&lt;br /&gt;
&lt;br /&gt;
You should be messaged or told by the previous committee that you need to sign up so they can invite you. All Bath students can freely make an account (though we ask you not to store your personal passwords on there).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol style=&amp;quot;list-style-type: decimal;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Go to [https://vault.bathcs.com vault.bathcs.com].&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Enter your uni email and click &amp;quot;Use single sign-on&amp;quot;.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Once redirected to our authentication site (Authelia), enter your University username and password.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;You will be redirected back to VaultTub and asked to create a master password. Use a brand new password that you will not forget.&amp;lt;/p&amp;gt;{{Note|text=If you lose the master password you will lose all access to VaultTub.|type=warn}}&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;You may also receive emails during this process, if the email is in &#039;&#039;&#039;junk&#039;&#039;&#039;, there should be a dropdown at the top of the email with the option to make “vault@bathcs.com” never go to your junk folder. Please select this as you will get a lot more emails after this point.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;&#039;&#039;&#039;Required&#039;&#039;&#039;: [[#Two-step login|Set up 2FA]]&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;&#039;&#039;&#039;Required&#039;&#039;&#039; &#039;&#039;&#039;for [[VaultTub#Organisation owners|Owners of organisations]]&#039;&#039;&#039;: set up [[#Emergency Access|emergency access]]&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Outgoing committees/initiatives will add you to the relevant organisation as described in the handover procedure. Please ensure that they do this, otherwise you will lose all access to the society&#039;s passwords.&lt;br /&gt;
&lt;br /&gt;
== Recommended Settings ==&lt;br /&gt;
&lt;br /&gt;
Once you have signed up with a password you can remember (but don’t use anywhere else), we recommend updating the following settings:&lt;br /&gt;
&lt;br /&gt;
Settings can be found: “Profile Icon in top right &amp;amp;gt; account settings”.&lt;br /&gt;
&lt;br /&gt;
=== Two-step login ===&lt;br /&gt;
&lt;br /&gt;
{{Note|type=info|text=&lt;br /&gt;
Two-factor authentication is &#039;&#039;&#039;mandatory&#039;&#039;&#039; for everyone.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Go to [https://vault.bathcs.com/#/settings/security/two-factor Two-step login settings] and choose a provider. For the best security we recommend Authenticator app or Passkey.&lt;br /&gt;
&lt;br /&gt;
=== Emergency access ===&lt;br /&gt;
&lt;br /&gt;
{{Note|text=&lt;br /&gt;
Emergency access is &#039;&#039;&#039;mandatory&#039;&#039;&#039; for all [[#Organisation owners|Owners of organisations]].&lt;br /&gt;
|type=info}}&lt;br /&gt;
&lt;br /&gt;
We recommend setting up emergency access with at least 1 other person, this is for safety if you lose access to your account.&lt;br /&gt;
&lt;br /&gt;
First, ask your trusted contact to create a VaultTub account. Once they have done that, head to [https://vault.bathcs.com/#/settings/emergency-access Emergency access settings] and click “Add emergency contact”. Enter the user&#039;s email and ask them to follow the instructions they receive via email. Once all the steps are complete, go back to the Emergency access tab and verify that they show up as expected. &lt;br /&gt;
&lt;br /&gt;
{{Note|type=warn|text=Make sure you verify that the user was added completely. It is easy to accidentally forget a step.}}&lt;br /&gt;
&lt;br /&gt;
Emergency access is required for users with a significant amount of power due to the risk of losing everything (we cannot recover your passwords).&lt;br /&gt;
&lt;br /&gt;
=== Using the extension/app ===&lt;br /&gt;
&lt;br /&gt;
Bitwarden has a [https://bitwarden.com/download/#downloads-web-browser browser extension] and an [https://bitwarden.com/download/#downloads-mobile app] which support self-hosted instances (and multiple accounts).&lt;br /&gt;
&lt;br /&gt;
{{Note|text=&lt;br /&gt;
If you wish, you can also set it up so you can approve sign-in requests when signing in somewhere else, which you may prefer over TOTP 2FA.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
To install the app or the extension:&lt;br /&gt;
&lt;br /&gt;
* Download the extension, from [https://bitwarden.com/download/#downloads-web-browser Bitwarden’s download page]&lt;br /&gt;
* Open it up&lt;br /&gt;
** if you already have an account you can click the profile icon and then click “Add account”.&lt;br /&gt;
* Under the input for the email address (set to “bitwarden” by default), you can select “self-hosted”.&lt;br /&gt;
* Input “https://vault.bathcs.com” for the server field and hit “Save” in the top right.&lt;br /&gt;
* Enter your login details for VaultTub.&lt;br /&gt;
&lt;br /&gt;
==== Recommended settings ====&lt;br /&gt;
&lt;br /&gt;
You may wish to change the default lockout period or add a pin, which can be done in the “Settings tab”. These are handled on a &#039;&#039;&#039;per account&#039;&#039;&#039; basis.&lt;br /&gt;
&lt;br /&gt;
You can click “unlock with pin” and enter a pin (unchecking “unlock with master on browser restart” if you don’t want that).&lt;br /&gt;
&lt;br /&gt;
You can also change the “Vault timeout”, however this is &#039;&#039;&#039;not&#039;&#039;&#039; recommended.&lt;br /&gt;
&lt;br /&gt;
==== Adding a Login ====&lt;br /&gt;
You can easily add a login by clicking the &amp;quot;New&amp;quot; button within the app, and filling out the details, along with the &amp;quot;website&amp;quot;. Please make sure the owner is set to the society this login should live under, as well as a collection set.&lt;br /&gt;
&lt;br /&gt;
From this interface you can also generate a password to fill in. The recommneded settings are:&lt;br /&gt;
&lt;br /&gt;
* &amp;amp;gt;= 25 characters&lt;br /&gt;
* include special characters&lt;br /&gt;
* min numbers: 2&lt;br /&gt;
* min special characters: 2&lt;br /&gt;
&lt;br /&gt;
== Organisation owners ==&lt;br /&gt;
&lt;br /&gt;
Make sure you have at least two owners to an organisation. This is to make sure we don’t lose access to the data.&lt;br /&gt;
&lt;br /&gt;
For societies we recommend roles equivalent to chair and secretary. For other initiatives, we recommend you choose two people to act as the Owner.&lt;br /&gt;
&lt;br /&gt;
{{Note|text=&lt;br /&gt;
For security reasons, please do not grant access to external users unless necessary. Make sure to keep data secure, especially where sensitive or personal data is involved.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Owners also require [[#Emergency Access|emergency access]] to be set up with someone who is not another owner of their organisation.&lt;br /&gt;
&lt;br /&gt;
== Organisations ==&lt;br /&gt;
To create an organisation, you can go to your “vaults” and click the “New organization” button on the side panel.&lt;br /&gt;
&lt;br /&gt;
Once created you can go to the “Organizations” tab in the top right and choose the organisation to manage, where you can invite new members (via “Members &amp;amp;gt; Invite Member”) or create a new collection (basically a folder which you can choose who has access to it).&lt;br /&gt;
&lt;br /&gt;
For each member you can choose the role and what collections they have permission to access, the rest is up to you on how you organise everything.&lt;br /&gt;
&lt;br /&gt;
{{Note|text=&lt;br /&gt;
When adding members, they will have to accept the invitation and then you will have to confirm them in the organisation interface.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Handover procedures ==&lt;br /&gt;
{{Stub}}&lt;br /&gt;
We need some instructions here on how to do handover. See the [https://boss.bathcs.com/handover/permissions/ old instructions] in the meantime.&lt;br /&gt;
&lt;br /&gt;
=== Rotating passwords ===&lt;br /&gt;
&lt;br /&gt;
As part of the handover procedures, it is recommended that each initiative rotates all the passwords stored in the organisation.&lt;br /&gt;
&lt;br /&gt;
To do this, please follow these rough instructions:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Open the item on VaultTub (either by the extension or website)&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Copy the password and temporarily store it somewhere (e.g. in the notes section)&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Visit the website&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Navigate to the change password section (it’s different for every website)&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;On the extension, click “edit” on the item and click the “Generate Password” button and confirm that it will override the current stored password. For password security recommendations see [[Passwords]], in general, make passwords long and random (or use passphrases). Password managers are designed to make it easy to use such random passwords.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Click “Save” on the item to save the new password&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Paste the new password in the change password fields + change the password&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Log out and log in again to make sure the new password has saved correctly&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Delete the temporary storage of the old password&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Add a line to the notes saying it was updated on the current date and include your name&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== How to deal with the worst case scenarios ==&lt;br /&gt;
&lt;br /&gt;
If it is relating to the website being down, please contact [mailto:su-boss@bath.ac.uk su-boss@bath.ac.uk] (CC [mailto:pcs47@bath.ac.uk pcs47@bath.ac.uk] if urgent). Note that BOSS do not have any access to any of the data stored as it is all encrypted.&lt;br /&gt;
&lt;br /&gt;
=== I lost my password and don’t have Emergency Access ===&lt;br /&gt;
&lt;br /&gt;
In that case, there is nothing you can do. Your account must be deleted and you will need to be re-invited (this means you WILL lose access to any passwords you have stored outside of organisations). Organisations passwords can be recovered by other members of the organisation.&lt;br /&gt;
&lt;br /&gt;
This is why you MUST either know your password by hand or store your password in your own password manager which also has a proper recovery procedure.&lt;br /&gt;
&lt;br /&gt;
=== The owner of the organisation is not responding ===&lt;br /&gt;
&lt;br /&gt;
If all [[#Quick note on owners|owners of the organisation]] are not responding or have lost access to their account, this is slightly more of an issue so make sure to have multiple owners.&lt;br /&gt;
&lt;br /&gt;
The organisation will have to be deleted and recreated. To save as many passwords as possible, get all other members to see what Collections they have access to and if they have permission to export the vault (found in the settings for the organisation).&lt;br /&gt;
&lt;br /&gt;
You want to then either export the vault data or copy every single password into a new organisation.&lt;br /&gt;
&lt;br /&gt;
== Creating new organisations ==&lt;br /&gt;
All student groups (including non-SU groups) are welcome to have organisations to share passwords as we believe in good password policies. However, only BOSS committee can create a new organisation for you, and so please submit a request by emailing [mailto:su-boss@bath.ac.uk su-boss@bath.ac.uk].&lt;br /&gt;
&lt;br /&gt;
They can do this through the [https://vault.bathcs.com/admin/users/overview admin interface] in the &amp;quot;Organisation&amp;quot; tab (however this interface is normally turned off and so has to be activated through a redeployment).&lt;br /&gt;
&lt;br /&gt;
== Technical details ==&lt;br /&gt;
&lt;br /&gt;
=== Backups ===&lt;br /&gt;
&lt;br /&gt;
Backups are handled by [[Bath Open Source Society|BOSS]] and is one of the few systems that get a complete off-site backup on a third-party service along with the typical whole cluster backups.&lt;br /&gt;
&lt;br /&gt;
But the basic idea:&lt;br /&gt;
&lt;br /&gt;
* VaultTub get&#039;s backed up every 4 hours to our backup server.&lt;br /&gt;
* The whole cluster get&#039;s backed up every day to our backup server&lt;br /&gt;
* The specific VaultTub data (including passwords), gets backed up to [https://www.scaleway.com/en/ Scaleway] every day&lt;br /&gt;
&lt;br /&gt;
Contact [mailto:su-boss@bath.ac.uk su-boss@bath.ac.uk] if you have any questions. You can also see [https://gitlab.bath.ac.uk/cs/int/terraform/ our configuration within terraform].&lt;br /&gt;
&lt;br /&gt;
=== Emails ===&lt;br /&gt;
&lt;br /&gt;
Emails are sent through the BOSS SMTP server. If you find they are going to junk, please contact [mailto:su-boss@bath.ac.uk su-boss@bath.ac.uk].&lt;/div&gt;</summary>
		<author><name>Pcs47</name></author>
	</entry>
	<entry>
		<id>https://wiki.bathcs.com/index.php?title=VaultTub&amp;diff=159</id>
		<title>VaultTub</title>
		<link rel="alternate" type="text/html" href="https://wiki.bathcs.com/index.php?title=VaultTub&amp;diff=159"/>
		<updated>2026-06-11T22:32:32Z</updated>

		<summary type="html">&lt;p&gt;Pcs47: /* How to deal with the worst case scenarios */ Add CC to me if urgent.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;VaultTub is a password manager managed by [[Bath Open Source Society]] which allows societies to store and share passwords securely. It can be accessed at [https://vault.bathcs.com vault.bathcs.com].&lt;br /&gt;
&lt;br /&gt;
For more detailed instructions, see [https://bitwarden.com/help/ BitWarden’s documentation].&lt;br /&gt;
&lt;br /&gt;
== Quick setup ==&lt;br /&gt;
&lt;br /&gt;
You should be messaged or told by the previous committee that you need to sign up so they can invite you. All Bath students can freely make an account (though we ask you not to store your personal passwords on there).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol style=&amp;quot;list-style-type: decimal;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Go to [https://vault.bathcs.com vault.bathcs.com].&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Enter your uni email and click &amp;quot;Use single sign-on&amp;quot;.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Once redirected to our authentication site (Authelia), enter your University username and password.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;You will be redirected back to VaultTub and asked to create a master password. Use a brand new password that you will not forget.&amp;lt;/p&amp;gt;{{Note|text=If you lose the master password you will lose all access to VaultTub.|type=warn}}&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;You may also receive emails during this process, if the email is in &#039;&#039;&#039;junk&#039;&#039;&#039;, there should be a dropdown at the top of the email with the option to make “vault@bathcs.com” never go to your junk folder. Please select this as you will get a lot more emails after this point.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;&#039;&#039;&#039;Required&#039;&#039;&#039;: [[#Two-step login|Set up 2FA]]&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;&#039;&#039;&#039;Required&#039;&#039;&#039; &#039;&#039;&#039;for [[VaultTub#Organisation owners|Owners of organisations]]&#039;&#039;&#039;: set up [[#Emergency Access|emergency access]]&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Outgoing committees/initiatives will add you to the relevant organisation as described in the handover procedure. Please ensure that they do this, otherwise you will lose all access to the society&#039;s passwords.&lt;br /&gt;
&lt;br /&gt;
== Recommended Settings ==&lt;br /&gt;
&lt;br /&gt;
Once you have signed up with a password you can remember (but don’t use anywhere else), we recommend updating the following settings:&lt;br /&gt;
&lt;br /&gt;
Settings can be found: “Profile Icon in top right &amp;amp;gt; account settings”.&lt;br /&gt;
&lt;br /&gt;
=== Two-step login ===&lt;br /&gt;
&lt;br /&gt;
{{Note|type=info|text=&lt;br /&gt;
Two-factor authentication is &#039;&#039;&#039;mandatory&#039;&#039;&#039; for everyone.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Go to [https://vault.bathcs.com/#/settings/security/two-factor Two-step login settings] and choose a provider. For the best security we recommend Authenticator app or Passkey.&lt;br /&gt;
&lt;br /&gt;
=== Emergency access ===&lt;br /&gt;
&lt;br /&gt;
{{Note|text=&lt;br /&gt;
Emergency access is &#039;&#039;&#039;mandatory&#039;&#039;&#039; for all [[#Organisation owners|Owners of organisations]].&lt;br /&gt;
|type=info}}&lt;br /&gt;
&lt;br /&gt;
We recommend setting up emergency access with at least 1 other person, this is for safety if you lose access to your account.&lt;br /&gt;
&lt;br /&gt;
First, ask your trusted contact to create a VaultTub account. Once they have done that, head to [https://vault.bathcs.com/#/settings/emergency-access Emergency access settings] and click “Add emergency contact”. Enter the user&#039;s email and ask them to follow the instructions they receive via email. Once all the steps are complete, go back to the Emergency access tab and verify that they show up as expected. &lt;br /&gt;
&lt;br /&gt;
{{Note|type=warn|text=Make sure you verify that the user was added completely. It is easy to accidentally forget a step.}}&lt;br /&gt;
&lt;br /&gt;
Emergency access is required for users with a significant amount of power due to the risk of losing everything (we cannot recover your passwords).&lt;br /&gt;
&lt;br /&gt;
=== Using the extension/app ===&lt;br /&gt;
&lt;br /&gt;
Bitwarden has a [https://bitwarden.com/download/#downloads-web-browser browser extension] and an [https://bitwarden.com/download/#downloads-mobile app] which support self-hosted instances (and multiple accounts).&lt;br /&gt;
&lt;br /&gt;
{{Note|text=&lt;br /&gt;
If you wish, you can also set it up so you can approve sign-in requests when signing in somewhere else, which you may prefer over TOTP 2FA.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
To install the app or the extension:&lt;br /&gt;
&lt;br /&gt;
* Download the extension, from [https://bitwarden.com/download/#downloads-web-browser Bitwarden’s download page]&lt;br /&gt;
* Open it up&lt;br /&gt;
** if you already have an account you can click the profile icon and then click “Add account”.&lt;br /&gt;
* Under the input for the email address (set to “bitwarden” by default), you can select “self-hosted”.&lt;br /&gt;
* Input “https://vault.bathcs.com” for the server field and hit “Save” in the top right.&lt;br /&gt;
* Enter your login details for VaultTub.&lt;br /&gt;
&lt;br /&gt;
==== Recommended settings ====&lt;br /&gt;
&lt;br /&gt;
You may wish to change the default lockout period or add a pin, which can be done in the “Settings tab”. These are handled on a &#039;&#039;&#039;per account&#039;&#039;&#039; basis.&lt;br /&gt;
&lt;br /&gt;
You can click “unlock with pin” and enter a pin (unchecking “unlock with master on browser restart” if you don’t want that).&lt;br /&gt;
&lt;br /&gt;
You can also change the “Vault timeout”, however this is &#039;&#039;&#039;not&#039;&#039;&#039; recommended.&lt;br /&gt;
&lt;br /&gt;
==== Adding a Login ====&lt;br /&gt;
You can easily add a login by clicking the &amp;quot;New&amp;quot; button within the app, and filling out the details, along with the &amp;quot;website&amp;quot;. Please make sure the owner is set to the society this login should live under, as well as a collection set.&lt;br /&gt;
&lt;br /&gt;
From this interface you can also generate a password to fill in. The recommneded settings are:&lt;br /&gt;
&lt;br /&gt;
* &amp;amp;gt;= 25 characters&lt;br /&gt;
* include special characters&lt;br /&gt;
* min numbers: 2&lt;br /&gt;
* min special characters: 2&lt;br /&gt;
&lt;br /&gt;
== Organisation owners ==&lt;br /&gt;
&lt;br /&gt;
Make sure you have at least two owners to an organisation. This is to make sure we don’t lose access to the data.&lt;br /&gt;
&lt;br /&gt;
For societies we recommend roles equivalent to chair and secretary. For other initiatives, we recommend you choose two people to act as the Owner.&lt;br /&gt;
&lt;br /&gt;
{{Note|text=&lt;br /&gt;
For security reasons, please do not grant access to external users unless necessary. Make sure to keep data secure, especially where sensitive or personal data is involved.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Owners also require [[#Emergency Access|emergency access]] to be set up with someone who is not another owner of their organisation.&lt;br /&gt;
&lt;br /&gt;
== Organisations ==&lt;br /&gt;
To create an organisation, you can go to your “vaults” and click the “New organization” button on the side panel.&lt;br /&gt;
&lt;br /&gt;
Once created you can go to the “Organizations” tab in the top right and choose the organisation to manage, where you can invite new members (via “Members &amp;amp;gt; Invite Member”) or create a new collection (basically a folder which you can choose who has access to it).&lt;br /&gt;
&lt;br /&gt;
For each member you can choose the role and what collections they have permission to access, the rest is up to you on how you organise everything.&lt;br /&gt;
&lt;br /&gt;
{{Note|text=&lt;br /&gt;
When adding members, they will have to accept the invitation and then you will have to confirm them in the organisation interface.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Handover procedures ==&lt;br /&gt;
{{Stub}}&lt;br /&gt;
We need some instructions here on how to do handover. See the [https://boss.bathcs.com/handover/permissions/ old instructions] in the meantime.&lt;br /&gt;
&lt;br /&gt;
=== Rotating passwords ===&lt;br /&gt;
&lt;br /&gt;
As part of the handover procedures, it is recommended that each initiative rotates all the passwords stored in the organisation.&lt;br /&gt;
&lt;br /&gt;
To do this, please follow this rough instruction list:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Open the item on VaultTub (either by the extension or website)&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Copy the password and temporarily store it somewhere (e.g. in the notes section)&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Visit the website&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Navigate to the change password section (it’s different for every website)&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;On the extension, click “edit” on the item and click the “Generate Password” button and confirm that it will override the current password stored then&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Password recommendations:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;amp;gt;= 25 characters&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;include special characters&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;min numbers: 2&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;min special characters: 2&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;uncheck “avoid ambiguous characters”&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Click “Save” on the item to save the new password&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Paste the new password in the change password fields + change the password&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Log out and log in again to make sure the new password has saved correctly&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Delete the temporary storage of the old password&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Add a line to the notes saying it was updated on the current date and include your name&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== How to deal with the worst case scenarios ==&lt;br /&gt;
&lt;br /&gt;
If it is relating to the website being down, please contact [mailto:su-boss@bath.ac.uk su-boss@bath.ac.uk] (CC [mailto:pcs47@bath.ac.uk pcs47@bath.ac.uk] if urgent). Note that BOSS do not have any access to any of the data stored as it is all encrypted.&lt;br /&gt;
&lt;br /&gt;
=== I lost my password and don’t have Emergency Access ===&lt;br /&gt;
&lt;br /&gt;
In that case, there is nothing you can do. Your account must be deleted and you will need to be re-invited (this means you WILL lose access to any passwords you have stored outside of organisations). Organisations passwords can be recovered by other members of the organisation.&lt;br /&gt;
&lt;br /&gt;
This is why you MUST either know your password by hand or store your password in your own password manager which also has a proper recovery procedure.&lt;br /&gt;
&lt;br /&gt;
=== The owner of the organisation is not responding ===&lt;br /&gt;
&lt;br /&gt;
If all [[#Quick note on owners|owners of the organisation]] are not responding or have lost access to their account, this is slightly more of an issue so make sure to have multiple owners.&lt;br /&gt;
&lt;br /&gt;
The organisation will have to be deleted and recreated. To save as many passwords as possible, get all other members to see what Collections they have access to and if they have permission to export the vault (found in the settings for the organisation).&lt;br /&gt;
&lt;br /&gt;
You want to then either export the vault data or copy every single password into a new organisation.&lt;br /&gt;
&lt;br /&gt;
== Creating new organisations ==&lt;br /&gt;
All student groups (including non-SU groups) are welcome to have organisations to share passwords as we believe in good password policies. However, only BOSS committee can create a new organisation for you, and so please submit a request by emailing [mailto:su-boss@bath.ac.uk su-boss@bath.ac.uk].&lt;br /&gt;
&lt;br /&gt;
They can do this through the [https://vault.bathcs.com/admin/users/overview admin interface] in the &amp;quot;Organisation&amp;quot; tab (however this interface is normally turned off and so has to be activated through a redeployment).&lt;br /&gt;
&lt;br /&gt;
== Technical details ==&lt;br /&gt;
&lt;br /&gt;
=== Backups ===&lt;br /&gt;
&lt;br /&gt;
Backups are handled by [[Bath Open Source Society|BOSS]] and is one of the few systems that get a complete off-site backup on a third-party service along with the typical whole cluster backups.&lt;br /&gt;
&lt;br /&gt;
But the basic idea:&lt;br /&gt;
&lt;br /&gt;
* VaultTub get&#039;s backed up every 4 hours to our backup server.&lt;br /&gt;
* The whole cluster get&#039;s backed up every day to our backup server&lt;br /&gt;
* The specific VaultTub data (including passwords), gets backed up to [https://www.scaleway.com/en/ Scaleway] every day&lt;br /&gt;
&lt;br /&gt;
Contact [mailto:su-boss@bath.ac.uk su-boss@bath.ac.uk] if you have any questions. You can also see [https://gitlab.bath.ac.uk/cs/int/terraform/ our configuration within terraform].&lt;br /&gt;
&lt;br /&gt;
=== Emails ===&lt;br /&gt;
&lt;br /&gt;
Emails are sent through the BOSS SMTP server. If you find they are going to junk, please contact [mailto:su-boss@bath.ac.uk su-boss@bath.ac.uk].&lt;/div&gt;</summary>
		<author><name>Pcs47</name></author>
	</entry>
	<entry>
		<id>https://wiki.bathcs.com/index.php?title=Where_to_go_when_you_don%27t_know_where_to_go&amp;diff=149</id>
		<title>Where to go when you don&#039;t know where to go</title>
		<link rel="alternate" type="text/html" href="https://wiki.bathcs.com/index.php?title=Where_to_go_when_you_don%27t_know_where_to_go&amp;diff=149"/>
		<updated>2026-06-08T13:03:18Z</updated>

		<summary type="html">&lt;p&gt;Pcs47: Replace with page from penn/mediawiki generated through pandoc.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;span id=&amp;quot;emergencies&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Emergencies ==&lt;br /&gt;
&lt;br /&gt;
If there is an emergency on campus call 01225 38 3999. Anywhere else, call 999. Keep calm and keep safe.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;mental-health-support&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Mental Health Support ==&lt;br /&gt;
&lt;br /&gt;
The University offers a large variety of support for mental health struggles. This document outlines the services you may want to refer someone to depending on how worried you are about them.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;If a student seems in any kind of immediate danger, follow the [https://www.bath.ac.uk/guides/supporting-students-in-distress/ supporting students in distress] guide. Keep yourself safe.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;general-support&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== 1. General Support ===&lt;br /&gt;
&lt;br /&gt;
If you feel like a student needs a bit of a cheer up, some advice or something to break them out of a bit of a torrid time, these services may be of help!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Director of Studies Team&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Academic guidance, as well as a great pillar of support. The DoS team has all the answers to potential academic questions, from guidance on suspensions to further signposting. They are useful for the academic side, but are not mental health professionals.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;John Bernadis, Director of Studies Year 1 and 2, [https://researchportal.bath.ac.uk/en/persons/john-benardis ib322@bath.ac.uk]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Moody Alam, Director of Studies years 3 and above, [https://researchportal.bath.ac.uk/en/persons/moody-alam ma3145@bath.ac.uk]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[https://www.bath.ac.uk/teams/department-of-computer-science-academic-staff/ Full DoS list]&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Support Groups&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;There are multiple support groups available for students going through hardship and feeling isolated but these are poorly advertised. If a student seems to be going through one of these situations, a gentle push in this direction may provide some company in times for which they do not want to be alone.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;[https://www.bath.ac.uk/campaigns/autism-social-group/ Autism Support Group]&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;[https://www.bath.ac.uk/campaigns/bereavement-social-group/ Bereavement Social Group]&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;[https://www.bath.ac.uk/campaigns/social-networking-group/ Loneliness Networking Group]&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Low mood (but be aware this could be a sign of a deeper issue):&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[https://www.bath.ac.uk/guides/social-prescribing-at-bath/ Social prescribing]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[https://www.bath.ac.uk/guides/courses-and-workshops-for-better-mental-health/ Courses and workshops for better mental health]&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;[https://www.bath.ac.uk/guides/getting-support-if-you-or-someone-else-is-feeling-lonely-or-isolated/ More information]&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;The Roper Centre&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;The Roper Centre in 4 West is open every weekday in term-time, 9am to 5pm. They can provide advice and are very friendly and approachable. If you feel like a student would benefit from support, but they aren’t willing to seek it themselves, you can also go to the Roper Centre to see if there’s anything they can do. they won’t compel anyone to get help, but they can reach out and they can also support you as a Student Leader. Remember if there is a risk of immediate harm you should follow the [https://www.bath.ac.uk/guides/supporting-students-in-distress/ supporting students in distress] guide.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;longer-term-support&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== 2. Longer Term Support ===&lt;br /&gt;
&lt;br /&gt;
Sometimes students show signs of underlying problems that you feel may warrant some longer-term support, or at the very least a consultation about the topic, and sometimes a student will ask you for this directly. These are the services available to us as students and residents of Bath.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;The Wellbeing Team&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;The University’s wellbeing team offers short term counselling sessions after an initial consultation, usually 6 weekly sessions with the hope that these will be enough to help a student. The University has in-house consellors and is partnered with outside organisations as well. These include one that offers culturally-appropriate counselling targeted specifically at students from Black, Asian, and minoritized communities.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[https://www.bath.ac.uk/guides/mental-health-support-at-the-university/ University Signposting]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[https://www.bath.ac.uk/guides/talking-therapies-at-the-university/ Bath Talking Therapies]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[https://www.bath.ac.uk/campaigns/culturally-sensitive-counselling/ Culturally Sensitive Counselling (External)]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[https://www.bath.ac.uk/guides/booking-a-wellbeing-appointment/ University Wellbeing Booking]&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;External Methods&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Honestly, it’s probably a better idea to point students to university-affiliated services first, but if that fails, Bath has multiple organisations that also offer support, though a lot of them require registration with a local GP.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;&#039;&#039;&#039;BaNES IAPT (Bath and Northeast Somerset Increasing access to psychological therapies)&#039;&#039;&#039;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;A Bath-based service, similar to the University’s, this service often offers 6-week sessions of 1-on-1 counselling before deciding whether you may need more, but as it is an NHS, may have an annoyingly long waiting list. They focus on Cognitive Behavioural Therapy.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[https://iapt.awp.nhs.uk/talking-therapies-banes BaNES IAPT Website]&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;&#039;&#039;&#039;Bath Minds&#039;&#039;&#039;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Another service that provides similar services to BaNES IAPT, though they are a slightly larger organisation and are a charity that offer more than just counselling, such as wellbeing groups centred around common hobbies like football.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Link: [https://www.bathmind.org.uk/1-to-1-mental-health-support/ Bath Minds website]&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;&#039;&#039;&#039;Off the record&#039;&#039;&#039;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;A charity that also offers similar counselling services, as well as advocacy groups and LGBTQ+ support, this is sometimes a group that the university refers students to after wellbeing’s initial evaluation.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;[https://www.offtherecord-banes.co.uk/ Off the Record’s website]&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;&#039;&#039;&#039;NHS&#039;&#039;&#039;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;The NHS is also a method for which to pursue counselling and long-term therapies, though the waitlist is long.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;[https://www.nhs.uk/mental-health/ NHS Mental Health]&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Honestly, there are probably a lot more, but this just goes to show that there is support, though waitlists are a constant annoyance in all such services. The University has a [https://www.bath.ac.uk/guides/counselling-and-therapy-services-in-the-bath-area/ list of services in the area] with many specialised services, located in both Bath and Bristol.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;immediate-help&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== 3. Immediate Help ===&lt;br /&gt;
&lt;br /&gt;
There are also services for which a student can get immediate advice and help:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;[https://www.bath.ac.uk/campaigns/be-well-talk-now/ Be Well - Talk Now]&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;A phone line that the University has hired a third party to run (they specialise in providing mental health support for businesses and universities). They are open to both call and live chat 24/7 and offer both domestic and international service. They have multilingual advisors and the ability to refer cases that need more help to where they need to go. As they are available by phone, this is a service that could be very useful.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Phone in the UK: 0808 196 8046&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Phone outside the UK: +44 3 307771499&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[https://talknow.spectrum.life/login?org=talknow Live chat] is available&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;[https://giveusashout.org/ Give us a Shout]&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;A UK text-based support service available [sms://85258?&amp;amp;body=SHOUT texting SHOUT to 85258]. They are available 24/7 but not student focussed.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Campus Security&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;If things have gotten bad, and practical advice is needed, for example if an ambulance is needed, a student is lost or an accident has occurred, campus security is a good place to call. They will be able to help an ambulance navigate campus better than any student; they are always useful in a pinch.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&#039;&#039;&#039;Emergency number: 01225 383999&#039;&#039;&#039;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&#039;&#039;&#039;General number: 01225 385349&#039;&#039;&#039;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;[https://www.papyrus-uk.org/papyrus-HOPELINE247/ Papyrus Hopeline]&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Available via either web chat or phone call, Papyrus is a service for anyone experiencing suicidal thoughts; they provide a safe space to talk about anything affecting their ability to stay safe.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;999/111&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;999 and 111 are also an important resource to remember, if things are looking real bleak, 999 offer support in life threatening conditions while 111 offer support in situations of when you’re unsure who to call and how serious things are.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;other-resources&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== 4. Other resources ===&lt;br /&gt;
&lt;br /&gt;
While these are all important, there are other sources of support available to students that may be helpful to know about! For example:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;[https://www.bath.ac.uk/guides/courses-and-workshops-for-better-mental-health/ Five-week courses/workshops to improve specific aspects of mental health]&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;[https://www.bath.ac.uk/campaigns/read-well/ Library Mental health reading program]&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;[https://www.talkofftherecord.org/get-info/apps/ A huge variety of support apps, including support for people at risk of self-harm and suicide (as a supplement to support from professionals)]&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;[https://www.thesubath.com/advice/personal/ SU support page (personal issues)]&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;[https://www.bath.ac.uk/professional-services/chaplaincy/ Spiritual guidance]&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;[https://www.thesubath.com/peer-support Peer support]&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;[https://studentspace.org.uk/ Student Space]&#039;&#039;&#039; which provides guidance and FAQs for dealing with mental health as a student&lt;br /&gt;
* &#039;&#039;&#039;[https://www.bath.ac.uk/corporate-information/wellbeing-support-out-of-hours A list of out-of-hours support available]&#039;&#039;&#039; maintained by Student Support&lt;br /&gt;
&lt;br /&gt;
-----&lt;br /&gt;
&lt;br /&gt;
Overall, there are so many resources you can point students towards. It is important to remember that as Student Leaders, you may be put in a position where you are asked to provide help. That’s fine, but it’s important not to get out of your depth! There are many professionals we can rely on to help our fellow students work through their problems, and our job on that front is to make sure students can get access to the help they need (even if we are sometimes those students as well)!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;financial-support&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Financial Support ==&lt;br /&gt;
&lt;br /&gt;
The financial support the university offers can mostly be split into advice and money. In general terms, they can offer [https://www.bath.ac.uk/guides/making-an-appointment-or-attending-a-drop-in-session-with-student-money-advice/ 1-on-1 meetings about financing]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;money-advice&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== [https://www.bath.ac.uk/guides/managing-your-money/ Money Advice] ===&lt;br /&gt;
&lt;br /&gt;
There are a lot of resources available, which can be listed on [https://www.bath.ac.uk/guides/managing-your-money/ the Money Advice page]. However, it is very dense, so what follows is a breakdown and grouping of the advice. I’d recommend skimming the page anyway as it’s useful stuff beyond this summary.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;funding-support&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==== Funding support ====&lt;br /&gt;
&lt;br /&gt;
The University directs to the various devolved student finance websites:&lt;br /&gt;
&lt;br /&gt;
* [https://www.gov.uk/student-finance England]&lt;br /&gt;
* [https://www.studentfinancewales.co.uk/ Wales]&lt;br /&gt;
* [https://www.saas.gov.uk/ Scotland]&lt;br /&gt;
* [https://www.studentfinanceni.co.uk/ Northern Ireland]&lt;br /&gt;
&lt;br /&gt;
Separate guidance for non-UK students is also given. They also link to support when opening a student bank account:&lt;br /&gt;
&lt;br /&gt;
* [https://www.moneyhelper.org.uk/en/family-and-care/student-and-graduate-money/student-and-graduate-bank-accounts?source=mas money advice service]&lt;br /&gt;
* [https://www.moneysavingexpert.com/students/student-bank-account/ money savings expert]&lt;br /&gt;
&lt;br /&gt;
There is further guidance on opening a [https://www.moneyhelper.org.uk/en/savings/types-of-savings/sharia-compliant-savings?source=mas# Shari’a compliant account] for those whose religious beliefs go against the idea of paying or charging interest, such as Islam. The University also offers emergency funds, more of which can be found in the following section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;monetary-aid&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==== Monetary Aid ====&lt;br /&gt;
&lt;br /&gt;
The university offers funding to students in two forms, &#039;&#039;&#039;short term loans&#039;&#039;&#039; and the &#039;&#039;&#039;hardship fund&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The [https://www.bath.ac.uk/campaigns/short-term-loans/ short term loans] can be applied to by students for up to 300 pounds, or 500 pounds if they have dependents. It is discretionary and usually not awarded during the last 2 months of the academic year. They are interest-free and usually due within 2 months, or when the next loan instalment is due, whichever is sooner, although a student can apply for longer through the [https://www.bath.ac.uk/guides/making-an-appointment-or-attending-a-drop-in-session-with-student-money-advice/ money advice team].&lt;br /&gt;
&lt;br /&gt;
The [https://www.bath.ac.uk/guides/applying-for-the-university-of-bath-hardship-fund/ hardship fund] is available to both home and international students, but does require students to have applied for the maximum amount of maintenance available to them. This means that effectively, if you’re a UK student you need to have applied to and achieved the max maintenance loan for your household income. They take about a month to make a decision and the idea is that they help with financial hardship, though for international students this must be considered unexpected, as they don’t help with tuition fees or similar. It’s a tricky process but the maximum award is 3500 pounds.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;budgeting&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==== Budgeting ====&lt;br /&gt;
&lt;br /&gt;
There is budgeting support available through the University:&lt;br /&gt;
&lt;br /&gt;
* [https://www.bath.ac.uk/guides/managing-your-money/ blackbullion financial toolkit]&lt;br /&gt;
* [https://www.bath.ac.uk/publications/managing-your-money/attachments/managing-your-money-factsheet.pdf money management factsheet]&lt;br /&gt;
* and more on [https://www.bath.ac.uk/guides/managing-your-money/ the Money Advice page]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;dignity-and-respect&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Dignity and Respect ==&lt;br /&gt;
&lt;br /&gt;
The University has a &#039;&#039;very&#039;&#039; wide range of options available for students who are being made to feel uncomfortable.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;mental-health-support-1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== Mental health support ===&lt;br /&gt;
&lt;br /&gt;
If someone is being made uncomfortable by others this can have a severe impact on their mental health. Read through the signposting steps in the mental health section before progressing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;support-and-report&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== Support and Report ===&lt;br /&gt;
&lt;br /&gt;
Support and Report is a bit of a misnomer: there is no obligation to report anything officially, or to start a formal enquiry.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;what-to-report&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==== What to report ====&lt;br /&gt;
&lt;br /&gt;
Anything that makes a member of the University uncomfortable can be reported on Support and Report. This includes incidents that occur off campus or online, or involve non-University people. Reports can be made anonymously, by bystanders, through a friend or directly by a student. Reports do not have to be about a specific incident; it could be a repeated pattern of behaviour, or microaggressions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;what-happens-next&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==== What happens next ====&lt;br /&gt;
&lt;br /&gt;
Each report is handled individually. Making a report does not automatically start a misconduct inquiry. All reports are confidential and are not shared without the explicit permission of the student (except if there is an immediate threat).&lt;br /&gt;
&lt;br /&gt;
Even after making a report through Support and Report, no pressure is applied to continue with any formal or non-formal interventions. The default action is to simply log the incident and take no further action.&lt;br /&gt;
&lt;br /&gt;
Some narrow examples of outcomes could include, but are not limited to:&lt;br /&gt;
&lt;br /&gt;
* Log the incident and take no specific action (the information can be used to focus future preventative work)&lt;br /&gt;
* Log the incident and get back in touch if it happens again (including with other students)&lt;br /&gt;
* Log the incident and get back in touch after a certain amount of time&lt;br /&gt;
* Referral to mental health support&lt;br /&gt;
* Action within the academic department (the department is not told of the reason for changes, but this could include separation in group courseworks or lab groups)&lt;br /&gt;
* Action with Student Living&lt;br /&gt;
* Contact with external organisations and/or the police&lt;br /&gt;
* Non-formal interviews&lt;br /&gt;
* Imposing mandatory training on people&lt;br /&gt;
* Triggering Student Discipline procedures&lt;br /&gt;
&lt;br /&gt;
The key thing is that none of these will happen without the permission of the subject!&lt;br /&gt;
&lt;br /&gt;
If the person who experienced the discomfort does not want to make a report, a committee member can do this, either on behalf of the person, or as a bystander. In the latter case, no action is taken, but options for action can be suggested to the committee member, who can pass this on to the subject.&lt;/div&gt;</summary>
		<author><name>Pcs47</name></author>
	</entry>
	<entry>
		<id>https://wiki.bathcs.com/index.php?title=Git/Advanced&amp;diff=148</id>
		<title>Git/Advanced</title>
		<link rel="alternate" type="text/html" href="https://wiki.bathcs.com/index.php?title=Git/Advanced&amp;diff=148"/>
		<updated>2026-06-08T12:43:50Z</updated>

		<summary type="html">&lt;p&gt;Pcs47: Recommend --force-with-lease (https://gitlab.bath.ac.uk/cs/services/wiki/-/work_items/33)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Git is a really powerful command line tool when you start looking into the advanced things you can do, but when maintaining or developing a project, you are probably not going to touch most of them. This is a list of ones which I use on a regular basis.&lt;br /&gt;
&lt;br /&gt;
It’s important to note that the more advanced commands can have quite powerful functions which can lose code if used incorrectly. However, in most cases git caches a significant amount, so if you lose a commit or some changes, &#039;&#039;&#039;don’t panic&#039;&#039;&#039; and look up your issue (someone has done this before and found a way to get the changes back).&lt;br /&gt;
&lt;br /&gt;
== More on Commit IDs ==&lt;br /&gt;
&lt;br /&gt;
Where it says to use the &amp;lt;code&amp;gt;commit-id&amp;lt;/code&amp;gt;, there are different inputs you can use to specify multiple commits easily.&lt;br /&gt;
&lt;br /&gt;
Let A and B be the ids for two different commits. To reference a range you can do:&lt;br /&gt;
&lt;br /&gt;
* A to B (including A): &amp;lt;code&amp;gt;A^..B&amp;lt;/code&amp;gt;&lt;br /&gt;
* A to B (excluding A): &amp;lt;code&amp;gt;A..B&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or you can specify the last &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt; commits:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;HEAD~X&amp;lt;/code&amp;gt; e.g. &amp;lt;code&amp;gt;git reset --soft HEAD~4&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Stashing ==&lt;br /&gt;
&lt;br /&gt;
Stashing is used when you want to record the current state of the working directory and the index, but want to go back to a clean working directory.&lt;br /&gt;
&lt;br /&gt;
It allows you to set aside some changes for later or just never commit them (without altering the [[Git/Special files#Gitignore|&amp;lt;code&amp;gt;.gitignore&amp;lt;/code&amp;gt; file]]).&lt;br /&gt;
&lt;br /&gt;
By stashing your changes, they will be removed so you can no longer see them, but you can always &amp;lt;code&amp;gt;pop&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;apply&amp;lt;/code&amp;gt; the stash to get the back at any point.&lt;br /&gt;
&lt;br /&gt;
=== Commands ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sh&amp;quot;&amp;gt;git stash       # Stash current unstaged (but tracked) changes&lt;br /&gt;
git stash apply # Restore the last stash without deleting it&lt;br /&gt;
git stash pop   # Restore the last stash and delete it&lt;br /&gt;
git stash list  # List the stashed changes&lt;br /&gt;
git stash show  # Inspect the stashed changes&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|type=reminder|text=&lt;br /&gt;
GUI tools e.g. lazygit or VSCode (with git extension pack) normally have a better interface for adding and removing stashes - so probably use that instead.&lt;br /&gt;
}}This is usually used with &amp;lt;code&amp;gt;git switch&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;git checkout&amp;lt;/code&amp;gt; to allow you to switch branches when you still have uncommitted changes that may conflict.&lt;br /&gt;
&lt;br /&gt;
== Reverting vs Resetting ==&lt;br /&gt;
&lt;br /&gt;
To either reset or revert, you need the git commit hash id (or the start of it), this can be done via &amp;lt;code&amp;gt;git log&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Once you have that, the interface is quite similar:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sh&amp;quot;&amp;gt;git reset commit-id&lt;br /&gt;
git revert commit-id&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
They both do the same thing of reverting the changes from the given commit. But the difference is, &amp;lt;code&amp;gt;revert&amp;lt;/code&amp;gt; will create a new commit (therefore you can just run &amp;lt;code&amp;gt;git push&amp;lt;/code&amp;gt; or merging without any issues), whereas &amp;lt;code&amp;gt;reset&amp;lt;/code&amp;gt; will remove those commits outright.&lt;br /&gt;
&lt;br /&gt;
When resetting, the tree (simply, the list of commits) itself is altered. This means that when pushing to a repo which already contains that commit, you have to use &amp;lt;code&amp;gt;git push --force-with-lease&amp;lt;/code&amp;gt;. This will cause anyone else working on the same branch to lose their changes, as they are forced to run &amp;lt;code&amp;gt;git pull --force&amp;lt;/code&amp;gt;. There also exists &amp;lt;code&amp;gt;git push --force&amp;lt;/code&amp;gt;, but &amp;lt;code&amp;gt;--force-with-lease&amp;lt;/code&amp;gt; won&#039;t apply changes if the remote has commits that you don&#039;t have locally. Therefore, &amp;lt;code&amp;gt;--force-with-lease&amp;lt;/code&amp;gt; is preferred.&lt;br /&gt;
&lt;br /&gt;
This command is dangerous so make sure you check everything before using it as it forces the upstream to be exactly like your local branch. So if you accidentally removed the wrong commit, you cannot easily get it back.&lt;br /&gt;
&lt;br /&gt;
=== Extra options ===&lt;br /&gt;
&lt;br /&gt;
With &amp;lt;code&amp;gt;reset&amp;lt;/code&amp;gt; you also have extra options which you may find useful. You can either use &amp;lt;code&amp;gt;--soft&amp;lt;/code&amp;gt; (Put all the changes of the commit in staged) or &amp;lt;code&amp;gt;--hard&amp;lt;/code&amp;gt; (which is the default, just forget all changes).&lt;br /&gt;
&lt;br /&gt;
With &amp;lt;code&amp;gt;revert&amp;lt;/code&amp;gt; you can use &amp;lt;code&amp;gt;--no-commit&amp;lt;/code&amp;gt; which will put the inverse of the changes in staged (and not create a new commit). This allows you to add multiple reverts or more changes in it.&lt;br /&gt;
&lt;br /&gt;
== Rebasing ==&lt;br /&gt;
&lt;br /&gt;
Rebasing is used when commits have been added to &amp;lt;code&amp;gt;main&amp;lt;/code&amp;gt; and you want to bring them to your branch (with was branched off of &amp;lt;code&amp;gt;main&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
To rebase off of main (when you are in your branch), you can run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sh&amp;quot;&amp;gt;git rebase main&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{Note|text=&lt;br /&gt;
As we are changing the structure of the commit tree, you must then run &amp;lt;code&amp;gt;git push --force-with-lease&amp;lt;/code&amp;gt; once you are 100% happy none of your changes have been lost.&lt;br /&gt;
&lt;br /&gt;
As usual, if there is anyone else using your current branch, you shouldn’t do this.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The steps it is takes are:&lt;br /&gt;
&lt;br /&gt;
* Temporarily reset all your commits which you added to this branch&lt;br /&gt;
* Apply all the new commits in &amp;lt;code&amp;gt;main&amp;lt;/code&amp;gt; (or the given branch)&lt;br /&gt;
* Re-apply all of your commits&lt;br /&gt;
&lt;br /&gt;
=== Dealing with Conflicts ===&lt;br /&gt;
&lt;br /&gt;
Sometimes there may be conflicting changes from the changes added to main (e.g. you’ve changed the same line as another change).&lt;br /&gt;
&lt;br /&gt;
This is when it gets quite confusing and dangerous.&lt;br /&gt;
&lt;br /&gt;
If this happens, git will print out an error, saying what files are are in conflict and where to find them.&lt;br /&gt;
&lt;br /&gt;
If you run &amp;lt;code&amp;gt;git status&amp;lt;/code&amp;gt; you will see that some files are staged and some are not. The idea for these are:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Staged files&#039;&#039;&#039;: These are the files which are not conflicting and will be committed on &amp;lt;code&amp;gt;git rebase --continue&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &#039;&#039;&#039;Unstaged files&#039;&#039;&#039;: These are the files with conflicts&lt;br /&gt;
&lt;br /&gt;
If you open one of the conflicting files you will find that git has altered it where the conflicts are.&lt;br /&gt;
&lt;br /&gt;
The format is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;txt&amp;quot;&amp;gt;&amp;amp;lt;&amp;amp;lt;&amp;amp;lt;&amp;amp;lt;&amp;amp;lt;&amp;amp;lt;&amp;amp;lt; HEAD&lt;br /&gt;
- Auto writing README&lt;br /&gt;
- A cool logo - hw&lt;br /&gt;
- who&#039;s the above guy?&lt;br /&gt;
=======&lt;br /&gt;
- something&lt;br /&gt;
- A cool logo - hw&lt;br /&gt;
- other&lt;br /&gt;
&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt; 8f309e1 (Test commit)&amp;lt;/pre&amp;gt;&lt;br /&gt;
{{Note|text= class=&amp;quot;note&amp;quot;&amp;gt;&lt;br /&gt;
VSCode has its own custom interface for this [https://code.visualstudio.com/docs/sourcecontrol/overview#_3way-merge-editor read more here]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
You will see the changes you made are below the &amp;lt;code&amp;gt;=======&amp;lt;/code&amp;gt; and the (updated) upstream code in &amp;lt;code&amp;gt;main&amp;lt;/code&amp;gt; is above it.&lt;br /&gt;
&lt;br /&gt;
What you have to do is, for each of these conflicts, to choose which one to keep (or create a mixture). To do this, you just remove everything that shouldn’t be there (which includes &amp;lt;code&amp;gt;&amp;amp;lt;&amp;amp;lt;&amp;amp;lt;&amp;amp;lt;&amp;amp;lt;&amp;amp;lt;&amp;amp;lt; HEAD&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;=======&amp;lt;/code&amp;gt;, etc). For example, in this case it should result in:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;txt&amp;quot;&amp;gt;- Auto writing README&lt;br /&gt;
- something&lt;br /&gt;
- A cool logo - hw&lt;br /&gt;
- other&lt;br /&gt;
- who&#039;s the above guy?&amp;lt;/pre&amp;gt;&lt;br /&gt;
Once you are happy an entire file is now conflict-free and correct, you can stage it.&lt;br /&gt;
&lt;br /&gt;
Then once there are no unstaged files left you can run &amp;lt;code&amp;gt;git rebase --continue&amp;lt;/code&amp;gt;, which will save the changes under the original commit (sometimes it will ask you to confirm the commit message with your editor, you can just save and exit it).&lt;br /&gt;
&lt;br /&gt;
Once you have finished rebasing, make sure to test that your code still works. It’s common for code to break after rebasing due to unexpected changes made by someone else.&lt;br /&gt;
&lt;br /&gt;
=== Interactive Rebase ===&lt;br /&gt;
&lt;br /&gt;
Interactive rebasing is one of the most powerful and fun commands ever. However it comes with the downside of it being quite dangerous.&lt;br /&gt;
&lt;br /&gt;
It is used for reorganising a merge request and managing commits to clean up the git log.&lt;br /&gt;
&lt;br /&gt;
To use it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sh&amp;quot;&amp;gt;git rebase -i HEAD~X&lt;br /&gt;
# Or interactive rebase off of main&lt;br /&gt;
git rebase -i main&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This should bring up your default text editor with a list of commits with a list of commands at the end, which looks like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pick af44004 Annoying rebasing commit&lt;br /&gt;
pick ceb4454 Add quote from Varnie&lt;br /&gt;
pick 1f156e8 Test commit&lt;br /&gt;
&lt;br /&gt;
# Rebase 315c076..1f156e8 onto 315c076 (3 commands)&lt;br /&gt;
#&lt;br /&gt;
# Commands:&lt;br /&gt;
# p, pick &amp;amp;lt;commit&amp;amp;gt; = use commit&lt;br /&gt;
# r, reword &amp;amp;lt;commit&amp;amp;gt; = use commit, but edit the commit message&lt;br /&gt;
# e, edit &amp;amp;lt;commit&amp;amp;gt; = use commit, but stop for amending&lt;br /&gt;
# s, squash &amp;amp;lt;commit&amp;amp;gt; = use commit, but meld into previous commit&lt;br /&gt;
# f, fixup [-C | -c] &amp;amp;lt;commit&amp;amp;gt; = like &amp;amp;quot;squash&amp;amp;quot; but keep only the previous&lt;br /&gt;
#                    commit&#039;s log message, unless -C is used, in which case&lt;br /&gt;
#                    keep only this commit&#039;s message; -c is same as -C but&lt;br /&gt;
#                    opens the editor&lt;br /&gt;
# x, exec &amp;amp;lt;command&amp;amp;gt; = run command (the rest of the line) using shell&lt;br /&gt;
# b, break = stop here (continue rebase later with &#039;git rebase --continue&#039;)&lt;br /&gt;
# d, drop &amp;amp;lt;commit&amp;amp;gt; = remove commit&lt;br /&gt;
# l, label &amp;amp;lt;label&amp;amp;gt; = label current HEAD with a name&lt;br /&gt;
# t, reset &amp;amp;lt;label&amp;amp;gt; = reset HEAD to a label&lt;br /&gt;
# m, merge [-C &amp;amp;lt;commit&amp;amp;gt; | -c &amp;amp;lt;commit&amp;amp;gt;] &amp;amp;lt;label&amp;amp;gt; [# &amp;amp;lt;oneline&amp;amp;gt;]&lt;br /&gt;
#         create a merge commit using the original merge commit&#039;s&lt;br /&gt;
#         message (or the oneline, if no original merge commit was&lt;br /&gt;
#         specified); use -c &amp;amp;lt;commit&amp;amp;gt; to reword the commit message&lt;br /&gt;
# u, update-ref &amp;amp;lt;ref&amp;amp;gt; = track a placeholder for the &amp;amp;lt;ref&amp;amp;gt; to be updated&lt;br /&gt;
#                       to this position in the new commits. The &amp;amp;lt;ref&amp;amp;gt; is&lt;br /&gt;
#                       updated at the end of the rebase&lt;br /&gt;
#&lt;br /&gt;
# These lines can be re-ordered; they are executed from top to bottom.&lt;br /&gt;
#&lt;br /&gt;
# If you remove a line here THAT COMMIT WILL BE LOST.&lt;br /&gt;
#&lt;br /&gt;
# However, if you remove everything, the rebase will be aborted.&lt;br /&gt;
#&amp;lt;/pre&amp;gt;&lt;br /&gt;
You can see all the commits which will be re-applied after the branch has been rolled back and commits from main been added.&lt;br /&gt;
&lt;br /&gt;
These all have the word &amp;lt;code&amp;gt;pick&amp;lt;/code&amp;gt; infront of them, meaning they will be committed as is, with the same message, and no editing happening.&lt;br /&gt;
&lt;br /&gt;
You can look over the other commands to see what you can do, but how it works is by replacing &amp;lt;code&amp;gt;pick&amp;lt;/code&amp;gt; with something else, e.g. &amp;lt;code&amp;gt;fixup&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;reword&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== The Fixup Commit ===&lt;br /&gt;
&lt;br /&gt;
This is a weird option when committing, that can be useful when you have an MR and you are wanting to keep a neat commit log, but are responding to review feedback.&lt;br /&gt;
&lt;br /&gt;
How this works, is lets say you’ve fixed something with a previous commit in your MR and were wanting to (when merging) squash this fix into that commit. But you want to have it as a separate commit to help the reviewer to see that you have fixed it.&lt;br /&gt;
&lt;br /&gt;
To do this you simply run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sh&amp;quot;&amp;gt;git commit --fixup=&amp;quot;amend:&amp;lt;git_commit_id&amp;gt;&amp;quot;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Which will create a new commit with the message:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;amend! Add information for publicising events from BCSS and where to go&lt;br /&gt;
&lt;br /&gt;
&amp;amp;gt; Add information for publicising events from BCSS and where to go&amp;lt;/pre&amp;gt;&lt;br /&gt;
Which you can then push as its own commit.&lt;br /&gt;
&lt;br /&gt;
Then when you come to merge you can run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sh&amp;quot;&amp;gt;git rebase -i main --autosquash&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Which will automatically move your amend commit to be &amp;lt;code&amp;gt;fixup&amp;lt;/code&amp;gt; above the commit you were amending.&lt;br /&gt;
&lt;br /&gt;
== Merging ==&lt;br /&gt;
&lt;br /&gt;
Normally merging is done via the interface on the remote repository system you are using. However it can be done in the command line as well (it can also be used in place of &amp;lt;code&amp;gt;rebase&amp;lt;/code&amp;gt; so you don’t have to use the dangerous &amp;lt;code&amp;gt;git push --force-with-lease&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
It copies all the commits which have been added on a branch to the branch you are currently on (e.g. &amp;lt;code&amp;gt;main&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
So the process to merge a branch into main is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sh&amp;quot;&amp;gt;git checkout main&lt;br /&gt;
git merge branch-name&lt;br /&gt;
git branch -d branch-name # Deletes the branch If you don&#039;t need the branch any&lt;br /&gt;
                          # more&lt;br /&gt;
git push&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Conflicts can still happen, see [[Git/Advanced#dealing-with-conflicts|above]] for more information about how to manage them.&lt;br /&gt;
&lt;br /&gt;
{{Note|text=&lt;br /&gt;
When merging, cherry-picking or other, and you are dealing with conflicts you need to use the subcommand with &amp;lt;code&amp;gt;--continue&amp;lt;/code&amp;gt;, for example &amp;lt;code&amp;gt;git merge --continue&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;git cherry-pick --continue&amp;lt;/code&amp;gt;.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Cherry-picking ==&lt;br /&gt;
&lt;br /&gt;
Cherry picking allows you to bring a single commit (or multiple, see [[#more-on-commit-ids|here]]) from another branch to your current one.&lt;br /&gt;
&lt;br /&gt;
To do this, it is as simple as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sh&amp;quot;&amp;gt;git cherry-pick commit-id&lt;br /&gt;
git push&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
== Submodules ==&lt;br /&gt;
&lt;br /&gt;
Submodules are normally used in what is called a “monorepo”, a repo which stores multiple difference projects or git repositories.&lt;br /&gt;
&lt;br /&gt;
It is also useful for refactoring some files. E.g. if you need the same files in multiple different projects (e.g. standardised tests or config files), it is common to add a “meta” repo which stores these projects, then add this as a submodule to each project which uses it.&lt;br /&gt;
&lt;br /&gt;
To add a submodule you can run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sh&amp;quot;&amp;gt;git submodule add repo-url folder/to/store&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This will clone the module inside the folder &amp;lt;code&amp;gt;folder/to/store&amp;lt;/code&amp;gt; and will add a &amp;lt;code&amp;gt;.gitmodule&amp;lt;/code&amp;gt; file in the base of the repo.&lt;br /&gt;
&lt;br /&gt;
When cloning the repo on other devices, you must remember to recursively clone all the submodules as well via:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sh&amp;quot;&amp;gt;git clone --recurse-submodules -j8 project-url&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|text=&lt;br /&gt;
&amp;lt;code&amp;gt;-j8&amp;lt;/code&amp;gt; is an performance optimisation see [https://stackoverflow.com/questions/3796927/how-do-i-git-clone-a-repo-including-its-submodules#4438292 this Stack Overflow answer]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Or if you have already cloned the repo and were wanting to update all the submodules, you can run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sh&amp;quot;&amp;gt;git submodule update --init --recursive&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Managing submodules ===&lt;br /&gt;
&lt;br /&gt;
Once you have cloned a submodule, you will note that any time you pull the latest changes to it, you need to make another commit in the base repo with the update.&lt;br /&gt;
&lt;br /&gt;
This is so that the submodules are locked on specific commits until you specifically say “yes this next commit is fine”.&lt;br /&gt;
&lt;br /&gt;
== Extra Configuration ==&lt;br /&gt;
&lt;br /&gt;
Sometimes there are configuration options that git will recommend when they become a problem, for example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sh&amp;quot;&amp;gt;git config --global pull.rebase true&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This means that when pulling from a branch which has new changes, it will rebase instead of merging the new commits.&lt;br /&gt;
&lt;br /&gt;
=== Commit Signing ===&lt;br /&gt;
&lt;br /&gt;
Commit signing is used to verify if you are who you say you are when committing (e.g. with your email address).&lt;br /&gt;
&lt;br /&gt;
I won’t go into much depth on this, instead just know it exists and is quite good practice to have but not necessary.&lt;br /&gt;
&lt;br /&gt;
You can read more [https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits here].&lt;br /&gt;
&lt;br /&gt;
Be aware that there are some consequences which come along with this:&lt;br /&gt;
&lt;br /&gt;
* If you have setup a strict mode with signing, you cannot commit if you loose access to your signing key&lt;br /&gt;
* When rebasing your changes, you have to resign all the commits (meaning you are the only one who can do it)&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
{{Special:PrefixIndex|prefix=Git|namespace=0|hideredirects=1}}&lt;br /&gt;
[[Category:Tutorial]]&lt;/div&gt;</summary>
		<author><name>Pcs47</name></author>
	</entry>
</feed>