Browse Source

add room namespaces whitelist

main
ghost 12 months ago
parent
commit
dc4e9d61c2
  1. 12
      .env
  2. 4
      config/services.yaml
  3. 4
      src/Controller/ModuleController.php
  4. 4
      src/Controller/RoomController.php
  5. 4
      templates/default/module/info.html.twig

12
.env

@ -31,16 +31,16 @@ APP_KEVACOIN_PORT=9992
APP_KEVACOIN_USERNAME=EDIT_ME APP_KEVACOIN_USERNAME=EDIT_ME
APP_KEVACOIN_PASSWORD=EDIT_ME APP_KEVACOIN_PASSWORD=EDIT_ME
# Default room namespace (must be owned to accept posts)
APP_KEVACOIN_NAMESPACE=EDIT_ME
# Address to receive kevacoin powers (make others able to fill node balance)
APP_KEVACOIN_ADDRESS=EDIT_ME
# Share with other some mining pool to get coins # Share with other some mining pool to get coins
APP_KEVACOIN_MINE_POOL_URL=https://miningpoolstats.stream/kevacoin APP_KEVACOIN_MINE_POOL_URL=https://miningpoolstats.stream/kevacoin
APP_KEVACOIN_MINE_SOLO_URL=https://kevacoin.org/tutorial_solo_mining.html APP_KEVACOIN_MINE_SOLO_URL=https://kevacoin.org/tutorial_solo_mining.html
# Address to receive kevacoin powers (make others able to fill node balance)
APP_KEVACOIN_MINE_ADDRESS=EDIT_ME
# Allowed room namespaces, separated with | (must be owned to accept posts)
APP_KEVACOIN_ROOM_NAMESPACES=EDIT_ME
# Allow remotes to create new rooms (namespaces) # Allow remotes to create new rooms (namespaces)
APP_ADD_ROOM_REMOTE_IP_REGEX=/.*/ APP_ADD_ROOM_REMOTE_IP_REGEX=/.*/

4
config/services.yaml

@ -12,8 +12,8 @@ parameters:
app.kevacoin.port: '%env(APP_KEVACOIN_PORT)%' app.kevacoin.port: '%env(APP_KEVACOIN_PORT)%'
app.kevacoin.username: '%env(APP_KEVACOIN_USERNAME)%' app.kevacoin.username: '%env(APP_KEVACOIN_USERNAME)%'
app.kevacoin.password: '%env(APP_KEVACOIN_PASSWORD)%' app.kevacoin.password: '%env(APP_KEVACOIN_PASSWORD)%'
app.kevacoin.namespace: '%env(APP_KEVACOIN_NAMESPACE)%' app.kevacoin.room.namespaces: '%env(APP_KEVACOIN_ROOM_NAMESPACES)%'
app.kevacoin.address: '%env(APP_KEVACOIN_ADDRESS)%' app.kevacoin.mine.address: '%env(APP_KEVACOIN_MINE_ADDRESS)%'
app.kevacoin.mine.pool.url: '%env(APP_KEVACOIN_MINE_POOL_URL)%' app.kevacoin.mine.pool.url: '%env(APP_KEVACOIN_MINE_POOL_URL)%'
app.kevacoin.mine.solo.url: '%env(APP_KEVACOIN_MINE_SOLO_URL)%' app.kevacoin.mine.solo.url: '%env(APP_KEVACOIN_MINE_SOLO_URL)%'

4
src/Controller/ModuleController.php

@ -26,11 +26,11 @@ class ModuleController extends AbstractController
'wallet' => 'wallet' =>
[ [
'balance' => (float) $client->getBalance(), 'balance' => (float) $client->getBalance(),
'block' => (int) $client->getBlockCount(), 'block' => (int) $client->getBlockCount()
'address' => $this->getParameter('app.kevacoin.address')
], ],
'mine' => 'mine' =>
[ [
'address' => $this->getParameter('app.kevacoin.mine.address'),
'pool' => 'pool' =>
[ [
'url' => $this->getParameter('app.kevacoin.mine.pool.url') 'url' => $this->getParameter('app.kevacoin.mine.pool.url')

4
src/Controller/RoomController.php

@ -23,7 +23,7 @@ class RoomController extends AbstractController
return $this->redirectToRoute( return $this->redirectToRoute(
'room_namespace', 'room_namespace',
[ [
'namespace' => $this->getParameter('app.kevacoin.namespace') 'namespace' => explode('|', $this->getParameter('app.kevacoin.room.namespaces'))[0]
] ]
); );
} }
@ -149,7 +149,7 @@ class RoomController extends AbstractController
return $this->redirectToRoute( return $this->redirectToRoute(
'room_namespace', 'room_namespace',
[ [
'namespace' => $this->getParameter('app.kevacoin.namespace') 'namespace' => explode('|', $this->getParameter('app.kevacoin.room.namespaces'))[0]
] ]
); );
} }

4
templates/default/module/info.html.twig

@ -2,10 +2,10 @@
{{ 'block:' | trans }} {{ wallet.block }} {{ 'block:' | trans }} {{ wallet.block }}
/ /
{{ 'balance:' | trans }} {{ wallet.balance }} {{ 'balance:' | trans }} {{ wallet.balance }}
{% if wallet.address %} {% if mine.address %}
/ /
{{ 'charge:' | trans }} {{ 'charge:' | trans }}
<pre>{{ wallet.address }}</pre> <pre>{{ mine.address }}</pre>
{% endif %} {% endif %}
{% if mine.pool %} {% if mine.pool %}
/ /

Loading…
Cancel
Save