grych

grych

Creator of Drab

Hi folks,
Few months ago I have announced the proof-of-concept of the library to manipulate the browsers DOM objects directly from Elixir (here). Finally, first beta has been released!

And of course it is available as a hex package.


In the meantime I’ve changed the API, so it is - I believe - easier to remember. If you think about webpage as a database which contains DOM objects, it is natural to query:

  • select(:text, from: "p:first") to get text of the first paragraph or
  • select(attr: :href, from: "a") for all links in the document,
    update some object(s) with
  • update(css: :border, set: "3px solid red", on: this(sender)),
    add new nodes or attributes
  • insert("<b>IMPORTANT</b>", before: "p:first"),
    or remove something with
  • delete(class: "btn", from: "#the_button"),
    and more, like synchronous modal which - launched on the server side - waits for user input.

Any suggestions, criticism, ideas welcome!


Grych

Showing Posts 231 to 240

grych

grych OP

Creator of Drab

Are you updating the assigns with the partial given?

poke socket, "hero_slides.html", hero_slides: ...

?

robobakery

robobakery

Thanks, I’ve totally forgot to include partial template when I call poke.

grych

grych OP

Creator of Drab

Cool.
I am thinking about changing this behavior, so when you not specify the template name, it changes it in all.

tnt

tnt

Did you manage to do that? Having to return to eex templates would be a real show-stopper for me.

tmbb

tmbb

No, sorry, I didn’t try. I’ve started aorking on my own thing instead…

piex

piex

Drab looks really interesting and I am hoping it will be a fit for an experimental project I m working on. I am trying to get drab working but running into an error “Erlang error: :notsup” when executing page render DrabExample.PageView.“index.html”/1

After digging a bit it seems to be coming from lib/plug/crypto/message_encryptor.ex. The call that fails is :crypto.block_encrypt(:aes_gcm, key, iv, {aad, plain_text})

This is likely an issue with my environment (OS X Sierra 10.12.6), OpenSSL 1.0.2l 25 May 2017

iex> :crypto.supports()
[hashs: [:sha, :sha224, :sha256, :sha384, :sha512, :md4, :md5, :ripemd160],
ciphers: [:des3_cbc, :des_ede3, :des3_cbf, :des3_cfb, :aes_cbc, :aes_cbc128,
:aes_cfb8, :aes_cfb128, :aes_cbc256, :aes_ctr, :aes_ecb, :aes_ige256,
:des_cbc, :des_cfb, :des_ecb, :blowfish_cbc, :blowfish_cfb64, :blowfish_ofb64,
:blowfish_ecb, :rc2_cbc, :rc4],
public_keys: [:rsa, :dss, :dh, :ec_gf2m, :ecdsa, :ecdh, :srp]]

iex> :ssl.versions
[ssl_app: ‘8.1.1’, supported: [:“tlsv1.2”],
available: [:“tlsv1.2”, :“tlsv1.1”, :tlsv1, :sslv3]]

My past Phoenix projects have not hit any issue, but may not have exercised this particular crypto path. Asking here in case anyone has had this issue or has an idea how to resolve it.

Any advice is greatly appreciated.

OvermindDL1

OvermindDL1

That does not seem like a drab error, rather that sounds like some application is not started that should have been started. What is your entire mix.exs file and your projects application file?

grych

grych OP

Creator of Drab

Hey @piex,
Yes, Drab is using Plug’s MessageVerifier to sign the tokens.
And yes, it looks like your environment issue. You are missing :aes_gcm.

On my system it’s there:

ex(3)> :crypto.supports()[:ciphers]
[:des3_cbc, :des_ede3, :des3_cbf, :des3_cfb, :aes_cbc, :aes_cbc128, :aes_cfb8,
 :aes_cfb128, :aes_cbc256, :aes_ctr, :aes_ecb, :aes_gcm, :aes_ige256, :des_cbc,
 :des_cfb, :des_ecb, :blowfish_cbc, :blowfish_cfb64, :blowfish_ofb64,
 :blowfish_ecb, :rc2_cbc, :rc4]

Not sure it is openssl version or erlang. I am using built-in openssl in macOS Sierra (OpenSSL 0.9.8zh 14 Jan 2016) and OpenSSL 1.0.1t 3 May 2016 on Debian.

piex

piex

Thanks grych, that confirmation was all I needed. I had been using the Erlang Solutions installer to manage switching between several Erlang versions but all of their builds seem to be missing :aes_gcm cipher. I switched to point to the brew installed version of Erlang and it includes :aes_gcm and now works. Thanks much.

grych

grych OP

Creator of Drab

Maybe it would be good to report it to plug team? They may want to check if you have a cipher before trying to use it, and change it, or at least give a better error message.

Where Next? Top

Trending in Announcing Top

woylie
Flop is an Elixir library that applies filtering, ordering and pagination parameters to your Ecto queries. offset-based pagination with...
New
MRdotB
I needed to reuse React components from my Chrome extension in my Phoenix/LiveView backend. I noticed that for Svelte/Vue, there are live...
New
woylie
I released Doggo, a collection of unstyled Phoenix components. https://github.com/woylie/doggo Features Unstyled Phoenix components....
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
anuaralfetahe
Hello Published a new library - ProcessHub! ProcessHub is a library designed to manage process distribution within the Elixir cluster. ...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Dmk
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New

Other Trending Topics Top

mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
webofbits
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself. My main conc...
#ai
New
sergio
It’s not that it’s vocabulary is too advanced. It’s something worse. I get lost trying to follow even a paragraph written by Claude. It’...
New
AstonJ
This showed up on my feed.. anyone heard of it? Just hype? Ox Alpha is a reasoning model designed for coding, sustained ag...
New
bartblast
Hey folks, I just published a post about Hologram’s funding and where the project goes next - the short version: Curiosum as Main Spons...
New
sorenone
Today we’re releasing Oban for Python. Not an Oban client in Python. Not a pythonx wrapper embedded in Elixir. Nope, it’s a fully operati...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews