diff --git a/Aaru.Server/Aaru.Server.csproj b/Aaru.Server/Aaru.Server.csproj index c2f462b2..a1ca26bc 100644 --- a/Aaru.Server/Aaru.Server.csproj +++ b/Aaru.Server/Aaru.Server.csproj @@ -136,6 +136,13 @@ <_ContentIncludedByDefault Remove="Areas\Admin\Views\Device\Edit.cshtml" /> <_ContentIncludedByDefault Remove="Areas\Admin\Views\Device\Index.cshtml" /> <_ContentIncludedByDefault Remove="Areas\Admin\Views\Atas\EditorTemplates\IdHashModel.cshtml" /> + <_ContentIncludedByDefault Remove="Views\Home\Changelog.cshtml" /> + <_ContentIncludedByDefault Remove="Views\Home\CODE_OF_CONDUCT.cshtml" /> + <_ContentIncludedByDefault Remove="Views\Home\CONTRIBUTING.cshtml" /> + <_ContentIncludedByDefault Remove="Views\Home\ISSUE_TEMPLATE.cshtml" /> + <_ContentIncludedByDefault Remove="Views\Home\NEEDED.cshtml" /> + <_ContentIncludedByDefault Remove="Views\Home\NEEDINFO.cshtml" /> + <_ContentIncludedByDefault Remove="Views\Home\PULL_REQUEST_TEMPLATE.cshtml" /> diff --git a/Aaru.Server/Controllers/HomeController.cs b/Aaru.Server/Controllers/HomeController.cs deleted file mode 100644 index 37499625..00000000 --- a/Aaru.Server/Controllers/HomeController.cs +++ /dev/null @@ -1,200 +0,0 @@ -// /*************************************************************************** -// Aaru Data Preservation Suite -// ---------------------------------------------------------------------------- -// -// Filename : HomeController.cs -// Author(s) : Natalia Portillo -// -// Component : Aaru Server. -// -// --[ Description ] ---------------------------------------------------------- -// -// Provides documentation data for razor views. -// -// --[ License ] -------------------------------------------------------------- -// -// This library 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 2.1 of the -// License, or (at your option) any later version. -// -// This library 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 library; if not, see . -// -// ---------------------------------------------------------------------------- -// Copyright © 2011-2021 Natalia Portillo -// ****************************************************************************/ - -using System; -using System.IO; -using System.Reflection; -using Markdig; -using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.Mvc; - -namespace Aaru.Server.Controllers -{ - public sealed class HomeController : Controller - { - readonly IWebHostEnvironment _environment; - - public HomeController(IWebHostEnvironment environment) => _environment = environment; - - [Route(""), Route("README")] - public ActionResult Index() - { - var sr = - new StreamReader(Path.Combine(_environment.ContentRootPath ?? throw new InvalidOperationException(), - "docs", "README.md")); - - string mdcontent = sr.ReadToEnd(); - sr.Close(); - - mdcontent = mdcontent.Replace(".md)", ")"); - - ViewBag.Markdown = Markdown.ToHtml(mdcontent); - - ViewBag.lblVersion = Assembly.GetExecutingAssembly().GetName().Version?.ToString(); - - return View(); - } - - [Route("Changelog")] - public ActionResult Changelog() - { - var sr = - new StreamReader(Path.Combine(_environment.ContentRootPath ?? throw new InvalidOperationException(), - "docs", "Changelog.md")); - - string mdcontent = sr.ReadToEnd(); - sr.Close(); - - mdcontent = mdcontent.Replace(".md)", ")"); - - ViewBag.Markdown = Markdown.ToHtml(mdcontent); - - ViewBag.lblVersion = Assembly.GetExecutingAssembly().GetName().Version?.ToString(); - - return View(); - } - - [Route("CODE_OF_CONDUCT")] - public ActionResult CODE_OF_CONDUCT() - { - var sr = - new StreamReader(Path.Combine(_environment.ContentRootPath ?? throw new InvalidOperationException(), - "docs", "CODE_OF_CONDUCT.md")); - - string mdcontent = sr.ReadToEnd(); - sr.Close(); - - mdcontent = mdcontent.Replace(".md)", ")").Replace("(.github/", "("); - - ViewBag.Markdown = Markdown.ToHtml(mdcontent); - - ViewBag.lblVersion = Assembly.GetExecutingAssembly().GetName().Version?.ToString(); - - return View(); - } - - [Route("PULL_REQUEST_TEMPLATE")] - public ActionResult PULL_REQUEST_TEMPLATE() - { - var sr = - new StreamReader(Path.Combine(_environment.ContentRootPath ?? throw new InvalidOperationException(), - "docs", "PULL_REQUEST_TEMPLATE.md")); - - string mdcontent = sr.ReadToEnd(); - sr.Close(); - - mdcontent = mdcontent.Replace(".md)", ")").Replace("(.github/", "("); - - ViewBag.Markdown = Markdown.ToHtml(mdcontent); - - ViewBag.lblVersion = Assembly.GetExecutingAssembly().GetName().Version?.ToString(); - - return View(); - } - - [Route("ISSUE_TEMPLATE")] - public ActionResult ISSUE_TEMPLATE() - { - var sr = - new StreamReader(Path.Combine(_environment.ContentRootPath ?? throw new InvalidOperationException(), - "docs", "ISSUE_TEMPLATE.md")); - - string mdcontent = sr.ReadToEnd(); - sr.Close(); - - mdcontent = mdcontent.Replace(".md)", ")").Replace("(.github/", "("); - - ViewBag.Markdown = Markdown.ToHtml(mdcontent); - - ViewBag.lblVersion = Assembly.GetExecutingAssembly().GetName().Version?.ToString(); - - return View(); - } - - [Route("CONTRIBUTING")] - public ActionResult Contributing() - { - var sr = - new StreamReader(Path.Combine(_environment.ContentRootPath ?? throw new InvalidOperationException(), - "docs", "CONTRIBUTING.md")); - - string mdcontent = sr.ReadToEnd(); - sr.Close(); - - mdcontent = mdcontent.Replace(".md)", ")").Replace("(.github/", "("); - - ViewBag.Markdown = Markdown.ToHtml(mdcontent); - - ViewBag.lblVersion = Assembly.GetExecutingAssembly().GetName().Version.ToString(); - - return View(); - } - - [Route("DONATING"), Route("NEEDED")] - public ActionResult Needed() - { - var sr = - new StreamReader(Path.Combine(_environment.ContentRootPath ?? throw new InvalidOperationException(), - "docs", "NEEDED.md")); - - string mdcontent = sr.ReadToEnd(); - sr.Close(); - - mdcontent = mdcontent.Replace(".md)", ")"); - - ViewBag.Markdown = Markdown.ToHtml(mdcontent); - - ViewBag.lblVersion = Assembly.GetExecutingAssembly().GetName().Version?.ToString(); - - return View(); - } - - [Route("NEEDINFO")] - public ActionResult NeedInfo() - { - var sr = - new StreamReader(Path.Combine(_environment.ContentRootPath ?? throw new InvalidOperationException(), - "docs", "NEEDINFO.md")); - - string mdcontent = sr.ReadToEnd(); - sr.Close(); - - mdcontent = mdcontent.Replace(".md)", ")"); - - ViewBag.Markdown = Markdown.ToHtml(mdcontent); - - ViewBag.lblVersion = Assembly.GetExecutingAssembly().GetName().Version?.ToString(); - - return View(); - } - } -} \ No newline at end of file diff --git a/Aaru.Server/Startup.cs b/Aaru.Server/Startup.cs index 7b3bd636..6e543ac0 100644 --- a/Aaru.Server/Startup.cs +++ b/Aaru.Server/Startup.cs @@ -61,6 +61,7 @@ namespace Aaru.Server app.UseHsts(); } + app.UseDefaultFiles(); app.UseStaticFiles(); // Add other security headers diff --git a/Aaru.Server/Views/Home/CODE_OF_CONDUCT.cshtml b/Aaru.Server/Views/Home/CODE_OF_CONDUCT.cshtml deleted file mode 100644 index 9c398172..00000000 --- a/Aaru.Server/Views/Home/CODE_OF_CONDUCT.cshtml +++ /dev/null @@ -1,43 +0,0 @@ -@{ - Layout = "~/Views/Shared/_Layout.cshtml"; - ViewBag.Title = "Aaru Server"; -} -@{ - // /*************************************************************************** - // Aaru Data Preservation Suite - // ---------------------------------------------------------------------------- - // - // Filename : CODE_OF_CONDUCT.cshtml - // Author(s) : Natalia Portillo - // - // Component : Aaru Server. - // - // --[ Description ] ---------------------------------------------------------- - // - // Renders code of conduct. - // - // --[ License ] -------------------------------------------------------------- - // - // This library 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 2.1 of the - // License, or (at your option) any later version. - // - // This library 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 library; if not, see . - // - // ---------------------------------------------------------------------------- - // Copyright © 2011-2021 Natalia Portillo - // ****************************************************************************/ -} -

- @Html.ActionLink("Return to main page.", "Index") -
- Aaru's code of conduct: -

-
@Html.Raw(ViewBag.Markdown)
\ No newline at end of file diff --git a/Aaru.Server/Views/Home/CONTRIBUTING.cshtml b/Aaru.Server/Views/Home/CONTRIBUTING.cshtml deleted file mode 100644 index 01c90574..00000000 --- a/Aaru.Server/Views/Home/CONTRIBUTING.cshtml +++ /dev/null @@ -1,43 +0,0 @@ -@{ - Layout = "~/Views/Shared/_Layout.cshtml"; - ViewBag.Title = "Aaru Server"; -} -@{ - // /*************************************************************************** - // Aaru Data Preservation Suite - // ---------------------------------------------------------------------------- - // - // Filename : CONTRIBUTING.cshtml - // Author(s) : Natalia Portillo - // - // Component : Aaru Server. - // - // --[ Description ] ---------------------------------------------------------- - // - // Renders contributing guidelines. - // - // --[ License ] -------------------------------------------------------------- - // - // This library 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 2.1 of the - // License, or (at your option) any later version. - // - // This library 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 library; if not, see . - // - // ---------------------------------------------------------------------------- - // Copyright © 2011-2021 Natalia Portillo - // ****************************************************************************/ -} -

- @Html.ActionLink("Return to main page.", "Index") -
- How to contribute to Aaru: -

-
@Html.Raw(ViewBag.Markdown)
\ No newline at end of file diff --git a/Aaru.Server/Views/Home/Changelog.cshtml b/Aaru.Server/Views/Home/Changelog.cshtml deleted file mode 100644 index f2d07cb5..00000000 --- a/Aaru.Server/Views/Home/Changelog.cshtml +++ /dev/null @@ -1,43 +0,0 @@ -@{ - Layout = "~/Views/Shared/_Layout.cshtml"; - ViewBag.Title = "Aaru Server"; -} -@{ - // /*************************************************************************** - // Aaru Data Preservation Suite - // ---------------------------------------------------------------------------- - // - // Filename : Changelog.cshtml - // Author(s) : Natalia Portillo - // - // Component : Aaru Server. - // - // --[ Description ] ---------------------------------------------------------- - // - // Renders changelog. - // - // --[ License ] -------------------------------------------------------------- - // - // This library 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 2.1 of the - // License, or (at your option) any later version. - // - // This library 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 library; if not, see . - // - // ---------------------------------------------------------------------------- - // Copyright © 2011-2021 Natalia Portillo - // ****************************************************************************/ -} -

- @Html.ActionLink("Return to main page.", "Index") -
- Aaru list of changes: -

-
@Html.Raw(ViewBag.Markdown)
\ No newline at end of file diff --git a/Aaru.Server/Views/Home/ISSUE_TEMPLATE.cshtml b/Aaru.Server/Views/Home/ISSUE_TEMPLATE.cshtml deleted file mode 100644 index cedd63ed..00000000 --- a/Aaru.Server/Views/Home/ISSUE_TEMPLATE.cshtml +++ /dev/null @@ -1,43 +0,0 @@ -@{ - Layout = "~/Views/Shared/_Layout.cshtml"; - ViewBag.Title = "Aaru Server"; -} -@{ - // /*************************************************************************** - // Aaru Data Preservation Suite - // ---------------------------------------------------------------------------- - // - // Filename : ISSUE_TEMPLATE.cshtml - // Author(s) : Natalia Portillo - // - // Component : Aaru Server. - // - // --[ Description ] ---------------------------------------------------------- - // - // Renders issue's template. - // - // --[ License ] -------------------------------------------------------------- - // - // This library 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 2.1 of the - // License, or (at your option) any later version. - // - // This library 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 library; if not, see . - // - // ---------------------------------------------------------------------------- - // Copyright © 2011-2021 Natalia Portillo - // ****************************************************************************/ -} -

- @Html.ActionLink("Return to main page.", "Index") -
- Aaru's template for issue reports: -

-
@Html.Raw(ViewBag.Markdown)
\ No newline at end of file diff --git a/Aaru.Server/Views/Home/Index.cshtml b/Aaru.Server/Views/Home/Index.cshtml deleted file mode 100644 index bc594310..00000000 --- a/Aaru.Server/Views/Home/Index.cshtml +++ /dev/null @@ -1,46 +0,0 @@ -@{ - Layout = "~/Views/Shared/_Layout.cshtml"; - ViewBag.Title = "Aaru Server"; -} -@{ - // /*************************************************************************** - // Aaru Data Preservation Suite - // ---------------------------------------------------------------------------- - // - // Filename : Index.cshtml - // Author(s) : Natalia Portillo - // - // Component : Aaru Server. - // - // --[ Description ] ---------------------------------------------------------- - // - // Renders readme. - // - // --[ License ] -------------------------------------------------------------- - // - // This library 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 2.1 of the - // License, or (at your option) any later version. - // - // This library 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 library; if not, see . - // - // ---------------------------------------------------------------------------- - // Copyright © 2011-2021 Natalia Portillo - // ****************************************************************************/ -} -
- Welcome to - - - Aaru - - Server version @ViewBag.lblVersion -
-
@Html.Raw(ViewBag.Markdown)
\ No newline at end of file diff --git a/Aaru.Server/Views/Home/NEEDED.cshtml b/Aaru.Server/Views/Home/NEEDED.cshtml deleted file mode 100644 index 476190e6..00000000 --- a/Aaru.Server/Views/Home/NEEDED.cshtml +++ /dev/null @@ -1,43 +0,0 @@ -@{ - Layout = "~/Views/Shared/_Layout.cshtml"; - ViewBag.Title = "Aaru Server"; -} -@{ - // /*************************************************************************** - // Aaru Data Preservation Suite - // ---------------------------------------------------------------------------- - // - // Filename : NEEDED.cshtml - // Author(s) : Natalia Portillo - // - // Component : Aaru Server. - // - // --[ Description ] ---------------------------------------------------------- - // - // Renders list of needed donations. - // - // --[ License ] -------------------------------------------------------------- - // - // This library 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 2.1 of the - // License, or (at your option) any later version. - // - // This library 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 library; if not, see . - // - // ---------------------------------------------------------------------------- - // Copyright © 2011-2021 Natalia Portillo - // ****************************************************************************/ -} -

- @Html.ActionLink("Return to main page.", "Index") -
- Aaru list of hardware and software needed: -

-
@Html.Raw(ViewBag.Markdown)
\ No newline at end of file diff --git a/Aaru.Server/Views/Home/NEEDINFO.cshtml b/Aaru.Server/Views/Home/NEEDINFO.cshtml deleted file mode 100644 index 99edbb46..00000000 --- a/Aaru.Server/Views/Home/NEEDINFO.cshtml +++ /dev/null @@ -1,43 +0,0 @@ -@{ - Layout = "~/Views/Shared/_Layout.cshtml"; - ViewBag.Title = "Aaru Server"; -} -@{ - // /*************************************************************************** - // Aaru Data Preservation Suite - // ---------------------------------------------------------------------------- - // - // Filename : NEEDINFO.cshtml - // Author(s) : Natalia Portillo - // - // Component : Aaru Server. - // - // --[ Description ] ---------------------------------------------------------- - // - // Renders list of needed donations. - // - // --[ License ] -------------------------------------------------------------- - // - // This library 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 2.1 of the - // License, or (at your option) any later version. - // - // This library 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 library; if not, see . - // - // ---------------------------------------------------------------------------- - // Copyright © 2011-2021 Natalia Portillo - // ****************************************************************************/ -} -

- @Html.ActionLink("Return to main page.", "Index") -
- Aaru list of information needed: -

-
@Html.Raw(ViewBag.Markdown)
\ No newline at end of file diff --git a/Aaru.Server/Views/Home/PULL_REQUEST_TEMPLATE.cshtml b/Aaru.Server/Views/Home/PULL_REQUEST_TEMPLATE.cshtml deleted file mode 100644 index 706c12b9..00000000 --- a/Aaru.Server/Views/Home/PULL_REQUEST_TEMPLATE.cshtml +++ /dev/null @@ -1,43 +0,0 @@ -@{ - Layout = "~/Views/Shared/_Layout.cshtml"; - ViewBag.Title = "Aaru Server"; -} -@{ - // /*************************************************************************** - // Aaru Data Preservation Suite - // ---------------------------------------------------------------------------- - // - // Filename : PULL_REQUEST_TEMPLATE.cshtml - // Author(s) : Natalia Portillo - // - // Component : Aaru Server. - // - // --[ Description ] ---------------------------------------------------------- - // - // Renders pull request's template. - // - // --[ License ] -------------------------------------------------------------- - // - // This library 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 2.1 of the - // License, or (at your option) any later version. - // - // This library 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 library; if not, see . - // - // ---------------------------------------------------------------------------- - // Copyright © 2011-2021 Natalia Portillo - // ****************************************************************************/ -} -

- @Html.ActionLink("Return to main page.", "Index") -
- Aaru's template for pull requests: -

-
@Html.Raw(ViewBag.Markdown)
\ No newline at end of file