presentations_compsoc/src/slides/skynet/1_setup.md

375 lines
10 KiB
Markdown
Raw Normal View History

2023-10-14 17:20:33 +01:00
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
title = "Skynet: Setup"
date = 2023-09-23
slides = true
2023-10-14 17:20:33 +01:00
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Skynet: Setup
2023-10-14 17:20:33 +01:00
-------------------------------------------------------------------------
Now that ye have the history time to get you Skynet accounts.
2023-10-14 17:20:33 +01:00
-------------------------------------------------------------------------
2023-10-14 17:20:33 +01:00
This is for new members.
If there are any older members please wait a little while.
2023-10-14 17:20:33 +01:00
-------------------------------------------------------------------------
## New Members
2023-10-14 17:20:33 +01:00
-------------------------------------------------------------------------
1. Be a fully paid up member of UL Computer Society
2023-10-14 17:20:33 +01:00
-------------------------------------------------------------------------
2023-10-14 17:20:33 +01:00
2. Go to <<https://account.skynet.ie/signup>>.
Enter the same email used for UL Wolves
2023-10-14 17:20:33 +01:00
-------------------------------------------------------------------------
3. You will get an email to verify your address, follow the link.
2023-10-14 17:20:33 +01:00
-------------------------------------------------------------------------
4. Choose a ``username`` and ``password``.
2023-10-14 17:20:33 +01:00
-------------------------------------------------------------------------
Congrats! You are in! //heist music//
2023-10-14 17:20:33 +01:00
-------------------------------------------------------------------------
## Returning Members
2023-10-14 17:20:33 +01:00
-------------------------------------------------------------------------
2023-10-14 17:20:33 +01:00
1. Please go to <<https://account.skynet.ie/modify>>.
Enter the same email used for UL Wolves
2023-10-14 17:20:33 +01:00
-------------------------------------------------------------------------
Congrats! You are in! //heist music//
2023-10-14 17:20:33 +01:00
-------------------------------------------------------------------------
## Returning Members
2023-10-14 17:20:33 +01:00
-------------------------------------------------------------------------
2023-10-14 17:20:33 +01:00
If you have forgotten your ``username``.
Use <<https://account.skynet.ie/recover/username>>
2023-10-14 17:20:33 +01:00
-------------------------------------------------------------------------
2023-10-14 17:20:33 +01:00
If you have forgotten your ``password``.
Use <<https://account.skynet.ie/recover/password>>
2023-10-14 17:20:33 +01:00
-------------------------------------------------------------------------
## All Members
2023-10-14 17:20:33 +01:00
-------------------------------------------------------------------------
Now that we are all on the same page we can now set an SSH key.
2023-10-14 17:20:33 +01:00
-------------------------------------------------------------------------
Prepwork:
```bash
cd ~/.ssh
mkdir skynet
cd skynet
```
2023-10-14 17:20:33 +01:00
-------------------------------------------------------------------------
```bash
ssh-keygen -t ed25519 -C "<comment>"
```
Location: username
Password: Press Enter twice
We will use the ``{username}.pub`` file later
2023-10-14 17:20:33 +01:00
-------------------------------------------------------------------------
Back to the ssh folder
```bash
cd ../
```
2023-10-14 17:20:33 +01:00
-------------------------------------------------------------------------
Windows
```powershell
"" > config
```
Linux
```bash
touch config
```
2023-10-14 17:20:33 +01:00
-------------------------------------------------------------------------
Into it pop this
```
Host *.skynet.ie
User %r
IdentityFile ~/.ssh/skynet/%r
IdentitiesOnly yes
```
(we will also ping this on discord)
2023-10-14 17:20:33 +01:00
-------------------------------------------------------------------------
Remember the ``{username}.pub`` in ``~/.ssh/skynet`` ?
2023-10-14 17:20:33 +01:00
-------------------------------------------------------------------------
```bash
cat ~/.ssh/skynet/{username}.pub
```
2023-10-14 17:20:33 +01:00
-------------------------------------------------------------------------
Copy the text and go to <<https://account.skynet.ie/modify>>
2023-10-14 17:20:33 +01:00
-------------------------------------------------------------------------
Select the SSH Key field and submit.
2023-10-14 17:20:33 +01:00
-------------------------------------------------------------------------
Congratulations, you now have full access to all of Skynet's services!
2023-10-14 17:20:33 +01:00
-------------------------------------------------------------------------
Now to learn //how// to access them!
2023-10-14 17:20:33 +01:00
-------------------------------------------------------------------------
## Email
2023-10-14 17:20:33 +01:00
-------------------------------------------------------------------------
1. Go to <<https://mail.skynet.ie/>>
2. Login with ``username@skynet.ie`` and ``password``
3. Done
2023-10-14 17:20:33 +01:00
-------------------------------------------------------------------------
## Email (Thunderbird)
2023-10-14 17:20:33 +01:00
-------------------------------------------------------------------------
0. Have Thunderbird Installed
1. Add Account
2. Login with ``username@skynet.ie`` and ``password``
3. It can take a few min.
4. Done
2023-10-14 17:20:33 +01:00
-------------------------------------------------------------------------
## Skynet Webserver
2023-10-14 17:20:33 +01:00
-------------------------------------------------------------------------
```bash
ssh {username}@skynet.skynet.ie
```
2023-10-14 17:20:33 +01:00
-------------------------------------------------------------------------
Thats it, you have logged into Skynet (webserver)!
2023-10-14 17:20:33 +01:00
-------------------------------------------------------------------------
## Skynet Website
2023-10-14 17:20:33 +01:00
-------------------------------------------------------------------------
The server you logged onto is a webserver.
2023-10-14 17:20:33 +01:00
-------------------------------------------------------------------------
This means it can serve content on the web.
2023-10-14 17:20:33 +01:00
-------------------------------------------------------------------------
Due to aforementioned //issues// we can only serve static files (no database)
2023-10-14 17:20:33 +01:00
-------------------------------------------------------------------------
This is more than enough for most folks needs.
2023-10-14 17:20:33 +01:00
-------------------------------------------------------------------------
2023-10-14 17:20:33 +01:00
Create a ``public_html`` in your own home directory with correct permissions
2023-10-14 17:20:33 +01:00
-------------------------------------------------------------------------
```bash
mkdir ~/public_html
chmod 711 ~
chmod -R 755 ~/public_html
cd ~/public_html
```
2023-10-14 17:20:33 +01:00
-------------------------------------------------------------------------
Now we have a folder, time to put something in it.
2023-10-14 17:20:33 +01:00
-------------------------------------------------------------------------
```bash
nano index.html
```
2023-10-14 17:20:33 +01:00
-------------------------------------------------------------------------
This brings up a terminal based editor, type whatever ye want here.
2023-10-14 17:20:33 +01:00
-------------------------------------------------------------------------
To exit press ``[ctrl]``+``[x]`` to bring up save options.
You cna rename the file, for now just press ``[enter]``
2023-10-14 17:20:33 +01:00
-------------------------------------------------------------------------
2023-10-14 17:20:33 +01:00
Go to <<https://{username}.users.skynet.ie>> to view your website.
2023-10-14 17:20:33 +01:00
-------------------------------------------------------------------------
That was cumbersome to do right?
2023-10-14 17:20:33 +01:00
-------------------------------------------------------------------------
2023-10-14 17:20:33 +01:00
Logging in.
Only to change a file on terminal that you have never used before.
2023-10-14 17:20:33 +01:00
-------------------------------------------------------------------------
Surely there is a better way?
2023-10-14 17:20:33 +01:00
-------------------------------------------------------------------------
Well luckily for you programmers are lazy
2023-10-14 17:20:33 +01:00
-------------------------------------------------------------------------
There are ways to transfer files from your local computer to the server.
2023-10-14 17:20:33 +01:00
-------------------------------------------------------------------------
Fow Windows you have WinSCP: <<https://winscp.net/>>
2023-10-14 17:20:33 +01:00
-------------------------------------------------------------------------
2023-10-14 17:20:33 +01:00
If ye are using linux you can use put ``sftp://{username}@skynet.skynet.ie``
(or use filezilla)
2023-10-14 17:20:33 +01:00
-------------------------------------------------------------------------
2023-09-27 17:47:16 +01:00
## Gitlab
2023-10-14 17:20:33 +01:00
-------------------------------------------------------------------------
2023-09-27 17:47:16 +01:00
As part of your Skynet account you have access to our Gitlab Server.
2023-10-14 17:20:33 +01:00
-------------------------------------------------------------------------
2023-09-27 17:47:16 +01:00
1. Go to <<https://gitlab.skynet.ie>>
2. Login with ``username`` and ``password``
3. Done
2023-10-14 17:20:33 +01:00
-------------------------------------------------------------------------
2023-09-27 17:47:16 +01:00
## Gitlab Website
2023-10-14 17:20:33 +01:00
-------------------------------------------------------------------------
2023-09-27 17:47:16 +01:00
its possible to have a website on gitlab.
2023-10-14 17:20:33 +01:00
-------------------------------------------------------------------------
2023-09-27 17:47:16 +01:00
Powered by source control and CI/CD pipelines (devops)
2023-10-14 17:20:33 +01:00
-------------------------------------------------------------------------
2023-09-27 17:47:16 +01:00
Go to the ``Dashboard`` > ``Groups`` > ``New Group``
2023-10-14 17:20:33 +01:00
-------------------------------------------------------------------------
2023-09-27 17:47:16 +01:00
Name the group Personal or College or something like that.
2023-10-14 17:20:33 +01:00
-------------------------------------------------------------------------
2023-09-27 17:47:16 +01:00
Inside that Group create a ``New Project``, name it whatever ye want.
2023-10-14 17:20:33 +01:00
-------------------------------------------------------------------------
2023-09-27 17:47:16 +01:00
2023-10-14 17:20:33 +01:00
``Create from Template`` > Any one that starts with ``Pages``
(I recommend ``pages/html``)
2023-09-27 17:47:16 +01:00
2023-10-14 17:20:33 +01:00
-------------------------------------------------------------------------
2023-09-27 17:47:16 +01:00
It will appear on the screen in a moment after clicking.
2023-10-14 17:20:33 +01:00
-------------------------------------------------------------------------
2023-09-27 17:47:16 +01:00
Go up to Edit > Web IDE > Change something on the index.html
2023-10-14 17:20:33 +01:00
-------------------------------------------------------------------------
2023-09-27 17:47:16 +01:00
2023-10-14 17:20:33 +01:00
``[ctrl] + [shift] + [g]`` (or click the icon on the left), enter a msg
And ``commit to master``.
2023-09-27 17:47:16 +01:00
2023-10-14 17:20:33 +01:00
-------------------------------------------------------------------------
2023-09-27 17:47:16 +01:00
Your website will now be build and deployed.
2023-10-14 17:20:33 +01:00
-------------------------------------------------------------------------
2023-09-27 17:47:16 +01:00
Woot!!! Devops!!!
2023-10-14 17:20:33 +01:00
-------------------------------------------------------------------------
2023-09-27 17:47:16 +01:00
To get teh link is a tad annoying.
2023-10-14 17:20:33 +01:00
-------------------------------------------------------------------------
2023-09-27 17:47:16 +01:00
Go to ``Settings`` (bottom left of repo page) > Pages
2023-10-14 17:20:33 +01:00
-------------------------------------------------------------------------
2023-09-27 17:47:16 +01:00
Open the link in a new tab and marvel at yer creation.
2023-10-14 17:20:33 +01:00
-------------------------------------------------------------------------
2023-09-27 17:47:16 +01:00
If you go back and commit new changes they will show up as well.
2023-10-14 17:20:33 +01:00
-------------------------------------------------------------------------
2023-09-27 17:47:16 +01:00
In a future session we will discuss Gitlab (and git in general) more.
2023-10-14 17:20:33 +01:00
-------------------------------------------------------------------------
2023-09-27 17:47:16 +01:00
Here completes the rough introduction to Skynet and creating websites.
2023-10-14 17:20:33 +01:00
-------------------------------------------------------------------------
If ye have any questions/ideas feel free to ask.
2023-10-14 17:20:33 +01:00
-------------------------------------------------------------------------
2023-10-14 17:20:33 +01:00
If ye want to take a deeper look into server admin feel free to ask.
2023-10-14 17:20:33 +01:00
-------------------------------------------------------------------------
2023-09-27 17:47:16 +01:00
Skynet team is always open to newcomers!