Commit Graph

49 Commits

Author SHA1 Message Date
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
Andreas Kling
436a1dce34 ResourceGraph.Applet: Host both CPU and memory applet in one process
No reason we can't host these in the same process, and then we have
one less process to dynamically link at boot. :^)
2021-04-04 20:13:55 +02:00
Andreas Kling
23cc88f83b Userland: Rename *.MenuApplet => *.Applet
These are no longer displayed in the menu, so it doesn't make sense to
call them menu applets. :^)
2021-04-04 16:29:55 +02:00
Andreas Kling
e94e94becc Base: Remove SystemMenu from SystemServer.ini 2021-03-26 08:20:53 +01:00
Andreas Kling
11e190b323 Base: Remove clock and username applets from startup
The clock has moved to the taskbar, and let's see how we feel without
the username being on screen all the time.
2021-03-25 22:40:51 +01:00
Andrew Kaster
611bbc43be Base/CI: Boot serenity in CI in a mode that runs tests on target
Build a new version of Serenity in CI that doesn't have all the debug
symbols on, or we'd be waiting a very long time to boot.

Insert a TestRunner entry into SystemServer.ini that will run a shell
script that runs tests in /bin and /usr/Tests and shuts down the system
in the new self-test boot mode. Also make sure enough basic services are
started in self-test such that the tests will actually run properly.
2021-02-28 18:19:37 +01:00
Andreas Kling
aefd206038 SymbolServer: Add symbolication service for out-of-process ELF parsing
This patch adds SymbolServer, a service daemon that provides
symbolication of ELF binaries. It has a very simple IPC API at the
moment that only turns addresses into symbol names.

This can be used to implement symbolication without having to do
in-process ELF parsing yourself. :^)
2021-02-04 23:19:08 +01:00
Nico Weber
362bde4a86 SystemServer.ini: Default to not showing network change notifications
Until someone has time to implement something for not showing the
very first network change at boot, let's turn off notifications for
network changes by default altogether. Having to dismiss this
notification at every boot gets old fast.
2021-01-20 21:01:21 +01:00
Brendan Coles
4d89c1885d MenuApplets: Add Network menu applet 2020-12-19 18:28:56 +01:00
Itamar
706a8c05fd CrashDaemon: Add service that acts on new coredumps
Currently we only print a backtrace. In the future, we could do something nice in the GUI.
2020-12-14 23:05:53 +01:00
AnotherTest
6b55b007dd HackStudio: Add a Shell language server 2020-10-04 23:12:28 +02:00
Itamar
863f14788f HackStudio: Add C++ Language Server
The language server keeps track of the content of currently edited
files by receiving updates about edit actions.

Also, C++ autocompletion is no longer tied to HackStudio itself and
moved to be part of the language server.
2020-09-30 21:46:59 +02:00
Andreas Kling
1056dde7c9 ProtocolServer: Run with low priority
Dr. Bugaev says this is the most appropriate priority. :^)
2020-07-06 15:41:15 +02:00
Andreas Kling
6f059ee830 ProtocolServer: Turn this into a multi-instance service
Everyone who connects to ProtocolServer now gets his own instance.
This means that different users can no longer talk to the same exact
ProtocolServer process, enhanching security and stability.
2020-07-06 13:30:11 +02:00
Andreas Kling
dfc0a35295 Base: Tweak resource graph colors to match SystemMonitor 2020-06-30 23:11:07 +02:00
Andreas Kling
e3782a7f99 ImageDecoder: Add a new service for out-of-process image decoding :^)
The new ImageDecoder service (available for members of "image" via
/tmp/portal/image) allows you to decode images in a separate process.

This will allow programs to confidently load untrusted images, since
the bulk of the security concerns are sandboxed to a separate process.

The only API right now is a synchronous IPC DecodeImage() call that
takes a shbuf with encoded image data and returns a shared buffer and
metadata for the decoded image.

It also comes with a very simple library for interfacing with the
ImageDecoder service: LibImageDecoderClient. The name is a bit of a
mouthful but I guess we can rename it later if we think of something
nicer to call it.

There's obviously a bit of overhead to spawning a separate process
for every image decode, so this is mostly only appropriate for
untrusted images (e.g stuff downloaded from the web) and not necessary
for trusted local images (e.g stuff in /res)
2020-06-22 21:47:00 +02:00
Andreas Kling
59537cf257 WebContent: Turn it into a MultiInstance service :^)
Port the WebContent service to the new MultiInstance mechanism that
Sergey added. This means that every new WebContentView gets its very
own segregated WebContent process.
2020-06-21 21:54:30 +02:00
Andreas Kling
c45c5ded34 WebContent: Start work on browser process separation :^)
The "WebContent" service provides a very restricted instance of LibWeb
running as an unprivileged user account. This will be used to implement
process separation in Browser, among other things.

This first cut of the service only spawns a single WebContent process
when someone connects to /tmp/portal/webcontent. We will soon switch
this over to spawning a new process for each connection.

Since this feature is very immature, we'll be bringing it up inside of
Demos/WebView as a separate demo program. Eventually this will become
a reusable widget that anyone can embed and easily get out-of-process
web content in their GUI.

This is pretty, pretty cool! :^)
2020-06-17 20:09:44 +02:00
Sergey Bugaev
ae21b8ee56 Base: Replace TTYServer with text mode Shell
Now that we have SystemServer that can (re)spawn the Shell, we don't need a
separate server just for that.

The two shells (on tty0 and tty1) are configured to only be started when booting
in text mode. This means you can now simply say boot_mode=text on the kernel
command line, and SystemServer will set up the system and spawn a comfy root
shell for you :^)
2020-05-27 11:19:38 +02:00
Sergey Bugaev
7d8bfe4f3a Base: Tweak SystemServer.ini
Notably, adjust service priorities.
2020-05-20 15:42:48 +02:00
Sergey Bugaev
f7ae66cee3 ClipboardHistory: Add a clipboard history applet :^)
It will listen for clipboard content changes in the backgroud. Once you click
on its icon, it will pop up a window listing all recorded clipboard contents.
You can then double-click on an item to copy it again.
2020-05-16 09:13:25 +02:00
Andreas Kling
244efe050a Clipboard: Move the system clipboard to a dedicated service process :^)
This commit moves the clipboard from WindowServer into a new Clipboard
service program. Clipboard runs as the unprivileged "clipboard" user
and with a much tighter pledge than WindowServer.

To keep things working as before, all GUI::Application users now make
a connection to Clipboard after making the connection to WindowServer.
It could be interesting to connect to Clipboard on demand, but right
now that would necessitate expanding every GUI app's pledge to include
"unix" and also unveiling the clipboard portal, which I prefer not to.
2020-05-14 22:53:58 +02:00
Andreas Kling
7b34f5bb92 LaunchServer: Don't use SystemServer keepalive 2020-05-09 16:57:35 +02:00
Andreas Kling
3d41cc849c LaunchServer: Run with portal permissions 600
The LaunchServer is personal to "anon" and we don't want other users
accessing it to launch anything.
2020-05-09 15:16:16 +02:00
Nicholas Hollett
2708cc0f72 LaunchServer: Add the LaunchServer to centralise file associations.
Step one of moving DesktopServices::open handling out of process. This
makes it easier to do things like read in associations for which program
opens which files or protocols. This gives users the ability to modify
the associations without having to rebuild :^)
2020-05-09 15:12:56 +02:00
Andreas Kling
5dd87c18c4 Base: Start a desktop FileManager by default! :^) 2020-04-18 22:09:40 +02:00
Linus Groh
54fc972a72 MenuApplets: Support memory usage and custom colors in ResourceGraph
The ResourceGraph menu applet now supports a few command line options:

--cpu / -C to display a CPU usage graph
--memory / -M to display a memory usage graph
--name / -n to set a name which is used to order applets
--color / -c to set the graph color (supports anything
Gfx::Color::from_string() understands)

The SystemServer.ini and WindowServer.ini config files have been updated
to spawn and show two ResourceGraph menu applets, one for CPU usage
(green) and one for memory usage (cyan) - this matches the colors in the
SystemMonitor graphs.
2020-04-11 10:03:12 +02:00
Linus Groh
b46a8d7335 MenuApplets: Rename CPUGraph to ResourceGraph
The plan is to extend what currently is known as "CPUGraph" and let the
SystemServer spawn multiple instances of it - which then can show memory
or network usages as well :^)

Simply renaming the applet is the first step.
2020-04-11 10:03:12 +02:00
AnotherTest
3ab6c5fd09 DHCPClient: Log errors and cleanup the code
Prior to this, we ran the DHCP client as a high-priority service, but
making the system feel laggy "for some network stuff" is not the
greatest of ideas :^)
2020-04-06 10:58:40 +02:00
AnotherTest
3e8cf79efa Servers: Add a new DHCP client
This adds a DHCPClient...Server that leases IPv4s.
2020-04-05 09:50:48 +02:00
Itamar
bd9f14e27e SystemServer: Add WorkingDirectory support
Services can now have their initial working directory
configured via `SystemServer.ini`.

This commit also configures Terminal's working directory
to be /home/anon
2020-03-18 08:23:31 +01:00
Andreas Kling
b711f1eab5 SystemMenu: Finish the implementation and start this at boot :^)
Fixes #1231.
2020-02-17 20:20:32 +01:00
Andreas Kling
9f54ea9bcd NotificationServer: Add a system service for desktop notifications
This patch adds NotificationServer, which runs as the "notify" user
and provides an IPC API for desktop notifications.

LibGUI gains the GUI::Notification class for showing notifications.

NotificationServer is spawned on demand and will unspawn after
dimissing all visible notifications. :^)

Finally, this also comes with a small /bin/notify utility.
2020-02-16 21:58:17 +01:00
Andreas Kling
9794e18a20 Base: Run WindowServer as a separate "window" user
This was actually rather painless and straightforward. WindowServer now
runs as the "window" user. Users in the "window" group can connect to
it via the socket in /tmp/portal/window as usual.
2020-02-16 21:58:17 +01:00
Hüseyin ASLITÜRK
9b5e0b6247 WindowServer: Remove username from MenuManager.
Now, we have UserName applet.
2020-02-09 10:37:35 +01:00
Andreas Kling
d0a708fda4 Base: Run ProtocolServer as a separate "protocol" user
This is probably not the final design we'll want for this, but for now
let's run the HTTP client code as a separate user to reduce exposure
for the standard "anon" user account.

Note that "protocol" is also added to the "lookup" group, in order to
allow ProtocolServer to contact LookupServer for DNS requests.
2020-01-11 13:07:32 +01:00
Andreas Kling
f5d9f11e52 Base: Add a "lookup" user+group that runs LookupServer
LookupServer now runs as lookup:lookup, allowing connections from other
members of the "lookup" group.

This is enforced through file system permissions by having the service
socket (/tmp/portal/lookup) be mode 0660.

Now the LookupServer program can't overwrite other people's files if it
starts misbehaving. That's pretty cool :^)
2020-01-09 21:36:17 +01:00
Hüseyin ASLITÜRK
e50deb55d3 WindowServer: Remove Clock from server.
We have clock applet.
2019-12-27 22:47:31 +01:00
Andreas Kling
e1940f365b WindowServer+MenuApplets: Move the "Audio" applet to its own program
This patch introduces the second MenuApplet: Audio. To make this work,
menu applet windows now also receive mouse events.

There's still some problem with mute/unmute via clicking not actually
working, but the call goes from the applet program over IPC to the
AudioServer, where something goes wrong with the state change message.
Need to look at that separately.

Anyways, it's pretty cool to have more applets running in their own
separate processes. :^)
2019-12-16 15:33:42 +01:00
Andreas Kling
20bbeba6d5 CPUGraph: Launch the CPUGraph menu applet on startup 2019-12-05 19:44:22 +01:00
Sergey Bugaev
52b0bd06a8 SystemServer: Implement lazy spawning
For services explicitly configured as lazy, SystemServer will now listen
on the socket and only spawn the service once a client attempts to connect
to the socket.
2019-11-26 19:58:25 +01:00
Sergey Bugaev
ab98969403 LookupServer: Port to socket takeover 2019-11-26 19:58:25 +01:00
Sergey Bugaev
9eaac26eda ProtocolServer: Port to socket takeover 2019-11-26 19:58:25 +01:00
Sergey Bugaev
bd55938985 AudioServer: Port to socket takeover 2019-11-26 19:58:25 +01:00
Sergey Bugaev
22a05621d5 WindowServer: Port to socket takeover 2019-11-26 19:58:25 +01:00
Sergey Bugaev
396ad4d6b2 SystemServer: Implement keepalive
When reaping a child, SystemServer will now match up child's pid with its own
record of the services, and respawn the service if keepalive is enabled for it.

For example, we want to restart the WindowServer if it crashes, but we wouldn't
want to restart the Terminal if it gets closed.
2019-11-26 19:58:25 +01:00
Sergey Bugaev
b93065359e SystemServer: Read service list from a config file
This replaces the hardcoded services list with a very simple config
file in /etc/SystemServer.ini :^)

Closes https://github.com/SerenityOS/serenity/issues/610
2019-11-26 19:58:25 +01:00