diff --git a/controller/Session.class.php b/controller/Session.class.php
index fdb944d2..a0885bd6 100644
--- a/controller/Session.class.php
+++ b/controller/Session.class.php
@@ -4,8 +4,6 @@ class Session
{
const KEY_DOWNLOAD_ACCESS_ERROR = 'download_error2',
KEY_DOWNLOAD_ALLOWED = 'beta_download_allowed2',
- KEY_PREFINERY_USER_ID = 'prefinery_user_id',
- KEY_PREFINER_USED_CUSTOM_CODE = 'prefinery_used_custom_code',
KEY_DEVELOPER_LAST_FORM = 'developer_last_form',
KEY_DEVELOPER_CREDITS_ERROR = 'developer_credits_error',
KEY_DEVELOPER_CREDITS_WALLET_ADDRESS = 'developer_credits_wallet_address',
diff --git a/controller/action/DownloadActions.class.php b/controller/action/DownloadActions.class.php
index b6359abd..e97f7389 100644
--- a/controller/action/DownloadActions.class.php
+++ b/controller/action/DownloadActions.class.php
@@ -28,58 +28,16 @@ class DownloadActions extends Actions
public static function executeGet()
{
- $email = static::getEmailParam();
- $user = [];
-
- if ($email)
- {
- if (filter_var($email, FILTER_VALIDATE_EMAIL))
- {
- $user = Prefinery::findUser($email);
- }
-
- if (!$user)
- {
- Session::unsetKey(Session::KEY_PREFINERY_USER_ID);
- Session::unsetKey(Session::KEY_DOWNLOAD_ALLOWED);
- }
- }
- elseif (Session::get(Session::KEY_PREFINERY_USER_ID))
- {
- try
- {
- $user = Prefinery::findUser(Session::get(Session::KEY_PREFINERY_USER_ID));
- }
- catch (PrefineryException $e)
- {
- if (stripos($e->getMessage(), 'Tester is hidden.') === false)
- {
- throw $e;
- }
- }
- }
-
- if ($user)
- {
- static::setSessionVarsForPrefineryUser($user);
- }
-
- if (!Session::get(Session::KEY_DOWNLOAD_ALLOWED))
- {
- return ['download/get'];
- }
-
$osChoices = OS::getAll();
$os = static::guessOs();
if ($os && isset($osChoices[$os]))
{
list($uri, $osTitle, $osIcon, $partial) = $osChoices[$os];
- return ['download/getAllowed', [
+ return ['download/get', [
'os' => $os,
'osTitle' => $osTitle,
'osIcon' => $osIcon,
- 'prefineryUser' => $user ?: [],
'downloadHtml' => View::exists('download/' . $partial) ?
View::render('download/' . $partial, ['downloadUrl' => Github::getAppDownloadUrl($os)]) :
false
@@ -93,7 +51,6 @@ class DownloadActions extends Actions
public static function executeSignup()
{
$email = Request::getParam('email');
- $code = Request::getParam('code');
if (!$email || !filter_var($email, FILTER_VALIDATE_EMAIL))
{
@@ -101,39 +58,10 @@ class DownloadActions extends Actions
}
else
{
- $referrerId = Request::getParam('referrer_id');
- $failure = false;
Mailgun::sendSubscriptionConfirmation($email);
-
- try
- {
- $user = Prefinery::findOrCreateUser($email, $code, $referrerId);
- static::setSessionVarsForPrefineryUser($user);
- if ($code && strlen($code) > 2 && in_array(substr($code, 0, 2), ['my', 'pf', 'sl']))
- {
- Session::set(Session::KEY_PREFINER_USED_CUSTOM_CODE, true);
- }
- }
- catch (CurlException $e)
- {
- $failure = true;
- Slack::sendErrorIfProd($e);
- }
- catch (PrefineryException $e)
- {
- $failure = true;
- }
-
- if ($failure)
- {
- Session::set(Session::KEY_DOWNLOAD_ALLOWED, false);
- Session::set(Session::KEY_DOWNLOAD_ACCESS_ERROR,
- 'We were unable to add you to the wait list. Received error "' . $e->getMessage() . '". Please contact ' .
- Config::HELP_CONTACT_EMAIL . ' if you think this is a mistake.');
- }
}
- return Controller::redirect('/get');
+ return Controller::redirect(Request::getReferrer('/get'));
}
public static function prepareListPartial(array $vars)
@@ -148,39 +76,6 @@ class DownloadActions extends Actions
{
return $vars + [
'defaultEmail' => static::getEmailParam(),
- 'allowInviteCode' => true,
- 'referralCode' => Request::getParam('r', '')
- ];
- }
-
- protected static function setSessionVarsForPrefineryUser($userData)
- {
- Session::set(Session::KEY_DOWNLOAD_ALLOWED, in_array($userData['status'], [Prefinery::STATE_ACTIVE, Prefinery::STATE_INVITED]));
- Session::set(Session::KEY_PREFINERY_USER_ID, (int)$userData['id']);
- }
-
- public static function prepareReferPartial(array $vars)
- {
- $userId = (int)Session::get(Session::KEY_PREFINERY_USER_ID);
- if (!$userId)
- {
- return null;
- }
-
- $prefineryUser = Prefinery::findUser($userId);
-
- if ($prefineryUser)
- {
- preg_match('/\?r\=(\w+)/', $prefineryUser['share_link'], $matches);
- }
- else
- {
- $matches = null;
- }
-
- return $vars + [
- 'prefineryUser' => $prefineryUser,
- 'referralCode' => $matches[1] ?? 'unknown'
];
}
diff --git a/data/i18n/en.yaml b/data/i18n/en.yaml
index b847f5d9..8f5dbda5 100644
--- a/data/i18n/en.yaml
+++ b/data/i18n/en.yaml
@@ -15,9 +15,8 @@ bounty:
completed_notice: This bounty has already been completed and can no longer be claimed.
pull_request_link: View the Pull Request
description:
- allowed: Download/install the latest version of LBRY for %os%.
faq: Frequently asked questions about LBRY.
- get: Download/install the latest version of LBRY.
+ get: Experience content freedom! Download the latest version of LBRY for Windows, mac OS, or Linux.
home: Meet LBRY, a content sharing and publishing platform that is decentralized and owned by its users.
join: Follow along and receive updates about LBRY via email.
learn: Learn more about LBRY, the technology that puts you back in control of the internet.
@@ -29,10 +28,10 @@ description:
test: WHAT WHAT
what: Access information and content in ways you never dreamed possible. Earn credits for your unused bandwidth and diskspace.
download:
- beta: This is still a beta.
+ beta: This software is in beta.
creator: Creator? Skip the Line
credits: Claim Credits
- curse: While LBRY is now live, it may crash, work unreliably, or inadvertently put a curse on your family for generations (a common programming error). Use at your own risk.
+ curse: It may crash, work unreliably, or inadvertently put a curse on your family for generations (a common programming error).
deb: Download .deb
earn1: Earn
# this many credits
@@ -43,11 +42,11 @@ download:
for-os: LBRY for %os%
github: Or, view the source and compile instructions on
osx: Arrival is expected by July 5.
- osx2: Download for OS X
+ osx2: Download for macOS
other: Other Systems
popular: Popular publishers can earn $1,000 and early access for publishing via LBRY.
select: Select an OS
- unavailable: LBRY is not yet out on your platform. You will receive an email as we expand LBRY to your preferred platform.
+ unavailable: LBRY is not yet out on this platform, but will be soon. Enter your email to be notified when it is released.
verb: Download
windows: Download for Windows
works: "Works with Ubuntu, Debian, or any distro with apt
or dpkg
."
@@ -79,7 +78,6 @@ global:
sentence: Watch, read and play in a decentralized digital library controlled by the community.
tagline: Content Freedom
learn:
- 100: LBRY in 100 Seconds
art: Art in the Internet Age
essay: Read the Essay
exchange_faq: Buy/Sell LBRY Credits
@@ -237,8 +235,8 @@ social:
github: GitHub (source code)
header: Build With Us
humansheader: Humans
- humanstext: Let's create a freer, more creative world.
- robotsheader: Wanna Be Robots
+ humanstext: Join the LBRY community.
+ robotsheader: Robots
robotstext: Make with us. All LBRY code is open source.
slack: Slack (chat)
tweets: Tweets by @LBRYio
diff --git a/lib/thirdparty/Prefinery.class.php b/lib/thirdparty/Prefinery.class.php
deleted file mode 100644
index 91c1215d..00000000
--- a/lib/thirdparty/Prefinery.class.php
+++ /dev/null
@@ -1,189 +0,0 @@
- [
- 'Accept: application/json',
- 'Content-type: application/json'
- ],
- 'json_data' => true,
- 'json_response' => true
- ];
-
- public static function findUser($emailOrId, $useApc = true)
- {
- $apcEnabled = Apc::isEnabled();
- if ($useApc && $apcEnabled)
- {
- $cached = apc_fetch('prefinery-user-' . $emailOrId, $success);
- if ($success)
- {
- return $cached;
- }
- }
-
- try
- {
- $user = is_numeric($emailOrId) ? Prefinery::findTesterById($emailOrId) : Prefinery::findTesterByEmail($emailOrId);
- }
- catch (PrefineryException $e)
- {
- if (stripos($e->getMessage(), 'Tester is hidden.') === false)
- {
- throw $e;
- }
- }
-
- if ($user)
- {
- unset($user['invitation_code']); // so we dont leak it
- if ($useApc && $apcEnabled)
- {
- apc_store('prefinery-user-' . $emailOrId, $user, 3600);
- }
- }
-
- return $user;
- }
-
- protected static function findTesterById($id)
- {
- return static::get('/testers/' . (int)$id);
- }
-
- protected static function findTesterByEmail($email)
- {
- $data = static::get('/testers', ['email' => $email]);
-
- if ($data && is_array($data) && count($data))
- {
- foreach ($data as $userData) //can partial match on email, very unlikely though
- {
- if (strtolower($userData['email']) == strtolower($email))
- {
- return $userData;
- }
- }
- return $data[0];
- }
-
- return null;
- }
-
- public static function findOrCreateUser($email, $inviteCode = null, $referrerId = null)
- {
- $user = static::findUser($email);
- if (!$user)
- {
- // dont record ip for lbry.io addresses, for testing
- $ip = !preg_match('/@lbry\.io$/', $email) ? Request::getOriginalIp() : null;
- $ua = Request::getUserAgent();
- $user = Prefinery::createTester(array_filter([
- 'email' => $email,
- 'status' => $inviteCode ? static::STATE_ACTIVE : static::STATE_APPLIED, # yes, has to be ACTIVE to validate invite code
- 'invitation_code' => $inviteCode,
- 'referrer_id' => $referrerId,
- 'profile' => ['ip' => $ip, 'user_agent' => $ua]
- ]));
-
-// if ($inviteCode)
-// {
-// $user = static::updateTester(array_intersect_key($user, ['id' => null]) + ['status' => static::STATE_ACTIVE]);
-// if ($user['invitation_code'] != $inviteCode)
-// {
-// $user['is_custom_code'] = true;
-// }
-// }
-
- $user['is_custom_code'] = false;
- }
-
-// unset($user['invitation_code']); // so we dont leak it
- return $user;
- }
-
- protected static function createTester(array $testerData)
- {
- return static::post('/testers', ['tester' => array_filter($testerData)], false);
- }
-
- public static function updateTester(array $testerData)
- {
- if (!$testerData['id'])
- {
- throw new PrefineryException('Update tester must be called with a tester id');
- }
- if (Apc::isEnabled())
- {
- apc_delete('prefinery-user-' . $testerData['id']);
- }
- return static::put('/testers/' . $testerData['id'], ['tester' => array_diff_key(array_filter($testerData), ['id' => null])], false);
- }
-
- protected static function put($endpoint, array $data = [])
- {
- $apiKey = Config::get('prefinery_key');
- $options = static::$curlOptions;
- $options['headers'][] = 'X-HTTP-Method-Override: PUT';
- return static::decodePrefineryResponse(
- Curl::put(static::DOMAIN . static::PREFIX . $endpoint . '.json?api_key=' . $apiKey, $data, $options)
- );
- }
-
- protected static function get($endpoint, array $data = [])
- {
- return static::decodePrefineryResponse(
- Curl::get(static::DOMAIN . static::PREFIX . $endpoint . '.json?api_key=' . Config::get('prefinery_key'),
- $data, array_merge(static::$curlOptions, ['retry' => 3])
- )
- );
- }
-
- protected static function post($endpoint, array $data = [], bool $allowEmptyResponse = true)
- {
- return static::decodePrefineryResponse(
- Curl::post(static::DOMAIN . static::PREFIX . $endpoint . '.json?api_key=' . Config::get('prefinery_key'),
- $data, array_merge(static::$curlOptions, ['retry' => 3])
- ),
- $allowEmptyResponse
- );
- }
-
- protected static function decodePrefineryResponse($data, $allowEmptyResponse = true)
- {
- if (!$allowEmptyResponse && !$data && $data !== [])
- {
- throw new PrefineryException('Received empty or improperly encoded response.');
- }
-
- if (isset($data['error']))
- {
- throw new PrefineryException($data['error']);
- }
-
- if (isset($data['errors']))
- {
- throw new PrefineryException($data['errors'] ?
- implode("\n", array_map(function ($error) { return $error['message']; }, (array)$data['errors'])) :
- 'Received empty error array.'
- );
- }
-
- return $data;
- }
-}
-
-class PrefineryException extends Exception
-{
-}
diff --git a/lib/tools/OS.class.php b/lib/tools/OS.class.php
index ce00a676..ff88e877 100644
--- a/lib/tools/OS.class.php
+++ b/lib/tools/OS.class.php
@@ -14,7 +14,7 @@ class OS
//yes, this is probably a bad pattern
return [
OS::OS_WINDOWS => ['/windows', 'Windows', 'icon-windows', '_windows'],
- OS::OS_OSX => ['/osx', 'OS X', 'icon-apple', '_osx'],
+ OS::OS_OSX => ['/osx', 'macOS', 'icon-apple', '_osx'],
OS::OS_LINUX => ['/linux', 'Linux', 'icon-linux', '_linux'],
OS::OS_ANDROID => ['/android', 'Android', 'icon-android', '_android'],
OS::OS_IOS => ['/ios', 'iOS', 'icon-mobile', '_ios']
diff --git a/view/template/developer/_quickstartApi.php b/view/template/developer/_quickstartApi.php
index 2171dc10..1f65000b 100644
--- a/view/template/developer/_quickstartApi.php
+++ b/view/template/developer/_quickstartApi.php
@@ -3,7 +3,7 @@
When running, the LBRY daemon provides a JSON-RPC server running at http://localhost:5279/lbryapi
.
- It can be accessed by any utility capable of making HTTPS GET and POST requests, such as cURL or possibly your toaster. Psst, if you are on windows you could use PowerShell while testing, scroll down to the bottom of this page to get more info. + It can be accessed by any utility capable of making HTTPS GET and POST requests, such as cURL or possibly your toaster. On Windows? You can also use PowerShell. Learn more.
To verify the LBRY daemon is running correctly, let's try looking up a URI: @@ -54,12 +54,12 @@
You can also list all of the commands available by calling the help command.
$curl 'http://localhost:5279/lbryapi' --data '{"method":"help"}'
-If you are running Windows and would like to follow this guide you could substitute curl with a PowerShell console and the following code.
$Invoke-RestMethod -Uri 'http://localhost:5279/lbryapi' -Body 'THE_JSON_DATA' -Method POST | ConvertTo-Json
-If PowerShell does not work and you want to continue with cURL, you'll need to escape inner double quotes with a \ to pass the JSON properly via Command Prompt. +
If PowerShell does not work and you want to continue with cURL, you'll need to escape inner double quotes with a \ to pass the JSON properly via Command Prompt.
$curl "http://localhost:5279/lbryapi" --data "{\"method\":\"get\",\"params\":{\"uri\":\"what\"} }"
diff --git a/view/template/download/_betaNotice.php b/view/template/download/_betaNotice.php
deleted file mode 100644
index 6cbdc9c1..00000000
--- a/view/template/download/_betaNotice.php
+++ /dev/null
@@ -1,4 +0,0 @@
-- {{download.beta}} - {{download.curse}} -
\ No newline at end of file diff --git a/view/template/download/_linux.php b/view/template/download/_linux.php index 23589ce8..bb3034e2 100644 --- a/view/template/download/_linux.php +++ b/view/template/download/_linux.php @@ -1,19 +1,18 @@- - href="" + + href="" data-analytics-category="Sign Up" data-analytics-action="Download" data-analytics-label="Linux" - */ ?> >{{download.deb}}
- - href="" + + href="" data-analytics-category="Sign Up" data-analytics-action="Download" data-analytics-label="OSX" - */ ?> >{{download.osx2}}
Developers and other technical users can try LBRY before it goes public.
- Developer Program -{{page.refer.earn1}} '2017-06-19' ? 2.5 : 5)) ?> {{page.refer.earn2}}
-- - - $('#referral-url-input') - .focus(function() { $(this).select(); }) - .click(function() { $(this).select(); }); - -
-$prefineryUser['share_signups_count']]) ?> - - -
- diff --git a/view/template/download/_signup.php b/view/template/download/_signup.php index ab096395..c7e46f25 100644 --- a/view/template/download/_signup.php +++ b/view/template/download/_signup.php @@ -1,7 +1,8 @@ -