mirror of
https://github.com/mCaptcha/mCaptcha.git
synced 2026-02-13 11:05:40 +00:00
Compare commits
1 Commits
fix-docker
...
dependabot
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
eef119f523 |
@@ -12,4 +12,3 @@ src/cache_buster_data.json
|
|||||||
browser/target
|
browser/target
|
||||||
browser/cobertura.xml
|
browser/cobertura.xml
|
||||||
browser/docs
|
browser/docs
|
||||||
**/target
|
|
||||||
|
|||||||
54
.github/workflows/clippy-fmt.yml
vendored
54
.github/workflows/clippy-fmt.yml
vendored
@@ -12,21 +12,54 @@ jobs:
|
|||||||
fmt:
|
fmt:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v2
|
||||||
# Ensure rustfmt is installed and setup problem matcher
|
- name: ⚡ Cache
|
||||||
- uses: actions-rust-lang/setup-rust-toolchain@v1
|
uses: actions/cache@v2
|
||||||
with:
|
with:
|
||||||
|
path: |
|
||||||
|
~/.cargo/registry
|
||||||
|
~/.cargo/git
|
||||||
|
node_modules
|
||||||
|
./docs/openapi/node_modules
|
||||||
|
target
|
||||||
|
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
||||||
|
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Install Rust
|
||||||
|
uses: actions-rs/toolchain@v1
|
||||||
|
with:
|
||||||
|
toolchain: stable
|
||||||
components: rustfmt
|
components: rustfmt
|
||||||
- name: Rustfmt Check
|
- name: Check with rustfmt
|
||||||
uses: actions-rust-lang/rustfmt@v1
|
uses: actions-rs/cargo@v1
|
||||||
|
with:
|
||||||
|
command: fmt
|
||||||
|
args: --all -- --check
|
||||||
|
|
||||||
clippy:
|
clippy:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v2
|
||||||
- uses: actions-rust-lang/setup-rust-toolchain@v1
|
- name: ⚡ Cache
|
||||||
|
uses: actions/cache@v2
|
||||||
with:
|
with:
|
||||||
|
path: |
|
||||||
|
~/.cargo/registry
|
||||||
|
~/.cargo/git
|
||||||
|
node_modules
|
||||||
|
./docs/openapi/node_modules
|
||||||
|
target
|
||||||
|
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
||||||
|
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Install Rust
|
||||||
|
uses: actions-rs/toolchain@v1
|
||||||
|
with:
|
||||||
|
toolchain: stable
|
||||||
components: clippy
|
components: clippy
|
||||||
|
override: true
|
||||||
|
|
||||||
- uses: actions/setup-node@v2
|
- uses: actions/setup-node@v2
|
||||||
with:
|
with:
|
||||||
@@ -35,5 +68,8 @@ jobs:
|
|||||||
- name: Build frontend
|
- name: Build frontend
|
||||||
run: make frontend
|
run: make frontend
|
||||||
|
|
||||||
- name: clippy Check
|
- name: Check with Clippy
|
||||||
run: cargo clippy --workspace --tests --all-features
|
uses: actions-rs/clippy-check@v1
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
args: --workspace --tests --all-features
|
||||||
|
|||||||
20
.github/workflows/coverage.yml
vendored
20
.github/workflows/coverage.yml
vendored
@@ -68,7 +68,18 @@ jobs:
|
|||||||
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v2
|
||||||
|
- name: ⚡ Cache
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
~/.cargo/registry
|
||||||
|
~/.cargo/git
|
||||||
|
node_modules
|
||||||
|
./docs/openapi/node_modules
|
||||||
|
target
|
||||||
|
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
||||||
|
|
||||||
|
|
||||||
- name: load env
|
- name: load env
|
||||||
run: |
|
run: |
|
||||||
@@ -81,7 +92,12 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
node-version: "18.0.0"
|
node-version: "18.0.0"
|
||||||
|
|
||||||
- uses: actions-rust-lang/setup-rust-toolchain@v1
|
- name: Install ${{ matrix.version }}
|
||||||
|
uses: actions-rs/toolchain@v1
|
||||||
|
with:
|
||||||
|
toolchain: ${{ matrix.version }}-x86_64-unknown-linux-gnu
|
||||||
|
profile: minimal
|
||||||
|
override: true
|
||||||
|
|
||||||
- name: Build frontend
|
- name: Build frontend
|
||||||
run: make frontend
|
run: make frontend
|
||||||
|
|||||||
38
.github/workflows/linux.yml
vendored
38
.github/workflows/linux.yml
vendored
@@ -9,7 +9,7 @@ on:
|
|||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
- "*"
|
- "*"
|
||||||
- "!gh-pages"
|
- '!gh-pages'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build_and_test:
|
build_and_test:
|
||||||
@@ -17,7 +17,9 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
version:
|
version:
|
||||||
|
#- 1.51.0
|
||||||
- stable
|
- stable
|
||||||
|
# - nightly
|
||||||
|
|
||||||
name: ${{ matrix.version }} - x86_64-unknown-linux-gnu
|
name: ${{ matrix.version }} - x86_64-unknown-linux-gnu
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -53,7 +55,7 @@ jobs:
|
|||||||
|
|
||||||
maria:
|
maria:
|
||||||
image: mariadb:10
|
image: mariadb:10
|
||||||
env:
|
env:
|
||||||
MARIADB_USER: "maria"
|
MARIADB_USER: "maria"
|
||||||
MARIADB_PASSWORD: "password"
|
MARIADB_PASSWORD: "password"
|
||||||
MARIADB_ROOT_PASSWORD: "password"
|
MARIADB_ROOT_PASSWORD: "password"
|
||||||
@@ -67,17 +69,17 @@ jobs:
|
|||||||
- 3306:3306
|
- 3306:3306
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v2
|
||||||
#- name: ⚡ Cache
|
- name: ⚡ Cache
|
||||||
# uses: actions/cache@v2
|
uses: actions/cache@v2
|
||||||
# with:
|
with:
|
||||||
# path: |
|
path: |
|
||||||
# ~/.cargo/registry
|
~/.cargo/registry
|
||||||
# ~/.cargo/git
|
~/.cargo/git
|
||||||
# node_modules
|
node_modules
|
||||||
# ./docs/openapi/node_modules
|
./docs/openapi/node_modules
|
||||||
# target
|
target
|
||||||
# key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
||||||
|
|
||||||
- name: configure GPG key
|
- name: configure GPG key
|
||||||
if: (github.ref == 'refs/heads/master' || github.event_name == 'push') && github.repository == 'mCaptcha/mCaptcha'
|
if: (github.ref == 'refs/heads/master' || github.event_name == 'push') && github.repository == 'mCaptcha/mCaptcha'
|
||||||
@@ -95,7 +97,12 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
node-version: "18.0.0"
|
node-version: "18.0.0"
|
||||||
|
|
||||||
- uses: actions-rust-lang/setup-rust-toolchain@v1
|
- name: Install ${{ matrix.version }}
|
||||||
|
uses: actions-rs/toolchain@v1
|
||||||
|
with:
|
||||||
|
toolchain: ${{ matrix.version }}-x86_64-unknown-linux-gnu
|
||||||
|
profile: minimal
|
||||||
|
override: true
|
||||||
|
|
||||||
- name: install nightwatch dep
|
- name: install nightwatch dep
|
||||||
run: sudo apt-get install xvfb
|
run: sudo apt-get install xvfb
|
||||||
@@ -110,8 +117,7 @@ jobs:
|
|||||||
run: make
|
run: make
|
||||||
env:
|
env:
|
||||||
POSTGRES_DATABASE_URL: "${{ env.POSTGRES_DATABASE_URL }}"
|
POSTGRES_DATABASE_URL: "${{ env.POSTGRES_DATABASE_URL }}"
|
||||||
MARIA_DATABASE_URL:
|
MARIA_DATABASE_URL: "${{ env.MARIA_DATABASE_URL }}"
|
||||||
"${{ env.MARIA_DATABASE_URL }}"
|
|
||||||
|
|
||||||
# - name: build frontend
|
# - name: build frontend
|
||||||
# run: make frontend
|
# run: make frontend
|
||||||
|
|||||||
20
Dockerfile
20
Dockerfile
@@ -1,6 +1,7 @@
|
|||||||
# SPDX-FileCopyrightText: 2023 Aravinth Manivannan <realaravinth@batsense.net>
|
# SPDX-FileCopyrightText: 2023 Aravinth Manivannan <realaravinth@batsense.net>
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||||
|
|
||||||
FROM node:18.0.0 as frontend
|
FROM node:18.0.0 as frontend
|
||||||
RUN set -ex; \
|
RUN set -ex; \
|
||||||
apt-get update; \
|
apt-get update; \
|
||||||
@@ -20,16 +21,33 @@ COPY Makefile /src/
|
|||||||
COPY scripts /src/scripts
|
COPY scripts /src/scripts
|
||||||
RUN make frontend
|
RUN make frontend
|
||||||
|
|
||||||
|
FROM rust:latest as planner
|
||||||
|
RUN cargo install cargo-chef
|
||||||
|
WORKDIR /src
|
||||||
|
COPY . /src/
|
||||||
|
RUN cargo chef prepare --recipe-path recipe.json
|
||||||
|
|
||||||
|
FROM rust:latest as cacher
|
||||||
|
WORKDIR /src/
|
||||||
|
RUN cargo install cargo-chef
|
||||||
|
COPY --from=planner /src/recipe.json recipe.json
|
||||||
|
RUN cargo chef cook --release --recipe-path recipe.json
|
||||||
|
|
||||||
FROM rust:latest as rust
|
FROM rust:latest as rust
|
||||||
WORKDIR /src
|
WORKDIR /src
|
||||||
COPY . .
|
COPY . .
|
||||||
|
COPY --from=cacher /src/target target
|
||||||
|
#COPY --from=cacher /src/db/db-core/target /src/db/db-core/target
|
||||||
|
#COPY --from=cacher /src/db/db-sqlx-postgres/target /src/db/db-sqlx-postgres/target
|
||||||
|
#COPY --from=cacher /src/db/db-migrations/target /src/db/db-migrations/target
|
||||||
|
#COPY --from=cacher /src/utils/cache-bust/target /src/utils/cache-bust/target
|
||||||
COPY --from=frontend /src/static/cache/bundle/ /src/static/cache/bundle/
|
COPY --from=frontend /src/static/cache/bundle/ /src/static/cache/bundle/
|
||||||
COPY --from=frontend /src/docs/openapi/dist/ /src/docs/openapi/dist/
|
COPY --from=frontend /src/docs/openapi/dist/ /src/docs/openapi/dist/
|
||||||
RUN cargo --version
|
RUN cargo --version
|
||||||
RUN make cache-bust
|
RUN make cache-bust
|
||||||
RUN cargo build --release
|
RUN cargo build --release
|
||||||
|
|
||||||
FROM debian:bookworm as mCaptcha
|
FROM debian:bullseye as mCaptcha
|
||||||
LABEL org.opencontainers.image.source https://github.com/mCaptcha/mCaptcha
|
LABEL org.opencontainers.image.source https://github.com/mCaptcha/mCaptcha
|
||||||
RUN useradd -ms /bin/bash -u 1001 mcaptcha
|
RUN useradd -ms /bin/bash -u 1001 mcaptcha
|
||||||
WORKDIR /home/mcaptcha
|
WORKDIR /home/mcaptcha
|
||||||
|
|||||||
12
package-lock.json
generated
12
package-lock.json
generated
@@ -8366,9 +8366,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/postcss": {
|
"node_modules/postcss": {
|
||||||
"version": "8.4.24",
|
"version": "8.4.31",
|
||||||
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.24.tgz",
|
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.31.tgz",
|
||||||
"integrity": "sha512-M0RzbcI0sO/XJNucsGjvWU9ERWxb/ytp1w6dKtxTKgixdtQDq4rmx/g8W1hnaheq9jgwL/oyEdH5Bc4WwJKMqg==",
|
"integrity": "sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@@ -17362,9 +17362,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"postcss": {
|
"postcss": {
|
||||||
"version": "8.4.24",
|
"version": "8.4.31",
|
||||||
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.24.tgz",
|
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.31.tgz",
|
||||||
"integrity": "sha512-M0RzbcI0sO/XJNucsGjvWU9ERWxb/ytp1w6dKtxTKgixdtQDq4rmx/g8W1hnaheq9jgwL/oyEdH5Bc4WwJKMqg==",
|
"integrity": "sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"nanoid": "^3.3.6",
|
"nanoid": "^3.3.6",
|
||||||
|
|||||||
@@ -4317,9 +4317,9 @@ postcss-value-parser@^4.1.0, postcss-value-parser@^4.2.0:
|
|||||||
integrity sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==
|
integrity sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==
|
||||||
|
|
||||||
postcss@^8.4.21, postcss@^8.4.24:
|
postcss@^8.4.21, postcss@^8.4.24:
|
||||||
version "8.4.24"
|
version "8.4.31"
|
||||||
resolved "https://registry.npmjs.org/postcss/-/postcss-8.4.24.tgz"
|
resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.31.tgz#92b451050a9f914da6755af352bdc0192508656d"
|
||||||
integrity sha512-M0RzbcI0sO/XJNucsGjvWU9ERWxb/ytp1w6dKtxTKgixdtQDq4rmx/g8W1hnaheq9jgwL/oyEdH5Bc4WwJKMqg==
|
integrity sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==
|
||||||
dependencies:
|
dependencies:
|
||||||
nanoid "^3.3.6"
|
nanoid "^3.3.6"
|
||||||
picocolors "^1.0.0"
|
picocolors "^1.0.0"
|
||||||
|
|||||||
Reference in New Issue
Block a user