Skip to content

Commit 2c34d4d

Browse files
add fedora signing and replace xmlsec (#400)
1 parent 4c8299b commit 2c34d4d

22 files changed

+466
-715
lines changed

.devcontainer/Dockerfile

-2
This file was deleted.

.devcontainer/devcontainer.json

-31
This file was deleted.

.devcontainer/docker/Dockerfile

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
FROM mcr.microsoft.com/devcontainers/rust:bullseye
2+
RUN apt-get update && apt-get -y install pkg-config libssl-dev libxml2-dev libclang-dev
3+
RUN apt update && \
4+
apt install sudo && \
5+
usermod -aG sudo vscode && \
6+
echo "%sudo ALL=(ALL) NOPASSWD:ALL" | tee -a /etc/sudoers > /dev/null
7+
8+
RUN chown vscode:vscode -R /home/vscode
9+
USER vscode
+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"name": "xhandler-rust",
3+
"build": {
4+
"dockerfile": "Dockerfile"
5+
},
6+
"runArgs": [
7+
"--privileged",
8+
"--userns=keep-id"
9+
],
10+
"remoteUser": "vscode",
11+
"features": {
12+
"ghcr.io/devcontainers/features/rust:1": {},
13+
"ghcr.io/devcontainers/features/node:1": {
14+
"version": "20"
15+
},
16+
"ghcr.io/devcontainers/features/docker-in-docker:2": {}
17+
},
18+
"postCreateCommand": "bash .devcontainer/docker/postCreateCommand.sh",
19+
"customizations": {
20+
"jetbrains": {
21+
"backend": "RustRover"
22+
},
23+
"vscode": {
24+
"settings": {},
25+
"extensions": [
26+
"vadimcn.vscode-lldb",
27+
"rust-lang.rust-analyzer",
28+
"tamasfe.even-better-toml",
29+
"github.vscode-github-actions",
30+
"github.vscode-pull-request-github"
31+
]
32+
},
33+
"codespaces": {
34+
"openFiles": [
35+
"README.md"
36+
]
37+
}
38+
}
39+
}
File renamed without changes.

.devcontainer/podman/.env

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
REPO_PATH=/home/cferiavi/git/openubl/xhandler-rust
2+
USER_UID=115091

.devcontainer/podman/Dockerfile

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
FROM quay.io/fedora/fedora:41
2+
3+
ARG USERNAME=vscode
4+
ARG USER_UID=1000
5+
ARG USER_GID=$USER_UID
6+
7+
COPY entrypoint.sh /entrypoint.sh
8+
9+
RUN dnf -y update && \
10+
dnf install -y @development-tools && \
11+
dnf install -y curl wget podman
12+
13+
RUN groupadd --gid $USER_GID $USERNAME && \
14+
useradd --uid $USER_UID --gid $USER_GID -m $USERNAME && \
15+
echo $USERNAME:10000:5000 > /etc/subuid && echo $USERNAME:10000:5000 > /etc/subgid && \
16+
# Allow user to execute 'sudo' without password
17+
usermod -aG wheel $USERNAME && \
18+
echo "%wheel ALL=(ALL) NOPASSWD:ALL" | tee -a /etc/sudoers > /dev/null
19+
20+
# Podman
21+
# https://github.com/containers/podman/issues/2788#issuecomment-479923274
22+
RUN chmod 4755 /usr/bin/newgidmap && chmod 4755 /usr/bin/newuidmap
23+
24+
# set permissions
25+
RUN chown $USERNAME:$USERNAME -R /home/$USERNAME
26+
27+
RUN usermod -aG wheel $USERNAME && \
28+
# Allow user to execute 'sudo' without password
29+
echo "%wheel ALL=(ALL) NOPASSWD:ALL" | tee -a /etc/sudoers > /dev/null && \
30+
# https://github.com/containers/podman/issues/2788#issuecomment-479923274
31+
chmod 4755 /usr/bin/newgidmap && chmod 4755 /usr/bin/newuidmap
32+
33+
ENV _CONTAINERS_USERNS_CONFIGURED=""
34+
35+
ENTRYPOINT [ "/entrypoint.sh" ]
36+
USER $USERNAME
37+
CMD ["tail", "-f", "/dev/null"]
+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"name": "xhandler-rust",
3+
"dockerComposeFile": "docker-compose.yml",
4+
"overrideCommand": true,
5+
"shutdownAction": "stopCompose",
6+
"service": "xhandler-rust",
7+
"remoteUser": "vscode",
8+
"onCreateCommand": "bash .devcontainer/podman/onCreateCommand.sh",
9+
"postCreateCommand": "bash .devcontainer/podman/postCreateCommand.sh",
10+
"customizations": {
11+
"jetbrains": {
12+
"backend": "RustRover"
13+
},
14+
"vscode": {
15+
"extensions": [
16+
"vadimcn.vscode-lldb",
17+
"rust-lang.rust-analyzer",
18+
"tamasfe.even-better-toml",
19+
"github.vscode-github-actions",
20+
"github.vscode-pull-request-github"
21+
]
22+
}
23+
}
24+
}
+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
volumes:
2+
cargo-cache:
3+
4+
services:
5+
xhandler-rust:
6+
# https://github.com/microsoft/vscode-remote-release/issues/10215
7+
image: localhost/xhandler-rust_devcontainer-xhandler-rust:latest
8+
build:
9+
context: .
10+
dockerfile: ./Dockerfile
11+
args:
12+
USER_UID: ${USER_UID}
13+
privileged: true
14+
userns_mode: "keep-id"
15+
# command: tail -f /dev/null
16+
volumes:
17+
- ${REPO_PATH}:/workspace:cached
18+
- cargo-cache:/home/vscode/.cargo

.devcontainer/podman/entrypoint.sh

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/sh
2+
3+
# Ensure $HOME exists when starting
4+
if [ ! -d "${HOME}" ]; then
5+
mkdir -p "${HOME}"
6+
fi
7+
8+
# Setup $PS1 for a consistent and reasonable prompt
9+
if [ -w "${HOME}" ] && [ ! -f "${HOME}"/.bashrc ]; then
10+
echo "PS1='\s-\v \w \$ '" > "${HOME}"/.bashrc
11+
fi
12+
13+
# Add current (arbitrary) user to /etc/passwd and /etc/group
14+
if ! whoami > /dev/null 2>&1; then
15+
if [ -w /etc/passwd ]; then
16+
echo "update passwd file"
17+
echo "${USER_NAME:-user}:x:$(id -u):0:${USER_NAME:-user} user:${HOME}:/bin/bash" >> /etc/passwd
18+
echo "${USER_NAME:-user}:x:$(id -u):" >> /etc/group
19+
fi
20+
fi
+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
sudo dnf install -y @development-tools
2+
sudo dnf install -y @c-development
3+
sudo dnf install -y libxml2-devel openssl-devel gcc gcc-c++ cmake perl
4+
5+
sudo dnf install -y rustup
6+
rustup-init -y
7+
. "$HOME/.cargo/env"
8+
rustup update
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Git autocomplete
2+
echo "source /usr/share/bash-completion/completions/git" >> ~/.bashrc

.github/actions/install-dependencies/action.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ runs:
66
- name: Install dependencies
77
shell: bash
88
run: |
9-
sudo apt-get -y install pkg-config xmlsec1 libxml2-dev libxmlsec1-dev libxmlsec1-openssl libclang-dev
9+
sudo apt-get -y install pkg-config libssl-dev libxml2-dev libclang-dev

0 commit comments

Comments
 (0)