FileShelter is an open-source web-based file transfer service that provides a secure and easy-to-use alternative to traditional FTP servers. In this tutorial, we will walk you through the step-by-step process of installing FileShelter on Fedora Server Latest.
Before we begin, you will need:
We need to install the required dependencies for FileShelter. Open your terminal and execute:
sudo dnf install python3 python3-pip python3-virtualenv rh-git29 httpd mod_ssl openssl
Confirm the installation by pressing 'y' when prompted.
We will now clone the FileShelter GitHub repository. Run the following command:
git clone https://github.com/epoupon/fileshelter.git
Then, navigate to the cloned project directory:
cd fileshelter
Create a virtual environment for FileShelter to isolate its dependencies:
python3 -m venv fileshelter-venv
Activate the created environment by running:
source fileshelter-venv/bin/activate
Now that we have activated the virtual environment, we can install the packages FileShelter needs using pip. Execute the following command to download the requirements:
pip3 install --no-cache-dir -r requirements.txt
Create a settings.py file in the 'fileshelter' directory by copying the sample configuration file:
cp fileshelter/settings-sample.py fileshelter/settings.py
FileShelter uses PostgreSQL as the default database engine. Install PostgreSQL and initialize the database:
sudo dnf install postgresql-server postgresql-contrib
sudo postgresql-setup --initdb
Set the PostgreSQL service to start on boot:
sudo systemctl enable postgresql
sudo systemctl start postgresql
Create a database for FileShelter:
sudo -u postgres psql -c "CREATE DATABASE fileshelter;"
Set a secure password for the user accessing the database:
sudo -u postgres psql -c "CREATE USER fileshelteruser WITH PASSWORD 'mypassword';"
sudo -u postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE fileshelter TO fileshelteruser;"
Update the settings.py file with the following database settings:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'fileshelter',
'USER': 'fileshelteruser',
'PASSWORD': 'mypassword',
'HOST': 'localhost',
'PORT': '',
}
}
In the same fileshelter/settings.py file, set your SECRET_KEY, SITE_ID and optionally, ALLOWED_HOSTS variable.
If you want to use email notifications when a transfer is completed or when the file expires, add these email-related settings to the settings.py file:
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_PORT = 587
EMAIL_USE_TLS = True
EMAIL_HOST_USER = 'youremail@yourprovider.com'
EMAIL_HOST_PASSWORD = 'yourpassword'
DEFAULT_FROM_EMAIL = 'youremail@yourprovider.com'
Before we start the FileShelter server, we need to initialize the database:
python3 manage.py migrate
We need to configure a web server to serve FileShelter over HTTPS. We’ll use Apache in this tutorial.
Use the following command to generate a self-signed SSL certificate:
sudo openssl req -x509 -nodes -newkey rsa:2048 -keyout /etc/pki/tls/private/localhost.key -out /etc/pki/tls/certs/localhost.crt -days 365
Enter the requested details when prompted (such as domain name). This will generate a self-signed SSL certificate in /etc/pki/tls/certs/localhost.crt and /etc/pki/tls/private/localhost.key.
Start by creating a new configuration file:
sudo vim /etc/httpd/conf.d/fileshelter.conf
and add the following configuration:
<VirtualHost *:80>
ServerName fileshelter.localhost
Redirect 301 / https://fileshelter.localhost/
</VirtualHost>
<VirtualHost *:443>
ServerName fileshelter.localhost
DocumentRoot /your/path/to/fileshelter/staticfiles
# SSL Configuration
SSLEngine on
SSLCertificateFile /etc/pki/tls/certs/localhost.crt
SSLCertificateKeyFile /etc/pki/tls/private/localhost.key
# Static files
Alias /static /your/path/to/fileshelter/staticfiles
<Directory /your/path/to/fileshelter/staticfiles>
Require all granted
</Directory>
<Directory /your/path/to/fileshelter/fileshelter>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
# WSGI Configuration
WSGIDaemonProcess fileshelter python-path=/your/path/to/fileshelter python-home=/your/path/to/fileshelter/fileshelter-venv
WSGIProcessGroup fileshelter
WSGIScriptAlias / /your/path/to/fileshelter/fileshelter/wsgi.py
</VirtualHost>
Restart Apache to apply the newly added configuration:
sudo systemctl restart httpd
Activate the virtual environment again:
source fileshelter-venv/bin/activate
Then start the Django development server:
python3 manage.py runserver
Navigate to https://fileshelter.localhost (as defined in http configuration) in your web browser to access FileShelter.
That's it! You've successfully installed and configured FileShelter on Fedora Server Latest. Enjoy your new, secure file transfer service.
If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!
Alternatively, for the best virtual desktop, try Shells!