From 18f05f4ccd2f6cb7507fc3e86ad7ca9a81247b0b Mon Sep 17 00:00:00 2001 From: carbotaniuman <41451839+carbotaniuman@users.noreply.github.com> Date: Mon, 22 Jun 2020 12:02:36 -0500 Subject: [PATCH] Added license headers --- src/main/kotlin/mdnet/base/Constants.kt | 18 ++++++++++ src/main/kotlin/mdnet/base/Main.kt | 35 ++++++++++++++++++- src/main/kotlin/mdnet/base/MangaDexClient.kt | 18 ++++++++++ src/main/kotlin/mdnet/base/ServerHandler.kt | 18 ++++++++++ src/main/kotlin/mdnet/base/Statistics.kt | 18 ++++++++++ src/main/kotlin/mdnet/base/dao/metadata.kt | 18 ++++++++++ .../mdnet/base/netty/ApplicationNetty.kt | 18 ++++++++++ src/main/kotlin/mdnet/base/netty/Keys.kt | 9 ++--- .../kotlin/mdnet/base/netty/WebUiNetty.kt | 18 ++++++++++ .../kotlin/mdnet/base/server/Application.kt | 18 ++++++++++ .../kotlin/mdnet/base/server/ImageServer.kt | 18 ++++++++++ src/main/kotlin/mdnet/base/server/WebUi.kt | 18 ++++++++++ src/main/kotlin/mdnet/base/server/common.kt | 18 ++++++++++ .../mdnet/base/settings/ClientSettings.kt | 18 ++++++++++ .../mdnet/base/settings/ServerSettings.kt | 18 ++++++++++ 15 files changed, 271 insertions(+), 7 deletions(-) diff --git a/src/main/kotlin/mdnet/base/Constants.kt b/src/main/kotlin/mdnet/base/Constants.kt index 028f889..249d29c 100644 --- a/src/main/kotlin/mdnet/base/Constants.kt +++ b/src/main/kotlin/mdnet/base/Constants.kt @@ -1,3 +1,21 @@ +/* +Mangadex@Home +Copyright (c) 2020, MangaDex Network +This file is part of MangaDex@Home. + +MangaDex@Home is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +MangaDex@Home 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 General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this MangaDex@Home. If not, see . + */ package mdnet.base import com.fasterxml.jackson.core.JsonParser diff --git a/src/main/kotlin/mdnet/base/Main.kt b/src/main/kotlin/mdnet/base/Main.kt index 6ecf668..e4475e0 100644 --- a/src/main/kotlin/mdnet/base/Main.kt +++ b/src/main/kotlin/mdnet/base/Main.kt @@ -1,3 +1,21 @@ +/* +Mangadex@Home +Copyright (c) 2020, MangaDex Network +This file is part of MangaDex@Home. + +MangaDex@Home is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +MangaDex@Home 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 General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this MangaDex@Home. If not, see . + */ package mdnet.base import ch.qos.logback.classic.LoggerContext @@ -19,9 +37,24 @@ object Main { @JvmStatic fun main(args: Array) { println( - "Mangadex@Home Client ${Constants.CLIENT_VERSION} (Build ${Constants.CLIENT_BUILD}) initializing" + "Mangadex@Home Client Version ${Constants.CLIENT_VERSION} (Build ${Constants.CLIENT_BUILD}) initializing" ) + println() println("Copyright (c) 2020, MangaDex Network") + println(""" + Mangadex@Home is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Mangadex@Home 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Mangadex@Home. If not, see . + """.trimIndent()) var file = "settings.json" if (args.size == 1) { diff --git a/src/main/kotlin/mdnet/base/MangaDexClient.kt b/src/main/kotlin/mdnet/base/MangaDexClient.kt index 7e27451..c2717da 100644 --- a/src/main/kotlin/mdnet/base/MangaDexClient.kt +++ b/src/main/kotlin/mdnet/base/MangaDexClient.kt @@ -1,3 +1,21 @@ +/* +Mangadex@Home +Copyright (c) 2020, MangaDex Network +This file is part of MangaDex@Home. + +MangaDex@Home is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +MangaDex@Home 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 General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this MangaDex@Home. If not, see . + */ /* ktlint-disable no-wildcard-imports */ package mdnet.base diff --git a/src/main/kotlin/mdnet/base/ServerHandler.kt b/src/main/kotlin/mdnet/base/ServerHandler.kt index 45ecd47..7e132d0 100644 --- a/src/main/kotlin/mdnet/base/ServerHandler.kt +++ b/src/main/kotlin/mdnet/base/ServerHandler.kt @@ -1,3 +1,21 @@ +/* +Mangadex@Home +Copyright (c) 2020, MangaDex Network +This file is part of MangaDex@Home. + +MangaDex@Home is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +MangaDex@Home 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 General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this MangaDex@Home. If not, see . + */ package mdnet.base import com.fasterxml.jackson.databind.DeserializationFeature diff --git a/src/main/kotlin/mdnet/base/Statistics.kt b/src/main/kotlin/mdnet/base/Statistics.kt index e9f502b..192e5d9 100644 --- a/src/main/kotlin/mdnet/base/Statistics.kt +++ b/src/main/kotlin/mdnet/base/Statistics.kt @@ -1,3 +1,21 @@ +/* +Mangadex@Home +Copyright (c) 2020, MangaDex Network +This file is part of MangaDex@Home. + +MangaDex@Home is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +MangaDex@Home 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 General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this MangaDex@Home. If not, see . + */ package mdnet.base import com.fasterxml.jackson.databind.PropertyNamingStrategy diff --git a/src/main/kotlin/mdnet/base/dao/metadata.kt b/src/main/kotlin/mdnet/base/dao/metadata.kt index 2af36d7..c71ce5e 100644 --- a/src/main/kotlin/mdnet/base/dao/metadata.kt +++ b/src/main/kotlin/mdnet/base/dao/metadata.kt @@ -1,3 +1,21 @@ +/* +Mangadex@Home +Copyright (c) 2020, MangaDex Network +This file is part of MangaDex@Home. + +MangaDex@Home is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +MangaDex@Home 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 General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this MangaDex@Home. If not, see . + */ package mdnet.base.dao import org.jetbrains.exposed.dao.Entity diff --git a/src/main/kotlin/mdnet/base/netty/ApplicationNetty.kt b/src/main/kotlin/mdnet/base/netty/ApplicationNetty.kt index b9aef00..39f6b0e 100644 --- a/src/main/kotlin/mdnet/base/netty/ApplicationNetty.kt +++ b/src/main/kotlin/mdnet/base/netty/ApplicationNetty.kt @@ -1,3 +1,21 @@ +/* +Mangadex@Home +Copyright (c) 2020, MangaDex Network +This file is part of MangaDex@Home. + +MangaDex@Home is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +MangaDex@Home 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 General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this MangaDex@Home. If not, see . + */ package mdnet.base.netty import io.netty.bootstrap.ServerBootstrap diff --git a/src/main/kotlin/mdnet/base/netty/Keys.kt b/src/main/kotlin/mdnet/base/netty/Keys.kt index 9ba75e2..6c76604 100644 --- a/src/main/kotlin/mdnet/base/netty/Keys.kt +++ b/src/main/kotlin/mdnet/base/netty/Keys.kt @@ -34,7 +34,6 @@ private const val PKCS_8_PEM_FOOTER = "-----END PRIVATE KEY-----" fun loadKey(keyDataString: String): PrivateKey? { if (keyDataString.contains(PKCS_1_PEM_HEADER)) { - // OpenSSL / PKCS#1 Base64 PEM encoded file val fixedString = keyDataString.replace(PKCS_1_PEM_HEADER, "").replace( PKCS_1_PEM_FOOTER, "") return readPkcs1PrivateKey( @@ -44,7 +43,6 @@ fun loadKey(keyDataString: String): PrivateKey? { ) } if (keyDataString.contains(PKCS_8_PEM_HEADER)) { - // PKCS#8 Base64 PEM encoded file val fixedString = keyDataString.replace(PKCS_8_PEM_HEADER, "").replace( PKCS_8_PEM_FOOTER, "") return readPkcs1PrivateKey( @@ -68,14 +66,13 @@ private fun readPkcs8PrivateKey(pkcs8Bytes: ByteArray): PrivateKey? { } private fun readPkcs1PrivateKey(pkcs1Bytes: ByteArray): PrivateKey? { - // We can't use Java internal APIs to parse ASN.1 structures, so we build a PKCS#8 key Java can understand val pkcs1Length = pkcs1Bytes.size val totalLength = pkcs1Length + 22 val pkcs8Header = byteArrayOf( - 0x30, 0x82.toByte(), (totalLength shr 8 and 0xff).toByte(), (totalLength and 0xff).toByte(), // Sequence + total length + 0x30, 0x82.toByte(), (totalLength shr 8 and 0xff).toByte(), (totalLength and 0xff).toByte(), 0x2, 0x1, 0x0, // Integer (0) - 0x30, 0xD, 0x6, 0x9, 0x2A, 0x86.toByte(), 0x48, 0x86.toByte(), 0xF7.toByte(), 0xD, 0x1, 0x1, 0x1, 0x5, 0x0, // Sequence: 1.2.840.113549.1.1.1, NULL - 0x4, 0x82.toByte(), (pkcs1Length shr 8 and 0xff).toByte(), (pkcs1Length and 0xff).toByte() // Octet string + length + 0x30, 0xD, 0x6, 0x9, 0x2A, 0x86.toByte(), 0x48, 0x86.toByte(), 0xF7.toByte(), 0xD, 0x1, 0x1, 0x1, 0x5, 0x0, + 0x4, 0x82.toByte(), (pkcs1Length shr 8 and 0xff).toByte(), (pkcs1Length and 0xff).toByte() ) val pkcs8bytes = join(pkcs8Header, pkcs1Bytes) return readPkcs8PrivateKey(pkcs8bytes) diff --git a/src/main/kotlin/mdnet/base/netty/WebUiNetty.kt b/src/main/kotlin/mdnet/base/netty/WebUiNetty.kt index 4a0916d..682af0b 100644 --- a/src/main/kotlin/mdnet/base/netty/WebUiNetty.kt +++ b/src/main/kotlin/mdnet/base/netty/WebUiNetty.kt @@ -1,3 +1,21 @@ +/* +Mangadex@Home +Copyright (c) 2020, MangaDex Network +This file is part of MangaDex@Home. + +MangaDex@Home is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +MangaDex@Home 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 General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this MangaDex@Home. If not, see . + */ package mdnet.base.netty import io.netty.bootstrap.ServerBootstrap diff --git a/src/main/kotlin/mdnet/base/server/Application.kt b/src/main/kotlin/mdnet/base/server/Application.kt index 5b17429..051c848 100644 --- a/src/main/kotlin/mdnet/base/server/Application.kt +++ b/src/main/kotlin/mdnet/base/server/Application.kt @@ -1,3 +1,21 @@ +/* +Mangadex@Home +Copyright (c) 2020, MangaDex Network +This file is part of MangaDex@Home. + +MangaDex@Home is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +MangaDex@Home 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 General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this MangaDex@Home. If not, see . + */ /* ktlint-disable no-wildcard-imports */ package mdnet.base.server diff --git a/src/main/kotlin/mdnet/base/server/ImageServer.kt b/src/main/kotlin/mdnet/base/server/ImageServer.kt index b425870..f1bb94e 100644 --- a/src/main/kotlin/mdnet/base/server/ImageServer.kt +++ b/src/main/kotlin/mdnet/base/server/ImageServer.kt @@ -1,3 +1,21 @@ +/* +Mangadex@Home +Copyright (c) 2020, MangaDex Network +This file is part of MangaDex@Home. + +MangaDex@Home is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +MangaDex@Home 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 General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this MangaDex@Home. If not, see . + */ /* ktlint-disable no-wildcard-imports */ package mdnet.base.server diff --git a/src/main/kotlin/mdnet/base/server/WebUi.kt b/src/main/kotlin/mdnet/base/server/WebUi.kt index 6de53d5..b2f9e71 100644 --- a/src/main/kotlin/mdnet/base/server/WebUi.kt +++ b/src/main/kotlin/mdnet/base/server/WebUi.kt @@ -1,3 +1,21 @@ +/* +Mangadex@Home +Copyright (c) 2020, MangaDex Network +This file is part of MangaDex@Home. + +MangaDex@Home is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +MangaDex@Home 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 General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this MangaDex@Home. If not, see . + */ /* ktlint-disable no-wildcard-imports */ package mdnet.base.server diff --git a/src/main/kotlin/mdnet/base/server/common.kt b/src/main/kotlin/mdnet/base/server/common.kt index a236ddc..841d027 100644 --- a/src/main/kotlin/mdnet/base/server/common.kt +++ b/src/main/kotlin/mdnet/base/server/common.kt @@ -1,3 +1,21 @@ +/* +Mangadex@Home +Copyright (c) 2020, MangaDex Network +This file is part of MangaDex@Home. + +MangaDex@Home is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +MangaDex@Home 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 General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this MangaDex@Home. If not, see . + */ /* ktlint-disable no-wildcard-imports */ package mdnet.base.server diff --git a/src/main/kotlin/mdnet/base/settings/ClientSettings.kt b/src/main/kotlin/mdnet/base/settings/ClientSettings.kt index 1c1ece1..33368a7 100644 --- a/src/main/kotlin/mdnet/base/settings/ClientSettings.kt +++ b/src/main/kotlin/mdnet/base/settings/ClientSettings.kt @@ -1,3 +1,21 @@ +/* +Mangadex@Home +Copyright (c) 2020, MangaDex Network +This file is part of MangaDex@Home. + +MangaDex@Home is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +MangaDex@Home 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 General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this MangaDex@Home. If not, see . + */ package mdnet.base.settings import com.fasterxml.jackson.databind.PropertyNamingStrategy diff --git a/src/main/kotlin/mdnet/base/settings/ServerSettings.kt b/src/main/kotlin/mdnet/base/settings/ServerSettings.kt index 648417f..a4de8dc 100644 --- a/src/main/kotlin/mdnet/base/settings/ServerSettings.kt +++ b/src/main/kotlin/mdnet/base/settings/ServerSettings.kt @@ -1,3 +1,21 @@ +/* +Mangadex@Home +Copyright (c) 2020, MangaDex Network +This file is part of MangaDex@Home. + +MangaDex@Home is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +MangaDex@Home 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 General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this MangaDex@Home. If not, see . + */ package mdnet.base.settings import com.fasterxml.jackson.databind.PropertyNamingStrategy