diff --git a/README.md b/README.md new file mode 100644 index 00000000..314d2619 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# lbry.io + +The [lbry.io](https://lbry.io) website diff --git a/controller/Controller.class.php b/controller/Controller.class.php index 24f77820..62da1fe2 100644 --- a/controller/Controller.class.php +++ b/controller/Controller.class.php @@ -13,7 +13,18 @@ class Controller $viewParameters = isset($viewAndParams[1]) ? $viewAndParams[1] : []; $headers = isset($viewAndParams[2]) ? $viewAndParams[2] : []; - static::sendHeaders($headers); + $defaultHeaders = [ + 'Content-Security-Policy' => "frame-ancestors 'none'", + 'X-Frame-Options' => 'DENY', + 'X-XSS-Protection'=> '1', + ]; + + if (IS_PRODUCTION) + { + $defaultHeaders['Strict-Transport-Security'] = 'max-age=31536000'; + } + + static::sendHeaders(array_merge($defaultHeaders, $headers)); if ($viewTemplate === null) { diff --git a/controller/Session.class.php b/controller/Session.class.php index 711895a1..bebd861b 100644 --- a/controller/Session.class.php +++ b/controller/Session.class.php @@ -18,7 +18,10 @@ class Session public static function init() { - session_start(); + session_start([ + 'cookie_secure' => IS_PRODUCTION, // cookie over ssl only + 'cookie_httponly' => true, // no js access + ]); } public static function get($key, $default = null) diff --git a/controller/action/DownloadActions.class.php b/controller/action/DownloadActions.class.php index e0a518de..a7829452 100644 --- a/controller/action/DownloadActions.class.php +++ b/controller/action/DownloadActions.class.php @@ -76,7 +76,7 @@ class DownloadActions extends Actions if (!$email || !filter_var($email, FILTER_VALIDATE_EMAIL)) { - Session::set(Session::KEY_DOWNLOAD_ACCESS_ERROR, 'Please provide a valid email. You provided: ' . $email); + Session::set(Session::KEY_DOWNLOAD_ACCESS_ERROR, 'Please provide a valid email. You provided: ' . htmlspecialchars($email)); } else { diff --git a/lib/tools/Prefinery.class.php b/lib/tools/Prefinery.class.php index dff70648..3d7eb6b9 100644 --- a/lib/tools/Prefinery.class.php +++ b/lib/tools/Prefinery.class.php @@ -60,12 +60,15 @@ class Prefinery $user = static::findUser($email); if (!$user) { + // dont record ip for lbry.io addresses, for testing + $ip = isset($_SERVER['REMOTE_ADDR']) && !preg_match('/@lbry\.io$/', $email) ? $_SERVER['REMOTE_ADDR'] : null; + $ua = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : null; $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' => $_SERVER['REMOTE_ADDR'], 'user_agent' => $_SERVER['HTTP_USER_AGENT']] + 'profile' => ['ip' => $ip, 'user_agent' => $ua] ])); } @@ -128,4 +131,4 @@ class Prefinery class PrefineryException extends Exception { -} \ No newline at end of file +} diff --git a/posts/faq/block-rewards.md b/posts/faq/block-rewards.md index 026b383d..b06b38ae 100644 --- a/posts/faq/block-rewards.md +++ b/posts/faq/block-rewards.md @@ -13,7 +13,7 @@ The source code, and not this file, is the only true definiton of the block rewa Eventually 1,000,000,000 LBRY credits will exist. They are awarded on the following schedule: -* The genesis block creates 400,000,000 credits to be administered by LBRY, Inc. 300,000,000 of these will be given away to the public. +* The genesis block creates 400,000,000 credits to be administered by LBRY, Inc. 300,000,000 of these will be strategically allocated to partners, many of whom have a direct interest in the naming layer. It also includes 100,000,000 earmarked for charity. Additionally, some may be given directly to the public in ways that add value and make sense. 100,000,000 are owned by LBRY directly. * The remaining 600,000,000 are mined in 3 stages: diff --git a/posts/faq/how-to-check-hashrate.md b/posts/faq/how-to-check-hashrate.md index df3111e5..073496e4 100644 --- a/posts/faq/how-to-check-hashrate.md +++ b/posts/faq/how-to-check-hashrate.md @@ -3,4 +3,6 @@ title: How do I check my hashrate? category: mining --- -You check your hashrate using `lbrycrd-cli gethashespersec`. +IF GPU mining please use the pool dashboard or local mining client UI. + +If CPU mining, you check your hashrate using `lbrycrd-cli gethashespersec`. diff --git a/posts/faq/mining-credits.md b/posts/faq/mining-credits.md index f9dee7bf..677ae431 100644 --- a/posts/faq/mining-credits.md +++ b/posts/faq/mining-credits.md @@ -2,8 +2,12 @@ title: How do I mine LBRY credits? category: mining --- +Library Credits (LBC) are mined over a 20-year Proof of Work period. +Block rewards increase every 100 blocks by 1LBC, peak at 500, and decline slowly. -LBRY binaries are out for OS X and Ubuntu. Others may try compiling from source. +For GPU mining, please see our list of [pools](https://lbry.io/faq/mining-pools). Each pool has a slightly different setup so please check their Getting Started page. + +For CPU mining, LBRY binaries are out for OS X and Ubuntu. Others may try compiling from source. ## Mining on Ubuntu @@ -24,4 +28,4 @@ LBRY binaries are out for OS X and Ubuntu. Others may try compiling from source. ## Compiling -LBRY can be compiled quite similarly to Bitcoin. Pester @jackrobison on Slack to fill this in! +Join us on [Slack](https://slack.lbry.io) if you need help compiling from source! diff --git a/posts/faq/mining-pools.md b/posts/faq/mining-pools.md index 8ee5669b..b3cda65e 100644 --- a/posts/faq/mining-pools.md +++ b/posts/faq/mining-pools.md @@ -4,6 +4,7 @@ category: mining --- Absolutely. Here are some links to the pools. Each pool will have instructions on how to join and get set up. +While we try to work with reliable pool operators, LBRY does not officially run or endorse any one pool. - [Pool.MN](https://pool.mn/lbry/index.php?page=gettingstarted) - [SuprNova](https://lbry.suprnova.cc/index.php?page=gettingstarted) diff --git a/posts/news/52-day-in-shoes-venezuelan.md b/posts/news/52-day-in-shoes-venezuelan.md new file mode 100644 index 00000000..86527953 --- /dev/null +++ b/posts/news/52-day-in-shoes-venezuelan.md @@ -0,0 +1,113 @@ +--- +author: lbry +title: 'Walking a Day in Venezuelan Shoes' +date: '2016-07-26 00:09:18' +cover: 'venezuela.jpg' +--- +Javier, a young Venezuelan and cryptocurrency advocate, joined [LBRY’s Slack](http://slack.lbry.io/) earlier this month to get access to our beta and learn more about LBRY’s vision. + +He shared with us a brief look into his life in Venezuela, where a socialist government has mismanaged the economy to the point of destruction. The local currency, the Venezuelan bolivar, is forecast to experience [1,600% inflation next year](http://blogs.wsj.com/economics/2016/07/18/venezuelas-inflation-is-set-to-top-1600-next-year/). Inflation will reach almost 500% this year. + +Venezuelans of all income levels are struggling with crippling shortages of food, medicine, and the most basic everyday products. Riots in the streets are almost a daily occurrence. The President has just given [control of the food supply to the military](http://www.wsj.com/articles/venezuelan-president-puts-armed-forces-in-charge-of-new-food-supply-system-1468335415). + +At the time Javier joined us, we had enabled LBRY Credit (LBC) tipping on our Slack channels. Someone sent Javier a small tip, and he responded: + +>”From the deepest corner of my heart, thanks a lot sir. I live in a poor country and I starve everyday. ... I really hope we get a new president this year. I can wait no longer, if hunger or insecurity doesn't kill me, sadness will." + +We asked him to tell us his story and that is what follows, with minor edits for clarity. + +You can help Javier by sending him BTC or LBC: + +**BTC:** 35jRKCLRXjL5j8sJDJJQZHmHkMNa18EVR5 + +**LBC:** bbBNDgX9WDKEWTaGkCi7yDjcaPdRb6GM4L + +**
Earn for each user who joins via this URL:
+Earn for each user who joins via this URL:
diff --git a/view/template/page/publish.php b/view/template/page/publish.php index f9b445be..58a630c6 100644 --- a/view/template/page/publish.php +++ b/view/template/page/publish.php @@ -64,7 +64,7 @@
LBRY uses the ground-breaking innovation of the blockchain to leave no one in control of your content except for you (including us!).
- LBRY is an open-source protocol that is controlled by it's users: we could not change the rules even if wanted to. + LBRY is an open-source protocol that is controlled by it's users: we could not change the rules even if we wanted to.
Update your content at any time. Change the price. Change the title. Publish, unpublish. You and only you can do this in LBRY.
@@ -83,7 +83,7 @@