解決unRaid中的APP市場(應用商店)打開失敗的問題


在UNRAID命令行中輸入 cd /usr/local/emhttp/plugins/community.applications/include

按回車,然后再輸入 ls

按回車,在顯示的文件列表中,可以找到 paths.php 這個文件

接下來,我們要修改這個文件的內容

繼續再命令行輸入 cp paths.php paths_bak.php

按回車,目的是給這個文件復制一下,做個備份

然后輸入 vi paths.php

再按Shift + :  然后輸入 %d

按回車,會發現 paths.php 這個文件的內容被我們清空了

然后按i,粘貼以下內容進去:

<?PHP
###############################################################
#                                                             #
# Community Applications copyright 2015-2021, Andrew Zawadzki #
#                   Licenced under GPLv2                      #
#                                                             #
###############################################################

$CA = "community.applications";

$caPaths['tempFiles']                           = "/tmp/$CA/tempFiles";                            /* path to temporary files */
$caPaths['flashDrive']                          = "/boot/config/plugins/$CA";
$caPaths['templates-community']                 = $caPaths['tempFiles']."/templates-community-apps";           /* templates and temporary files stored here.  Deleted every update of applications */
$caPaths['community-templates-url']             = "https://cdn.jsdelivr.net/gh/Squidly271/Community-Applications-Moderators@master/Repositories.json";
$caPaths['PublicServiceAnnouncement']           = "https://cdn.jsdelivr.net/gh/Squidly271/Community-Applications-Moderators@master/PublicServiceAnnouncement.txt";
$caPaths['community-templates-info']            = $caPaths['tempFiles']."/templates.json";                     /* json file containing all of the templates */
$caPaths['community-templates-displayed']       = $caPaths['tempFiles']."/displayed.json";                     /* json file containing all of the templates currently displayed */
$caPaths['community-templates-allSearchResults']= $caPaths['tempFiles']."/allSearchResults.json";
$caPaths['community-templates-catSearchResults']= $caPaths['tempFiles']."/catSearchResults.json";
$caPaths['startupDisplayed']                    = $caPaths['tempFiles']."/startupDisplayed";
$caPaths['repositoriesDisplayed']               = $caPaths['tempFiles']."/repositoriesDisplayed.json";
$caPaths['application-feed']                    = "https://cdn.jsdelivr.net/gh/Squidly271/AppFeed@master/applicationFeed.json";
$caPaths['application-feed-last-updated']       = "https://cdn.jsdelivr.net/gh/Squidly271/AppFeed@master/applicationFeed-lastUpdated.json";
$caPaths['application-feedBackup']              = "https://raw.staticdn.net/Squidly271/AppFeed/master/applicationFeed.json";
$caPaths['application-feed-last-updatedBackup'] = "https://raw.staticdn.net/Squidly271/AppFeed/master/applicationFeed-lastUpdated.json";
$caPaths['appFeedDownloadError']                = $caPaths['tempFiles']."/downloaderror.txt";
$caPaths['categoryList']                        = $caPaths['tempFiles']."/categoryList.json";
$caPaths['repositoryList']                      = $caPaths['tempFiles']."/repositoryList.json";
$caPaths['sortOrder']                           = $caPaths['tempFiles']."/sortOrder.json";
$caPaths['currentServer']                       = $caPaths['tempFiles']."/currentServer.txt";
$caPaths['lastUpdated']                         = $caPaths['tempFiles']."/lastUpdated.json";
$caPaths['lastUpdated-old']                     = $caPaths['tempFiles']."/lastUpdated-old.json";
$caPaths['addConverted']                        = $caPaths['tempFiles']."/TrippingTheRift";                    /* flag to indicate a rescan needed since a dockerHub container was added */
$caPaths['convertedTemplates']                  = "{$caPaths['flashDrive']}/private/";                        /* path to private repositories on flash drive */
$caPaths['dockerSearchResults']                 = $caPaths['tempFiles']."/docker_search.json";                 /* The displayed docker search results */
$caPaths['dockerfilePage']                      = $caPaths['tempFiles']."/dockerfilePage";                     /* the downloaded webpage to scrape the dockerfile from */
$caPaths['Dockerfile']                          = $caPaths['tempFiles']."/Dockerfile";
$caPaths['moderationURL']                       = "https://raw.staticdn.net/Squidly271/Community-Applications-Moderators/master/Moderation.json";
$caPaths['moderation']                          = $caPaths['tempFiles']."/moderation.json";                    /* json file that has all of the moderation */
$caPaths['unRaidVersion']                       = "/etc/unraid-version";
$caPaths['logos']                               = $caPaths['tempFiles']."/logos.json";
$caPaths['unRaidVars']                          = "/var/local/emhttp/var.ini";
$caPaths['docker_cfg']                          = "/boot/config/docker.cfg";
$caPaths['dockerUpdateStatus']                  = "/var/lib/docker/unraid-update-status.json";
$caPaths['pinnedV2']                            = "{$caPaths['flashDrive']}/pinned_appsV2.json";
$caPaths['appOfTheDay']                         = $caPaths['tempFiles']."/appOfTheDay.json";
$caPaths['statistics']                          = $caPaths['tempFiles']."/statistics.json";
$caPaths['statisticsURL']                       = "https://raw.staticdn.net/Squidly271/AppFeed/master/statistics.json";
$caPaths['pluginSettings']                      = "{$caPaths['flashDrive']}/community.applications.cfg";
$caPaths['fixedTemplates_txt']                  = $caPaths['tempFiles']."/caFixed.txt";
$caPaths['invalidXML_txt']                      = $caPaths['tempFiles']."/invalidxml.txt";
$caPaths['warningAccepted']                     = "{$caPaths['flashDrive']}/accepted";
$caPaths['pluginWarning']                       = "{$caPaths['flashDrive']}/plugins_accepted";
$caPaths['pluginDupes']                         = $caPaths['tempFiles']."/pluginDupes.json";
$caPaths['pluginTempDownload']                  = $caPaths['tempFiles']."/pluginTempFile.plg";
$caPaths['dockerManTemplates']                  = $dockerManPaths['templates-user'];
$caPaths['iconHTTPSbase']                       = "https://raw.staticdn.net/Squidly271/AppFeed/master/https-images/";
$caPaths['disksINI']                            = "/var/local/emhttp/disks.ini";
$caPaths['dynamixSettings']                     = "/boot/config/plugins/dynamix/dynamix.cfg";
$caPaths['installedLanguages']                  = "/boot/config/plugins";
$caPaths['dynamixUpdates']                      = "/tmp/plugins";
$caPaths['LanguageErrors']                      = "https://squidly271.github.io/languageErrors.html";
$caPaths['CA_languageBase']                     = "https://raw.staticdn.net/Squidly271/AppFeed/master/";
$caPaths['CA_logs']                             = "/tmp/CA_logs";
$caPaths['logging']                             = "{$caPaths['CA_logs']}/ca_log.txt";
?>

然后按ESC,輸入:wq,保存文件后APP市場就可以正常使用了。

 

Unraid中也可以用 nano paths.php , 全文替換:nano下的全文替換方式:光標定位到頁首,按command/ctrl + shift + end全選,再按command/ctrl + k剪貼,再復制下面的代碼,按command/ctrl + v粘貼下面的代碼。

 

注意:該配置修改在unraid重啟后會丟失,要想重啟后配置不丟,可以寫個啟動腳本,每次重啟后讓系統自動執行上述修改,方法如下:

重啟后配置不丟的方法

  1. 在應用商店中搜索:CA User Script,並安裝

  2. 在SETTINGS中點擊User Scripts


     
    image.png
  3. 點擊ADD NEW SCRIPT創建一個新的腳本

  4. 腳本名稱隨意

  5. 復制以下內容為作為腳本內容:

  6. #!/bin/bash
    
    # 
    tee /usr/local/emhttp/plugins/community.applications/include/paths.php << 'EOF'
    <?PHP
    ###############################################################
    #                                                             #
    # Community Applications copyright 2015-2021, Andrew Zawadzki #
    #                   Licenced under GPLv2                      #
    #                                                             #
    ###############################################################
    
    $CA = "community.applications";
    
    $caPaths['tempFiles']                           = "/tmp/$CA/tempFiles";                            /* path to temporary files */
    $caPaths['flashDrive']                          = "/boot/config/plugins/$CA";
    $caPaths['templates-community']                 = $caPaths['tempFiles']."/templates-community-apps";           /* templates and temporary files stored here.  Deleted every update of applications */
    $caPaths['community-templates-url']             = "https://cdn.jsdelivr.net/gh/Squidly271/Community-Applications-Moderators@master/Repositories.json";
    $caPaths['PublicServiceAnnouncement']           = "https://cdn.jsdelivr.net/gh/Squidly271/Community-Applications-Moderators@master/PublicServiceAnnouncement.txt";
    $caPaths['community-templates-info']            = $caPaths['tempFiles']."/templates.json";                     /* json file containing all of the templates */
    $caPaths['community-templates-displayed']       = $caPaths['tempFiles']."/displayed.json";                     /* json file containing all of the templates currently displayed */
    $caPaths['community-templates-allSearchResults']= $caPaths['tempFiles']."/allSearchResults.json";
    $caPaths['community-templates-catSearchResults']= $caPaths['tempFiles']."/catSearchResults.json";
    $caPaths['startupDisplayed']                    = $caPaths['tempFiles']."/startupDisplayed";
    $caPaths['repositoriesDisplayed']               = $caPaths['tempFiles']."/repositoriesDisplayed.json";
    $caPaths['application-feed']                    = "https://cdn.jsdelivr.net/gh/Squidly271/AppFeed@master/applicationFeed.json";
    $caPaths['application-feed-last-updated']       = "https://cdn.jsdelivr.net/gh/Squidly271/AppFeed@master/applicationFeed-lastUpdated.json";
    $caPaths['application-feedBackup']              = "https://raw.staticdn.net/Squidly271/AppFeed/master/applicationFeed.json";
    $caPaths['application-feed-last-updatedBackup'] = "https://raw.staticdn.net/Squidly271/AppFeed/master/applicationFeed-lastUpdated.json";
    $caPaths['appFeedDownloadError']                = $caPaths['tempFiles']."/downloaderror.txt";
    $caPaths['categoryList']                        = $caPaths['tempFiles']."/categoryList.json";
    $caPaths['repositoryList']                      = $caPaths['tempFiles']."/repositoryList.json";
    $caPaths['sortOrder']                           = $caPaths['tempFiles']."/sortOrder.json";
    $caPaths['currentServer']                       = $caPaths['tempFiles']."/currentServer.txt";
    $caPaths['lastUpdated']                         = $caPaths['tempFiles']."/lastUpdated.json";
    $caPaths['lastUpdated-old']                     = $caPaths['tempFiles']."/lastUpdated-old.json";
    $caPaths['addConverted']                        = $caPaths['tempFiles']."/TrippingTheRift";                    /* flag to indicate a rescan needed since a dockerHub container was added */
    $caPaths['convertedTemplates']                  = "{$caPaths['flashDrive']}/private/";                        /* path to private repositories on flash drive */
    $caPaths['dockerSearchResults']                 = $caPaths['tempFiles']."/docker_search.json";                 /* The displayed docker search results */
    $caPaths['dockerfilePage']                      = $caPaths['tempFiles']."/dockerfilePage";                     /* the downloaded webpage to scrape the dockerfile from */
    $caPaths['Dockerfile']                          = $caPaths['tempFiles']."/Dockerfile";
    $caPaths['moderationURL']                       = "https://raw.staticdn.net/Squidly271/Community-Applications-Moderators/master/Moderation.json";
    $caPaths['moderation']                          = $caPaths['tempFiles']."/moderation.json";                    /* json file that has all of the moderation */
    $caPaths['unRaidVersion']                       = "/etc/unraid-version";
    $caPaths['logos']                               = $caPaths['tempFiles']."/logos.json";
    $caPaths['unRaidVars']                          = "/var/local/emhttp/var.ini";
    $caPaths['docker_cfg']                          = "/boot/config/docker.cfg";
    $caPaths['dockerUpdateStatus']                  = "/var/lib/docker/unraid-update-status.json";
    $caPaths['pinnedV2']                            = "{$caPaths['flashDrive']}/pinned_appsV2.json";
    $caPaths['appOfTheDay']                         = $caPaths['tempFiles']."/appOfTheDay.json";
    $caPaths['statistics']                          = $caPaths['tempFiles']."/statistics.json";
    $caPaths['statisticsURL']                       = "https://raw.staticdn.net/Squidly271/AppFeed/master/statistics.json";
    $caPaths['pluginSettings']                      = "{$caPaths['flashDrive']}/community.applications.cfg";
    $caPaths['fixedTemplates_txt']                  = $caPaths['tempFiles']."/caFixed.txt";
    $caPaths['invalidXML_txt']                      = $caPaths['tempFiles']."/invalidxml.txt";
    $caPaths['warningAccepted']                     = "{$caPaths['flashDrive']}/accepted";
    $caPaths['pluginWarning']                       = "{$caPaths['flashDrive']}/plugins_accepted";
    $caPaths['pluginDupes']                         = $caPaths['tempFiles']."/pluginDupes.json";
    $caPaths['pluginTempDownload']                  = $caPaths['tempFiles']."/pluginTempFile.plg";
    $caPaths['dockerManTemplates']                  = $dockerManPaths['templates-user'];
    $caPaths['iconHTTPSbase']                       = "https://raw.staticdn.net/Squidly271/AppFeed/master/https-images/";
    $caPaths['disksINI']                            = "/var/local/emhttp/disks.ini";
    $caPaths['dynamixSettings']                     = "/boot/config/plugins/dynamix/dynamix.cfg";
    $caPaths['installedLanguages']                  = "/boot/config/plugins";
    $caPaths['dynamixUpdates']                      = "/tmp/plugins";
    $caPaths['LanguageErrors']                      = "https://squidly271.github.io/languageErrors.html";
    $caPaths['CA_languageBase']                     = "https://raw.staticdn.net/Squidly271/AppFeed/master/";
    $caPaths['CA_logs']                             = "/tmp/CA_logs";
    $caPaths['logging']                             = "{$caPaths['CA_logs']}/ca_log.txt";
    ?>
    EOF
    

      

  1. 點擊SAVE CHANGES

  2. 將該腳本的啟動時間設為:At First Array Start Only

 
 
  1. 點擊APPLY應用上述修改即可。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM