-
-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
427 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
ARG ARCH= | ||
FROM ${ARCH}debian:bookworm AS toolchain | ||
|
||
RUN apt-get -y update && \ | ||
apt-get -y install \ | ||
build-essential git-core \ | ||
lintian pkg-config quilt patch cargo \ | ||
nodejs node-colors node-commander \ | ||
libudev-dev libapt-pkg-dev \ | ||
libacl1-dev libpam0g-dev libfuse3-dev \ | ||
libsystemd-dev uuid-dev libssl-dev \ | ||
libclang-dev libjson-perl libcurl4-openssl-dev \ | ||
dh-exec dh-nodejs wget | ||
|
||
RUN wget https://static.rust-lang.org/rustup/rustup-init.sh && \ | ||
chmod +x rustup-init.sh && \ | ||
./rustup-init.sh -y --default-toolchain nightly | ||
|
||
ENV RUSTUP_TOOLCHAIN=nightly | ||
|
||
WORKDIR /src | ||
|
||
RUN for tool in /root/.cargo/bin/*; do ln -vsf $tool /usr/bin/; done | ||
RUN /usr/bin/rustc --version | ||
RUN git config --global user.email "docker@compile.dev" && \ | ||
git config --global user.name "Docker Compile" | ||
|
||
FROM toolchain as builder | ||
|
||
# Clone all sources | ||
ARG VERSION=master | ||
ADD /versions/${VERSION}/ /patches/ | ||
RUN /patches/clone.bash | ||
|
||
# Apply all patches | ||
ADD /scripts/ /scripts/ | ||
RUN /scripts/apply-patches.bash /patches/server/*.patch | ||
RUN /scripts/strip-cargo.bash | ||
RUN /scripts/resolve-dependencies.bash | ||
|
||
# A first required dep | ||
RUN apt-get -y build-dep $PWD/pve-eslint | ||
RUN cd pve-eslint/ && make dinstall | ||
|
||
# A proxmox-perl-rs required deps | ||
RUN apt-get -y build-dep $PWD/perlmod/perlmod $PWD/perlmod/perlmod-bin $PWD/perlmod/perlmod-macro | ||
RUN cd perlmod/perlmod-bin && dpkg-buildpackage -us -uc -b && dpkg -i ../perlmod-bin*.deb | ||
|
||
# A pve-common required deps | ||
RUN apt-get -y build-dep $PWD/proxmox-perl-rs/pve-rs | ||
RUN cd proxmox-perl-rs/pve-rs && make dinstall | ||
RUN cd proxmox-perl-rs/common/pkg && make deb && dpkg -i *.deb | ||
RUN apt-get -y build-dep $PWD/pve-common | ||
RUN cd pve-common/ && ( make dinstall || apt-get -f -y install && make dinstall ) | ||
|
||
# Install dev dependencies of widget toolkit | ||
RUN apt-get -y build-dep $PWD/proxmox-widget-toolkit | ||
RUN cd proxmox-widget-toolkit/ && make deb && dpkg -i proxmox-widget-toolkit-dev*.deb | ||
|
||
# Deps for all rest | ||
RUN apt-get -y build-dep $PWD/proxmox-acme | ||
RUN apt-get -y build-dep $PWD/proxmox-backup | ||
RUN apt-get -y build-dep $PWD/proxmox-mini-journalreader | ||
RUN apt-get -y build-dep $PWD/extjs | ||
RUN apt-get -y build-dep $PWD/proxmox-i18n | ||
RUN apt-get -y build-dep $PWD/pve-xtermjs | ||
RUN apt-get -y build-dep $PWD/libjs-qrcodejs | ||
|
||
# Compile ALL | ||
RUN cd proxmox-backup/ && make deb | ||
RUN cd extjs/ && make deb | ||
RUN cd proxmox-i18n/ && make deb | ||
RUN cd pve-xtermjs/ && make deb | ||
RUN cd proxmox-mini-journalreader/ && make deb | ||
RUN cd libjs-qrcodejs/ && make deb | ||
RUN cd proxmox-acme/ && make deb | ||
|
||
# Copy all debian packages | ||
RUN mkdir -p /deb && \ | ||
find /src/ -name '*.deb' -exec cp -av {} /deb/ \; | ||
|
||
#================================= | ||
|
||
FROM ${ARCH}debian:bookworm | ||
COPY --from=builder /deb/ /deb/ | ||
|
||
# Install all packages | ||
RUN export DEBIAN_FRONTEND=noninteractive && \ | ||
apt-get -y update && \ | ||
apt install -y runit ssmtp /deb/*.deb | ||
|
||
# Add default configs | ||
ADD /pbs/ /etc/proxmox-backup-default/ | ||
|
||
VOLUME /etc/proxmox-backup | ||
VOLUME /var/log/proxmox-backup | ||
VOLUME /var/lib/proxmox-backup | ||
|
||
ADD runit/ /runit/ | ||
CMD ["runsvdir", "/runit"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
ARG DOCKER_ARCH | ||
FROM ${DOCKER_ARCH}/debian:bookworm AS builder | ||
|
||
RUN apt-get -y update && \ | ||
apt-get -y install \ | ||
build-essential git-core \ | ||
lintian pkg-config quilt patch cargo \ | ||
nodejs node-colors node-commander \ | ||
libudev-dev libapt-pkg-dev \ | ||
libacl1-dev libpam0g-dev libfuse3-dev \ | ||
libsystemd-dev uuid-dev libssl-dev \ | ||
libclang-dev libjson-perl libcurl4-openssl-dev \ | ||
dh-exec wget | ||
|
||
WORKDIR /src | ||
|
||
RUN /usr/bin/rustc --version | ||
RUN git config --global user.email "docker@compile.dev" && \ | ||
git config --global user.name "Docker Compile" | ||
|
||
# Clone all sources | ||
ARG VERSION=master | ||
ADD /versions/${VERSION}/ /patches/ | ||
RUN /patches/clone.bash | ||
|
||
# Install valid rust toolchain | ||
ARG DOCKER_ARCH | ||
RUN \ | ||
if [ "${DOCKER_ARCH}" != "arm32v7" ]; then \ | ||
wget https://static.rust-lang.org/rustup/rustup-init.sh && \ | ||
chmod +x rustup-init.sh && \ | ||
./rustup-init.sh -y --default-toolchain nightly && \ | ||
for tool in /root/.cargo/bin/*; do ln -vsf $tool /usr/bin/; done; \ | ||
fi | ||
|
||
# Apply all patches | ||
ADD /scripts/ /scripts/ | ||
RUN /scripts/apply-patches.bash /patches/server/*.patch /patches/client/*.patch /patches/client-${DOCKER_ARCH}/*.patch | ||
RUN /scripts/strip-cargo.bash | ||
RUN /scripts/experimental-cargo.bash | ||
RUN /scripts/resolve-dependencies.bash | ||
|
||
# Build | ||
RUN \ | ||
. /root/.cargo/env; \ | ||
cargo build --manifest-path proxmox-backup/proxmox-backup-client/Cargo.toml --release && \ | ||
cargo build --manifest-path proxmox-backup/pxar-bin/Cargo.toml --release | ||
|
||
# Bundle client | ||
RUN /scripts/bundle-client.bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
#!/bin/bash | ||
|
||
set -eo pipefail | ||
|
||
SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" | ||
|
||
if [[ "$1" == "show-sha" ]]; then | ||
VERSION="${2:-master}" | ||
VERSION_DATE="" | ||
|
||
tmp_dir=$(mktemp -d -t ci-XXXXXXXXXX) | ||
cd "$tmp_dir/" | ||
trap 'cd ; rm -rf $tmp_dir' EXIT | ||
|
||
perform() { | ||
git clone "git://git.proxmox.com/git/$1.git" 2>/dev/null | ||
if [[ -z "$VERSION_TIMESTAMP" ]]; then | ||
REVISION=$(git -C "$1" rev-parse "$VERSION") | ||
VERSION_TIMESTAMP=$(git -C "$1" log -1 --format=%ct "$VERSION") | ||
else | ||
while read TIMESTAMP REVISION; do | ||
if [[ $TIMESTAMP -le $VERSION_TIMESTAMP ]]; then | ||
break | ||
fi | ||
done < <(git -C "$1" log --format="%ct %H") | ||
fi | ||
|
||
CHANGE_TIME=$(git -C "$1" log -1 --format="%cd" $REVISION) | ||
|
||
echo "$1 $REVISION # $CHANGE_TIME" | ||
} | ||
else | ||
if [[ -n "$1" ]]; then | ||
cd "$1" | ||
fi | ||
|
||
perform() { | ||
if [[ ! -d "$1" ]]; then | ||
git clone "git://git.proxmox.com/git/$1.git" | ||
else | ||
git -C "$1" fetch | ||
fi | ||
git -C "$1" checkout "$2" -f | ||
git -C "$1" clean -fdx | ||
} | ||
fi | ||
|
||
if [[ ! -e "$SCRIPT_DIR/versions" ]]; then | ||
echo "Missing 'versions' file." | ||
exit 1 | ||
fi | ||
|
||
while read REPO COMMIT_SHA REST; do | ||
echo "$REPO $COMMIT_SHA..." 1>&2 | ||
perform "$REPO" "$COMMIT_SHA" | ||
done < "$SCRIPT_DIR/versions" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
diff --git a/www/NavigationTree.js b/www/NavigationTree.js | ||
index 576d05ab..7ba9955a 100644 | ||
--- a/www/NavigationTree.js | ||
+++ b/www/NavigationTree.js | ||
@@ -77,12 +77,6 @@ Ext.define('PBS.store.NavigationStore', { | ||
expanded: true, | ||
leaf: false, | ||
children: [ | ||
- { | ||
- text: gettext('Shell'), | ||
- iconCls: 'fa fa-terminal', | ||
- path: 'pbsXtermJsConsole', | ||
- leaf: true, | ||
- }, | ||
{ | ||
text: gettext('Storage / Disks'), | ||
iconCls: 'fa fa-hdd-o', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
commit 1b425b8fd31147524f81c549ccbf0318a75f1c9e | ||
Author: Kamil Trzciński <ayufan@ayufan.eu> | ||
Date: Sat May 1 14:40:06 2021 +0200 | ||
|
||
Support local compile | ||
|
||
diff --git a/debian/proxmox-backup-file-restore.install b/debian/proxmox-backup-file-restore.install | ||
old mode 100644 | ||
new mode 100755 | ||
index d952836e..e6888c5f | ||
--- a/debian/proxmox-backup-file-restore.install | ||
+++ b/debian/proxmox-backup-file-restore.install | ||
@@ -1,4 +1,5 @@ | ||
+#! /usr/bin/dh-exec | ||
usr/bin/proxmox-file-restore | ||
-usr/lib/x86_64-linux-gnu/proxmox-backup/file-restore/proxmox-restore-daemon | ||
+usr/lib/${DEB_HOST_MULTIARCH}/proxmox-backup/file-restore/proxmox-restore-daemon | ||
usr/share/man/man1/proxmox-file-restore.1 | ||
usr/share/zsh/vendor-completions/_proxmox-file-restore | ||
diff --git a/debian/proxmox-backup-server.install b/debian/proxmox-backup-server.install | ||
old mode 100644 | ||
new mode 100755 | ||
index cebf84a3..fa96f93e | ||
--- a/debian/proxmox-backup-server.install | ||
+++ b/debian/proxmox-backup-server.install | ||
@@ -1,17 +1,18 @@ | ||
+#! /usr/bin/dh-exec | ||
etc/pbs-enterprise.list /etc/apt/sources.list.d/ | ||
etc/proxmox-backup-banner.service /lib/systemd/system/ | ||
etc/proxmox-backup-daily-update.service /lib/systemd/system/ | ||
etc/proxmox-backup-daily-update.timer /lib/systemd/system/ | ||
etc/proxmox-backup-proxy.service /lib/systemd/system/ | ||
etc/proxmox-backup.service /lib/systemd/system/ | ||
usr/bin/pmt | ||
usr/bin/pmtx | ||
usr/bin/proxmox-tape | ||
-usr/lib/x86_64-linux-gnu/proxmox-backup/proxmox-backup-api | ||
-usr/lib/x86_64-linux-gnu/proxmox-backup/proxmox-backup-banner | ||
-usr/lib/x86_64-linux-gnu/proxmox-backup/proxmox-backup-proxy | ||
-usr/lib/x86_64-linux-gnu/proxmox-backup/proxmox-daily-update | ||
-usr/lib/x86_64-linux-gnu/proxmox-backup/sg-tape-cmd | ||
+usr/lib/${DEB_HOST_MULTIARCH}/proxmox-backup/proxmox-backup-api | ||
+usr/lib/${DEB_HOST_MULTIARCH}/proxmox-backup/proxmox-backup-banner | ||
+usr/lib/${DEB_HOST_MULTIARCH}/proxmox-backup/proxmox-backup-proxy | ||
+usr/lib/${DEB_HOST_MULTIARCH}/proxmox-backup/proxmox-daily-update | ||
+usr/lib/${DEB_HOST_MULTIARCH}/proxmox-backup/sg-tape-cmd | ||
usr/sbin/pbs2to3 | ||
usr/sbin/proxmox-backup-debug | ||
usr/sbin/proxmox-backup-manager | ||
diff --git a/debian/rules b/debian/rules | ||
index 4fc6de8f..fcbf7e93 100755 | ||
--- a/debian/rules | ||
+++ b/debian/rules | ||
@@ -2,6 +2,7 @@ | ||
# See debhelper(7) (uncomment to enable) | ||
# output every command that modifies files on the build system. | ||
DH_VERBOSE = 1 | ||
+DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) | ||
|
||
include /usr/share/dpkg/pkg-info.mk | ||
include /usr/share/rustc/architecture.mk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
commit 1b425b8fd31147524f81c549ccbf0318a75f1c9e | ||
Author: Kamil Trzciński <ayufan@ayufan.eu> | ||
Date: Sat May 1 14:40:06 2021 +0200 | ||
|
||
Support local compile | ||
|
||
diff --git a/debian/rules b/debian/rules | ||
index 4fc6de8f..fcbf7e93 100755 | ||
--- a/debian/rules | ||
+++ b/debian/rules | ||
@@ -21,7 +22,7 @@ export DEB_CARGO_PACKAGE=proxmox-backup | ||
override_dh_auto_configure: | ||
@perl -ne 'if (/^version\s*=\s*"(\d+(?:\.\d+)+)"/) { my $$v_cargo = $$1; my $$v_deb = "$(DEB_VERSION_UPSTREAM)"; \ | ||
die "ERROR: d/changelog <-> Cargo.toml version mismatch: $$v_cargo != $$v_deb\n" if $$v_cargo ne $$v_deb; exit(0); }' Cargo.toml | ||
- $(CARGO) prepare-debian $(CURDIR)/debian/cargo_registry --link-from-system | ||
+ #$(CARGO) prepare-debian --help $(CURDIR)/debian/cargo_registry --link-from-system | ||
dh_auto_configure | ||
|
||
override_dh_auto_build: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
diff --git a/src/Makefile b/src/Makefile | ||
index ea8af24..d7f1351 100644 | ||
--- a/src/Makefile | ||
+++ b/src/Makefile | ||
@@ -2,7 +2,7 @@ PROGRAM=mini-journalreader | ||
SOURCES=mini-journalreader.c | ||
|
||
LIBS := libsystemd | ||
-CFLAGS += -Werror -Wall -Wextra -Wl,-z,relro -g -O2 --std=gnu11 | ||
+CFLAGS += -Wall -Wextra -Wl,-z,relro -g -O2 --std=gnu11 | ||
CFLAGS += -fstack-protector-strong -D_FORTIFY_SOURCE=2 | ||
CFLAGS += $(shell pkg-config --cflags ${LIBS}) | ||
LFLAGS += $(shell pkg-config --libs ${LIBS}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
diff --git a/pve-rs/debian/rules b/pve-rs/debian/rules | ||
index bddb889..4e15f38 100755 | ||
--- a/pve-rs/debian/rules | ||
+++ b/pve-rs/debian/rules | ||
@@ -21,5 +21,5 @@ export DEB_CARGO_PACKAGE=pve-rs | ||
override_dh_auto_configure: | ||
@perl -ne 'if (/^version\s*=\s*"(\d+(?:\.\d+)+)"/) { my $$v_cargo = $$1; my $$v_deb = "$(DEB_VERSION_UPSTREAM)"; \ | ||
die "ERROR: d/changelog <-> Cargo.toml version mismatch: $$v_cargo != $$v_deb\n" if $$v_cargo ne $$v_deb; exit(0); }' Cargo.toml | ||
- $(CARGO) prepare-debian $(CURDIR)/debian/cargo_registry --link-from-system | ||
+ #$(CARGO) prepare-debian $(CURDIR)/debian/cargo_registry --link-from-system | ||
dh_auto_configure |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
diff --git a/proxmox-router/src/cli/command.rs b/proxmox-router/src/cli/command.rs | ||
index 906ec0c..2a396e2 100644 | ||
--- a/proxmox-router/src/cli/command.rs | ||
+++ b/proxmox-router/src/cli/command.rs | ||
@@ -2,6 +2,7 @@ use anyhow::*; | ||
use serde_json::Value; | ||
use std::cell::RefCell; | ||
use std::sync::Arc; | ||
+use std::result::Result::Ok; | ||
|
||
use proxmox_schema::*; | ||
use proxmox_schema::format::DocumentationFormat; | ||
diff --git a/proxmox-sys/src/linux/procfs/mod.rs b/proxmox-sys/src/linux/procfs/mod.rs | ||
index 5784e0e..e503b5f 100644 | ||
--- a/proxmox-sys/src/linux/procfs/mod.rs | ||
+++ b/proxmox-sys/src/linux/procfs/mod.rs | ||
@@ -1,3 +1,4 @@ | ||
+use std::result::Result::Ok; | ||
use std::collections::HashSet; | ||
use std::convert::TryFrom; | ||
use std::fmt; | ||
diff --git a/proxmox/src/sys/linux/tty.rs b/proxmox-sys/src/sys/linux/tty.rs | ||
index 0b4a3c1..e7a7847 100644 | ||
--- a/proxmox-sys/src/linux/tty.rs | ||
+++ b/proxmox-sys/src/linux/tty.rs | ||
@@ -1,3 +1,4 @@ | ||
+use std::result::Result::Ok; | ||
use std::io::{self, Read, Write}; | ||
use std::mem::MaybeUninit; | ||
use std::os::unix::io::AsRawFd; |
Oops, something went wrong.