| 1 | <?php |
| 2 | /************************************************************* |
| 3 | # 076 License |
| 4 | |
| 5 | Copyright (c) テクニカル諏訪子 |
| 6 | |
| 7 | Permission is hereby granted to any person obtaining a copy of the software |
| 8 | Little Beast (the "Software") to use, modify, merge, copy, publish, distribute, |
| 9 | sublicense, and/or sell copies of the Software, subject to the following conditions: |
| 10 | |
| 11 | 1. **Origin Attribution**: |
| 12 | - You must not misrepresent the origin of the Software; you must not claim |
| 13 | you created the original Software. |
| 14 | - If the Software is used in a product, you must either: |
| 15 | a. Provide clear attribution in the product's documentation, user interface, |
| 16 | or other visible areas, **OR** |
| 17 | b. Pay the original developers a fee they specify in writing. |
| 18 | 2. **Usage Restriction**: |
| 19 | - The Software, or any derivative works, dependencies, or libraries |
| 20 | incorporating it, must not be used for censorship or to suppress freedom of |
| 21 | speech, expression, or creativity. Prohibited uses include, but are not |
| 22 | limited to: |
| 23 | - Censorship of so-called "hate speech", visuals, non-mainstream opinions, |
| 24 | ideas, or objective reality. |
| 25 | - Tools or systems designed to restrict access to information or |
| 26 | artistic works. |
| 27 | 3. **Notice Preservation**: |
| 28 | - This license and the above copyright notice must remain intact in all copies |
| 29 | of the source code. |
| 30 | |
| 31 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, |
| 32 | INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A |
| 33 | PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT |
| 34 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF |
| 35 | CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE |
| 36 | OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| 37 | */ |
| 38 | define('REPO_ROOT', '/repos/'); |
| 39 | define('TWITTER_HANDLE', '@techsuwako'); |
| 40 | // 静的ファイル(画像・CSS等)の場所。パス(例:「/static」=public/static/)、又は別のサーバーのURL(例:「https://ass.example.com/static」) |
| 41 | // URLの場合、アップロードされたファイルはpublic/の下の同じパス(例:public/static/)に保存するので、そのサーバーと同期して下さい |
| 42 | define('ASS_DOMAIN', '/static'); |
| 43 | // TLS(HTTPS・STARTTLS等)で信頼するCAの証明書のPEMファイル。空ならシステムの場所(/etc/ssl/cert.pem等)を探す |
| 44 | // chroot(OpenBSDのhttpd・php-fpm)の中では/var/www/etc/ssl/cert.pemが/etc/ssl/cert.pemになる。Windowsでは指定が必要 |
| 45 | define('TLS_CAFILE', ''); |
| 46 | define('SITEINFO', [ |
| 47 | 'title' => 'Little Beast', |
| 48 | 'description' => 'PHP Framework', |
| 49 | 'tags' => 'game,tech,developer', |
| 50 | 'url' => '', |
| 51 | ]); |
| 52 | // ブログ(URLのディレクトリ => 設定)。ブログ毎に「/ディレクトリ.atom」のフィードが出来る |
| 53 | // title:フィードの名前(省略するとSITEINFOのtitle) |
| 54 | // federate:FEDIINFOのアカウントが新しい記事を投稿し、Fediverseからの返信をコメントにする(省略するとblogだけtrue) |
| 55 | // more:Fediverseの投稿の「続きを読む」リンクの文字(省略すると「読み続き」) |
| 56 | define('BLOGS', [ |
| 57 | 'blog' => [], |
| 58 | ]); |
| 59 | define('MAILINFO', [ |
| 60 | 'from' => 'hogehoge@ho.ge', |
| 61 | 'host' => 'smtp.ho.ge', |
| 62 | 'port' => 587, |
| 63 | 'user' => 'hogehoge@ho.ge', |
| 64 | 'pass' => 'hogehogehoge', |
| 65 | ]); |
| 66 | define('FEDIINFO', [ |
| 67 | 'domain' => '', // 例:example.com 又は https://example.com |
| 68 | // falseにするとマルチユーザーモード:ブログのアクターはそのままで、 |
| 69 | // Fediverseのロールを持つユーザーはそれぞれアクター(@ユーザー名@ドメイン)になり、/microblogが使える。 |
| 70 | // AUTH_ENABLEDとcron(apdeliver)も必要 |
| 71 | 'isSingleUser' => true, |
| 72 | 'actor' => 'loli', |
| 73 | 'actorNick' => 'ロリ', |
| 74 | 'desc' => '', |
| 75 | 'icon' => ASS_DOMAIN.'/logo.png', |
| 76 | 'pubkey' => ROOT.'/public/static/pub.pem', |
| 77 | 'privkey' => ROOT.'/data/priv.pem', |
| 78 | ]); |
| 79 | // データベース(DB_ENABLEDが必要)。driver:mysql(MariaDBも)、pgsql(PostgreSQL、portは普通5432、charsetはUTF8)、sqlite |
| 80 | // socket:UNIXソケットのパス(指定するとhost・portの代わりに使う、例:/var/run/mysql/mysql.sock、PostgreSQLはディレクトリも可:/tmp) |
| 81 | // tls:trueで証明書を確認するTLS、又はsslのコンテキストオプションの配列(例:['cafile' => '/etc/ssl/ca.pem']) |
| 82 | // debug:送受信したパケットを出力する |
| 83 | // PostgreSQLのみ:channel_binding(prefer、require、disable)、allow_cleartext(TLSでなくてもパスワードをそのまま送る) |
| 84 | // SQLiteのみ:path(ファイル、相対パスはROOTから、例:data/site.sqlite)、readonly、busy_timeout(ロックを待つミリ秒) |
| 85 | define('DBINFO', [ |
| 86 | 'driver' => 'mysql', |
| 87 | 'host' => '127.0.0.1', |
| 88 | 'port' => 3306, |
| 89 | 'socket' => '', |
| 90 | 'username' => '', |
| 91 | 'password' => '', |
| 92 | 'dbname' => '', |
| 93 | 'charset' => 'utf8mb4', |
| 94 | 'tls' => false, |
| 95 | 'debug' => false, |
| 96 | ]); |
| 97 | // Gitler(Gitのホスティング、GITLER_ENABLEDが必要)。root:リポジトリのディレクトリ(相対パスはROOTから。 |
| 98 | // OpenBSDではphp-fpmのchrootの中、例:サイトが/var/www/htdocsなら../git=/var/www/git、/var/www/htdocs/example.com/wwwなら../../../git)。 |
| 99 | // ssh:SSHのホスト(git@example.com、空ならSSHは無し)、sshPort、php:SSHで使うPHPのコマンド(chrootの外のパス)、 |
| 100 | // objectFormat:新しいリポジトリの形式(sha1、sha256)、branch:新しいリポジトリのブランチ、maxRepos:1人の最大 |
| 101 | define('GITINFO', [ |
| 102 | 'root' => '../git', |
| 103 | 'ssh' => '', |
| 104 | 'sshPort' => 22, |
| 105 | 'php' => '/usr/local/bin/php-8.5', |
| 106 | 'objectFormat' => 'sha1', |
| 107 | 'branch' => 'master', |
| 108 | 'maxRepos' => 100, |
| 109 | ]); |
| 110 | define('OPENPROVIDER', [ |
| 111 | 'username' => '', |
| 112 | 'password' => '', |
| 113 | 'ip' => '0.0.0.0', |
| 114 | 'owner_handle' => '', |
| 115 | ]); |
| 116 | |
| 117 | define('MAILER_ENABLED', false); |
| 118 | define('LOGGING_ENABLED', true); |
| 119 | define('ATOM_ENABLED', true); |
| 120 | define('ACTIVITYPUB_ENABLED', false); |
| 121 | define('CRON_ENABLED', false); |
| 122 | define('CURL_ENABLED', true); |
| 123 | define('AUTH_ENABLED', false); |
| 124 | define('OPENPROVIDER_ENABLED', false); |
| 125 | define('DB_ENABLED', false); // データベース(DBINFOを参照) |
| 126 | define('AUTH_REGISTER_ENABLED', false); |
| 127 | define('AUTH_VERIFY_EMAIL', false); // 登録時にメールアドレスの確認を必須にする(MAILER_ENABLEDも必要) |
| 128 | define('AUTH_2FA_ENABLED', false); // 二段階認証(認証アプリのコード)を使えるようにする(各ユーザーがプロフィールの編集から有効にする) |
| 129 | define('COMMENTS_ENABLED', false); // 記事のコメント(書き込みはAUTH_ENABLED、Fediverseからの返信はACTIVITYPUB_ENABLEDも必要) |
| 130 | define('ADMIN_ENABLED', false); // 管理画面(/admin、管理者のロールとAUTH_ENABLEDが必要)。ユーザー、ログ、Cron、キャッシュ、データベースの変換 |
| 131 | define('ADMIN_SETUP_CODE', ''); // 管理者が居ない時に、/admin/setupで最初の管理者を作る為のコード(長くて推測されにくい物、作った後は空に) |
| 132 | define('GITLER_ENABLED', false); // Gitler(/gitler、Gitのリポジトリ、AUTH_ENABLEDも必要。GITINFOを参照) |
| 133 | define('COPYRIGHT_YEAR', '2018-'.date('Y')); |
| 134 | define('DEBUG_MODE', false); |