diff --git a/.env.local.example b/.env.example similarity index 100% rename from .env.local.example rename to .env.example diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml new file mode 100644 index 0000000..a1077ba --- /dev/null +++ b/.gitea/workflows/build.yml @@ -0,0 +1,28 @@ +name: Build and publish the docker image + +on: + push: + branches: ["custom"] + +env: + REGISTRY: git.ngn.tf + IMAGE: ${{gitea.repository}} + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: "https://github.com/actions/checkout@v4" + + - name: Login to container repo + uses: "https://github.com/docker/login-action@v1" + with: + registry: ${{env.REGISTRY}} + username: ${{gitea.actor}} + password: ${{secrets.PACKAGES_TOKEN}} + + - name: Build image + run: | + docker build . --tag ${{env.REGISTRY}}/${{env.IMAGE}}:latest + docker push ${{env.REGISTRY}}/${{env.IMAGE}}:latest diff --git a/.github/workflows/container-release.yml b/.github/workflows/container-release.yml deleted file mode 100644 index f5dad0b..0000000 --- a/.github/workflows/container-release.yml +++ /dev/null @@ -1,57 +0,0 @@ -name: Docker Image CI - -on: - push: - tags: - - 'v*' - workflow_dispatch: - -env: - REGISTRY: ghcr.io - USER: ${{ github.repository_owner }} - IMAGE_NAME: ${{ github.repository }} - -permissions: - contents: read - packages: write - -jobs: - build-push: - runs-on: ubuntu-latest - - steps: - - - name: Check Out Repo - uses: actions/checkout@v4 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - with: - # arm64 specific - platforms: arm64 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Login to registry - uses: docker/login-action@v3 - with: - registry: ${{ env.REGISTRY }} - username: ${{ env.USER }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Extract metadata (tags, labels) for Docker - id: meta - uses: docker/metadata-action@v5 - with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - - - name: Build and push Docker image - uses: docker/build-push-action@v6 - with: - context: . - push: true - file: ./Dockerfile - platforms: linux/amd64,linux/arm64 - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} diff --git a/.gitignore b/.gitignore index fdab8f5..85d08a1 100644 --- a/.gitignore +++ b/.gitignore @@ -24,7 +24,7 @@ yarn-error.log* .pnpm-debug.log* # local env files -.env*.local +.env # typescript *.tsbuildinfo @@ -33,10 +33,10 @@ next-env.d.ts #just dev stuff dev/* -# other lockfiles +# other lockfiles yarn.lock package-lock.json # docker docker-compose.yml -dump.rdb \ No newline at end of file +dump.rdb diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index 4342c4e..0000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,166 +0,0 @@ -# Changelog - -All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines. - -## [4.1.0](https://github.com/zyachel/libremdb/compare/v4.0.0...v4.1.0) (2024-12-15) - - -### Features - -* github workflow for building container images ([4caf603](https://github.com/zyachel/libremdb/commit/4caf603162e17b9bb5c58db004dabb580172e267)) - - -### Bug Fixes - -* **reviews:** revert implementation of reviews route ([1030798](https://github.com/zyachel/libremdb/commit/1030798a734c2fa1d123476b24810b953d02146e)) - -## [4.0.0](https://github.com/zyachel/libremdb/compare/v3.4.0...v4.0.0) (2024-08-24) - - -### ⚠ BREAKING CHANGES - -* **list:** will give 503 now - -### Bug Fixes - -* add disclaimer ([2626dfd](https://github.com/zyachel/libremdb/commit/2626dfd8ab75b6d05d20e92e8dc98be53017fe66)) -* **api:** fix reviews api ([1041de5](https://github.com/zyachel/libremdb/commit/1041de5439604baab5fbc113c31dbad3096a2945)) -* **cache:** make cache keys for review more distinctive ([324c138](https://github.com/zyachel/libremdb/commit/324c138ec49cd24e932f9b1f8569c22ca25ebc13)) -* **cleaners:** fix app crash ([333d3b1](https://github.com/zyachel/libremdb/commit/333d3b107e36a8455364e5e09fc6064a9745f3b9)) -* **error:** add sanity checks before error destructuring ([e320557](https://github.com/zyachel/libremdb/commit/e320557addd4f12f32a638f452a738b5a8f5aa32)) -* **list:** remove list route ([67891c7](https://github.com/zyachel/libremdb/commit/67891c765533791a1a276e0669358b935ef9f697)) - -## [3.4.0](https://github.com/zyachel/libremdb/compare/v3.3.1...v3.4.0) (2024-03-31) - - -### Features - -* **reviews:** add reviews route ([dc42b32](https://github.com/zyachel/libremdb/commit/dc42b3204caf843d0f07fa28572c5ed275bb601d)) - - -### Bug Fixes - -* **instances:** fix urls in instances.json ([3eb5178](https://github.com/zyachel/libremdb/commit/3eb517849f279b2453579d0b5c5000e803a13bca)) - -## [3.3.1](https://github.com/zyachel/libremdb/compare/v3.3.0...v3.3.1) (2024-01-06) - - -### Bug Fixes - -* **dockerfile:** fix failing docker build ([719f42b](https://github.com/zyachel/libremdb/commit/719f42b5e6f6bafc0807986b6198dbbe1cb271ab)) - -## [3.3.0](https://github.com/zyachel/libremdb/compare/v3.2.0...v3.3.0) (2023-12-07) - - -### Features - -* **api:** add a catch-all route ([9fdd731](https://github.com/zyachel/libremdb/commit/9fdd7311368411d59784977f77d1af103ae16543)) -* **api:** add api endpoints for dynamic routes ([19f1700](https://github.com/zyachel/libremdb/commit/19f1700a55867c1fb8d6c11431bd4557e7520de1)) - - -### Bug Fixes - -* **api:** refactor all endpoints a bit ([4dffbbc](https://github.com/zyachel/libremdb/commit/4dffbbc0ec870a8f9a56e4ee62e6a6c472552f6a)) -* **title:** fix title route crash ([a5b7d52](https://github.com/zyachel/libremdb/commit/a5b7d527833a67f40f992c13bbe391884c0d1f82)) - -## [3.2.0](https://github.com/zyachel/libremdb/compare/v3.1.1...v3.2.0) (2023-10-28) - - -### Features - -* **list:** add list route ([97f1432](https://github.com/zyachel/libremdb/commit/97f1432ac5d23206229d806b7cb3e04af6dec36f)) - -## [3.1.1](https://github.com/zyachel/libremdb/compare/v3.1.0...v3.1.1) (2023-10-14) - - -### Bug Fixes - -* **card:** fix long attributes in cards under 'Known For' section ([736d680](https://github.com/zyachel/libremdb/commit/736d6802430a3f4f364915f3df93fc548a51ebf1)) -* **error:** fix incorrect 'view on IMDb' link on error page ([0aea2f4](https://github.com/zyachel/libremdb/commit/0aea2f47dad6eb78e319ea1abd8c444f2cba4424)) -* **media proxy:** fix 304 response code with body error ([c610ef4](https://github.com/zyachel/libremdb/commit/c610ef4d1be39c122715a0eb200155537e7d6abf)) -* **name:** fix name route crash ([38ed0c6](https://github.com/zyachel/libremdb/commit/38ed0c62177532b93f61af4172ffa6e5b9995bdc)) -* **name:** fix route crash for some ids ([e91c313](https://github.com/zyachel/libremdb/commit/e91c313f127632f1bd44d190af71bc841bbe87b7)) -* **title:** fix a crash in title route ([21a1c83](https://github.com/zyachel/libremdb/commit/21a1c83d95b703fa08cdb96c206626f22d5366c9)) - -## [3.1.0](https://github.com/zyachel/libremdb/compare/v3.0.0...v3.1.0) (2023-05-21) - - -### Features - -* **cache:** implement caching of routes ([c53c88d](https://github.com/zyachel/libremdb/commit/c53c88db9bf98258547e2ca512f864800821cb1f)) - - -### Bug Fixes - -* **form:** fix hydration error ([8599ae2](https://github.com/zyachel/libremdb/commit/8599ae2c5ac11f2818f56c9f7de7666a38b4386c)) -* **name:** fix a couple of crashes in name and title route ([8d9b663](https://github.com/zyachel/libremdb/commit/8d9b6630a576b7e8331eb5431cd90d02733b4917)) - -## [3.0.0](https://github.com/zyachel/libremdb/compare/v2.4.0...v3.0.0) (2023-04-15) - - -### ⚠ BREAKING CHANGES - -* **title:** older versions won't work, at least for title route - -### Features - -* add info related to the current instance ([2c5d2f8](https://github.com/zyachel/libremdb/commit/2c5d2f86e46a52223f07d573b152bad5174ee2d9)) -* **route:** add name route ([75732e0](https://github.com/zyachel/libremdb/commit/75732e00869f9777e87e767a48648996345f02f7)) - - -### Bug Fixes - -* **title:** fix title page crash ([8ce02d0](https://github.com/zyachel/libremdb/commit/8ce02d02364c8e1f03a8b16594bc20ee6766a8c6)) - -# [2.4.0](https://github.com/zyachel/libremdb/compare/v2.3.1...v2.4.0) (2023-01-22) - - -### Bug Fixes - -* fix app crash ([71d1d5b](https://github.com/zyachel/libremdb/commit/71d1d5b34e2866729ae0c96c59ea51e8d1a3dcca)) - - -### Features - -* add error boundary ([5cc2ef0](https://github.com/zyachel/libremdb/commit/5cc2ef02cec0b31c5d449e189a054fbef5801f60)) - - - -## [2.3.1](https://github.com/zyachel/libremdb/compare/v2.3.0...v2.3.1) (2023-01-15) - - -### Bug Fixes - -* fix unseekable videos on webkit-based browsers ([a32785c](https://github.com/zyachel/libremdb/commit/a32785ce00b638e9079f0924fd9b00f98c077348)) - - - -# [2.3.0](https://github.com/zyachel/libremdb/compare/v2.2.2...v2.3.0) (2022-12-31) - - -### Bug Fixes - -* couple css improvements for webkit-based browsers ([81eaf2f](https://github.com/zyachel/libremdb/commit/81eaf2fd5e5980c0c4d59a8805cf541fa8fe51f9)) - - -### Features - -* **search:** add basic search functionality ([0cff34a](https://github.com/zyachel/libremdb/commit/0cff34a766b09ba17be2a89f6290889dbf225436)) - - - -## [2.2.2](https://github.com/zyachel/libremdb/compare/v2.2.1...v2.2.2) (2022-12-10) - - -### Bug Fixes - -* app crash on qutebrowser ([78b14ec](https://github.com/zyachel/libremdb/commit/78b14ec07955d29403b8b5ae0d449f38eea2bbc5)) - - - -## [2.2.1](https://github.com/zyachel/libremdb/compare/v2.2.0...v2.2.1) (2022-12-01) - - -### Bug Fixes - -* **title:** fix site crash ([dd75df0](https://github.com/zyachel/libremdb/commit/dd75df01eb7c03d8945a8bd20ed231a66bd88b8f)) diff --git a/Dockerfile b/Dockerfile index d52ac3f..9d7ba28 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,35 +1,33 @@ -# Thanks @yordis on Github! https://github.com/vercel/next.js/discussions/16995#discussioncomment-132339 - -# Install dependencies only when needed FROM node:lts-alpine AS deps -WORKDIR /opt/app +WORKDIR /app COPY package.json pnpm-lock.yaml ./ + RUN npm install -g pnpm RUN pnpm install --frozen-lockfile -# Rebuild the source code only when needed -# This is where because may be the case that you would try -# to build the app based on some `X_TAG` in my case (Git commit hash) -# but the code hasn't changed. FROM node:lts-alpine AS builder -ENV NODE_ENV=production -WORKDIR /opt/app -RUN npm install -g pnpm +WORKDIR /app COPY . . -COPY --from=deps /opt/app/node_modules ./node_modules +COPY --from=deps /app/node_modules ./node_modules + +ENV NODE_ENV=production + +RUN npm install -g pnpm RUN pnpm build -# Production image, copy all the files and run next -FROM gcr.io/distroless/nodejs18-debian11 AS runner -ARG X_TAG -WORKDIR /opt/app +FROM node:lts-alpine AS runner + +WORKDIR /app +COPY --from=builder /app/next.config.mjs ./ +COPY --from=builder /app/public ./public +COPY --from=builder /app/.next ./.next +COPY --from=builder /app/node_modules ./node_modules + +ENV NEXT_TELEMETRY_DISABLED=1 ENV NODE_ENV=production -COPY --from=builder /opt/app/next.config.mjs ./ -COPY --from=builder /opt/app/public ./public -COPY --from=builder /opt/app/.next ./.next -COPY --from=builder /opt/app/node_modules ./node_modules ENV HOST=0.0.0.0 ENV PORT=3000 -CMD ["./node_modules/next/dist/bin/next", "start"] \ No newline at end of file + +CMD ["./node_modules/next/dist/bin/next", "start"] diff --git a/LICENSE b/LICENSE.txt similarity index 100% rename from LICENSE rename to LICENSE.txt diff --git a/README.md b/README.md index 2e0e3f6..6d1c058 100644 --- a/README.md +++ b/README.md @@ -1,239 +1,5 @@ -# libremdb +# [ngn.tf] | libremdb -A free & open source IMDb front-end. +![](https://git.ngn.tf/ngn/libremdb/actions/workflows/build.yml/badge.svg) -Inspired by projects like [teddit](https://codeberg.org/teddit/teddit), [nitter](https://github.com/zedeus/nitter) and [many others](#similar-projects). - -| | | -| -------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------ | -| | | - ---- - -## Some Features - -- No ads or tracking - Browse any movie info without being tracked or bombarded by annoying ads. -- Modern interface - Modern interface with curated colors supporting both dark and light themes. -- Responsive design - Be it your small mobile or big computer screen, it's fully responsive. -- Lightweight - _[Up movie page](https://imdb.com/title/tt1049413/)_ - (tested on Firefox v104; without scroll; simulated regular 4g) - - | Network tab stats | libremdb | IMDb | - | ------------------------ | -------- | ------ | - | no. of requests | 22 | 180 | - | data transfered(gzipped) | 468KB | 1.88MB | - | load event fired in | 6.22s | 10.01s | - ---- - -## Instances - -| Instance | Tor | I2P | Region | Cloudflare | Notes | -| ---------------------------------------- | -------------------------------------------------------------------------------------- | --------------------------------------------------------------------------- | ------- | ---------- | ------------------------------------------------------------------ | -| | No | No | CA | No | Operated by me | -| | No | No | DE | No | Operated by [PussTheCat.org](https://pussthecat.org/) | -| | [Yes](http://ld.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion/) | [Yes](http://vernz3ubrntql4wrgyrssd6u3qzi36zrhz2agbo6vibzbs5olk2q.b32.i2p/) | US | No | Operated by [~vern](https://vern.cc/) | -| | No | No | US/DE | No | Operated by [Whatever Social](https://whatever.social/) | -| | No | No | DE | No | Operated by [lunar.icu](https://lunar.icu/) | -| | No | No | DE | Yes | Operated by [shindouj](https://github.com/shindouj/) | -| | No | No | FR | No | Operated by [Hostux.net](https://hostux.net/) | -| | No | No | DE | Yes | Operated by [WhateverItWorks](https://github.com/WhateverItWorks/) | -| | No | No | US | Yes | Operated by [Nerdyfam.tech](https://nerdyfam.tech/) | -| | No | No | US | No | Operated by [tux.pizza](https://tux.pizza/) | -| | No | No | — | No | Operated by [frontendfriendly.xyz](https://frontendfriendly.xyz/) | -| | No | No | SG | No | Operated by [Opnxng](https://about.opnxng.com/) | -| | [Yes](https://libremdb.catsarchywsyuss6jdxlypsw5dc7owd5u5tr6bujxb7o6xw2hipqehyd.onion) | [Yes](http://qjlgasoy3nxepgzntucmcnb6pryqxakwdu7sxvqzi7spdfootryq.b32.i2p/) | US | No | Operated by [Butter Cat](https://catsarch.com/) | -| | [Yes](http://libremdb.r4focoma7gu2zdwwcjjad47ysxt634lg73sxmdbkdozanwqslho5ohyd.onion/) | No | NL | No | Operated by [r4fo](https://r4fo.com/) | -| | [Yes](http://libremdb.g4c3eya4clenolymqbpgwz3q3tawoxw56yhzk4vugqrl6dtu3ejvhjid.onion/) | No | FR | No | Operated by [PrivacyDev](https://privacydev.net/) | -| | No | No | NL | No | Operated by [ducks.party](https://ducks.party/) | -| | No | No | TR | No | Operated by [ngn](https://ngn.tf/) | -| | No | No | DE | No | Operated by [bloat.cat](https://bloat.cat/) | -| | No | No | US | Yes | Operated by [blade10101](https://github.com/blade10101) | -| | No | No | US | No | Operated by [hyperreal64](https://github.com/hyperreal64) | -| | [Yes](http://q3hetdcyyy572xznqmsledzlbv77moycoqs6ptehpp5vsmx4dtcuqeqd.onion/) | [Yes](http://5j37qusybvyhecljn4hr5i4chifdlfqfkfveythzpzyfxiibt7cq.b32.i2p/) | CA | No | Operated by [Troughy](https://zorby.top/) | -| | No | No | UA | No | Operated by [Weidenwiesel](https://nerdvpn.de/) | -| | No | No | US | No | Operated by [canine.tools](https://canine.tools/) | -| | No | No | US | No | Operated by [jodanjodan](https://github.com/JodanJodan) | - -Instances list in JSON format can be found in [instances.json](instances.json) file. - ---- - -## Questions you might have - -- How do I use it? - Replace `imdb.com` in any IMDb URL with any of the instances. For example: '[imdb.com/title/tt1049413](https://imdb.com/title/tt1049413/)' to '[libremdb.iket.me/title/tt1049413](https://libremdb.iket.me/title/tt1049413/)'. - To avoid changing the URLs manually, you can use [extensions](#automatic-redirection). - -- Why is it so slow? - Whenever you request info about a movie/show on libremdb, 4 trips are made(2 between your browser and libremdb's server, and 2 between libremdb's server and IMDb's server) instead of the usual 2 trips when you visit a website. For this reason there's a noticable delay. This is a bit of inconvenience you'll have to face should you wish to use this website. - -- It doesn't have all routes. - I'll implement more with time :) - -- Is content served from third-parties, like Amazon? - Nope, libremdb proxies all image and video requests through the instance to avoid exposing your IP address, browser information and other personally identifiable metadata ([Contributor](https://github.com/httpjamesm)). - -- Why not just use IMDb? - Refer to the [features section](#some-features) above. - -- Why didn't you use other databases like [TMDB](https://www.themoviedb.org/) or [OMDb](https://www.omdbapi.com/)? - IMDb simply has superior dataset compared to all other alternatives. With that being said, I'd encourage you to check out those alternatives too. - ---- - -## Privacy - -- Information collected: - None. - -- Information stored in your browser: - A key named 'theme' is stored in Local Storage provided by your browser, if you ever override the default theme. To remove it, go to site data settings, and clear the data for this website. To permamently disable libremdb from storing your theme prefrences, either turn off JavaScript or disable access to Local Storage for libremdb. - -- Information collected by other services: - None. libremdb proxies images anonymously through the instance for maximum privacy ([Contributor](https://github.com/httpjamesm)). - ---- - -## To-Do - -- [ ] add advanced search route -- [x] add did you know and reviews on movie info page -- [x] add a way to see trailer and other videos -- [ ] implement movie specific routes like: - - - [ ] reviews(including critic reviews) - - [ ] video & image gallery - - [ ] sections under 'did you know' - - [ ] release info - - [ ] parental guide - -- [ ] implement other routes like: - - - [ ] lists - - [ ] moviemeter - - [x] person info(includes directors and actors) - - [ ] company info - - [ ] user info - -- [x] use redis, or any other caching strategy -- [x] implement a better installation method -- [x] serve images and videos from libremdb itself - ---- - -## Installation - -As libremdb is made with Next.js, you can deploy it anywhere where Next.js is supported. Below are a few other methods: - -### Manual - -1. Install Node.js and Git. - for Node.js, visit [their website](https://nodejs.org/en/). - for Git, run `sudo apt install git` if you're on a Debian-based distro. Else visit [their website](https://git-scm.com/). - -2. Install redis(optional). - You can install redis from [here](https://redis.io). - -3. Clone and set up the repo. - - ```bash - git clone https://github.com/zyachel/libremdb.git # replace github.com with codeberg.org if you wish so. - cd libremdb - # change the configuration file to your liking. - cp .env.local.example .env.local - # replace 'pnpm' with yarn or npm if you use those. - pnpm install - pnpm build - pnpm start - # optional: if you're using redis - redis-server - ``` - -libremdb will start running at http://localhost:3000. -To change port, modify the last command like this: `pnpm start -- -p `. - -### Docker (Local) - -You can build the docker image using the provided Dockerfile(thanks to [@httpjamesm](https://github.com/httpjamesm)) and set it up using the [example docker-compose file](./docker-compose.example.yml). - -Change the docker-compose file to your liking and run `docker-compose up -d` to start the container, that's all! - -### Docker (Built) - -Use the pre-built images from github packages using `docker pull ghcr.io/zyachel/libremdb:latest` to pull latest images. - -To run the container with pulled image use the following command. -> Note: Env file is required for running this image. Download and edit this [env file](https://github.com/zyachel/libremdb/blob/main/.env.local.example). - - -```sh -docker/podman run \ - --detach \ - --name "libremdb" \ - -p 3000:3000 \ - --env-file "path_to_env_file" \ - ghcr.io/zyachel/libremdb:latest -``` - -OR - -There's a [docker image](https://github.com/PussTheCat-org/docker-libremdb-quay) made by [@TheFrenchGhosty](https://github.com/TheFrenchGhosty) for [PussTheCat.org's instance](https://libremdb.pussthecat.org). You can use that as well. - -## Miscellaneous - -### Automatic redirection - -- [Redirector](https://github.com/einaregilsson/Redirector) - config: - - ``` - Description: redirect IMDb to libremdb - Example URL: https://www.imdb.com/title/tt0258463/?ref_=tt_sims_tt_t_4 - Include pattern: https?:\/\/(www\.)?imdb\.com\/(.*) - Redirect to: https://libremdb.iket.me/$2 - Pattern type: Regular Expression - ``` - -- [LibRedirect](https://github.com/libredirect/libredirect/) - -- [Privacy Redirector](https://github.com/dybdeskarphet/privacy-redirector) - -### Similar projects - -- [Teddit](https://codeberg.org/teddit/teddit) - Teddit is an alternative Reddit front-end focused on privacy. -- [Nitter](https://github.com/zedeus/nitter) - Nitter is a free and open source alternative Twitter front-end focused on privacy. -- [Bibliogram](https://sr.ht/~cadence/bibliogram/) - Bibliogram is an alternative front-end for Instagram. -- [Invidious](https://invidious.io) - Invidious is an alternative front-end to YouTube. -- [Libreddit](https://github.com/spikecodes/libreddit) - Libreddit is an alternative private front-end to Reddit. -- [Scribe](https://git.sr.ht/~edwardloveall/scribe) - Scribe is an alternative Medium frontend. -- [full list →](https://github.com/digitalblossom/alternative-frontends) - ---- - -## Contact - -I'm availabe on [[matrix]](https://matrix.to/#/@ninal:matrix.org) and [email](mailto:aricla@protonmail.com) in case you wish to contact me personally. - ---- - -## License - -Licensed under GNU AGPLv3. -See [License](./LICENSE) for full legalese. - ---- - -## Disclaimer - -_libremdb does not host any content. All content on libremdb is from IMDb. IMDb is a trademark of IMDb.com, Inc._ +A fork of the [libremdb](https://github.com/zyachel/libremdb) project, with my personal changes. diff --git a/docker-compose.example.yml b/docker-compose.example.yml index 824f505..14403e5 100644 --- a/docker-compose.example.yml +++ b/docker-compose.example.yml @@ -1,47 +1,31 @@ -# docker-compose.yml - -version: '3' - services: libremdb: container_name: libremdb - build: - context: . - dockerfile: Dockerfile + image: git.ngn.tf/ngn/libremdb ports: - - "3000:3000" - env_file: .env.local.example + - 80:3000 + env_file: .env.example depends_on: - - libremdb-redis - restart: always + - libremdb-redis + tmpfs: + - /opt/app/.next/cache/:size=10M,mode=0770,uid=65534,gid=65534,noexec,nosuid,nodev + security_opt: + - no-new-privileges:true + cap_drop: + - ALL user: 65534:65534 # equivalent to the nobody user read_only: true - tmpfs: - - /opt/app/.next/cache/:size=10M,mode=0770,uid=65534,gid=65534,noexec,nosuid,nodev - security_opt: - - no-new-privileges:true - cap_drop: - - ALL - networks: - - libremdb + restart: unless-stopped - libremdb-redis: + libremdb_redis: container_name: libremdb_redis image: redis - # FOR DEBUGGING ONLY - # ports: - # - "6379:6379" - restart: always user: nobody - read_only: true - security_opt: - - no-new-privileges:true tmpfs: - - /data:size=10M,mode=0770,uid=65534,gid=65534,noexec,nosuid,nodev + - /data:size=10M,mode=0770,uid=65534,gid=65534,noexec,nosuid,nodev + security_opt: + - no-new-privileges:true cap_drop: - - ALL - networks: - - libremdb - -networks: - libremdb: \ No newline at end of file + - ALL + read_only: true + restart: unless-stopped diff --git a/src/components/buttons/ThemeToggler.tsx b/src/components/buttons/ThemeToggler.tsx deleted file mode 100644 index 8488c73..0000000 --- a/src/components/buttons/ThemeToggler.tsx +++ /dev/null @@ -1,34 +0,0 @@ -import { useContext } from 'react'; -import { themeContext } from 'src/context/theme-context'; -import styles from 'src/styles/modules/components/buttons/themeToggler.module.scss'; - -type Props = { - className: string; -}; - -const ThemeToggler = (props: Props) => { - const { theme, setTheme } = useContext(themeContext); - const clickHandler = () => { - const themeToSet = theme === 'light' ? 'dark' : 'light'; - setTheme(themeToSet); - }; - - return ( - - ); -}; - -export default ThemeToggler; diff --git a/src/components/layout/Footer.tsx b/src/components/layout/Footer.tsx index 15a6a65..872616f 100644 --- a/src/components/layout/Footer.tsx +++ b/src/components/layout/Footer.tsx @@ -27,6 +27,9 @@ const Footer = () => { +
  • + | +
  • ))}
  • @@ -35,10 +38,6 @@ const Footer = () => {
  • - - libremdb does not host any content. All content on libremdb is from IMDb. IMDb is a - trademark of IMDb.com, Inc. - ); }; diff --git a/src/components/layout/Header.tsx b/src/components/layout/Header.tsx index 5154742..9bb04bc 100644 --- a/src/components/layout/Header.tsx +++ b/src/components/layout/Header.tsx @@ -1,5 +1,4 @@ import Link from 'next/link'; -import ThemeToggler from 'src/components/buttons/ThemeToggler'; import styles from 'src/styles/modules/layout/header.module.scss'; type Props = { full?: boolean; originalPath?: string }; @@ -52,7 +51,6 @@ const Header = ({ full, originalPath }: Props) => { - {full && ( diff --git a/src/components/layout/index.tsx b/src/components/layout/index.tsx index d26e019..4c50383 100644 --- a/src/components/layout/index.tsx +++ b/src/components/layout/index.tsx @@ -1,5 +1,4 @@ import { ReactNode } from 'react'; -import Footer from './Footer'; import Header from './Header'; type Props = { @@ -16,7 +15,6 @@ const Layout = ({ full, children, className, originalPath }: Props) => {
    {children}
    -