diff --git a/CHANGELOG.md b/CHANGELOG.md index b214ce6..9fa7eb8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,55 +1,34 @@ -## [1.0.2](https://github.com/KeptCodes/StatStream/compare/v1.0.1...v1.0.2) (2024-11-20) - +# [1.1.0](https://github.com/KeptCodes/StatStream/compare/v1.0.2...v1.1.0) (2024-11-20) ### Bug Fixes -* origin URL matching ([#32](https://github.com/KeptCodes/StatStream/issues/32)) ([b1ff38d](https://github.com/KeptCodes/StatStream/commit/b1ff38d5cf6ed95a8f2314ddf4a6de7144ee6dda)) - -# 1.0.0 (2024-11-19) - - -* Release v2.0.0 ([#14](https://github.com/KeptCodes/StatStream/issues/14)) ([0b8ca75](https://github.com/KeptCodes/StatStream/commit/0b8ca757017e78b63570ae857e364d90cb24dfd4)), closes [#11](https://github.com/KeptCodes/StatStream/issues/11) [#12](https://github.com/KeptCodes/StatStream/issues/12) [#13](https://github.com/KeptCodes/StatStream/issues/13) [#12](https://github.com/KeptCodes/StatStream/issues/12) - - -### Bug Fixes - -* docker deploy flow ([bb2a933](https://github.com/KeptCodes/StatStream/commit/bb2a933d8b32ac02f20d301a940a8a60913ff29a)) -* gh token ([c2dc724](https://github.com/KeptCodes/StatStream/commit/c2dc724c45bfd8f6568695abae60ebf63a9fbc9c)) -* github token ([9586260](https://github.com/KeptCodes/StatStream/commit/9586260d2fb3ce717e623679bfbf126ffec9597a)) -* pat token ([f64530e](https://github.com/KeptCodes/StatStream/commit/f64530e8071cc0cd4333de0a2547d5227af98423)) -* permissions ([bb906b8](https://github.com/KeptCodes/StatStream/commit/bb906b8abd107b52f6efe565aac8df68cac648eb)) -* release only on master ([5a462f5](https://github.com/KeptCodes/StatStream/commit/5a462f5820628bc1ecadf55d94e0b783f54bba8b)) -* remove dev branch to release ([bdcf2b6](https://github.com/KeptCodes/StatStream/commit/bdcf2b60ad67a0f7c6e9fec9c24e81b08aaf97ea)) -* run release workflow ([18e9b15](https://github.com/KeptCodes/StatStream/commit/18e9b1523d7816fd7c53558cc4d93b3e41135c1c)) -* workflow Triggers added ([0448bca](https://github.com/KeptCodes/StatStream/commit/0448bca476ae2a91f4383d6fc262794f6abc6347)) - +- **ci:** release workflow bun to npm ([#37](https://github.com/KeptCodes/StatStream/issues/37)) ([548cd88](https://github.com/KeptCodes/StatStream/commit/548cd88300b65c36c9ac08508f7da24457a6e9e1)) +- **ci:** release workflow npm to bun ([#36](https://github.com/KeptCodes/StatStream/issues/36)) ([2e32296](https://github.com/KeptCodes/StatStream/commit/2e32296ea94ba7e734820144dda5ec39798537cb)) ### Features -* adds Readme ([c2b7d05](https://github.com/KeptCodes/StatStream/commit/c2b7d05da00b15ec6f4322e74fe155ccd26a9382)) -* docker deploy setup ([#4](https://github.com/KeptCodes/StatStream/issues/4)) ([eeeef1c](https://github.com/KeptCodes/StatStream/commit/eeeef1c2f2267ae371764533d74fdb13b1c917b2)) -* docker deploy setup ([#5](https://github.com/KeptCodes/StatStream/issues/5)) ([8acd142](https://github.com/KeptCodes/StatStream/commit/8acd14290f5384c19c6316ddec4961fa95cde77a)) -* Docker setup ([b1a725c](https://github.com/KeptCodes/StatStream/commit/b1a725c6d8149e8319a8c45ffdb167e49a2edd19)) -* semantic release docker hub push ([#10](https://github.com/KeptCodes/StatStream/issues/10)) ([9eda188](https://github.com/KeptCodes/StatStream/commit/9eda188781e6482c40f6ff1e8b7da0be4a24b6ba)) -* tracking url change ([#1](https://github.com/KeptCodes/StatStream/issues/1)) ([e044901](https://github.com/KeptCodes/StatStream/commit/e04490131bbdae1605cdcf5f62368e9073f33d61)) +- Docs website added ([#34](https://github.com/KeptCodes/StatStream/issues/34)) ([e721cf1](https://github.com/KeptCodes/StatStream/commit/e721cf125f60e33d0332f560911b6afbbdb354a9)) +- **structure:** workplace monorepo setup with docs ([#33](https://github.com/KeptCodes/StatStream/issues/33)) ([fa2bed0](https://github.com/KeptCodes/StatStream/commit/fa2bed067050e109bec2cd4383fe545cad1277b7)) +## [1.0.2](https://github.com/KeptCodes/StatStream/compare/v1.0.1...v1.0.2) (2024-11-20) -### BREAKING CHANGES +### Bug Fixes -* removing tracker cdn file replacement is pushed +- origin URL matching ([#32](https://github.com/KeptCodes/StatStream/issues/32)) ([b1ff38d](https://github.com/KeptCodes/StatStream/commit/b1ff38d5cf6ed95a8f2314ddf4a6de7144ee6dda)) -* fixes: coverage tests for tracker added +# 1.0.0 (2024-11-19) -# 1.0.0 (2024-11-18) +- Release v2.0.0 ([#14](https://github.com/KeptCodes/StatStream/issues/14)) ([0b8ca75](https://github.com/KeptCodes/StatStream/commit/0b8ca757017e78b63570ae857e364d90cb24dfd4)), closes [#11](https://github.com/KeptCodes/StatStream/issues/11) [#12](https://github.com/KeptCodes/StatStream/issues/12) [#13](https://github.com/KeptCodes/StatStream/issues/13) [#12](https://github.com/KeptCodes/StatStream/issues/12) ### Bug Fixes +- docker deploy flow ([bb2a933](https://github.com/KeptCodes/StatStream/commit/bb2a933d8b32ac02f20d301a940a8a60913ff29a)) - gh token ([c2dc724](https://github.com/KeptCodes/StatStream/commit/c2dc724c45bfd8f6568695abae60ebf63a9fbc9c)) - github token ([9586260](https://github.com/KeptCodes/StatStream/commit/9586260d2fb3ce717e623679bfbf126ffec9597a)) - pat token ([f64530e](https://github.com/KeptCodes/StatStream/commit/f64530e8071cc0cd4333de0a2547d5227af98423)) - permissions ([bb906b8](https://github.com/KeptCodes/StatStream/commit/bb906b8abd107b52f6efe565aac8df68cac648eb)) -- docker deploy flow ([bb2a933](https://github.com/KeptCodes/StatStream/commit/bb2a933d8b32ac02f20d301a940a8a60913ff29a)) - release only on master ([5a462f5](https://github.com/KeptCodes/StatStream/commit/5a462f5820628bc1ecadf55d94e0b783f54bba8b)) +- remove dev branch to release ([bdcf2b6](https://github.com/KeptCodes/StatStream/commit/bdcf2b60ad67a0f7c6e9fec9c24e81b08aaf97ea)) - run release workflow ([18e9b15](https://github.com/KeptCodes/StatStream/commit/18e9b1523d7816fd7c53558cc4d93b3e41135c1c)) - workflow Triggers added ([0448bca](https://github.com/KeptCodes/StatStream/commit/0448bca476ae2a91f4383d6fc262794f6abc6347)) diff --git a/bun.lockb b/bun.lockb index de2c986..12fe4ee 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/docker-compose.yml b/packages/app/docker-compose.yml similarity index 94% rename from docker-compose.yml rename to packages/app/docker-compose.yml index df22be7..990badc 100644 --- a/docker-compose.yml +++ b/packages/app/docker-compose.yml @@ -1,4 +1,3 @@ -version: "3" services: statstream: build: . diff --git a/packages/app/package.json b/packages/app/package.json index 611e081..1a892bd 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -58,6 +58,7 @@ "express": "^4.21.1", "terser": "^5.36.0", "winston": "^3.17.0", + "morgan": "^1.10.0", "zod": "^3.23.8" }, "devDependencies": { @@ -76,6 +77,7 @@ "jest": "^29.7.0", "semantic-release": "^24.2.0", "supertest": "^7.0.0", + "@types/morgan": "^1.9.9", "ts-jest": "^29.2.5", "ts-node-dev": "^2.0.0", "typescript": "^5.6.3", diff --git a/packages/app/src/api/handlers.ts b/packages/app/src/api/handlers.ts index 4f93b4a..1e612be 100644 --- a/packages/app/src/api/handlers.ts +++ b/packages/app/src/api/handlers.ts @@ -26,7 +26,6 @@ export const trackAction = async ( }); return; } - console.log(req.headers["x-signature"]); const originUrl = req.headers.origin; const locationData = await fetchLocationData(req); diff --git a/packages/app/src/lib/server.ts b/packages/app/src/lib/server.ts index a1c3955..e7aa880 100644 --- a/packages/app/src/lib/server.ts +++ b/packages/app/src/lib/server.ts @@ -7,5 +7,8 @@ const server = express(); server.use(cors()); server.use(express.json()); server.use(router); +server.use((_, res) => { + res.send("NOT FOUND"); +}); export default server; diff --git a/packages/app/src/lib/utils.ts b/packages/app/src/lib/utils.ts index 919a072..8c5e52a 100644 --- a/packages/app/src/lib/utils.ts +++ b/packages/app/src/lib/utils.ts @@ -3,17 +3,7 @@ import { Request } from "express"; import terser from "terser"; export async function fetchLocationData(req: Request) { - let clientIP: string; - - if (req.headers["x-forwarded-for"]) { - if (typeof req.headers["x-forwarded-for"] === "string") { - clientIP = req.headers["x-forwarded-for"]; - } else { - clientIP = req.headers["x-forwarded-for"][0].trim(); - } - } else { - clientIP = req.socket.remoteAddress ?? ""; - } + const clientIP = req.socket.remoteAddress ?? ""; let locationData: LocationData; diff --git a/packages/docs/versioned_docs/version-1.0.3/dashboard/_category_.json b/packages/docs/versioned_docs/version-v1/dashboard/_category_.json similarity index 100% rename from packages/docs/versioned_docs/version-1.0.3/dashboard/_category_.json rename to packages/docs/versioned_docs/version-v1/dashboard/_category_.json diff --git a/packages/docs/versioned_docs/version-1.0.3/dashboard/access-tracked-data.md b/packages/docs/versioned_docs/version-v1/dashboard/access-tracked-data.md similarity index 100% rename from packages/docs/versioned_docs/version-1.0.3/dashboard/access-tracked-data.md rename to packages/docs/versioned_docs/version-v1/dashboard/access-tracked-data.md diff --git a/packages/docs/versioned_docs/version-1.0.3/installation/_category_.json b/packages/docs/versioned_docs/version-v1/installation/_category_.json similarity index 100% rename from packages/docs/versioned_docs/version-1.0.3/installation/_category_.json rename to packages/docs/versioned_docs/version-v1/installation/_category_.json diff --git a/packages/docs/versioned_docs/version-1.0.3/installation/add-your-website.md b/packages/docs/versioned_docs/version-v1/installation/add-your-website.md similarity index 100% rename from packages/docs/versioned_docs/version-1.0.3/installation/add-your-website.md rename to packages/docs/versioned_docs/version-v1/installation/add-your-website.md diff --git a/packages/docs/versioned_docs/version-1.0.3/installation/docker-image-host.md b/packages/docs/versioned_docs/version-v1/installation/docker-image-host.md similarity index 100% rename from packages/docs/versioned_docs/version-1.0.3/installation/docker-image-host.md rename to packages/docs/versioned_docs/version-v1/installation/docker-image-host.md diff --git a/packages/docs/versioned_docs/version-1.0.3/installation/setup-discord-bot.md b/packages/docs/versioned_docs/version-v1/installation/setup-discord-bot.md similarity index 100% rename from packages/docs/versioned_docs/version-1.0.3/installation/setup-discord-bot.md rename to packages/docs/versioned_docs/version-v1/installation/setup-discord-bot.md diff --git a/packages/docs/versioned_docs/version-1.0.3/installation/setup-discord-server.md b/packages/docs/versioned_docs/version-v1/installation/setup-discord-server.md similarity index 100% rename from packages/docs/versioned_docs/version-1.0.3/installation/setup-discord-server.md rename to packages/docs/versioned_docs/version-v1/installation/setup-discord-server.md diff --git a/packages/docs/versioned_docs/version-1.0.3/intro.md b/packages/docs/versioned_docs/version-v1/intro.md similarity index 100% rename from packages/docs/versioned_docs/version-1.0.3/intro.md rename to packages/docs/versioned_docs/version-v1/intro.md diff --git a/packages/docs/versioned_docs/version-1.0.3/why-to-use.md b/packages/docs/versioned_docs/version-v1/why-to-use.md similarity index 100% rename from packages/docs/versioned_docs/version-1.0.3/why-to-use.md rename to packages/docs/versioned_docs/version-v1/why-to-use.md diff --git a/packages/docs/versioned_sidebars/version-1.0.3-sidebars.json b/packages/docs/versioned_sidebars/version-v1-sidebars.json similarity index 100% rename from packages/docs/versioned_sidebars/version-1.0.3-sidebars.json rename to packages/docs/versioned_sidebars/version-v1-sidebars.json diff --git a/packages/docs/versions.json b/packages/docs/versions.json index 8bf8ec5..868a38e 100644 --- a/packages/docs/versions.json +++ b/packages/docs/versions.json @@ -1,3 +1 @@ -[ - "1.0.3" -] +["v1"]