Hello Vlad,
the kepub issue is in my opinion not completely solved. If you only want to rename a kepub to kepub.epub and leave normal epubs as they are, you need an extra statement in config_local.php.
I am not an expert in this but te statement could look something like this:
*
     * Rename .kepub to .kepub.epub if downloaded from a Kobo eReader
     * The ebook will then be recognized a Kepub so with chaptered paging, stat$
     * You have to enable URL rewriting if you want to enable kepup.epub downlo$
     * 1 : Yes (enable)
     * 0 : No
     */
    $config['cops_provide_kepub.epub'] = "1";
Is it possible that you can solve this?
By the way, I am using a readynas Duo and could only download epubs on my Glo when I changed in .htaccess the RewriteRule(s) with the complete path to fetch.php:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^download/(\d*)/(\d*)/.*\.kepub\.epub$ /webroot/cops/fetch.php?data=&db=&type=epub [L]
RewriteRule ^download/(\d*)/(\d*)/.*\.(.*)$ /webroot/cops/fetch.php?data=&db=&type= [L]
RewriteRule ^download/(\d*)/.*\.kepub\.epub$ /webroot/cops/fetch.php?data=&type=epub [L]
RewriteRule ^download/(\d*)/.*\.(.*)$ /webroot/cops/fetch.php?data=&type= [L]
</IfModule>
Further my compliments for all the good work! 
