Per favore, raccontaci tutte le cose che hai fatto per aggiungere questo plugin.
Hai aggiunto il before_code come descritto in precedenza in questo argomento?
Si tratta di un’installazione standard?
in app.yml Aggiunto come - git clone https//GitHub—-.git
Selfhosted su Ubuntu 18, ed è un’installazione standard con il comando ./setup
Quindi non l’hai fatto
@RGJ puoi dirmi come aggiungere questo before_code e condividermi il post con il before_code
Mi dispiace, puoi usare ctrl-f per cercare l’argomento e ti condurrà alla risposta.
@RGJ si riferisce alla guida su GitHub
GitHub - spruceid/discourse-siwe-auth: Discourse plugin for SIWE authentication
Nel file app.yml devi aggiungere le sezioni sotto la sezione hooks
ha funzionato davvero grazie non so perché non riuscissi a vederlo prima ![]()
aggiornamento: installazione completata e plugin funziona correttamente, ora sto solo testando con il wallet ETH per l’accesso.
Credo che questo sia rotto, non appare alcun popup (richiesta di firma) quando si preme il pulsante “Sign with Ethereum” nella pagina /discourse-siwe/auth.
Di seguito sono riportati i log della console che appaiono quando si preme il pulsante.
SyntaxError: Unexpected token '<', "<!doctype "... is not valid JSON
at Function.parse [as parseJSON] (<anonymous>)
at n (ajax-error.js:29:1)
at e.popupAjaxError (ajax-error.js:71:1)
at y (rsvp.js:435:1)
at v (rsvp.js:421:1)
at f (rsvp.js:370:1)
at m.invoke (queue.ts:203:14)
at m.flush (queue.ts:98:13)
at f.flush (deferred-action-queues.ts:75:19)
at $._end (index.ts:616:32)
at _boundAutorunEnd (index.ts:257:12)
TypeError: Cannot destructure property 'message' of '(intermediate value)' as it is undefined.
at e.signMessage (web3modal.js:66:1)
at async e.runSigningProcess (web3modal.js:82:1)
at async e.initAuth (siwe-auth-index.js:38:1)
Funziona per me in entrambi i test, superato come stabile, utilizzando un Infura ID.
Come hai configurato il plugin?
Ho provato sia la chiave Infura che gli RPC pubblici, oltre a inserire manualmente l’RPC mainnet da Infura. Non sono sicuro che sia quello il problema.
È possibile modificare/stilizzare il popup “Accedi con eth”?
Posso aggiungere anche altre reti compatibili con Ethereum?
Puoi farmi un esempio di “rete compatibile con Ethereum”?
Voglio dire, proprio come BSC
Intendo “Binance Smart Chain”
Nuovo errore
Sì, ho aggiunto gli hook before_code. L’errore inizia qui e non si verifica quando commento il plugin siwe-auth.
I, [2025-02-11T03:40:25.992538 #1] INFO -- :
I, [2025-02-11T03:40:25.993236 #1] INFO -- :
> cd /var/www/discourse & su discourse -c 'bundle exec rake db:migrate'
rake aborted!
hooks:
before_code:
- exec:
cmd:
- gem install rubyzip
after_code:
- exec:
cd: $home/plugins
cmd:
- git clone https://github.com/discourse/docker_manager.git
- git clone https://github.com/discourse/discourse-gamification
- git clone https://github.com/discourse/discourse-chat-integration
- git clone https://github.com/angusmcleod/discourse-events
- git clone https://github.com/discourse/discourse-ai
- git clone https://github.com/discourse/discourse-subscriptions
- git clone https://github.com/discourse/discourse-translator
- git clone https://github.com/discourse/discourse-signatures
- git clone https://github.com/merefield/discourse-locations
- git clone https://github.com/discourse/discourse-reactions
- git clone https://github.com/melhosseiny/discourse-nft-avatar
- git clone https://github.com/discourse/discourse-follow
- git clone https://github.com/spruceid/discourse-siwe-auth
Vedi l’errore qui sotto
FAILED
--------------------
Pups::ExecError: cd /var/www/discourse & su discourse -c 'bundle exec rake db:migrate' failed with return #<Process::Status: pid 778 exit 1>
Location of failure: /usr/local/lib/ruby/gems/3.3.0/gems/pups-1.2.1/lib/pups/exec_command.rb:132:in `spawn'
exec failed with the params {"cd"=>"$home", "tag"=>"migrate", "hook"=>"db_migrate", "cmd"=>["su discourse -c 'bundle exec rake db:migrate'"]}
bootstrap failed with exit code 1
** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one.
./discourse-doctor may help diagnose the problem.
@RGJ si veda sopra, speriamo di poter risolvere rapidamente ^
LOG COMPLETO:
redacted@server:/var/discourse$ sudo ./launcher rebuild app
architettura x86_64 rilevata
La soluzione è (era) già nel nostro fork su GitHub - communiteq/discourse-siwe-auth: Discourse plugin for SIWE authentication, non abbiamo ancora effettuato una PR all’upstream perché i commit di correzione sono un po’ disordinati, ma funziona bene.
