2020-06-17 17:31:42 +02:00
|
|
|
/*
|
2021-11-23 10:31:08 +01:00
|
|
|
* Copyright (c) 2020-2021, Andreas Kling <kling@serenityos.org>
|
2020-06-17 17:31:42 +02:00
|
|
|
*
|
2021-04-22 01:24:48 -07:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-06-17 17:31:42 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include <LibCore/EventLoop.h>
|
|
|
|
|
#include <LibCore/LocalServer.h>
|
2021-11-23 10:59:50 +01:00
|
|
|
#include <LibCore/System.h>
|
2021-12-06 18:11:05 +01:00
|
|
|
#include <LibIPC/SingleServer.h>
|
2021-11-23 10:31:08 +01:00
|
|
|
#include <LibMain/Main.h>
|
2020-06-17 17:31:42 +02:00
|
|
|
#include <WebContent/ClientConnection.h>
|
|
|
|
|
|
2021-11-23 10:31:08 +01:00
|
|
|
ErrorOr<int> serenity_main(Main::Arguments)
|
2020-06-17 17:31:42 +02:00
|
|
|
{
|
|
|
|
|
Core::EventLoop event_loop;
|
2021-12-29 13:10:12 -05:00
|
|
|
TRY(Core::System::pledge("stdio recvfd sendfd accept unix rpath"));
|
2021-11-23 10:59:50 +01:00
|
|
|
TRY(Core::System::unveil("/res", "r"));
|
2022-01-20 12:27:56 -05:00
|
|
|
TRY(Core::System::unveil("/etc/timezone", "r"));
|
2021-11-23 10:59:50 +01:00
|
|
|
TRY(Core::System::unveil("/tmp/portal/request", "rw"));
|
|
|
|
|
TRY(Core::System::unveil("/tmp/portal/image", "rw"));
|
|
|
|
|
TRY(Core::System::unveil("/tmp/portal/websocket", "rw"));
|
|
|
|
|
TRY(Core::System::unveil(nullptr, nullptr));
|
2020-06-17 17:31:42 +02:00
|
|
|
|
2021-12-07 00:41:28 +01:00
|
|
|
auto client = TRY(IPC::take_over_accepted_client_from_system_server<WebContent::ClientConnection>());
|
2020-06-17 17:31:42 +02:00
|
|
|
return event_loop.exec();
|
|
|
|
|
}
|