diff --git a/controller/Controller.class.php b/controller/Controller.class.php index f92278ef..98839688 100644 --- a/controller/Controller.class.php +++ b/controller/Controller.class.php @@ -141,7 +141,8 @@ class Controller } } - $router->any('/get/lbry.{ext:c}', 'DownloadActions::executeGetRedirect'); + $router->any('/get/lbry.{ext:c}', 'DownloadActions::executeGetAppRedirect'); + $router->any('/get/lbrynet.{os:c}.zip', 'DownloadActions::executeGetDaemonRedirect'); $router->get([ContentActions::URL_NEWS . '/{slug:c}?', 'news'], 'ContentActions::executeNews'); $router->get([ContentActions::URL_FAQ . '/{slug:c}?', 'faq'], 'ContentActions::executeFaq'); diff --git a/controller/action/DeveloperActions.class.php b/controller/action/DeveloperActions.class.php index 329ee7ef..75190eb2 100644 --- a/controller/action/DeveloperActions.class.php +++ b/controller/action/DeveloperActions.class.php @@ -47,6 +47,16 @@ class DeveloperActions extends Actions ]; } + + public static function prepareQuickstartInstallPartial(array $vars) + { + return $vars + ['versions' => [ + Os::OS_LINUX => Github::getDaemonReleaseProperty(OS::OS_LINUX, 'tag_name'), + Os::OS_OSX => Github::getDaemonReleaseProperty(OS::OS_OSX, 'tag_name'), + Os::OS_WINDOWS => Github::getDaemonReleaseProperty(OS::OS_WINDOWS, 'tag_name'), + ]]; + } + public static function prepareFormNewDeveloperRewardPartial(array $vars) { return $vars + [ diff --git a/controller/action/DownloadActions.class.php b/controller/action/DownloadActions.class.php index a6743b4b..afda9134 100644 --- a/controller/action/DownloadActions.class.php +++ b/controller/action/DownloadActions.class.php @@ -2,27 +2,40 @@ class DownloadActions extends Actions { - public static function executeGetRedirect(string $ext) + public static function executeGetAppRedirect(string $ext) { $uri = null; switch ($ext) { case 'deb': - $uri = GitHub::getDownloadUrl(OS::OS_LINUX); + $uri = GitHub::getAppDownloadUrl(OS::OS_LINUX); break; case 'dmg': - $uri = GitHub::getDownloadUrl(OS::OS_OSX); + $uri = GitHub::getAppDownloadUrl(OS::OS_OSX); break; case 'msi': - $uri = GitHub::getDownloadUrl(OS::OS_WINDOWS); + $uri = GitHub::getAppDownloadUrl(OS::OS_WINDOWS); break; } return Controller::redirect($uri ?: '/get', 302); } + public static function executeGetDaemonRedirect(string $os) + { + $uri = null; + $oses = Os::getAll(); + + if (isset($oses[$os])) + { + $uri = GitHub::getDaemonDownloadUrl($os); + } + + return Controller::redirect($uri ?: '/quickstart', 302); + } + public static function executeGet() { $email = Request::getParam('e'); @@ -68,7 +81,7 @@ class DownloadActions extends Actions 'osIcon' => $osIcon, 'prefineryUser' => $user ?: [], 'downloadHtml' => View::exists('download/' . $partial) ? - View::render('download/' . $partial, ['downloadUrl' => Github::getDownloadUrl($os)]) : + View::render('download/' . $partial, ['downloadUrl' => Github::getAppDownloadUrl($os)]) : false ]]; } diff --git a/lib/thirdparty/Github.class.php b/lib/thirdparty/Github.class.php index 86149032..729e3902 100644 --- a/lib/thirdparty/Github.class.php +++ b/lib/thirdparty/Github.class.php @@ -2,7 +2,7 @@ class Github { - public static function getDownloadUrl($os, $cache = true) + public static function getAppDownloadUrl($os, $cache = true) { if (!in_array($os, array_keys(OS::getAll()))) { @@ -32,6 +32,40 @@ class Github return null; } + public static function getDaemonReleaseProperty($os, $property, $isAssetProperty = false, $cache = true) + { + if (!in_array($os, array_keys(OS::getAll()))) + { + throw new DomainException('Unknown OS'); + } + + try + { + $releaseData = static::get('/repos/lbryio/lbry/releases/latest', $cache); + foreach ($releaseData['assets'] as $asset) + { + if ( + ($os == OS::OS_LINUX && stripos($asset['browser_download_url'], 'linux') !== false) || + ($os == OS::OS_OSX && stripos($asset['browser_download_url'], 'macos') !== false) || + ($os == OS::OS_WINDOWS && strpos($asset['browser_download_url'], 'windows') !== false) + ) + { + return $isAssetProperty ? $asset[$property] : $releaseData[$property]; + } + } + } + catch (Exception $e) + { + } + + return null; + } + + public static function getDaemonDownloadUrl($os, $cache = true) + { + return static::getDaemonReleaseProperty($os, 'browser_download_url', true); + } + public static function get($endpoint, $cache = true) { $twoHoursInSeconds = 7200; diff --git a/view/template/developer/_quickstartApi.php b/view/template/developer/_quickstartApi.php index 0740218a..99f459a6 100644 --- a/view/template/developer/_quickstartApi.php +++ b/view/template/developer/_quickstartApi.php @@ -1,4 +1,4 @@ -

The API

+

API Basics

When running, the LBRY daemon provides a JSON-RPC server running at http://localhost:5279/lbryapi.

@@ -25,7 +25,7 @@ "ver": "0.0.3" } ] - +

First Download

Above, we called the method resolve_name @@ -38,42 +38,18 @@ $curl 'http://localhost:5279/lbryapi' --data '{"method":"get","params":{"name":"what"} }' [ { - "claim_id": "790cd199f4177a1b2045c0f2e5ed922ee4dbce29", - "completed": false, - "download_directory": "/home/lbry/Downloads", - "download_path": "/home/lbry/Downloads/LBRY100.mp4", + //some response fields omitted for brevity + "claim_id": "7b670f0034d0eb119c32acfe8b19ae6622dd218f", //a claim ID is persistent for a piece of content. It stays the same if the original publisher updates the entry. + "download_directory": "/home/kauffj/Downloads", + "download_path": "/home/kauffj/Downloads/LBRY100.mp4", "file_name": "LBRY100.mp4", - "key": "0edc1705489d7a2b2bcad3fea7e5ce92", - "message": "Started LBRY100.mp4, got 3/76 blobs, stream status: running", - "metadata": { - "author": "Samuel Bryan", - "content_type": "video/mp4", - "description": "What is LBRY? An introduction with Alex Tabarrok", - "language": "en", - "license": "LBRY inc", - "nsfw": false, - "sources": { - "lbry_sd_hash": "d5169241150022f996fa7cd6a9a1c421937276a3275eb912790bd07ba7aec1fac5fd45431d226b8fb402691e79aeb24b" - }, - "thumbnail": "https://s3.amazonaws.com/files.lbry.io/logo.png", - "title": "What is LBRY?", - "ver": "0.0.3" - }, - "mime_type": "video/mp4", - "name": "what", - "outpoint": "cbfc821bf6a73f62affd69207119e0da1e438ecfcbc1c69777bf01b16f142d47:0", - "points_paid": 0.0, - "sd_hash": "d5169241150022f996fa7cd6a9a1c421937276a3275eb912790bd07ba7aec1fac5fd45431d226b8fb402691e79aeb24b", - "stopped": false, - "stream_hash": "9f41e37b1ea706d1b431a65f634b89c5aadefb106280da3661e4d565d47bc938a345755cafb2af807bcfc9fbde3306e3", - "stream_name": "LBRY100.mp4", - "suggested_file_name": "LBRY100.mp4", + "metadata": { ... }, //same dictionary as above + "outpoint": "6e224057a9dfa3417bb3890da2c4b4e9d2471641185c6c8b33cb57d61365a4f0:1", //an outpoint is a frozen-in-time pointer to a specific piece of content. It changes if the content changes. "total_bytes": 158433904, - "written_bytes": 0 + "written_bytes": 0 //will increase as the file downloads } -] - - +] +

This file will download in the background to the download_directory specified in the returned data. Subsequent calls to get or file_list will return the status.

The LBRY API consists of about 50 calls, all related to discovering, distributing, and purchasing content. View the full API documentation.

You can also list all of the commands available by calling the help command.

$curl 'http://localhost:5279/lbryapi' --data '{"method":"help"}' diff --git a/view/template/developer/_quickstartCredits.php b/view/template/developer/_quickstartCredits.php index 275b59a3..73d24d59 100644 --- a/view/template/developer/_quickstartCredits.php +++ b/view/template/developer/_quickstartCredits.php @@ -38,9 +38,21 @@

Enjoy a Hollywood Film

It's a Disaster starring David Cross is just one of tens of thousands of great pieces of content available. Check it out!

$curl 'http://localhost:5279/lbryapi' --data '{"method":"get","params":{"name":"itsadisaster"} }' -["d5169241150022f996fa7cd6a9a1c421937276a3275eb912790bd07ba7aec1fac5fd45431d226b8fb402691e79aeb24b"] +[ + { + //some response fields omitted for brevity + "claim_id": "bd970a51249cba542a9acfb130147294a6326ee2", + "download_directory": "/home/kauffj/Downloads", + "download_path": "/home/kauffj/Downloads/It's A Disaster_Feature.mp4", + "metadata": { + "author": "Written and directed by Todd Berger", + "content_type": "video/mp4", + "description": "Four couples meet for Sunday brunch only to discover they are stuck in a house together as the world may be about to end." + } + } +]

Try the UI

-

LBRY comes with a UI so that normal people can use it too. You can download it here.

+

LBRY comes with a fully-featured UI so that normal people can use it too. You can download it here.

You Did It! What's Next?

Start building something awesome! LBRY works as a discovery and distribution backend for everything from films to CAD files. diff --git a/view/template/developer/_quickstartInstall.php b/view/template/developer/_quickstartInstall.php index 38f2f038..48878f8f 100644 --- a/view/template/developer/_quickstartInstall.php +++ b/view/template/developer/_quickstartInstall.php @@ -9,9 +9,9 @@ - Download - Download - Download + Download + Download + Download diff --git a/view/template/nav/_footer.php b/view/template/nav/_footer.php index 0e8e792e..e032a4d8 100644 --- a/view/template/nav/_footer.php +++ b/view/template/nav/_footer.php @@ -4,20 +4,18 @@ -

diff --git a/view/template/nav/_globalItems.php b/view/template/nav/_globalItems.php index c7abb883..8d892dd2 100644 --- a/view/template/nav/_globalItems.php +++ b/view/template/nav/_globalItems.php @@ -1,6 +1,5 @@ __('nav.get'), - '/news' => __('nav.news'), '/learn' => __('nav.learn') ] as $url => $label): ?>
diff --git a/view/template/nav/_header.php b/view/template/nav/_header.php index f6de72a9..7fe71c50 100644 --- a/view/template/nav/_header.php +++ b/view/template/nav/_header.php @@ -2,28 +2,27 @@ false, - 'isAbsolute' => false + 'isAbsolute' => false, + 'isLogoOnly' => false ], EXTR_SKIP) ?>
diff --git a/view/template/page/home.php b/view/template/page/home.php index 7c3d7b33..59b81c02 100644 --- a/view/template/page/home.php +++ b/view/template/page/home.php @@ -41,4 +41,4 @@
- + \ No newline at end of file diff --git a/view/template/page/home2.php b/view/template/page/home2.php new file mode 100644 index 00000000..869d7c82 --- /dev/null +++ b/view/template/page/home2.php @@ -0,0 +1,49 @@ + +
>
+ + + false, 'isLogoOnly' => false]) ?> +
+
+
+
+
+

Content Freedom

+

Watch, read or play what you choose. Earn 100% of the price you decide.

+

You control your data. You own the network. Indeed, you are the network.

+

Find Hollywood films, college lessons, amazing streamers and more on the first open, global, and community-controlled digital bazaar.

+
+
+
+ Join LBRY +
+ +
+
+
+ +
+ +
+
+

+ __('email.go'), 'btnClass' => 'btn-alt']) ?> +
+
+
+ +
+
+ +
*/ ?> +
+
+ +
+ false]) ?> diff --git a/view/template/page/learn.php b/view/template/page/learn.php index 10726f6c..040670ff 100644 --- a/view/template/page/learn.php +++ b/view/template/page/learn.php @@ -17,45 +17,39 @@ -
+
-
-
-
-

{{learn.explore}}

- - - -
-
-

{{learn.nerd}}

-

LBRY is 100% open source in the Bazaar tradition.

- -
+
+

{{learn.explore}}

+ + + +
-
+
-
-
-

-

- -
-
-

{{learn.join}}

- -
-
+

{{learn.nerd}}

+

LBRY is 100% open source in the Bazaar tradition.

+ +
+
+
+
+
+
+

{{learn.join}}

+
diff --git a/view/template/social/_list.php b/view/template/social/_list.php index e48d0ebd..c87e3fc1 100644 --- a/view/template/social/_list.php +++ b/view/template/social/_list.php @@ -1,3 +1,6 @@ +
+ Slack +
diff --git a/view/template/social/_listDev.php b/view/template/social/_listDev.php index 783b7887..42c39962 100644 --- a/view/template/social/_listDev.php +++ b/view/template/social/_listDev.php @@ -4,11 +4,11 @@
*/ ?> diff --git a/web/scss/_basic.scss b/web/scss/_basic.scss index 73bcc505..46bd46f4 100644 --- a/web/scss/_basic.scss +++ b/web/scss/_basic.scss @@ -114,7 +114,7 @@ a:hover img } } -.btn-primary, .btn-alt +.btn-primary, .btn-alt, .btn-link { cursor: pointer; display: inline-block; @@ -129,6 +129,17 @@ a:hover img margin-left: 8px; } } +.btn-link +{ + @include anchor($color-primary); +} +.btn-large +{ + height: $spacing-vertical * 2; + line-height: $spacing-vertical * 2; + font-size: 1.5em; + padding: 0 30px; +} .btn-primary { color: white; diff --git a/web/scss/_content.scss b/web/scss/_content.scss index dbbeb68b..26e2bcb4 100644 --- a/web/scss/_content.scss +++ b/web/scss/_content.scss @@ -45,15 +45,15 @@ &.content-dark { - color: #e8e8e8; + color: $color-content-dark; h1, h2, h3, h4, h5, h6 { color: #fff; } .link-primary { color: $color-light-alt; } - .meta { color: #dddddd; } + .meta { color: $color-meta-dark; } } &:not(.content-dark), &.content-light { - color: #333; + color: $color-content-light; h1, h2, h3, h4, h5, h6 { color: $color-text-dark; @@ -174,7 +174,6 @@ margin-left: auto; margin-right: auto; } - } .content-inset { diff --git a/web/scss/_global.scss b/web/scss/_global.scss index d3959b3c..61f7de2c 100644 --- a/web/scss/_global.scss +++ b/web/scss/_global.scss @@ -8,6 +8,9 @@ $color-text-dark: #000; $color-money: #216C2A; $color-meta-light: #505050; $color-meta-lighter: #999999; +$color-meta-dark: #dddddd; +$color-content-light: #333333; +$color-content-dark: #e8e8e8; $color-info-bg: #3a779d; $font-size: 16px; diff --git a/web/scss/_header.scss b/web/scss/_header.scss index 9329d14a..aa6e1126 100644 --- a/web/scss/_header.scss +++ b/web/scss/_header.scss @@ -1,6 +1,7 @@ @import "global"; -$color-nav-border: #ddd; +$color-nav-border-light: #ddd; +$color-nav-border-dark: #ddd; .header { @@ -41,7 +42,7 @@ $color-nav-border: #ddd; .header-light { color: $color-text-dark; - border-bottom: 1px $color-nav-border solid; + border-bottom: 1px $color-nav-border-light solid; background-color: white; .logo-light { display: none; } } @@ -119,11 +120,24 @@ $color-nav-border: #ddd; text-align: center; font-size: 0.8em; line-height: $spacing-vertical * 2; - color: #666; - border-top: 1px $color-nav-border solid; - border-bottom: 1px $color-nav-border solid; padding: $spacing-vertical / 2 0; @include jumpingScrollbarFix(); + img + { + display: block; + margin-left: auto; + margin-right: auto; + } +} +.footer-standard--light +{ + color: $color-content-light; + border-top: 1px $color-nav-border-light solid; + border-bottom: 1px $color-nav-border-light solid; +} +.footer-standard--dark +{ + color: $color-content-dark; } .footer-img-link {