# LAB1
[toc]
### Job List
1. - [X] (30%) Install and set up Proxmox
2. - [X] (10%) Create VMs for web server and database
3. - [X] (10%) Create a simple web API with web framework
4. - [X] (10%) Deploy your app on a WSGI server and a dedicated web server
5. - [X] (10%) Create another web API to show data in the database
6. - [X] (10%) Push to GitLab
7. - [X] (20%) Questions asked by Tas
8. - [X] (10%) Bonus: set up pfSense and be able to use
9. - [x] (10%) Bonus: set up VPN server in pfSense
## Install and set up Proxmox (pfSense, VMs)
> Author: Yin-Tao Ling

1. Install Proxmox VE using a USB.
2. Setting static IP address **192.168.207.50/24** for Proxmox Host.
3. Create another bridge **vmbr1** for pfSense LAN.
4. Create all VMs and configure the networking based on the above figure.
5. Setting port forwarding on global router due to insufficient IP address (140.113.207.28).
## Install VPN server (Wireguard)
> Author: Yin-Tao Ling
**強烈建議觀看以下網址**
Ref: [wundertech](https://www.wundertech.net/how-to-set-up-wireguard-on-pfsense/)
1. Follow all of the steps in wundertech's tutorial.
2. Create Client's WireGuard Tunnel profile:
> PrivateKey: Generated automatically
> Address: An Allowed IP address in VPN peer from VPN server.
> PublicKey: pfSense Web GUI -> **VPN**/**WireGuard**/**Tunnels**/**tun_wg0** -> Interface Public Keys
> Endpoint: Fixed

3. Create Server's WireGuard Peer profile:
pfSense Web GUI -> **VPN**/**WireGuard**/**Peers**/**Add Peer**
> PublicKey: Copied from Client's WireGuard Tunnel profile.
> Allowed IPs: Any IP address in 10.200.0.0/24

4. Verify VPN functionality

## Topology

## Database
* using MariaDB
* Data: Iris dataset
* 建置流程:
* 啟動 MariaDB container
* 以 Python 讀取 Iris
* 寫入 DB
## Backend
* using FastAPI (+ Uvicorn)
* support 2 required API:
* `/`: return `Hello world`
* `/data`: return Iris dataset
I5x/v69lZtmLiNJ6b3il1OFfvNMTNdh/P8yA97nGwzU=
5jlWoWjMfM3gNPMmjmxWTf8zGnExam8oV9zpRxZmIi0=