Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

Commit

Permalink
Merge branch 'master' into trolley-wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Geometrically authored Oct 10, 2023
2 parents 709cc5b + dfa43f3 commit de262bc
Show file tree
Hide file tree
Showing 97 changed files with 9,602 additions and 7,865 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ BEEHIIV_API_KEY=none

ANALYTICS_ALLOWED_ORIGINS='["http://127.0.0.1:3000", "http://localhost:3000", "https://modrinth.com", "https://www.modrinth.com", "*"]'

CLICKHOUSE_URL=http:/localhost:8123
CLICKHOUSE_URL=http://localhost:8123
CLICKHOUSE_USER=default
CLICKHOUSE_PASSWORD=
CLICKHOUSE_DATABASE=staging_ariadne
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ blank_issues_enabled: true
contact_links:
- name: Discord
about: Ask questions on our Discord Server.
url: https://discord.gg/modrinth-734077874708938864
url: https://discord.modrinth.com
- name: Roadmap
about: View our Roadmap. Please do not open issues for items on our roadmap.
url: https://roadmap.modrinth.com
Expand Down
24 changes: 19 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ on:
push:
branches: [master]
pull_request:
branches:
- master

env:
CARGO_TERM_COLOR: always
Expand All @@ -21,23 +23,34 @@ jobs:

steps:
- uses: actions/checkout@v2

# Start Docker Compose
- name: Start Docker Compose
run: docker-compose up -d

- uses: actions-rs/toolchain@v1
name: Install toolchain
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
- name: Cache build artifacts
id: cache-build

# Cache dependencies and build artifacts
- name: Cache build artifacts and dependencies
uses: actions/cache@v2
with:
path: target/**
key: ${{ runner.os }}-build-cache-${{ matrix.rust }}
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- uses: actions-rs/cargo@v1
with:
command: build
env:
SQLX_OFFLINE: true

- uses: actions-rs/cargo@v1
with:
command: test
Expand All @@ -50,4 +63,5 @@ jobs:
S3_URL: ${{ secrets.S3_URL }}
S3_REGION: ${{ secrets.S3_REGION }}
S3_BUCKET_NAME: ${{ secrets.S3_BUCKET_NAME }}
SQLX_OFFLINE: true
SQLX_OFFLINE: true
DATABASE_URL: postgresql://labrinth:labrinth@localhost/postgres
35 changes: 32 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 21 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ actix-multipart = "0.6.0"
actix-cors = "0.6.4"
actix-ws = "0.2.5"
actix-files = "0.6.2"
actix-web-prom = "0.7.0"

tokio = { version = "1.29.1", features = ["sync"] }
tokio-stream = "0.1.14"
Expand All @@ -37,7 +38,7 @@ hyper-tls = "0.5.0"
serde_json = "1.0"
serde = { version = "1.0", features = ["derive"] }
serde_with = "3.0.0"
chrono = { version = "0.4.26", features = ["serde"]}
chrono = { version = "0.4.26", features = ["serde"] }
yaserde = "0.8.0"
yaserde_derive = "0.8.0"
xml-rs = "0.8.15"
Expand Down Expand Up @@ -72,9 +73,21 @@ log = "0.4.19"
env_logger = "0.10.0"
thiserror = "1.0.41"

sqlx = { version = "0.6.3", features = ["offline", "runtime-tokio-rustls", "postgres", "chrono", "macros", "migrate", "decimal", "json"] }
rust_decimal = { version = "1.30.0", features = ["serde-with-float", "serde-with-str"] }
redis = { version = "0.23.0", features = ["tokio-comp", "ahash", "r2d2"]}
sqlx = { version = "0.6.3", features = [
"offline",
"runtime-tokio-rustls",
"postgres",
"chrono",
"macros",
"migrate",
"decimal",
"json",
] }
rust_decimal = { version = "1.30.0", features = [
"serde-with-float",
"serde-with-str",
] }
redis = { version = "0.23.0", features = ["tokio-comp", "ahash", "r2d2"] }
deadpool-redis = "0.12.0"
clickhouse = { version = "0.11.2", features = ["uuid", "time"] }
uuid = { version = "1.2.2", features = ["v4", "fast-rng", "serde"] }
Expand All @@ -91,4 +104,7 @@ color-thief = "0.2.2"

woothee = "0.13.0"

lettre = "0.10.4"
lettre = "0.10.4"

[dev-dependencies]
actix-http = "3.4.0"
37 changes: 37 additions & 0 deletions migrations/20230816085700_collections_and_more.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
CREATE TABLE collections (
id bigint PRIMARY KEY,
title varchar(255) NOT NULL,
description varchar(2048) NOT NULL,
user_id bigint REFERENCES users NOT NULL,
created timestamp with time zone NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated timestamp with time zone NOT NULL DEFAULT CURRENT_TIMESTAMP,

status varchar(64) NOT NULL DEFAULT 'listed',

icon_url varchar(2048) NULL,
color integer NULL
);

CREATE TABLE collections_mods (
collection_id bigint REFERENCES collections NOT NULL,
mod_id bigint REFERENCES mods NOT NULL,
PRIMARY KEY (collection_id, mod_id)
);

CREATE TABLE uploaded_images (
id bigint PRIMARY KEY,
url varchar(2048) NOT NULL,
size integer NOT NULL,
created timestamp with time zone NOT NULL DEFAULT CURRENT_TIMESTAMP,
owner_id bigint REFERENCES users NOT NULL,

-- Type of contextual association
context varchar(64) NOT NULL, -- project, version, thread_message, report, etc.

-- Only one of these should be set (based on 'context')
mod_id bigint NULL REFERENCES mods,
version_id bigint NULL REFERENCES versions,
thread_message_id bigint NULL REFERENCES threads_messages,
report_id bigint NULL REFERENCES reports

);
17 changes: 17 additions & 0 deletions migrations/20230913024611_organizations.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
CREATE TABLE organizations (
id bigint PRIMARY KEY,
title varchar(255) NOT NULL, -- also slug
description text NOT NULL,
created_at timestamp NOT NULL DEFAULT now(),
updated_at timestamp NOT NULL DEFAULT now(),
team_id bigint NOT NULL REFERENCES teams(id) ON UPDATE CASCADE,

icon_url varchar(255) NULL,
color integer NULL
);

ALTER TABLE mods ADD COLUMN organization_id bigint NULL REFERENCES organizations(id) ON DELETE SET NULL;

-- Organization permissions only apply to teams that are associated to an organization
-- If they do, 'permissions' is considered the fallback permissions for projects in the organization
ALTER TABLE team_members ADD COLUMN organization_permissions bigint NULL;
Loading

0 comments on commit de262bc

Please sign in to comment.