Giter VIP home page Giter VIP logo

condenser's Introduction

Condenser

Condenser is the react.js web interface to the world's first and best blockchain-based social media platform, steemit.com. It uses STEEM, a blockchain powered by DPoS Governance and ChainBase DB to store JSON-based content for a plethora of web applications.

Why would I want to use Condenser (steemit.com front-end)?

  • Learning how to build blockchain-based web applications using STEEM as a content storage mechanism in react.js
  • Reviewing the inner workings of the steemit.com social media platform
  • Assisting with software development for steemit.com

Installation

Docker

We highly recommend using docker to run condenser in production. This is how we run the live steemit.com site and it is the most supported (and fastest) method of both building and running condenser. We will always have the latest version of condenser (master branch) available on Docker Hub. Configuration settings can be set using environment variables (see configuration section below for more information). If you need to install docker, you can get it at https://get.docker.com

To bring up a running container it's as simple as this:

docker run -it -p 8080:8080 steemit/condenser

Environment variables can be added like this:

docker run -it -p 8080:8080 steemit/condenser

If you would like to modify, build, and run condenser using docker, it's as simple as pulling in the github repo and issuing one command to build it, like this:

git clone https://github.com/steemit/condenser
cd condenser
docker build -t="myname/condenser:mybranch" .
docker run -it -p 8080:8080 myname/condenser:mybranch

Building from source without docker (the 'traditional' way):

(better if you're planning to do condenser development)

Clone the repository and make a tmp folder

git clone https://github.com/steemit/condenser
cd condenser
mkdir tmp

Install dependencies

Install at least Node v8.7 if you don't already have it. We recommend using nvm to do this as it's both the simplest way to install and manage installed version(s) of node. If you need nvm, you can get it at https://github.com/creationix/nvm.

Condenser is known to successfully build using node 8.7, npm 5.4.2, and yarn 1.3.2.

Using nvm, you would install like this:

nvm install v8.7

We use the yarn package manager instead of the default npm. There are multiple reasons for this, one being that we have steem-js built from source pulling the github repo as part of the build process and yarn supports this. This way the library that handles keys can be loaded by commit hash instead of a version name and cryptographically verified to be exactly what we expect it to be. Yarn can be installed with npm, but afterwards you will not need to use npm further.

npm install -g yarn
yarn global add babel-cli
yarn install --frozen-lockfile
yarn run build

To run condenser in production mode, run:

yarn run production

When launching condenser in production mode it will automatically use 1 process per available core. You will be able to access the front-end at http://localhost:8080 by default.

To run condenser in development mode, run:

yarn run start

It will take quite a bit longer to start in this mode (~60s) as it needs to build and start the webpack-dev-server.

By default you will be connected to steemit.com's public steem node at wss://steemd.steeemit.com. This is actually on the real blockchain and you would use your regular account name and credentials to login - there is not an official separate testnet at this time. If you intend to run a full-fledged site relying on your own, we recommend looking into running a copy of steemd locally instead https://github.com/steemit/steem.

Debugging SSR code

yarn debug will build a development version of the codebase and then start the local server with --inspect-brk so that you can connect a debugging client. You can use Chromium to connect by finding the remote client at chrome://inspect/#devices.

Configuration

The intention is to configure condenser using environment variables. You can see the names of all of the available configuration environment variables in config/custom-environment-variables.json. Default values are stored in config/defaults.json.

Environment variables using an example like this:

export SDC_CLIENT_STEEMD_URL="wss://steemd.steemit.com"
export SDC_SERVER_STEEMD_URL="wss://steemd.steemit.com"

Keep in mind environment variables only exist in your active session, so if you wish to save them for later use you can put them all in a file and source them in.

If you'd like to statically configure condenser without variables you can edit the settings directly in config/production.json. If you're running in development mode, copy config/production.json to config/dev.json with cp config/production.json config/dev.json and adjust settings in dev.json.

If you're intending to run condenser in a production environment one configuration option that you will definitely want to edit is server_session_secret which can be set by the environment variable SDC_SESSION_SECRETKEY. To generate a new value for this setting, you can do this:

node
> crypto.randomBytes(32).toString('base64')
> .exit

Style Guides For Submitting Pull Requests

File naming and location

  • Prefer CamelCase js and jsx file names
  • Prefer lower case one word directory names
  • Keep stylesheet files close to components
  • Component's stylesheet file name should match component name

Js & Jsx

We use prettier to autofromat the code, with this configuration. Run yarn run fmt to format everything in src/, or yarn exec -- prettier --config .prettierrc --write src/whatever/file.js for a specific file.

CSS & SCSS

If a component requires a css rule, please use its uppercase name for the class, e.g. "Header" class for the header's root div. We adhere to BEM methodology with exception for Foundation classes, here is an example for the Header component:

<!-- Block -->
<ul class="Header">
  ...
  <!-- Element -->
  <li class="Header__menu-item">Menu Item 1</li>
  <!-- Element with modifier -->
  <li class="Header__menu-item--selected">Element with modifier</li>
</ul>

Storybook

yarn run storybook

Testing

Run test suite

yarn test

will run jest

Test endpoints offline

If you want to test a server-side rendered page without using the network, do this:

yarn build
OFFLINE_SSR_TEST=true NODE_ENV=production node --prof lib/server/index.js

This will read data from the blobs in api_mockdata directory. If you want to use another set of mock data, create a similar directory to that one and add an argument OFFLINE_SSR_TEST_DATA_DIR pointing to your new directory.

Run blackbox tests using nightwatch

To run a Selenium test suite, start the condenser docker image with a name condenser (like docker run --name condenser -itp 8080:8080 steemit/condenser:latest) and then run the blackboxtest image attached to the condneser image's network:

docker build -t=steemit/condenser-blackboxtest blackboxtest/
docker run --network container:condenser steemit/condenser-blackboxtest:latest

Issues

To report a non-critical issue, please file an issue on this GitHub project.

If you find a security issue please report details to: [email protected]

We will evaluate the risk and make a patch available before filing the issue.

condenser's People

Contributors

bnchdrff avatar economicstudio avatar eonwarped avatar ety001 avatar gandalf-the-grey avatar gl2748 avatar goldibex avatar gryter avatar jnordberg avatar jonathanporta avatar jredbeard avatar leon9665 avatar netuoso avatar nynhex avatar originated avatar pfunks avatar pkattera avatar plink01001 avatar quochuy3191313 avatar realmankwon avatar relativityboy avatar roadscape avatar sneak avatar snow-lpc avatar svk31 avatar syvb avatar thebitcoiner avatar timcliff avatar weirdops avatar xxo1shine avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

condenser's Issues

Internal market order disappeared from interface

After this last site update the market order that I placed on the internal market disappeared from the interface.
My wallet still shows 0 SD and 0 STEEM so the order was not canceled during the update. However, since the interface does not show it, I can't do it manually to recover my balance.

While its just a minor amount, still worrying that this kind of bug/upgrade issue can happen with ANY amount.

[Suggestion] Floating Editor For Submitting Post Instead of Fixed

https://steemit.com/suggestions/@jasonmcz/suggestion-floating-editor-for-submitting-post-instead-of-fixed

Hi guys!

I am here to write up this suggestion for making some improvements to the GUI for post submission. I recently wrote an article under recipe section -- Recipe: My 30 min Salmon Ramen Hack. While I was writing this post, I've noticed how cumbersome it could be for someone who doesn't know how to write with Markdown or Html when the story is ridiculously long and we will have to scroll UP and DOWN all the time to make text edits or inserting a picture

Examples found here:

The Current UI for Post Submission :





But when your article is too long :


What if we do it this way :


Problems with the way steemit.com parses tags and what it includes in the "links" field

It stops parsing the tag at a hyphen, so creating tags with hypens in them is currently not possible.

I also think there needs to be a way to include a hashtag without automatically adding it as a tag. Sometimes I just want to use a hashtag (without wrapping it in quotes or in a code span) without having steemit.com treat it as anything special.

See details in this post: https://steemit.com/test/@arhag/testing-tags

Unintended diff format while posting a reply

Here is a reply to my post, the text reads:

How about if they (we - not sure if I'd be classed as a 'large' SP holder) voted an hour after posting? That could act as an extra incentive for early voters.

I think the issue with getting authors to refrain from voting for themselves early, is that some will do it via a proxy/ shill account. Thereby getting the benefit without being perceived to be greedy.

If I reply to this comment with this text:

>How about if they (we - not sure if I'd be classed as a 'large' SP holder) voted an hour after posting? That could act as an extra incentive for early voters.

I support this.

>I think the issue with getting authors to refrain from voting for themselves early, is that some will do it via a proxy/ shill account. Thereby getting the benefit without being perceived to be greedy.

It's all about reputation. Technically it's unable to prevent anyone from voting for herself/himself early.

The result shows as:

@@ -1,8 +1,9 @@
+%3E
How abou
@@ -154,16 +154,34 @@
oters.%0A%0A
+I support this.%0A%0A%3E
I think
@@ -373,8 +373,117 @@
greedy.
+%0A%0AIt's all about reputation. Technically it's unable to prevent anyone from voting for herself/himself early.

Link is here.

Feature Request: Spoiler tags

Categories on Steem like this one are really going to want spoiler tags rendered on Steemit.
The format would be something like this:

[Visible text warning readers of the scope of the spoiler goes here](#some-spoiler-tag "Actual spoiler content goes here")

And steemit would be responsible for identifying the correct spoiler tag through the fragment identifier on the link (#some-spoiler-tag in the example above). Technically each channel could have its own CSS (that's a whole other proposal though!) to identify and render different fragment identifiers in different ways like reddit does. But the simpler solution is to make #spoiler be the standard fragment identifier that the Steemit website recognizes and renders properly. To see an example of spoiler tags in action, click here.

Power Up of Vests is not requesting Proper Authority

anyone else having problem powering up their steem? I have 200+ steem listed that I want to power up but it says insufficient funds when i try.

The error is likely misleading, it is probably failing on authority check.

Feature Request: Allow safe HTML in Markdown

Currently the Markdown rendering uses :escape-html to escape any HTML in the raw body text. I would like to see it eventually allow a subset of HTML that is safe, while filtering out everything else in a sane way. For example, if it doesn't understand some tag, it just ignores the tags and its associated attributes and renders the text within as Markdown like normal.

This would allow authors to optionally use allowed HTML to structure their content rather than only Markdown syntax. But more importantly it allows specifying certain attributes adding semantic meaning to content that is not possible with pure Markdown.

For example, in Markdown I can do a blockquote by prepending each line with a "> ". Not only is this more cumbersome than just putting wrapping the text in a blockquote tag, but it also prevents me from specifying a cite attribute on the blockquote tag. If the blockquote HTML tag was allowed rather than escaped, steemit.com could even be smart about interpreting the cite attribute (or even other attributes) to render the blockquote in a special way if the citation was another comment internal to Steem.

There are many other possibilities that become open if we allow a broad yet safe subset of HTML through in the Markdown rendering. However, it is important to ensure it is safe. This means no potential for script injection attacks (or disallowed custom CSS styling). An earlier attempt to quickly enable this feature on steemit.com allowed scripts in user-submitted posts to be processed in the browser for a short time before the behavior was reverted. So it is important to take your time and get it right on the test site before deploying.

Feature request: Edit history

Besides the creation time, if a post/comment was edited, it should have another time that says when the post was last edited (e.g. a link that says "(edited )").

Clicking on that link would flip the post/comment to reveal an edit history UI (for just that post/comment in the context of the larger discussion tree). The edit history UI would allow the user to see a timeline of all edits made to the post/comment, and to jump to any of the snapshot points in the timeline to see the state of the post/comment at that time.

Questions remain regarding whether the JSON metadata at each snapshot time should also be made available in some way, and also whether it should affect the display of the post/comment (for example if a post was marked NSFW and then later the NSFW mark was removed with an edit, should viewing its older version in the edit history replace the images in the post with a click-to-reveal placeholder?). Also, it would be really nice if the status of the votes for the post/comment could also be updated to reflect their state at each snapshot time.

This is a pretty major feature request because it not only requires a lot of new UI work, but it also requires writing new code in steemd to provide the data necessary to the client. I'm thinking steemd would need to be able to retrieve all comment operations of the post/comment and then replay that mini-blockchain (with appropriate content patching code) in order up to the generation requested by the caller before returning that snapshot state (of title, body, json_metadata, and other metadata like last_update) to the caller. Ideally, it would also retrieve all the vote operations related to that post and process them in order up to the last_update time of the requested generation of the post/comment and return the state of votes with the response to the caller.

Finally, back to the client UI level, I think it would be useful if the URL request for a post/comment accepted a generation field (e.g. ?generation=1). In that case steemit.com would automatically flip the appropriate post/comment to the edit history view and show the requested generation of the post/comment on page load. This would allow people to link to a particular version of an edited post and know that they are linking people to content that they have read and know will not be later changed to something else by the author.

total payout amount should be displayed

pfunk:
Personally I think the total payout amount should be displayed as well
a post's previous value is information that people want to see, at least I do

gritt-n-auld
To add onto pfunk's suggestion, on hover should display total.
Or, vice versa. Total and on hover is pending.

RTL support

Steemit.com is lucking RTL support. RTL languages are: Hebrew, Arabic, Persian and more and it represents tens of millions of internet users.

IPad and new txt editor

I've got this MSG from the Facebook page of Steemit.

"Ever since the new post editor was introduced, I have been unable to post anything or reply to anyone. Unlike the old editor, which worked fine with iPad2, the new editor does not work at all. It will not let me enter or cut and paste any text.

As far as I am concerned Steemit is now almost completely useless (only thing it lets me do is up or downvote posts).

Still it is early days and maybe somebody will fix this and actually allow iPad users to join in once more?"

Steemit.com Markdown rendering adds line breaks on every newline

I find this very frustrating. In Markdown, I can add a single line break in my source text without triggering a new paragraph or a line break in the rendered output.

If I actually want a line break (but not a new paragraph), I need to add at least two spaces at the end of my line.

See this post and compare it to how it should be done on steemd.com.

RSS subscription

Good work with great concept!

Currently it seems it is not possible to subscribe to RSS feeds to read the latest steem updates. Is this correct?

Feature Request: Allow anyone to see raw source text of post/comment

Currently only an author of the post/comment can see the raw text of the body field by clicking on Edit. I propose that everyone be able to see a read-only version of that if they choose to. This is useful when quoting a specific section of a parent comment that you are replying to.

Raw html does not embed videos correctly

When writing a post with the newest html editor, the content was auto converted to raw html. Whilts this is not a major issue, Youtube embedded videos are not parsed correctly in raw html, they are just ignored.

The workaround is to convert everything back to markdown ;)

Embedded images occasionally attach a prefix to the src url

I've not been on Steemit long enough to notice whether this started happening recently or not, but I've personally only observed this occurring in the last 24 hours.

Occasionally an embedded image in a post / comment will appear with a https://img0.steemit.com/0x0/ prefix, as in <img src="https://img0.steemit.com/0x0/https://s32.postimg.org/j6plt0d7p/Enlight1_10.jpg">. Refreshing the page often fixes this.

Hiding NSFW images

I do not agree with using tags (such as #nsfw) to mark explicit content. I think that is mixing up their true functionality. I have outlined the solution that I prefer in this post (please read through it if you haven't already), although that proposal will probably require some slight modifications now that categories are being depreciated in favor of tags (they are right?).

That all said. I think there is a need for dealing with NSFW content sooner rather than later. So until a better solution is formalized and implemented, I think you should modify steemit.com to not show post summaries of posts tagged #nsfw regardless of net_rshares and to mark such posts with a special NSFW label. Opening the posts would show the full content.

Still not possible to change posting key when logged in with active authority

My master password is set up to give me access to posting and memo only.

However, I tried logging in using my active private key. Doing so allows me to show my active private key on my Permissions tab. It also allows me to edit both my active and memo keys. But it does not allow me to edit my posting key.

Dropdown box for votes doesn't scale well to many votes

Take this post for example:
https://steemit.com/steemservices/@steemservices/getting-started-with-steemit

First of all, nice touch on extending the bottom of the page with enough whitespace to fit the largest vote dropdown. I'm glad that I didn't have to report that as a bug.

However, notice how much whitespace needs to be added for that post simply to fit the (currently) 51 votes of the root post. It would be even worse if the comment closest to the bottom of the page (for some given sort order presumably other than trending) had all those votes. And this problem will only get worse as the site gets bigger and popular posts end up having many many more votes.

I propose that the vote dropdown only shows at most the top N (choose a reasonable N) votes by abs_rshares. And then if there are more votes than that, it includes an item at the bottom that says "M more votes..." (except replace M with the actual number). Alternatively, if all the votes for the comment are displayed in the dropdown, it instead includes an item at the bottom that says "Show vote details...". If the user clicks on either of those bottom items, it takes them to another page which shows all of the ranked votes for that particular post/comment.This view could have a lot more detail about the votes such as the user-selected weight, the rshares value, time of voting, and current vote weight (the one that determines fraction of curation rewards earned). And this data can be in a table that allows sorting by any of the columns in ascending or descending order.

Mixed content bug (retrieving images from HTTP allowed)

This bug still exists.

For some reason, despite the fact that the image link to the Reddit alien image in that thread is supposed to be HTTPS, the browser downloads it via HTTP. This causes the web page to have mixed content and so the green lock icon disappears.

Ideally, it should not be possible to request images over HTTP. Apparently, replacing "http://" in all image links with "https://" or "//" is not enough to solve the problem.

Cursor cannot be moved in write comment/article window on IPad/IPhone

Dear steemit maintainers,

When using an IPad or IPhone to edit or write a text in a multi-line text field on steemit.com, then moving the cursor is not possible. Instead of the cursor being moved, the text box scrolls and the cursor will stay at its current position.

Used Browsers: 51.0.2704.104
OS: IOS 9.3.2

Regards,
riensen

Feature Request: Clicking on the time of comment should give context-surrounded permalink to comment and other link sharing options

I would like to see the time of comments be a link just like root posts that provides a link to the comment in the context of the discussion tree. This would be the same link you get when you click to see the comment from the "Posts" or "Replies" tab of your account page.

I also think there should be an alternative way to get such a link. The share dropdown should provide a "Link" option. The share dropdown would be available to comments as well as root posts. For root posts, it would provide the same link as that of clicking the time of the root post. For comments, the "Link" share option would instead provide a directly link to the comment (not context-surrounded).

In this case, comment's viewed directly (as if they were roots of the discussion) should be rendered differently to indicate they are not the actual root post and to provide links to allow them to navigate to the greater discussion tree not shown. At a minimum this means a direct link to the parent of the comment. But it would ideally also have a link to show the comment in the context of the whole discussion tree that it exists within, not just the subtree currently shown. However, clicking on the time of a comment within the displayed subtree would link to that comment in the context of that subtree, not of all the whole discussion tree it actually exists within.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.