Browse Source

Fix ProcessJobs not working if folder is empty but table isn't

pull/308/head
Chris 6 years ago
parent
commit
e85bc98dcc
  1. 9
      app/Jobs/ProcessApps.php
  2. 5
      app/SupportedApps/Ghost/Ghost.php
  3. 10
      app/SupportedApps/Ghost/app.json
  4. BIN
      app/SupportedApps/Ghost/ghost.png
  5. 5
      app/SupportedApps/MailcowSOGo/MailcowSOGo.php
  6. 10
      app/SupportedApps/MailcowSOGo/app.json
  7. 3
      app/SupportedApps/MailcowSOGo/mailcowsogo.svg
  8. 5
      app/SupportedApps/Mattermost/Mattermost.php
  9. 10
      app/SupportedApps/Mattermost/app.json
  10. BIN
      app/SupportedApps/Mattermost/mattermost.png
  11. 5
      app/SupportedApps/MayanEDMS/MayanEDMS.php
  12. 10
      app/SupportedApps/MayanEDMS/app.json
  13. BIN
      app/SupportedApps/MayanEDMS/mayanedms.png
  14. 45
      app/SupportedApps/Nzbget/Nzbget.php
  15. 5
      app/SupportedApps/Privatebin/Privatebin.php
  16. 10
      app/SupportedApps/Privatebin/app.json
  17. BIN
      app/SupportedApps/Privatebin/privatebin.png
  18. 5
      app/SupportedApps/Rspamd/Rspamd.php
  19. 10
      app/SupportedApps/Rspamd/app.json
  20. BIN
      app/SupportedApps/Rspamd/rspamd.png
  21. 5
      app/SupportedApps/SOGo/SOGo.php
  22. 10
      app/SupportedApps/SOGo/app.json
  23. 11
      app/SupportedApps/SOGo/sogo.svg
  24. 5
      app/SupportedApps/Snibox/Snibox.php
  25. 10
      app/SupportedApps/Snibox/app.json
  26. BIN
      app/SupportedApps/Snibox/snibox.png

9
app/Jobs/ProcessApps.php

@ -34,11 +34,15 @@ class ProcessApps implements ShouldQueue
$localapps = Application::all();
$list = json_decode(SupportedApps::getList()->getBody());
$validapps = [];
foreach($list->apps as $app) {
$validapps[] = $app->appid;
$localapp = $localapps->where('appid', $app->appid)->first();
$application = ($localapp) ? $localapp : new Application;
if(!file_exists(app_path('SupportedApps/'.className($app->name)))) {
SupportedApps::getFiles($app);
$application = new Application;
SupportedApps::saveApp($app, $application);
} else {
// check if there has been an update for this app
@ -46,11 +50,10 @@ class ProcessApps implements ShouldQueue
if($localapp) {
if($localapp->sha !== $app->sha) {
SupportedApps::getFiles($app);
SupportedApps::saveApp($app, $localapp);
SupportedApps::saveApp($app, $application);
}
} else {
SupportedApps::getFiles($app);
$application = new Application;
SupportedApps::saveApp($app, $application);
}

5
app/SupportedApps/Ghost/Ghost.php

@ -0,0 +1,5 @@
<?php namespace App\SupportedApps\Ghost;
class Ghost extends \App\SupportedApps {
}

10
app/SupportedApps/Ghost/app.json

@ -0,0 +1,10 @@
{
"appid": "c4745785181de931cfd5bd79294cb1687d82aea9",
"name": "Ghost",
"website": "https://github.com/tryghost/ghost",
"license": "MIT License",
"description": "Fiercely independent, professional publishing. A fully open source, powerful platform for building and running modern publications, we power serious blogs, magazines and journalism from DuckDuckGo to OpenAI & Sky News.",
"enhanced": false,
"tile_background": "light",
"icon": "ghost.png"
}

BIN
app/SupportedApps/Ghost/ghost.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

5
app/SupportedApps/MailcowSOGo/MailcowSOGo.php

@ -0,0 +1,5 @@
<?php namespace App\SupportedApps\MailcowSOGo;
class MailcowSOGo extends \App\SupportedApps {
}

10
app/SupportedApps/MailcowSOGo/app.json

@ -0,0 +1,10 @@
{
"appid": "1ec48781d2c87a9e6dc9ee99e5eff0ab5958df09",
"name": "Mailcow - SOGo",
"website": "https://sogo.nu/",
"license": "GNU GPL/LGPL v2 and above",
"description": "SOGo is a fully supported and trusted groupware server with a focus on scalability and open standards.\r\n\r\nPart of the Mailcow stack.",
"enhanced": false,
"tile_background": "dark",
"icon": "mailcowsogo.svg"
}

3
app/SupportedApps/MailcowSOGo/mailcowsogo.svg

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 10 KiB

5
app/SupportedApps/Mattermost/Mattermost.php

@ -0,0 +1,5 @@
<?php namespace App\SupportedApps\Mattermost;
class Mattermost extends \App\SupportedApps {
}

10
app/SupportedApps/Mattermost/app.json

@ -0,0 +1,10 @@
{
"appid": "b3e1424fb69ca08481b03ad9d81e95488421997f",
"name": "Mattermost",
"website": "https://mattermost.com/",
"license": "MIT License",
"description": "Mattermost provides high trust collaboration and messaging solutions through an open source, community-powered approach. Enjoy all the productivity benefits of workplace messaging across web, mobile and PC, with unlimited archiving, search and integrations within IT-controlled private environments in public clouds, including AWS and Azure, as well as on-premise in private clouds and virtual or physical servers.",
"enhanced": false,
"tile_background": "light",
"icon": "mattermost.png"
}

BIN
app/SupportedApps/Mattermost/mattermost.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

5
app/SupportedApps/MayanEDMS/MayanEDMS.php

@ -0,0 +1,5 @@
<?php namespace App\SupportedApps\MayanEDMS;
class MayanEDMS extends \App\SupportedApps {
}

10
app/SupportedApps/MayanEDMS/app.json

@ -0,0 +1,10 @@
{
"appid": "6b9e062ff02ea610df64e9b0eca1c973faf1b51d",
"name": "Mayan EDMS",
"website": "https://github.com/tryghost/ghost",
"license": "Apache License 2.0",
"description": "Mayan EDMS is an open-source document management system. Its main purpose is to store, introspect, and categorize files, with a strong emphasis on preserving the contextual and business information of documents. It can also OCR, preview, label, sign, send, and receive thoses files. Other features of interest are its workflow system, role based access control, and REST API.",
"enhanced": false,
"tile_background": "light",
"icon": "mayanedms.png"
}

BIN
app/SupportedApps/MayanEDMS/mayanedms.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

45
app/SupportedApps/Nzbget/Nzbget.php

@ -0,0 +1,45 @@
<?php namespace App\SupportedApps\Nzbget;
class Nzbget extends \App\SupportedApps implements \App\EnhancedApps {
public $config;
public function test()
{
$test = parent::appTest($this->url('status'));
echo $test->status;
}
public function livestats()
{
$status = 'inactive';
$res = parent::execute($this->url('status'));
$details = json_decode($res->getBody());
$data = [];
if($details) {
$size = $details->result->RemainingSizeMB;
$rate = $details->result->DownloadRate;
$data['queue_size'] = format_bytes($size*1000*1000, false, ' <span>', '</span>');
$data['current_speed'] = format_bytes($rate, false, ' <span>');
$status = ($size > 0 || $rate > 0) ? 'active' : 'inactive';
}
return parent::getLiveStats($status, $data);
}
public function url($endpoint)
{
$api_url = parent::normaliseurl($this->config->url);
$username = $this->config->username;
$password = $this->config->password;
$rebuild_url = str_replace('http://', 'http://'.$username.':'.$password.'@', $api_url);
$rebuild_url = str_replace('https://', 'https://'.$username.':'.$password.'@', $rebuild_url);
$rebuild_url = rtrim($rebuild_url, '/');
$api_url = $rebuild_url.'/jsonrpc/'.$endpoint;
return $api_url;
}
}

5
app/SupportedApps/Privatebin/Privatebin.php

@ -0,0 +1,5 @@
<?php namespace App\SupportedApps\Privatebin;
class Privatebin extends \App\SupportedApps {
}

10
app/SupportedApps/Privatebin/app.json

@ -0,0 +1,10 @@
{
"appid": "87ecbead58e42b5ab9e1a92ccc0b42075f4fba91",
"name": "Privatebin",
"website": "https://privatebin.info/",
"license": "zlib/libpng License with Acknowledgement",
"description": "PrivateBin is a minimalist, open source online pastebin where the server has zero knowledge of pasted data.\r\n\r\nData is encrypted and decrypted in the browser using 256bit AES in Galois Counter mode.",
"enhanced": false,
"tile_background": "light",
"icon": "privatebin.png"
}

BIN
app/SupportedApps/Privatebin/privatebin.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

5
app/SupportedApps/Rspamd/Rspamd.php

@ -0,0 +1,5 @@
<?php namespace App\SupportedApps\Rspamd;
class Rspamd extends \App\SupportedApps {
}

10
app/SupportedApps/Rspamd/app.json

@ -0,0 +1,10 @@
{
"appid": "5876529d5d47f91c435d9230576044bc4cad8547",
"name": "Rspamd",
"website": "https://rspamd.com/",
"license": "Apache 2.0",
"description": "Fast, free and open-source spam filtering system.",
"enhanced": false,
"tile_background": "dark",
"icon": "rspamd.png"
}

BIN
app/SupportedApps/Rspamd/rspamd.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

5
app/SupportedApps/SOGo/SOGo.php

@ -0,0 +1,5 @@
<?php namespace App\SupportedApps\SOGo;
class SOGo extends \App\SupportedApps {
}

10
app/SupportedApps/SOGo/app.json

@ -0,0 +1,10 @@
{
"appid": "d143b3a76b72591495655c5257c7523456bdd736",
"name": "SOGo",
"website": "https://sogo.nu/",
"license": "GNU GPL/LGPL v2 and above",
"description": "SOGo is a fully supported and trusted groupware server with a focus on scalability and open standards.",
"enhanced": false,
"tile_background": "light",
"icon": "sogo.svg"
}

11
app/SupportedApps/SOGo/sogo.svg

@ -0,0 +1,11 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="792px" height="464px" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:1.41421;">
<g>
<g>
<g>
<path d="M643.711,144.938C633.849,144.938 626.847,137.721 626.847,128.035C626.847,118.341 633.849,111.123 643.711,111.123C653.65,111.123 660.652,118.341 660.652,128.035C660.652,137.721 653.65,144.938 643.711,144.938ZM643.681,94.5835C624.154,94.5835 610.288,108.861 610.288,128.035C610.288,147.2 624.154,161.478 643.681,161.478C663.335,161.478 677.202,147.2 677.202,128.035C677.202,108.861 663.335,94.5835 643.681,94.5835ZM643.652,178.811C614.019,178.811 592.965,157.13 592.965,128.035C592.965,98.9315 614.019,77.2602 643.652,77.2602C673.48,77.2602 694.525,98.9315 694.525,128.035C694.525,157.13 673.48,178.811 643.652,178.811ZM643.613,58.4876C603.032,58.4876 574.212,88.1791 574.212,128.035C574.212,167.882 603.032,197.564 643.613,197.564C684.458,197.564 713.288,167.882 713.288,128.035C713.288,88.1791 684.458,58.4876 643.613,58.4876ZM157.492,182.836L136.653,177.871C117.684,173.513 108.048,168.538 108.048,154.858C108.048,139.307 123.903,133.079 138.21,133.079C152.752,133.079 163.377,140.345 169.635,151.656C169.654,151.704 169.684,151.753 169.723,151.812C169.85,152.057 169.997,152.292 170.124,152.537L170.154,152.517C172.122,155.494 175.432,157.482 178.997,157.482C185.068,157.482 189.465,153.095 189.465,147.024C189.465,144.703 188.966,142.245 187.879,140.394C177.205,122.248 159.607,114.424 139.454,114.424C112.093,114.424 85.6524,128.104 85.6524,158.266C85.6524,185.95 113.023,194.038 122.972,196.516L142.871,201.187C158.109,204.918 170.546,209.903 170.546,224.504C170.546,241.298 153.134,248.77 136.34,248.77C119.241,248.77 106.579,240.025 97.8541,227.118L97.8443,227.118C95.9054,224.288 92.899,222.3 89.2169,222.3C83.2826,222.3 78.5037,227.177 78.7191,233.102C78.8171,235.52 79.6201,237.567 80.854,239.32C94.5246,259.777 114.296,267.425 136.34,267.425C164.641,267.425 192.942,254.362 192.942,222.643C192.942,202.127 177.704,187.507 157.492,182.836ZM296.617,248.682C263.038,248.682 241.886,223.495 241.886,190.846C241.886,158.187 263.038,133 296.617,133C330.52,133 351.662,158.187 351.662,190.846C351.662,223.495 330.52,248.682 296.617,248.682ZM296.617,114.345C251.531,114.345 219.499,146.994 219.499,190.846C219.499,234.688 251.531,267.337 296.617,267.337C342.016,267.337 374.048,234.688 374.048,190.846C374.048,146.994 342.016,114.345 296.617,114.345ZM514.985,232.818C514.221,233.552 513.448,234.277 512.606,234.972C511.509,235.981 510.236,237.068 508.786,238.155C500.032,244.491 488.976,248.163 476.049,248.163C442.46,248.163 421.318,222.976 421.318,190.327C421.318,157.668 442.46,132.481 476.049,132.481C509.942,132.481 531.084,157.668 531.084,190.327C531.084,207.376 525.316,222.369 514.985,232.818ZM464.797,315.733C467.304,315.733 469.899,315.566 472.592,315.233C477.567,314.607 482.101,314.332 486.204,314.332C505.281,314.44 514.995,319.983 520.851,326.387C526.697,332.831 528.95,341.566 528.94,348.989C528.95,352.544 528.391,355.726 527.774,357.636C524.856,366.488 518.961,372.511 509.932,377.045C500.972,381.491 489.015,383.763 476.51,383.743C472.034,383.743 467.481,383.459 462.986,382.921C454.486,381.941 443.244,378.289 435.096,371.923C430.993,368.751 427.614,364.99 425.235,360.534C422.875,356.059 421.406,350.869 421.396,344.23L421.396,343.495C421.651,331.254 427.272,323.126 433.431,317.221C436.477,314.342 439.611,312.198 441.892,310.836C442.255,310.621 442.597,310.425 442.911,310.249C448.953,313.823 456.454,315.762 464.797,315.733ZM476.049,113.826C430.964,113.826 398.922,146.475 398.922,190.327C398.922,219.96 413.562,244.461 436.976,257.241C436.663,257.554 436.359,257.877 436.066,258.2C430.014,264.83 426.919,273.32 426.909,281.909C426.9,285.698 427.526,289.586 428.868,293.307C425.832,295.246 422.209,297.9 418.497,301.386C409.547,309.72 399.921,323.733 399.637,343.123C399.627,343.573 399.627,343.946 399.627,344.23C399.617,354.218 401.987,363.227 406.031,370.778C412.113,382.147 421.582,390.059 431.355,395.338C441.187,400.626 451.44,403.436 460.381,404.533C465.708,405.17 471.114,405.512 476.51,405.512C491.532,405.493 506.514,402.957 519.549,396.572C532.524,390.285 543.678,379.464 548.496,364.285C549.926,359.771 550.689,354.649 550.709,348.989C550.689,337.492 547.389,323.449 537.058,311.855C526.727,300.221 509.638,292.455 486.204,292.563C481.112,292.563 475.687,292.916 469.919,293.63C468.058,293.856 466.354,293.963 464.797,293.963C457.619,293.915 454.016,291.927 451.871,289.899C449.756,287.833 448.698,285.101 448.669,281.909C448.659,278.657 449.942,275.24 452.106,272.909C454.319,270.598 457.071,269.031 461.869,268.972C462.3,268.972 462.761,268.982 463.231,269.021C466.306,269.237 469.292,269.345 472.191,269.345C496.173,269.393 514.212,261.961 526.482,251.737C538.791,241.514 545.294,229.077 548.369,219.255L548.329,219.245C551.669,210.422 553.48,200.688 553.48,190.327C553.48,146.475 521.448,113.826 476.049,113.826Z" style="fill:rgb(80,189,55);fill-rule:nonzero;"/>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 5.2 KiB

5
app/SupportedApps/Snibox/Snibox.php

@ -0,0 +1,5 @@
<?php namespace App\SupportedApps\Snibox;
class Snibox extends \App\SupportedApps {
}

10
app/SupportedApps/Snibox/app.json

@ -0,0 +1,10 @@
{
"appid": "6c050d5bdf522fa20599560ff0f6b74e7dcd97a8",
"name": "Snibox",
"website": "https://github.com/snibox/snibox",
"license": "MIT License",
"description": "Snibox is a self-hosted, single-user (for now) snippet manager. Developed to collect and organize code snippets. Supports various programming languages, markdown, plain text.",
"enhanced": false,
"tile_background": "dark",
"icon": "snibox.png"
}

BIN
app/SupportedApps/Snibox/snibox.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

Loading…
Cancel
Save