mirakurun 3.9.0-beta.9 → 3.9.0-rc.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/CHANGELOG.md +21 -4
  2. package/CONTRIBUTING.md +9 -3
  3. package/README.md +4 -9
  4. package/api.d.ts +3 -1
  5. package/api.yml +12 -4
  6. package/bin/postinstall.js +8 -9
  7. package/bin/preuninstall.js +1 -1
  8. package/config/dvbconf-for-isdb/conf/dvbv5_channels_isdbs.conf +3 -3
  9. package/doc/Configuration.md +4 -0
  10. package/doc/Platforms.md +52 -16
  11. package/docker/container-init.sh +7 -0
  12. package/docker/docker-compose.yml +20 -10
  13. package/lib/Mirakurun/EPG.d.ts +0 -4
  14. package/lib/Mirakurun/EPG.js +37 -52
  15. package/lib/Mirakurun/EPG.js.map +1 -1
  16. package/lib/Mirakurun/Event.d.ts +1 -1
  17. package/lib/Mirakurun/Program.d.ts +1 -1
  18. package/lib/Mirakurun/Program.js +23 -24
  19. package/lib/Mirakurun/Program.js.map +1 -1
  20. package/lib/Mirakurun/Server.d.ts +0 -1
  21. package/lib/Mirakurun/Server.js +10 -25
  22. package/lib/Mirakurun/Server.js.map +1 -1
  23. package/lib/Mirakurun/TSDecoder.d.ts +5 -3
  24. package/lib/Mirakurun/TSDecoder.js +20 -9
  25. package/lib/Mirakurun/TSDecoder.js.map +1 -1
  26. package/lib/Mirakurun/TSFilter.d.ts +2 -0
  27. package/lib/Mirakurun/TSFilter.js +24 -9
  28. package/lib/Mirakurun/TSFilter.js.map +1 -1
  29. package/lib/Mirakurun/Tuner.js +1 -1
  30. package/lib/Mirakurun/Tuner.js.map +1 -1
  31. package/lib/Mirakurun/TunerDevice.js +9 -4
  32. package/lib/Mirakurun/TunerDevice.js.map +1 -1
  33. package/lib/Mirakurun/api/channels/{type}/{channel}/services/{id}/stream.js +4 -2
  34. package/lib/Mirakurun/api/channels/{type}/{channel}/services/{id}/stream.js.map +1 -1
  35. package/lib/Mirakurun/api/channels/{type}/{channel}/stream.js +4 -2
  36. package/lib/Mirakurun/api/channels/{type}/{channel}/stream.js.map +1 -1
  37. package/lib/Mirakurun/api/channels/{type}.js +2 -2
  38. package/lib/Mirakurun/api/channels/{type}.js.map +1 -1
  39. package/lib/Mirakurun/api/channels.js +2 -2
  40. package/lib/Mirakurun/api/channels.js.map +1 -1
  41. package/lib/Mirakurun/api/config/channels/scan.js +1 -1
  42. package/lib/Mirakurun/api/config/channels/scan.js.map +1 -1
  43. package/lib/Mirakurun/api/events/stream.js +1 -1
  44. package/lib/Mirakurun/api/events/stream.js.map +1 -1
  45. package/lib/Mirakurun/api/iptv/lineup.json.js +1 -1
  46. package/lib/Mirakurun/api/iptv/lineup.json.js.map +1 -1
  47. package/lib/Mirakurun/api/iptv/playlist.js +1 -1
  48. package/lib/Mirakurun/api/iptv/playlist.js.map +1 -1
  49. package/lib/Mirakurun/api/iptv/xmltv.js +198 -2
  50. package/lib/Mirakurun/api/iptv/xmltv.js.map +1 -1
  51. package/lib/Mirakurun/api/programs/{id}/stream.js +4 -2
  52. package/lib/Mirakurun/api/programs/{id}/stream.js.map +1 -1
  53. package/lib/Mirakurun/api/services/{id}/stream.js +4 -2
  54. package/lib/Mirakurun/api/services/{id}/stream.js.map +1 -1
  55. package/lib/Mirakurun/api/services.js +1 -1
  56. package/lib/Mirakurun/api/services.js.map +1 -1
  57. package/lib/Mirakurun/api/status.js +1 -0
  58. package/lib/Mirakurun/api/status.js.map +1 -1
  59. package/lib/Mirakurun/config.d.ts +2 -0
  60. package/lib/Mirakurun/config.js +46 -3
  61. package/lib/Mirakurun/config.js.map +1 -1
  62. package/lib/Mirakurun/rpc.js +7 -4
  63. package/lib/Mirakurun/rpc.js.map +1 -1
  64. package/lib/Mirakurun/system.d.ts +4 -2
  65. package/lib/Mirakurun/system.js +42 -8
  66. package/lib/Mirakurun/system.js.map +1 -1
  67. package/lib/client.d.ts +29 -1
  68. package/lib/client.js +120 -20
  69. package/lib/client.js.map +1 -1
  70. package/lib/server.js +1 -0
  71. package/lib/server.js.map +1 -1
  72. package/lib/tsconfig.tsbuildinfo +1 -0
  73. package/lib/ui/index.bundle.js +2722 -0
  74. package/lib/ui/index.bundle.js.map +1 -0
  75. package/lib/ui/index.dev.html +2 -6
  76. package/lib/ui/index.html +2 -6
  77. package/lib/ui/swagger-ui.html +40 -0
  78. package/lib/ui/vendors.bundle.js +78252 -0
  79. package/lib/ui/vendors.bundle.js.map +1 -0
  80. package/package.json +46 -46
  81. package/.github/ISSUE_TEMPLATE/feature-request.md +0 -16
  82. package/lib/ui/index.js +0 -7154
  83. package/lib/ui/index.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -2,13 +2,14 @@
2
2
 
3
3
  see [Commit Logs](https://github.com/Chinachu/Mirakurun/commits/master) to check all.
4
4
 
5
- ## 3.9.0 (2021-xx-xx)
5
+ ## 3.9.0 (2022-xx-xx)
6
6
 
7
7
  Performance improvements, fixes for memory leaks and bugs related to EPG processing, etc.
8
8
 
9
9
  ### Server Changes
10
10
 
11
11
  - **config/server**: Add `disableWebUI` (Env: `DISABLE_WEB_UI` for Docker) to disable Web UI.
12
+ - **config/server**: Add `allowIPv4CidrRanges`, `allowIPv6CidrRanges` (Env: `ALLOW_IPV4_CIDR_RANGES`, `ALLOW_IPV6_CIDR_RANGES` for Docker) to allow optional IP range.
12
13
  - **config/server**: Change several default values based on typical usage.
13
14
  - `programGCInterval`: `900000` (15 mins) → `3600000` (1 hour)
14
15
  - `epgGatheringInterval`: `900000` (15 mins) → `1800000` (30 mins)
@@ -24,12 +25,15 @@ Performance improvements, fixes for memory leaks and bugs related to EPG process
24
25
  - **epg**: Add support for event relay.
25
26
  - **epg**: Add support for multi track audios.
26
27
  - **epg**: Improve performance of parsing start_time of events.
27
- - **epg**: Change to run asynchronously to reduce load.
28
28
  - **program**: Add event group type as `type` to `db.ProgramRelatedItem` of `db.Program`.
29
29
  - **program**: Fixed a problem in the implementation of conflict detection. (bug)
30
30
  - **program**: Reduced the frequent repeated update events.
31
31
  - **program**: Removed the `audio` property and added the `audios` property to support multi track audios. (**breaking change**)
32
+ - **program**: Fix program overlapping when re-scheduled. (bug)
33
+ - **program**: Removed the `redefine` event and added the `remove` event. (**breaking change**)
32
34
  - **api/iptv**: Fixed a problem with Kodi 19's IPTV feature that caused channel selection to take a long time. [#101](https://github.com/Chinachu/Mirakurun/pull/101)
35
+ - **api/iptv**: Add category (genre) info.
36
+ - **api/iptv**: Add timezone offset explicitly.
33
37
  - **api/getLogoImage**: Add `Cache-Control` header to cache logo images.
34
38
  - **api/restart**: Improved the restart speed on Docker. (approx. 2 secs)
35
39
  - **rpc**: Added a WebSocket RPC interface. (experimental)
@@ -37,18 +41,31 @@ Performance improvements, fixes for memory leaks and bugs related to EPG process
37
41
  - **ui/status**: Fix "EPG Gathering Network IDs" hex strings to upper case.
38
42
  - **ui/status**: Fix handle tuner updates to correctly. (bug) [#109](https://github.com/Chinachu/Mirakurun/pull/109)
39
43
  - **ui/config**: Add "EPG Gathering Interval" setting in Config/Server.
44
+ - **ui/config**: Add "Allow IPv4 CIDR Ranges", "Allow IPv6 CIDR Ranges" setting in Config/Server.
40
45
  - **ui/heart**: Add confirmation before accessing opencollective. [#106](https://github.com/Chinachu/Mirakurun/issues/106)
41
46
 
47
+ ### Client Changes
48
+
49
+ - Add [AbortSignal](https://nodejs.org/api/globals.html#class-abortsignal) option for `getChannelStream()`, `getServiceStreamByChannel()` `getServiceStream()`, `getProgramStream()`.
50
+ - Fix set priority correctly. (bug)
51
+ - Fix unexpected `postinstall` execution on npm@7 and later. (bug) [#116](https://github.com/Chinachu/Mirakurun/issues/116)
52
+
42
53
  ### Docker Changes
43
54
 
44
- - Update base image to `node:16.9.1-buster-slim`.
55
+ - Update base image to `node:16.13.1-buster-slim`.
45
56
  - Fixed the exit signal handling properly.
46
57
  - When a `SIGHUP` is received in a container, only the node process can be restarted quickly.
58
+ - Add startup script (it runs `/opt/bin/startup`) support.
59
+ - default `docker-compose.yml` volumes has been changed:
60
+ - `/usr/local/mirakurun/*` → `/opt/mirakurun/*`
61
+ - default `docker-compose.yml` network_mode has been changed to `host`.
62
+ - it enables IPv6 options.
47
63
 
48
64
  ### Other Changes
49
65
 
66
+ - **package**: Drop engine support `node@12`.
50
67
  - **package**: Update dependencies.
51
- - Reimplemented certain processes in C++.
68
+ - remove `colors` package for urgent security reasons.
52
69
 
53
70
  ## 3.8.0 (2021-08-10)
54
71
 
package/CONTRIBUTING.md CHANGED
@@ -2,6 +2,11 @@
2
2
 
3
3
  ## Report an Issue (問題の報告)
4
4
 
5
+ All issues that are not bugs or cannot be reproduced will be closed due to the limited moderating capacity at the moment.
6
+ If you have any comments or requests, please send them to the Discord.<br>
7
+ 現在、管理体制が限定的なため、バグではないか、バグが再現できない Issue は全てクローズされます。
8
+ ご意見・ご要望については、是非 Discord にお寄せください。
9
+
5
10
  * https://github.com/Chinachu/Mirakurun/issues
6
11
 
7
12
  When reporting an issue we also need as much information about your environment
@@ -20,13 +25,14 @@ that you can include. We never know what is your environment.<br>
20
25
  git clone git@github.com:Chinachu/Mirakurun.git
21
26
  cd Mirakurun
22
27
  git checkout <branch>
28
+ git submodule update --init
23
29
  ```
24
30
 
25
31
  ### Build
26
32
 
27
33
  ```sh
28
34
  # Docker on Linux
29
- npm run docker-build
35
+ npm run docker:build
30
36
 
31
37
  # Linux / Win32
32
38
  npm install
@@ -37,7 +43,7 @@ npm run build
37
43
 
38
44
  ```sh
39
45
  # Docker on Linux
40
- npm run docker-run
46
+ npm run docker:run
41
47
 
42
48
  # Linux
43
49
  sudo npm run start
@@ -50,7 +56,7 @@ npm run start.win32
50
56
 
51
57
  ```sh
52
58
  # Docker on Linux
53
- npm run docker-debug
59
+ npm run docker:debug
54
60
 
55
61
  # Linux
56
62
  sudo npm run debug
package/README.md CHANGED
@@ -2,13 +2,11 @@
2
2
 
3
3
  # Mirakurun
4
4
 
5
- DVR Tuner Server Service for **[Chinachu](https://chinachu.moe/)** Air.
5
+ DVR Tuner Server for Japanese TV which designed for the "Air" (in development codename).
6
6
 
7
7
  [![npm version][npm-img]][npm-url]
8
8
  [![npm downloads][downloads-image]][downloads-url]
9
9
  [![Linux Build][azure-pipelines-img]][azure-pipelines-url]
10
- [![Dependency Status][dep-img]][dep-url]
11
- [![devDependency Status][devdep-img]][devdep-url]
12
10
  [![tip for next commit](https://tip4commit.com/projects/43158.svg)](https://tip4commit.com/github/Chinachu/Mirakurun)
13
11
  [![Backers on Open Collective](https://opencollective.com/Mirakurun/backers/badge.svg)](#backers)
14
12
  [![Sponsors on Open Collective](https://opencollective.com/Mirakurun/sponsors/badge.svg)](#sponsors)
@@ -58,7 +56,7 @@ see: [doc/Platforms.md](doc/Platforms.md)
58
56
 
59
57
  ## Requirements / Supported Platforms
60
58
 
61
- * [Node.js](http://nodejs.org/) 12, 14, 16
59
+ * [Node.js](http://nodejs.org/) 14, 16
62
60
  * Linux w/ [PM2](http://pm2.keymetrics.io/) or [Docker](https://hub.docker.com/r/chinachu/mirakurun)
63
61
 
64
62
  see: [doc/Platforms.md](doc/Platforms.md)
@@ -88,6 +86,7 @@ You can use PM2 Plus to realtime monitoring if running by PM2.
88
86
  * [Rivarun](https://github.com/Chinachu/Rivarun)
89
87
  * [BonDriver_Mirakurun](https://github.com/Chinachu/BonDriver_Mirakurun)
90
88
  * Mirakurun Client ([Built-in](https://github.com/Chinachu/Mirakurun/blob/master/src/client.ts))
89
+ * "Air" (in development codename)
91
90
  * [Chinachu γ](https://github.com/Chinachu/Chinachu/wiki/Gamma-Installation-V2)
92
91
  * [EPGStation](https://github.com/l3tnun/EPGStation)
93
92
 
@@ -145,9 +144,5 @@ Support this project by becoming a sponsor. Your logo will show up here with a l
145
144
  [downloads-image]: https://img.shields.io/npm/dm/mirakurun.svg?style=flat
146
145
  [downloads-url]: https://npmjs.org/package/mirakurun
147
146
  [azure-pipelines-img]: https://dev.azure.com/chinachu/Mirakurun/_apis/build/status/Chinachu.Mirakurun?branchName=master
148
- [azure-pipelines-url]: hhttps://dev.azure.com/chinachu/Mirakurun/_build/latest?definitionId=1&branchName=master
149
- [dep-img]: https://david-dm.org/Chinachu/Mirakurun.svg
150
- [dep-url]: https://david-dm.org/Chinachu/Mirakurun
151
- [devdep-img]: https://david-dm.org/Chinachu/Mirakurun/dev-status.svg
152
- [devdep-url]: https://david-dm.org/Chinachu/Mirakurun#info=devDependencies
147
+ [azure-pipelines-url]: https://dev.azure.com/chinachu/Mirakurun/_build/latest?definitionId=1&branchName=master
153
148
  [docker-url]: https://hub.docker.com/r/chinachu/mirakurun
package/api.d.ts CHANGED
@@ -220,7 +220,7 @@ export interface Event {
220
220
 
221
221
  export type EventResource = "program" | "service" | "tuner";
222
222
 
223
- export type EventType = "create" | "update" | "redefine";
223
+ export type EventType = "create" | "update" | "remove";
224
224
 
225
225
  export interface ConfigServer {
226
226
  path?: string;
@@ -237,6 +237,8 @@ export interface ConfigServer {
237
237
  logoDataInterval?: number;
238
238
  disableEITParsing?: boolean;
239
239
  disableWebUI?: boolean;
240
+ allowIPv4CidrRanges?: string[];
241
+ allowIPv6CidrRanges?: string[];
240
242
  }
241
243
 
242
244
  export enum LogLevel {
package/api.yml CHANGED
@@ -2,10 +2,10 @@ swagger: '2.0'
2
2
  info:
3
3
  title: Mirakurun
4
4
  version: ~
5
- description: DVR Tuner Server Service for Chinachu Air.
5
+ description: DVR Tuner Server for Japanese TV.
6
6
  contact:
7
- name: kanreisa
8
- url: https://github.com/kanreisa
7
+ name: Chinachu Project
8
+ url: https://chinachu.moe/
9
9
  basePath: /api
10
10
  consumes:
11
11
  - application/json
@@ -448,7 +448,7 @@ definitions:
448
448
  enum:
449
449
  - create
450
450
  - update
451
- - redefine
451
+ - remove
452
452
 
453
453
  # config --------------------------------------------------------------------
454
454
 
@@ -489,6 +489,14 @@ definitions:
489
489
  type: boolean
490
490
  disableWebUI:
491
491
  type: boolean
492
+ allowIPv4CidrRanges:
493
+ type: array
494
+ items:
495
+ type: string
496
+ allowIPv6CidrRanges:
497
+ type: array
498
+ items:
499
+ type: string
492
500
 
493
501
  ConfigTuners:
494
502
  type: array
@@ -15,7 +15,7 @@
15
15
  */
16
16
  "use strict";
17
17
 
18
- if (process.env["npm_config_global"] !== undefined && process.env["npm_config_global"] !== "true") {
18
+ if (process.env["npm_config_global"] !== "true") {
19
19
  process.exit(0);
20
20
  }
21
21
 
@@ -23,14 +23,13 @@ const fs = require("fs");
23
23
  const path = require("path");
24
24
  const child_process = require("child_process");
25
25
  const semver = require("semver");
26
- const colors = require("colors");
27
26
  const pkg = require("../package.json");
28
27
 
29
28
  // node check
30
29
  if (semver.satisfies(process.version, pkg.engines.node) === true) {
31
- console.log("Version:", `node@${process.version}`.green, "[OK]".bgGreen);
30
+ console.log("Version:", `node@${process.version}`, "[OK]");
32
31
  } else {
33
- console.error("Version:", `node@${process.version}`.red, "[NG]".bgRed, "Expected:", pkg.engines.node);
32
+ console.error("Version:", `node@${process.version}`, "[NG]", "Expected:", pkg.engines.node);
34
33
  process.exit(1);
35
34
  }
36
35
 
@@ -57,9 +56,9 @@ if (process.platform === "linux" || process.platform === "darwin") {
57
56
  const pm2Version = child_process.execSync("pm2 -v", { encoding: "utf8" }).trim();
58
57
  const pm2Expected = ">=2.4.0";
59
58
  if (semver.satisfies(pm2Version, pm2Expected) === true) {
60
- console.log("Version:", `pm2@${pm2Version}`.green, "[OK]".bgGreen);
59
+ console.log("Version:", `pm2@${pm2Version}`, "[OK]");
61
60
  } else {
62
- console.error("Version:", `pm2@${pm2Version}`.red, "[NG]".bgRed, "Expected:", pm2Expected);
61
+ console.error("Version:", `pm2@${pm2Version}`, "[NG]", "Expected:", pm2Expected);
63
62
  process.exit(1);
64
63
  }
65
64
 
@@ -72,7 +71,7 @@ if (process.platform === "linux" || process.platform === "darwin") {
72
71
  ]
73
72
  });
74
73
  } catch (e) {
75
- console.log("Caution: `pm2 startup` has failed. you can try fix yourself.".bgYellow);
74
+ console.log("Caution: `pm2 startup` has failed. you can try fix yourself.");
76
75
  }
77
76
 
78
77
  child_process.execSync("pm2 start processes.json", {
@@ -95,9 +94,9 @@ if (process.platform === "linux" || process.platform === "darwin") {
95
94
  const winserVersion = child_process.execSync("winser -v", { encoding: "utf8" }).replace(/^[a-z]+ /, "").trim();
96
95
  const winserExpected = ">=1.0.3 <2.0.0";
97
96
  if (semver.satisfies(winserVersion, winserExpected) === true) {
98
- console.log("Version:", `winser@${winserVersion}`.green, "[OK]".bgGreen);
97
+ console.log("Version:", `winser@${winserVersion}`, "[OK]");
99
98
  } else {
100
- console.error("Version:", `winser@${winserVersion}`.red, "[NG]".bgRed, "Expected:", winserExpected);
99
+ console.error("Version:", `winser@${winserVersion}`, "[NG]", "Expected:", winserExpected);
101
100
  process.exit(1);
102
101
  }
103
102
 
@@ -15,7 +15,7 @@
15
15
  */
16
16
  "use strict";
17
17
 
18
- if (process.env["npm_config_global"] !== undefined && process.env["npm_config_global"] !== "true") {
18
+ if (process.env["npm_config_global"] !== "true") {
19
19
  process.exit(0);
20
20
  }
21
21
 
@@ -141,15 +141,15 @@
141
141
  [BS23_1]
142
142
  DELIVERY_SYSTEM = ISDBS
143
143
  FREQUENCY = 1471440
144
- STREAM_ID = 18289
144
+ STREAM_ID = 18801
145
145
  [BS23_2]
146
146
  DELIVERY_SYSTEM = ISDBS
147
147
  FREQUENCY = 1471440
148
- STREAM_ID = 18290
148
+ STREAM_ID = 18802
149
149
  [BS23_3]
150
150
  DELIVERY_SYSTEM = ISDBS
151
151
  FREQUENCY = 1471440
152
- STREAM_ID = 18291
152
+ STREAM_ID = 18803
153
153
  [CS2]
154
154
  DELIVERY_SYSTEM = ISDBS
155
155
  FREQUENCY = 1613000
@@ -27,6 +27,8 @@ epgRetrievalTime: 600000 # integer (ms)
27
27
  logoDataInterval: 604800000 # integer (ms)
28
28
  disableEITParsing: false # boolean
29
29
  disableWebUI: false # boolean
30
+ allowIPv4CidrRanges: ["10.0.0.0/8", "127.0.0.0/8", "172.16.0.0/12", "192.168.0.0/16"] # array of string
31
+ allowIPv6CidrRanges: ["fc00::/7"] # array of string
30
32
  ```
31
33
 
32
34
  ### Environment Values (Docker)
@@ -43,6 +45,8 @@ EPG_RETRIEVAL_TIME
43
45
  LOGO_DATA_INTERVAL
44
46
  DISABLE_EIT_PARSING
45
47
  DISABLE_WEB_UI
48
+ ALLOW_IPV4_CIDR_RANGES
49
+ ALLOW_IPV6_CIDR_RANGES
46
50
  ```
47
51
 
48
52
  ## tuners.yml
package/doc/Platforms.md CHANGED
@@ -2,17 +2,17 @@
2
2
 
3
3
  ## Overview
4
4
 
5
- **Bold** is the recommended. also, **Node.js** `^12 || ^14 || ^16` needed.
5
+ **Bold** is the recommended. also, **Node.js** `^14.17.0 || ^16` needed.
6
6
 
7
7
  * [**Docker on Linux**](#docker-on-linux)
8
8
  * [Docker Engine](https://docs.docker.com/engine/install/) `>=18.06.0`
9
9
  * [Docker Compose](https://docs.docker.com/compose/install/) `>=1.22.0`
10
- * **x64**
10
+ * **x64** / arm32v7 / **arm64v8**
11
11
  * **Ubuntu Server 20.04** / Debian 9 / CentOS 8.1
12
12
  * ⚠ Note: Desktop Environment / VM is not supported and unstable!
13
13
  * [Linux](#linux)
14
14
  * [PM2](http://pm2.keymetrics.io/) `>=2.4.0`
15
- * x86 / **x64** / ARMv7 / **ARMv8**
15
+ * x86 / x64 / arm64v8
16
16
  * **Debian** / **Ubuntu Server** / CentOS / Gentoo
17
17
  * SystemV / OpenRC / **SystemD**
18
18
  * ⚠ Note: Desktop Environment / VM is not supported and unstable!
@@ -39,6 +39,10 @@ curl -sSL https://get.docker.com/ | CHANNEL=stable sh
39
39
  ### Install / Uninstall / Update
40
40
 
41
41
  ```sh
42
+ # Create: /opt/mirakurun/
43
+ sudo mv -vf /usr/local/mirakurun /opt/mirakurun
44
+ sudo mkdir -p /opt/mirakurun/run /opt/mirakurun/opt /opt/mirakurun/config /opt/mirakurun/data
45
+
42
46
  # Install
43
47
  mkdir ~/mirakurun/
44
48
  cd ~/mirakurun/
@@ -80,20 +84,50 @@ docker-compose logs [-f]
80
84
  ### Config
81
85
 
82
86
  ```
83
- vim /usr/local/mirakurun/config/server.yml
84
- vim /usr/local/mirakurun/config/tuners.yml
85
- vim /usr/local/mirakurun/config/channels.yml
87
+ vim /opt/mirakurun/config/server.yml
88
+ vim /opt/mirakurun/config/tuners.yml
89
+ vim /opt/mirakurun/config/channels.yml
86
90
  ```
87
91
 
88
92
  see: [Configuration.md](Configuration.md)
89
93
 
90
94
  ### 💡 How to Use: Non-DVB Devices
91
95
 
96
+ #### option: **using custom startup script**
97
+
98
+ ```sh
99
+ mkdir -p /opt/mirakurun/opt/bin
100
+ vim /opt/mirakurun/opt/bin/startup # example ↓
101
+ chmod +x /opt/mirakurun/opt/bin/startup
102
+ ```
103
+ ```bash
104
+ #!/bin/bash
105
+
106
+ if !(type "recpt1" > /dev/null 2>&1); then
107
+ apt-get update
108
+ apt-get install -y --no-install-recommends git autoconf automake
109
+
110
+ cd /tmp
111
+ git clone https://github.com/stz2012/recpt1.git
112
+ cd recpt1/recpt1
113
+ ./autogen.sh
114
+ ./configure --prefix /opt
115
+ make
116
+ make install
117
+ fi
118
+
119
+ recpt1 -v
120
+ ```
121
+ ```sh
122
+ docker-compose down
123
+ docker-compose run --rm -e SETUP=true mirakurun
124
+ docker-compose up -d
125
+ ```
126
+
127
+ #### option: **using static build**
128
+
92
129
  ```sh
93
- $ which recpt1
94
- /usr/local/bin/recpt1
95
- $ cp /usr/local/bin/recpt1 /usr/local/mirakurun/opt/bin/
96
- $ vim /usr/local/mirakurun/config/tuners.yml
130
+ $ cp /usr/local/bin/something-static /opt/mirakurun/opt/bin/
97
131
  ```
98
132
 
99
133
  ### 💡 Locations (Container)
@@ -108,19 +142,21 @@ $ vim /usr/local/mirakurun/config/tuners.yml
108
142
  * `programs.json`
109
143
  * Opt: `/opt/`
110
144
  * `bin/`
145
+ * `bin/startup` - custom startup script (optional)
111
146
 
112
147
  ### 💡 Locations (Host)
113
148
 
114
- * Socket: `/usr/local/mirakurun/run/mirakurun.sock`
115
- * Config: `/usr/local/mirakurun/config/`
149
+ * Socket: `/opt/mirakurun/run/mirakurun.sock`
150
+ * Config: `/opt/mirakurun/config/`
116
151
  * `server.yml`
117
152
  * `tuners.yml`
118
153
  * `channels.yml`
119
- * Data: `/usr/local/mirakurun/data/`
154
+ * Data: `/opt/mirakurun/data/`
120
155
  * `services.json`
121
156
  * `programs.json`
122
- * Opt: `/usr/local/mirakurun/opt/`
157
+ * Opt: `/opt/mirakurun/opt/`
123
158
  * `bin/`
159
+ * `bin/startup` - custom startup script (optional)
124
160
 
125
161
  ## Linux
126
162
 
@@ -151,7 +187,7 @@ sudo apt install build-essential
151
187
  sudo npm install pm2 -g
152
188
 
153
189
  # Quick
154
- sudo npm install mirakurun -g --unsafe-perm --production
190
+ sudo npm install mirakurun -g --unsafe-perm --foreground-scripts --production
155
191
 
156
192
  # Advanced
157
193
  sudo npm install mirakurun -g --production
@@ -239,7 +275,7 @@ npm install winser@1.0.3 -g
239
275
  **use Windows PowerShell as Admin.**
240
276
 
241
277
  ```
242
- npm install mirakurun@latest -g --production
278
+ npm install mirakurun@latest -g --foreground-scripts --production
243
279
  ```
244
280
 
245
281
  ### Uninstall
@@ -37,6 +37,13 @@ if [ -f "/app-data/programs.yml" -a ! -f "$PROGRAMS_DB_PATH" ]; then
37
37
  cp -v "/app-data/programs.yml" "$PROGRAMS_DB_PATH"
38
38
  fi
39
39
 
40
+ # custom startup script
41
+ if [ -e "/opt/bin/startup" ]; then
42
+ echo "executing /opt/bin/startup..."
43
+ /opt/bin/startup
44
+ echo "done."
45
+ fi
46
+
40
47
  # only for test purpose
41
48
  if !(type "arib-b25-stream-test" > /dev/null 2>&1); then
42
49
  npm --prefix /opt install arib-b25-stream-test
@@ -1,7 +1,4 @@
1
1
  version: "3.7"
2
- networks:
3
- default:
4
- name: mirakurun
5
2
  services:
6
3
  mirakurun:
7
4
  build:
@@ -14,19 +11,32 @@ services:
14
11
  - SYS_NICE
15
12
  environment:
16
13
  TZ: Asia/Tokyo
14
+ DOCKER_NETWORK: host
17
15
  # LOG_LEVEL: "3"
18
16
  # DEBUG: "true"
19
- ports:
20
- - 40772:40772
21
- # - 9229:9229
17
+ network_mode: host
22
18
  devices:
23
19
  - /dev/bus:/dev/bus
24
20
  - /dev/dvb:/dev/dvb
25
21
  volumes:
26
- - /usr/local/mirakurun/run/:/var/run/
27
- - /usr/local/mirakurun/opt/:/opt/
28
- - /usr/local/mirakurun/config/:/app-config/
29
- - /usr/local/mirakurun/data/:/app-data/
22
+ # ** CAUTION **
23
+ # (default) `/usr/local/mirakurun/*` has been moved to `/opt/mirakurun/*`
24
+ # try:
25
+ # sudo mv -vf /usr/local/mirakurun /opt/mirakurun
26
+ # sudo mkdir -p /opt/mirakurun/run /opt/mirakurun/opt /opt/mirakurun/config /opt/mirakurun/data
27
+ # you can change to any location if required.
28
+ - type: bind
29
+ source: /opt/mirakurun/run/
30
+ target: /var/run/
31
+ - type: bind
32
+ source: /opt/mirakurun/opt/
33
+ target: /opt/
34
+ - type: bind
35
+ source: /opt/mirakurun/config/
36
+ target: /app-config/
37
+ - type: bind
38
+ source: /opt/mirakurun/data/
39
+ target: /app-data/
30
40
  restart: always
31
41
  logging:
32
42
  driver: json-file
@@ -1,10 +1,6 @@
1
1
  import { EIT } from "@chinachu/aribts/lib/table/eit";
2
2
  export default class EPG {
3
3
  private _epg;
4
- private _queue;
5
- private _running;
6
- private _end;
7
4
  write(eit: EIT): void;
8
5
  end(): void;
9
- private _run;
10
6
  }