Browse Source

add room namespaces whitelist

main
ghost 1 year 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 @@ -31,16 +31,16 @@ APP_KEVACOIN_PORT=9992
APP_KEVACOIN_USERNAME=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
APP_KEVACOIN_MINE_POOL_URL=https://miningpoolstats.stream/kevacoin
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)
APP_ADD_ROOM_REMOTE_IP_REGEX=/.*/

4
config/services.yaml

@ -12,8 +12,8 @@ parameters: @@ -12,8 +12,8 @@ parameters:
app.kevacoin.port: '%env(APP_KEVACOIN_PORT)%'
app.kevacoin.username: '%env(APP_KEVACOIN_USERNAME)%'
app.kevacoin.password: '%env(APP_KEVACOIN_PASSWORD)%'
app.kevacoin.namespace: '%env(APP_KEVACOIN_NAMESPACE)%'
app.kevacoin.address: '%env(APP_KEVACOIN_ADDRESS)%'
app.kevacoin.room.namespaces: '%env(APP_KEVACOIN_ROOM_NAMESPACES)%'
app.kevacoin.mine.address: '%env(APP_KEVACOIN_MINE_ADDRESS)%'
app.kevacoin.mine.pool.url: '%env(APP_KEVACOIN_MINE_POOL_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 @@ -26,11 +26,11 @@ class ModuleController extends AbstractController
'wallet' =>
[
'balance' => (float) $client->getBalance(),
'block' => (int) $client->getBlockCount(),
'address' => $this->getParameter('app.kevacoin.address')
'block' => (int) $client->getBlockCount()
],
'mine' =>
[
'address' => $this->getParameter('app.kevacoin.mine.address'),
'pool' =>
[
'url' => $this->getParameter('app.kevacoin.mine.pool.url')

4
src/Controller/RoomController.php

@ -23,7 +23,7 @@ class RoomController extends AbstractController @@ -23,7 +23,7 @@ class RoomController extends AbstractController
return $this->redirectToRoute(
'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 @@ -149,7 +149,7 @@ class RoomController extends AbstractController
return $this->redirectToRoute(
'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 @@ @@ -2,10 +2,10 @@
{{ 'block:' | trans }} {{ wallet.block }}
/
{{ 'balance:' | trans }} {{ wallet.balance }}
{% if wallet.address %}
{% if mine.address %}
/
{{ 'charge:' | trans }}
<pre>{{ wallet.address }}</pre>
<pre>{{ mine.address }}</pre>
{% endif %}
{% if mine.pool %}
/

Loading…
Cancel
Save