diff --git a/abi/addabi.php b/abi/addabi.php index 6905126..dc9502c 100644 --- a/abi/addabi.php +++ b/abi/addabi.php @@ -3,7 +3,7 @@ $mojisizefile = "../server/textsize.txt"; $banurldomainfile = "../server/banurldomain.txt"; $banurl_info = file_get_contents($banurldomainfile); -$banurl = preg_split("/\r\n|\n|\r/", $banurl_info); +$banurl = array_filter(preg_split("/\r\n|\n|\r/", $banurl_info)); require('../db.php'); @@ -57,16 +57,19 @@ if (safetext(isset($_POST['uniqid'])) && safetext(isset($_POST['abitext'])) && s exit; } // 禁止url確認 - for($i = 0; $i < count($banurl); $i++) { - if (false !== strpos($abitext, 'https://'.$banurl[$i])) { - $err = "contains_prohibited_url"; - $response = array( - 'error_code' => $err, - ); - echo json_encode($response, JSON_UNESCAPED_UNICODE); - exit; + if(!(empty($banurl))){ + for($i = 0; $i < count($banurl); $i++) { + if (false !== strpos($abitext, 'https://'.$banurl[$i])) { + $err = "contains_prohibited_url"; + $response = array( + 'error_code' => $err, + ); + echo json_encode($response, JSON_UNESCAPED_UNICODE); + exit; + } } } + try { $pdo = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS); diff --git a/actor/index.php b/actor/index.php index 51f41ea..11674f2 100644 --- a/actor/index.php +++ b/actor/index.php @@ -61,6 +61,8 @@ if(safetext($serversettings["serverinfo"]["server_activitypub"]) === "true"){ "preferredUsername" => "".$userData["userid"]."", "name" => "".$userData["username"]."", "summary" => "".nl2br($userData["profile"])."", + "followers" => "https://".$domain."/user/followers/?actor=@".$userid."", + "following" => "https://".$domain."/user/following/?actor=@".$userid."", "inbox" => "https://".$domain."/user/inbox/?actor=@".$userid."", "outbox" => "https://".$domain."/user/outbox/?actor=@".$userid."", "published" => "".date(DATE_ATOM, strtotime($userData["datetime"]))."", diff --git a/css/home.css b/css/home.css index 6f77ab5..db44ea8 100644 --- a/css/home.css +++ b/css/home.css @@ -3745,7 +3745,7 @@ label>input { .rightbox .btmbox{ position: absolute; - bottom: 6px; /*下に固定*/ + bottom: 8px; /*下に固定*/ height: fit-content; max-width: 45dvh; width: 90%; diff --git a/function/function.php b/function/function.php index a51d001..cd3ce8e 100644 --- a/function/function.php +++ b/function/function.php @@ -405,7 +405,7 @@ function YouTube_and_nicovideo_Links($postText) { } $video_id = str_replace('&', '?', $video_id); } elseif (isset($parsedUrl['path'])) { - if (preg_match('/^\/watch\/|^\/embed\/|^\/shorts\/|^\/v\//', $parsedUrl['path'])) { + if (preg_match('/^\/watch\/|^\/embed\/|^\/shorts\/|^\/v\/|\//', $parsedUrl['path'])) { $video_id = str_replace('/', '', htmlentities($parsedUrl['path'], ENT_QUOTES, 'UTF-8', false)); $video_time = 0; $iframe = true; @@ -692,7 +692,11 @@ function send_notification($to,$from,$title,$message,$url,$category){ } } // ユーズするとき全部この関数 -function send_ueuse($userid,$rpUniqid,$ruUniqid,$ueuse,$photo1,$photo2,$photo3,$photo4,$video1,$nsfw){ +function send_ueuse($userid,$rpUniqid,$ruUniqid,$ueuse,$photo1,$photo2,$photo3,$photo4,$video1,$nsfw,$aibwm){ + //AIBlockWaterMark-------------------------------------------- + require('../settings_admin/plugin_settings/aiblockwatermark_settings.php'); + //------------------------------------------------------ + $rpUniqid = safetext($rpUniqid); $ruUniqid = safetext($ruUniqid); $userid = safetext($userid); @@ -707,7 +711,8 @@ function send_ueuse($userid,$rpUniqid,$ruUniqid,$ueuse,$photo1,$photo2,$photo3,$ $banurldomainfile = "../server/banurldomain.txt"; $banurl_info = file_get_contents($banurldomainfile); - $banurl = preg_split("/\r\n|\n|\r/", $banurl_info); + $banurl = array_filter(preg_split("/\r\n|\n|\r/", $banurl_info)); + // データベースに接続 try { @@ -743,13 +748,16 @@ function send_ueuse($userid,$rpUniqid,$ruUniqid,$ueuse,$photo1,$photo2,$photo3,$ } // 禁止url確認 - for($i = 0; $i < count($banurl); $i++) { - if(!($banurl[$i] == "")){ - if (false !== strpos($ueuse, 'https://'.$banurl[$i])) { - $error_message[] = '投稿が禁止されているURLが含まれています。(INPUT_CONTAINS_PROHIBITED_URL)'; + if(!(empty($banurl))){ + for($i = 0; $i < count($banurl); $i++) { + if(!($banurl[$i] == "")){ + if (false !== strpos($ueuse, 'https://'.$banurl[$i])) { + $error_message[] = '投稿が禁止されているURLが含まれています。(INPUT_CONTAINS_PROHIBITED_URL)'; + } } } } + } $old_datetime = date("Y-m-d H:i:00"); @@ -963,6 +971,22 @@ function send_ueuse($userid,$rpUniqid,$ruUniqid,$ueuse,$photo1,$photo2,$photo3,$ } } + if($aibwm === true && !empty(AIBWM_CHK && AIBWM_CHK == "true")){ + require('../plugin/AIBlockWaterMark/aiblockwatermark.php'); + if(!($save_photo1 == "none")){ + AIBlockWaterMark($save_photo1, $userid); + } + if(!($save_photo2 == "none")){ + AIBlockWaterMark($save_photo2, $userid); + } + if(!($save_photo3 == "none")){ + AIBlockWaterMark($save_photo3, $userid); + } + if(!($save_photo4 == "none")){ + AIBlockWaterMark($save_photo4, $userid); + } + } + if(empty($error_message)) { // 書き込み日時を取得 $datetime = date("Y-m-d H:i:s"); @@ -1346,4 +1370,44 @@ function uwuzu_password_verify($password, $hash){ } } } + +//ユーザーのOther_Settings読み取り関数 +function val_OtherSettings($dataname, $jsontext){ + $other_settings = json_decode($jsontext, true); + if(!(empty($other_settings[$dataname]))) { + if(is_bool($other_settings[$dataname]) === true){ + if($other_settings[$dataname] == true){ + $ret = true; + }else{ + $ret = false; + } + }elseif(is_int($other_settings[$dataname]) === true){ + $ret = (int)$other_settings[$dataname]; + }elseif(is_string($other_settings[$dataname])){ + $ret = $other_settings[$dataname]; + } + }else{ + $ret = false; + } + return $ret; +} +//ユーザーのOther_Settings追加関数 +function val_AddOtherSettings($dataname, $data, $jsontext){ + $other_settings = json_decode($jsontext, true); + if(isset($dataname) && isset($data) && isset($jsontext)) { + if(is_bool($data) === true){ + $new_data = [$dataname=>$data]; + $ret = json_encode(array_merge($other_settings,$new_data)); + }elseif(is_int($data) === true){ + $new_data = [$dataname=>(int)$data]; + $ret = json_encode(array_merge($other_settings,$new_data)); + }elseif(is_string($data)){ + $new_data = [$dataname=>$data]; + $ret = json_encode(array_merge($other_settings,$new_data)); + } + }else{ + $ret = false; + } + return $ret; +} ?> \ No newline at end of file diff --git a/function/reuse.php b/function/reuse.php index 9b24bee..13973bb 100644 --- a/function/reuse.php +++ b/function/reuse.php @@ -43,12 +43,14 @@ if (safetext(isset($_POST['uniqid'])) && safetext(isset($_POST['reusetext'])) && $video1 = ""; $rpUniqid = ""; + + $AIBWM = false; if(!(empty($result["ueuse"]))){ $ruUniqid = $postUniqid; }else{ $ruUniqid = $result["ruuniqid"]; } - $ueuse_result = send_ueuse($userid,$rpUniqid,$ruUniqid,$reusetext,$photo1,$photo2,$photo3,$photo4,$video1,$nsfw_chk); + $ueuse_result = send_ueuse($userid,$rpUniqid,$ruUniqid,$reusetext,$photo1,$photo2,$photo3,$photo4,$video1,$nsfw_chk,$AIBWM); if($ueuse_result == null){ echo json_encode(['success' => true]); diff --git a/home/index.php b/home/index.php index a3cbc5a..f307857 100644 --- a/home/index.php +++ b/home/index.php @@ -187,7 +187,7 @@ $notificationcount = $notiData['notification_count']; //-----------------URLから取得---------------- if(isset($_GET['text'])) { - $ueuse = safetext($_GET['text']); + $ueuse = safetext(urldecode($_GET['text'])); }elseif(isset($_COOKIE['ueuse'])) { $ueuse = safetext($_COOKIE['ueuse']); } @@ -195,6 +195,16 @@ if(isset($_GET['text'])) { //------------------------------------------- if( !empty($_POST['btn_submit']) ) { + $settingsJsonQuery = $pdo->prepare("SELECT userid, other_settings FROM account WHERE userid = :userid"); + $settingsJsonQuery->bindValue(':userid', $userid); + $settingsJsonQuery->execute(); + $settingsJson = $settingsJsonQuery->fetch(); + if(!(empty($settingsJson["other_settings"]))){ + $isAIBWM = val_OtherSettings("isAIBlockWaterMark", $settingsJson["other_settings"]); + }else{ + $isAIBWM = false; + } + $ueuse = safetext($_POST['ueuse']); if(isset($_POST['nsfw_chk'])){ @@ -211,7 +221,7 @@ if( !empty($_POST['btn_submit']) ) { $rpUniqid = ""; $ruUniqid = ""; - $ueuse_result = send_ueuse($userid,$rpUniqid,$ruUniqid,$ueuse,$photo1,$photo2,$photo3,$photo4,$video1,$nsfw_chk); + $ueuse_result = send_ueuse($userid,$rpUniqid,$ruUniqid,$ueuse,$photo1,$photo2,$photo3,$photo4,$video1,$nsfw_chk,$isAIBWM); if($ueuse_result == null){ //一時保存していたユーズ内容の削除 diff --git a/server/uwuzuabout.txt b/server/uwuzuabout.txt index 8dce441..1c2de9c 100644 --- a/server/uwuzuabout.txt +++ b/server/uwuzuabout.txt @@ -94,27 +94,6 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -### WebPush -Copyright (c) 2015 Louis Lagrange - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ## 更新情報 編集者 : daichimarukana diff --git a/server/uwuzuinfo.txt b/server/uwuzuinfo.txt index 45ffcce..8bb6ecd 100644 --- a/server/uwuzuinfo.txt +++ b/server/uwuzuinfo.txt @@ -1,4 +1,4 @@ uwuzu -1.4.6 -2024/11/06 +1.4.7 +2024/11/14 daichimarukana,putonfps \ No newline at end of file diff --git a/server/uwuzurelease.txt b/server/uwuzurelease.txt index 03bedcf..d3cedfb 100644 --- a/server/uwuzurelease.txt +++ b/server/uwuzurelease.txt @@ -1,6 +1,28 @@ ## リリースノートだぜぇぇぇぇぇぇい!!!!!!! ここにはuwuzuの更新情報を載せてくぜぇ~!(いやまてテンションおかしいだろ...) +## Version 1.4.7 (Funium) +2024/11/14 +fix: 未使用のライブラリのライセンス情報が表示されてしまう問題を修正しました。 +fix: 一部のYouTubeリンクで埋め込みがされない問題を修正しました。 +fix: ドメインブロック機能の設定が空白の際にすべてのドメインがブロックされてしまう問題を修正しました! +chg: ActivityPubの仕様に少しでも近づけるようちょこっといじりました +chg: 一部UIを変更しました!!! +new: 各ユーザーごとにAI学習を拒否する設定を行えるようにしました! + これはHTML内にnoaiフラグを含むことによりAI学習を拒否する意思表示を行うものです。 + なお、この機能を使用するにはデータベースの更新が必要となります。 + データベースのaccountテーブルにother_settings(longtext)というカラムを追加してください。 + phpMyAdminで追加する場合は、タイプをJSONに選択して追加してください。 +new: AIによる学習(クロール)を拒否する管理者設定を追加しました! + この設定で次のAIクローラーによる学習が拒否されます。 + OpenAI、Google、Anthropic、Common Crawl +new: 利用可能なプラグインを増やしました! + 現在利用可能なプラグインは以下のものです。 + - AIBlockWaterMark + - PHPMailer + AIBlockWaterMarkの利用にもデータベースのaccountテーブルにother_settings(longtext)というカラムを追加する必要があります。 +del: OpenAI社によるGPTBotのクロールを拒否する設定項目を削除しました。 +uwuzu_database.sqlは更新済みです。 ## Version 1.4.6 (Funium) リリース日:2024/11/06 diff --git a/settings/index.php b/settings/index.php index 35bed7e..1778fef 100644 --- a/settings/index.php +++ b/settings/index.php @@ -190,6 +190,7 @@ $mail_settings = safetext($res["mail_settings"]); //phpmailer-------------------------------------------- require('../settings_admin/plugin_settings/phpmailer_settings.php'); //------------------------------------------------------ +require('../settings_admin/plugin_settings/aiblockwatermark_settings.php'); if( !empty($pdo) ) { // データベース接続の設定 @@ -200,6 +201,9 @@ if( !empty($pdo) ) { $role = $userData["role"]; + $isAIBlock = val_OtherSettings("isAIBlock", $userData["other_settings"]); + $isAIBWM = val_OtherSettings("isAIBlockWaterMark", $userData["other_settings"]); + if(!(empty($userData["encryption_ivkey"]))){ $view_mailadds = DecryptionUseEncrKey($userData["mailadds"], GenUserEnckey($userData["datetime"]), $userData["encryption_ivkey"]); }else{ @@ -231,6 +235,22 @@ if( !empty($_POST['btn_submit']) ) { $mailadds = safetext($_POST['mailadds']); + $new_isAIBlock = safetext($_POST['isAIBlock']); + if($new_isAIBlock === "true"){ + $save_isAIBlock = true; + }else{ + $save_isAIBlock = false; + } + $other_settings_json = val_AddOtherSettings("isAIBlock", $save_isAIBlock, $userData["other_settings"]); + + $new_isAIBMW = safetext($_POST['isAIBMW']); + if($new_isAIBMW === "true"){ + $save_isAIBMW = true; + }else{ + $save_isAIBMW = false; + } + $other_settings_json = val_AddOtherSettings("isAIBlockWaterMark", $save_isAIBMW, $other_settings_json); + if( !empty($_POST['mail_important']) ) { $mail_important = safetext($_POST['mail_important']); }else{ @@ -306,7 +326,7 @@ if( !empty($_POST['btn_submit']) ) { try { // SQL作成 - $stmt = $pdo->prepare("UPDATE account SET username = :username, mailadds = :mailadds, profile = :profile, sacinfo = :saveimbot, mail_settings = :mail_settings WHERE userid = :userid;"); + $stmt = $pdo->prepare("UPDATE account SET username = :username, mailadds = :mailadds, profile = :profile, sacinfo = :saveimbot, mail_settings = :mail_settings, other_settings = :other_settings WHERE userid = :userid;"); // 他の値をセット $stmt->bindParam(':username', $username, PDO::PARAM_STR); @@ -314,6 +334,7 @@ if( !empty($_POST['btn_submit']) ) { $stmt->bindParam(':profile', $profile, PDO::PARAM_STR); $stmt->bindParam(':saveimbot', $saveim_bot, PDO::PARAM_STR); $stmt->bindParam(':mail_settings', $savemail_important, PDO::PARAM_STR); + $stmt->bindParam(':other_settings', $other_settings_json, PDO::PARAM_STR); // 条件を指定 // 以下の部分を適切な条件に置き換えてください @@ -845,6 +866,36 @@ $pdo = null; + +
AIによる学習を拒否する
+AI学習防止透かしを自動挿入する
+AIBlockWaterMarkプラグイン
+AIBlockWaterMarkのオンオフ
+ diff --git a/settings_admin/plugin_settings/aiblockwatermark_settings.php b/settings_admin/plugin_settings/aiblockwatermark_settings.php new file mode 100644 index 0000000..daae8b1 --- /dev/null +++ b/settings_admin/plugin_settings/aiblockwatermark_settings.php @@ -0,0 +1,5 @@ + + + \ No newline at end of file diff --git a/settings_admin/serveradmin.php b/settings_admin/serveradmin.php index 8f7fb81..2cf2b9f 100644 --- a/settings_admin/serveradmin.php +++ b/settings_admin/serveradmin.php @@ -284,7 +284,7 @@ if( !empty($_POST['btn_submit']) ) { if($postrobots === "true"){ //GPTBotによるクロールを拒否 $file = fopen($robots, 'w'); - $data = "User-agent: GPTBot\nDisallow: /"; + $data = "User-agent: GPTBot\nDisallow: /\n\nUser-agent: ChatGPT-User\nDisallow: /\n\nUser-agent: Google-Extended\nDisallow: /\n\nUser-agent: ClaudeBot\nDisallow: /\n\nUser-agent: CCBot\nDisallow: /"; fputs($file, $data); fclose($file); }else{ @@ -348,7 +348,7 @@ if( !empty($_POST['btn_submit']) ) { $url = (empty($_SERVER['HTTPS']) ? 'http://' : 'https://') . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; header("Location:".$url.""); - exit; + exit; } require('../logout/logout.php'); ?> @@ -496,9 +496,11 @@ require('../logout/logout.php');OpenAIによるクロールを拒否するかどうか
※robots.txtによりOpenAIからのクロールを拒否するものであり、他のAI企業によるクロールを完全拒否するものではございません。
AI学習を拒否するかどうか
+