Recently I ran out of space in my dropbox folder. I had about 25gbs of documents ranging from word docs to code. I had Dropbox’s college something competition award that lets you store more data if your college sends enough invites or something like that. Because of that I got lazy and continued using dropbox for another year. However recently that award expired and I was capped back to 5gbs.
Also another concern of mine was having all my files in someone else’s server which can be searched with a warrant (This warrant can be from multiple countries, even the ones that are corrupt). Therefore having all of my files in my own hard drives which I can microwave any time is much better! (I wonder what event would force me to microwave hw assignments…). Of course by hosting my own server I’m also taking a huge risk.
Will have all my storage locally, (no prying eyes (mass surveillance), can get rid of it whenever I want for good)
Develop networking and OS skills (will have to setup VPNs, Dynamic DNS, ngnix, auto restart, raid arrays, hard drives, file systems, power loss scenarios… )
Can get hacked (all data exposed)
Can lose lots of important data
Reduced access (If my room looses internet, I cant access my files)
This path I’m following is not the most logical one for sure. Google Drive offers a quite affordable price than dropbox for more size, it was something like 2$ a month. Also I already invested in 70$ for this. Although I have 500gb wheras google drive gives only 100gb for 2$.
Long story short here is how I did it.
Initially I researched all the available open source dropbox alternatives. I came across a couple, and found out that people were mostly satisfied with seafile. I was like great! Let’s use that.
My initial concern was about security. I looked up for vulnerabilities in seahub and came across to couple of minor stuff on the github issues. I’m also planning to do a vulnerability scan with Qualys and also Vega. (If I ever expose my seafile server to world wide web). In order to have the most secure server as possible, my seafile server is only accessible through vpn. I’m also planning to open it slowly to some ip addresses. I will also log everything real-time and also receive push notifications about logins and hard drive spins by that way i will know if I’m owned or not before its too late (I’m aware of the fact that there are still ways to hack it without me noticing but this is better than nothing).
Problems That I have experienced so far
After 20 days of uptime I experienced the first file system corruption due to power loss (I believe it was a powerloss), 10GBs of my files were corrupted.
As you can see there the permissions for the files and the owner information is missing and whenever i try to access the file it says bad message. These files are on a raid array (It is a raid 0) and somehow they managed the get corrupted. Since I knew something like this was coming up, I backed my shit to another place too, so I did not loose any data at all, just my secondary backup. After cleaning up the corrupted files and uploading the backup I experienced this problem again! FUCK
However I knew that this time It was definitely a power failure because I unplugged the raspberry pi while testing my IoT plug (that I made with esp8266). That must have corrupted it. However this time I managed to fix it with fsck.
First I unmounted the drives
Then I executed fsck
fsck /dev/md0 (the device is different then the mount point, type df to see the mount points and the devices)
fsck asks some questions and I usually answer yes to all of them. In this instance fsck was able to fix the problem without any data loss, however in the previous one I lost a little bit of data. Maybe it was because i executed the file restoring tool of seafile which turned out to be quite destructive. I had only one corrupt library, after running the tool I lost all my libraries.
I will also post my notes for seafile installation, however the seafile wiki is quite comprehensive in that matter.