diff --git a/.gitattributes b/.gitattributes index af3ad12..e3f08fc 100644 --- a/.gitattributes +++ b/.gitattributes @@ -2,3 +2,4 @@ /.yarn/releases/* binary /.yarn/plugins/**/* binary /.pnp.* binary linguist-generated +* text=auto eol=lf diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..1ae20e5 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,46 @@ +name: CI + +on: [pull_request, push] + +jobs: + typecheck: + name: Typecheck + runs-on: ubuntu-latest + steps: + - name: Check out the repo + uses: actions/checkout@v4 + with: + submodules: true + + - name: Setup Node.js environment + uses: actions/setup-node@v4 + with: + node-version: lts/* + cache: "yarn" + + - name: Install dependencies + run: yarn install --immutable --network-timeout 1000000 + + - name: Typecheck + run: yarn typecheck + + lint: + name: Lint + runs-on: ubuntu-latest + steps: + - name: Check out the repo + uses: actions/checkout@v4 + with: + submodules: true + + - name: Setup Node.js environment + uses: actions/setup-node@v4 + with: + node-version: lts/* + cache: "yarn" + + - name: Install dependencies + run: yarn install --immutable --network-timeout 1000000 + + - name: Lint + run: yarn lint diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..2422087 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,68 @@ +name: Release Workflow + +on: + workflow_dispatch: {} + release: + types: [published] + # This can be used to automatically publish nightlies at UTC nighttime + schedule: + - cron: "0 2 * * *" # run at 2 AM UTC + +jobs: + web: + name: Push website Docker image to registry + runs-on: ubuntu-latest + permissions: + packages: write + contents: read + steps: + - name: Check out the repo + uses: actions/checkout@v4 + with: + submodules: true + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v3 + with: + buildkitd-flags: --debug + + - name: Log in to the Container registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v5 + with: + images: | + ghcr.io/drop-OSS/drop + tags: | + type=schedule,pattern=nightly + type=semver,pattern=v{{version}} + type=semver,pattern=v{{major}}.{{minor}} + type=semver,pattern=v{{major}} + type=ref,event=branch,prefix=branch- + type=ref,event=pr + type=sha + # set latest tag for stable releases + type=raw,value=latest,enable=${{ github.event_name == 'release' && github.event.release.prerelease == false }} + + - name: Build and push image + id: build-and-push + uses: docker/build-push-action@v6 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + platforms: linux/amd64,linux/arm64 + cache-from: type=gha + cache-to: type=gha,mode=max diff --git a/.gitignore b/.gitignore index 915b82c..705c5c9 100644 --- a/.gitignore +++ b/.gitignore @@ -30,4 +30,7 @@ logs # deploy template deploy-template/* -!deploy-template/compose.yml \ No newline at end of file +!deploy-template/compose.yml + +# generated prisma client +/prisma/client \ No newline at end of file diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 37893f5..de22495 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -29,3 +29,26 @@ build: docker image tag $IMAGE_NAME $PUBLISH_LATEST_IMAGE_NAME docker push $PUBLISH_IMAGE_NAME $PUBLISH_LATEST_IMAGE_NAME fi + +build-arm64: + stage: build + image: arm64v8/docker:latest + tags: + - aarch64 + variables: + IMAGE_NAME: $CI_REGISTRY_IMAGE/$CI_COMMIT_REF_NAME:$CI_COMMIT_SHORT_SHA-arm64 + LATEST_IMAGE_NAME: $CI_REGISTRY_IMAGE/$CI_COMMIT_REF_NAME:latest-arm64 + PUBLISH_IMAGE_NAME: $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG-arm64 + PUBLISH_LATEST_IMAGE_NAME: $CI_REGISTRY_IMAGE:latest-arm64 + script: + - docker build -t $IMAGE_NAME . --platform=linux/arm64 + - docker image tag $IMAGE_NAME $LATEST_IMAGE_NAME + - docker push $IMAGE_NAME + - docker push $LATEST_IMAGE_NAME + - | + if [ $CI_COMMIT_TAG ]; then + docker image tag $IMAGE_NAME $PUBLISH_IMAGE_NAME + docker image tag $IMAGE_NAME $PUBLISH_LATEST_IMAGE_NAME + docker push $PUBLISH_IMAGE_NAME + docker push $PUBLISH_LATEST_IMAGE_NAME + fi diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..1e7121f --- /dev/null +++ b/.prettierignore @@ -0,0 +1 @@ +drop-base/ diff --git a/.vscode/settings.json b/.vscode/settings.json index 87ca8ef..e426a5e 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,18 +1,21 @@ { - "spellchecker.ignoreWordsList": [ - "mTLS", - "Wireguard" - ], - "sqltools.connections": [ - { - "previewLimit": 50, - "server": "localhost", - "port": 5432, - "driver": "PostgreSQL", - "name": "drop", - "database": "drop", - "username": "drop", - "password": "drop" - } - ] + "spellchecker.ignoreWordsList": ["mTLS", "Wireguard"], + "sqltools.connections": [ + { + "previewLimit": 50, + "server": "localhost", + "port": 5432, + "driver": "PostgreSQL", + "name": "drop", + "database": "drop", + "username": "drop", + "password": "drop" + } + ], + // allow autocomplete for ArkType expressions like "string | num" + "editor.quickSuggestions": { + "strings": "on" + }, + // prioritize ArkType's "type" for autoimports + "typescript.preferences.autoImportSpecifierExcludeRegexes": ["^(node:)?os$"] } diff --git a/.yarnrc b/.yarnrc deleted file mode 100644 index 9bcf946..0000000 --- a/.yarnrc +++ /dev/null @@ -1 +0,0 @@ -"@drop:registry" "https://lab.deepcore.dev/api/v4/projects/57/packages/npm/" diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f7a20b4..3d883ae 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -41,7 +41,8 @@ TODO: Add Troubleshooting If not, look at the [Troubleshooting](https://github.com/Drop-OSS/docs/Troubleshooting) page for instructions on how to gather data to better debug your problem. --> -If you cannot find an existing issue, you can go ahead and create an issue with as much + +If you cannot find an existing issue, you can go ahead and create an issue with as much detail as you can provide. It should include the data gathered as indicated above, along with the following: @@ -69,7 +70,8 @@ maintainers) by mentioning their GitHub handle (starting with `@`) in your messa ### Getting started You should be familiar with the basics of -[contributing on GitHub](https://help.github.com/articles/using-pull-requests) +[contributing on GitHub](https://help.github.com/articles/using-pull-requests) + @@ -95,8 +97,8 @@ maintainers) by mentioning their GitHub handle (starting with `@`) in your messa ### You have an addition -We are absolutely accepting more contributions or features to drop, but please, make sure -that it is reasonable. Contributions that only cover a very small niche are likely to not +We are absolutely accepting more contributions or features to drop, but please, make sure +that it is reasonable. Contributions that only cover a very small niche are likely to not be added. Please be so kind as to [search](#use-the-search-luke) for any pending, merged or rejected Pull Requests @@ -109,7 +111,7 @@ maintainers) by mentioning their GitHub handle (starting with `@`) in your messa For any extensive change, such as API changes, you will have to find testers to +1 your PR. ----- +--- ## Use the Search, Luke @@ -126,7 +128,7 @@ to be sure your contribution has not already come up. If all fails, your thing has probably not been reported yet, so you can go ahead and [create an issue](#reporting-issues) or [submit a PR](#submitting-pull-requests). ----- +--- ## Commit Guidelines @@ -161,11 +163,13 @@ type(scope)!: subject Examples: - Commit that changes the `git` plugin: + ``` feat(git): add alias for `git commit` ``` - Commit that changes many plugins: + ``` style: fix inline declaration of arrays ``` @@ -203,6 +207,7 @@ type(scope)!: subject Formatting tricks: the commit subject may contain: - Links to related issues or PRs by writing `#issue`. This will be highlighted by the changelog tool: + ``` feat(archlinux): add support for aura AUR helper (#9467) ``` @@ -219,7 +224,7 @@ Try to keep the first commit line short. It's harder to do using this commit sty concise, and if you need more space, you can use the commit body. Try to make sure that the commit subject is clear and precise enough that users will know what changed by just looking at the changelog. ----- +--- + ## Reference -This contributing guide is adapted from the -[oh-my-zsh contribution guide](https://github.com/ohmyzsh/ohmyzsh/blob/master/CONTRIBUTING.md). -If there are any issues with this, please email admin@deepcore.dev. \ No newline at end of file + +This contributing guide is adapted from the +[oh-my-zsh contribution guide](https://github.com/ohmyzsh/ohmyzsh/blob/master/CONTRIBUTING.md). +If there are any issues with this, please email admin@deepcore.dev. diff --git a/Dockerfile b/Dockerfile index 33e714a..128e0d0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,28 +1,30 @@ # pull pre-configured and updated build environment -FROM registry.deepcore.dev/drop-oss/drop-server-build-environment/main:latest AS build-system +FROM debian:testing-20250317-slim AS build-system -# setup workdir -RUN mkdir /build -WORKDIR /build +# setup workdir - has to be the same filepath as app because fuckin' Prisma +WORKDIR /app # install dependencies and build +RUN apt-get update -y +RUN apt-get install node-corepack -y RUN corepack enable COPY . . -RUN NUXT_TELEMETRY_DISABLED=1 yarn install +RUN NUXT_TELEMETRY_DISABLED=1 yarn install --network-timeout 1000000 +RUN NUXT_TELEMETRY_DISABLED=1 yarn prisma generate RUN NUXT_TELEMETRY_DISABLED=1 yarn build # create run environment for Drop FROM node:lts-slim AS run-system -RUN mkdir /app WORKDIR /app -COPY --from=build-system /build/.output ./app -COPY --from=build-system /build/prisma ./prisma -COPY --from=build-system /build/build ./startup +COPY --from=build-system /app/.output ./app +COPY --from=build-system /app/prisma ./prisma +COPY --from=build-system /app/package.json ./ +COPY --from=build-system /app/build ./startup # OpenSSL as a dependency for Drop (TODO: seperate build environment) RUN apt-get update -y && apt-get install -y openssl -RUN yarn global add prisma +RUN yarn global add prisma@6.7.0 CMD ["/app/startup/launch.sh"] \ No newline at end of file diff --git a/README.md b/README.md index 4916f96..69ae307 100644 --- a/README.md +++ b/README.md @@ -1,20 +1,16 @@
- +
-
- Contribution guide    - Our website    -
-
-
- -[![GitHub License](https://img.shields.io/github/license/Drop-OSS/drop-app)](LICENSE) -[![Gitlab Pipeline Status](https://img.shields.io/gitlab/pipeline-status/drop-oss%2Fdrop?gitlab_url=https%3A%2F%2Flab.deepcore.dev)](https://lab.deepcore.dev/drop-oss/drop/-/pipelines) -[![Discord](https://img.shields.io/discord/1291622805124812871?label=discord)](https://discord.gg/ZVGggfXN) -[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-%23FE5196?logo=conventionalcommits&logoColor=white)](https://conventionalcommits.org) +
# Drop +[![Website](https://img.shields.io/badge/website-000000?style=for-the-badge&logo=About.me&logoColor=white)](https://droposs.org) +[![Static Badge](https://img.shields.io/badge/FORUM-blue?style=for-the-badge)](https://forum.droposs.org) +[![GitHub License](https://img.shields.io/badge/AGPL--3.0-red?style=for-the-badge)](LICENSE) +[![Discord](https://img.shields.io/badge/Discord-5865F2?style=for-the-badge&logo=discord&logoColor=white)](https://discord.gg/ACq4qZp4a9) +[![Open Collective](https://img.shields.io/badge/OpenCollective-1F87FF?style=for-the-badge&logo=OpenCollective&logoColor=white)](https://opencollective.com/drop-oss) + Drop is an open-source game distribution platform, like GameVault or Steam. It's designed to distribute and shared DRM-free game quickly, all while being incredibly flexible, beautiful and fast. ## Philosophy @@ -32,16 +28,18 @@ To just deploy Drop, we've set up a simple docker compose file in deploy-templat 3. Edit the compose.yml file (`nano compose.yml`) and copy your GiamtBomb API Key into the GIANT_BOMB_API_KEY environment variable 4. Run `docker compose up -d` -Your drop server should now be running. To register the admin user, navigate to http://your.drop.server.ip:3000/register?id=admin +Your drop server should now be running. To register the admin user, navigate to http://your.drop.server.ip:3000/register?id=admin and fill in the required forms ### Adding a game + To add a game to the drop library, do as follows: + 1. Ensure that the current user owns the library folder with `sudo chown -R $(id -u $(whoami)) library` 2. `cd library` 3. `mkdir ` with the name of the game which you would like to register 4. `cd ` -5. `mkdir ` Upload files for the specific game version to this folder +5. `mkdir ` Upload files for the specific game version to this folder 6. Navigate to http://your.drop.server.ip:3000/ 7. Import game metadata (uses GiantBomb API Key) by selecting the game and specifying which entry to import 8. Navigate to http://your.drop.server.ip:3000/admin/library @@ -64,15 +62,16 @@ Drop uses a utility package called droplet that's written in Rust. It has builts Steps: +1. Run `git submodule update --init --recursive` to setup submodules 1. Copy the `.env.example` to `.env` and add your GiantBomb metadata key (more metadata providers coming) -2. Create the `.data` directory with `mkdir .data` -3. Ensure that your user owns the `.data` directory with `sudo chown -R $(id -u $(whoami))` -4. Open up a terminal and navigate to `dev-tools`, and run `docker compose up` -5. Open up another terminal in the root directory of the project and run `yarn` and then `yarn dev` to start the dev server +1. Create the `.data` directory with `mkdir .data` +1. Ensure that your user owns the `.data` directory with `sudo chown -R $(id -u $(whoami))` +1. Open up a terminal and navigate to `dev-tools`, and run `docker compose up` +1. Open up another terminal in the root directory of the project and run `yarn` and then `yarn dev` to start the dev server As part of the first-time bootstrap, Drop creates an invitation with the fixed id of 'admin'. So, to create an admin account, go to: -http://localhost:3000/register?id=admin +http://localhost:3000/auth/register?id=admin ## Contributing diff --git a/SECURITY.md b/SECURITY.md index b11f4ee..8fc42ef 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -1,4 +1,5 @@ # Security + To report a vulnerability, please DO NOT create an issue for it as this may lead to the vulnerability being exploited before it can be fixed. Instead, please email [security@deepcore.dev](mailto:security@deepcore.dev) diff --git a/app.vue b/app.vue index 5b6668f..c70e804 100644 --- a/app.vue +++ b/app.vue @@ -1,4 +1,5 @@ diff --git a/components/CreateCollectionModal.vue b/components/CreateCollectionModal.vue new file mode 100644 index 0000000..be4e806 --- /dev/null +++ b/components/CreateCollectionModal.vue @@ -0,0 +1,113 @@ + + + diff --git a/components/DeleteCollectionModal.vue b/components/DeleteCollectionModal.vue new file mode 100644 index 0000000..76e842c --- /dev/null +++ b/components/DeleteCollectionModal.vue @@ -0,0 +1,75 @@ + + + diff --git a/components/DeleteNewsModal.vue b/components/DeleteNewsModal.vue new file mode 100644 index 0000000..8f508d7 --- /dev/null +++ b/components/DeleteNewsModal.vue @@ -0,0 +1,81 @@ + + + diff --git a/components/Docs/Sidebar.vue b/components/Docs/Sidebar.vue deleted file mode 100644 index a8d1ed1..0000000 --- a/components/Docs/Sidebar.vue +++ /dev/null @@ -1,50 +0,0 @@ - - - diff --git a/components/Docs/SidebarNavItem.vue b/components/Docs/SidebarNavItem.vue deleted file mode 100644 index ae6e96a..0000000 --- a/components/Docs/SidebarNavItem.vue +++ /dev/null @@ -1,30 +0,0 @@ - - - diff --git a/components/DropLogo.vue b/components/DropLogo.vue new file mode 100644 index 0000000..8645c5b --- /dev/null +++ b/components/DropLogo.vue @@ -0,0 +1,14 @@ + diff --git a/components/DropWordmark.vue b/components/DropWordmark.vue new file mode 100644 index 0000000..ae9b39b --- /dev/null +++ b/components/DropWordmark.vue @@ -0,0 +1,18 @@ + diff --git a/components/GameCarousel.vue b/components/GameCarousel.vue index bf9da98..14ab80e 100644 --- a/components/GameCarousel.vue +++ b/components/GameCarousel.vue @@ -1,41 +1,70 @@