From 610fedabb8e5056686e5ce5c4224cbb4ba2fa1b3 Mon Sep 17 00:00:00 2001 From: Gioacchino Mazzurco Date: Fri, 29 Nov 2019 19:46:46 +0100 Subject: [PATCH] Fix JSON API related files licensing based on talk with Cyril and FSFE suggestions --- libretroshare/src/jsonapi/jsonapi.cpp | 38 ++++++++------- libretroshare/src/jsonapi/jsonapi.h | 39 ++++++++------- libretroshare/src/jsonapi/jsonapiitems.h | 40 ++++++++-------- .../src/{rsserver => jsonapi}/p3webui.cc | 42 ++++++++--------- libretroshare/src/jsonapi/p3webui.h | 47 +++++++++++++++++++ libretroshare/src/libretroshare.pro | 4 +- libretroshare/src/retroshare/rsjsonapi.h | 42 +++++++++-------- libretroshare/src/retroshare/rswebui.h | 42 +++++++++-------- libretroshare/src/rsserver/p3webui.h | 46 ------------------ 9 files changed, 176 insertions(+), 164 deletions(-) rename libretroshare/src/{rsserver => jsonapi}/p3webui.cc (79%) create mode 100644 libretroshare/src/jsonapi/p3webui.h delete mode 100644 libretroshare/src/rsserver/p3webui.h diff --git a/libretroshare/src/jsonapi/jsonapi.cpp b/libretroshare/src/jsonapi/jsonapi.cpp index b15dbefb5..24f4fefb7 100644 --- a/libretroshare/src/jsonapi/jsonapi.cpp +++ b/libretroshare/src/jsonapi/jsonapi.cpp @@ -1,21 +1,23 @@ -/******************************************************************************* - * RetroShare JSON API * - * * - * Copyright (C) 2018-2019 Gioacchino Mazzurco * - * * - * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License version 3 as * - * published by the Free Software Foundation. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Affero General Public License * - * along with this program. If not, see . * - * * - *******************************************************************************/ +/* + * RetroShare JSON API + * + * Copyright (C) 2018-2019 Gioacchino Mazzurco + * + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU Affero General Public License as published by the + * Free Software Foundation, version 3. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see + * + * SPDX-FileCopyrightText: 2004-2019 RetroShare Team + * SPDX-License-Identifier: AGPL-3.0-only + */ #include #include diff --git a/libretroshare/src/jsonapi/jsonapi.h b/libretroshare/src/jsonapi/jsonapi.h index 9c0fa502d..6c26ceaae 100644 --- a/libretroshare/src/jsonapi/jsonapi.h +++ b/libretroshare/src/jsonapi/jsonapi.h @@ -1,21 +1,24 @@ -/******************************************************************************* - * RetroShare JSON API * - * * - * Copyright (C) 2018-2019 Gioacchino Mazzurco * - * * - * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License version 3 as * - * published by the Free Software Foundation. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Affero General Public License * - * along with this program. If not, see . * - * * - *******************************************************************************/ +/* + * RetroShare JSON API + * + * Copyright (C) 2018-2019 Gioacchino Mazzurco + * + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU Affero General Public License as published by the + * Free Software Foundation, version 3. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see + * + * SPDX-FileCopyrightText: 2004-2019 RetroShare Team + * SPDX-License-Identifier: AGPL-3.0-only + */ + #pragma once #include diff --git a/libretroshare/src/jsonapi/jsonapiitems.h b/libretroshare/src/jsonapi/jsonapiitems.h index ac6ac8b25..eba871e98 100644 --- a/libretroshare/src/jsonapi/jsonapiitems.h +++ b/libretroshare/src/jsonapi/jsonapiitems.h @@ -1,22 +1,24 @@ -/******************************************************************************* - * RetroShare JSON API * - * * - * Copyright (C) 2018-2019 Gioacchino Mazzurco * - * * - * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * - * published by the Free Software Foundation, either version 3 of the * - * License, or (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU Affero General Public License for more details. * - * * - * You should have received a copy of the GNU Affero General Public License * - * along with this program. If not, see . * - * * - *******************************************************************************/ +/* + * RetroShare JSON API + * + * Copyright (C) 2018-2019 Gioacchino Mazzurco + * + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU Affero General Public License as published by the + * Free Software Foundation, version 3. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see + * + * SPDX-FileCopyrightText: 2004-2019 RetroShare Team + * SPDX-License-Identifier: AGPL-3.0-only + */ + #pragma once #include diff --git a/libretroshare/src/rsserver/p3webui.cc b/libretroshare/src/jsonapi/p3webui.cc similarity index 79% rename from libretroshare/src/rsserver/p3webui.cc rename to libretroshare/src/jsonapi/p3webui.cc index 7daa4cd6a..60fc63ea9 100644 --- a/libretroshare/src/rsserver/p3webui.cc +++ b/libretroshare/src/jsonapi/p3webui.cc @@ -1,23 +1,23 @@ -/******************************************************************************* - * libretroshare/src/rsserver: p3webui.cc * - * * - * libretroshare: retroshare core library * - * * - * Copyright 2019-2019 Cyril Soler * - * * - * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version 3 as * - * published by the Free Software Foundation. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Affero General Public License * - * along with this program. If not, see . * - * * - *******************************************************************************/ +/* + * RetroShare Web User Interface + * + * Copyright (C) 2019 Cyril Soler + * + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU Affero General Public License as published by the + * Free Software Foundation, version 3. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see + * + * SPDX-FileCopyrightText: 2004-2019 RetroShare Team + * SPDX-License-Identifier: AGPL-3.0-only + */ #include "p3webui.h" @@ -194,5 +194,3 @@ bool p3WebUI::stop() rsJsonApi->restart(); return true; } - - diff --git a/libretroshare/src/jsonapi/p3webui.h b/libretroshare/src/jsonapi/p3webui.h new file mode 100644 index 000000000..b67927ab7 --- /dev/null +++ b/libretroshare/src/jsonapi/p3webui.h @@ -0,0 +1,47 @@ +/* + * RetroShare Web User Interface + * + * Copyright (C) 2019 Cyril Soler + * + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU Affero General Public License as published by the + * Free Software Foundation, version 3. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see + * + * SPDX-FileCopyrightText: 2004-2019 RetroShare Team + * SPDX-License-Identifier: AGPL-3.0-only + */ + +#pragma once + +#include +#include +#include + +#include "retroshare/rswebui.h" +#include "jsonapi/jsonapi.h" + +class p3WebUI: public RsWebUi, public JsonApiResourceProvider +{ +public: + ~p3WebUI() override = default; + + // implements RsWebUI + + virtual void setHtmlFilesDirectory(const std::string& html_dir) override; + virtual void setUserPassword(const std::string& passwd) override; + + virtual bool restart() override ; + virtual bool stop() override ; + bool isRunning() const override; + // implements JsonApiResourceProvider + + virtual std::vector > getResources() const override; +}; diff --git a/libretroshare/src/libretroshare.pro b/libretroshare/src/libretroshare.pro index 369f8075f..779558a59 100644 --- a/libretroshare/src/libretroshare.pro +++ b/libretroshare/src/libretroshare.pro @@ -161,8 +161,8 @@ PUBLIC_HEADERS = retroshare/rsdisc.h \ rs_webui { PUBLIC_HEADERS += retroshare/rswebui.h - SOURCES += rsserver/p3webui.cc - HEADERS += rsserver/p3webui.h + SOURCES += jsonapi/p3webui.cc + HEADERS += jsonapi/p3webui.h } HEADERS += plugins/pluginmanager.h \ diff --git a/libretroshare/src/retroshare/rsjsonapi.h b/libretroshare/src/retroshare/rsjsonapi.h index 07a18c6b9..2fbad4a44 100644 --- a/libretroshare/src/retroshare/rsjsonapi.h +++ b/libretroshare/src/retroshare/rsjsonapi.h @@ -1,22 +1,26 @@ -/******************************************************************************* - * libretroshare/src/retroshare: rsjsonapi.h * - * * - * Copyright (C) 2018-2019 Gioacchino Mazzurco * - * Copyright (C) 2019-2019 Cyril Soler * - * * - * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License version 3 as * - * published by the Free Software Foundation. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Affero General Public License * - * along with this program. If not, see . * - * * - *******************************************************************************/ +/* + * RetroShare JSON API public header + * + * Copyright (C) 2018-2019 Gioacchino Mazzurco + * Copyright (C) 2019 Cyril Soler + * + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation, either version 3 of the License, or (at your option) any + * later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see + * + * SPDX-FileCopyrightText: 2004-2019 RetroShare Team + * SPDX-License-Identifier: LGPL-3.0-or-later + */ + #pragma once #include diff --git a/libretroshare/src/retroshare/rswebui.h b/libretroshare/src/retroshare/rswebui.h index 03eabc076..d7166f545 100644 --- a/libretroshare/src/retroshare/rswebui.h +++ b/libretroshare/src/retroshare/rswebui.h @@ -1,23 +1,25 @@ -/******************************************************************************* - * libretroshare/src/rsserver: rswebui.h * - * * - * libretroshare: retroshare core library * - * * - * Copyright 2019-2019 Cyril Soler * - * * - * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License version 3 as * - * published by the Free Software Foundation. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Affero General Public License * - * along with this program. If not, see . * - * * - *******************************************************************************/ +/* + * RetroShare Web User Interface public header + * + * Copyright (C) 2019 Cyril Soler + * + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation, either version 3 of the License, or (at your option) any + * later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see + * + * SPDX-FileCopyrightText: 2004-2019 RetroShare Team + * SPDX-License-Identifier: LGPL-3.0-or-later + */ + #pragma once #include diff --git a/libretroshare/src/rsserver/p3webui.h b/libretroshare/src/rsserver/p3webui.h deleted file mode 100644 index 0a2a7450f..000000000 --- a/libretroshare/src/rsserver/p3webui.h +++ /dev/null @@ -1,46 +0,0 @@ -/******************************************************************************* - * libretroshare/src/rsserver: p3webui.h * - * * - * libretroshare: retroshare core library * - * * - * Copyright 2019-2019 Cyril Soler * - * * - * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version 3 as * - * published by the Free Software Foundation. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Affero General Public License * - * along with this program. If not, see . * - * * - *******************************************************************************/ - -#include -#include -#include -#include "retroshare/rswebui.h" -#include "jsonapi/jsonapi.h" - -class p3WebUI: public RsWebUi, public JsonApiResourceProvider -{ -public: - ~p3WebUI() override = default; - - // implements RsWebUI - - virtual void setHtmlFilesDirectory(const std::string& html_dir) override; - virtual void setUserPassword(const std::string& passwd) override; - - virtual bool restart() override ; - virtual bool stop() override ; - bool isRunning() const override; - // implements JsonApiResourceProvider - - virtual std::vector > getResources() const override; -}; - -