diff --git a/.github/workflows/binaries.yml b/.github/workflows/binaries.yml index 4713d3d..a034580 100644 --- a/.github/workflows/binaries.yml +++ b/.github/workflows/binaries.yml @@ -41,12 +41,13 @@ jobs: - name: Build with PyInstaller shell: bash run: | + if [ "$RUNNER_OS" == "Windows" ]; then SEP=";"; else SEP=":"; fi pyinstaller --onefile \ - --add-data "voxvera/locales:voxvera/locales" \ - --add-data "voxvera/src:voxvera/src" \ - --add-data "voxvera/templates:voxvera/templates" \ - --add-data "voxvera/resources:voxvera/resources" \ - --add-data "requirements.txt:." \ + --add-data "voxvera/locales${SEP}voxvera/locales" \ + --add-data "voxvera/src${SEP}voxvera/src" \ + --add-data "voxvera/templates${SEP}voxvera/templates" \ + --add-data "voxvera/resources${SEP}voxvera/resources" \ + --add-data "requirements.txt${SEP}." \ --name "${{ matrix.artifact_name }}" \ voxvera/cli.py diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index edef1f5..a08b304 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -19,8 +19,8 @@ jobs: - name: Install dependencies run: | sudo apt-get update - sudo apt-get install -y python3-pip - pip install --break-system-packages . + sudo apt-get install -y tor + pip install . - name: Run end-to-end tests run: ci/test-e2e.sh - name: Upload logs diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 505d1b5..48cc075 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -35,7 +35,9 @@ jobs: sudo apt-get install -y wget bash packaging/build_appimage.sh - name: Build Docker image - run: docker build -t ghcr.io/${{ github.repository_owner }}/voxvera:${{ github.ref_name }} . + run: | + OWNER_LC=$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]') + docker build -t ghcr.io/${OWNER_LC}/voxvera:${{ github.ref_name }} . - name: Login to GHCR uses: docker/login-action@v2 with: @@ -43,7 +45,9 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Push Docker image - run: docker push ghcr.io/${{ github.repository_owner }}/voxvera:${{ github.ref_name }} + run: | + OWNER_LC=$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]') + docker push ghcr.io/${OWNER_LC}/voxvera:${{ github.ref_name }} - name: Publish to PyPI uses: pypa/gh-action-pypi-publish@release/v1 with: diff --git a/Dockerfile b/Dockerfile index 9dc9f95..02e9b1e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,26 +1,22 @@ FROM python:3.11-slim -# Install system dependencies +# Install system dependencies (only runtime) RUN apt-get update && apt-get install -y \ tor onionshare-cli \ - jq qrencode imagemagick poppler-utils \ - nodejs npm \ && rm -rf /var/lib/apt/lists/* -# Install npm tools for HTML/JS processing -RUN npm install -g javascript-obfuscator html-minifier-terser - # Copy VoxVera source COPY . /opt/voxvera -ENV PYTHONPATH=/opt/voxvera +WORKDIR /opt/voxvera -# Make voxvera command available -RUN echo '#!/bin/sh\nexec python3 -m voxvera.cli "$@"' > /usr/local/bin/voxvera \ - && chmod +x /usr/local/bin/voxvera +# Install VoxVera and its Python dependencies +RUN pip install . # Prepare flyers volume RUN mkdir /flyers && ln -s /flyers /opt/voxvera/host VOLUME /flyers + +# VoxVera expects to run in /opt/voxvera for local assets WORKDIR /opt/voxvera CMD ["voxvera", "quickstart"] diff --git a/packaging/build_appimage.sh b/packaging/build_appimage.sh index 3804bdf..9c0a768 100755 --- a/packaging/build_appimage.sh +++ b/packaging/build_appimage.sh @@ -29,7 +29,7 @@ touch "$APPDIR/voxvera.png" wget -q https://github.com/AppImage/AppImageKit/releases/latest/download/appimagetool-x86_64.AppImage -O appimagetool chmod +x appimagetool -./appimagetool "$APPDIR" dist/VoxVera.AppImage +./appimagetool --appimage-extract-and-run "$APPDIR" dist/VoxVera.AppImage rm appimagetool echo "AppImage created at dist/VoxVera.AppImage"