├── .env.sample ├── .gitignore ├── README.md ├── api ├── redoc │ └── openapi.json └── swagger │ ├── _data_api.yaml │ └── data_api.yaml ├── d-build.sh ├── d-down.sh ├── d-up.sh ├── data_api.sh ├── docker-compose.yml ├── docker ├── Dockerfile ├── httpd │ └── virtualhost.conf └── mt-data │ └── .keep ├── docs_assets ├── 20221204073039.png └── 20221204073718.png ├── dump.sh ├── mt-settings ├── mt-config.cgi ├── mt-static │ ├── mtml │ │ └── .keep │ └── plugins │ │ └── .keep └── plugins │ └── .keep ├── mtml └── .keep ├── sql └── test_data_mysql.sql └── www ├── html └── .keep └── logs └── .keep /.env.sample: -------------------------------------------------------------------------------- 1 | MYSQL_ALLOW_EMPTY_PASSWORD=yes 2 | MYSQL_ROOT_PASSWORD=root 3 | MYSQL_DATABASE=movabletype 4 | MYSQL_USER=movabletype 5 | MYSQL_PASSWORD=movabletype 6 | CONTAINER_BASE_NAME=website 7 | CGI_BASE_PATH=/var/www/local/cgi-bin 8 | DUMP_FILE=test_data_mysql 9 | WEB_PORT=11000:80 10 | APP_PORT=5000 11 | DB_PORT=3306:3306 12 | WORK_DIR=/var/www/mt 13 | MT=MT7-R5402 14 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /www/logs/* 2 | !/www/logs/.keep 3 | /www/html/* 4 | !/www/html/.keep 5 | # !/www/html/.htaccess 6 | /db-data/ 7 | 8 | # gitignore 9 | 10 | # ------------------------------ 11 | # Numerous always-ignore extensions 12 | # ------------------------------ 13 | 14 | .env 15 | *~ 16 | *.diff 17 | *.log 18 | *.swp 19 | *.zip 20 | *.sass-cache 21 | *.tmphtml 22 | *.map 23 | *.dat 24 | *.pid 25 | 26 | # ------------------------------ 27 | # OS or Editor filders 28 | # ------------------------------ 29 | 30 | .DS_Store 31 | ._* 32 | Thumbs.db 33 | .cache 34 | .project 35 | .settings 36 | .sublime-project 37 | .sublime-workspace 38 | 39 | # ------------------------------ 40 | # Folders to ignore 41 | # ------------------------------ 42 | 43 | .svn 44 | .ssh 45 | .grunt 46 | .vagrant 47 | .vagrant.d 48 | .idea 49 | node_modules 50 | components 51 | bower 52 | bower_components 53 | _bower 54 | pids 55 | 56 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Local development environment 2 | 3 | - Docker 4 | - Rocky Linux 9 5 | - Apache 6 | - MySQL 5.7 7 | - Perl 8 | - Movable Type 9 | - Swagger 10 | - Redocly 11 | 12 | | 起動アプリケーション | URL | 13 | |----------------|-----------------------------------| 14 | | Movable Type | http://localhost:11000/cgi-bin/mt | 15 | | Swagger Editor | http://localhost:8001 | 16 | | Swagger UI | http://localhost:8002 | 17 | | Redocly Redoc | http://localhost:8003 | 18 | 19 | ## Setup 20 | 21 | 1. .env.sampleを.envにリネーム 22 | 2. .env環境変数を設定 23 | 3. mt-settings/mt-config.cgiで設定したDB情報を入力 24 | 4. Movable Type本体のディレクトリ名をMT-7.0にしてzipにする 25 | 5. docker/mt-data 配下にMovable Typeをzipで配置 26 | 27 | ## docker compose command 28 | 29 | Movable Type を配置して、docker compose で起動します。 30 | 31 | ### Build 32 | 33 | 必要なイメージをダウンロードを行い、設置したMovable Typeを配置し展開します。 34 | 35 | ```bash 36 | ./d-build.sh 37 | ``` 38 | 39 | ### Start 40 | 41 | ```bash 42 | ./d-up.sh 43 | ``` 44 | 45 | ### Shutdown 46 | 47 | ```bash 48 | ./d-down.sh 49 | ``` 50 | 51 | ### Dump 52 | 53 | ShutdownでDBは破棄されます。 54 | 必要なデータはシャットダウンの前にDBのDumpを取ります。 55 | 56 | 以下のコマンドで `sql/test.sql` が生成されます。 57 | 58 | ```bash 59 | ./dump.sh test 60 | ``` 61 | 62 | 再度起動する時は、 `env` ファイルに取り出した Dumpファイルを指定することで起動できます。 63 | 64 | ```dotenv 65 | DUMP_FILE=test 66 | ``` 67 | 68 | ### Login SSH Web 69 | 70 | ``` 71 | docker exec -it コンテナ名 /bin/bash 72 | ``` 73 | 74 | ### Login MySQL 75 | 76 | ``` 77 | docker exec -it コンテナ名 /bin/bash 78 | ``` 79 | 80 | ## Swagger 81 | 82 | ![Swagger](./docs_assets/20221204073039.png) 83 | 84 | Dockerを起動するとData API用のSwagger UIが表示します。 85 | localhost:11000のMTに入ってるデータを確認する場合は、 `mt-config.cgi` に `DataAPICORSAllowOrigin` を設定します。 86 | 87 | ```cgi 88 | DataAPICORSAllowOrigin http://localhost:8002/ 89 | ``` 90 | 91 | ## Redocly Redoc 92 | 93 | ![Redocly](./docs_assets/20221204073718.png) 94 | 95 | Movalbe TypeのData APIのドキュメントでも利用しているRedoclyをローカルで参照可能です。 96 | 97 | `data_api.sh` で最新APIのJSONを取得して、起動時に `openapi.json` を参照して閲覧できます。 98 | 99 | ### Data API OpenAPI 100 | 101 | Data API のリポジトリからOpenAPIのJSONを取得するシェルスクリプトです。 102 | 103 | ```bash 104 | ./data_api.sh 105 | ``` 106 | 107 | シェルスクリプトを実行することで `./api/redoc/openapi.json` に配置します。 108 | 109 | ## Local Data Share 110 | 111 | ローカルで構築したCMSのデータを共有する手順です。 112 | 113 | 1. 出力された画像などをzipにまとめる 114 | 2. git経由でzipデータを共有する(共有先は任意) 115 | 3. バックアップしたsqlを共有 116 | 4. zipを解凍して該当のドキュメントルートへ入れる 117 | 5. sqlをリストアしてデータベースを上書きする 118 | 119 | ```bash 120 | # Backup 121 | docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql 122 | 123 | # Restore 124 | cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE 125 | ``` 126 | 127 | ## Remove Storage 128 | 129 | Dockerで作成したStorageが残っていた場合は削除するコマンド 130 | 131 | ```bash 132 | docker volume ls -qf dangling=true | xargs -J% docker volume rm % 133 | ``` 134 | -------------------------------------------------------------------------------- /api/swagger/_data_api.yaml: -------------------------------------------------------------------------------- 1 | openapi: 3.0.0 2 | info: 3 | version: 1.0.0 4 | title: Data API 5 | description: >- 6 | Movable Type Data API Swagger 7 | servers: 8 | - url: 'http://localhost:11000/cgi-bin/mt/mt-data-api.cgi/v5/' 9 | tags: 10 | - name: Authentication 11 | description: Authentication でアクセストークン取得 12 | - name: Site 13 | description: Site の情報取得 14 | - name: Content Types 15 | description: Content Types の情報取得 16 | - name: Content Data 17 | description: Content Data の情報取得 18 | - name: Content Fields 19 | description: Content Fields の情報取得 20 | - name: Category Set 21 | description: Category Set の情報取得 22 | - name: Assets 23 | description: Assets の情報取得 24 | paths: 25 | /authentication: 26 | post: 27 | tags: 28 | - Authentication 29 | description: > 30 | Authentication : Authenticationでアクセストークン取得 31 | parameters: 32 | - $ref: '#/components/parameters/Username' 33 | - $ref: '#/components/parameters/Password' 34 | - $ref: '#/components/parameters/ClientId' 35 | responses: 36 | '200': 37 | description: Response 200 38 | content: 39 | application/json: 40 | schema: 41 | allOf: 42 | - $ref: '#/components/schemas/Authentication' 43 | '403': 44 | description: Response 403 45 | content: 46 | application/json: 47 | schema: 48 | $ref: '#/components/schemas/Error403' 49 | '404': 50 | description: Response 404 51 | content: 52 | application/json: 53 | schema: 54 | $ref: '#/components/schemas/Error404' 55 | /sites: 56 | get: 57 | tags: 58 | - Site 59 | description: > 60 | Site Collection : サイトの一覧情報取得 61 | parameters: 62 | - $ref: '#/components/parameters/Search' 63 | - $ref: '#/components/parameters/SearchFields' 64 | - $ref: '#/components/parameters/Limit' 65 | - $ref: '#/components/parameters/Offset' 66 | - $ref: '#/components/parameters/SiteSortBy' 67 | - $ref: '#/components/parameters/SortOrder' 68 | - $ref: '#/components/parameters/IncludeIds' 69 | - $ref: '#/components/parameters/ExcludeIds' 70 | - $ref: '#/components/parameters/Fields' 71 | - $ref: '#/components/parameters/DateField' 72 | - $ref: '#/components/parameters/DateFrom' 73 | - $ref: '#/components/parameters/DateTo' 74 | responses: 75 | '200': 76 | description: Response 200 77 | content: 78 | application/json: 79 | schema: 80 | allOf: 81 | - $ref: '#/components/schemas/TotalResults' 82 | - $ref: '#/components/schemas/SiteCollection' 83 | '403': 84 | description: Response 403 85 | content: 86 | application/json: 87 | schema: 88 | $ref: '#/components/schemas/Error403' 89 | '404': 90 | description: Response 404 91 | content: 92 | application/json: 93 | schema: 94 | $ref: '#/components/schemas/Error404' 95 | /sites/{site_id}/assets: 96 | get: 97 | tags: 98 | - Assets 99 | description: > 100 | Assets : ファイルの情報取得 101 | parameters: 102 | - $ref: '#/components/parameters/SiteId' 103 | responses: 104 | '200': 105 | description: Response 200 106 | content: 107 | application/json: 108 | schema: 109 | allOf: 110 | - $ref: '#/components/schemas/TotalResultsNumber' 111 | - $ref: '#/components/schemas/AssetsCollection' 112 | '403': 113 | description: Response 403 114 | content: 115 | application/json: 116 | schema: 117 | $ref: '#/components/schemas/Error403' 118 | '404': 119 | description: Response 404 120 | content: 121 | application/json: 122 | schema: 123 | $ref: '#/components/schemas/Error404' 124 | /sites/{site_id}/assets/{asset_id}: 125 | get: 126 | tags: 127 | - Assets 128 | description: > 129 | Assets : ファイルの情報取得 130 | parameters: 131 | - $ref: '#/components/parameters/SiteId' 132 | - $ref: '#/components/parameters/AssetsId' 133 | responses: 134 | '200': 135 | description: Response 200 136 | content: 137 | application/json: 138 | schema: 139 | $ref: '#/components/schemas/Assets' 140 | '403': 141 | description: Response 403 142 | content: 143 | application/json: 144 | schema: 145 | $ref: '#/components/schemas/Error403' 146 | '404': 147 | description: Response 404 148 | content: 149 | application/json: 150 | schema: 151 | $ref: '#/components/schemas/Error404' 152 | /sites/{site_id}: 153 | get: 154 | tags: 155 | - Site 156 | description: > 157 | Site : サイト情報取得 158 | parameters: 159 | - $ref: '#/components/parameters/SiteId' 160 | - $ref: '#/components/parameters/Fields' 161 | responses: 162 | '200': 163 | description: Response 200 164 | content: 165 | application/json: 166 | schema: 167 | $ref: '#/components/schemas/Site' 168 | '403': 169 | description: Response 403 170 | content: 171 | application/json: 172 | schema: 173 | $ref: '#/components/schemas/Error403' 174 | '404': 175 | description: Response 404 176 | content: 177 | application/json: 178 | schema: 179 | $ref: '#/components/schemas/Error404' 180 | /sites/{site_id}/categorySets: 181 | get: 182 | tags: 183 | - Category Set 184 | description: > 185 | Category Set Collection : カテゴリセット一覧の情報取得 186 | parameters: 187 | - $ref: '#/components/parameters/SiteId' 188 | - $ref: '#/components/parameters/Search' 189 | - $ref: '#/components/parameters/SearchFields' 190 | - $ref: '#/components/parameters/Limit' 191 | - $ref: '#/components/parameters/Offset' 192 | - $ref: '#/components/parameters/CategorySetSortBy' 193 | - $ref: '#/components/parameters/SortOrder' 194 | - $ref: '#/components/parameters/IncludeIds' 195 | - $ref: '#/components/parameters/ExcludeIds' 196 | - $ref: '#/components/parameters/Fields' 197 | - $ref: '#/components/parameters/DateField' 198 | - $ref: '#/components/parameters/DateFrom' 199 | - $ref: '#/components/parameters/DateTo' 200 | responses: 201 | '200': 202 | description: Response 200 203 | content: 204 | application/json: 205 | schema: 206 | allOf: 207 | - $ref: '#/components/schemas/TotalResults' 208 | - $ref: '#/components/schemas/CategorySetCollection' 209 | '403': 210 | description: Response 403 211 | content: 212 | application/json: 213 | schema: 214 | $ref: '#/components/schemas/Error403' 215 | '404': 216 | description: Response 404 217 | content: 218 | application/json: 219 | schema: 220 | $ref: '#/components/schemas/Error404' 221 | /sites/{site_id}/categorySets/{category_set_id}: 222 | get: 223 | tags: 224 | - Category Set 225 | description: > 226 | Category Set : カテゴリセットの情報取得 227 | parameters: 228 | - $ref: '#/components/parameters/SiteId' 229 | - $ref: '#/components/parameters/CategorySetId' 230 | - $ref: '#/components/parameters/Fields' 231 | responses: 232 | '200': 233 | description: Response 200 234 | content: 235 | application/json: 236 | schema: 237 | $ref: '#/components/schemas/CategorySet' 238 | '403': 239 | description: Response 403 240 | content: 241 | application/json: 242 | schema: 243 | $ref: '#/components/schemas/Error403' 244 | '404': 245 | description: Response 404 246 | content: 247 | application/json: 248 | schema: 249 | $ref: '#/components/schemas/Error404' 250 | /sites/{site_id}/categorySets/{category_set_id}/categories: 251 | get: 252 | tags: 253 | - Category Set 254 | description: > 255 | Category Set Categories Collection : カテゴリセットのカテゴリ一覧取得 256 | parameters: 257 | - $ref: '#/components/parameters/SiteId' 258 | - $ref: '#/components/parameters/CategorySetId' 259 | - $ref: '#/components/parameters/MaxDepth' 260 | - $ref: '#/components/parameters/IncludeCurrent' 261 | - $ref: '#/components/parameters/Limit' 262 | - $ref: '#/components/parameters/SortOrder' 263 | - $ref: '#/components/parameters/SearchFields' 264 | - $ref: '#/components/parameters/DateField' 265 | - $ref: '#/components/parameters/DateFrom' 266 | - $ref: '#/components/parameters/DateTo' 267 | responses: 268 | '200': 269 | description: Response 200 270 | content: 271 | application/json: 272 | schema: 273 | allOf: 274 | - $ref: '#/components/schemas/TotalResults' 275 | - $ref: '#/components/schemas/CategorySetCategoriesCollection' 276 | '403': 277 | description: Response 403 278 | content: 279 | application/json: 280 | schema: 281 | $ref: '#/components/schemas/Error403' 282 | '404': 283 | description: Response 404 284 | content: 285 | application/json: 286 | schema: 287 | $ref: '#/components/schemas/Error404' 288 | /sites/{site_id}/categorySets/{category_set_id}/categories/{category_id}: 289 | get: 290 | tags: 291 | - Category Set 292 | description: > 293 | Category Set Category : カテゴリセットの特定のカテゴリを取得する 294 | parameters: 295 | - $ref: '#/components/parameters/SiteId' 296 | - $ref: '#/components/parameters/CategorySetId' 297 | - $ref: '#/components/parameters/CategoryId' 298 | - $ref: '#/components/parameters/Fields' 299 | responses: 300 | '200': 301 | description: Response 200 302 | content: 303 | application/json: 304 | schema: 305 | $ref: '#/components/schemas/CategorySetCategory' 306 | '403': 307 | description: Response 403 308 | content: 309 | application/json: 310 | schema: 311 | $ref: '#/components/schemas/Error403' 312 | '404': 313 | description: Response 404 314 | content: 315 | application/json: 316 | schema: 317 | $ref: '#/components/schemas/Error404' 318 | /sites/{site_id}/contentTypes: 319 | get: 320 | tags: 321 | - Content Types 322 | description: | 323 | - Content Types : コンテンツタイプ一覧の情報取得 324 | - 取得には認証が必要です。 325 | parameters: 326 | - $ref: '#/components/parameters/SiteId' 327 | - $ref: '#/components/parameters/Fields' 328 | - $ref: '#/components/parameters/Limit' 329 | - $ref: '#/components/parameters/Offset' 330 | - $ref: '#/components/parameters/ContentTypesSortBy' 331 | - $ref: '#/components/parameters/SortOrder' 332 | - $ref: '#/components/parameters/IncludeIds' 333 | - $ref: '#/components/parameters/ExcludeIds' 334 | responses: 335 | '200': 336 | description: Response 200 337 | content: 338 | application/json: 339 | schema: 340 | allOf: 341 | - $ref: '#/components/schemas/TotalResults' 342 | - $ref: '#/components/schemas/ContentTypesCollection' 343 | '403': 344 | description: Response 403 345 | content: 346 | application/json: 347 | schema: 348 | $ref: '#/components/schemas/Error403' 349 | '404': 350 | description: Response 404 351 | content: 352 | application/json: 353 | schema: 354 | $ref: '#/components/schemas/Error404' 355 | /sites/{site_id}/contentTypes/{content_type_id}: 356 | get: 357 | tags: 358 | - Content Types 359 | description: | 360 | - Content Types : コンテンツタイプの情報取得 361 | - 取得には認証が必要です。 362 | parameters: 363 | - $ref: '#/components/parameters/SiteId' 364 | - $ref: '#/components/parameters/ContentTypeId' 365 | responses: 366 | '200': 367 | description: Response 200 368 | content: 369 | application/json: 370 | schema: 371 | allOf: 372 | - $ref: '#/components/schemas/ContentTypes' 373 | '403': 374 | description: Response 403 375 | content: 376 | application/json: 377 | schema: 378 | $ref: '#/components/schemas/Error403' 379 | '404': 380 | description: Response 404 381 | content: 382 | application/json: 383 | schema: 384 | $ref: '#/components/schemas/Error404' 385 | /sites/{site_id}/contentTypes/{content_type_id}/data: 386 | get: 387 | tags: 388 | - Content Data 389 | description: > 390 | Content Data Collection : コンテンツデータ一覧の情報取得 391 | parameters: 392 | - $ref: '#/components/parameters/SiteId' 393 | - $ref: '#/components/parameters/ContentTypeId' 394 | - $ref: '#/components/parameters/Fields' 395 | - $ref: '#/components/parameters/Limit' 396 | - $ref: '#/components/parameters/Offset' 397 | - $ref: '#/components/parameters/ContentDataAndContentFieldSortBy' 398 | - $ref: '#/components/parameters/SortOrder' 399 | - $ref: '#/components/parameters/IncludeIds' 400 | - $ref: '#/components/parameters/ExcludeIds' 401 | - $ref: '#/components/parameters/DataAPIExtendSearchQueryFrom' 402 | - $ref: '#/components/parameters/DataAPIExtendSearchQueryTo' 403 | - $ref: '#/components/parameters/DataAPIExtendSearchQueryDateType' 404 | - $ref: '#/components/parameters/DataAPIExtendSearchQueryBefore' 405 | - $ref: '#/components/parameters/DataAPIExtendSearchQueryAfter' 406 | - $ref: '#/components/parameters/DataAPIExtendSearchQueryDays' 407 | - $ref: '#/components/parameters/DataAPIExtendSearchQueryFuture' 408 | - $ref: '#/components/parameters/DataAPIExtendSearchQueryPast' 409 | - $ref: '#/components/parameters/DataAPIExtendSearchQueryLabel' 410 | - $ref: '#/components/parameters/DataAPIExtendSearchQueryLabelEq' 411 | - $ref: '#/components/parameters/DataAPIExtendSearchQueryIdentifier' 412 | - $ref: '#/components/parameters/DataAPIExtendSearchQueryIdentifierEq' 413 | - $ref: '#/components/parameters/DataAPIExtendSearchQueryContentFieldId' 414 | responses: 415 | '200': 416 | description: Response 200 417 | content: 418 | application/json: 419 | schema: 420 | allOf: 421 | - $ref: '#/components/schemas/TotalResults' 422 | - $ref: '#/components/schemas/ContentDataCollection' 423 | '403': 424 | description: Response 403 425 | content: 426 | application/json: 427 | schema: 428 | $ref: '#/components/schemas/Error403' 429 | '404': 430 | description: Response 404 431 | content: 432 | application/json: 433 | schema: 434 | $ref: '#/components/schemas/Error404' 435 | /sites/{site_id}/contentTypes/{content_type_id}/dataExtend: 436 | get: 437 | tags: 438 | - Content Data 439 | description: | 440 | - Content Data Collection dataExtend : DataAPIExtendSearch v1.5.0 で追加された dataExtend エンドポイント 441 | - description:このエンドポイントは、デフォルトのdataエンドポイントに加えてコンテンツフィールドのソートが可能になります。また、デフォルトのdataエンドポイントにはないページングpaginateオブジェクトが追加されます。 442 | parameters: 443 | - $ref: '#/components/parameters/SiteId' 444 | - $ref: '#/components/parameters/ContentTypeId' 445 | - $ref: '#/components/parameters/Fields' 446 | - $ref: '#/components/parameters/Limit' 447 | - $ref: '#/components/parameters/Offset' 448 | - $ref: '#/components/parameters/IncludeIds' 449 | - $ref: '#/components/parameters/ExcludeIds' 450 | - $ref: '#/components/parameters/DataAPIExtendSearchQueryContentFieldId' 451 | - $ref: '#/components/parameters/DataAPIExtendSearchQuerySortFieldName' 452 | - $ref: '#/components/parameters/DataAPIExtendSearchQuerySortFieldNameOrder' 453 | - $ref: '#/components/parameters/DataAPIExtendSearchQueryLimitPerPage' 454 | - $ref: '#/components/parameters/DataAPIExtendSearchQueryPage' 455 | responses: 456 | '200': 457 | description: Response 200 458 | content: 459 | application/json: 460 | schema: 461 | allOf: 462 | - $ref: '#/components/schemas/TotalResults' 463 | - $ref: '#/components/schemas/ContentDataCollection' 464 | - $ref: '#/components/schemas/Paginate' 465 | '403': 466 | description: Response 403 467 | content: 468 | application/json: 469 | schema: 470 | $ref: '#/components/schemas/Error403' 471 | '404': 472 | description: Response 404 473 | content: 474 | application/json: 475 | schema: 476 | $ref: '#/components/schemas/Error404' 477 | /sites/{site_id}/contentTypes/{content_type_id}/data/{content_data_id}: 478 | get: 479 | tags: 480 | - Content Data 481 | description: > 482 | Content Data : コンテンツデータ詳細の情報取得 ※お知らせなどの詳細画面で利用する 483 | parameters: 484 | - $ref: '#/components/parameters/SiteId' 485 | - $ref: '#/components/parameters/ContentTypeId' 486 | - $ref: '#/components/parameters/ContentDataId' 487 | - $ref: '#/components/parameters/Fields' 488 | responses: 489 | '200': 490 | description: Response 200 491 | content: 492 | application/json: 493 | schema: 494 | $ref: '#/components/schemas/ContentData' 495 | '403': 496 | description: Response 403 497 | content: 498 | application/json: 499 | schema: 500 | $ref: '#/components/schemas/Error403' 501 | '404': 502 | description: Response 404 503 | content: 504 | application/json: 505 | schema: 506 | $ref: '#/components/schemas/Error404' 507 | /sites/{site_id}/contentTypes/{content_type_id}/fields: 508 | get: 509 | tags: 510 | - Content Fields 511 | description: | 512 | - Content Data : コンテンツフィールドの情報取得 フィールドのID確認用 513 | - 取得には認証が必要です。 514 | parameters: 515 | - $ref: '#/components/parameters/SiteId' 516 | - $ref: '#/components/parameters/ContentTypeId' 517 | - $ref: '#/components/parameters/Fields' 518 | - $ref: '#/components/parameters/Limit' 519 | - $ref: '#/components/parameters/Offset' 520 | - $ref: '#/components/parameters/ContentDataAndContentFieldSortBy' 521 | - $ref: '#/components/parameters/SortOrder' 522 | - $ref: '#/components/parameters/IncludeIds' 523 | - $ref: '#/components/parameters/ExcludeIds' 524 | responses: 525 | '200': 526 | description: Response 200 527 | content: 528 | application/json: 529 | schema: 530 | allOf: 531 | - $ref: '#/components/schemas/TotalResults' 532 | - $ref: '#/components/schemas/ContentFields' 533 | '403': 534 | description: Response 403 535 | content: 536 | application/json: 537 | schema: 538 | $ref: '#/components/schemas/Error403' 539 | '404': 540 | description: Response 404 541 | content: 542 | application/json: 543 | schema: 544 | $ref: '#/components/schemas/Error404' 545 | 546 | components: 547 | parameters: 548 | AssetsId: 549 | in: path 550 | name: asset_id 551 | description: The asset ID. 552 | required: true 553 | schema: 554 | type: number 555 | SiteId: 556 | in: path 557 | name: site_id 558 | description: The site ID. 559 | required: true 560 | schema: 561 | type: number 562 | ContentTypeId: 563 | in: path 564 | name: content_type_id 565 | description: The content type ID. 566 | required: true 567 | schema: 568 | type: number 569 | ContentDataId: 570 | in: path 571 | name: content_data_id 572 | description: The content data ID. 573 | required: true 574 | schema: 575 | type: number 576 | CategorySetId: 577 | in: path 578 | name: category_set_id 579 | description: The category set ID. 580 | required: true 581 | schema: 582 | type: number 583 | CategoryId: 584 | in: path 585 | name: category_id 586 | description: The category ID. 587 | required: true 588 | schema: 589 | type: number 590 | ClientId: 591 | in: query 592 | name: clientId 593 | description: クライアントID 594 | required: true 595 | schema: 596 | type: string 597 | Password: 598 | in: query 599 | name: password 600 | description: Webパスワード 601 | required: true 602 | schema: 603 | type: string 604 | Username: 605 | in: query 606 | name: username 607 | description: MTログインユーザ 608 | required: true 609 | schema: 610 | type: string 611 | DateField: 612 | in: query 613 | name: dateField 614 | description: | 615 | Specifies the field name to be used as a date field for filtering. (new in v3) 616 | required: false 617 | required: false 618 | schema: 619 | type: string 620 | DateFrom: 621 | name: dateFrom 622 | in: query 623 | description: | 624 | The start date to filtering. Specify in “YYYY-MM-DD” format. (new in v3) 625 | required: false 626 | schema: 627 | type: string 628 | DateTo: 629 | name: dateTo 630 | in: query 631 | description: | 632 | The end date to filtering. Specify in “YYYY-MM-DD” format. (new in v3) 633 | required: false 634 | schema: 635 | type: string 636 | Search: 637 | name: search 638 | in: query 639 | description: | 640 | Search query. 641 | required: false 642 | schema: 643 | type: string 644 | SearchFields: 645 | name: searchFields 646 | in: query 647 | description: | 648 | The comma separated field name list to search. In this version, only name is available. 649 | required: false 650 | schema: 651 | type: string 652 | IncludeIds: 653 | name: includeIds 654 | in: query 655 | description: | 656 | The comma separated ID list of entries to include to result. 657 | required: false 658 | schema: 659 | type: string 660 | ExcludeIds: 661 | name: excludeIds 662 | in: query 663 | description: | 664 | The comma separated ID list of entries to exclude from result. 665 | required: false 666 | schema: 667 | type: string 668 | Fields: 669 | in: query 670 | name: fields 671 | description: The field list to retrieve as part of the Content Data resource. That list should be separated by comma. If this parameter is not specified, All fields will be returned. 672 | required: false 673 | schema: 674 | type: string 675 | Limit: 676 | in: query 677 | name: limit 678 | description: Maximum number of sites to retrieve. 679 | required: false 680 | schema: 681 | type: number 682 | Offset: 683 | in: query 684 | name: offset 685 | description: 0-indexed offset. 686 | required: false 687 | schema: 688 | type: string 689 | ContentTypesSortBy: 690 | in: query 691 | name: sortBy 692 | description: | 693 | The field name for sort. You can specify one of following values. 694 | required: false 695 | schema: 696 | type: string 697 | enum: [ name, dataLabel, uniqueID, modified_on ] 698 | CategorySetSortBy: 699 | in: query 700 | name: sortBy 701 | description: | 702 | The field name for sort. You can specify one of following values. 703 | required: false 704 | schema: 705 | type: string 706 | enum: [ id, name, created_on, modified_on, content_type_count ] 707 | ContentDataAndContentFieldSortBy: 708 | in: query 709 | name: sortBy 710 | description: | 711 | The field name for sort. You can specify one of following values. 712 | required: false 713 | schema: 714 | type: string 715 | enum: [ id, uniqueID, authored_on, created_on, modified_on ] 716 | SiteSortBy: 717 | in: query 718 | name: sortBy 719 | description: | 720 | The field name for sort. You can specify one of following values. 721 | required: false 722 | schema: 723 | type: string 724 | enum: [ name ] 725 | SortBy: 726 | in: query 727 | name: sortBy 728 | description: | 729 | The field name for sort. You can specify one of following values. 730 | required: false 731 | schema: 732 | type: string 733 | enum: [id, uniqueID, authored_on, created_on, modified_on, label, basename, created_by, user_custom] 734 | SortOrder: 735 | in: query 736 | name: sortOrder 737 | description: | 738 | - descend (default): Return content data in descending order. 739 | - ascend: Return content data in ascending order. 740 | required: false 741 | schema: 742 | type: string 743 | enum: [descend, ascend] 744 | MaxDepth: 745 | name: maxDepth 746 | in: query 747 | description: | 748 | The depth of retrieving parent categories. 749 | required: false 750 | schema: 751 | type: number 752 | IncludeCurrent: 753 | name: includeCurrent 754 | in: query 755 | description: | 756 | - 1: The list does not include current category. 757 | - The list includes current category. 758 | required: false 759 | schema: 760 | type: number 761 | DataAPIExtendSearchQueryLabel: 762 | in: query 763 | name: label 764 | description: | 765 | ### 識別子でのフィルタリング 766 | - ?label="識別子名" 767 | - contains 768 | required: false 769 | schema: 770 | type: string 771 | DataAPIExtendSearchQueryLabelEq: 772 | in: query 773 | name: label_eq 774 | description: | 775 | ### 識別子でのフィルタリング 776 | - ?label_eq="識別子名" 777 | - equal 778 | required: false 779 | schema: 780 | type: string 781 | DataAPIExtendSearchQueryIdentifier: 782 | in: query 783 | name: identifier 784 | description: | 785 | ### 出力ファイル名でのフィルタリング 786 | - ?identifier="出力ファイル名" 787 | - contains 788 | required: false 789 | schema: 790 | type: string 791 | DataAPIExtendSearchQueryIdentifierEq: 792 | in: query 793 | name: identifier_eq 794 | description: | 795 | ### 出力ファイル名でのフィルタリング 796 | - ?label_eq="出力ファイル名" 797 | - equal 798 | required: false 799 | schema: 800 | type: string 801 | DataAPIExtendSearchQueryFrom: 802 | in: query 803 | name: from 804 | description: | 805 | ### From filter(期間) 806 | - Data API Extend Search 807 | - toと組み合わせが必須 808 | - 2021-10-10 809 | required: false 810 | schema: 811 | type: string 812 | DataAPIExtendSearchQueryTo: 813 | in: query 814 | name: to 815 | description: | 816 | ### To filter(期間) 817 | - Data API Extend Search 818 | - fromと組み合わせが必須 819 | - 2021-10-10 820 | required: false 821 | schema: 822 | type: string 823 | DataAPIExtendSearchQueryDateType: 824 | in: query 825 | name: date_type 826 | description: | 827 | ### date_type 828 | - Data API Extend Search 829 | - フィルタリングのqueryを利用する際は必須 830 | - authored_on 831 | required: false 832 | schema: 833 | type: string 834 | DataAPIExtendSearchQueryBefore: 835 | in: query 836 | name: after 837 | description: | 838 | ### Before Filter(以前) 839 | - Data API Extend Search 840 | - 2021-10-10 841 | required: false 842 | schema: 843 | type: string 844 | DataAPIExtendSearchQueryAfter: 845 | in: query 846 | name: after 847 | description: | 848 | ### After Filter(以前) 849 | - Data API Extend Search 850 | - 2021-10-10 851 | required: false 852 | schema: 853 | type: string 854 | DataAPIExtendSearchQueryDays: 855 | in: query 856 | name: days 857 | description: | 858 | ### Days Filter(N日以内) 859 | - Data API Extend Search 860 | - 30 861 | required: false 862 | schema: 863 | type: number 864 | DataAPIExtendSearchQueryFuture: 865 | in: query 866 | name: future 867 | description: | 868 | ### Future Filter(未来) 869 | - Data API Extend Search 870 | - 1 871 | required: false 872 | schema: 873 | type: number 874 | DataAPIExtendSearchQueryPast: 875 | in: query 876 | name: past 877 | description: | 878 | ### Past Filter(過去) 879 | - Data API Extend Search 880 | - 1 881 | required: false 882 | schema: 883 | type: number 884 | DataAPIExtendSearchQueryContentFieldId: 885 | in: query 886 | name: content_field_id 887 | description: | 888 | ### ContentField Filter 889 | - Data API Extend Search 890 | - Format 891 | { 892 | "content_field_[ターゲットのフィールドのID]": "ヒットさせたい文字をいれる" 893 | } 894 | required: false 895 | schema: 896 | type: object 897 | properties: { } 898 | additionalProperties: false 899 | DataAPIExtendSearchQuerySortFieldName: 900 | in: query 901 | name: sortFieldName 902 | description: | 903 | - sortの対象となるコンテンツフィールド名を入力 904 | required: false 905 | schema: 906 | type: string 907 | example: 記事公開日 908 | DataAPIExtendSearchQuerySortFieldNameOrder: 909 | in: query 910 | name: sortFieldNameOrder 911 | description: | 912 | - descend (default): Return contentField in descending order. 913 | - ascend: Return contentField in ascending order. 914 | required: false 915 | schema: 916 | type: string 917 | enum: [descend, ascend] 918 | DataAPIExtendSearchQueryLimitPerPage: 919 | in: query 920 | name: limitPerPage 921 | description: | 922 | - 指定したレスポンスの件数を指定するクエリ 923 | required: false 924 | schema: 925 | type: number 926 | DataAPIExtendSearchQueryPage: 927 | in: query 928 | name: page 929 | description: | 930 | - 2ページ目以降を取得するクエリ 931 | required: false 932 | schema: 933 | type: number 934 | securitySchemes: 935 | ApiKeyAuth: 936 | type: apiKey 937 | in: header 938 | name: X-MT-Authorization 939 | description: | 940 | - accessTokenを発行して発行したトークンをMTAuthする 941 | - curlコマンド: `curl -d 'username=ユーザ名' -d 'password=パスワード' -d "clientId=test" http://localhost:11000/cgi-bin/mt/mt-data-api.cgi/v4/authentication | jq` 942 | - MTAuth accessToken=アクセストークン 943 | schemas: 944 | SiteCollection: 945 | type: object 946 | properties: 947 | items: 948 | type: array 949 | items: 950 | allOf: 951 | - $ref: '#/components/schemas/Site' 952 | description: The array of result content. 953 | Site: 954 | type: object 955 | properties: 956 | allowCommenterRegist: 957 | type: boolean 958 | required: false 959 | description: 'true: Allow visitors to register as members of this website using one of the Authentication Methods selected below. false: Not allowed.' 960 | allowCommentHtml: 961 | type: boolean 962 | required: false 963 | description: 'true: Allow commenters to include a limited set of HTML tags in their comments. false: All HTML will be stripped out.' 964 | allowComments: 965 | type: boolean 966 | required: false 967 | description: 'true: Accept comments. false: Do not accept comments.' 968 | allowCommentsDefault: 969 | type: boolean 970 | required: false 971 | description: 'The state of the comment acceptance of default in this site. true: Comments are accepted. false: Comments are not accepted.' 972 | allowPings: 973 | type: boolean 974 | required: false 975 | allowPingsDefault: 976 | type: boolean 977 | required: false 978 | description: 'The state of the comment acceptance of default in this site. Available value is follows. true: Trackbacks are accepted. false: Trackbacks are not accepted.' 979 | allowToChangeAtUpload: 980 | type: boolean 981 | required: false 982 | description: 'true: Allow user to change the upload destination when upload a file. false: Not allowed.' 983 | allowUnregComments: 984 | type: boolean 985 | required: false 986 | description: 'true: Allow comments from anonymous or unauthenticated users. false: Not allowed.' 987 | archivePath: 988 | type: string 989 | required: false 990 | description: The archive path for this site. This property only accepts absolute path. 991 | archiveTypePreferred: 992 | type: string 993 | nullable: true 994 | description: The preferred archive type for this site. 995 | archiveUrl: 996 | type: string 997 | description: The archive url of this site. [Update in v2] This property was changed to updatable. 998 | autodiscoverLinks: 999 | type: boolean 1000 | required: false 1001 | description: 'true: Enable External TrackBack Auto-Discovery. false: Disable.' 1002 | autolinkUrls: 1003 | type: boolean 1004 | required: false 1005 | description: 'true: Transform URLs in comment text into HTML links. false: Do not transform.' 1006 | autoRenameNonAscii: 1007 | type: boolean 1008 | required: false 1009 | description: 'true: Uploded file name will be automatically changed to randam filename if uploaded filename contains non-ascii character. false: File name is not changed.' 1010 | basenameLimit: 1011 | type: string 1012 | required: false 1013 | description: The maximum length of basename. 1014 | ccLicenseImage: 1015 | type: string 1016 | description: The URL for the Creative Commons License image for this site. 1017 | ccLicenseUrl: 1018 | type: string 1019 | description: The URL for the Creative Commons License url for this site. 1020 | class: 1021 | type: string 1022 | description: The object class for this site. 1023 | commenterAuthenticators: 1024 | type: array 1025 | required: false 1026 | description: Array of commenter authenticators for this site. 1027 | convertParasComments: 1028 | type: string 1029 | required: false 1030 | description: The text formatting of this site's comment. 1031 | contentCss: 1032 | type: string 1033 | nullable: true 1034 | description: The CSS applying to WYSIWYG editor of this site. 1035 | contentTypes: 1036 | type: array 1037 | items: 1038 | type: object 1039 | properties: 1040 | id: 1041 | type: number 1042 | name: 1043 | type: string 1044 | convertParas: 1045 | type: string 1046 | required: false 1047 | description: 'The default text formatting in this site. Available value in default is follows. `0`: The default text formatting is ''None'' `__default__`: The default text formatting is ''Convert Line Breaks'' `markdown`: The default text formatting is ''Markdown'' `markdown_with_smartypants`: The default text formatting is ''Markdown With SmartyPants'' `richtext`: The default text formatting is ''Rich Text'' `textile_2`: The default text formatting is ''Textile 2''' 1048 | createdBy: 1049 | type: object 1050 | properties: 1051 | id: 1052 | type: string 1053 | description: The ID of created user. 1054 | displayName: 1055 | type: string 1056 | description: The display name of created user. 1057 | userpicUrl: 1058 | type: string 1059 | nullable: true 1060 | description: The URL of created user's userpic. The userpic will be made by UserpicThumbnailSize and UserpicAllowRect settings. If user does not set own userpic, will be returned empty string. 1061 | createdDate: 1062 | type: string 1063 | description: The created time for this website. (format is iso 8601 datetime) 1064 | customDynamicTemplates: 1065 | type: string 1066 | required: false 1067 | description: 'Publishing profile for this site. Available value is follows. `none`: Immediately publish all index templates and archive templates statically. `all`: Publish all index templates and archive templates dynamically. `archives`: Publish all archive templates dynamically. Immediately publish all index templates statically. `async_all`: All index templates and archive templates published statically via Publish Que. `async_partial`: mmediately publish Main Index template, Page archives statically. Use Publish Queue to publish all other index templates and archive templates statically.' 1068 | customFields: 1069 | type: array 1070 | required: false 1071 | daysOrPosts: 1072 | type: string 1073 | required: false 1074 | description: 'The type of listing default. Available value is follows. `days`: Listing entries that written in the past N days. N is a value of listOnIndex. `posts`: Listing most recent N entries. N is a value of listOnIndex.' 1075 | dateLanguage: 1076 | type: string 1077 | description: 'The date locale settings for this site. Available valus is follow. `cz`: Czech / `dk`: Danish / `nl`: Dutch / `en`: English / `et`: Estonian / `fr`: French / `de`: German / `is`: Icelandic / `it`: Italian / `ja`: Japanese / `no`: Norwegian / `pl`: Polish / `pt`: Portuguese / `sk`: Slovak / `si`: Slovenian / `es`: Spanish / `fi`: Suomi / `se`: Swedish' 1078 | description: 1079 | type: string 1080 | nullable: true 1081 | description: The description of this site. [Update in v2] This property was changed to updatable. 1082 | dynamicCache: 1083 | type: boolean 1084 | required: false 1085 | description: 'Cannot set this property when dynamic templates does not exist. `true`: Dynamic cache for dynamic publishing is enabled. / `false`: Dynamic cache for dynamic publishing is disabled.' 1086 | dynamicConditional: 1087 | type: boolean 1088 | required: false 1089 | description: 'Cannot set this property when dynamic templates does not exist. `true`: Dynamic conditional retrieval of dynamic publishing is enabled. / `false`: Dynamic conditional retrieval of dynamic publishing is disabled.' 1090 | entryCustomPrefs: 1091 | type: array 1092 | required: false 1093 | description: 'Default displayed fields of this site''s entry. Available value is follows. `title`: Title field / `text`: Body and extended field / `category`: Category list / `excerpt`: Excerpt field / `keywords`: Keyword field / `tags`: Tags field / `feedback`: Comment and trackback setting field / `assets`: Entry assets list / customfield_basename: Each custom Fields' 1094 | emailNewComments: 1095 | type: string 1096 | description: 'Email notification when posting comment to this site. `0`: Off. / `1`: On. / `2`: Only when attension is required.' 1097 | emailNewPings: 1098 | type: string 1099 | description: '"Email notification setting when accepting trackback to this site. `0`: Off. / `1`: On. / `2`: Only when attention is required.' 1100 | extraPath: 1101 | type: string 1102 | required: false 1103 | description: The raw data of extra path for default upload destination. If extra path is not configured, this value is a blank string. 1104 | fileExtension: 1105 | type: string 1106 | required: false 1107 | description: The file extension for this site. 1108 | followAuthLinks: 1109 | type: boolean 1110 | required: false 1111 | description: '`true`: Do not add the ''nofollow'' attribute when a comment is submitted by a trusted commenter. / `false`: Add the ''nofollow'' attribute .' 1112 | host: 1113 | type: string 1114 | description: The host name of this site. 1115 | id: 1116 | type: number 1117 | description: The ID of this site. 1118 | includeCache: 1119 | type: boolean 1120 | description: '`true`: Module cache is enabled. / `false`: Module cache is disabled.' 1121 | includeSystem: 1122 | type: string 1123 | nullable: true 1124 | description: '`'''' (empty string)`: Server Side Includes is disabled. / `php`: Server Side Include is enabled with PHP. / `shtml`: Server Side Include is enabled with Apache SSI. / `asp`: Server Side Include is enabled with ASP. / `jsp`: Server Side Include is enabled with JSP.' 1125 | language: 1126 | type: string 1127 | description: 'The language for this site. Available value is follows. `de`: German / `en`: English / `es`: Spanish / `fl`: French / `nl`: Dutch / `ja`: Japanese' 1128 | internalAutodiscovery: 1129 | type: boolean 1130 | required: false 1131 | description: '`true`: Enable Internal TrackBack Auto-Discovery. / `false`: Disable.' 1132 | junkFolderExpiry: 1133 | type: string 1134 | description: The period for deleting spam comments and trackbacks. 1135 | junkScoreThreshold: 1136 | type: number 1137 | description: The spam score threshold of this site. 1138 | listOnIndex: 1139 | type: string 1140 | description: The number of entries shown in the list by default. 1141 | maxRevisionsEntry: 1142 | type: string 1143 | nullable: true 1144 | description: The number of revisions per entries and pages in this site. 1145 | maxRevisionsTemplate: 1146 | type: string 1147 | nullable: true 1148 | description: The number of revisions per templates in this site. 1149 | moderateComments: 1150 | type: string 1151 | description: |- 1152 | `0`: Anyone. / `1`: No one. / `2`: Trusted commenters only. / `3`: Any authenticated commenters. 1153 | moderatePings (boolean) - `true`: Hold all TrackBacks for approval before they are published. / `false`: Do not hold. 1154 | modifiedDate: 1155 | type: string 1156 | description: The last modified time for this website. (format is iso 8601 datetime) 1157 | name: 1158 | type: string 1159 | description: The name for this site. [Update in v2] This property was changed to updatable. 1160 | newCreatedUserRoles: 1161 | type: array 1162 | required: false 1163 | description: Assigned to users that are created in the future on this site. 1164 | nofollowUrls: 1165 | type: boolean 1166 | required: false 1167 | description: '`true`: All URLs in comments and TrackBacks will be assigned a ''nofollow'' link relation. / `false`: Not assigned.' 1168 | normalizeOrientation: 1169 | type: boolean 1170 | required: false 1171 | description: '`true`: Image orientation is normalized automatically when the image file contains orientation information. / `false`: Image orientation is will never normalized.' 1172 | operationIfExists: 1173 | oneOf: 1174 | - type: number 1175 | - type: string 1176 | description: '`1`: The upload file will be changed to random file name automatically. / `2`: The existing file will be overwritten. / `3`: Upload will be canceled.' 1177 | pageCustomPrefs: 1178 | type: array 1179 | items: 1180 | type: string 1181 | description: 'Default displayed fields of this site''s page. Available value is follows. `title`: Title field / `text`: Body and extended field / `category`: Category list / `excerpt`: Excerpt field / `keywords`: Keyword field / `tags`: Tags field / `feedback`: Comment and trackback setting field / `assets`: Page assets list / `customfield_basename`: Each custom Fields' 1182 | parent: 1183 | type: object 1184 | nullable: true 1185 | properties: 1186 | id: 1187 | type: string 1188 | description: The ID of parent website. 1189 | name: 1190 | type: string 1191 | description: The name of parent website. 1192 | description: The parent website of this blog. If this object is top level sige, this field must be null. 1193 | publishEmptyArchive: 1194 | type: boolean 1195 | required: false 1196 | description: '`true`: Category archive without entries is published. / `false`: Category archive without entries is not published.' 1197 | pingGoogle: 1198 | type: boolean 1199 | required: false 1200 | description: '`true`: Enable sending update ping to Google. / `false`: Disabled sending update ping to Google.' 1201 | pingWeblogs: 1202 | type: boolean 1203 | required: false 1204 | description: '`true`: Enable sending update ping to weblogs.com. / `false`: Disabled sending update ping to weblogs.com.' 1205 | pingOthers: 1206 | type: array 1207 | items: 1208 | type: string 1209 | description: Array of update ping services. 1210 | description: Array of update ping services. 1211 | relativeUrl: 1212 | type: string 1213 | description: The relative site url of this site. 1214 | requireCommentEmails: 1215 | type: boolean 1216 | required: false 1217 | description: '`true`: Require name and E-mail Address for Anonymous Comments. / `false`: Do not require.' 1218 | sanitizeSpec: 1219 | type: string 1220 | required: false 1221 | description: The limit html tags of this site's comment. "0" is default. 1222 | serverOffset: 1223 | type: string 1224 | description: The server offset for this site. 1225 | sitePath: 1226 | type: string 1227 | required: false 1228 | description: The site path for this site. This property only accepts absolute path. 1229 | smartReplace: 1230 | type: number 1231 | required: false 1232 | description: 'The punctuation replacement of this site. `0`: No substitution. / `1`: Character entities. / `2`: ASCII equivalents.' 1233 | sortOrderPosts: 1234 | type: string 1235 | required: false 1236 | description: 'The default sorting direction for the entry listing. Available value is follows. `ascend`: Ascengin order. / `descend`: Descending order.' 1237 | sortOrderComments: 1238 | type: string 1239 | required: false 1240 | description: 'The comment order of this site. Available value is follows. `ascend`: Ascending order. / `descend`: Descending order' 1241 | smartReplaceFields: 1242 | type: array 1243 | items: 1244 | type: string 1245 | description: Replace fields of this site. 1246 | statusDefault: 1247 | type: string 1248 | required: false 1249 | description: 'The default entry status in this site. Available value is follows. `Pubish`: The default status is ''Published'' / `Draft`: The default status is ''Unpublished''' 1250 | themeId: 1251 | type: string 1252 | required: false 1253 | description: The theme ID for this site. 1254 | timezone: 1255 | type: string 1256 | description: The timezone of this site. 1257 | updatable: 1258 | type: boolean 1259 | description: '`true`: Current user can update this website. / `false`: Current user cannot update this website.' 1260 | uploadDestination: 1261 | type: object 1262 | properties: 1263 | path: 1264 | type: string 1265 | raw: 1266 | type: string 1267 | description: |- 1268 | The default configuration for upload destination of this site. 1269 | path (string) - The full path for default upload destination. The value begin with site path and contains extra path if extra_path configured. If default upload destination is not configured, this value is just a same as site_path. 1270 | raw (string) - The raw data of default upload destination. If default upload destination is not configured, this value is a blank string. 1271 | url: 1272 | type: string 1273 | description: The site url of this site. [Update in v2] This property was changed to updatable. 1274 | useCommentConfirmation: 1275 | type: boolean 1276 | required: false 1277 | description: '`true`: Each commenter''s browser will be redirected to a comment confirmation page after their comment is accepted. / `false`: Will not.' 1278 | useRevision: 1279 | type: boolean 1280 | required: false 1281 | description: '`true`: Revision history is enabled. / `false`: Revision history is disabled.' 1282 | wordsInExcerpt: 1283 | type: string 1284 | required: false 1285 | description: The default length for excerpt. 1286 | ContentTypesCollection: 1287 | type: object 1288 | properties: 1289 | items: 1290 | type: array 1291 | items: 1292 | allOf: 1293 | - $ref: '#/components/schemas/ContentTypes' 1294 | description: The array of result content. 1295 | ContentTypes: 1296 | type: object 1297 | properties: 1298 | blog: 1299 | type: object 1300 | properties: 1301 | id: 1302 | type: number 1303 | description: The site ID. Not writable. 1304 | description: The site of this content type. Not writable. 1305 | contentFields: 1306 | type: array 1307 | items: 1308 | type: object 1309 | properties: 1310 | id: 1311 | type: string 1312 | label: 1313 | type: string 1314 | type: 1315 | type: string 1316 | uniqueID: 1317 | type: string 1318 | description: The list of content fields. 1319 | createdBy: 1320 | type: object 1321 | properties: 1322 | displayName: 1323 | type: string 1324 | description: The display name of this content type creator. Not writable. 1325 | id: 1326 | type: number 1327 | description: The ID of this content type creator. Not writable. 1328 | userpicUrl: 1329 | type: string 1330 | nullable: true 1331 | description: The URL of this content type creator's userpic. The userpic will be made by UserpicThumbnailSize and UserpicAllowRect settings. If user does not set own userpic, will be returned empty string. Not writable. 1332 | description: Created user of this content type. Not writable. 1333 | createdDate: 1334 | type: string 1335 | description: Created date of this content type. (format is iso 8601 datetime) Not writable. 1336 | dataLabel: 1337 | type: string 1338 | description: The Unique ID of the content field that is data label. If not set will be NULL. 1339 | description: 1340 | type: string 1341 | description: The description of this content type. 1342 | id: 1343 | type: number 1344 | description: The ID of this content type. Not writable. 1345 | modifiedBy: 1346 | type: object 1347 | properties: 1348 | displayName: 1349 | type: string 1350 | description: The display name of this content type modifier. Not writable. 1351 | id: 1352 | type: number 1353 | description: The ID of this content type modifier. Not writable. 1354 | userpicUrl: 1355 | type: string 1356 | nullable: true 1357 | description: The URL of this content type modifier's userpic. The userpic will be made by UserpicThumbnailSize and UserpicAllowRect settings. If user does not set own userpic, will be returned empty string. Not writable. 1358 | description: Last modified user of this content type. Not writable. 1359 | modifiedDate: 1360 | type: string 1361 | description: Last modified date of this content type. (format is iso 8601 datetime) Not writable. 1362 | name: 1363 | type: string 1364 | description: The name of this content type. 1365 | uniqueID: 1366 | type: string 1367 | description: The unique ID of this content type. Not writable. 1368 | updatable: 1369 | type: boolean 1370 | description: '`true`: Current user can update this content type. / `false`: Current user cannot update this content type. Not writable.' 1371 | userDisplayOption: 1372 | type: boolean 1373 | description: '`true`: Signed-in user can change display options for edit content data screen of this content type in the CMS admin screen. / `false`: Signed-in user cannot change display options for edit content data screen of this content type in the CMS admin screen.' 1374 | ContentDataCollection: 1375 | type: object 1376 | properties: 1377 | items: 1378 | type: array 1379 | items: 1380 | allOf: 1381 | - $ref: '#/components/schemas/ContentData' 1382 | description: The array of result content. 1383 | ContentData: 1384 | type: object 1385 | properties: 1386 | author: 1387 | type: object 1388 | properties: 1389 | displayName: 1390 | type: string 1391 | description: The display name of this content data creator. Not writable 1392 | userpicUrl: 1393 | type: string 1394 | nullable: true 1395 | description: The URL of this content data creator's userpic. The userpic will be made by UserpicThumbnailSize and UserpicAllowRect settings. If user does not set own userpic, will be returned empty string. Not writable 1396 | basename: 1397 | type: string 1398 | description: The identifier for this content data. 1399 | blog: 1400 | type: object 1401 | properties: 1402 | id: 1403 | type: string 1404 | description: The ID of the site that contains this cotent data. Not writable 1405 | createdDate: 1406 | type: string 1407 | description: Created date of this content data. (format is iso 8601 datetime) Not writable. 1408 | data: 1409 | type: array 1410 | items: 1411 | type: object 1412 | properties: 1413 | data: 1414 | type: string 1415 | nullable: true 1416 | id: 1417 | type: string 1418 | label: 1419 | type: string 1420 | type: 1421 | type: string 1422 | description: List of data of this content data. 1423 | date: 1424 | type: string 1425 | description: The published time for this content data. (format is iso 8601 datetime) 1426 | id: 1427 | type: number 1428 | description: The ID of this content data. Not writable. 1429 | label: 1430 | type: string 1431 | description: The label value of this data. 1432 | modifiedDate: 1433 | type: string 1434 | description: Last modified date of this content data. (format is iso 8601 datetime) Not writable. 1435 | permalink: 1436 | type: string 1437 | description: permalink 1438 | status: 1439 | type: string 1440 | description: 'Draft: This content data is saved as draft. cd_status is 1. Publish: This content data is published. cd_status is 2. Review: This content data is waiting for approval. cd_status is 3. Future: This content data is scheduled for future publishing. cd_status is 4. Spam: This content data is marked as Spam. cd_status is 5.' 1441 | updatable: 1442 | type: boolean 1443 | description: 'true: The user who accessed can update this contnt data. false: The user who accessed cannot update this content data.' 1444 | relations: 1445 | type: object 1446 | properties: 1447 | CategoryDepartment: 1448 | type: array 1449 | items: 1450 | properties: 1451 | id: 1452 | type: string 1453 | basename: 1454 | type: string 1455 | label: 1456 | type: string 1457 | parentId: 1458 | type: string 1459 | description: '学科カテゴリのレスポンス' 1460 | CategoryKinds: 1461 | type: array 1462 | items: 1463 | properties: 1464 | id: 1465 | type: string 1466 | basename: 1467 | type: string 1468 | label: 1469 | type: string 1470 | parentId: 1471 | type: string 1472 | description: '種別カテゴリのレスポンス' 1473 | CategorySubject: 1474 | type: array 1475 | items: 1476 | properties: 1477 | id: 1478 | type: string 1479 | basename: 1480 | type: string 1481 | label: 1482 | type: string 1483 | parentId: 1484 | type: string 1485 | description: '対象カテゴリのレスポンス' 1486 | CategoryUndergraduate: 1487 | type: array 1488 | items: 1489 | properties: 1490 | id: 1491 | type: string 1492 | basename: 1493 | type: string 1494 | label: 1495 | type: string 1496 | parentId: 1497 | type: string 1498 | description: '学部カテゴリのレスポンス' 1499 | OGP: 1500 | type: array 1501 | items: 1502 | properties: 1503 | id: 1504 | type: string 1505 | fileName: 1506 | type: string 1507 | path: 1508 | type: string 1509 | url: 1510 | type: string 1511 | description: 'OGP画像のレスポンス' 1512 | MainVisual: 1513 | type: array 1514 | items: 1515 | properties: 1516 | id: 1517 | type: string 1518 | fileName: 1519 | type: string 1520 | path: 1521 | type: string 1522 | url: 1523 | type: string 1524 | description: 'key名は、カテゴリセット・アセットのフィールド名' 1525 | description: DataAPIContentDataRelations plugin response 1526 | CategorySetCollection: 1527 | type: object 1528 | properties: 1529 | items: 1530 | type: array 1531 | items: 1532 | allOf: 1533 | - $ref: '#/components/schemas/CategorySet' 1534 | description: The array of result content. 1535 | CategorySetCategoriesCollection: 1536 | type: object 1537 | properties: 1538 | items: 1539 | type: array 1540 | items: 1541 | allOf: 1542 | - $ref: '#/components/schemas/CategorySetCategory' 1543 | description: The array of result content. 1544 | AssetsCollection: 1545 | type: object 1546 | properties: 1547 | items: 1548 | type: array 1549 | items: 1550 | allOf: 1551 | - $ref: '#/components/schemas/Assets' 1552 | description: The array of result content. 1553 | Assets: 1554 | type: object 1555 | properties: 1556 | blog: 1557 | type: object 1558 | properties: 1559 | id: 1560 | type: string 1561 | description: The ID of the site that contains this category. 1562 | class: 1563 | type: string 1564 | description: The object class for this category. 1565 | createdBy: 1566 | type: object 1567 | properties: 1568 | displayName: 1569 | type: string 1570 | description: The display name of the user who created this category. 1571 | id: 1572 | type: string 1573 | description: The ID of the user who created this category. 1574 | userpicUrl: 1575 | type: string 1576 | nullable: true 1577 | description: The URL of created user’s userpic. The userpic will be made by UserpicThumbnailSize and UserpicAllowRect settings. If user does not set own userpic, empty string will be returned. 1578 | createdDate: 1579 | type: string 1580 | description: he created time for this category. (format is iso 8601 datetime) 1581 | customFields: 1582 | type: array 1583 | description: 1584 | type: string 1585 | nullable: true 1586 | description: The description of this category. 1587 | fileExtension: 1588 | type: string 1589 | filename: 1590 | type: string 1591 | id: 1592 | type: string 1593 | description: The ID of this category. 1594 | label: 1595 | type: string 1596 | description: The label of this category. 1597 | modifiedBy: 1598 | type: object 1599 | properties: 1600 | displayName: 1601 | type: string 1602 | description: The display name of the user who modified this category. 1603 | id: 1604 | type: string 1605 | description: The ID of the user who modified this category. 1606 | userpicUrl: 1607 | type: string 1608 | nullable: true 1609 | description: The URL of modified user’s userpic. The userpic will be made by UserpicThumbnailSize and UserpicAllowRect settings. If user does not set own userpic, empty string will be returned. 1610 | modifiedDate: 1611 | type: string 1612 | description: The last modified time for this category. (format is iso 8601 datetime) 1613 | parent: 1614 | type: number 1615 | nullable: true 1616 | description: The ID of the parent category for this category. This field can be updated from v2. 1617 | meta: 1618 | type: object 1619 | properties: 1620 | fileSize: 1621 | type: number 1622 | height: 1623 | type: string 1624 | width: 1625 | type: string 1626 | mimeType: 1627 | type: string 1628 | tags: 1629 | type: array 1630 | type: 1631 | type: string 1632 | url: 1633 | type: string 1634 | updatable: 1635 | type: boolean 1636 | description: |- 1637 | true: The user who accessed can update this category. 1638 | false: The user who accessed cannot update this category. 1639 | description: The array of result content. 1640 | TotalResultsNumber: 1641 | type: object 1642 | properties: 1643 | totalResults: 1644 | type: number 1645 | description: Total record count of this request. 1646 | TotalResults: 1647 | type: object 1648 | properties: 1649 | totalResults: 1650 | type: string 1651 | description: Total record count of this request. 1652 | Paginate: 1653 | type: object 1654 | properties: 1655 | paginate: 1656 | type: object 1657 | properties: 1658 | currentPage: 1659 | type: number 1660 | limit: 1661 | type: number 1662 | maxPage: 1663 | type: number 1664 | nextPage: 1665 | type: number 1666 | offset: 1667 | type: number 1668 | prevPage: 1669 | type: number 1670 | CategorySetCategory: 1671 | type: object 1672 | properties: 1673 | archiveLink: 1674 | type: string 1675 | description: The category archive URL of this category. If “Category” archive mapping is not configured, this value will be null. 1676 | basename: 1677 | type: string 1678 | description: The basename of this category. 1679 | blog: 1680 | type: object 1681 | properties: 1682 | id: 1683 | type: string 1684 | description: The ID of the site that contains this category. 1685 | class: 1686 | type: string 1687 | description: The object class for this category. 1688 | createdBy: 1689 | type: object 1690 | properties: 1691 | displayName: 1692 | type: string 1693 | description: The display name of the user who created this category. 1694 | userpicUrl: 1695 | type: string 1696 | nullable: true 1697 | description: The URL of created user’s userpic. The userpic will be made by UserpicThumbnailSize and UserpicAllowRect settings. If user does not set own userpic, empty string will be returned. 1698 | createdDate: 1699 | type: string 1700 | description: he created time for this category. (format is iso 8601 datetime) 1701 | customFields: 1702 | type: array 1703 | description: 1704 | type: string 1705 | description: The description of this category. 1706 | id: 1707 | type: number 1708 | description: The ID of this category. 1709 | label: 1710 | type: string 1711 | description: The label of this category. 1712 | modifiedBy: 1713 | type: object 1714 | properties: 1715 | displayName: 1716 | type: string 1717 | description: The display name of the user who modified this category. 1718 | userpicUrl: 1719 | type: string 1720 | nullable: true 1721 | description: The URL of modified user’s userpic. The userpic will be made by UserpicThumbnailSize and UserpicAllowRect settings. If user does not set own userpic, empty string will be returned. 1722 | modifiedDate: 1723 | type: string 1724 | description: The last modified time for this category. (format is iso 8601 datetime) 1725 | parent: 1726 | type: string 1727 | description: The ID of the parent category for this category. This field can be updated from v2. 1728 | updatable: 1729 | type: boolean 1730 | description: |- 1731 | true: The user who accessed can update this category. 1732 | false: The user who accessed cannot update this category. 1733 | CategorySet: 1734 | type: object 1735 | properties: 1736 | blog: 1737 | type: object 1738 | properties: 1739 | id: 1740 | type: string 1741 | description: The ID of the site that contains this category set. Not writable 1742 | categories: 1743 | type: array 1744 | items: 1745 | type: object 1746 | properties: 1747 | basename: 1748 | type: string 1749 | id: 1750 | type: number 1751 | label: 1752 | type: string 1753 | parent: 1754 | type: string 1755 | description: List of categories. Not writable. 1756 | content_type_count: 1757 | type: string 1758 | createdBy: 1759 | type: object 1760 | properties: 1761 | displayName: 1762 | type: string 1763 | description: The display name of this category set created. Not writable. 1764 | userpicUrl: 1765 | type: string 1766 | nullable: true 1767 | description: The URL of this category set created's userpic. The userpic will be made by UserpicThumbnailSize and UserpicAllowRect settings. If user does not set own userpic, will be returned empty string. Not writable. 1768 | description: Last modified user of this category set. Not writable. 1769 | createdDate: 1770 | type: string 1771 | description: Created date of this category set. (format is iso 8601 datetime) Not writable. 1772 | id: 1773 | type: number 1774 | description: The ID of this category set. Not writable. 1775 | modifiedBy: 1776 | type: object 1777 | properties: 1778 | displayName: 1779 | type: string 1780 | description: The display name of this category set modifier. Not writable. 1781 | userpicUrl: 1782 | type: string 1783 | nullable: true 1784 | description: The URL of this category set modifier's userpic. The userpic will be made by UserpicThumbnailSize and UserpicAllowRect settings. If user does not set own userpic, will be returned empty string. Not writable. 1785 | description: Last modified user of this category set. Not writable. 1786 | modifiedDate: 1787 | type: string 1788 | description: Last modified date of this category set. (format is iso 8601 datetime) Not writable. 1789 | name: 1790 | type: string 1791 | description: The name of this category set. 1792 | updatable: 1793 | type: boolean 1794 | description: 'true: The user who accessed can update this category set. false: The user who accessed cannot update this category set.' 1795 | ContentFields: 1796 | type: object 1797 | properties: 1798 | items: 1799 | type: array 1800 | items: 1801 | type: object 1802 | properties: 1803 | blog: 1804 | type: object 1805 | properties: 1806 | id: 1807 | type: string 1808 | description: The ID of the site that contains this category. 1809 | createdBy: 1810 | type: object 1811 | properties: 1812 | displayName: 1813 | type: string 1814 | description: The display name of the user who created this category. 1815 | id: 1816 | type: string 1817 | description: The ID of the user who created this category. 1818 | userpicUrl: 1819 | type: string 1820 | nullable: true 1821 | description: The URL of created user’s userpic. The userpic will be made by UserpicThumbnailSize and UserpicAllowRect settings. If user does not set own userpic, empty string will be returned. 1822 | createdDate: 1823 | type: string 1824 | description: he created time for this category. (format is iso 8601 datetime) 1825 | description: 1826 | type: string 1827 | nullable: true 1828 | description: The description of this category. 1829 | id: 1830 | type: string 1831 | description: The ID of this category. 1832 | label: 1833 | type: string 1834 | description: The label of this category. 1835 | modifiedBy: 1836 | type: object 1837 | properties: 1838 | displayName: 1839 | type: string 1840 | description: The display name of the user who modified this category. 1841 | id: 1842 | type: string 1843 | description: The ID of the user who modified this category. 1844 | userpicUrl: 1845 | type: string 1846 | nullable: true 1847 | description: The URL of modified user’s userpic. The userpic will be made by UserpicThumbnailSize and UserpicAllowRect settings. If user does not set own userpic, empty string will be returned. 1848 | modifiedDate: 1849 | type: string 1850 | description: The last modified time for this category. (format is iso 8601 datetime) 1851 | options: 1852 | type: object 1853 | properties: 1854 | can_add: 1855 | type: string 1856 | allow_upload: 1857 | type: string 1858 | increase_decrease_cols: 1859 | type: string 1860 | increase_decrease_rows: 1861 | type: string 1862 | initial_cols: 1863 | type: string 1864 | initial_rows: 1865 | type: string 1866 | source: 1867 | type: string 1868 | category_set: 1869 | type: string 1870 | description: 1871 | type: string 1872 | description: Field Description 1873 | display: 1874 | type: string 1875 | initial_value: 1876 | type: string 1877 | label: 1878 | type: string 1879 | max_length: 1880 | type: string 1881 | min_length: 1882 | type: string 1883 | required: 1884 | type: string 1885 | description: '0か1' 1886 | input_format: 1887 | type: string 1888 | decimal_places: 1889 | type: number 1890 | max_value: 1891 | type: string 1892 | min_value: 1893 | type: string 1894 | max: 1895 | type: string 1896 | min: 1897 | type: string 1898 | multiple: 1899 | type: string 1900 | values: 1901 | type: array 1902 | properties: 1903 | checked: 1904 | type: string 1905 | label: 1906 | type: string 1907 | value: 1908 | type: string 1909 | type: 1910 | type: string 1911 | description: Field Type 1912 | uniqueID: 1913 | type: string 1914 | description: Unique ID 1915 | updatable: 1916 | type: boolean 1917 | description: |- 1918 | true: The user who accessed can update this category. 1919 | false: The user who accessed cannot update this category. 1920 | description: The array of result content. 1921 | Authentication: 1922 | type: object 1923 | properties: 1924 | accessToken: 1925 | type: string 1926 | expiresIn: 1927 | type: string 1928 | remember: 1929 | type: boolean 1930 | sessionId: 1931 | type: string 1932 | Error403: 1933 | type: "object" 1934 | properties: 1935 | error: 1936 | type: object 1937 | properties: 1938 | code: 1939 | type: number 1940 | example: 403 1941 | message: 1942 | type: string 1943 | example: Do not have permission to create child site. 1944 | Error404: 1945 | type: "object" 1946 | properties: 1947 | error: 1948 | type: object 1949 | properties: 1950 | code: 1951 | type: number 1952 | example: 404 1953 | message: 1954 | type: string 1955 | example: Site not found 1956 | security: 1957 | - ApiKeyAuth: [] # use the same name as under securitySchemes 1958 | 1959 | externalDocs: 1960 | description: "Find out more about Swagger" 1961 | url: "http://swagger.io" 1962 | -------------------------------------------------------------------------------- /d-build.sh: -------------------------------------------------------------------------------- 1 | mkdir db-data 2 | docker compose up -d --build 3 | -------------------------------------------------------------------------------- /d-down.sh: -------------------------------------------------------------------------------- 1 | rm -rf ./db-data 2 | docker compose down -v 3 | -------------------------------------------------------------------------------- /d-up.sh: -------------------------------------------------------------------------------- 1 | docker compose up -d 2 | -------------------------------------------------------------------------------- /data_api.sh: -------------------------------------------------------------------------------- 1 | # Data API ドキュメント 2 | wget https://raw.githubusercontent.com/movabletype/mt-docs-data-api-reference/master/src/openapi/v5.json -O ./api/redoc/openapi.json 3 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | # バージョンの指定 2 | version: "3" 3 | 4 | # サービス定義 5 | services: 6 | swagger-editor: 7 | platform: linux/x86_64 8 | image: swaggerapi/swagger-editor 9 | container_name: "swagger-editor" 10 | ports: 11 | - "8001:8080" 12 | swagger-ui: 13 | platform: linux/x86_64 14 | image: swaggerapi/swagger-ui 15 | container_name: "swagger-ui" 16 | ports: 17 | - "8002:8080" 18 | volumes: 19 | - ./api/swagger/_data_api.yaml:/_data_api.yaml 20 | environment: 21 | SWAGGER_JSON: /_data_api.yaml 22 | redoc: 23 | platform: linux/x86_64 24 | image: redocly/redoc 25 | container_name: "redoc" 26 | environment: 27 | SPEC_URL: ./openapi/openapi.json # Redocの画面を開いたときに初期値として表示するファイル 28 | PORT: 8080 # nginx port(default:80) 29 | ports: 30 | - '8003:8080' 31 | volumes: 32 | - ./api/redoc:/usr/share/nginx/html/openapi 33 | mysql: 34 | platform: linux/x86_64 35 | container_name: ${CONTAINER_BASE_NAME}-db 36 | image: mysql:5.7 37 | restart: always 38 | environment: 39 | MYSQL_ALLOW_EMPTY_PASSWORD: ${MYSQL_ALLOW_EMPTY_PASSWORD} 40 | MYSQL_USER: ${MYSQL_USER} 41 | MYSQL_PASSWORD: ${MYSQL_PASSWORD} 42 | MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD} 43 | MYSQL_DATABASE: ${MYSQL_DATABASE} 44 | env_file: .env 45 | command: mysqld --character-set-server=utf8 --collation-server=utf8_unicode_ci 46 | volumes: 47 | - ./db-data:/var/lib/mysql 48 | - ./sql/${DUMP_FILE}.sql:/docker-entrypoint-initdb.d/test_data_mysql.sql 49 | ports: 50 | - 3306:3306 51 | web: 52 | platform: linux/x86_64 53 | container_name: ${CONTAINER_BASE_NAME}-apache 54 | build: 55 | context: ./docker 56 | args: 57 | MT_FILE: "${MT}" 58 | ports: 59 | - "${WEB_PORT}" 60 | volumes: 61 | - ./www/html:/var/www/local/html 62 | - ./www/logs:/var/www/local/logs 63 | - ./mt-settings/mt-config.cgi:/var/www/local/cgi-bin/mt/mt-config.cgi 64 | - ./docker/httpd/virtualhost.conf:/etc/httpd/conf.d/virtualhost.conf 65 | depends_on: 66 | - mysql 67 | -------------------------------------------------------------------------------- /docker/Dockerfile: -------------------------------------------------------------------------------- 1 | # Rocky Linux 9指定 2 | FROM rockylinux:9 3 | 4 | RUN echo /etc/redhat-release 5 | ARG MT_FILE="local" 6 | RUN echo ${MT_FILE} 7 | MAINTAINER "redamoon" 8 | USER root 9 | RUN dnf -y clean all 10 | 11 | RUN dnf update -y \ 12 | && dnf install -y git unzip glibc httpd httpd-devel \ 13 | && dnf clean all 14 | 15 | # =========================== 16 | # Httpd Setting 17 | # =========================== 18 | RUN echo "ServerName localhost" >> /etc/httpd/conf/httpd.conf 19 | RUN sed -i.org '/#AddHandler cgi-script/s/#//' /etc/httpd/conf/httpd.conf 20 | RUN sed -i "/^#NameVirtualHost \*:80$/ s/#NameVirtualHost \*:80/NameVirtualHost \*:80/" /etc/httpd/conf/httpd.conf 21 | RUN sed -i -e "s/KeepAlive Off/KeepAlive On/g" /etc/httpd/conf/httpd.conf 22 | RUN sed -i -e "s/AllowOverride None/AllowOverride All/g" /etc/httpd/conf/httpd.conf 23 | RUN sed -i -e "s/DirectoryIndex index.html index.html.var/DirectoryIndex index.html index.php/g" /etc/httpd/conf/httpd.conf 24 | RUN sed -i '$a\LoadModule include_module modules/mod_include.so' /etc/httpd/conf/httpd.conf 25 | RUN sed -i '$a\LoadModule filter_module modules/mod_filter.so' /etc/httpd/conf/httpd.conf 26 | 27 | # Remi リポジトリの追加 28 | # Rocky LinuxでもEPELリポジトリは利用できますが、RemiリポジトリのURLが変更される可能性があるので確認してください。 29 | RUN dnf -y install epel-release 30 | RUN dnf -y install https://rpms.remirepo.net/enterprise/remi-release-9.rpm 31 | 32 | # =========================== 33 | # Perl・DB・Dnfリポジトリ・CAPN 34 | # =========================== 35 | RUN dnf -y install perl-CGI perl-CPAN "perl(Module::Build)" "perl(DBD::mysql)" 36 | 37 | # =========================== 38 | # 必須モジュール 39 | # =========================== 40 | RUN dnf -y install "perl(Image::Magick)" "perl(Digest::MD5)" "perl(Mozilla::CA)" "perl(HTML::Entities)" 41 | 42 | ## =========================== 43 | ## Memcached 44 | ## =========================== 45 | #RUN dnf -y install memcached "perl(Cache::Memcached)" 46 | # 47 | ## =========================== 48 | ## SMTP認証関連ライブラリー 49 | ## =========================== 50 | #RUN dnf -y install "perl(IO::Socket::SSL)" "perl(Net::SSLeay)" "perl(Net::SMTP::SSL)" 51 | #RUN dnf -y install "perl(Digest::HMAC)" 52 | # 53 | #RUN dnf -y install "perl(IO::Socket::SSL)" "perl(Net::SSLeay)" "perl(Net::SMTP::SSL)" 54 | #RUN cpan Net::SMTP::TLS 55 | #RUN dnf -y install "perl(Digest::HMAC)" 56 | #RUN cpan Net::SMTP::TLS 57 | # 58 | ## =========================== 59 | ## Other:バックアップ 60 | ## =========================== 61 | #RUN dnf -y install "perl(Archive::Zip)" "perl(Archive::Tar)" "perl(XML::LibXML::SAX)" 62 | #RUN dnf -y install expat-devel "perl(ExtUtils::MakeMaker)" "perl(Test::Simple)" "perl(XML::Parser)" 63 | #RUN dnf -y install "perl(Archive::Zip)" "perl(Archive::Tar)" "perl(XML::LibXML::SAX)" 64 | #RUN cpan XML::SAX::Expat 65 | # 66 | ## =========================== 67 | ## Other:PSGI 68 | ## =========================== 69 | #RUN dnf -y install --skip-broken "perl(CGI::Parse::PSGI)" "perl(Plack)" 70 | #RUN dnf -y install --skip-broken "perl(CGI)" 71 | #RUN dnf -y install --skip-broken "perl(SOAP::Transport::HTTP)" "perl(XMLRPC::Transport::HTTP)" 72 | ##RUN cpan Devel::StackTrace CGI::Parse::PSGI Plack CGI 73 | ##RUN cpan SOAP::Transport::HTTP XMLRPC::Transport::HTTP #cpanだと時間がかかりすぎてタイムアウトする 74 | # 75 | ## =========================== 76 | ## Other:ライブラリ 77 | ## =========================== 78 | #RUN dnf -y install --skip-broken "perl(Authen::SASL)" "perl(Crypt::SSLeay)" "perl(Crypt::DSA)" "perl(Digest::SHA)" "perl(Digest::SHA1)" "perl(HTML::Parser)" "perl(XML::Parser)" 79 | #RUN dnf -y install --skip-broken "perl(Heap::Fibonacci)" "perl(File::NFSLock)" "perl(IO::String)" "perl(DB_File)" "perl(HTTP::Date)" "perl(Text::CSV_XS)" "perl(MIME::Parser)" "perl(LWP::UserAgent)" "perl(Scalar::Util)" "perl(CGI::Cookie)" "perl(File::Spec)" "perl(parent)" 80 | 81 | # =========================== 82 | # Movable Type Setting 83 | # =========================== 84 | RUN mkdir -p /var/www/local/html 85 | RUN mkdir -p /var/www/local/cgi-bin 86 | ADD mt-data/${MT_FILE}.zip /var/www/local/cgi-bin/ 87 | RUN unzip /var/www/local/cgi-bin/${MT_FILE}.zip -d '/var/www/local/cgi-bin/' 88 | RUN mv /var/www/local/cgi-bin/${MT_FILE} /var/www/local/cgi-bin/mt 89 | RUN chown -R apache:apache /var/www/local/html 90 | RUN chown -R apache:apache /var/www/local/cgi-bin/mt 91 | RUN chmod 777 /var/www/ 92 | RUN chmod 777 /var/www/local 93 | RUN chmod 777 /var/www/local/html 94 | RUN chmod 755 /var/www/local/cgi-bin/mt/*.cgi 95 | 96 | EXPOSE 80 97 | CMD ["/usr/sbin/httpd", "-D", "FOREGROUND"] -------------------------------------------------------------------------------- /docker/httpd/virtualhost.conf: -------------------------------------------------------------------------------- 1 | 2 | DocumentRoot /var/www/local/html 3 | ServerName localhost 4 | Alias /cgi-bin/ /var/www/local/cgi-bin/ 5 | AddHandler cgi-script .cgi 6 | 7 | AllowOverride All 8 | Order allow,deny 9 | Allow from all 10 | Options ExecCGI FollowSymLinks Includes 11 | AddType application/x-httpd-cgi .cgi .pl 12 | AddHandler image/gif .gif 13 | AddHandler image/jpg .jpg 14 | 15 | ErrorLog /var/www/local/logs/error_log 16 | TransferLog /var/www/local/logs/access_log 17 | -------------------------------------------------------------------------------- /docker/mt-data/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redamoon/docker-mt-lamp/c0eb757af4cc498138c41a3ca0e30f09d205f2a5/docker/mt-data/.keep -------------------------------------------------------------------------------- /docs_assets/20221204073039.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redamoon/docker-mt-lamp/c0eb757af4cc498138c41a3ca0e30f09d205f2a5/docs_assets/20221204073039.png -------------------------------------------------------------------------------- /docs_assets/20221204073718.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redamoon/docker-mt-lamp/c0eb757af4cc498138c41a3ca0e30f09d205f2a5/docs_assets/20221204073718.png -------------------------------------------------------------------------------- /dump.sh: -------------------------------------------------------------------------------- 1 | docker exec website-db /usr/bin/mysqldump -u root --password=root movabletype > sql/$1.sql 2 | -------------------------------------------------------------------------------- /mt-settings/mt-config.cgi: -------------------------------------------------------------------------------- 1 | # The CGIPath is the URL to your Movable Type directory 2 | CGIPath /cgi-bin/mt/ 3 | 4 | # simply remove it or comment out the line by prepending a "#". 5 | StaticWebPath /cgi-bin/mt/mt-static 6 | 7 | #================ DATABASE SETTINGS ================== 8 | # CHANGE setting below that refer to databases 9 | # you will be using. 10 | 11 | ##### MYSQL ##### 12 | ObjectDriver DBI::mysql 13 | Database movabletype 14 | DBUser movabletype 15 | DBPassword movabletype 16 | DBHost mysql 17 | 18 | ## Change setting to language that you want to using. 19 | DefaultLanguage ja 20 | 21 | ## Debug Mode 22 | DebugMode 1 23 | -------------------------------------------------------------------------------- /mt-settings/mt-static/mtml/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redamoon/docker-mt-lamp/c0eb757af4cc498138c41a3ca0e30f09d205f2a5/mt-settings/mt-static/mtml/.keep -------------------------------------------------------------------------------- /mt-settings/mt-static/plugins/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redamoon/docker-mt-lamp/c0eb757af4cc498138c41a3ca0e30f09d205f2a5/mt-settings/mt-static/plugins/.keep -------------------------------------------------------------------------------- /mt-settings/plugins/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redamoon/docker-mt-lamp/c0eb757af4cc498138c41a3ca0e30f09d205f2a5/mt-settings/plugins/.keep -------------------------------------------------------------------------------- /mtml/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redamoon/docker-mt-lamp/c0eb757af4cc498138c41a3ca0e30f09d205f2a5/mtml/.keep -------------------------------------------------------------------------------- /sql/test_data_mysql.sql: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redamoon/docker-mt-lamp/c0eb757af4cc498138c41a3ca0e30f09d205f2a5/sql/test_data_mysql.sql -------------------------------------------------------------------------------- /www/html/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redamoon/docker-mt-lamp/c0eb757af4cc498138c41a3ca0e30f09d205f2a5/www/html/.keep -------------------------------------------------------------------------------- /www/logs/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redamoon/docker-mt-lamp/c0eb757af4cc498138c41a3ca0e30f09d205f2a5/www/logs/.keep --------------------------------------------------------------------------------