Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Node.js v22 対応 #1057

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ jobs:
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: "lts/*"
node-version-file: package.json
cache: yarn
- name: install
run: yarn
Expand Down
13 changes: 12 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ All notable changes to this project will be documented in this file.
## [2025]

### Added

- Deep Linking support from Blackboard (OU)

## [2024]

### Added

- Version management feature (NII)
- Tag/note registration (OU)
- Word cloud (OU)
Expand All @@ -19,6 +21,7 @@ All notable changes to this project will be documented in this file.
## [2023]

### Added

- Video thumbnail display
- Viewing status timeline (OU)
- Names and Role Provisioning Services support (OU)
Expand All @@ -28,12 +31,14 @@ All notable changes to this project will be documented in this file.
- Deep Linking support

### Changed

- Removal of IP address-based client authentication
- Video interaction log improvement (NII)

## [2022]

### Added

- Keyword registration (NII)
- Multiple author registration (NII)
- License registration (NII)
Expand All @@ -50,6 +55,7 @@ All notable changes to this project will be documented in this file.
## [2021]

### Added

- LTI 1.1 authentication from Blackboard (OU)
- Viewing history (OU)
- Learning analytics (OU)
Expand All @@ -68,6 +74,7 @@ All notable changes to this project will be documented in this file.
## [2020]

### Added

- RDB support (NII)
- LTI 1.1 authentication from Moodle (NII)
- Role-based access control (NII)
Expand All @@ -76,14 +83,18 @@ All notable changes to this project will be documented in this file.
- Video interaction log output (NII)

### Changed

- Complete migration from PHP to TypeScript

## Development

- The initial development of this project was carried out by NII.

## Note

- Contribution attributions vary due to differences in documentation practices.

## Organization Abbreviations

- NII: National Institute of Informatics
- OU: Osaka University
- OU: Osaka University
2 changes: 1 addition & 1 deletion CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ Contributors listed below have made various contributions to different aspects o
- National Institute of Informatics (2020 - )
- NPO Consortium TIES (2020 - )
- Osaka University (2021 - )
- Kumamoto University (2021 - )
- Kumamoto University (2021 - )
2 changes: 1 addition & 1 deletion README-ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,4 @@ MIT

## funding

永続的な開発を続けるために、寄付を歓迎します。
永続的な開発を続けるために、寄付を歓迎します。
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# ![ロゴ](docs/assets/chibichilo_s.png)CHiBi-CHiLO
# ![ロゴ](docs/assets/chibichilo_s.png)CHiBi-CHiLO

[English](README-en.md) | [日本語](README-ja.md)

Expand All @@ -9,9 +9,11 @@ LMS と外部接続する[LTI ツールプロバイダー](https://www.imsglobal
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/git/external?repository-url=https%3A%2F%2Fgithub.com%2Fnpocccties%2Fchibichilo&env=SESSION_SECRET,DATABASE_URL)

## License

This project is released under the MIT License. The full text can be found in the [LICENSE file](LICENSE).

## Contributors

We appreciate contributions to this project. A list of all contributors can be found in the [CONTRIBUTORS file](CONTRIBUTORS.md).

These documents serve to ensure transparency and equality among all participants in the project, accurately reflecting each member's involvement and the collective nature of the project.
These documents serve to ensure transparency and equality among all participants in the project, accurately reflecting each member's involvement and the collective nature of the project.
6 changes: 3 additions & 3 deletions compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# NOTE: DON'T USE IT IN PRODUCTION. 本番環境で使用しないで。
services:
mariadb:
image: "mariadb:11.1.2-jammy"
image: "mariadb:11.2.6-jammy"
environment:
MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
MYSQL_DATABASE: bitnami_moodle
Expand All @@ -22,15 +22,15 @@ services:
- moodle_data_v4:/bitnami/moodle
- moodledata_data_v4:/bitnami/moodledata
db:
image: "postgres:15.4-alpine3.18"
image: "postgres:15.10-alpine3.21"
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
ports: ["5432:5432"]
volumes:
- postgres_data_v15:/var/lib/postgresql/data
app:
image: "node:18.17.1-alpine3.18"
image: "node:22.13.0-alpine3.21"
environment:
FRONTEND_ORIGIN: "http://localhost:3000"
SESSION_SECRET: super_secret_characters_for_session
Expand Down
2 changes: 1 addition & 1 deletion moodle/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
FROM bitnami/moodle:4.1.5-debian-11-r18
FROM bitnami/moodle:4.5.1-debian-12-r2
# NOTE: Fixed AH00023 for macOS with Apple silicon
RUN echo 'Mutex posixsem' >> /opt/bitnami/apache2/conf/httpd.conf
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
"storybook": "storybook dev -s ./public"
},
"engines": {
"node": "^16.13.0 || ^18.12.0 || ^20.0.0"
"node": "^18.12.0 || ^20.0.0 || ^22.13.0"
},
"dependencies": {
"@twemoji/api": "^15.0.3"
Expand Down
6 changes: 5 additions & 1 deletion server/utils/activity/upsertActivity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ function countTimeRange(
log.endMs < range.endMs &&
log.endMs - range.startMs > ACTIVITY_COUNT_INTERVAL_THRESHOLD_MS)
) {
range.count ??= 0;
range.count += 1;
}
});
Expand Down Expand Up @@ -350,7 +351,10 @@ async function upsertActivity({
}

const timeRanges = merge(exists?.timeRanges ?? [], activity.timeRanges);
const timeRangeLogs = concatAndMerge(recentTimeRangeLogs, activity.timeRanges);
const timeRangeLogs = concatAndMerge(
recentTimeRangeLogs,
activity.timeRanges
);
const purgedTimeRangeLogs = purge(recentTimeRangeLogs, activity.timeRanges);

timeRangeCounts = countTimeRange(timeRangeCounts, purgedTimeRangeLogs);
Expand Down
135 changes: 69 additions & 66 deletions server/utils/book/importBooksUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -517,78 +517,81 @@ class ImportBooksUtil {
return;
}
zipfile.readEntry();
zipfile.on("entry", (entry) => {
// ディレクトリは fileName が '/' で終わっている
if (/\/$/.test(entry.fileName)) {
zipfile.readEntry();
} else {
const filename = path.join(this.tmpdir, entry.fileName);
const dirname = path.dirname(filename);
zipfile.openReadStream(entry, (err, readStream) => {
if (err) {
this.errors.push(`openReadStreamでエラーが発生しました。\n${err}`);
zipfile.readEntry();
return;
}
try {
if (!fs.existsSync(dirname)) {
fs.mkdirSync(dirname, { recursive: true });
}
readStream.on("end", () => {
zipfile.readEntry();
});
const ws = fs.createWriteStream(filename);
// eslint-disable-next-line @typescript-eslint/no-explicit-any
readStream.pipe(ws).on("error", (err: any) => {
zipfile
.on("entry", (entry) => {
// ディレクトリは fileName が '/' で終わっている
if (/\/$/.test(entry.fileName)) {
zipfile.readEntry();
} else {
const filename = path.join(this.tmpdir, entry.fileName);
const dirname = path.dirname(filename);
zipfile.openReadStream(entry, (err, readStream) => {
if (err) {
this.errors.push(
`zip解凍中にファイルの書き込みに失敗しました。\n${err}`
`openReadStreamでエラーが発生しました。\n${err}`
);
zipfile.readEntry();
return;
}
try {
if (!fs.existsSync(dirname)) {
fs.mkdirSync(dirname, { recursive: true });
}
readStream.on("end", () => {
zipfile.readEntry();
});
const ws = fs.createWriteStream(filename);
// eslint-disable-next-line @typescript-eslint/no-explicit-any
readStream.pipe(ws).on("error", (err: any) => {
this.errors.push(
`zip解凍中にファイルの書き込みに失敗しました。\n${err}`
);
readStream.destroy();
zipfile.readEntry();
});
} catch (err) {
this.errors.push(`zip解凍中に例外が発生しました。\n${err}`);
readStream.destroy();
zipfile.readEntry();
});
} catch (err) {
this.errors.push(`zip解凍中に例外が発生しました。\n${err}`);
readStream.destroy();
zipfile.readEntry();
}
});
}
})
.on("close", () => {
this.unzippedFiles = recursive(this.tmpdir);
const jsonfiles: string[] = this.unzippedFiles.filter((filename) =>
filename.toLowerCase().endsWith(".json")
);
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const jsons: any[] = [];
if (jsonfiles.length) {
for (const jsonfile of jsonfiles) {
try {
const json = JSON.parse(fs.readFileSync(jsonfile).toString());
jsons.push(...(Array.isArray(json) ? json : [json]));
} catch (e) {
this.errors.push(
`入力されたjsonテキストを解釈できません。\n${e}`
);
}
});
}
})
.on("close", () => {
this.unzippedFiles = recursive(this.tmpdir);
const jsonfiles: string[] = this.unzippedFiles.filter((filename) =>
filename.toLowerCase().endsWith(".json")
);
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const jsons: any[] = [];
if (jsonfiles.length) {
for (const jsonfile of jsonfiles) {
try {
const json = JSON.parse(fs.readFileSync(jsonfile).toString());
jsons.push(...(Array.isArray(json) ? json : [json]));
} catch (e) {
this.errors.push(
`入力されたjsonテキストを解釈できません。\n${e}`
);
}
}
} else {
this.errors.push("jsonファイルがありません。");
}
} else {
this.errors.push("jsonファイルがありません。");
}
if (this.errors.length) {
resolve({});
} else {
resolve(jsons);
}
})
.on("error", (error) => {
try {
resolve(JSON.parse(fs.readFileSync(file).toString()));
} catch (e) {
this.errors.push(`ファイルがzipではありません。\n${error}`);
resolve({});
}
});
if (this.errors.length) {
resolve({});
} else {
resolve(jsons);
}
})
.on("error", (error) => {
try {
resolve(JSON.parse(fs.readFileSync(file).toString()));
} catch (e) {
this.errors.push(`ファイルがzipではありません。\n${error}`);
resolve({});
}
});
});
});
}
Expand Down
Loading