meganz / webclient

The mega.nz web client
Other
1.06k stars 311 forks source link
cloud-storage cryptographic meganz privacy webclient

MEGA Web Client

MEGA provides robust cloud storage with convenient and powerful always-on privacy. MEGA believes in your right to privacy and provides you with the technology tools to protect it. We call it User Controlled Encryption (UCE), and it happens automatically.

Secure Boot

secureboot.js loads all the resources from static content servers and verifies its authenticity by checking the cryptographic hash.

Note: This is not the exact same secureboot.js as we have online at https://mega.nz/secureboot.js. We have an automatic process that generates secureboot.js with its cryptographic hashes and all the versioned resource files (file_X.js/file_X.html) as needed based on this repository before prior to updating the live site.

During development it's essential that your set the following localStorage parameters:

// Disables the cryptographic hash verification logic.
localStorage.dd = 1;

There are also various other localStorage parameters that are useful during development:

// Enables vanilla console logging.
localStorage.d = 1;
// Enables full console logging via MegaLogger.
localStorage.minLogLevel = 0;
// Allows you to disable the context menu in the FM for element inspection.
localStorage.contextmenu = 1;

Local webclient setup instructions for Ubuntu (for MEGAchat see INSTALL.md)

  1. Install Apache2:

    sudo apt-get install apache2
  2. Create a new virtual host configuration file and edit it:

    sudo nano /etc/apache2/sites-available/webclient.conf
  3. Add the following and save the file:

<VirtualHost *:80>
    ServerName webclient.local
    ServerAdmin webmaster@webclient.local
    DocumentRoot /var/www/html/webclient.local
    ErrorLog /var/log/apache2/webclient.local.error.log
    CustomLog /var/log/apache2/webclient.local.access.log combined
    LogLevel warn

    <Directory "/var/www/html/webclient.local">
        AllowOverride All
    </Directory>
</VirtualHost>
  1. Enable the config, also the rewrite and headers modules:

    sudo a2ensite webclient.conf
    sudo a2enmod rewrite
  2. Edit the hosts file:

    sudo nano /etc/hosts
  3. Add the following and save the file:

    127.0.0.1       webclient.local
  4. Restart the web server:

    sudo systemctl restart apache2
  5. Clone the repository:

    cd /var/www/html/
    git clone git@code.developers.mega.co.nz:web/webclient.git webclient.local
  6. Set permissions:

    sudo chgrp -R www-data /var/www/html/
    sudo chown -R <your-username> /var/www/html/
  7. Pull language files:

    /var/www/html/webclient.local/scripts/lang.sh
  8. Visit http://webclient.local in your browser.

Directories

Our JavaScript Files

Vendor JavaScript Files

See js/vendor/README.md for more.