I rejoined the Folding@Home community due to the Corona pandemic and own 3 Ubuntu Servers in total where i run the fahclients.
It gets sometime annoying to manage them via remote: the web-allow configuration has to be adjusted everytime my home router ip adress gets changes (every 24h) ...
I havent found any other convinient solutions to address this issue (probably there are some, however i couldnt find them in the documentation ...) so i come out with my own "quick and dirty" solution by simply pass the web control interface via proxy_pass of the nginx http server (analogous approach with apache):
1. Setup the fahclient according to the documantation.
2. Install nginx server on your Linux machine (code example here with ubuntu):
Code: Select all
sudo apt update
sudo apt install nginx
4. Open the fahclient config.xml file with editor of your choice:
Code: Select all
sudo nano /etc/fahclient/config.xml
Code: Select all
<allow v='127.0.0.1'/>
<web-allow v='127.0.0.1'/>
Code: Select all
<config>
<!-- Folding Slot Configuration -->
<gpu v='false'/>
<!-- HTTP Server -->
<allow v='127.0.0.1'/>
<!-- Slot Control -->
<power v='FULL'/>
<!-- User Information -->
<passkey v='somekey'/>
<team v='0'/>
<user v='someone'/>
<!-- Web Server -->
<web-allow v='127.0.0.1'/>
<!-- Folding Slots -->
<slot id='0' type='CPU'/>
</config>
Code: Select all
sudo nano /etc/nginx/sites-available/default
Code: Select all
location /foldingathome/ {
proxy_pass http://127.0.0.1:7396/;
}
...so it looks similar to this:
Code: Select all
server {
listen 80 default_server;
listen [::]:80 default_server;
# SSL configuration
#
# listen 443 ssl default_server;
# listen [::]:443 ssl default_server;
#
# Note: You should disable gzip for SSL traffic.
# See: https://bugs.debian.org/773332
#
# Read up on ssl_ciphers to ensure a secure configuration.
# See: https://bugs.debian.org/765782
#
# Self signed certs generated by the ssl-cert package
# Don't use them in a production server!
#
# include snippets/snakeoil.conf;
root /var/www/html;
# Add index.php to the list if you are using PHP
index index.html index.htm index.nginx-debian.html;
server_name _;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
}
# FAH proxy pass
location /foldingathome/ {
proxy_pass http://127.0.0.1:7396/;
}
# pass PHP scripts to FastCGI server
#
#location ~ \.php$ {
# include snippets/fastcgi-php.conf;
#
# # With php-fpm (or other unix sockets):
# fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
# # With php-cgi (or other tcp sockets):
# fastcgi_pass 127.0.0.1:9000;
#}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}
To enable this you have to setup ssl in nginx first (follow the documentation)
8. Restart both the fahclient and the nginx server:
Code: Select all
sudo /etc/init.d/FAHClient restart
service nginx restart
Code: Select all
http://youripadress/foldingathome/
PS. If someone has a better solution (also in terms of security) please let me know!