Mirror or Fork dlux.io

in #dlux3 years ago (edited)

dlux.io is a web based front end for applications served securely through IPFS. As well as a wallet and dex for interacting with the token ecosystem of dlux (and limited HIVE features).

In the interest of decentralization we've been building this site with no real tracking or other features that make a mirror function in any way different. It's generally just a PHP templating site.

Screenshot from 2021-04-07 15-05-50.png

I'm assuming you have root ssh access to an ubuntu server. Here we go:

Install dependencies (sudo may need to be prepended):

apt-get update

apt-get install nginx git snap php php-cli php-fpm php-json php-pdo php-mysql php-zip php-gd php-mbstring php-curl php-xml php-pear php-bcmath composer -y

navigate to a working directory

cd var/www

git clone https://github.com/dluxio/dlux-io.git

cd dlux-io

run composer

composer install && composer update select yes if prompted

Set up nginx

vim /etc/nginx/sites-available/default

server {
        listen 80 default_server;
        listen [::]:80 default_server;

        root /var/www/dlux-io/public;
        index index.php;

        server_name _;
    #server_name dluxmirror.io www.dluxmirror.io;
    
location / {
        try_files $uri $uri/ /index.php?$args;
        }
        location ^~/js{
               alias /var/www/dlux-io/public/js;
}
        location ^~/css{
                alias /var/www/dlux-io/public/css;
}
        location ^~/scss{
                alias /var/www/dlux-io/public/scss;
}
        location ^~/img{
                alias /var/www/dlux-io/public/img;
}
        location ^~/dmxAppConnect{
                alias /var/www/dlux-io/public/dmxAppConnect;
}
        location ^~/ScriptLibrary{
                alias /var/www/dlux-io/public/ScriptLibrary;
}

location ~ \.php$ {
                include snippets/fastcgi-php.conf;
                fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
    # Check php version number if test fails
        }

        #if ($host = dluxmirror.io) {
        #        return 301 https://www.$host$request_uri;
        #}
}
if you know your domain name uncomment and adjust appropriate lines

test the configuration file

nginx -t

reload nginx

service nginx reload

navigate to you server on port 80 - web browser to IP address

adjust your DNS records to point to your server (beyond scope)

install certbot and configure https:

snap install core && snap refresh core

snap install --classic certbot

ln -s /snap/bin/certbot /usr/bin/certbot -move certbot to bin

certbot --nginx --follow instructions

Of course this will work with forks and feel free to add your own branding. I hope everything can remain opensource, but that's up to you.

My next post will talk about how to set up the IPFS gateway to mirror the dApp functionality.