Giter VIP home page Giter VIP logo

glasnost's Introduction

Glasnost

Glasnost is an GraphQL app server for Golos and Steem blockchains built with Elixir, Phoenix and Mnesia. Docs

Glasnost -- GraphQL API сервер для приложений и блогов на платформе Golos. Использует Elixir, Phoenix и Mnesia. Документация

glasnost's People

Contributors

avral avatar ontofractal avatar vadbars 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

glasnost's Issues

How to make changes to website html?

Hey,

So I've been trying to customize my website beyondboinc, specifically the app.html.eex file.

I've managed to substitute this file for my own, but the changes are not shown.

I've tried resetting the nodejs server, but no luck.

Is there an easy way to make the docker container to recognize local file changes or to force the changed files to be used?

Will I have to make my own docker image?

Thanks, keep up the great work 👍

Images not using HTTPS

Hey,

I'm getting the following issue on my glasnost website:
image

Some of the posts by authors contain non-https image links, think we could somehow replace 'http' with 'https' when importing the data from the blockchain?

Cheers 👍

Error while starting Glasnost app in Docker

C:\Users\User>docker run -it -p 80:80 -e "GLASNOST_CONFIG_URL=C:\Users\User\config.json" --restart on-failure:10 ontofractal/glasnost:latest
22:00:59.750 [error] ** State machine #PID<0.194.0> terminating
** Last message in was {:ssl,
{:sslsocket, {:gen_tcp, #Port<0.6684>, :tls_connection, :undefined},
#PID<0.199.0>},
"HTTP/1.1 502 Bad Gateway\r\nServer: nginx/1.10.0 (Ubuntu)\r\nDate: Thu, 30 Mar 2017 22:00:45 GMT\r\nContent-Type: text/html\r\nContent-Length: 174\r\nConnection: keep-alive\r\n\r\n\r\n<title>502 Bad Gateway</title>\r\n<body bgcolor="white">\r\n

502 Bad Gateway

\r\n
nginx/1.11.10\r\n\r\n\r\n"}
** When State == :handshaking
** Data == {:context,
{:websocket_req, :wss, 'ws.golos.io', 443, '/', :infinity, :undefined, 1,
{:sslsocket, {:gen_tcp, #Port<0.6684>, :tls_connection, :undefined},
#PID<0.199.0>},
{:transport, :ssl, :ssl, :ssl_closed, :ssl_error,
[mode: :binary, active: true, verify: :verify_none, packet: 0]},
"v2RSnWyWQKbsisDacXuHNw==", :undefined, :undefined, :undefined, :undefined,
:undefined},
{:transport, :ssl, :ssl, :ssl_closed, :ssl_error,
[mode: :binary, active: true, verify: :verify_none, packet: 0]}, [],
{:wss, 'ws.golos.io', 443, '/'}, {Golos.WS, %{}}, "", false, 0}
** Reason for termination =
** {:function_clause,
[{Golos.WS, :ondisconnect, [{:error, {502, "Bad Gateway"}}, %{}],
[file: 'lib/ex_golos/golos_ws.ex', line: 29]},
{:websocket_client, :disconnect, 2,
[file: '/glasnost_app/deps/websocket_client/src/websocket_client.erl',
line: 277]}, {:gen_fsm, :handle_msg, 7, [file: 'gen_fsm.erl', line: 451]},
{:proc_lib, :init_p_do_apply, 3, [file: 'proc_lib.erl', line: 247]}]}

22:01:00.042 [error] ** State machine #PID<0.228.0> terminating
** Last message in was {:ssl,
{:sslsocket, {:gen_tcp, #Port<0.8031>, :tls_connection, :undefined},
#PID<0.234.0>},
"HTTP/1.1 502 Bad Gateway\r\nServer: nginx/1.10.0 (Ubuntu)\r\nDate: Thu, 30 Mar 2017 22:00:46 GMT\r\nContent-Type: text/html\r\nContent-Length: 174\r\nConnection: keep-alive\r\n\r\n\r\n<title>502 Bad Gateway</title>\r\n<body bgcolor="white">\r\n

502 Bad Gateway

\r\n
nginx/1.11.10\r\n\r\n\r\n"}
** When State == :handshaking
** Data == {:context,
{:websocket_req, :wss, 'ws.golos.io', 443, '/', :infinity, :undefined, 1,
{:sslsocket, {:gen_tcp, #Port<0.8031>, :tls_connection, :undefined},
#PID<0.234.0>},
{:transport, :ssl, :ssl, :ssl_closed, :ssl_error,
[mode: :binary, active: true, verify: :verify_none, packet: 0]},
"DK6O0zqie/8XdjDJT1I24w==", :undefined, :undefined, :undefined, :undefined,
:undefined},
{:transport, :ssl, :ssl, :ssl_closed, :ssl_error,
[mode: :binary, active: true, verify: :verify_none, packet: 0]}, [],
{:wss, 'ws.golos.io', 443, '/'}, {Golos.WS, %{}}, "", false, 0}
** Reason for termination =
** {:function_clause,
[{Golos.WS, :ondisconnect, [{:error, {502, "Bad Gateway"}}, %{}],
[file: 'lib/ex_golos/golos_ws.ex', line: 29]},
{:websocket_client, :disconnect, 2,
[file: '/glasnost_app/deps/websocket_client/src/websocket_client.erl',
line: 277]}, {:gen_fsm, :handle_msg, 7, [file: 'gen_fsm.erl', line: 451]},
{:proc_lib, :init_p_do_apply, 3, [file: 'proc_lib.erl', line: 247]}]}

22:01:00.482 [info] Running Glasnost.Web.Endpoint with Cowboy using http://:::80
22:01:00.575 [error] ** State machine #PID<0.287.0> terminating
** Last message in was {:ssl,
{:sslsocket, {:gen_tcp, #Port<0.10193>, :tls_connection, :undefined},
#PID<0.295.0>},
"HTTP/1.1 502 Bad Gateway\r\nServer: nginx/1.10.0 (Ubuntu)\r\nDate: Thu, 30 Mar 2017 22:00:46 GMT\r\nContent-Type: text/html\r\nContent-Length: 174\r\nConnection: keep-alive\r\n\r\n\r\n<title>502 Bad Gateway</title>\r\n<body bgcolor="white">\r\n

502 Bad Gateway

\r\n
nginx/1.11.10\r\n\r\n\r\n"}
** When State == :handshaking
** Data == {:context,
{:websocket_req, :wss, 'ws.golos.io', 443, '/', :infinity, :undefined, 1,
{:sslsocket, {:gen_tcp, #Port<0.10193>, :tls_connection, :undefined},
#PID<0.295.0>},
{:transport, :ssl, :ssl, :ssl_closed, :ssl_error,
[mode: :binary, active: true, verify: :verify_none, packet: 0]},
"sd6wqfbQLONfRAp4VCsKcA==", :undefined, :undefined, :undefined, :undefined,
:undefined},
{:transport, :ssl, :ssl, :ssl_closed, :ssl_error,
[mode: :binary, active: true, verify: :verify_none, packet: 0]}, [],
{:wss, 'ws.golos.io', 443, '/'}, {Golos.WS, %{}}, "", false, 0}
** Reason for termination =
** {:function_clause,
[{Golos.WS, :ondisconnect, [{:error, {502, "Bad Gateway"}}, %{}],
[file: 'lib/ex_golos/golos_ws.ex', line: 29]},
{:websocket_client, :disconnect, 2,
[file: '/glasnost_app/deps/websocket_client/src/websocket_client.erl',
line: 277]}, {:gen_fsm, :handle_msg, 7, [file: 'gen_fsm.erl', line: 451]},
{:proc_lib, :init_p_do_apply, 3, [file: 'proc_lib.erl', line: 247]}]}

22:01:00.706 [info] Application glasnost exited: Glasnost.Application.start(:normal, []) returned an error: shutdown: failed to start child: Glasnost.Orchestrator.AuthorSyncSup
** (EXIT) an exception was raised:
** (ArgumentError) argument error
:erlang.list_to_integer('\Users\User\config.json')
(hackney) /glasnost_app/deps/hackney/src/hackney_url.erl:204: :hackney_url.parse_netloc/2
(hackney) /glasnost_app/deps/hackney/src/hackney.erl:346: :hackney.request/5
(httpoison) lib/httpoison/base.ex:432: HTTPoison.Base.request/9
(glasnost) lib/glasnost/runtime_config.ex:57: RuntimeConfig.fetch_external_config/0
(con_cache) lib/con_cache/operations.ex:202: ConCache.Operations.dirty_get_or_store/3
(con_cache) lib/con_cache/lock.ex:31: ConCache.Lock.exec/4
(glasnost) lib/glasnost/runtime_config.ex:11: RuntimeConfig.get/1
{"Kernel pid terminated",application_controller,"{application_start_failure,glasnost,{{shutdown,{failed_to_start_child,'Elixir.Glasnost.Orchestrator.AuthorSyncSup',{badarg,[{erlang,list_to_integer,["\Users\User\config.json"],[]},{hackney_url,parse_netloc,2,[{file,"/glasnost_app/deps/hackney/src/hackney_url.erl"},{line,204}]},{hackney,request,5,[{file,"/glasnost_app/deps/hackney/src/hackney.erl"},{line,346}]},{'Elixir.HTTPoison.Base',request,9,[{file,"lib/httpoison/base.ex"},{line,432}]},{'Elixir.RuntimeConfig',fetch_external_config,0,[{file,"lib/glasnost/runtime_config.ex"},{line,57}]},{'Elixir.ConCache.Operations',dirty_get_or_store,3,[{file,"lib/con_cache/operations.ex"},{line,202}]},{'Elixir.ConCache.Lock',exec,4,[{file,"lib/con_cache/lock.ex"},{line,31}]},{'Elixir.RuntimeConfig',get,1,[{file,"lib/glasnost/runtime_config.ex"},{line,11}]}]}}},{'Elixir.Glasnost.Application',start,[normal,[]]}}}"}
Kernel pid terminated (application_controller) ({application_start_failure,glasnost,{{shutdown,{failed_to_start_child,'Elixir.Glasnost.Orchestrator.AuthorSyncSup',{badarg,[{erlang,list_to_integer,["\

Crash dump is being written to: erl_crash.dump...done

C:\Users\User>|

Admin panel error?

02:02:32.106 [info] Starting config update...
02:02:32.130 [info] Finishing config update...
02:02:32.153 request_id=jghitbt511sna12b0s8rni56bdl2nbug [info] Sent 500 in 48ms
02:02:32.172 [error] #PID<0.482.0> running Glasnost.Web.Endpoint terminated
Server: mydomain.tldt:80 (http)
Request: POST /admin/command_and_control
** (exit) an exception was raised:
    ** (Protocol.UndefinedError) protocol String.Chars not implemented for %HTTP                                                                                                             oison.Error{id: nil, reason: :nxdomain}
        (elixir) lib/string/chars.ex:3: String.Chars.impl_for!/1
        (elixir) lib/string/chars.ex:17: String.Chars.to_string/1
        (glasnost) lib/glasnost/web/controllers/admin_controller.ex:21: Glasnost                                                                                                             .Web.AdminController.command_and_control/2
        (glasnost) lib/glasnost/web/controllers/admin_controller.ex:1: Glasnost.                                                                                                             Web.AdminController.action/2
        (glasnost) lib/glasnost/web/controllers/admin_controller.ex:1: Glasnost.                                                                                                             Web.AdminController.phoenix_controller_pipeline/2
        (glasnost) lib/glasnost/web/endpoint.ex:1: Glasnost.Web.Endpoint.instrum                                                                                                             ent/4
        (phoenix) lib/phoenix/router.ex:277: Phoenix.Router.__call__/1
        (glasnost) lib/glasnost/web/endpoint.ex:1: Glasnost.Web.Endpoint.plug_bu                                                                                                             ilder_call/2

Internal server error when specifying a configuration URL. Is there a format that the config URL needs to follow?

On another note, if my server crashes how do I maintain the previous instance of docker? By starting up the docker container again won't the admin page reset (potentially enabling a malicious user to gain access to the admin panel?)

Thank you

I think this is one of the best community infrastructure projects for Steem. The Elixir/Phoenix and GraphQL+Postgres stack is pretty interesting, and the code looks super neat.

Congrats on getting this far. I'm looking forward to running this in production.

./start.sh: Permission denied

~/G/S/glasnost % docker ps -a | grep glasnost
1655650571a7        ontofractal/glasnost   "/bin/sh -c ./star..."    4 minutes ago       Exited (126) 4 minutes ago                                                    glasnost_glasnost_1
b3d489a1e2b0        postgres               "docker-entrypoint..."    4 minutes ago       Up 4 minutes                 0.0.0.0:5411->5432/tcp                           glasnost_pg_1
~/G/S/glasnost % docker logs 1655650571a7
/bin/sh: 1: ./start.sh: Permission denied

This is both for docker image and build from Github.
Looks like the file permissions aren't set right, chmod +x start.sh fixes it.

Маркдаун режет страницы с кодами html

Если встречается код html, например <li>, страница обрезается. а код выводится на страницу. Пример: https://golos.io/mapala/@vadbars/bolgarskiij-voyazh-2010-trudnoe-nachalo
Текст не выводится совсем. После картинки сразу
<li>Трудное начало <a href="https://golos.io/mapala/@vadbars/bolgarskiij-voyazh-2010-trudnoe-nachalo" target="_blank">Голос</a>, <a href="http://mapala.net/vadbars/bolgarskiij-voyazh-2010-trudnoe-nachalo" target="_blank">Мапала</a></li> <li>Краснокожая паспортина и все, все, все <a href="https://golos.io/mapala/@vadbars/bolgarskiij-voyazh-krasnokozhaya-pasportina-i-vse-vse-vse" target="_blank">Голос</a>, <span></span><a href="http://mapala.net/vadbars/bolgarskiij-voyazh-krasnokozhaya-pasportina-i-vse-vse-vse" target="_blank">Мапала</a></li>

SEO: Structured Data

So I've been improving the SEO of my blog with simple meta tags, but we could potentially implement structured data within the post template in order to get glasnost steemit posts indexed like news articles and displayed directly in google: https://developers.google.com/search/docs/guides/?hl=en-GB https://developers.google.com/search/docs/data-types/articles?hl=en-GB

What do you think? I'm going to give it a try.

Annoyances with AMP:

  • Potentially need to convert css to inline..
  • May need to replace html tags

Edit: AMP is too disruptive.

Ecto.Repo.Schema.insert! returns an error

glasnost_1  |     (ecto) lib/ecto/repo/schema.ex:125: Ecto.Repo.Schema.insert!/4
glasnost_1  | 22:34:57.221 [error] Process #PID<0.26061.0> raised an exception
glasnost_1  | ** (Ecto.ChangeError) value `[[1, "0.16.4"]]` for `Glasnost.Golos.Block.extensions` in `insert` does not match type {:array, :map}
glasnost_1  |     (ecto) lib/ecto/repo/schema.ex:788: Ecto.Repo.Schema.dump_field!/6
glasnost_1  |     (ecto) lib/ecto/repo/schema.ex:797: anonymous fn/6 in Ecto.Repo.Schema.dump_fields!/5
glasnost_1  |     (stdlib) lists.erl:1263: :lists.foldl/3
glasnost_1  |     (ecto) lib/ecto/repo/schema.ex:795: Ecto.Repo.Schema.dump_fields!/5
glasnost_1  |     (ecto) lib/ecto/repo/schema.ex:744: Ecto.Repo.Schema.dump_changes!/6
glasnost_1  |     (ecto) lib/ecto/repo/schema.ex:207: anonymous fn/14 in Ecto.Repo.Schema.do_insert/4
glasnost_1  |     (ecto) lib/ecto/repo/schema.ex:125: Ecto.Repo.Schema.insert!/4

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.