Merge branch 'dev-master' of git.076.ne.jp:TechnicalSuwako/076server into model
このコミットが含まれているのは:
コミット
e0129f6fac
14
.env.example
14
.env.example
|
@ -2,6 +2,7 @@ APP_NAME=076Server
|
|||
APP_ENV=local
|
||||
APP_KEY=
|
||||
APP_DEBUG=false
|
||||
APP_LOG_LEVEL=debug
|
||||
APP_URL=http://localhost
|
||||
ONION_HOST=jkdasfhfdhndsfnklhjfdsknjfdgsjk.onion
|
||||
SESSION_SECURE_COOKIE=false
|
||||
|
@ -18,6 +19,7 @@ ADMIN_NAME=""
|
|||
ADMIN_PASS=""
|
||||
|
||||
LOG_CHANNEL=stack
|
||||
LOG_LEVEL=debug
|
||||
|
||||
DB_CONNECTION=mysql
|
||||
DB_HOST=127.0.0.1
|
||||
|
@ -32,6 +34,8 @@ QUEUE_CONNECTION=sync
|
|||
SESSION_DRIVER=file
|
||||
SESSION_LIFETIME=120
|
||||
|
||||
MEMCACHED_HOST=127.0.0.1
|
||||
|
||||
REDIS_HOST=127.0.0.1
|
||||
REDIS_PASSWORD=null
|
||||
REDIS_PORT=6379
|
||||
|
@ -41,7 +45,11 @@ MAIL_HOST=smtp.mailtrap.io
|
|||
MAIL_PORT=2525
|
||||
MAIL_USERNAME=null
|
||||
MAIL_PASSWORD=null
|
||||
MAIL_NOREPLY_USER=null
|
||||
MAIL_NOREPLY_PASS=null
|
||||
MAIL_ENCRYPTION=null
|
||||
MAIL_OWNER_ADDRESS=null
|
||||
MAIL_OWNER_NAME="${APP_NAME}"
|
||||
MAIL_FROM_ADDRESS=null
|
||||
MAIL_FROM_NAME="${APP_NAME}"
|
||||
|
||||
|
@ -52,3 +60,9 @@ CONOHA_DENANT_ID=""
|
|||
CONOHA_DENANT_NAME=""
|
||||
CONOHA_USER_NAME=""
|
||||
CONOHA_USER_PASS=""
|
||||
|
||||
YOUTUBE_API=""
|
||||
LBRY_URI=""
|
||||
PEER_URI=""
|
||||
PEER_USER=""
|
||||
PEER_PASS=""
|
|
@ -28,11 +28,11 @@ class BashController extends Controller {
|
|||
if (mb_substr($args[$i], 0, 1, 'utf-8')) $opt = $args[$i];
|
||||
}
|
||||
|
||||
if (strpos($opt, 'l') !== false) {
|
||||
if (str_contains($opt, 'l')) {
|
||||
$ps = null;
|
||||
$pg = null;
|
||||
|
||||
if (strpos($opt, 't') !== false) {
|
||||
if (str_contains($opt, 't')) {
|
||||
$pg = DB::table('blg_content')->select('publish_date')->where('isPost', 0)->orderBy('title', 'asc')->first();
|
||||
$ps = DB::table('blg_content')->select('publish_date')->where('isPost', 1)->orderBy('title', 'asc')->first();
|
||||
}
|
||||
|
@ -42,8 +42,8 @@ class BashController extends Controller {
|
|||
}
|
||||
|
||||
return "合計 2<br />
|
||||
drwxr-xr-x 2 suwako suwako ".(strpos($opt, 'h') !== false ? '4.0K' : '4096')." ".date('m', $ps->publish_date)."月 ".date('d', $ps->publish_date)." ".date('H:i', $ps->publish_date)." post<br />
|
||||
drwxr-xr-x 2 suwako suwako ".(strpos($opt, 'h') !== false ? '4.0K' : '4096')." ".date('m', $pg->publish_date)."月 ".date('d', $pg->publish_date)." ".date('H:i', $pg->publish_date)." page";
|
||||
drwxr-xr-x 2 suwako suwako ".(str_contains($opt, 'h') ? '4.0K' : '4096')." ".date('m', $ps->publish_date)."月 ".date('d', $ps->publish_date)." ".date('H:i', $ps->publish_date)." post<br />
|
||||
drwxr-xr-x 2 suwako suwako ".(str_contains($opt, 'h') ? '4.0K' : '4096')." ".date('m', $pg->publish_date)."月 ".date('d', $pg->publish_date)." ".date('H:i', $pg->publish_date)." page";
|
||||
}
|
||||
|
||||
return 'post page';
|
||||
|
@ -57,7 +57,7 @@ drwxr-xr-x 2 suwako suwako ".(strpos($opt, 'h') !== false ? '4.0K' : '4096')."
|
|||
$slug = '';
|
||||
|
||||
for ($i = 1; $i < count($cat); $i++) {
|
||||
if (strpos($cat[$i], 'post') !== false) $mode = 1;
|
||||
if (str_contains($cat[$i], 'post')) $mode = 1;
|
||||
$slug = $cat[$i];
|
||||
}
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ class Comment {
|
|||
|
||||
$user = null;
|
||||
if (isset($_COOKIE['kero_token'])) $user = DB::table('users')->select('id')->where('kero_token', $_COOKIE['kero_token'])->first()->id;
|
||||
if ($user == 0 && (strpos($r->newmessage, 'http://') !== false || strpos($r->newmessage, 'https://') !== false)) return redirect('/');
|
||||
if ($user == 0 && (str_contains($r->newmessage, 'http://') || str_contains($r->newmessage, 'https://'))) return redirect('/');
|
||||
|
||||
$add = DB::table('blg_comments')->insertGetId([
|
||||
'user_id' => $user,
|
||||
|
|
|
@ -0,0 +1,169 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Home;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Illuminate\Support\Facades\Mail;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
use App\Http\Controllers\MailerController;
|
||||
use App\Mail\ContactNotifyMail;
|
||||
|
||||
class Contact {
|
||||
private $field;
|
||||
|
||||
public function __construct () {
|
||||
$this->field = [
|
||||
'kenmei' => '',
|
||||
'adr' => '',
|
||||
'cat' => '',
|
||||
'cats' => [
|
||||
'' => '',
|
||||
'bugreport' => 'バグ報告したい',
|
||||
'chat' => 'チャットサービス(XMPP、IRC、Mumble)について聞きたい',
|
||||
'social' => 'SNSサービス(Pleroma、PeerTube)について聞きたい',
|
||||
'privfront' => '代替SNSフロントサービス(Nitter、Invidious、Librarian、Searx)について聞きたい',
|
||||
'storage' => 'ストレージサービス(Gitea、Nextcloud)について聞きたい',
|
||||
'otherserv' => '076外サービス(テク諏訪、076萌、URLoli、some.very.questionable.website、hozon.site、xmr.jp等)について聞きたい',
|
||||
'scam1' => 'DMCA報告したい',
|
||||
'scam2' => '営業したい',
|
||||
'scam3' => '法律について',
|
||||
'scam4' => '税金について',
|
||||
'scam5' => '無駄な話',
|
||||
],
|
||||
'bunsyo' => '',
|
||||
'gpg' => '',
|
||||
'ruleapply' => false,
|
||||
];
|
||||
}
|
||||
|
||||
public function index (Request $r) {
|
||||
if (isset($r->submit)) return $this->send($r);
|
||||
return view('pages.site.contact', ['field' => $this->field, 'err' => []]);
|
||||
}
|
||||
|
||||
public function seiko () {
|
||||
return view('pages.site.contact-seiko', ['field' => $this->field, 'suc' => ['メールを送りました!', '送信者様は連絡ルールを守ったら、24時間以内で返事します。']]);
|
||||
}
|
||||
|
||||
public function send (Request $r) {
|
||||
$this->field['adr'] = $r->adr;
|
||||
$this->field['kenmei'] = $r->kenmei;
|
||||
$this->field['cat'] = $r->cat;
|
||||
$this->field['catname'] = $r->cat;
|
||||
$this->field['gpg'] = !isset($r->gpg) || is_null($r->gpg) || $r->gpg == '' ? null : file_get_contents($r->file('gpg'));
|
||||
$this->field['bunsyo'] = $r->bunsyo;
|
||||
$this->field['ruleapply'] = isset($r->ruleapply);
|
||||
|
||||
$err = [];
|
||||
$gpg = null;
|
||||
|
||||
// メールアドレス
|
||||
if (!isset($this->field['adr']) || is_null($this->field['adr']) || $this->field['adr'] == '') $err[] = 'メールアドレスをご入力下さい。';
|
||||
else if (!filter_var($this->field['adr'], FILTER_VALIDATE_EMAIL)) $err[] = 'メールアドレスを正しくご入力下さい。';
|
||||
$this->field['filename'] = trim($this->field['adr']).'.key';
|
||||
|
||||
// 件名
|
||||
if (!isset($this->field['kenmei']) || is_null($this->field['kenmei']) || $this->field['kenmei'] == '') $err[] = '件名をご入力下さい。';
|
||||
if (str_contains($this->field['kenmei'], 'http://') || str_contains($this->field['kenmei'], 'https://')) $err[] = '件名でURLを入らないで下さい。';
|
||||
$this->field['bunsyo'] = trim($this->field['bunsyo']);
|
||||
|
||||
// カテゴリ
|
||||
if (!isset($this->field['cat']) || is_null($this->field['cat']) || $this->field['cat'] == '') $err[] = 'カテゴリをご選択下さい。';
|
||||
|
||||
// GPG
|
||||
if (!isset($this->field['gpg']) || is_null($this->field['gpg']) || $this->field['gpg'] == '') $err[] = 'GPGをご選択下さい。';
|
||||
else {
|
||||
$gpg = new \gnupg();
|
||||
$info = $gpg->import($this->field['gpg']);
|
||||
$gpg->addencryptkey($info['fingerprint']);
|
||||
Storage::disk('public')->put($this->field['filename'], $this->field['gpg']);
|
||||
$path = Storage::disk('public')->path($this->field['filename']);
|
||||
$verifygpg = explode("\n", $this->run('gpg --dry-run --import '.$path))[0];
|
||||
if (!str_contains($verifygpg, '処理数の合計: 1') && !str_contains($verifygpg, 'Total number processed: 1')) $err[] = $verifygpg;
|
||||
}
|
||||
|
||||
// 文章
|
||||
if (!isset($this->field['bunsyo']) || is_null($this->field['bunsyo']) || $this->field['bunsyo'] == '') $err[] = '文章をご入力下さい。';
|
||||
if (str_contains($this->field['bunsyo'], 'http://') || str_contains($this->field['bunsyo'], 'https://')) $err[] = '文章でURLを入らないで下さい。';
|
||||
if (isset($this->field['gpg']) && !is_null($this->field['gpg']) && $this->field['gpg'] != '') $this->field['bunsyo'] = $gpg->encrypt(trim("メール: ".$this->field['adr']."\n\n".$this->field['bunsyo']));
|
||||
|
||||
// 連絡ルール
|
||||
if (!$this->field['ruleapply']) $err[] = 'ルールを同意して下さい。';
|
||||
|
||||
if (!empty($err)) {
|
||||
if (isset($this->field['gpg']) && !is_null($this->field['gpg']) && $this->field['gpg'] != '') {
|
||||
Storage::disk('public')->delete($this->field['filename']);
|
||||
$this->field['bunsyo'] = $r->bunsyo;
|
||||
}
|
||||
return view('pages.site.contact', ['field' => $this->field, 'err' => $err]);
|
||||
}
|
||||
|
||||
// カテゴリはDMCA報告、営業、税金、法律、又は無駄な話を選択したら、いつでも送信せず失敗します。
|
||||
if (str_contains($this->field['cat'], 'scam')) {
|
||||
if (isset($this->field['gpg']) && !is_null($this->field['gpg']) && $this->field['gpg'] != '') {
|
||||
Storage::disk('public')->delete($this->field['filename']);
|
||||
$this->field['bunsyo'] = $r->bunsyo;
|
||||
}
|
||||
return view('pages.site.contact', ['field' => $this->field, 'err' => ['送信に失敗しました。数時間後もう一回送信してみて下さい。']]);
|
||||
}
|
||||
|
||||
foreach ($this->field['cats'] as $i => $c) {
|
||||
if ($this->field['cat'] == $i) $this->field['catname'] = $c;
|
||||
}
|
||||
|
||||
// メールを送る
|
||||
try {
|
||||
$mail = new MailerController();
|
||||
if (!$mail->compose($this->field, true)) {
|
||||
if (isset($this->field['gpg']) && !is_null($this->field['gpg']) && $this->field['gpg'] != '') {
|
||||
Storage::disk('public')->delete($this->field['filename']);
|
||||
$this->field['bunsyo'] = $r->bunsyo;
|
||||
}
|
||||
return view('pages.site.contact', ['field' => $this->field, 'err' => ['送信に失敗しました。数時間後もう一回送信してみて下さい。']]);
|
||||
}
|
||||
} catch (\Throwable $e) {
|
||||
if (isset($this->field['gpg']) && !is_null($this->field['gpg']) && $this->field['gpg'] != '') {
|
||||
Storage::disk('public')->delete($this->field['filename']);
|
||||
$this->field['bunsyo'] = $r->bunsyo;
|
||||
}
|
||||
Log::critical($e);
|
||||
return view('pages.site.contact', ['field' => $this->field, 'err' => ['送信に失敗しました。数時間後もう一回送信してみて下さい。']]);
|
||||
}
|
||||
|
||||
Storage::disk('public')->delete($this->field['filename']);
|
||||
$this->field['kenmei'] = '';
|
||||
$this->field['adr'] = '';
|
||||
$this->field['cat'] = '';
|
||||
$this->field['bunsyo'] = '';
|
||||
$this->field['gpg'] = '';
|
||||
$this->field['ruleapply'] = false;
|
||||
|
||||
return redirect('/contact/seiko');
|
||||
}
|
||||
|
||||
function run ($bin, $command = '', $force = true) {
|
||||
$stream = null;
|
||||
$bin .= $force ? ' 2>&1' : '';
|
||||
|
||||
$descriptorSpec = array(
|
||||
0 => array('pipe', 'r'),
|
||||
1 => array('pipe', 'w')
|
||||
);
|
||||
|
||||
$process = proc_open($bin, $descriptorSpec, $pipes);
|
||||
|
||||
if (is_resource($process)) {
|
||||
fwrite($pipes[0], $command);
|
||||
fclose($pipes[0]);
|
||||
|
||||
$stream = stream_get_contents($pipes[1]);
|
||||
fclose($pipes[1]);
|
||||
|
||||
proc_close($process);
|
||||
}
|
||||
|
||||
return $stream;
|
||||
}
|
||||
}
|
|
@ -48,7 +48,7 @@ class Content extends Engine {
|
|||
$frm['public_status'] = $r->public_status;
|
||||
$frm['publish_date'] = $r->publish_date;
|
||||
$frm['isMenu'] = (int)!is_null($r->isMenu) && $r->isMenu == 'on';
|
||||
$frm['isPost'] = (int)!is_null($r->isPost) && $r->isPost == 'on';
|
||||
$frm['isPost'] = (int)!is_null($r->isPost) && $r->isPost == '1';
|
||||
$frm['message'] = $r->message;
|
||||
|
||||
// 件名、文章又はスラッグがなければ、エラーを出て
|
||||
|
|
|
@ -0,0 +1,74 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Contracts\Routing\ResponseFactory;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
use PHPMailer\PHPMailer\PHPMailer;
|
||||
use PHPMailer\PHPMailer\Exception;
|
||||
|
||||
class MailerController extends Controller {
|
||||
public function __construct() {}
|
||||
|
||||
public function compose ($val, $form=false) {
|
||||
mb_language('japanese');
|
||||
mb_internal_encoding('UTF-8');
|
||||
|
||||
$mail = new PHPMailer(true);
|
||||
|
||||
try {
|
||||
// $mail->SMTPDebug = 2;
|
||||
$mail->isSMTP();
|
||||
$mail->Host = config('mail.mailers.smtp.host');
|
||||
$mail->Port = config('mail.mailers.smtp.port');
|
||||
$mail->SMTPSecure = config('mail.mailers.smtp.encryption');
|
||||
$mail->SMTPAuth = true;
|
||||
$mail->From = config('mail.'.($form ? 'owner' : 'from').'.address');
|
||||
$mail->FromName = mb_encode_mimeheader(config('mail.mailers.smtp.'.($form ? 'fromname' : 'noreplyfrom')), 'JIS');
|
||||
$mail->Username = config('mail.mailers.smtp.'.($form ? 'username' : 'noreplyuser'));
|
||||
$mail->Password = config('mail.mailers.smtp.'.($form ? 'password' : 'noreplypass'));
|
||||
|
||||
$mail->AddAddress(config('mail.'.($form ? 'owner' : 'from').'.address'));
|
||||
if ($form) $mail->addReplyTo(config('mail.owner.address'), config('mail.owner.name'));
|
||||
else $mail->addReplyTo($val['adr']);
|
||||
|
||||
$mail->SMTPOptions = [
|
||||
'ssl' => [
|
||||
'verify_peer' => false,
|
||||
'verify_peer_name' => false,
|
||||
'allow_self_signed' => true
|
||||
]
|
||||
];
|
||||
|
||||
if (isset($val['attach'])) {
|
||||
for ($i=0; $i < count($val['attach']); $i++) {
|
||||
$mail->AddAttachment($val['attach'][$i], $val['attachname'][$i]);
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($val['gpg'])) {
|
||||
$mail->AddStringAttachment($val['gpg'], $val['filename']);
|
||||
$mail->AddStringAttachment($val['bunsyo'], $val['adr'].'.gpg');
|
||||
}
|
||||
|
||||
$mail->isHTML(false);
|
||||
|
||||
$mail->Subject = mb_encode_mimeheader('【'.$val['catname'].'】'.$val['kenmei'], 'JIS');
|
||||
if ($form) $mail->Body = mb_convert_encoding($val['bunsyo'], 'UTF-8');
|
||||
else $mail->Body = mb_convert_encoding($val['bunsyo'], 'JIS');
|
||||
|
||||
if (!$mail->send()) {
|
||||
Log::critical('Mailer error: ' . $mail->ErrorInfo);
|
||||
return false;
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
Log::critical($e);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class RssFeedController extends Controller {
|
||||
public function feed () {
|
||||
$select = ['id', 'user_id', 'title', 'slug', 'publish_date', 'message'];
|
||||
$posts = DB::table('blg_content')->select($select)->where('isPost', true)->where('public_status', 0)->orderBy('id', 'desc')->limit(50)->get();
|
||||
|
||||
foreach ($posts as $k => $v) {
|
||||
$userd = DB::table('users')->where('id', $v->user_id)->first();
|
||||
$userd = DB::table('usr_profile')->where('user_id', $v->user_id)->first();
|
||||
$v->user = $userd->display_name;
|
||||
unset($posts[$k]->user_id);
|
||||
}
|
||||
|
||||
return response()->view('rss.feed', ['posts' => $posts])->header('Content-Type', 'application/xml');
|
||||
}
|
||||
}
|
|
@ -98,6 +98,7 @@ class Prayer extends Engine {
|
|||
|
||||
if (!$get) return $err;
|
||||
$get = json_decode($get);
|
||||
if (isset($get->status) && $get->status == 404) return [];
|
||||
|
||||
$come = array();
|
||||
$come['come'] = array();
|
||||
|
@ -116,7 +117,7 @@ class Prayer extends Engine {
|
|||
$g->comments->id = $g->id;
|
||||
$g->comments->name = $g->account->displayName;
|
||||
$g->comments->channel = $g->account->url;
|
||||
$g->comments->icon = env('PEER_URI').$g->account->avatar->path;
|
||||
$g->comments->icon = !is_null($g->account->avatar) ? env('PEER_URI').$g->account->avatar->path : '/img/noicon.jpg';
|
||||
$g->comments->message = strip_tags($g->text, array('<br />'));
|
||||
$g->comments->createdTS = strtotime($g->createdAt);
|
||||
$g->comments->created = date('Y年m月d日 H:i:s', strtotime($g->createdAt));
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
namespace App\Providers;
|
||||
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Illuminate\Pagination\Paginator;
|
||||
|
||||
class AppServiceProvider extends ServiceProvider
|
||||
{
|
||||
|
@ -23,6 +24,6 @@ class AppServiceProvider extends ServiceProvider
|
|||
*/
|
||||
public function boot()
|
||||
{
|
||||
//
|
||||
Paginator::useBootstrap();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,37 +2,24 @@
|
|||
"name": "laravel/laravel",
|
||||
"type": "project",
|
||||
"description": "The Laravel Framework.",
|
||||
"keywords": [
|
||||
"framework",
|
||||
"laravel"
|
||||
],
|
||||
"keywords": ["framework", "laravel"],
|
||||
"license": "MIT",
|
||||
"require": {
|
||||
"php": "^7.2.5",
|
||||
"fideloper/proxy": "^4.2",
|
||||
"fruitcake/laravel-cors": "^1.0",
|
||||
"guzzlehttp/guzzle": "^6.3",
|
||||
"laravel/framework": "^7.0",
|
||||
"laravel/tinker": "^2.0",
|
||||
"phpmailer/phpmailer": "^6.2",
|
||||
"predis/predis": "^1.1"
|
||||
"php": "^8.0",
|
||||
"fideloper/proxy": "^4.4.1",
|
||||
"fruitcake/laravel-cors": "^2.0.4",
|
||||
"guzzlehttp/guzzle": "^7.4.0",
|
||||
"laravel/framework": "^8.74.0",
|
||||
"laravel/tinker": "^2.6.2",
|
||||
"phpmailer/phpmailer": "^6.5",
|
||||
"predis/predis": "^1.1.9"
|
||||
},
|
||||
"require-dev": {
|
||||
"facade/ignition": "^2.0",
|
||||
"fzaninotto/faker": "^1.9.1",
|
||||
"mockery/mockery": "^1.3.1",
|
||||
"nunomaduro/collision": "^4.1",
|
||||
"phpunit/phpunit": "^8.5"
|
||||
},
|
||||
"config": {
|
||||
"optimize-autoloader": true,
|
||||
"preferred-install": "dist",
|
||||
"sort-packages": true
|
||||
},
|
||||
"extra": {
|
||||
"laravel": {
|
||||
"dont-discover": []
|
||||
}
|
||||
"facade/ignition": "^2.5",
|
||||
"fakerphp/faker": "^1.16.0",
|
||||
"mockery/mockery": "^1.4.2",
|
||||
"nunomaduro/collision": "^5.0",
|
||||
"phpunit/phpunit": "^9.5.10"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
|
@ -51,8 +38,6 @@
|
|||
"Tests\\": "tests/"
|
||||
}
|
||||
},
|
||||
"minimum-stability": "dev",
|
||||
"prefer-stable": true,
|
||||
"scripts": {
|
||||
"post-autoload-dump": [
|
||||
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
|
||||
|
@ -64,5 +49,17 @@
|
|||
"post-create-project-cmd": [
|
||||
"@php artisan key:generate --ansi"
|
||||
]
|
||||
}
|
||||
},
|
||||
"extra": {
|
||||
"laravel": {
|
||||
"dont-discover": []
|
||||
}
|
||||
},
|
||||
"config": {
|
||||
"optimize-autoloader": true,
|
||||
"preferred-install": "dist",
|
||||
"sort-packages": true
|
||||
},
|
||||
"minimum-stability": "dev",
|
||||
"prefer-stable": true
|
||||
}
|
||||
|
|
|
@ -55,6 +55,13 @@ return [
|
|||
'visibility' => 'public',
|
||||
],
|
||||
|
||||
'private' => [
|
||||
'driver' => 'local',
|
||||
'root' => storage_path('app/private'),
|
||||
'url' => env('APP_URL').'/storage',
|
||||
'visibility' => 'private',
|
||||
],
|
||||
|
||||
's3' => [
|
||||
'driver' => 's3',
|
||||
'key' => env('AWS_ACCESS_KEY_ID'),
|
||||
|
|
|
@ -39,8 +39,13 @@ return [
|
|||
'host' => env('MAIL_HOST', 'smtp.mailgun.org'),
|
||||
'port' => env('MAIL_PORT', 587),
|
||||
'encryption' => env('MAIL_ENCRYPTION', 'tls'),
|
||||
'fromname' => env('MAIL_OWNER_NAME'),
|
||||
'username' => env('MAIL_USERNAME'),
|
||||
'password' => env('MAIL_PASSWORD'),
|
||||
'noreplyfrom' => env('MAIL_FROM_NAME'),
|
||||
'noreplyuser' => env('MAIL_NOREPLY_USER'),
|
||||
'noreplypass' => env('MAIL_NOREPLY_PASS'),
|
||||
'sendmail' => '/usr/sbin/sendmail -bs',
|
||||
'timeout' => null,
|
||||
'auth_mode' => null,
|
||||
],
|
||||
|
@ -87,6 +92,10 @@ return [
|
|||
'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'),
|
||||
'name' => env('MAIL_FROM_NAME', 'Example'),
|
||||
],
|
||||
'owner' => [
|
||||
'address' => env('MAIL_OWNER_ADDRESS', 'hello@example.com'),
|
||||
'name' => env('MAIL_OWNER_NAME', 'Example'),
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
@extends('theme.'.env('THEME').'.site')
|
||||
|
||||
@section('content')
|
||||
<div class="within">
|
||||
<div class="bar">連絡フォーム</div>
|
||||
<div class="back">
|
||||
<div class="alert alert-success" role="alert">
|
||||
@foreach ($suc as $s)
|
||||
{{ $s }}<br />
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endsection
|
|
@ -0,0 +1,84 @@
|
|||
@extends('theme.'.env('THEME').'.site')
|
||||
|
||||
@section('content')
|
||||
<div class="within">
|
||||
<div class="bar">連絡フォーム</div>
|
||||
<div class="back">
|
||||
@if (!empty($err))
|
||||
<div class="alert alert-danger" role="alert">
|
||||
<ul>
|
||||
@foreach ($err as $e)
|
||||
<li>{{ $e }}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
@endif
|
||||
私のGPGはこちらです→ <a href="https://some.very.questionable.website/suwako-gpg.key">suwako-gpg.key</a>
|
||||
<hr />
|
||||
<form method="POST" action="/contact" enctype="multipart/form-data">
|
||||
@csrf
|
||||
<div class="row body">
|
||||
<div class="col-sm-3"><b>メールアドレス<span style="color: #ed1515;">*</span></b></div>
|
||||
<div class="col">
|
||||
<input name="adr" type="text" class="form-control" value="{{ $field['adr'] }}" />
|
||||
<span style="font-size: 10px; color: #7f8c8d;">例)notwork@076.ne.jp</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row body">
|
||||
<div class="col-sm-3"><b>件名<span style="color: #ed1515;">*</span></b></div>
|
||||
<div class="col">
|
||||
<input name="kenmei" type="text" class="form-control" value="{{ $field['kenmei'] }}" />
|
||||
<span style="font-size: 10px; color: #7f8c8d;">例)アカウントの作成について</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row body">
|
||||
<div class="col-sm-3"><b>カテゴリ<span style="color: #ed1515;">*</span></b></div>
|
||||
<div class="col">
|
||||
<select name="cat" class="form-control">
|
||||
@foreach ($field['cats'] as $k => $v)
|
||||
<option value="{{ $k }}" @if ($field['cat'] == $k) selected @endif >{{ $v }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
<span style="font-size: 10px; color: #ed1515;">注意)違うカテゴリを選択すると、メールアドレスをブロックされます!!</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row body">
|
||||
<div class="col-sm-3"><b>GPG公開キー<span style="color: #ed1515;">*</span></b></div>
|
||||
<div class="col"><input type="file" name="gpg" /></div>
|
||||
</div>
|
||||
<div class="row body">
|
||||
<div class="col-sm-3"><b>文章<span style="color: #ed1515;">*</span></b></div>
|
||||
<div class="col"><textarea name="bunsyo" rows="16" class="form-control">{{ $field['bunsyo'] }}</textarea></div>
|
||||
</div>
|
||||
<div class="row body">
|
||||
<div class="col-sm-3"><b>連絡ルール<span style="color: #ed1515;">*</span></b></div>
|
||||
<div class="col">
|
||||
<p style="font-size: 80%;">
|
||||
メールを送る前、ちゃんと下記のルールをお読み下さい。<br />
|
||||
ルールを守らないと、送信者様のメールアドレスをブラックリストに追加しますので、ご注意下さい。<br /><br />
|
||||
|
||||
① 件名及び文章にURLを追加できません、「http」や「https」等を消しても駄目です。<br />
|
||||
それの場合、送信者様のメールアドレスをブラックリストに追加します。<br />
|
||||
② 正しいカテゴリを選択して下さい。<br />
|
||||
文章と件名とカテゴリが異なったら、送信者様のメールアドレスをブラックリストに追加します。<br />
|
||||
③ 送るには、GPGパブリックキーは必須です。新規創造するには:「gpg --generate」<br />
|
||||
④ 返事する時も、GPGで暗号されないと、<br />
|
||||
私は返事しません。私のパブリックキーはページの上で御座います。<br />
|
||||
⑤ このフォームで、私のGPGパブリックキーを送ったら、返事しません。<br />
|
||||
⑥ 私は返事しなければ、複数同じメールを送ると、送信者様のメールアドレスをブラックリストに追加します。<br />
|
||||
⑦ 日本語でメールを送信して下さい。他の言語の場合、翻訳機で読めないと、返事しません。
|
||||
</p>
|
||||
<div class="form-group form-check">
|
||||
<input type="checkbox" name="ruleapply" class="form-check-input" id="ruleapply" @if ($field['ruleapply']) checked @endif />
|
||||
<label class="form-check-label" for="ruleapply">すべてのルールを読みました。そうして、全部で同意します。</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row body">
|
||||
<div class="col"><input type="submit" name="submit" class="btn btn-success btn-block" value="送信" /></div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endsection
|
|
@ -4,11 +4,11 @@
|
|||
|
||||
<div class="indexborder">
|
||||
@foreach ($res as $k => $r)
|
||||
<div class="within {{ ($r->public_status !== 0 ? ' wny' : '') }}" style="margin: {{ ($k == 0 ? 0 : 16) }}px auto {{ ($k == count($res)-1 ? 0 : 16) }}px">
|
||||
<div class="bar {{ ($r->public_status !== 0 ? ' bny' : '') }}">
|
||||
<a href="/blog/{{ $r->slug }}">{{ $r->title }}</a>
|
||||
<div class="within {{ ($r->public_status !== 0 ? ' wny' : '') }}" style="margin: {{ ($k == 0 ? 0 : 16) }}px auto {{ ($k == count($res)-1 ? 0 : 16) }}px">
|
||||
<div class="bar {{ ($r->public_status !== 0 ? ' bny' : '') }}">
|
||||
<a href="/blog/{{ $r->slug }}">{{ $r->title }}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
|
||||
|
|
|
@ -6,9 +6,9 @@
|
|||
<div class="bar">{{ __('site.signin') }}</div>
|
||||
<div class="back">
|
||||
@if ($err)
|
||||
<div class="alert alert-danger" role="alert">
|
||||
{{ $err }}
|
||||
</div>
|
||||
<div class="alert alert-danger" role="alert">
|
||||
{{ $err }}
|
||||
</div>
|
||||
@endif
|
||||
<form method="POST" action="/login">
|
||||
@csrf
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
<?=
|
||||
'<?xml version="1.0" encoding="UTF-8"?>'.PHP_EOL
|
||||
?>
|
||||
<rss version="2.0">
|
||||
<channel>
|
||||
<title><![CDATA[{{ env('APP_NAME') }}]]></title>
|
||||
<link><![CDATA[{{ env('APP_URL') }}/feed ]]></link>
|
||||
<description><![CDATA[ テクニカル諏訪子のホームページです。ゲーム及びテクノロジー関係ブログですわ♡ ]]></description>
|
||||
<language>ja</language>
|
||||
<pubDate>{{ now() }}</pubDate>
|
||||
|
||||
@foreach($posts as $post)
|
||||
<item>
|
||||
<title><![CDATA[{{ $post->title }}]]></title>
|
||||
<link>{{ env('APP_URL') }}/blog/{{ $post->slug }}</link>
|
||||
<description><![CDATA[{!! $post->message !!}]]></description>
|
||||
<author><![CDATA[{{ $post->user }}]]></author>
|
||||
<pubDate>{{ date('Y-m-d H:i:s', $post->publish_date) }}</pubDate>
|
||||
</item>
|
||||
@endforeach
|
||||
</channel>
|
||||
</rss>
|
|
@ -2,8 +2,9 @@
|
|||
<div class="collapse navbar-collapse">
|
||||
<a href="#" class="navbar-brand"><img src="/img/favicon.jpeg" style="border-radius: 4px;" width="30" height="30" alt="favicon" /></a>
|
||||
<ul class="navbar-nav mr-auto">
|
||||
<li class="nav-item"><a class="nav-link{{ (strpos($_SERVER['REQUEST_URI'], '/blog') !== false || $_SERVER['REQUEST_URI'] == '/' ? ' active' : '') }}" href="/">{{ __('site.top') }}</a></li>
|
||||
<li class="nav-item"><a class="nav-link{{ (str_contains($_SERVER['REQUEST_URI'], '/blog') || $_SERVER['REQUEST_URI'] == '/' ? ' active' : '') }}" href="/">{{ __('site.top') }}</a></li>
|
||||
<li class="nav-item"><a class="nav-link" href="http://{{ env('ONION_HOST') }}">Tor</a></li>
|
||||
<li class="nav-item"><a class="nav-link" href="/feed">RSS</a></li>
|
||||
</ul>
|
||||
<ul class="navbar-nav ml-auto">
|
||||
@if ($user)
|
||||
|
|
|
@ -14,19 +14,6 @@
|
|||
<!-- Styles -->
|
||||
@include('theme.'.env('THEME').'.component.favicon')
|
||||
@include('theme.'.env('THEME').'.component.colors')
|
||||
<style>
|
||||
#page { background: green; }
|
||||
#post { background: deeppink; }
|
||||
#typepost:checked + #page { background: cyan; }
|
||||
#typepost:checked ~ #post { background: blue; }
|
||||
#typepost:checked + #post { background: purple; }
|
||||
#typepost:checked ~ #page { background: brown; }
|
||||
|
||||
#typepost:checked + #page { display: none; }
|
||||
#typepost:checked ~ #post { display: block; }
|
||||
#typepage:checked + #post { display: none; }
|
||||
#typepage:checked ~ #page { display: block; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
@include('theme.'.env('THEME').'.component.navbar')
|
||||
|
|
|
@ -3,31 +3,37 @@
|
|||
Route::get('/', 'Home\Index@index');
|
||||
Route::get('/blog/{slug}', 'Home\Index@post');
|
||||
|
||||
Route::get('/changelang/{lang}', function ($lang) {
|
||||
setcookie('language', $lang, time()+157788000, '/', $_SERVER['HTTP_HOST'], 0, 1);
|
||||
return redirect('/');
|
||||
Route::group(['prefix' => 'content'], function () {
|
||||
Route::any('/add', 'Home\Content@add');
|
||||
Route::any('/{slug}/edit', 'Home\Content@edit');
|
||||
});
|
||||
|
||||
Route::any('/content/add', 'Home\Content@add');
|
||||
Route::any('/content/{slug}/edit', 'Home\Content@edit');
|
||||
|
||||
Route::any('/login', 'User\Login@index');
|
||||
Route::any('/register', 'User\Register@index');
|
||||
|
||||
Route::any('/profile/{id}/edit', 'User\Profile@edit');
|
||||
Route::get('/profile/{id}', 'User\Profile@index');
|
||||
Route::group(['prefix' => 'profile'], function () {
|
||||
Route::any('/{id}/edit', 'User\Profile@edit');
|
||||
Route::get('/{id}', 'User\Profile@index');
|
||||
});
|
||||
|
||||
Route::any('/video/game/add', 'Video\Game@add');
|
||||
Route::any('/video/game/{slug}/edit', 'Video\Game@edit');
|
||||
Route::group(['prefix' => 'video'], function () {
|
||||
Route::group(['prefix' => 'game'], function () {
|
||||
Route::any('/add', 'Video\Game@add');
|
||||
Route::any('/{slug}/edit', 'Video\Game@edit');
|
||||
});
|
||||
|
||||
Route::any('/video/add', 'Video\VideoTable@add');
|
||||
Route::any('/video/{vid}/edit', 'Video\VideoTable@edit');
|
||||
Route::any('/add', 'Video\VideoTable@add');
|
||||
Route::any('/{vid}/edit', 'Video\VideoTable@edit');
|
||||
|
||||
Route::get('/video', 'Video\Game@index');
|
||||
Route::get('/video/{slug}', 'Video\VideoTable@index');
|
||||
Route::get('/video/play/{vid}', 'Video\Prayer@index');
|
||||
Route::get('/', 'Video\Game@index');
|
||||
Route::get('/{slug}', 'Video\VideoTable@index');
|
||||
Route::get('/play/{vid}', 'Video\Prayer@index');
|
||||
});
|
||||
|
||||
Route::get('/memberlist', 'User\MemberList@index');
|
||||
Route::get('/commentlist', 'Home\CommentList@index');
|
||||
Route::get('/contact/seiko', 'Home\Contact@seiko');
|
||||
Route::any('/contact', 'Home\Contact@index');
|
||||
Route::get('/feed', 'RssFeedController@feed');
|
||||
|
||||
Route::get('/{slug}', 'Home\Index@page');
|
||||
|
|
新しいイシューから参照