aboutsummaryrefslogtreecommitdiff
path: root/report/cloud-maker.tex
blob: d6179c20ae8988a8df4c90221caa3033fd020b09 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
\documentclass[12pt]{article}
\usepackage[top=2cm, left=3cm, right=3cm]{geometry}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{times}
\usepackage{calc}
\usepackage{eso-pic}
\usepackage{titlesec}
\usepackage{soulutf8}
\usepackage{array}
\usepackage{makecell}
\usepackage{hyperref}
\usepackage{graphicx}
\usepackage{tikz-uml}
\usepackage{pgfgantt}
\usepackage{listings}
\usepackage{color}

\date{06 Oct, 2024}
\title{Cloud Maker}
\author{Vikas Kushwaha}

\nonstopmode

\newlength{\PageFrameTopMargin}
\newlength{\PageFrameBottomMargin}
\newlength{\PageFrameLeftMargin}
\newlength{\PageFrameRightMargin}

\setlength{\PageFrameTopMargin}{1cm}
\setlength{\PageFrameBottomMargin}{1cm}
\setlength{\PageFrameLeftMargin}{1cm}
\setlength{\PageFrameRightMargin}{1cm}

\makeatletter

\let\inserttitle\@title
\let\insertauthor\@author
\let\insertdate\@date

\newlength{\Page@FrameHeight}
\newlength{\Page@FrameWidth}

\AddToShipoutPicture {
	\thicklines
	\setlength{\Page@FrameHeight}{\paperheight-\PageFrameTopMargin-\PageFrameBottomMargin}
	\setlength{\Page@FrameWidth}{\paperwidth-\PageFrameLeftMargin-\PageFrameRightMargin}
	\put(\strip@pt\PageFrameLeftMargin,\strip@pt\PageFrameTopMargin){
		\framebox(\strip@pt\Page@FrameWidth, \strip@pt\Page@FrameHeight){}}}

\makeatother

\titleformat{\section}
{\Large\bfseries\center\uppercase}
{}
{1em}
{}
[\hrule]

\titleformat{\subsubsection}
{\bfseries\uppercase}
{}
{1em}
{\ul}

\AddToHook{cmd/section/before}{\clearpage}
\graphicspath{ {./images/} }

\newenvironment{changemargin}[2]{%
\begin{list}{}{%
\setlength{\topsep}{0pt}%
\setlength{\leftmargin}{#1}%
\setlength{\rightmargin}{#2}%
\setlength{\listparindent}{\parindent}%
\setlength{\itemindent}{\parindent}%
\setlength{\parsep}{\parskip}%
}%
\item[]}{\end{list}}

\renewcommand\theadfont{\bfseries}
\newcolumntype{L}[1]{>{\raggedright\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{R}[1]{>{\raggedleft\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}


\definecolor{dkgreen}{rgb}{0,0.6,0}
\definecolor{gray}{rgb}{0.5,0.5,0.5}
\definecolor{mauve}{rgb}{0.58,0,0.82}

\lstset{frame=tb,
  language=Go,
  aboveskip=3mm,
  belowskip=3mm,
  showstringspaces=false,
  columns=flexible,
  basicstyle={\small\ttfamily},
  numbers=none,
  numberstyle=\tiny\color{gray},
  keywordstyle=\bfseries\color{blue},
  commentstyle=\itshape\color{dkgreen},
	identifierstyle=\color{mauve},
  stringstyle=\color{red},
  breaklines=true,
  breakatwhitespace=true,
  tabsize=3
}

\hypersetup{colorlinks=true, urlcolor=blue}


\begin{document}


\iftrue  % Theory


\begin{center}
	\fontsize{14pt}{28pt}\selectfont
	A PROJECT REPORT \\
	on \\
	\textbf{"\underline{\MakeUppercase{\inserttitle}}"} \\
	\textit{submitted by} \\
	\textbf{Mr. \insertauthor} \\
	\textbf{Seat No :-} \\
	\textit{in partial fullfillment for the award of the degree} \\
	of \\
	\textbf{BACHELOR OF SCIENCE} \\
	in \\
	\textbf{COMPUTER SCIENCE} \\
	\textit{under the guidance of} \\
	\textbf{Mrs. Swetha Iyer} \\
	\textbf{Department of Computer Science} \\
	\vspace{1cm}
	\includegraphics[scale=0.25]{vartak-logo} \\
	\fontsize{14pt}{20pt}\selectfont
	\textbf{VIDYAVARDHINI'S} \\
	\textbf{A. V. COLLEGE OF ARTS, K. M. COLLEGE OF COMMERCE} \\
	\textbf{E. S. A. COLLEGE OF SCIENCE,} \\
	\textbf{VASAI(WEST), PALGHAR-401208, MAHARASHTRA} \\
	\fontsize{14pt}{28pt}\selectfont
	\textbf{(Sem V)} \\
	\textbf{(2024-25)} \\
\end{center}


\fontsize{12pt}{24pt}\selectfont

\section{Acknowledgement}
\begin{center}
	\vspace{2cm}
	I would like to acknowledge my sincere thanks towards our project guide \\
	\textbf{Mrs. Swetha Iyer} \\
	for their valuable guidance and suggestions and \\
	providing me an opportunity to do the project work in the college lab and \\
	which made me complete the project successfully. \\
	\vspace{2cm}
	I am also thankful to \\
	\textbf{Head of Computer Scince Department} \\
	\textbf{Mrs. Srimathi Narayanan} \\
	For providing such nice guidance in form of comments and corrections. \\
	I am thakful to and fortunate enough to get contant encouragement, \\
	support and guidance from all teaching staff of Computer Science \\
	which helped us in successfully completing our project work. \\
Also, I would like to extend our sincere esteems to all staff in laboratory \\
	for their timely support. \\
	\vspace{2cm}
	By \textbf{\insertauthor}, \\
	T.Y.BSc (Computer Science)
\end{center}


\section{Declaration}
\vspace{2cm}
I \textbf{\underline{\insertauthor}} hereby declare that, \\
\bigskip \\
The project entitled
\textbf{"\underline{\MakeUppercase{\inserttitle}}"}
submitted in the partial fulfillment for the award of Bachelor of Science in Computer Science during the academic year \textbf{2024 - 2025} is my original work and the project has not formed the basis for the award of any degree, associate ship, fellowhip or any other similar titles. \\ \\ \\
\vspace{2cm}
\textbf{Signature of the Student:} \\
\bigskip
\textbf{Place:} \\
\bigskip
\textbf{Date:} \\


\section{Plagarism Report}
\vspace{2cm}
\includegraphics[width=\linewidth]{dupli-checker} \\
...


\section{Gantt Chart}


\section{Table Of Content}
\vfill
\begin{center}
\begin{tabular}{ | C{2cm} | m{8cm} | C{2cm} | m{2cm} | }
	\hline
	\thead{Sr. No} & \thead{Contents} & \thead{Page No.} & \thead{Sign} \\
	\hline
	\hline\textbf{1.}  & \textbf{Introduction} & \textbf{7} & \\
	\hline\textbf{2.}  & \textbf{Limitation of Current System} & \textbf{8} & \\
	\hline\textbf{3.}  & \textbf{Advantages of Proposed System} & \textbf{9} & \\
	\hline\textbf{4.}  & \textbf{Tools and Techniques} & \textbf{10} & \\
	\hline\textbf{5.}  & \textbf{Requirement Specification} & \textbf{11} & \\
	\hline\textbf{6.}  &
	\bgroup
	\def\arraystretch{0.7}%
	\begin{tabular}{L{0.7cm} l}
		& \textbf{System Design} \\
		\textbf{(A)} & Event Table \\
		\textbf{(B)} & ER Diagram \\
		\textbf{(C)} & Class Diagram \\
		\textbf{(D)} & Use Case Diagram \\
		\textbf{(E)} & Sequence Diagram \\
		\textbf{(F)} & Component Diagram \\
		\textbf{(G)} & Deployment Diagram \\
		\textbf{(H)} & Activity Diagram \\
		\textbf{(I)} & Database \\
	\end{tabular}
	\egroup
		& \textbf{12 - 20} & \\
	\hline\textbf{7.}  & \textbf{System Implementation} & \textbf{21 - 47} & \\
	\hline\textbf{8.}  & \textbf{Results} & \textbf{48 - 51} & \\
	\hline\textbf{9.}  & \textbf{Conclusion} & \textbf{52} & \\
	\hline\textbf{10.} & \textbf{References} & \textbf{53} & \\
	\hline
\end{tabular}
\end{center}
\vfill


\section{Introduction}
\vspace{1cm}
\textbf{\uppercase{Title of the Project:}} \quad\textbf{\MakeUppercase{\inserttitle}}
\bigskip
\subsubsection{Synopsis:} \quad\quad
\textit{A cloud storage in distributed fashion.} \\ \par
This system is intended to be an alternative to online storage proveders like Google Drive. It's a distributed model where the user physically owns the resources in his/her own house. Unlike centralised cloud providers, the user is given a small computing device, preferrably an SBC like Rasberry Pi which acts as an 'Endpoint Device' and a gateway to access user's various media devices like Pen Drives, Hard Drives, Memory Cards, and any other sotrage media that can potentially interface with the Endpoint Device (Rasberry Pi, in our case.) \\ \par
The user is intended to connect his Endpoint device using a Web Proxy which will be automatically setup acting as a Internet Gateway to his Endpoint Device. The Rasberry Pi will be primary product for the user that will act as a Cloud Storage Provider. He can access this Cloud Storage from any computer that has an Internet Connection. The user will be provided with a Web Interface from where he can view and manage all his Files and Folders. \\
\par
In summary, it turns the user's own storage devices into a cloud making it convinient for the user to access his storage from anywhere in the world.


\section{Limitations of Current System}
\vspace{2cm}
\quad\quad Thc cloud storage space have now become mainstream. People used store their files and data backups on External Storage Devices like Pend Drives and Hard Drives. However, these days we just upload all our content to cloud storage like Google Drive. This poses many problems and risks surrounding around Data Privacy, Security and Ownership of Data. It's now a well known fact that companies sell the User Data they harvest to other companies in exchange of profits. \\

There's also a problem with the costs involved. Cloud Storage Drives are extremely Expensive. Just for instance Google Cloud charges you Rs. 130 per month in India for a 100GB storage space for a single user. Assuming a year is just 10 months, it becomes Rs. 1300 for an year an Rs. 13,000 for a decade. That's actually quiet expensive for just a 100GB of storage space. A lot of people aren't really interested in spending a lot of money on such storage options as they often simply can't afford it. They will usually try to limit themselves by just using the limited storage space that is provided per account for free. 15 GigaBytes in case of Google Drive.


\section{Advantages of Proposed System}
\vspace{2cm}
\quad\quad This system tries to solve many of the problems with Cloud Storage proveders, as mentioned in the previous section that revolve araound data privacy and security and also costs. \\
\par
\inserttitle{} ensures that the data stays on user's physical medium ensuring that the user absolutely owns the data and no one else on the internet has access to it. Unless ofcourse, they had physical access to the device itself. This is incredibly useful for storing highly sensitive documents and other details that can be detremental for the user if fallen onto wrong hands. Being distributed in nature, it also minimizes the damage of data breaches. If a hacker do succeed in any case breaching the cloud storage, they only breache one device rather than breaching the whole community. This can be quite important for Government officials storing classified documents on the storage devices \\
\par
\inserttitle{} also makes it feasible for users to have large cloud storage space. As the user can simply use his/her own storage devices as a cloud store. The user can buy 1 TeraByte hard drive which will usually costs around Rs. 3,000 to 5,000 and can easily last for 6+ years and even a decade. This makes the costs and scale feasible for the user. This is especially useful for professionals like Video Editors and Graphics designers that often have Adboe project files spanning over multiple GigaBytes. They can't carry their hard drive everywhere and they often have to access various of their previous workd sporadically even for new projects.


\section{Tools and Techniques}
\vspace{2cm}
\quad\quad
This system involves an Endpoint Server and a client computer. For the endpoint server, let's assume a Rasberry Pi Model 3B flashed with a Linux Operating System like Debian 10 for ARM. This devices primarily runs two things, a web server and a set of scripts for managing storage devices. It then forwards it's Web Server Port to a VPS server using SSH. This VPS server has a pre-registered domain name and acts as a proxy to the Rasberry Pi Endpoint making it accessible throught the internet. \\
\par
Initially, two shell scripts are started in the bacground -- automountd and automount-clean. automountd monitors all the usb ports of Rasberry Pi and automatically mounts any storage device as soon as it's connected to it. It mounts them at a specific mount point (/media/user) which is later used by the Web Server. automount-clean monitors the mount point and cleans any dangling directories left over of unmount storage devices. \\
\par
The Web Server makes the mount point accessible to other computers by providing a web interface for browsing and managing files. The Web Interface is essentially a File Manager. The Web Server is written in Go Programming Languages and uses http router from standard library which provides routing functionality and html/template (Go's built in template engine) which provides the building blocks of the web interface.\\
\par
The Web Interface can be accessed through any computer or mobile device. The user can freely upload, download, or share files from his media device.


\section{Requirement Specification}
\vspace{2cm}
\begin{enumerate}
	\item \textbf{Hardware Requirements:} \\ \\
		For Endpoint Server,
		\begin{itemize}
			\item Rasberry PI Model B+ or newer
			\item 16GB Memory Card
			\item External Storage Drives of User Preferred Size
		\end{itemize}
		For Client Device,
		\begin{itemize}
			\item Connection to Endpoint Rasberry Pi Server (LAN / WAN)
		\end{itemize}

	\vspace{1cm}
	\item \textbf{Software Requirements:} \\ \\
		For Endpoint Server,
		\begin{itemize}
				\item OS: Debian Raspi Linux
				\item Shell: Bash
				\item Programming Language: Go
		\end{itemize}
		For Client Device,
		\begin{itemize}
			\item Any OS with latest Web Browser
		\end{itemize}
\end{enumerate}

\fi  % Theory


\iftrue  % UML Diagrams
\fontsize{12pt}{16pt}\selectfont

\section{Event Table}
\begin{changemargin}{-1cm}{-1cm}
\vfill
\begin{center}
\begin{tabular}{ | C{2cm} | C{3cm} | C{2cm} | C{3cm} | C{3cm} | C{2cm} | }
	\hline
	\thead{Event} &
	\thead{Trigger} &
	\thead{Source} &
	\thead{Activity} &
	\thead{Response} &
	\thead{Destination} \\
	\hline\hline
	Cut Files &
	User clicks on Cut Button & User &
	Files are added to Cut Buffer &
	Files in Cut Buffer &
	Endpoint Server \\ \hline

	Copy Files & User clicks on Copy Button & User &
	Files are added to Copy Buffer &
	Files in Copy Buffer &
	Endpoint Server \\ \hline

	Paste from Cut Buffer &
	User clicks on Paste button &
	User &
	Files are moved from Cut Buffer &
	Files Moved &
	Endpoint Server \\ \hline

	Paste from Copy Buffer &
	User clicks on Paste button &
	User &
	Files are copied from Copy Buffer &
	Files Copied &
	Endpoint Server \\ \hline

	Delete Files &
	User clicks on Delete Button &
	User &
	Selected Files are set to deletion &
	Confirm Deletion &
	Endpoint Server \\ \hline

	Upload Local Files &
	User clicks on Upload Button &
	User &
	File Browser is opened for selection &
	User submits files &
	User \\ \hline

	Download Remote Files &
	Server gets Download Requests &
	Endpoint Server &
	Server ZIPs requested file and sends to user &
	Compressed File recieved &
	User \\ \hline

	Create Folder &
	User enters New Folder Name &
	User &
	New Folder is created on the system &
	Folder is shown &
	Endpoint Server \\ \hline

\end{tabular}
\end{center}
\vfill
\end{changemargin}


\section{ER Diagram}
\vfill
\begin{center}
\begin{tikzpicture}[
		class/.style={minimum width=4cm},
	]
	\umlclass[class, rectangle split parts=2]{FileSystem}{
		CutCount \\
		CopyCount \\
		FileCount \\
		CutBuffer \\
		CopyBuffer \\
		File \\
	}{}
	\umlclass[class, x=8cm, y=0cm,
			rectangle split parts=2]{Directory}{
		URI \\
		Path \\
		Info \\
		Files \\
	}{}
	\umlclass[class, x=8cm, y=-8cm,
			rectangle split parts=2]{File}{
		URI \\
		Path \\
		Info \\
		Data \\
	}{}
	\umluniassoc[mult=1]{FileSystem}{Directory}
	\umluniassoc[mult=0..*]{Directory}{Directory}
	\umluniassoc[mult=0..*]{Directory}{File}
\end{tikzpicture}
\end{center}
\vfill


\section{Class Diagram}
\vfill
\begin{center}
\begin{tikzpicture}[
		class/.style={minimum width=6cm},
	]
	\umlclass[class]{FSData}{
		CutCount: int \\
		CopyCount: int \\
		FileCount: int \\
		CutBuffer: []string \\
		CopyBuffer: []string \\
		File: *FileNode \\
	}{}
	\umlclass[class, x=8cm, y=-8cm]{FileNode}{
		URI: string \\
		Path: string \\
		IsDir: bool \\
		Info: os.FileInfo \\
		Data: any \\
	}{
		HTMLPath(): template.HTML \\
		EvalSymlinks(): string \\
		IconPath(): string \\
		Size(): string \\
		Mode(): string \\
		ModDate(): string \\
		ModTime(): string \\
		Details(): string \\
	}
	\umluniaggreg[geometry=-|]{FSData}{FileNode}
\end{tikzpicture}
\end{center}
\vfill


\section{Use Case Diagram}
\vfill
\begin{center}
\begin{tikzpicture}[
		case/.style={text width=3cm},
		subcase/.style={minimum width=3cm}
	]
	\begin{umlsystem}[x=6] {}
		\umlusecase[case, name=br] {Browse Files Remotely}
		\umlusecase[case, name=ob, x=6cm, y=-2cm] {Open in Browser}
		\umlusecase[case, name=up, y=-3cm] {Upload Files}
		\umlusecase[case, name=dn, y=-5cm] {Download Files}
		\umlusecase[case, name=fm, y=-8cm] {Manage Files}
		\umlusecase[subcase, name=cp, x=6cm, y=-6cm] {Copy}
		\umlusecase[subcase, name=mv, x=7cm, y=-8cm] {Move}
		\umlusecase[subcase, name=dl, x=6cm, y=-10cm] {Delete}
	\end{umlsystem}
	\node [above] at (current bounding box.north) {Cloud Maker};
	\umlactor[y=-4] {User}
	\umlassoc{User}{br}
	\umlassoc{User}{up}
	\umlassoc{User}{dn}
	\umlassoc{User}{fm}
	\umlextend{br}{ob}
	\umlinclude{fm}{cp}
	\umlinclude{fm}{mv}
	\umlinclude{fm}{dl}
\end{tikzpicture}
\end{center}
\vfill


\section{Sequence Diagram}
\vfill
% Stage 1: Connect to Cloud Storage \\
\begin{center}
\begin{tikzpicture}
\begin{umlseqdiag}
	\umlactor[class=User]{u}
	\umlobject[x=7, class=Server]{proxy}
	\umlobject[x=14, class=Server]{endpoint}

	\begin{umlcall}[op=Port Forwarding, type=synchron, return=Connection Established]{endpoint}{proxy} \end{umlcall}
	\begin{umlcall}[op=HTTP Connection Request, type=synchron, dt=10, return=Connection Established]{u}{proxy}
		\begin{umlcall}[op=Forward Request, type=synchron, return=HTTP Connection]{proxy}{endpoint} \end{umlcall}
	\end{umlcall}
\end{umlseqdiag}
\end{tikzpicture}
\end{center}
\vfill

\vfill
% Stage 2: Open Files and perform Actions \\
\begin{center}
\begin{tikzpicture}
\begin{umlseqdiag}
	\umlactor[class=User]{u}
	\umlobject[x=7, class=Server]{endpoint}
	\umlmulti[x=14, class=Drives]{storage}

	\begin{umlcall}[op=Get Filesystem Data]{storage}{endpoint}
	\begin{umlcall}[op=File Browser, padding=5, return=Close Connection]{endpoint}{u}

		\begin{umlcall}[op=Upload Files, dt=5]{u}{endpoint}
			\begin{umlcall}[op=Save Files, dt=0]{endpoint}{storage} \end{umlcall}
		\end{umlcall}

		\begin{umlcallself}[op=Select Files, dt=0]{u} \end{umlcallself}

		\begin{umlcall}[op=Cut/Copy Files, dt=0]{u}{endpoint} \end{umlcall}
		\begin{umlcallself}[op=Add Files to Buffer, dt=-2]{endpoint} \end{umlcallself}

		\begin{umlcall}[op=Open Folder, dt=4, padding=0, return=Reload Page]{u}{endpoint}
			\begin{umlcall}[op=Change Directory, dt=0]{endpoint}{storage} \end{umlcall}
		\end{umlcall}

		\begin{umlcall}[op=Paste Files in buffer]{u}{endpoint} \end{umlcall}
		\begin{umlcall}[op=Move/Copy Files in Buffer, dt=-2]{endpoint}{storage} \end{umlcall}

		\begin{umlcall}[op=Download Files, padding=0, return=Files Transferred]{u}{endpoint}
			\begin{umlcall}[op=Zip Files, dt=0, return=Files Compressed]{endpoint}{storage} \end{umlcall}
		\end{umlcall}

		\begin{umlcall}[op=Delete Files, dt=5, return=Request Confirmation]{u}{endpoint} \end{umlcall}
		\begin{umlcall}[op=Confirm]{u}{endpoint} \end{umlcall}
		\begin{umlcall}[op=Remove Files, dt=-2]{endpoint}{storage} \end{umlcall}

	\end{umlcall}
	\end{umlcall}
\end{umlseqdiag}
\end{tikzpicture}
\end{center}
\vfill


\section{Component Diagram}
\vfill
\begin{center}
\begin{tikzpicture}[
		comp/.style={minimum width=3cm}
	]
	\umlbasiccomponent[comp, x=0, y=-0]{Client}
	\umlbasiccomponent[comp, x=10, y=-0]{Nginx Proxy}
	\umlbasiccomponent[comp, x=5, y=-3]{SSH Server}
	\umlbasiccomponent[comp, x=0, y=-6]{SSH Client}
	\umlbasiccomponent[comp, x=10, y=-6]{Web Server}
	\umlbasiccomponent[comp, x=5, y=-9]{Linux OS}
	\umlbasiccomponent[comp, x=10, y=-12]{USB Monitor}
	% \umlbasiccomponent[comp, x=0, y=-14]{File System}
	\umlbasiccomponent[comp, x=0, y=-12]{Storage Devices}
	\umlassemblyconnector[interface=HTTP Connection]{Client}{Nginx Proxy}
	\umlVHassemblyconnector[interface=Forwarded Port]{Nginx Proxy}{SSH Server}
	\umlVHassemblyconnector[interface=SSH Connection]{SSH Client}{SSH Server}
	\umlassemblyconnector[interface=Web Server Port]{SSH Client}{Web Server}
	\umlHVassemblyconnector[interface=File System]{Linux OS}{Storage Devices}
	\umlHVassemblyconnector[interface=USB Ports]{USB Monitor}{Linux OS}
	\umlVHassemblyconnector[interface=File System]{Web Server}{Linux OS}
\end{tikzpicture}
\end{center}
\vfill


\section{Deployment Diagram}
\vfill
\begin{center}
\begin{tikzpicture}
	\begin{umlcomponent}{Client Device}
		\umlbasiccomponent[]{Web Browser}
	\end{umlcomponent}
	\begin{umlcomponent}{Central Proxy Server}
		\umlbasiccomponent[x=8]{SSH Server}
		\umlbasiccomponent[x=12]{Nginx}
		\umlbasiccomponent[x=10, y=-2]{Linux OS}
	\end{umlcomponent}
	\begin{umlcomponent}{Endpoint Server}
		\umlbasiccomponent[x=2, y=-8]{Web Server}
		\umlbasiccomponent[x=6, y=-8]{SSH Client}
		\umlbasiccomponent[x=10, y=-8]{Linux OS}
		\umlbasiccomponent[x=4, y=-10]{USB Monitor}
		\umlbasiccomponent[x=8, y=-10]{File System}
	\end{umlcomponent}
	\begin{umlcomponent}{External Storage}
		\umlbasiccomponent[x=0, y=-16]{Pen Drive}
		\umlbasiccomponent[x=4, y=-16]{External Hard Drive}
		\umlbasiccomponent[x=8, y=-16]{SD Card}
		\umlbasiccomponent[x=12, y=-16]{External SSD}
	\end{umlcomponent}
	\umluniassoc{Client Device}{Central Proxy Server}
	\umluniassoc{Endpoint Server}{Central Proxy Server}
	\umluniassoc{Endpoint Server}{External Storage}
\end{tikzpicture}
\end{center}
\vfill


\section{Activity Diagram}
\vfill
\begin{center}
\begin{tikzpicture}[
		node distance=2cm,
		arrow/.style={thick,->,>=stealth},
		start/.style={fill=black,circle,thick},
		label/.style={rectangle, rounded corners=5, text centered, draw=black, fill=yellow!20},
		fixlabel/.style={label, text width=2cm},
		decision/.style={diamond, draw=black, fill=blue!20},
	]
	\node[start] at (0, 0) (start) {};
	\node[fixlabel, below of=start] (browse) {Browse Files};
	\node[fixlabel, left of=browse, xshift=-2cm] (ofolder) {Open\\File};
	\node[fixlabel, right of=browse, xshift=2cm] (ofile) {Upload File};
	\node[decision, below of=browse, yshift=0.5cm] (split1) {};
	\node[label, left of=split1, yshift=-1.5cm, text width=3cm] (select) {Select Files and Folders};
	\node[fixlabel, right of=split1, yshift=-1.5cm] (action) {Perform Action};
	\node[label, right of=action, xshift=2cm] (download) {Download};
	\node[fixlabel, below of=action] (manage) {Manage Files};
	\node[label, left of=manage, xshift=-4cm] (delete) {Delete};
	\node[decision, below of=manage, yshift=0.5cm] (split2) {};
	\node[fixlabel, left of=split2, yshift=-1.5cm] (cut) {Cut to Buffer};
	\node[fixlabel, right of=split2, yshift=-1.5cm] (copy) {Copy to Buffer};
	\node[decision, below of=manage, yshift=-2.5cm] (split3) {};
	\node[fixlabel, below of=split3] (paste) {Paste from Buffer};
	\node[decision, below of=delete, yshift=-0.5cm, fill=red!20] (conf1) {Confirm?};
	\node[label, below of=conf1, yshift=-0.5cm] (conf1yes) {Delete Files};
	\node[label, left of=conf1, xshift=-2cm] (conf1no) {Ignore};

	\draw[arrow] (start) -- (browse);
	\draw[arrow] (browse) -- (ofolder);
	\draw[arrow] (browse) -- (ofile);
	\draw[arrow] (browse) -- (split1);
	\draw[arrow] (split1) -| (select);
	\draw[arrow] (split1) -| (action);
	\draw[arrow] (select) -- (action);
	\draw[arrow] (action) -- (manage);
	\draw[arrow] (action) -- (download);
	\draw[arrow] (manage) -- (split2);
	\draw[arrow] (split2) -| (cut);
	\draw[arrow] (split2) -| (copy);
	\draw[arrow] (cut) |- (split3);
	\draw[arrow] (copy) |- (split3);
	\draw[arrow] (split3) -- (paste);
	\draw[arrow] (manage) -- (delete);
	\draw[arrow] (delete) -- (conf1);
	\draw[arrow] (conf1) -- node[anchor=east] {Yes} (conf1yes);
	\draw[arrow] (conf1) -- node[anchor=south] {No} (conf1no);
\end{tikzpicture}
\end{center}
\vfill


\section{Database}
\vfill
\begin{center}
Representation of File Metadata in File System. \\
\bigskip
\begin{tabular}{ | m{4cm} | m{3cm} | m{3cm} | m{3cm} | }
	\hline
	\thead{Attribute} &
	\thead{DataType} &
	\thead{Size} &
	\thead{Retrieval} \\
	\hline\hline
	Name               & Chars    & 255 Bytes & Primary Key \\
	Permissions        & Octal    & 4 Bytes   & Not Null \\
	User UID           & Integer  & 4 Bytes   & Not Null \\
	Group GID          & Integer  & 4 Bytes   & Not Null \\
	Modification Time  & Time     & 4 Bytes   & Not Null \\ \hline
\end{tabular}
\end{center}
\vfill


% \section{Gantt Chart}
% \vfill
% \begin{center}
% \begin{ganttchart}[
% 		hgrid=true,
% 		vgrid={*2{dotted}, {dashed}, *3{dotted}, {dashed}, *4{dotted}, {dashed}},
% 		y unit chart=0.8cm,
% 		title height=1,
% 		expand chart=\textwidth,
% 		bar label node/.append style={align=right},
% 		bar height=0.5,
% 		exed/.style={bar top shift=0.5},
% 		real/.style={bar top shift=0.1, bar/.append style={fill=black}},
% 	]{1}{15}
% 	\gantttitle{2024}{15} \ganttnewline[draw=none]
% 	\gantttitle{June}{3}
% 	\gantttitle{July}{4}
% 	\gantttitle{August}{5}
% 	\gantttitle{September}{3} \\
% 	\gantttitlelist{1,...,3}{1}
% 	\gantttitlelist{1,...,4}{1}
% 	\gantttitlelist{1,...,5}{1}
% 	\gantttitlelist{1,...,3}{1} \\
% 	\ganttbar[exed]{Requirements \\ Specification}{1}{1} \\
% 	\ganttbar[real]{}{1}{2} \\
% 	\ganttbar[exed]{Analysis}{2}{3} \\
% 	\ganttbar[real]{}{3}{4} \\
% 	\ganttbar[exed]{Design}{4}{5} \\
% 	\ganttbar[real]{}{5}{7} \\
% 	\ganttbar[exed]{Coding and \\ Testing}{6}{11} \\
% 	\ganttbar[real]{}{8}{12} \\
% 	\ganttbar[exed]{Implementation}{12}{13} \\
% 	\ganttbar[real]{}{13}{15} \\
% \end{ganttchart}
% \end{center}
% \vfill

\fi  % UML Diagrams


\iftrue  % System Implementation


\section{System Implementation}

\lstset{language=Go}
\lstset{basicstyle=\ttffamily}

\subsubsection{server.go}
\lstinputlisting{../src/server.go}%

\subsubsection{helpers.go}
\lstinputlisting{../src/helpers.go}

\subsubsection{files.go}
\lstinputlisting{../src/files.go}

\subsubsection{templates.go}
\lstinputlisting{../src/templates.go}

\lstset{language=Bash}

\subsubsection{automountd}
\lstinputlisting{../scripts/automountd}

\subsubsection{automount-clean}
\lstinputlisting{../scripts/automount-clean}


\fi  % System Implementation


\fontsize{12pt}{24pt}\selectfont

\iftrue  % Miscellaneous

\section{Results}

Connecting to Pi and loading the page asks for credentials. \\ \\
\includegraphics[width=\linewidth]{ss/1.cm-login.png} \\

The home page will be loaded when the right credentials are entered. It contains a list of drives that are currentyl mounted to any of the Rasberry Pi USB Ports. \\ \\
\includegraphics[width=\linewidth]{ss/2.cm-home.png} \\

Clicking on the upload button opens a dialog which the user can use to select and upload multiple files. \\ \\
\includegraphics[width=\linewidth]{ss/3.cm-upload.png} \\

Clicking on the new folder button in lower right corner opens up a prompt that inputs a name and create a new folder. \\ \\
\includegraphics[width=\linewidth]{ss/4.cm-create-folder.png} \\

\clearpage
The user can also select multiple files and perform various file operations on selected files. \\ \\
\includegraphics[width=\linewidth]{ss/5.cm-select.png} \\

Here's an example of user cutting a bunch of files. \\ \\
\includegraphics[width=\linewidth]{ss/6.cm-cut.png} \\

\clearpage
Same with copying files. \\ \\
\includegraphics[width=\linewidth]{ss/7.cm-cut-copy.png} \\

The clear button will cancel any cut/copy operations where as the paste button will paste all the files from cut/copy buffer in the directory the user is currently in. Similary the user can also downlad files using file selection. \\ \\

When deleting files, the user is prompted with a confirmation dialog box with count of files that are goint to be deleted. \\ \\
\includegraphics[width=\linewidth]{ss/8.cm-delete-prompt.png}


\section{Future Scope and Conclusion}
\vspace{2cm}
\quad\quad
The \inserttitle{} system proves to be a very useful tool for digital professionals and even normal users. However, this was really a minimal working demonstration of can be done with a cheap computer (like Rasberry Pi) and bunch of media devices. A lot more can be done to extend the current systems as well as make it do things that it was not intended to. \\
\par
It's authentication system can be improved to include permanent logins and session managements using browser cookies. At the movement, it only supports HTTP BasicAuth and user has to login everytime they open a new browser instance. \\
\par
This system can include automatic backup and sync functionality with native applications interfacing the web server. This would be the key feature for driving mass adoption by users as one of the primary view of cloud storage is of a 'backup point.' Users will also don't have to bother with manuall uploading or downloading files as they can be automatically synced in the background. \\
\par
A public sharing functionality can be introduced where a user selects a folder or a bunch of files and a link is automatically generated that allows other people or non-users of the system to access those files. This will also replace the reliance on third party file sharing sites like Zapya or ToffeeShare.


\section{References}
\vspace{2cm}
\begin{enumerate}
	\item Go Language Specificatoin: \quad \url{https://go.dev/ref/spec}
	\item Go Package Documentation: \quad \url{https://pkg.go.dev/std}
	\item Go User Guides: \quad \url{https://go.dev/doc/}
	\item Basic Auth: \\ \quad \url{https://www.alexedwards.net/blog/basic-authentication-in-go}
	\item Stack Overflow: \quad \url{https://stackoverflow.com}
	\item Google Drive Pricing: \quad \url{https://one.google.com/about/plans}
	\item Nginx: \quad \url{https://nginx.org/en/}
	\item OpenSSH: \quad \url{https://www.openssh.com/}
	\item ArchLinux Wiki: \quad \url{https://wiki.archlinux.org/}
	\item MDN Docs: \quad \url{https://developer.mozilla.org/en-US/}
\end{enumerate}


\fi  % Miscellaneous


\end{document}