]> jfr.im git - irc/unrealircd/unrealircd-webpanel.git/log
irc/unrealircd/unrealircd-webpanel.git
12 months agoRename the information tab to Info
Valerie Pond [Fri, 12 May 2023 16:13:11 +0000 (17:13 +0100)] 
Rename the information tab to Info

12 months agoMake the server bans page according to @syzop request
Valerie Pond [Fri, 12 May 2023 16:10:40 +0000 (17:10 +0100)] 
Make the server bans page according to @syzop request

12 months agoPanelUser->add_meta(): Accept arrays as well as strings
Valerie Pond [Fri, 12 May 2023 16:09:20 +0000 (17:09 +0100)] 
PanelUser->add_meta(): Accept arrays as well as strings

12 months agoDeal quicker with dead event loop processes. End-users need to run 'composer install'.
Bram Matthys [Mon, 8 May 2023 06:29:04 +0000 (08:29 +0200)] 
Deal quicker with dead event loop processes. End-users need to run 'composer install'.

Long story:
In the panel we have some background tasks, like the live "Network Overview", the
"Logs" live view, but also the notification that works on every page behind-the-scenes,
that will show popups for server errors/warnings.
Depending on the webserver and PHP backend, but in particular with fast cgi modules,
these PHP processes may not see the browser as being "gone" until they actually send
something, so we send something when $rpc->eventloop() returns, which is guaranteed to
return at least every 10 seconds (if there is no data, quicker otherwise).

This means that, until now, it took up to 10 seconds for these PHP processes to die.
If you are quickly browsing from one page to the other, then - especially with the
main overview or the logs page which causes 2 processes - you could hit your PHP max
processes or max workers, especially if you have a relatively low limit of like 10.

Upstream commit of unrealircd-rpc-php changes the returning behavior (when idle) from
every 10 seconds to every 2 seconds, which should help a lot.

If you still have situations where pages don't load at all or get max processes reached
in your webserver logs then you should really bump your PHP process/workers limit.
There's no way around that :).

12 months agoFix Role Editor: make the role stuff db-independent (most code already was).
Bram Matthys [Sun, 7 May 2023 17:24:45 +0000 (19:24 +0200)] 
Fix Role Editor: make the role stuff db-independent (most code already was).
Get rid of the ROLE hooks at the same time, since they can all be accessed
via the generic config API, right ?

12 months agoServer detail view: don't show TLS / Channel modes / User modes if not available.
Bram Matthys [Sun, 7 May 2023 11:59:46 +0000 (13:59 +0200)] 
Server detail view: don't show TLS / Channel modes / User modes if not available.
Like on services servers. Previously PHP errors were generated.

12 months agoLogs: Add some explanation in the initial header. At least for now when
Bram Matthys [Sun, 7 May 2023 11:52:31 +0000 (13:52 +0200)] 
Logs: Add some explanation in the initial header. At least for now when
most people are not using 6.1.1 yet since it is not released :)

12 months agoCheck for sodium module being loaded, and abstract the PHP module checker.
Bram Matthys [Sun, 7 May 2023 11:46:25 +0000 (13:46 +0200)] 
Check for sodium module being loaded, and abstract the PHP module checker.

Issue of missing sodium module reported by Madriix in
https://github.com/unrealircd/unrealircd-webpanel/issues/30

12 months agoFix warning/error in channel sorting.
Bram Matthys [Sun, 7 May 2023 11:31:22 +0000 (13:31 +0200)] 
Fix warning/error in channel sorting.
Reported by Madriix in https://github.com/unrealircd/unrealircd-webpanel/issues/30
Fix suggested by ghostnode on IRC.

12 months agoShow helpful error message if php-mbstring is not installed
Bram Matthys [Sat, 6 May 2023 18:11:05 +0000 (20:11 +0200)] 
Show helpful error message if php-mbstring is not installed

12 months agoApache w/FPM: workaround for pages hanging and becoming completely unresponsive.
Bram Matthys [Sat, 6 May 2023 17:28:04 +0000 (19:28 +0200)] 
Apache w/FPM: workaround for pages hanging and becoming completely unresponsive.
Reported by Thoraxx.

And yeah, it would be better if users would reconfigure their fcgi proxy and
tweak apache conf with flushpackets=on but I think it is "too difficult" for
users. Ideally we would detect the condition and error or warn, but.. yeah...
if anyone has a better idea, or knows of a PHP trick to force flushpackets=on
at runtime, tell me :D

12 months agoLogs: add search placeholder to give a hint of nick / ip to search on
Bram Matthys [Fri, 5 May 2023 17:03:36 +0000 (19:03 +0200)] 
Logs: add search placeholder to give a hint of nick / ip to search on

12 months agoLogs: you can now enter an IP address or nickid in the search field.
Bram Matthys [Fri, 5 May 2023 16:51:19 +0000 (18:51 +0200)] 
Logs: you can now enter an IP address or nickid in the search field.
This because it now searches in all JSON data, include IP addresses,
nickid, nicks, hostnames, etc... makes it very easy to filter on
all events of a particular person or host.

12 months agoApply fix a8d2da775b3e8a9991b3979d604f3a0218d66085 again
Bram Matthys [Fri, 5 May 2023 13:30:59 +0000 (15:30 +0200)] 
Apply fix a8d2da775b3e8a9991b3979d604f3a0218d66085 again

12 months agoLogs: filter past logs as well. End users must run 'composer install'
Bram Matthys [Fri, 5 May 2023 13:12:58 +0000 (15:12 +0200)] 
Logs: filter past logs as well. End users must run 'composer install'

12 months agoLogs: don't show join/part/kick in live view by default.
Bram Matthys [Fri, 5 May 2023 13:00:18 +0000 (15:00 +0200)] 
Logs: don't show join/part/kick in live view by default.

See comment...
/* Add these as well, they are not logged by default
 * in the memory log either. See
 * https://github.com/unrealircd/unrealircd/commit/45342c2d33968178cd07a12cd6fdc4e65b604134
 * Added here separately because we may want to make
 * this an option...
 */

12 months agoLogs: show search pane (on desktop)
Bram Matthys [Fri, 5 May 2023 12:39:22 +0000 (14:39 +0200)] 
Logs: show search pane (on desktop)

12 months agoFix CPU usage issue.
Bram Matthys [Fri, 5 May 2023 12:36:08 +0000 (14:36 +0200)] 
Fix CPU usage issue.

12 months agoLogs: you can now click on entries and see the full log entry + JSON
Bram Matthys [Fri, 5 May 2023 12:15:36 +0000 (14:15 +0200)] 
Logs: you can now click on entries and see the full log entry + JSON

12 months agoLog view: don't redraw when fetching 1000 log entries.
Bram Matthys [Fri, 5 May 2023 11:02:18 +0000 (13:02 +0200)] 
Log view: don't redraw when fetching 1000 log entries.
Instead, for historical logs, redraw every 100 events.
Then do an explicit redraw/sync. And then start the live ones.

Otherwise the CPU of the user browsing the panel is not happy :D

13 months agoFix some nav links css for mobile and for server switch
Valerie Pond [Sat, 29 Apr 2023 00:39:06 +0000 (01:39 +0100)] 
Fix some nav links css for mobile and for server switch

13 months agoJS: Dynamic modal dialogs, and move toasts to own file
Valerie Pond [Fri, 28 Apr 2023 23:39:17 +0000 (00:39 +0100)] 
JS: Dynamic modal dialogs, and move toasts to own file

13 months agomake table headers blue again
Valerie Pond [Fri, 28 Apr 2023 23:37:42 +0000 (00:37 +0100)] 
make table headers blue again

13 months agoChannels: possibly fix a bug when clicking on a channel (loading wrong URL).
Bram Matthys [Fri, 28 Apr 2023 10:38:12 +0000 (12:38 +0200)] 
Channels: possibly fix a bug when clicking on a channel (loading wrong URL).
Reported by Nini.

Only happens when base_url was / and then due to my wrongly added /
it would result in a href to //channels/ etc... which is misinterpreted
as https://channels/details.php..etc...

13 months agoFix again, run 'composer install' :D
Bram Matthys [Thu, 27 Apr 2023 18:43:22 +0000 (20:43 +0200)] 
Fix again, run 'composer install' :D

13 months agoFetch existing logs in Log screen. Only for git unrealircd.
Bram Matthys [Thu, 27 Apr 2023 18:37:52 +0000 (20:37 +0200)] 
Fetch existing logs in Log screen. Only for git unrealircd.
Or actually this isn't even committed yet....
Requires end users to run 'composer install' as well...

13 months agoFix UnrealIRCd 6.0.7 not working. End-users need to 'composer install'
Bram Matthys [Thu, 27 Apr 2023 18:05:59 +0000 (20:05 +0200)] 
Fix UnrealIRCd 6.0.7 not working. End-users need to 'composer install'

13 months agoStart on "Logs" (log viewer). This only shows live logs at the moment.
Bram Matthys [Thu, 27 Apr 2023 17:22:07 +0000 (19:22 +0200)] 
Start on "Logs" (log viewer). This only shows live logs at the moment.
Still to do:
* Click = all details
* Fetch past XYZ log entries (requires new unrealircd api call)

Since 'responsive' datatables were not working, i made it non-responsive
and did the responsiveness myself based on resolutions etc.
I kinda hate the manual fiddling but now it works great on mobile both
in landscape and portrait mode, and on various desktop resolutions.

13 months agoSet "issuer" already in connection call. This to speed up connection
Bram Matthys [Thu, 27 Apr 2023 14:37:17 +0000 (16:37 +0200)] 
Set "issuer" already in connection call. This to speed up connection
a bit as this causes unrealircd-rpc-php to skip a ping-pong and also
makes it not wait for the rpc.set_issuer call reply (since we don't
care that much).

13 months agoUpdate composer dependencies. End users need to run 'composer install'.
Bram Matthys [Thu, 27 Apr 2023 14:36:50 +0000 (16:36 +0200)] 
Update composer dependencies. End users need to run 'composer install'.
This so 02da13a9d49686e9a6c6254c7318e3e145debbf3 actually works
(set "issuer" in UnrealIRCd\Connection options to save 1 round trip).

Note: if end-user forgets to call 'composer install' then this means
set by is not logged now.

13 months agoserver-bans: switch title and button value to default
Valerie Pond [Thu, 27 Apr 2023 00:02:42 +0000 (01:02 +0100)] 
server-bans: switch title and button value to default

This fixes an issue where the header and button text for the modal for "Add Ban" was still "Edit Ban" after having previously clicked a ban to edit and now clicked "Add Ban" again.

13 months agoOverview: Make the "Live stats" only show if we have a live connection.
Bram Matthys [Wed, 26 Apr 2023 18:20:27 +0000 (20:20 +0200)] 
Overview: Make the "Live stats" only show if we have a live connection.
The "Live stats" will also automatically disappear if stats have not
been received past 10 seconds (we should receive it every 1sec).

TODO: Consider removing all values in such a scenario

TODO2: Consider showing a connection lost icon or something else..

13 months agoOverview: use the live feed only, don't initially set anything.
Bram Matthys [Wed, 26 Apr 2023 18:03:06 +0000 (20:03 +0200)] 
Overview: use the live feed only, don't initially set anything.
This avoids duplicate code and also makes the page load faster
on high latency connections.

13 months agoFor api_timer_loop() also execute the command immediately.
Bram Matthys [Wed, 26 Apr 2023 18:02:32 +0000 (20:02 +0200)] 
For api_timer_loop() also execute the command immediately.
This so you don't have to wait eg 1000ms for the first update.

13 months agoChannel list: Run StripControlCharacters() on the topic
Bram Matthys [Wed, 26 Apr 2023 17:52:25 +0000 (19:52 +0200)] 
Channel list: Run StripControlCharacters() on the topic

The alternative would be irc2html() from
https://github.com/unrealircd/unrealircd-webpanel/pull/24
but not so sure about that... it makes colors and other markup
done by random users show quite prominently on an admin panel.

13 months agoChannels: convert to use datatables
Bram Matthys [Wed, 26 Apr 2023 17:18:01 +0000 (19:18 +0200)] 
Channels: convert to use datatables

13 months agoServer-Bans: underline on hover at mask (even though clicking actually works
Bram Matthys [Wed, 26 Apr 2023 16:49:21 +0000 (18:49 +0200)] 
Server-Bans: underline on hover at mask (even though clicking actually works
in all rows... hm...)

13 months agoServer Bans: don't do "edit ban" popup when selecting bans for deletion.
Bram Matthys [Wed, 26 Apr 2023 16:39:08 +0000 (18:39 +0200)] 
Server Bans: don't do "edit ban" popup when selecting bans for deletion.

13 months agoMake API pages return empty data / die when server is not available.
Bram Matthys [Wed, 26 Apr 2023 16:27:57 +0000 (18:27 +0200)] 
Make API pages return empty data / die when server is not available.
This fixes annoying JS popup in "Users" and "Server bans" when the
IRC server is down.

13 months agoFix issue with @ob_end_flush() still throwing an error
Bram Matthys [Wed, 26 Apr 2023 16:26:15 +0000 (18:26 +0200)] 
Fix issue with @ob_end_flush() still throwing an error
(yeah, it throws now instead of... well... PHP manual is outdated i guess)

13 months agoUpdate the page title depending on what page you are.
Bram Matthys [Wed, 26 Apr 2023 15:55:29 +0000 (17:55 +0200)] 
Update the page title depending on what page you are.
Suggested by Madriix.

13 months agoFix everyone getting "No RPC server configured" :D
Bram Matthys [Wed, 26 Apr 2023 15:16:31 +0000 (17:16 +0200)] 
Fix everyone getting "No RPC server configured" :D

13 months agoAdd simple way to deal with IRC server configuration required.
Bram Matthys [Wed, 26 Apr 2023 07:45:53 +0000 (09:45 +0200)] 
Add simple way to deal with IRC server configuration required.
This handles the "no_irc_server_required" property on $pages.

Also renames "url" property to "script" in $pages in previous commit,
since it points to the script page (eg server-bans/index.php).
It will automatically strip /index.php if possible.

13 months agoMake $pages[] not have a string value in the end but an array with ["url"=>...]
Bram Matthys [Wed, 26 Apr 2023 07:13:06 +0000 (09:13 +0200)] 
Make $pages[] not have a string value in the end but an array with ["url"=>...]
Plugins that add nav will need updating.

13 months agoNicer error dialog in connect_to_ircd()
Bram Matthys [Wed, 26 Apr 2023 07:02:19 +0000 (09:02 +0200)] 
Nicer error dialog in connect_to_ircd()

13 months agoOn assigning role, call $user->delete_meta("permissions");
Bram Matthys [Wed, 26 Apr 2023 06:57:36 +0000 (08:57 +0200)] 
On assigning role, call $user->delete_meta("permissions");

13 months agoFix del_usermeta() not working for both sql_db and file_db
Bram Matthys [Wed, 26 Apr 2023 06:56:00 +0000 (08:56 +0200)] 
Fix del_usermeta() not working for both sql_db and file_db
(We just didn't notice until now)

13 months agoFinish switching to Roles
Valerie Pond [Tue, 25 Apr 2023 19:55:07 +0000 (20:55 +0100)] 
Finish switching to Roles

13 months agoServer Bans: Softban fixes on the panel side. Requires latest UnrealIRCd git.
Bram Matthys [Tue, 25 Apr 2023 13:44:12 +0000 (15:44 +0200)] 
Server Bans: Softban fixes on the panel side. Requires latest UnrealIRCd git.
It also seems there are still bugs in this area (on the
panel side)

13 months agoServer bans: you can now click on any existing ban to edit, and changed modal.
Bram Matthys [Tue, 25 Apr 2023 12:57:20 +0000 (14:57 +0200)] 
Server bans: you can now click on any existing ban to edit, and changed modal.
Should probably make the former a bit more obvious in the UI.

13 months agoServer Bans: responsive datatables and auto truncate "Reason".
Bram Matthys [Tue, 25 Apr 2023 08:33:25 +0000 (10:33 +0200)] 
Server Bans: responsive datatables and auto truncate "Reason".

13 months agoAdd js/datatables-ellipsis.js for automatic truncating of table fields (eg: reason)
Bram Matthys [Tue, 25 Apr 2023 08:32:59 +0000 (10:32 +0200)] 
Add js/datatables-ellipsis.js for automatic truncating of table fields (eg: reason)

13 months agoUsers: code cleanup: remove old filtering code, not needed anymore.
Bram Matthys [Tue, 25 Apr 2023 06:53:06 +0000 (08:53 +0200)] 
Users: code cleanup: remove old filtering code, not needed anymore.

13 months agoUsers: make actions work again (broken when datatables were added 2d ago)
Bram Matthys [Tue, 25 Apr 2023 06:49:14 +0000 (08:49 +0200)] 
Users: make actions work again (broken when datatables were added 2d ago)

13 months agoUsers: bring back striped table (was removed while debugging render issue)
Bram Matthys [Tue, 25 Apr 2023 06:42:41 +0000 (08:42 +0200)] 
Users: bring back striped table (was removed while debugging render issue)

13 months agoUsers: get rid of "user modes" column. Similar to previous, at least for now.
Bram Matthys [Tue, 25 Apr 2023 06:39:51 +0000 (08:39 +0200)] 
Users: get rid of "user modes" column. Similar to previous, at least for now.

13 months agoUsers: Scratch the "Secure" column, as it's less useful nowadays that
Bram Matthys [Tue, 25 Apr 2023 06:33:15 +0000 (08:33 +0200)] 
Users: Scratch the "Secure" column, as it's less useful nowadays that
hopefully more and more, if not all, users are secure.

We can bring it back, that's why this commit is contained.

13 months agoFix issues with NGINX: notifications, user list, server ban list.
Bram Matthys [Tue, 25 Apr 2023 06:27:23 +0000 (08:27 +0200)] 
Fix issues with NGINX: notifications, user list, server ban list.
Basically all the API calls that used common_api.php. Reported by Nini.

13 months agoUse responsive datatables in Users view: automatic column priority etc.
Bram Matthys [Tue, 25 Apr 2023 06:12:01 +0000 (08:12 +0200)] 
Use responsive datatables in Users view: automatic column priority etc.
* Actually in mobile this seems to have a glitch, it shows one column too
  much, which corrects itself as soon as you scroll.
* On a big screen the "Oper" and "Secure" columns are still not shown
  even though they could be. Then again, those columns are not really
  important so may be scratched altogether.
* If all this turns out not to work too well, then we can always revert
  revert the changes to users/index.php, i guess.

13 months agoUsers: hide filter pane on mobile. Still not sure why the width is so fuqd.
Bram Matthys [Mon, 24 Apr 2023 19:36:50 +0000 (21:36 +0200)] 
Users: hide filter pane on mobile. Still not sure why the width is so fuqd.

13 months agoUsers Overview: fix dynamic showing/hiding of rows.
Bram Matthys [Mon, 24 Apr 2023 18:54:48 +0000 (20:54 +0200)] 
Users Overview: fix dynamic showing/hiding of rows.

13 months agoMake Users list use Datatables with a Search Pane (filter) and Search bar.
Bram Matthys [Mon, 24 Apr 2023 17:49:35 +0000 (19:49 +0200)] 
Make Users list use Datatables with a Search Pane (filter) and Search bar.

13 months agoMove datatables CSS/JS include to inc/header.php.
Bram Matthys [Mon, 24 Apr 2023 16:35:55 +0000 (18:35 +0200)] 
Move datatables CSS/JS include to inc/header.php.

13 months agoSettings - RPC Servers: fix missing quotes (javascript error)
Bram Matthys [Mon, 24 Apr 2023 14:10:43 +0000 (16:10 +0200)] 
Settings - RPC Servers: fix missing quotes (javascript error)

13 months agoDisplay SQL error during installation, if we get one.
Bram Matthys [Mon, 24 Apr 2023 13:17:39 +0000 (15:17 +0200)] 
Display SQL error during installation, if we get one.

13 months agoDeal with empty RPC servers better.
Bram Matthys [Mon, 24 Apr 2023 13:04:41 +0000 (15:04 +0200)] 
Deal with empty RPC servers better.

13 months agoTop-nav: allow switching between configured RPC servers.
Bram Matthys [Mon, 24 Apr 2023 12:03:16 +0000 (14:03 +0200)] 
Top-nav: allow switching between configured RPC servers.

NOTE: This currently switches the default RPC server for everyone.
Plan is to later make this per-user or more likely per-session.

Untested: mobile.. should probably be hidden there or tucked under nav.

13 months agoSettings - RPC Servers: confirm dialog for server deletion
Bram Matthys [Mon, 24 Apr 2023 11:00:24 +0000 (13:00 +0200)] 
Settings - RPC Servers: confirm dialog for server deletion

13 months agoSettings - RPC Servers: Don't re-order list on edit.
Bram Matthys [Mon, 24 Apr 2023 10:34:07 +0000 (12:34 +0200)] 
Settings - RPC Servers: Don't re-order list on edit.
And also fix editing wrong entry.

13 months agoSettings - RPC Servers: click item - add "Delete Server"
Bram Matthys [Mon, 24 Apr 2023 10:15:39 +0000 (12:15 +0200)] 
Settings - RPC Servers: click item - add "Delete Server"

13 months agoSome initial instructions if servers is empty.
Bram Matthys [Mon, 24 Apr 2023 09:58:06 +0000 (11:58 +0200)] 
Some initial instructions if servers is empty.

13 months agoNow that we have "RPC Servers" in settings, make installer redirect to that.
Bram Matthys [Mon, 24 Apr 2023 09:50:52 +0000 (11:50 +0200)] 
Now that we have "RPC Servers" in settings, make installer redirect to that.

So instead of redirecting to settings/install2.php we now redirect to
settings/rpc-servers.php.

That page still needs to be modified for "initial setup instructions" though.

This also renames api/installation2.php -> api/test_rpc_server.php

13 months agoAdd Settings - RPC Servers (start of multi-server work).
Bram Matthys [Mon, 24 Apr 2023 09:48:10 +0000 (11:48 +0200)] 
Add Settings - RPC Servers (start of multi-server work).
This also makes $config["unrealircd"] an array now.

13 months agoServer Bans: fetch the banlist in the background
Bram Matthys [Sun, 23 Apr 2023 19:55:31 +0000 (21:55 +0200)] 
Server Bans: fetch the banlist in the background

13 months agoUse non-slim jquery, so we have AJAX requests available
Bram Matthys [Sun, 23 Apr 2023 19:55:08 +0000 (21:55 +0200)] 
Use non-slim jquery, so we have AJAX requests available

13 months agoUse datatables in "Server Bans" view (initial work / demo)
Bram Matthys [Sun, 23 Apr 2023 19:01:07 +0000 (21:01 +0200)] 
Use datatables in "Server Bans" view (initial work / demo)

13 months agofile_auth -> file_db and sql_auth -> sql_db. Config of existing setups
Bram Matthys [Sun, 23 Apr 2023 16:49:48 +0000 (18:49 +0200)] 
file_auth -> file_db and sql_auth -> sql_db. Config of existing setups
are modified automatically by rewriting config/config.php.

13 months agoSetup: actually delete data/database.php as well (after confirmation)
Bram Matthys [Sun, 23 Apr 2023 16:00:39 +0000 (18:00 +0200)] 
Setup: actually delete data/database.php as well (after confirmation)

Similar to previous commit, but for file_auth instead of sql_auth.

13 months agoSetup: acctually delete SQL tables (after confirmation and filling in user info)
Bram Matthys [Sun, 23 Apr 2023 15:42:35 +0000 (17:42 +0200)] 
Setup: acctually delete SQL tables (after confirmation and filling in user info)

13 months agoSetup: warn if file_auth database exists too
Bram Matthys [Sun, 23 Apr 2023 15:37:09 +0000 (17:37 +0200)] 
Setup: warn if file_auth database exists too

13 months agoSetup: fix error about undefined "secrets". Reported by Nini.
Bram Matthys [Sun, 23 Apr 2023 15:36:28 +0000 (17:36 +0200)] 
Setup: fix error about undefined "secrets". Reported by Nini.

13 months agoAdd warning if there is already data in the SQL database.
Bram Matthys [Sun, 23 Apr 2023 15:17:16 +0000 (17:17 +0200)] 
Add warning if there is already data in the SQL database.

Also, jump from step 1 to step 2 if things are correct without having
to press another button.

13 months agoSetup: Use HTTP POST instead of GET when testing MySQL and RPC credentials.
Bram Matthys [Sun, 23 Apr 2023 14:43:04 +0000 (16:43 +0200)] 
Setup: Use HTTP POST instead of GET when testing MySQL and RPC credentials.
This so they don't end up in the webserver access log ;)

13 months agoSetup: fix connection check not working with passwords with & and possibly
Bram Matthys [Sun, 23 Apr 2023 14:30:14 +0000 (16:30 +0200)] 
Setup: fix connection check not working with passwords with & and possibly
other characters.

13 months agoDisable autocomplete in setup pages for user/password of SQL and RPC as these
Bram Matthys [Sun, 23 Apr 2023 14:22:19 +0000 (16:22 +0200)] 
Disable autocomplete in setup pages for user/password of SQL and RPC as these
have nothing to do with the web login so it is only confusing.
Still allow autocomplete for the "Create account" thing though, eg for devs
doing repeated setups.

13 months agoRole Editor: can now add/duplicate and delete roles.
Valerie Pond [Sat, 22 Apr 2023 23:24:15 +0000 (00:24 +0100)] 
Role Editor: can now add/duplicate and delete roles.

13 months agoSimplify a line.
Bram Matthys [Sat, 22 Apr 2023 16:31:18 +0000 (18:31 +0200)] 
Simplify a line.

13 months agoMove cfg/defines.php to inc/, to avoid confusing with user-configurable
Bram Matthys [Sat, 22 Apr 2023 16:04:00 +0000 (18:04 +0200)] 
Move cfg/defines.php to inc/, to avoid confusing with user-configurable
things, which it is not, or at least not in that file.

13 months agoMove some PHP files from ./ to ./inc: common, connection, header, footer
Bram Matthys [Sat, 22 Apr 2023 16:01:31 +0000 (18:01 +0200)] 
Move some PHP files from ./ to ./inc: common, connection, header, footer

13 months agoTry to be helpful if someone mixes wrong secrets::key with (old) DB unrealircd::rpc_p...
Bram Matthys [Sat, 22 Apr 2023 15:12:53 +0000 (17:12 +0200)] 
Try to be helpful if someone mixes wrong secrets::key with (old) DB unrealircd::rpc_password

13 months agounrealircd::rpc_password is now encrypted with secret::key (XChaCha20-Poly1305-IETF)
Bram Matthys [Sat, 22 Apr 2023 15:04:50 +0000 (17:04 +0200)] 
unrealircd::rpc_password is now encrypted with secret::key (XChaCha20-Poly1305-IETF)
Again, the purpose is so if any bad person gets a copy of your DB then the
stored RPC password is still useless since they also need your config/config.php.

Old unencrypted unrealircd::rpc_password entries are automatically
encrypted (upgraded).

Similar to previous commit 6b08fcb99e66665e7e4f345702915d7192fcd27b
this means you cannot blindly 'rm config/config.php' and then expect
your existing DB to still work with a random new (and different) key.

13 months agoThe config file now contains 'secrets' with 'pepper' that is used for
Bram Matthys [Sat, 22 Apr 2023 14:32:21 +0000 (16:32 +0200)] 
The config file now contains 'secrets' with 'pepper' that is used for
hashing passwords in the database. This means a hacker now needs to
have config.php to attack the (hashed) passwords in the database.
This may not be very meaningful if the DB backend is file_auth, but
can be useful for example if the backend is sql_auth and your database
backup (mysqldump) gets leaked.

We automatically create the secrets (like pepper) and automatically
upgrade password hashes to use pepper while each user logs in.
This does need write access to config/config.php while upgrading, though.

The hashed passwords in the database will have the prefix "peppered:"
if they have been upgraded to use pepper.

A side-effect of this is that you cannot blindly 'rm config/config.php'
and start the installation over again while keeping your old database.
This because the hashed passwords in the existing database were created
with an old pepper value and the new setup would create a random new
pepper value, making the hashes worthless (and wrong).
This mostly matters for devs though, but it is something for testers
to be aware of as well.

13 months agoMore towards the Role Editor
Valerie Pond [Sat, 22 Apr 2023 11:06:28 +0000 (12:06 +0100)] 
More towards the Role Editor

13 months agoCheck if opcache_invalidate() is available, before calling it, fixing HTTP 500
Bram Matthys [Sat, 22 Apr 2023 07:11:13 +0000 (09:11 +0200)] 
Check if opcache_invalidate() is available, before calling it, fixing HTTP 500
in setup screen.

Reported by Madriix in https://github.com/unrealircd/unrealircd-webpanel/issues/26

13 months agoFix file auth not working since about 24hrs ago
Bram Matthys [Sat, 22 Apr 2023 06:54:19 +0000 (08:54 +0200)] 
Fix file auth not working since about 24hrs ago

13 months agoAdd api/index.php config/index.php (empty) + config/index.php data/.gitignore
Bram Matthys [Fri, 21 Apr 2023 19:04:09 +0000 (21:04 +0200)] 
Add api/index.php config/index.php (empty) + config/index.php data/.gitignore

13 months agoThis plugins/sql_auth/error.php is no longer used
Bram Matthys [Fri, 21 Apr 2023 18:59:10 +0000 (20:59 +0200)] 
This plugins/sql_auth/error.php is no longer used

13 months agoSomething tells me this was just a test page ;)
Bram Matthys [Fri, 21 Apr 2023 18:57:48 +0000 (20:57 +0200)] 
Something tells me this was just a test page ;)

13 months agoShow git short hash as version for now (ok.. not ideal.. but it fits :D)
Bram Matthys [Fri, 21 Apr 2023 18:07:01 +0000 (20:07 +0200)] 
Show git short hash as version for now (ok.. not ideal.. but it fits :D)

Whoops.. webpanel_version was not actually set so we were re-running the
create_tables / upgrade code all the time.

13 months agoIt is now mandatory to load an auth provider: either sql_auth or file_auth.
Bram Matthys [Fri, 21 Apr 2023 17:57:31 +0000 (19:57 +0200)] 
It is now mandatory to load an auth provider: either sql_auth or file_auth.