Repository navigation
Follow a start, edit server.cfg, turn Tools into a hub, and count what the resources do on Debug pages - #54
Merged
Merged
Conversation
…delay, however long it lasts
…iles each browser loads
…ates are left as found
…nd let the owner give it 15 more minutes
…ts masked and earlier versions kept
…the heavy assets and missing files FXServer warned about
…rails and switch the map's style
… port without restarting Observer
…ources, on three Debug pages
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Twelve commits, one per piece of work, each of which builds and passes on its own. Together: a start that is followed resource by resource instead of being killed at a fixed budget,
server.cfgedited from the panel, a Tools page that holds several tools and stages a fix for the next start, a live map over Rockstar's own map with a list of players and their trails, the rail's pages grouped with a search over them, SFTP's address given in the panel, and a Debug group that counts what the resources send, write and call.What changed
A start is hung once it starts nothing, not once it is long (
a199bcb)observer-fxserver: FXServer runs its cfg before any thread of a resource, the bridge's included, so a start gives no heartbeat. The hang delay was counted from the spawn to the first answer, and a big server's first start was killed at the delay while it still started resources. Until the cfg has run, eachStarted resourceline now counts in the heartbeat's place: a start is hung once it has started no resource for the delay, however long it takes in all, and the console names the last resource it started.observer-app: the file-changes job waits for the server to be online for 30 minutes at most, 3 before, so that it does not hash the folder beside a start that reads the same files.Following a start (
5d37ca0)observer-fxserver(start): reads the console while FXServer runs its cfg: the resources up, those that did not start, how many the folder holds. The command the start is at (ensure [clothes],server.cfgline 226, 12 of its 150 resources up) is worked out from the resources eachensureandstartof the cfg starts, a category being every resource under the folder of that name. When Observer cannot read every command, as when the cfg executes a file inside a resource, it says so rather than guess.observer-domain:ServerStatus.start(StartProgress: started, failed, found, planned, the last resource, the command, the five slowest, and when the start will be taken for stuck). Audit actionserver_start_extended; error codeserver_not_starting.observer-web:POST /servers/default/start/extend(SERVER_CONTROL) gives the start under way 15 minutes more, as often as needed. The hang delay itself is not changed.server.cfg, edited from the panel (
7b1e233)observer-fxserver(cfg_edit): a save rewrites only what changed. Comments, blank lines, order, line ends and a byte order mark stay as they were. Secrets never reach the browser: they stand in the text as<<secret-1>>,<<secret-2>>, and a save puts each back where its mark still is.observer-store: migration0016_cfg_versions.sql, the file as it was before each save: the latest 20 versions, with who replaced each and when.observer-web:GETandPUT /servers/default/cfg,POST …/cfg/check,POST …/cfg/diff,GET …/cfg/versions,GET …/cfg/versions/{id}andPOST …/cfg/versions/{id}/restore, all the owner's, a save and a restore with the password again. A save is refused when the file on disk is no longer the one the edit started from, and applies at the next start of FXServer.observer-domain:cfg. Audit actionsserver_cfg_changedandserver_cfg_restored, which hold the lines added and removed, never their text. Error codescfg_not_editable,cfg_changed,invalid_cfg_text,cfg_version_not_found.execare refused; the checks still read those.Tools as a hub, and a fix staged for the next start (
a57fc72,37a3648)0017_tool_staged.sqlkeeps the plan's SHA-256, one staged fix at most for each tool.POSTandDELETE /tools/duplicate-archetypes/stage, the owner's with the password again; audit actionstool_fix_stagedandtool_fix_unstaged.GET /servers/default/start/warnings). Observer rewrites no texture: the list is what to work from.37a3648).Live map (
2528d06,ee829c9)MapSettings.imagery(MapImagery, Atlas by default, with the owner's image and the grid as the two other choices), which settings sent without it still parse. Each browser loads the tiles from Rockstar's servers; Observer ships and keeps no map. The CSP'simg-srcgainshttps://s.rsg.sc, that one host.The rail and a search (
8fde965,02d2475)shell/nav.tsholds the pages the rail and the search share.SFTP's address in the panel (
6fb596b,cde8f13)observer(sftp) opens, moves and closes the port at once, without a restart of Observer or of FXServer. A port that does not open never stops Observer: the panel says what the host answered, and SFTP waits until the address is given again or changed.GET /settings/sftp(SETTINGS_VIEW) says where SFTP listens, whetherobserver.tomlnames the address, whether the port is open and the fingerprint of the host key;PUT /settings/sftpis the owner's. Audit actionsftp_listen_changed; error codessftp_listen_pinnedandinvalid_sftp_listen.[sftp]inobserver.tomlstill names the address: the panel then shows it and cannot change it, and it is read at Observer's start, which stops if the port is taken, as before.Features::switchednow takes the feature's stop first when whoever keeps the task closes it at the same moment; it picked between the two at random, and the log then did not say the switch ended the task.6fb596bshowed the two linesobserver.tomlneeded.cde8f13replaces that guide with the address card; the README keeps the lines.Debug (
f2b0d4e)debug, the only one that starts off. It counts from the next start of FXServer.observer-fxserver(hook): at each start while Debug is on, Observer adds one line at the top and one at the end of the build'scitizen/scripting/lua/scheduler.lua, the file every server Lua runtime runs first, and keeps the file as it was beside it (scheduler.lua.original). Once Debug is off, the next start puts the file back byte for byte. A build whose scheduler Observer does not recognise is left as it is and starts all the same. Nothing is added to the server's resources.resource/observer/hook.lua, which those two lines load into each resource: it counts the events sent and received with the time their handlers take, the state bag writes and the HTTP requests, and reports once a second through the structured traces. Names, counts and sizes only: never an event's payload, a state bag's value, or the path, query, body or answer of a request. The bridge's own runtime counts nothing.observer-app(debug): the counts in 5-second slices for 15 minutes, in memory, gone with the server's run, and rates taken over the seconds really counted. Migration0018_debug_hosts.sqlstores the hosts each resource called, with the time of the first call; for the first 24 hours Debug counts, every host is taken as known.observer-web:GET /debug/status,/debug/events,/debug/bagsand/debug/http(DIAGNOSTICS_VIEW), andPOST /debug/http/known, the owner's. Audit actiondebug_host_known.server.luaandCONTRACT.mdare unchanged.Alongside
fake_start_ms <ms>andfake_start_ms:<name>,fake_fail_start <name>,fake_heavy <names>andfake_missing <names>; a stand-in for the hook, which reports for every started resource of a hooked build, withfake_debug_demo 1,fake_debug_silent <names>andfake_debug <resource> <list> <fields...>on stdin.Notes for review
observer.tomlwins when it names the address; turning SFTP on applies at once rather than at Observer's next start; theobserver.tomlguide left the panel.Verified
mainat Give the server setup a screen of its own, and fix what a pass over the panel found #53:cargo fmt --all --check,cargo xtask icons --check, clippy on all targets with-D warnings, with and withoutobserver/test-catalog,cargo test --workspace(2,692 passed, none failed),cargo xtask bindingsleaving the tree as it is, and the panel's format, lint, type check, 758 tests and build. The panel ran under Node 26.13.cargo fmt --check, bindings unchanged, clippy, and the panel's format, lint, type check and tests. The Rust tests ran whole ona199bcb,7b1e233,02d2475andcde8f13as well as on the head.Not verified
hook.luahas never been executed. No Lua interpreter is installed on this machine, and the fake FXServer stands in for it in the tests and in the browser. What it costs on a busy server is described in the README, not measured.start: Nonein aServerStatus: the one indesktop/mod.rswas compiled and run, the one insystemd.rs, which only Linux compiles, was read against the struct.cargo xtask e2e: Playwright asks for a newer Chromium than the one installed here.