Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .devcontainer/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
WORKSPACE="/workspace"
CRYPTOPRO_USERNAME="<ИМЯ_ПОЛЬЗОВАТЕЛЯ_САЙТА_CRYPTOPRO>"
CRYPTOPRO_PASSWORD="<ПАРОЛЬ_ПОЛЬЗОВАТЕЛЯ_САЙТА_CRYPTOPRO>"
42 changes: 42 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
ARG VARIANT="base:bookworm"

FROM mcr.microsoft.com/devcontainers/${VARIANT}

ENV DEBIAN_FRONTEND noninteractive

ARG CRYPTOPRO_USERNAME

ARG CRYPTOPRO_PASSWORD

RUN apt-get update && apt-get install -y --no-install-recommends \
apt-transport-https \
build-essential \
ca-certificates \
cmake \
git-flow \
gpg \
libboost-all-dev \
python3-dev \
unzip \
wget

RUN echo "machine cryptopro.ru login ${CRYPTOPRO_USERNAME} password ${CRYPTOPRO_PASSWORD}" > /etc/apt/auth.conf.d/cryptopro.conf && \
chmod 600 /etc/apt/auth.conf.d/cryptopro.conf

RUN echo "deb https://cryptopro.ru/repo/deb 5.0-unstable main" > /etc/apt/sources.list.d/cprocsp.list

RUN wget -qO - https://www.cryptopro.ru/sites/default/files/products/csp/cryptopro_key.pub | \
gpg --dearmor > /etc/apt/trusted.gpg.d/cryptopro.gpg

RUN echo "deb https://repo.rutoken.ru/apt/ stable main" > /etc/apt/sources.list.d/rutoken.list

RUN wget -qO- 'https://dev.rutoken.ru/download/attachments/142508509/repo-rutoken-public.gpg' | \
gpg --dearmor > /etc/apt/trusted.gpg.d/rutoken.gpg

RUN apt-get update && apt-get install -y --no-install-recommends \
cprocsp-pki-cades \
lsb-cprocsp-devel

RUN rm /etc/apt/auth.conf.d/cryptopro.conf

RUN apt-get clean
46 changes: 46 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"name": "pyCAdES",
"dockerComposeFile": "docker-compose.yaml",
"service": "app",
"remoteUser": "vscode",
"workspaceFolder": "/workspace",
"customizations": {
"vscode": {
"settings": {
"terminal.integrated.profiles.linux": {
"bash": {
"path": "/bin/bash"
}
},
"python.defaultInterpreterPath": "${workspaceRoot}/.venv/bin/python3",
"git.enabled": true,
"terminal.integrated.defaultProfile.linux": "bash",
"terminal.integrated.inheritEnv": true,
"editor.bracketPairColorization.enabled": true,
"editor.guides.bracketPairs": "active"
},
"extensions": [
"adam-bender.commit-message-editor",
"christian-kohler.path-intellisense",
"codeium.codeium",
"ms-python.python",
"ms-vscode.cpptools",
"ms-vscode.cmake-tools",
"EditorConfig.EditorConfig"
]
}
},
"postCreateCommand": {
"setupEnvironment": "rm -rf .venv &&uv python install 3.11 && uv venv --python 3.11 ${containerWorkspaceFolder}/.venv && sudo chown -R $(whoami): ${containerWorkspaceFolder}/.venv"
},
"remoteEnv": {
"PATH": "${containerWorkspaceFolder}/.venv/bin:${containerEnv:PATH}",
"SSH_AUTH_SOCK": "/ssh-agent",
"WORKSPACE": "${containerWorkspaceFolder}",
"UV_LINK_MODE": "copy"
},
"features": {
"ghcr.io/va-h/devcontainers-features/uv:1": {}
},
"mounts": ["source=${SSH_AUTH_SOCK},target=/ssh-agent,type=bind"]
}
19 changes: 19 additions & 0 deletions .devcontainer/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
services:
app:
env_file:
- .env
build:
context: ..
dockerfile: .devcontainer/Dockerfile
args:
- WORKSPACE=${WORKSPACE}
- CRYPTOPRO_USERNAME=${CRYPTOPRO_USERNAME}
- CRYPTOPRO_PASSWORD=${CRYPTOPRO_PASSWORD}
command: sleep infinity
networks:
- default
volumes:
- ..:${WORKSPACE}:cached

networks:
default:
31 changes: 31 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
root = true

[*]
charset = utf-8
trim_trailing_whitespace = true
end_of_line = lf
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false

[*.{py,java,r,R}]
indent_style = space
indent_size = 4

[{**.yml,**.yaml}]
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 2
trim_trailing_whitespace = true

[*.{c++,cc,cpp,cxx,h,h++,hh,hpp,hxx,inl,ipp,tlh,tli}]
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 2
trim_trailing_whitespace = true

[{Makefile,**.mk}]
indent_style = tab
38 changes: 38 additions & 0 deletions .github/workflows/develop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Develop

on:
push:
branches:
- dev
- develop
paths:
- "**/*.py"
- ".github/workflows/develop.yml"
pull_request:
branches:
- dev
- develop
paths:
- "**/*.py"
- ".github/workflows/develop.yml"
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository

steps:
- name: Checkout sources
uses: actions/checkout@v4
with:
persist-credentials: false
fetch-depth: 0

- name: Install uv
uses: astral-sh/setup-uv@v5

- name: Install dependencies
uses: excitedleigh/setup-nox@v2.0.0

- run: nox
52 changes: 52 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Release

on:
push:
branches:
- main
- master
paths:
- "**/*.py"
- ".github/workflows/release.yml"
pull_request:
branches:
- main
- master
paths:
- "**/*.py"
- ".github/workflows/release.yml"
workflow_dispatch:

jobs:
tests:
name: Run tests
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
with:
persist-credentials: false
fetch-depth: 0

- name: Install uv
uses: astral-sh/setup-uv@v5

- name: Install dependencies
uses: excitedleigh/setup-nox@v2.0.0

- run: nox

release:
needs: [tests]
name: Release
runs-on: ubuntu-latest
permissions:
contents: write
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
fetch-depth: 0
Loading