Commit graph

96 commits

Author SHA1 Message Date
Caoimhe d7b067e8f7 Base: Run SpiceAgent as a user service
This allows it to read/write to the user's clipboard properly. Prior to
this, it would be writing to the Clipboard server running under the
window user, which doesn't impact other users (like anon).

Co-authored-by: Daniel Bertalan <dani@danielbertalan.dev>
2023-05-12 17:47:16 +01:00
implicitfield cea7386ea8 Base: Set PATH in text mode 2022-10-31 00:02:34 +01:00
Lucas CHOLLET 99cd6f66cf Base: Launch CrashDaemon at session start-up 2022-10-14 11:37:11 +02:00
Lucas CHOLLET 3197c1793a Base: Launch Clipboard at session start-up
The clipboard service hasn't been ported to user-based portals with
others services as it is needed at `GUI::Application` creation and thus
before the first login, as the `LoginServer` needs one.

This problem as been solved thanks to session-based portals, a clipboard
portal is now created at boot for the "login" session and another for
each "user" session.

With a user-based portal, the "login" portal would have needed to be
created for the `root` user, exposing us to security issues. It now, can
be owned by the `window` user.
2022-10-14 11:37:11 +02:00
Lucas CHOLLET 22f8ead2f4 Base: Launch SQLServer at session start-up 2022-08-14 21:52:35 +01:00
Lucas CHOLLET 267a2c7c32 Base: Launch LanguageServers at session start-up 2022-08-14 21:52:35 +01:00
Lucas CHOLLET 4f87f03bd1 Base: Launch AudioServer at session start-up 2022-08-14 21:52:35 +01:00
Lucas CHOLLET c248569d6b Base: Launch InspectorServer at session start-up 2022-08-14 21:52:35 +01:00
Lucas CHOLLET b01822bdd4 Base: Launch NotificationServer at session start-up 2022-08-14 21:52:35 +01:00
Lucas CHOLLET 1da9375400 Base: Launch ImageDecoder at session start-up 2022-08-14 21:52:35 +01:00
Lucas CHOLLET e8115bfdb1 Base: Launch FileSystemAccessServer at session start-up 2022-08-14 21:52:35 +01:00
Lucas CHOLLET e9e94ef3cc Base: Launch WebSocket at session start-up 2022-08-14 21:52:35 +01:00
Lucas CHOLLET ac7b0e69e5 Base: Launch WebContent at session start-up 2022-08-14 21:52:35 +01:00
Lucas CHOLLET 266e18e0b6 Base: Launch Request at session start-up 2022-08-14 21:52:35 +01:00
Lucas CHOLLET 07e89ad538 Base: Launch ConfigServer at session start-up 2022-08-14 21:52:35 +01:00
Lucas CHOLLET 70846d701c LaunchServer+SystemServer: Move the portal to a user-specific directory
Various changes are needed to support this:
 - The directory is created by Core::Account on login (and located in
   /tmp).
 - Service's sockets are now deleted on exit (to allow re-creation)
 - SystemServer needs to handle SIGTERM to correctly destroy services.
2022-07-19 11:15:14 +01:00
Maciej b1709c368f Base: Don't launch LookupServer in generate-manpages mode
This is not needed now.
2022-05-26 21:49:52 +01:00
Maciej ddd4547e13 NetworkServer: Add a new NetworkServer service
This service is responsible for loading network configuration from a
/etc/Network.ini config file. It sets up static IP address + mask or
starts DHCPClient depending on configuration.
2022-05-26 21:47:27 +01:00
Peter Elliott 12c7b954e1 Kernel+WindowServer: Move setting tty graphical mode to Userspace
This will allow using the console tty and WindowServer regardless of
your kernel command line. Also this fixes a bug where, when booting in
text mode, the console was in graphical mode, and would not accept
input.
2022-04-29 19:52:32 +02:00
brapru d797031b65 Base: Spawn the LookupServer for generate-manpages SystemMode
Previously the CI would hang on the "Check manpages for completeness"
step on any utility that unveils the /tmp/portal/lookup file because
it was not created during the generate-manpages SystemMode.

This will allow utilities that resolve hostnames (e.g. netstat, arp) to
pass the export-argsparser-mangpages.sh check.
2022-04-19 10:50:55 +02:00
Brian Gianforcaro 95b295971d Everywhere: Move tests to /home/anon/Tests 2022-03-20 22:20:59 +01:00
Timothy Flynn 5c90aa357b Base: Restart the SQL server if it crashes
There's a fair amount of VERIFY/TODO calls in LibSQL that will crash the
SQL server if we hit an unimplemented feature or some bug. Restart the
server if this happens to help with debugging / development.
2022-02-13 21:30:38 +00:00
Brian Gianforcaro 6bf91d00ef run-tests: Make reproducing test failures behave closer to selftest mode
In CI / or local testing when you run `serenity.sh tests`, the system
will boot itself in self test mode, and the test runner will be launched
by SystemServer. Previously we were setting up settings for that
environment in the `SystemServer.ini`. This makes reproducing CI
failures a bit confusing, as the system will behavior differently if you
run in self-test mode, vs running `run-tests-and-shutdown.sh` or
`run-tests` manually in a session.

This change moves the settings to `run-tests`, so no matter how you try
to run the test runner, it will always behave the same.
2022-01-07 01:19:09 -08:00
Ben Wiederhake f9167c9265 Base+LibCore: Store booleans in human-readable format
Fixes #10640.
2021-11-04 23:44:02 +01:00
Ben Wiederhake 2caad04d23 Base: Add new system-mode that just generates manpages 2021-11-01 21:12:58 +01:00
Ben Wiederhake 3ec87ecc75 Base: Don't start unnecessary services in self-test
These services weren't actually needed or tested. This should speed up
tests a bit. Even if it doesn't, at least we don't do unnecessary work.
2021-11-01 21:12:58 +01:00
Ben Wiederhake 3d855a801b SystemServer: Rename 'BootModes' config option to 'SystemModes' 2021-10-25 23:38:28 +02:00
Peter Elliott b77dad5ba3 LoginServer: Add --auto-login switch
Auto login will automatically log in a user without prompting for a
password, but will still allow logouts and subsequent password logins.
2021-10-17 22:18:48 +02:00
Peter Elliott e3ed7f76c5 LoginServer: Process logins and start SystemServer in user mode 2021-10-17 22:18:48 +02:00
Peter Elliott f8fb0359ae SystemServer: Add per user mode (--user)
System server running in user mode will form the basis of a "session"
for login purposes in serenity.
2021-10-17 22:18:48 +02:00
Andreas Kling bdcd0abf9d Userland: Introduce ConfigServer and LibConfig
ConfigServer is an IPC service that provides access to application
configuration and settings. The idea is to replace all uses of
Core::ConfigFile with IPC requests to ConfigServer.

This first cut of the API is pretty similar to Core::ConfigFile.

The old:

    auto config = Core::ConfigFile::open_for_app("App");
    auto value = config->read_entry("Group", "Key");

The new:

    auto value = Config::read_string("App", "Group", "Key");

ConfigServer uses the ~/.config directory as its backing store
and all the files remain human-editable. :^)
2021-08-26 00:54:27 +02:00
Peter Elliott 01248d28ef Applets: Add DesktopPicker applet
This applet displays a grid of desktops, and shows the user what virtual
desktop they are on. When clicked, the desktop will be changed.
2021-07-19 18:21:40 +02:00
x-yl d4bb6a1a1e SpiceAgent: Add a new spice agent service :^)
A SPICE agent communicates with the host OS to provide nifty features
like clipboard sharing :^)

This patch implements only plain-text clipboard sharing.

See: github.com/freedesktop/spice-protocol/blob/master/spice/vd_agent.h
2021-07-14 12:33:07 +02:00
Timothy 41ce2debda FileSystemAccessServer: Add service for accessing veiled files nicely
Adds new service FileSystemAccessServer which allows programs to
request a file descriptor for any file on the file system.

The user can be prompted to choose the path with a FilePicker, or the
path can be provided by the application which will show a MessageBox
showing the pid and name of the calling process and allows the user to
approve or deny the request.
2021-07-10 15:33:46 +02:00
Jan de Visser e72448888b SystemServer: Add entry for SQLServer in SystemServer.ini 2021-07-08 17:55:59 +04:30
Andrew Kaster ab88f4e082 Base: Set UBSAN to deadly for TestRunner service
This will run all the tests that are children of this service with
deadly UBSAN, ensuring we don't get any UBSAN regressions in on-target
tests anymore. :^)
2021-06-29 07:17:34 +04:30
kleines Filmröllchen 2e00155275 AudioServer: Make AudioServer boot in text mode
This way, we can have Audio on the console :^)
2021-06-25 20:48:14 +04:30
Andreas Kling b968d44375 Base: Make anon's helper services run with 600 socket permissions
Some of these were using 660 permissions which meant that other users
in the "users" group could connect to anon's service processes.

Let's tighten things up by not allowing that. :^)
2021-06-06 18:03:57 +02:00
Andreas Kling 8f1d9c949d Clipboard: Remove unnecessary UID separation
This process is already sandboxed to the point where the UID doesn't
matter, so let's just stop having the separate "clipboard" user.
2021-06-06 17:56:34 +02:00
Andreas Kling 3dc1787306 NotificationServer: Remove unnecessary UID separation
This process is already sandboxed to the point where the UID doesn't
matter, so let's just stop having the separate "notify" user.
2021-06-06 17:56:34 +02:00
Andreas Kling 9c2786b872 Userland: Remove SymbolServer and the "symbol" user+group 2021-05-22 18:54:22 +02:00
Andreas Kling 3d3a5b431f Services: Add InspectorServer to reverse the direction of Inspector
This service daemon will act as an intermediary between the Inspector
program and the inspectable programs it wants to inspect.

Programs can make themselves available for inspection by connecting
to /tmp/portal/inspectables using the Core::EventLoop RPC protocol.
2021-05-13 23:28:40 +02:00
Ömer Kurttekin d922c2f5f3
Userland: Preserve keyboard mapping preference on reboot (#6955) 2021-05-09 15:56:03 +02:00
Andreas Kling a7e44d8b3c Base: Remove unnecessary UID separation of multi-process Browser
After looking closely at this, I realized that we've been running
all the service processes under separate user accounts even though
there's actually no need to.

Since we already use pledge() and unveil() to limit the scope and
access of these programs, separating them to another UID doesn't
achieve anything meaningful. So let's bring them back to the "anon"
user account and simplify things.

Programs affected:

- ImageDecoder
- RequestServer
- WebContent
- WebSocket

Longer term, I'd like for all of these to get spawned for the current
desktop user somehow, possibly by some kind of session manager, or
perhaps by the Browser program itself. But for now they remain under
SystemServer's control.
2021-05-06 13:33:08 +02:00
Sergey Bugaev 37a59f7f40 Base: Start LookupServer on boot
I can't say I like starting yet another thing on boot... but now that
LookupServer provides mDNS (and optionaly DNS) services to other hosts,
we have to start it on boot, not when the first local client connects.
2021-05-05 21:16:17 +02:00
DexesTTP 71d27abb97 Services: Rename ProtocolServer to RequestServer
The current ProtocolServer was really only used for requests, and with
the recent introduction of the WebSocket service, long-lasting
connections with another server are not part of it. To better reflect
this, this commit renames it to RequestServer.

This commit also changes the existing 'protocol' portal to 'request',
the existing 'protocol' user and group to 'request', and most mentions
of the 'download' aspect of the request to 'request' when relevant, to
make everything consistent across the system.

Note that LibProtocol still exists as-is, but the more generic Client
class and the more specific Download class have both been renamed to a
more accurate RequestClient and Request to match the new names.

This commit only change names, not behaviors.
2021-04-25 19:04:34 +02:00
DexesTTP 62ed26164b Services: Add a WebSocket service
The WebSocket service isolates communication with a WebSocket to its
own isolated process. Similar to other isolating services, it has its
own user and group.
2021-04-25 19:04:34 +02:00
Andrew Kaster 89ee38fe5c Tests: Add environment variable for tests only
This is useful for CI where we don't want to spend a minute and a half
benchmarking Vector::append, and we don't have a good way to pass
test-specific arguments yet. :)
2021-04-25 09:36:49 +02:00
sin-ack aa56f9a1e0 LibGUI+WindowServer: Separate window manager IPC from regular IPC
With this patch the window manager related functionality is split out
onto a new endpoint pair named WindowManagerServer/Client.  This allows
window manager functionality to be potentially privilege separated in
the future.  To this end, a new client named WMConnectionClient
is used to maintain a window manager connection.  When a process
connects to the endpoint and greets the WindowServer as a window manager
(via Window::make_window_manager(int)), they're subscribed to the events
they requested via the WM event mask.

This patch also removes the hardcoding of the Taskbar WindowType to
receive WM events automatically.  However, being a window manager still
requires having an active window, at the moment.
2021-04-17 13:06:25 +02:00
Andreas Kling 66a27f37db Base: Minor cleanups in SystemServer.ini
Fix up an outdated comment and remove some unnecessary Executable
values (since those are implied by the group name anyway.)
2021-04-04 20:13:55 +02:00