A simple template for hosting a personal storage system
Ultra light-weight, works on most devices
Includes:
- Web server to manage your files, including:
- Upload files
- View images
- View videos
- Delete files
- Security system for protecting your user files, including:
- Dynamic RSA Authentication
Supports:
- Windows
- Linux
- Web (Broken) (Client RSA encryption and decryption is broken from the plugin side)
- Android
- MacOS
- IOS
login.mp4
upload.mp4
foldercreate.mp4
imageview.mp4
videoview.mp4
- The Server uses the ports 7979
- The Server cannot handle multiple connections on the same user
- Robust DDOS protection is recommended, although the server has a simple implementation
- Drive encrpytion is recommended if you run sensitive data, storage template will not handle files encryption
- Delete old files in temp folder, lost connections will not delete files automatically
- Login passwords is encrypted, all requests is encrypted after user login, all connected users have different RSA keys.
- The project does not handle http redirects, be careful using it in http on production
- The storage folder will be located in /source_server/drive/account/...
- The temporary received files will be in /source_server/drive/temp/...
- The files is not encrypted, the NAS server has entire access to all files stored in the storage
Storage Template requires some dependencies to fully work
- Conversion videos after upload or download from links: ffmpeg
- Download Videos from links: yt-dlp (On linux by default you need to install from your repository distro, should be installed in /usr/bin/yt-dlp)
If you do not download this dependencies storage template maybe fail during some tasks
All binaries should be placed in ./source_server/libraries/windows-or-linux
Windows
libraries\windows\ffmpeg.exe
libraries\windows\yt-dlp.exe
Linux
By default linux will try to use the libraries from your package manager in: /usr/bin/..., if you distro is different you can manually compile the video_converter
and video_downloader
This project has a simple DDOS system, if you wish to use the project with the ports open, a DDOS protection system is recommended.
When starting the storage, make sure to clean the temporary files in /source_server/drive/temp/
- Storage templates converts all uploaded videos to 720p 30fps (The video will be unavalaible until the conversion is finished, if the storage server is closed after the conversion, you will need to manually convert), if your NAS server cannot handle a video streaming in 720p probably will not handle very well, a good estimate is:
Intel(R) Core(TM) i3-2367M CPU @ 1.40GHz
works flawless for 2 users at same time - At least 1024 MB RAM (depends on how many users at the same time)
- Install git
- Run this command in the folder you want to save the storage system:
git clone https://github.com/LeandroTheDev/storage_template
-
You also can clone manually the repository in the github
- Install mariadb server
- Open the mariadb terminal cli:
sudo mariadb
- Run this command (consider changing the password):
CREATE DATABASE storage; GRANT ALL PRIVILEGES ON storage.* TO 'nas_admin'@'localhost' IDENTIFIED BY 'secretpassword' WITH GRANT OPTION; FLUSH PRIVILEGES;
- Change the database.js credentials
this.database_connection = new Sequelize('storage', "nas_admin", "secretpassword", {
host: "localhost",
dialect: "mariadb",
logging: false,
sync: true,
dialectOptions: {
connectTimeout: 30000
}
})
- Install nodejs
- Check the README.md for node dependencies (or use the command
npm install
) - Running the web server:
node init.js
- (You need to run the web server first before this command) MariaDB cli, Creating admin account:
USE storage; INSERT INTO accounts (username, password) VALUES ('admin', 'secretpassword');
- Install git
- Run this command in the folder you want to save the storage system:
git clone https://github.com/LeandroTheDev/storage_template
-
You also can clone manually the repository in the github
- Install mariadb server
- Open the mariadb terminal cli:
C:\Program Files\MariaDB version\bin\mariadb -uroot -ppass
- Run this command (consider changing the password):
CREATE DATABASE storage; GRANT ALL PRIVILEGES ON storage.* TO 'nas_admin'@'localhost' IDENTIFIED BY 'secretpassword' WITH GRANT OPTION; FLUSH PRIVILEGES;
- Change the database.js credentials
this.database_connection = new Sequelize('storage', "nas_admin", "secretpassword", {
host: "localhost",
dialect: "mariadb",
logging: false,
sync: true,
dialectOptions: {
connectTimeout: 30000
}
})
- Install nodejs
- Check the README.md for node dependencies (or use the command
npm install
) - Running the web server:
node init.js
- (You need to run the web server first before this command) MariaDB cli, Creating admin account:
USE storage; INSERT INTO accounts (username, password) VALUES ('admin', 'secretpassword');
You can manually compile the application for you desire OS, or you can download it on releases section.
After installed and configurated the server, you will need to get the ip address from your server, once you started the application choose the select ip option, change it to your desired address, press the reset keys buttons, select server side for better compatibility, put your credentials and start using.
First thing you will need to compile the front end is to install the flutter framework on your machine
- ninja
- mpv
- pkgconf
Build command: flutter build linux
Build command: flutter build windows
- android sdk
Build command: flutter build android