mirror of
https://git.deuxfleurs.fr/Deuxfleurs/garage.git
synced 2026-11-12 17:19:17 -05:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
713c61acb8 |
||
|
|
1c88ee9bc5 |
||
|
|
d768f559da |
||
|
|
99976e11f8 |
||
|
|
5367f8adb2 |
||
|
|
30e393b439 |
||
|
|
926b3c0fad |
||
|
|
dcfa408887 |
||
|
|
70383b4363 |
||
|
|
440a577563 |
||
|
|
5072dbd228 |
||
|
|
2ce3513c10 |
||
|
|
e92c52eb65 |
||
|
|
8b1338ef2f |
||
|
|
8ff95f09c9 |
||
|
|
86a3fe8ec5 |
||
|
|
ec50ffac42 |
||
|
|
d7736cb614 |
||
|
|
8033bdb0b4 |
||
|
|
5a535788fc |
||
|
|
ea325d78d3 |
||
|
|
ec16d166f9 |
||
|
|
7a5d329e49 |
||
|
|
f82b938033 |
||
|
|
96b11524d5 |
||
|
|
c0fb9fd0fe |
||
|
|
983037d965 |
||
|
|
e4e1f8f0d6 |
||
|
|
e7ddba53e3 |
||
|
|
ed76893581 |
||
|
|
fc2f73ddb5 |
||
|
|
fe399a3265 |
||
|
|
de1a5b87b6 |
||
|
|
2b93a01d2b |
||
|
|
aeb978552a |
||
|
|
393b76ecba |
||
|
|
5c00c9fb46 |
||
|
|
f97a7845e9 |
||
|
|
bb6ec9ebd9 |
||
|
|
dd54d0b2b1 |
||
|
|
01c4876fb4 |
||
|
|
e4c61124d8 |
||
|
|
ec03e3d16c |
||
|
|
7a19daafbd |
||
|
|
99fcfa3844 |
||
|
|
633958c7b1 |
701 changed files with 20213 additions and 133793 deletions
478
.drone.yml
Normal file
478
.drone.yml
Normal file
|
|
@ -0,0 +1,478 @@
|
||||||
|
---
|
||||||
|
kind: pipeline
|
||||||
|
name: default
|
||||||
|
|
||||||
|
workspace:
|
||||||
|
base: /drone/garage
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
- name: nix_store
|
||||||
|
host:
|
||||||
|
path: /var/lib/drone/nix
|
||||||
|
- name: nix_config
|
||||||
|
temp: {}
|
||||||
|
|
||||||
|
environment:
|
||||||
|
HOME: /drone/garage
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: setup nix
|
||||||
|
image: nixpkgs/nix:nixos-21.05
|
||||||
|
volumes:
|
||||||
|
- name: nix_store
|
||||||
|
path: /nix
|
||||||
|
- name: nix_config
|
||||||
|
path: /etc/nix
|
||||||
|
commands:
|
||||||
|
- cp nix/nix.conf /etc/nix/nix.conf
|
||||||
|
- nix-build --no-build-output --no-out-link shell.nix --arg release false -A inputDerivation
|
||||||
|
|
||||||
|
- name: code quality
|
||||||
|
image: nixpkgs/nix:nixos-21.05
|
||||||
|
volumes:
|
||||||
|
- name: nix_store
|
||||||
|
path: /nix
|
||||||
|
- name: nix_config
|
||||||
|
path: /etc/nix
|
||||||
|
commands:
|
||||||
|
- nix-shell --arg release false --run "cargo fmt -- --check"
|
||||||
|
- nix-shell --arg release false --run "cargo clippy -- --deny warnings"
|
||||||
|
|
||||||
|
- name: build
|
||||||
|
image: nixpkgs/nix:nixos-21.05
|
||||||
|
volumes:
|
||||||
|
- name: nix_store
|
||||||
|
path: /nix
|
||||||
|
- name: nix_config
|
||||||
|
path: /etc/nix
|
||||||
|
commands:
|
||||||
|
- nix-build --no-build-output --option log-lines 100 --argstr target x86_64-unknown-linux-musl --arg release false --argstr git_version $DRONE_COMMIT
|
||||||
|
|
||||||
|
- name: unit + func tests
|
||||||
|
image: nixpkgs/nix:nixos-21.05
|
||||||
|
environment:
|
||||||
|
GARAGE_TEST_INTEGRATION_EXE: result/bin/garage
|
||||||
|
volumes:
|
||||||
|
- name: nix_store
|
||||||
|
path: /nix
|
||||||
|
- name: nix_config
|
||||||
|
path: /etc/nix
|
||||||
|
commands:
|
||||||
|
- |
|
||||||
|
nix-build \
|
||||||
|
--no-build-output \
|
||||||
|
--option log-lines 100 \
|
||||||
|
--argstr target x86_64-unknown-linux-musl \
|
||||||
|
--argstr compileMode test
|
||||||
|
- ./result/bin/garage_api-*
|
||||||
|
- ./result/bin/garage_model-*
|
||||||
|
- ./result/bin/garage_rpc-*
|
||||||
|
- ./result/bin/garage_table-*
|
||||||
|
- ./result/bin/garage_util-*
|
||||||
|
- ./result/bin/garage_web-*
|
||||||
|
- ./result/bin/garage-*
|
||||||
|
- ./result/bin/integration-*
|
||||||
|
|
||||||
|
- name: smoke-test
|
||||||
|
image: nixpkgs/nix:nixos-21.05
|
||||||
|
volumes:
|
||||||
|
- name: nix_store
|
||||||
|
path: /nix
|
||||||
|
- name: nix_config
|
||||||
|
path: /etc/nix
|
||||||
|
commands:
|
||||||
|
- nix-build --no-build-output --argstr target x86_64-unknown-linux-musl --arg release false --argstr git_version $DRONE_COMMIT
|
||||||
|
- nix-shell --arg release false --run ./script/test-smoke.sh || (cat /tmp/garage.log; false)
|
||||||
|
|
||||||
|
trigger:
|
||||||
|
event:
|
||||||
|
- custom
|
||||||
|
- push
|
||||||
|
- pull_request
|
||||||
|
- tag
|
||||||
|
- cron
|
||||||
|
|
||||||
|
node:
|
||||||
|
nix: 1
|
||||||
|
|
||||||
|
---
|
||||||
|
kind: pipeline
|
||||||
|
type: docker
|
||||||
|
name: release-linux-x86_64
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
- name: nix_store
|
||||||
|
host:
|
||||||
|
path: /var/lib/drone/nix
|
||||||
|
- name: nix_config
|
||||||
|
temp: {}
|
||||||
|
|
||||||
|
environment:
|
||||||
|
TARGET: x86_64-unknown-linux-musl
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: setup nix
|
||||||
|
image: nixpkgs/nix:nixos-21.05
|
||||||
|
volumes:
|
||||||
|
- name: nix_store
|
||||||
|
path: /nix
|
||||||
|
- name: nix_config
|
||||||
|
path: /etc/nix
|
||||||
|
commands:
|
||||||
|
- cp nix/nix.conf /etc/nix/nix.conf
|
||||||
|
- nix-build --no-build-output --no-out-link shell.nix -A inputDerivation
|
||||||
|
|
||||||
|
- name: build
|
||||||
|
image: nixpkgs/nix:nixos-21.05
|
||||||
|
volumes:
|
||||||
|
- name: nix_store
|
||||||
|
path: /nix
|
||||||
|
- name: nix_config
|
||||||
|
path: /etc/nix
|
||||||
|
commands:
|
||||||
|
- nix-build --no-build-output --argstr target $TARGET --arg release true --argstr git_version $DRONE_COMMIT
|
||||||
|
|
||||||
|
- name: integration
|
||||||
|
image: nixpkgs/nix:nixos-21.05
|
||||||
|
volumes:
|
||||||
|
- name: nix_store
|
||||||
|
path: /nix
|
||||||
|
- name: nix_config
|
||||||
|
path: /etc/nix
|
||||||
|
commands:
|
||||||
|
- nix-shell --run ./script/test-smoke.sh || (cat /tmp/garage.log; false)
|
||||||
|
|
||||||
|
- name: push static binary
|
||||||
|
image: nixpkgs/nix:nixos-21.05
|
||||||
|
volumes:
|
||||||
|
- name: nix_store
|
||||||
|
path: /nix
|
||||||
|
- name: nix_config
|
||||||
|
path: /etc/nix
|
||||||
|
environment:
|
||||||
|
AWS_ACCESS_KEY_ID:
|
||||||
|
from_secret: garagehq_aws_access_key_id
|
||||||
|
AWS_SECRET_ACCESS_KEY:
|
||||||
|
from_secret: garagehq_aws_secret_access_key
|
||||||
|
commands:
|
||||||
|
- nix-shell --arg rust false --arg integration false --run "to_s3"
|
||||||
|
|
||||||
|
- name: docker build and publish
|
||||||
|
image: nixpkgs/nix:nixos-21.05
|
||||||
|
volumes:
|
||||||
|
- name: nix_store
|
||||||
|
path: /nix
|
||||||
|
- name: nix_config
|
||||||
|
path: /etc/nix
|
||||||
|
environment:
|
||||||
|
DOCKER_AUTH:
|
||||||
|
from_secret: docker_auth
|
||||||
|
DOCKER_PLATFORM: "linux/amd64"
|
||||||
|
CONTAINER_NAME: "dxflrs/amd64_garage"
|
||||||
|
HOME: "/kaniko"
|
||||||
|
commands:
|
||||||
|
- mkdir -p /kaniko/.docker
|
||||||
|
- echo $DOCKER_AUTH > /kaniko/.docker/config.json
|
||||||
|
- export CONTAINER_TAG=${DRONE_TAG:-$DRONE_COMMIT}
|
||||||
|
- nix-shell --arg rust false --arg integration false --run "to_docker"
|
||||||
|
|
||||||
|
|
||||||
|
trigger:
|
||||||
|
event:
|
||||||
|
- promote
|
||||||
|
- cron
|
||||||
|
|
||||||
|
node:
|
||||||
|
nix: 1
|
||||||
|
|
||||||
|
---
|
||||||
|
kind: pipeline
|
||||||
|
type: docker
|
||||||
|
name: release-linux-i686
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
- name: nix_store
|
||||||
|
host:
|
||||||
|
path: /var/lib/drone/nix
|
||||||
|
- name: nix_config
|
||||||
|
temp: {}
|
||||||
|
|
||||||
|
environment:
|
||||||
|
TARGET: i686-unknown-linux-musl
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: setup nix
|
||||||
|
image: nixpkgs/nix:nixos-21.05
|
||||||
|
volumes:
|
||||||
|
- name: nix_store
|
||||||
|
path: /nix
|
||||||
|
- name: nix_config
|
||||||
|
path: /etc/nix
|
||||||
|
commands:
|
||||||
|
- cp nix/nix.conf /etc/nix/nix.conf
|
||||||
|
- nix-build --no-build-output --no-out-link shell.nix -A inputDerivation
|
||||||
|
|
||||||
|
- name: build
|
||||||
|
image: nixpkgs/nix:nixos-21.05
|
||||||
|
volumes:
|
||||||
|
- name: nix_store
|
||||||
|
path: /nix
|
||||||
|
- name: nix_config
|
||||||
|
path: /etc/nix
|
||||||
|
commands:
|
||||||
|
- nix-build --no-build-output --argstr target $TARGET --arg release true --argstr git_version $DRONE_COMMIT
|
||||||
|
|
||||||
|
- name: integration
|
||||||
|
image: nixpkgs/nix:nixos-21.05
|
||||||
|
volumes:
|
||||||
|
- name: nix_store
|
||||||
|
path: /nix
|
||||||
|
- name: nix_config
|
||||||
|
path: /etc/nix
|
||||||
|
commands:
|
||||||
|
- nix-shell --run ./script/test-smoke.sh || (cat /tmp/garage.log; false)
|
||||||
|
|
||||||
|
- name: push static binary
|
||||||
|
image: nixpkgs/nix:nixos-21.05
|
||||||
|
volumes:
|
||||||
|
- name: nix_store
|
||||||
|
path: /nix
|
||||||
|
- name: nix_config
|
||||||
|
path: /etc/nix
|
||||||
|
environment:
|
||||||
|
AWS_ACCESS_KEY_ID:
|
||||||
|
from_secret: garagehq_aws_access_key_id
|
||||||
|
AWS_SECRET_ACCESS_KEY:
|
||||||
|
from_secret: garagehq_aws_secret_access_key
|
||||||
|
commands:
|
||||||
|
- nix-shell --arg rust false --arg integration false --run "to_s3"
|
||||||
|
|
||||||
|
- name: docker build and publish
|
||||||
|
image: nixpkgs/nix:nixos-21.05
|
||||||
|
volumes:
|
||||||
|
- name: nix_store
|
||||||
|
path: /nix
|
||||||
|
- name: nix_config
|
||||||
|
path: /etc/nix
|
||||||
|
environment:
|
||||||
|
DOCKER_AUTH:
|
||||||
|
from_secret: docker_auth
|
||||||
|
DOCKER_PLATFORM: "linux/386"
|
||||||
|
CONTAINER_NAME: "dxflrs/386_garage"
|
||||||
|
HOME: "/kaniko"
|
||||||
|
commands:
|
||||||
|
- mkdir -p /kaniko/.docker
|
||||||
|
- echo $DOCKER_AUTH > /kaniko/.docker/config.json
|
||||||
|
- export CONTAINER_TAG=${DRONE_TAG:-$DRONE_COMMIT}
|
||||||
|
- nix-shell --arg rust false --arg integration false --run "to_docker"
|
||||||
|
|
||||||
|
trigger:
|
||||||
|
event:
|
||||||
|
- promote
|
||||||
|
- cron
|
||||||
|
|
||||||
|
node:
|
||||||
|
nix: 1
|
||||||
|
|
||||||
|
---
|
||||||
|
kind: pipeline
|
||||||
|
type: docker
|
||||||
|
name: release-linux-aarch64
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
- name: nix_store
|
||||||
|
host:
|
||||||
|
path: /var/lib/drone/nix
|
||||||
|
- name: nix_config
|
||||||
|
temp: {}
|
||||||
|
|
||||||
|
environment:
|
||||||
|
TARGET: aarch64-unknown-linux-musl
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: setup nix
|
||||||
|
image: nixpkgs/nix:nixos-21.05
|
||||||
|
volumes:
|
||||||
|
- name: nix_store
|
||||||
|
path: /nix
|
||||||
|
- name: nix_config
|
||||||
|
path: /etc/nix
|
||||||
|
commands:
|
||||||
|
- cp nix/nix.conf /etc/nix/nix.conf
|
||||||
|
- nix-build --no-build-output --no-out-link ./shell.nix --arg rust false --arg integration false -A inputDerivation
|
||||||
|
|
||||||
|
- name: build
|
||||||
|
image: nixpkgs/nix:nixos-21.05
|
||||||
|
volumes:
|
||||||
|
- name: nix_store
|
||||||
|
path: /nix
|
||||||
|
- name: nix_config
|
||||||
|
path: /etc/nix
|
||||||
|
commands:
|
||||||
|
- nix-build --no-build-output --argstr target $TARGET --arg release true --argstr git_version $DRONE_COMMIT
|
||||||
|
|
||||||
|
- name: push static binary
|
||||||
|
image: nixpkgs/nix:nixos-21.05
|
||||||
|
volumes:
|
||||||
|
- name: nix_store
|
||||||
|
path: /nix
|
||||||
|
- name: nix_config
|
||||||
|
path: /etc/nix
|
||||||
|
environment:
|
||||||
|
AWS_ACCESS_KEY_ID:
|
||||||
|
from_secret: garagehq_aws_access_key_id
|
||||||
|
AWS_SECRET_ACCESS_KEY:
|
||||||
|
from_secret: garagehq_aws_secret_access_key
|
||||||
|
commands:
|
||||||
|
- nix-shell --arg rust false --arg integration false --run "to_s3"
|
||||||
|
|
||||||
|
- name: docker build and publish
|
||||||
|
image: nixpkgs/nix:nixos-21.05
|
||||||
|
volumes:
|
||||||
|
- name: nix_store
|
||||||
|
path: /nix
|
||||||
|
- name: nix_config
|
||||||
|
path: /etc/nix
|
||||||
|
environment:
|
||||||
|
DOCKER_AUTH:
|
||||||
|
from_secret: docker_auth
|
||||||
|
DOCKER_PLATFORM: "linux/arm64"
|
||||||
|
CONTAINER_NAME: "dxflrs/arm64_garage"
|
||||||
|
HOME: "/kaniko"
|
||||||
|
commands:
|
||||||
|
- mkdir -p /kaniko/.docker
|
||||||
|
- echo $DOCKER_AUTH > /kaniko/.docker/config.json
|
||||||
|
- export CONTAINER_TAG=${DRONE_TAG:-$DRONE_COMMIT}
|
||||||
|
- nix-shell --arg rust false --arg integration false --run "to_docker"
|
||||||
|
|
||||||
|
trigger:
|
||||||
|
event:
|
||||||
|
- promote
|
||||||
|
- cron
|
||||||
|
|
||||||
|
node:
|
||||||
|
nix: 1
|
||||||
|
|
||||||
|
---
|
||||||
|
kind: pipeline
|
||||||
|
type: docker
|
||||||
|
name: release-linux-armv6l
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
- name: nix_store
|
||||||
|
host:
|
||||||
|
path: /var/lib/drone/nix
|
||||||
|
- name: nix_config
|
||||||
|
temp: {}
|
||||||
|
|
||||||
|
environment:
|
||||||
|
TARGET: armv6l-unknown-linux-musleabihf
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: setup nix
|
||||||
|
image: nixpkgs/nix:nixos-21.05
|
||||||
|
volumes:
|
||||||
|
- name: nix_store
|
||||||
|
path: /nix
|
||||||
|
- name: nix_config
|
||||||
|
path: /etc/nix
|
||||||
|
commands:
|
||||||
|
- cp nix/nix.conf /etc/nix/nix.conf
|
||||||
|
- nix-build --no-build-output --no-out-link --arg rust false --arg integration false -A inputDerivation
|
||||||
|
|
||||||
|
- name: build
|
||||||
|
image: nixpkgs/nix:nixos-21.05
|
||||||
|
volumes:
|
||||||
|
- name: nix_store
|
||||||
|
path: /nix
|
||||||
|
- name: nix_config
|
||||||
|
path: /etc/nix
|
||||||
|
commands:
|
||||||
|
- nix-build --no-build-output --argstr target $TARGET --arg release true --argstr git_version $DRONE_COMMIT
|
||||||
|
|
||||||
|
- name: push static binary
|
||||||
|
image: nixpkgs/nix:nixos-21.05
|
||||||
|
volumes:
|
||||||
|
- name: nix_store
|
||||||
|
path: /nix
|
||||||
|
- name: nix_config
|
||||||
|
path: /etc/nix
|
||||||
|
environment:
|
||||||
|
AWS_ACCESS_KEY_ID:
|
||||||
|
from_secret: garagehq_aws_access_key_id
|
||||||
|
AWS_SECRET_ACCESS_KEY:
|
||||||
|
from_secret: garagehq_aws_secret_access_key
|
||||||
|
commands:
|
||||||
|
- nix-shell --arg integration false --arg rust false --run "to_s3"
|
||||||
|
|
||||||
|
- name: docker build and publish
|
||||||
|
image: nixpkgs/nix:nixos-21.05
|
||||||
|
volumes:
|
||||||
|
- name: nix_store
|
||||||
|
path: /nix
|
||||||
|
- name: nix_config
|
||||||
|
path: /etc/nix
|
||||||
|
environment:
|
||||||
|
DOCKER_AUTH:
|
||||||
|
from_secret: docker_auth
|
||||||
|
DOCKER_PLATFORM: "linux/arm"
|
||||||
|
CONTAINER_NAME: "dxflrs/arm_garage"
|
||||||
|
HOME: "/kaniko"
|
||||||
|
commands:
|
||||||
|
- mkdir -p /kaniko/.docker
|
||||||
|
- echo $DOCKER_AUTH > /kaniko/.docker/config.json
|
||||||
|
- export CONTAINER_TAG=${DRONE_TAG:-$DRONE_COMMIT}
|
||||||
|
- nix-shell --arg rust false --arg integration false --run "to_docker"
|
||||||
|
|
||||||
|
trigger:
|
||||||
|
event:
|
||||||
|
- promote
|
||||||
|
- cron
|
||||||
|
|
||||||
|
node:
|
||||||
|
nix: 1
|
||||||
|
|
||||||
|
---
|
||||||
|
kind: pipeline
|
||||||
|
type: docker
|
||||||
|
name: refresh-release-page
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
- name: nix_store
|
||||||
|
host:
|
||||||
|
path: /var/lib/drone/nix
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: refresh-index
|
||||||
|
image: nixpkgs/nix:nixos-21.05
|
||||||
|
volumes:
|
||||||
|
- name: nix_store
|
||||||
|
path: /nix
|
||||||
|
environment:
|
||||||
|
AWS_ACCESS_KEY_ID:
|
||||||
|
from_secret: garagehq_aws_access_key_id
|
||||||
|
AWS_SECRET_ACCESS_KEY:
|
||||||
|
from_secret: garagehq_aws_secret_access_key
|
||||||
|
commands:
|
||||||
|
- mkdir -p /etc/nix && cp nix/nix.conf /etc/nix/nix.conf
|
||||||
|
- nix-shell --arg integration false --arg rust false --run "refresh_index"
|
||||||
|
|
||||||
|
depends_on:
|
||||||
|
- release-linux-x86_64
|
||||||
|
- release-linux-i686
|
||||||
|
- release-linux-aarch64
|
||||||
|
- release-linux-armv6l
|
||||||
|
|
||||||
|
trigger:
|
||||||
|
event:
|
||||||
|
- promote
|
||||||
|
- cron
|
||||||
|
|
||||||
|
node:
|
||||||
|
nix: 1
|
||||||
|
|
||||||
|
---
|
||||||
|
kind: signature
|
||||||
|
hmac: 3fc19d6f9a3555519c8405e3281b2e74289bb802f644740d5481d53df3a01fa4
|
||||||
|
|
||||||
|
...
|
||||||
1
.envrc
1
.envrc
|
|
@ -1 +0,0 @@
|
||||||
use flake
|
|
||||||
1
.gitattributes
vendored
Normal file
1
.gitattributes
vendored
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
*.pdf filter=lfs diff=lfs merge=lfs -text
|
||||||
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -3,4 +3,3 @@
|
||||||
/pki
|
/pki
|
||||||
**/*.rs.bk
|
**/*.rs.bk
|
||||||
*.swp
|
*.swp
|
||||||
/.direnv
|
|
||||||
|
|
@ -1,44 +0,0 @@
|
||||||
labels:
|
|
||||||
nix: "enabled"
|
|
||||||
|
|
||||||
when:
|
|
||||||
event:
|
|
||||||
- push
|
|
||||||
- tag
|
|
||||||
- pull_request
|
|
||||||
- deployment
|
|
||||||
- cron
|
|
||||||
- manual
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: check formatting
|
|
||||||
image: nixpkgs/nix:nixos-24.05
|
|
||||||
commands:
|
|
||||||
- nix-build -j4 --attr flakePackages.fmt
|
|
||||||
|
|
||||||
- name: build
|
|
||||||
image: nixpkgs/nix:nixos-24.05
|
|
||||||
commands:
|
|
||||||
- nix-build -j4 --attr flakePackages.dev
|
|
||||||
|
|
||||||
- name: unit + func tests (lmdb)
|
|
||||||
image: nixpkgs/nix:nixos-24.05
|
|
||||||
commands:
|
|
||||||
- nix-build -j4 --attr flakePackages.tests-lmdb
|
|
||||||
|
|
||||||
- name: unit + func tests (sqlite)
|
|
||||||
image: nixpkgs/nix:nixos-24.05
|
|
||||||
commands:
|
|
||||||
- nix-build -j4 --attr flakePackages.tests-sqlite
|
|
||||||
|
|
||||||
- name: unit + func tests (fjall)
|
|
||||||
image: nixpkgs/nix:nixos-24.05
|
|
||||||
commands:
|
|
||||||
- nix-build -j4 --attr flakePackages.tests-fjall
|
|
||||||
|
|
||||||
- name: integration tests
|
|
||||||
image: nixpkgs/nix:nixos-24.05
|
|
||||||
commands:
|
|
||||||
- nix-build -j4 --attr flakePackages.dev
|
|
||||||
- nix-shell --attr ci --run ./script/test-smoke.sh || (cat /tmp/garage.log; false)
|
|
||||||
depends_on: [ build ]
|
|
||||||
|
|
@ -1,33 +0,0 @@
|
||||||
labels:
|
|
||||||
nix: "enabled"
|
|
||||||
|
|
||||||
when:
|
|
||||||
event:
|
|
||||||
- deployment
|
|
||||||
- cron
|
|
||||||
|
|
||||||
depends_on:
|
|
||||||
- release
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: refresh-index
|
|
||||||
image: nixpkgs/nix:nixos-24.05
|
|
||||||
environment:
|
|
||||||
AWS_ACCESS_KEY_ID:
|
|
||||||
from_secret: garagehq_aws_access_key_id
|
|
||||||
AWS_SECRET_ACCESS_KEY:
|
|
||||||
from_secret: garagehq_aws_secret_access_key
|
|
||||||
commands:
|
|
||||||
- mkdir -p /etc/nix && cp nix/nix.conf /etc/nix/nix.conf
|
|
||||||
- nix-shell --attr ci --run "refresh_index"
|
|
||||||
|
|
||||||
- name: multiarch-docker
|
|
||||||
image: nixpkgs/nix:nixos-24.05
|
|
||||||
environment:
|
|
||||||
DOCKER_AUTH:
|
|
||||||
from_secret: docker_auth
|
|
||||||
commands:
|
|
||||||
- mkdir -p /root/.docker
|
|
||||||
- echo $DOCKER_AUTH > /root/.docker/config.json
|
|
||||||
- export CONTAINER_TAG=${CI_COMMIT_TAG:-$CI_COMMIT_SHA}
|
|
||||||
- nix-shell --attr ci --run "multiarch_docker"
|
|
||||||
|
|
@ -1,71 +0,0 @@
|
||||||
labels:
|
|
||||||
nix: "enabled"
|
|
||||||
|
|
||||||
when:
|
|
||||||
event:
|
|
||||||
- deployment
|
|
||||||
- cron
|
|
||||||
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- ARCH: amd64
|
|
||||||
TARGET: x86_64-unknown-linux-musl
|
|
||||||
- ARCH: i386
|
|
||||||
TARGET: i686-unknown-linux-musl
|
|
||||||
- ARCH: arm64
|
|
||||||
TARGET: aarch64-unknown-linux-musl
|
|
||||||
- ARCH: arm
|
|
||||||
TARGET: armv6l-unknown-linux-musleabihf
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: build
|
|
||||||
image: nixpkgs/nix:nixos-24.05
|
|
||||||
commands:
|
|
||||||
- nix-build --attr releasePackages.${ARCH} --argstr git_version ${CI_COMMIT_TAG:-$CI_COMMIT_SHA}
|
|
||||||
|
|
||||||
- name: check is static binary
|
|
||||||
image: nixpkgs/nix:nixos-24.05
|
|
||||||
commands:
|
|
||||||
- nix-shell --attr ci --run "./script/not-dynamic.sh result/bin/garage"
|
|
||||||
|
|
||||||
- name: integration tests
|
|
||||||
image: nixpkgs/nix:nixos-24.05
|
|
||||||
commands:
|
|
||||||
- nix-shell --attr ci --run ./script/test-smoke.sh || (cat /tmp/garage.log; false)
|
|
||||||
when:
|
|
||||||
- matrix:
|
|
||||||
ARCH: amd64
|
|
||||||
- matrix:
|
|
||||||
ARCH: i386
|
|
||||||
|
|
||||||
- name: upgrade tests
|
|
||||||
image: nixpkgs/nix:nixos-24.05
|
|
||||||
commands:
|
|
||||||
- nix-shell --attr ci --run "./script/test-upgrade.sh v0.8.4 x86_64-unknown-linux-musl" || (cat /tmp/garage.log; false)
|
|
||||||
when:
|
|
||||||
- matrix:
|
|
||||||
ARCH: amd64
|
|
||||||
|
|
||||||
- name: push static binary
|
|
||||||
image: nixpkgs/nix:nixos-24.05
|
|
||||||
environment:
|
|
||||||
TARGET: "${TARGET}"
|
|
||||||
AWS_ACCESS_KEY_ID:
|
|
||||||
from_secret: garagehq_aws_access_key_id
|
|
||||||
AWS_SECRET_ACCESS_KEY:
|
|
||||||
from_secret: garagehq_aws_secret_access_key
|
|
||||||
commands:
|
|
||||||
- nix-shell --attr ci --run "to_s3"
|
|
||||||
|
|
||||||
- name: docker build and publish
|
|
||||||
image: nixpkgs/nix:nixos-24.05
|
|
||||||
environment:
|
|
||||||
DOCKER_PLATFORM: "linux/${ARCH}"
|
|
||||||
CONTAINER_NAME: "dxflrs/${ARCH}_garage"
|
|
||||||
DOCKER_AUTH:
|
|
||||||
from_secret: docker_auth
|
|
||||||
commands:
|
|
||||||
- mkdir -p /root/.docker
|
|
||||||
- echo $DOCKER_AUTH > /root/.docker/config.json
|
|
||||||
- export CONTAINER_TAG=${CI_COMMIT_TAG:-$CI_COMMIT_SHA}
|
|
||||||
- nix-shell --attr ci --run "to_docker"
|
|
||||||
4880
Cargo.lock
generated
4880
Cargo.lock
generated
File diff suppressed because it is too large
Load diff
142
Cargo.toml
142
Cargo.toml
|
|
@ -1,154 +1,20 @@
|
||||||
[workspace]
|
[workspace]
|
||||||
resolver = "2"
|
|
||||||
members = [
|
members = [
|
||||||
"src/db",
|
|
||||||
"src/util",
|
"src/util",
|
||||||
"src/net",
|
|
||||||
"src/rpc",
|
"src/rpc",
|
||||||
"src/table",
|
"src/table",
|
||||||
"src/block",
|
"src/block",
|
||||||
"src/model",
|
"src/model",
|
||||||
"src/api/common",
|
"src/api",
|
||||||
"src/api/s3",
|
|
||||||
"src/api/k2v",
|
|
||||||
"src/api/admin",
|
|
||||||
"src/web",
|
"src/web",
|
||||||
"src/garage",
|
"src/garage",
|
||||||
"src/k2v-client",
|
"src/k2v-client",
|
||||||
"src/format-table",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
default-members = ["src/garage"]
|
default-members = ["src/garage"]
|
||||||
|
|
||||||
[workspace.dependencies]
|
[profile.dev]
|
||||||
|
lto = "off"
|
||||||
# Internal Garage crates
|
|
||||||
format_table = { version = "0.1.1", path = "src/format-table" }
|
|
||||||
garage_api_common = { version = "1.3.1", path = "src/api/common" }
|
|
||||||
garage_api_admin = { version = "1.3.1", path = "src/api/admin" }
|
|
||||||
garage_api_s3 = { version = "1.3.1", path = "src/api/s3" }
|
|
||||||
garage_api_k2v = { version = "1.3.1", path = "src/api/k2v" }
|
|
||||||
garage_block = { version = "1.3.1", path = "src/block" }
|
|
||||||
garage_db = { version = "1.3.1", path = "src/db", default-features = false }
|
|
||||||
garage_model = { version = "1.3.1", path = "src/model", default-features = false }
|
|
||||||
garage_net = { version = "1.3.1", path = "src/net" }
|
|
||||||
garage_rpc = { version = "1.3.1", path = "src/rpc" }
|
|
||||||
garage_table = { version = "1.3.1", path = "src/table" }
|
|
||||||
garage_util = { version = "1.3.1", path = "src/util" }
|
|
||||||
garage_web = { version = "1.3.1", path = "src/web" }
|
|
||||||
k2v-client = { version = "0.0.4", path = "src/k2v-client" }
|
|
||||||
|
|
||||||
# External crates from crates.io
|
|
||||||
arc-swap = "1.0"
|
|
||||||
argon2 = "0.5"
|
|
||||||
async-trait = "0.1.7"
|
|
||||||
backtrace = "0.3"
|
|
||||||
base64 = "0.21"
|
|
||||||
blake2 = "0.10"
|
|
||||||
bytes = "1.0"
|
|
||||||
bytesize = "1.1"
|
|
||||||
cfg-if = "1.0"
|
|
||||||
chrono = "0.4"
|
|
||||||
crc32fast = "1.4"
|
|
||||||
crc32c = "0.6"
|
|
||||||
crypto-common = "0.1"
|
|
||||||
gethostname = "0.4"
|
|
||||||
git-version = "0.3.4"
|
|
||||||
hex = "0.4"
|
|
||||||
hexdump = "0.1"
|
|
||||||
html-escape = "0.2.13"
|
|
||||||
hmac = "0.12"
|
|
||||||
itertools = "0.12"
|
|
||||||
ipnet = "2.9.0"
|
|
||||||
lazy_static = "1.4"
|
|
||||||
md-5 = "0.10"
|
|
||||||
mktemp = "0.5"
|
|
||||||
nix = { version = "0.29", default-features = false, features = ["fs"] }
|
|
||||||
nom = "7.1"
|
|
||||||
parking_lot = "0.12"
|
|
||||||
parse_duration = "2.1"
|
|
||||||
pin-project = "1.0.12"
|
|
||||||
pnet_datalink = "0.34"
|
|
||||||
rand = "0.8"
|
|
||||||
sha1 = "0.10"
|
|
||||||
sha2 = "0.10"
|
|
||||||
timeago = { version = "0.4", default-features = false }
|
|
||||||
xxhash-rust = { version = "0.8", default-features = false, features = ["xxh3"] }
|
|
||||||
|
|
||||||
aes-gcm = { version = "0.10", features = ["aes", "stream"] }
|
|
||||||
sodiumoxide = { version = "0.2.5-0", package = "kuska-sodiumoxide" }
|
|
||||||
kuska-handshake = { version = "0.2.0", features = ["default", "async_std"] }
|
|
||||||
|
|
||||||
clap = { version = "4.1", features = ["derive", "env"] }
|
|
||||||
pretty_env_logger = "0.5"
|
|
||||||
structopt = { version = "0.3", default-features = false }
|
|
||||||
syslog-tracing = "0.3"
|
|
||||||
tracing = "0.1"
|
|
||||||
tracing-journald = "0.3.1"
|
|
||||||
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
|
|
||||||
|
|
||||||
heed = { version = "0.11", default-features = false, features = ["lmdb"] }
|
|
||||||
rusqlite = "0.37"
|
|
||||||
r2d2 = "0.8"
|
|
||||||
r2d2_sqlite = "0.31"
|
|
||||||
fjall = "2.4"
|
|
||||||
|
|
||||||
async-compression = { version = "0.4", features = ["tokio", "zstd"] }
|
|
||||||
zstd = { version = "0.13", default-features = false }
|
|
||||||
|
|
||||||
quick-xml = { version = "0.26", features = [ "serialize" ] }
|
|
||||||
rmp-serde = "1.1.2"
|
|
||||||
serde = { version = "1.0", default-features = false, features = ["derive", "rc"] }
|
|
||||||
serde_bytes = "0.11"
|
|
||||||
serde_json = "1.0"
|
|
||||||
toml = { version = "0.8", default-features = false, features = ["parse"] }
|
|
||||||
|
|
||||||
# newer version requires rust edition 2021
|
|
||||||
k8s-openapi = { version = "0.21", features = ["v1_24"] }
|
|
||||||
kube = { version = "0.88", default-features = false, features = ["runtime", "derive", "client", "rustls-tls"] }
|
|
||||||
schemars = "0.8"
|
|
||||||
reqwest = { version = "0.11", default-features = false, features = ["rustls-tls-manual-roots", "json"] }
|
|
||||||
|
|
||||||
form_urlencoded = "1.0.0"
|
|
||||||
http = "1.0"
|
|
||||||
httpdate = "1.0"
|
|
||||||
http-range = "0.1"
|
|
||||||
http-body-util = "0.1"
|
|
||||||
hyper = { version = "1.0", default-features = false }
|
|
||||||
hyper-util = { version = "0.1", features = [ "full" ] }
|
|
||||||
multer = "3.0"
|
|
||||||
percent-encoding = "2.2"
|
|
||||||
roxmltree = "0.19"
|
|
||||||
url = "2.3"
|
|
||||||
|
|
||||||
futures = "0.3"
|
|
||||||
futures-util = "0.3"
|
|
||||||
tokio = { version = "1.0", default-features = false, features = ["net", "rt", "rt-multi-thread", "io-util", "net", "time", "macros", "sync", "signal", "fs"] }
|
|
||||||
tokio-util = { version = "0.7", features = ["compat", "io"] }
|
|
||||||
tokio-stream = { version = "0.1", features = ["net"] }
|
|
||||||
|
|
||||||
opentelemetry = { version = "0.17", features = [ "rt-tokio", "metrics", "trace" ] }
|
|
||||||
opentelemetry-prometheus = "0.10"
|
|
||||||
opentelemetry-otlp = "0.10"
|
|
||||||
opentelemetry-contrib = "0.9"
|
|
||||||
prometheus = "0.13"
|
|
||||||
|
|
||||||
# used by the k2v-client crate only
|
|
||||||
aws-sigv4 = { version = "1.1", default-features = false }
|
|
||||||
hyper-rustls = { version = "0.26", default-features = false, features = ["http1", "http2", "ring", "rustls-native-certs"] }
|
|
||||||
log = "0.4"
|
|
||||||
thiserror = "2.0"
|
|
||||||
|
|
||||||
# ---- used only as build / dev dependencies ----
|
|
||||||
assert-json-diff = "2.0"
|
|
||||||
rustc_version = "0.4.0"
|
|
||||||
static_init = "1.0"
|
|
||||||
aws-smithy-runtime = { version = "1.8", default-features = false, features = ["tls-rustls"] }
|
|
||||||
aws-sdk-config = { version = "1.62", default-features = false }
|
|
||||||
aws-sdk-s3 = { version = "1.79", default-features = false, features = ["rt-tokio"] }
|
|
||||||
|
|
||||||
[profile.release]
|
[profile.release]
|
||||||
lto = "thin"
|
debug = true
|
||||||
codegen-units = 16
|
|
||||||
opt-level = 3
|
|
||||||
strip = "debuginfo"
|
|
||||||
|
|
|
||||||
25
Makefile
25
Makefile
|
|
@ -1,22 +1,13 @@
|
||||||
.PHONY: doc all run1 run2 run3
|
.PHONY: doc all release shell
|
||||||
|
|
||||||
all:
|
all:
|
||||||
clear
|
clear; cargo build --all-features
|
||||||
cargo build
|
|
||||||
|
|
||||||
# ----
|
doc:
|
||||||
|
cd doc/book; mdbook build
|
||||||
|
|
||||||
run1:
|
release:
|
||||||
RUST_LOG=garage=debug ./target/debug/garage -c tmp/config1.toml server
|
nix-build --arg release true
|
||||||
run1rel:
|
|
||||||
RUST_LOG=garage=debug ./target/release/garage -c tmp/config1.toml server
|
|
||||||
|
|
||||||
run2:
|
shell:
|
||||||
RUST_LOG=garage=debug ./target/debug/garage -c tmp/config2.toml server
|
nix-shell
|
||||||
run2rel:
|
|
||||||
RUST_LOG=garage=debug ./target/release/garage -c tmp/config2.toml server
|
|
||||||
|
|
||||||
run3:
|
|
||||||
RUST_LOG=garage=debug ./target/debug/garage -c tmp/config3.toml server
|
|
||||||
run3rel:
|
|
||||||
RUST_LOG=garage=debug ./target/release/garage -c tmp/config3.toml server
|
|
||||||
|
|
|
||||||
30
README.md
30
README.md
|
|
@ -1,4 +1,4 @@
|
||||||
Garage [](https://woodpecker.deuxfleurs.fr/repos/1)
|
Garage [](https://drone.deuxfleurs.fr/Deuxfleurs/garage)
|
||||||
===
|
===
|
||||||
|
|
||||||
<p align="center" style="text-align:center;">
|
<p align="center" style="text-align:center;">
|
||||||
|
|
@ -15,24 +15,18 @@ Garage [,
|
Non-goals include:
|
||||||
an experimental small-scale self hosted service provider,
|
|
||||||
which has been using it in production since its first release in 2020.
|
|
||||||
|
|
||||||
Learn more on our dedicated documentation pages:
|
- Extremely high performance
|
||||||
|
- Complete implementation of the S3 API
|
||||||
|
- Erasure coding (our replication model is simply to copy the data as is on several nodes, in different datacenters if possible)
|
||||||
|
|
||||||
- [Goals and use cases](https://garagehq.deuxfleurs.fr/documentation/design/goals/)
|
Our main use case is to provide a distributed storage layer for small-scale self hosted services such as [Deuxfleurs](https://deuxfleurs.fr).
|
||||||
- [Features](https://garagehq.deuxfleurs.fr/documentation/reference-manual/features/)
|
|
||||||
- [Quick start](https://garagehq.deuxfleurs.fr/documentation/quick-start/)
|
|
||||||
|
|
||||||
Garage is entirely free software released under the terms of the AGPLv3.
|
|
||||||
|
|
|
||||||
158
default.nix
158
default.nix
|
|
@ -1,24 +1,148 @@
|
||||||
{ system ? builtins.currentSystem, git_version ? null, }:
|
{
|
||||||
|
system ? builtins.currentSystem,
|
||||||
|
release ? false,
|
||||||
|
target ? "x86_64-unknown-linux-musl",
|
||||||
|
compileMode ? null,
|
||||||
|
git_version ? null,
|
||||||
|
}:
|
||||||
|
|
||||||
with import ./nix/common.nix;
|
with import ./nix/common.nix;
|
||||||
|
|
||||||
let
|
let
|
||||||
pkgs = import nixpkgs { };
|
crossSystem = { config = target; };
|
||||||
compile = import ./nix/compile.nix;
|
in let
|
||||||
|
log = v: builtins.trace v v;
|
||||||
|
|
||||||
build_release = target: (compile {
|
pkgs = import pkgsSrc {
|
||||||
inherit target system git_version nixpkgs;
|
inherit system crossSystem;
|
||||||
crane = flake.inputs.crane;
|
overlays = [ cargo2nixOverlay ];
|
||||||
rust-overlay = flake.inputs.rust-overlay;
|
|
||||||
release = true;
|
|
||||||
}).garage;
|
|
||||||
|
|
||||||
in {
|
|
||||||
releasePackages = {
|
|
||||||
amd64 = build_release "x86_64-unknown-linux-musl";
|
|
||||||
i386 = build_release "i686-unknown-linux-musl";
|
|
||||||
arm64 = build_release "aarch64-unknown-linux-musl";
|
|
||||||
arm = build_release "armv6l-unknown-linux-musleabihf";
|
|
||||||
};
|
};
|
||||||
flakePackages = flake.packages.${system};
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
Rust and Nix triples are not the same. Cargo2nix has a dedicated library
|
||||||
|
to convert Nix triples to Rust ones. We need this conversion as we want to
|
||||||
|
set later options linked to our (rust) target in a generic way. Not only
|
||||||
|
the triple terminology is different, but also the "roles" are named differently.
|
||||||
|
Nix uses a build/host/target terminology where Nix's "host" maps to Cargo's "target".
|
||||||
|
*/
|
||||||
|
rustTarget = log (pkgs.rustBuilder.rustLib.rustTriple pkgs.stdenv.hostPlatform);
|
||||||
|
|
||||||
|
/*
|
||||||
|
Cargo2nix is built for rustOverlay which installs Rust from Mozilla releases.
|
||||||
|
We want our own Rust to avoid incompatibilities, like we had with musl 1.2.0.
|
||||||
|
rustc was built with musl < 1.2.0 and nix shipped musl >= 1.2.0 which lead to compilation breakage.
|
||||||
|
So we want a Rust release that is bound to our Nix repository to avoid these problems.
|
||||||
|
See here for more info: https://musl.libc.org/time64.html
|
||||||
|
Because Cargo2nix does not support the Rust environment shipped by NixOS,
|
||||||
|
we emulate the structure of the Rust object created by rustOverlay.
|
||||||
|
In practise, rustOverlay ships rustc+cargo in a single derivation while
|
||||||
|
NixOS ships them in separate ones. We reunite them with symlinkJoin.
|
||||||
|
*/
|
||||||
|
rustChannel = pkgs.symlinkJoin {
|
||||||
|
name ="rust-channel";
|
||||||
|
paths = [
|
||||||
|
pkgs.rustPlatform.rust.rustc
|
||||||
|
pkgs.rustPlatform.rust.cargo
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
Cargo2nix provides many overrides by default, you can take inspiration from them:
|
||||||
|
https://github.com/cargo2nix/cargo2nix/blob/master/overlay/overrides.nix
|
||||||
|
|
||||||
|
You can have a complete list of the available options by looking at the overriden object, mkcrate:
|
||||||
|
https://github.com/cargo2nix/cargo2nix/blob/master/overlay/mkcrate.nix
|
||||||
|
*/
|
||||||
|
overrides = pkgs.rustBuilder.overrides.all ++ [
|
||||||
|
/*
|
||||||
|
[1] We need to alter Nix hardening to be able to statically compile: PIE,
|
||||||
|
Position Independent Executables seems to be supported only on amd64. Having
|
||||||
|
this flags set either make our executables crash or compile as dynamic on many platforms.
|
||||||
|
In the following section codegenOpts, we reactive it for the supported targets
|
||||||
|
(only amd64 curently) through the `-static-pie` flag. PIE is a feature used
|
||||||
|
by ASLR, which helps mitigate security issues.
|
||||||
|
Learn more about Nix Hardening: https://github.com/NixOS/nixpkgs/blob/master/pkgs/build-support/cc-wrapper/add-hardening.sh
|
||||||
|
|
||||||
|
[2] We want to inject the git version while keeping the build deterministic.
|
||||||
|
As we do not want to consider the .git folder as part of the input source,
|
||||||
|
we ask the user (the CI often) to pass the value to Nix.
|
||||||
|
*/
|
||||||
|
(pkgs.rustBuilder.rustLib.makeOverride {
|
||||||
|
name = "garage";
|
||||||
|
overrideAttrs = drv:
|
||||||
|
/* [1] */ { hardeningDisable = [ "pie" ]; }
|
||||||
|
//
|
||||||
|
/* [2] */ (if git_version != null then {
|
||||||
|
preConfigure = ''
|
||||||
|
${drv.preConfigure or ""}
|
||||||
|
export GIT_VERSION="${git_version}"
|
||||||
|
'';
|
||||||
|
} else {});
|
||||||
|
})
|
||||||
|
|
||||||
|
/*
|
||||||
|
We ship some parts of the code disabled by default by putting them behind a flag.
|
||||||
|
It speeds up the compilation (when the feature is not required) and released crates have less dependency by default (less attack surface, disk space, etc.).
|
||||||
|
But we want to ship these additional features when we release Garage.
|
||||||
|
In the end, we chose to exclude all features from debug builds while putting (all of) them in the release builds.
|
||||||
|
Currently, the only such feature of Garage is kubernetes-discovery from the garage_rpc crate.
|
||||||
|
The experimental feature k2v is also enabled here in all builds.
|
||||||
|
*/
|
||||||
|
(pkgs.rustBuilder.rustLib.makeOverride {
|
||||||
|
name = "garage_rpc";
|
||||||
|
overrideArgs = old:
|
||||||
|
{
|
||||||
|
features = if release then [ "kubernetes-discovery" "k2v" ] else [ "k2v" ];
|
||||||
|
};
|
||||||
|
})
|
||||||
|
];
|
||||||
|
|
||||||
|
packageFun = import ./Cargo.nix;
|
||||||
|
|
||||||
|
/*
|
||||||
|
We compile fully static binaries with musl to simplify deployment on most systems.
|
||||||
|
When possible, we reactivate PIE hardening (see above).
|
||||||
|
|
||||||
|
Also, if you set the RUSTFLAGS environment variable, the following parameters will
|
||||||
|
be ignored.
|
||||||
|
|
||||||
|
For more information on static builds, please refer to Rust's RFC 1721.
|
||||||
|
https://rust-lang.github.io/rfcs/1721-crt-static.html#specifying-dynamicstatic-c-runtime-linkage
|
||||||
|
*/
|
||||||
|
|
||||||
|
codegenOpts = {
|
||||||
|
"armv6l-unknown-linux-musleabihf" = [ "target-feature=+crt-static" "link-arg=-static" ]; /* compile as dynamic with static-pie */
|
||||||
|
"aarch64-unknown-linux-musl" = [ "target-feature=+crt-static" "link-arg=-static" ]; /* segfault with static-pie */
|
||||||
|
"i686-unknown-linux-musl" = [ "target-feature=+crt-static" "link-arg=-static" ]; /* segfault with static-pie */
|
||||||
|
"x86_64-unknown-linux-musl" = [ "target-feature=+crt-static" "link-arg=-static-pie" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
The following definition is not elegant as we use a low level function of Cargo2nix
|
||||||
|
that enables us to pass our custom rustChannel object. We need this low level definition
|
||||||
|
to pass Nix's Rust toolchains instead of Mozilla's one.
|
||||||
|
|
||||||
|
target is mandatory but must be kept to null to allow cargo2nix to set it to the appropriate value
|
||||||
|
for each crate.
|
||||||
|
*/
|
||||||
|
rustPkgs = pkgs.rustBuilder.makePackageSet {
|
||||||
|
inherit packageFun rustChannel release codegenOpts;
|
||||||
|
packageOverrides = overrides;
|
||||||
|
target = null;
|
||||||
|
|
||||||
|
buildRustPackages = pkgs.buildPackages.rustBuilder.makePackageSet {
|
||||||
|
inherit rustChannel packageFun codegenOpts;
|
||||||
|
packageOverrides = overrides;
|
||||||
|
target = null;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
in
|
||||||
|
if compileMode == "test"
|
||||||
|
then pkgs.symlinkJoin {
|
||||||
|
name ="garage-tests";
|
||||||
|
paths = builtins.map (key: rustPkgs.workspace.${key} { inherit compileMode; }) (builtins.attrNames rustPkgs.workspace);
|
||||||
}
|
}
|
||||||
|
else rustPkgs.workspace.garage { inherit compileMode; }
|
||||||
|
|
|
||||||
|
|
@ -1,17 +0,0 @@
|
||||||
# Browse doc
|
|
||||||
|
|
||||||
Run in this directory:
|
|
||||||
|
|
||||||
```
|
|
||||||
python3 -m http.server
|
|
||||||
```
|
|
||||||
|
|
||||||
And open in your browser:
|
|
||||||
- http://localhost:8000/garage-admin-v0.html
|
|
||||||
|
|
||||||
# Validate doc
|
|
||||||
|
|
||||||
```
|
|
||||||
wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/6.1.0/openapi-generator-cli-6.1.0.jar -O openapi-generator-cli.jar
|
|
||||||
java -jar openapi-generator-cli.jar validate -i garage-admin-v0.yml
|
|
||||||
```
|
|
||||||
|
|
@ -1,59 +0,0 @@
|
||||||
/* montserrat-300 - latin */
|
|
||||||
@font-face {
|
|
||||||
font-family: 'Montserrat';
|
|
||||||
font-style: normal;
|
|
||||||
font-weight: 300;
|
|
||||||
src: local(''),
|
|
||||||
url('../fonts/montserrat-v25-latin-300.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
|
|
||||||
url('../fonts/montserrat-v25-latin-300.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
|
|
||||||
}
|
|
||||||
|
|
||||||
/* montserrat-regular - latin */
|
|
||||||
@font-face {
|
|
||||||
font-family: 'Montserrat';
|
|
||||||
font-style: normal;
|
|
||||||
font-weight: 400;
|
|
||||||
src: local(''),
|
|
||||||
url('../fonts/montserrat-v25-latin-regular.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
|
|
||||||
url('../fonts/montserrat-v25-latin-regular.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
|
|
||||||
}
|
|
||||||
|
|
||||||
/* montserrat-700 - latin */
|
|
||||||
@font-face {
|
|
||||||
font-family: 'Montserrat';
|
|
||||||
font-style: normal;
|
|
||||||
font-weight: 700;
|
|
||||||
src: local(''),
|
|
||||||
url('../fonts/montserrat-v25-latin-700.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
|
|
||||||
url('../fonts/montserrat-v25-latin-700.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
|
|
||||||
}
|
|
||||||
/* roboto-300 - latin */
|
|
||||||
@font-face {
|
|
||||||
font-family: 'Roboto';
|
|
||||||
font-style: normal;
|
|
||||||
font-weight: 300;
|
|
||||||
src: local(''),
|
|
||||||
url('../fonts/roboto-v30-latin-300.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
|
|
||||||
url('../fonts/roboto-v30-latin-300.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
|
|
||||||
}
|
|
||||||
|
|
||||||
/* roboto-regular - latin */
|
|
||||||
@font-face {
|
|
||||||
font-family: 'Roboto';
|
|
||||||
font-style: normal;
|
|
||||||
font-weight: 400;
|
|
||||||
src: local(''),
|
|
||||||
url('../fonts/roboto-v30-latin-regular.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
|
|
||||||
url('../fonts/roboto-v30-latin-regular.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
|
|
||||||
}
|
|
||||||
|
|
||||||
/* roboto-700 - latin */
|
|
||||||
@font-face {
|
|
||||||
font-family: 'Roboto';
|
|
||||||
font-style: normal;
|
|
||||||
font-weight: 700;
|
|
||||||
src: local(''),
|
|
||||||
url('../fonts/roboto-v30-latin-700.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
|
|
||||||
url('../fonts/roboto-v30-latin-700.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
|
|
||||||
}
|
|
||||||
|
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue