diff --git a/.github/workflows/deepnote-build.yml b/.github/workflows/deepnote-build.yml new file mode 100644 index 0000000..cd76dce --- /dev/null +++ b/.github/workflows/deepnote-build.yml @@ -0,0 +1,45 @@ +name: Build and Push + +on: + push: + branches: [ "main" ] + paths: + - 'deepnote/**' + - '.github/workflows/deepnote-build.yml' + workflow_dispatch: # Allow manual triggering + +env: + REGISTRY: ghcr.io + IMAGE_NAME: deepnote-mpdev + +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Log in to the Container registry + uses: docker/login-action@v2 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v4 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + + - name: Build and push Docker image + uses: docker/build-push-action@v4 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/.gitmodules b/.gitmodules index 05b95e1..2317524 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ [submodule "katbin/source"] path = katbin/source url = https://github.com/SphericalKat/katbin +[submodule "one-hub"] + path = one-hub + url = https://github.com/MartialBE/one-hub diff --git a/README.md b/README.md index d7aa2b9..afd12b2 100644 --- a/README.md +++ b/README.md @@ -31,8 +31,13 @@ graph TD Custom Caddy server with additional modules. See `caddy/README.md` for details. ### Katbin +> only as a showcase for git submodules, not really needed A pastebin service written in Elixir. See `katbin/README.md` for details. This service is included as a git submodule and built from source. +### opengist + +### transfer.sh + ### [Other Service] [Brief description of other service. Add as implemented.] diff --git a/deepnote/Dockerfile b/deepnote/Dockerfile new file mode 100644 index 0000000..2a38292 --- /dev/null +++ b/deepnote/Dockerfile @@ -0,0 +1,51 @@ +FROM bitnami/python:3.12-debian-12 + +# Switch to root user +USER root + +# Install system dependencies +RUN apt-get update && apt-get install -y \ + vim \ + screen \ + lsof \ + netcat-openbsd \ + mtr-tiny \ + zsh \ + wget \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + +# Create necessary directories +RUN mkdir -p /root/work/bin + +# Download and install Syncthing +RUN SYNCTHING_VERSION=$(curl -s https://api.github.com/repos/syncthing/syncthing/releases/latest | grep -oP '"tag_name": "\K(.*)(?=")') && \ + wget https://github.com/syncthing/syncthing/releases/download/${SYNCTHING_VERSION}/syncthing-linux-amd64-${SYNCTHING_VERSION}.tar.gz -O syncthing.tar.gz && \ + tar -xzf syncthing.tar.gz && \ + mv syncthing-linux-amd64-${SYNCTHING_VERSION}/syncthing /root/work/bin/ && \ + rm -rf syncthing-linux-amd64-${SYNCTHING_VERSION} syncthing.tar.gz + +# Install Bun +RUN curl -fsSL https://bun.sh/install | bash \ + && mv /root/.bun /root/work/bun + +# Set up PATH +ENV PATH="/root/work/bin:/root/work/bun/bin:${PATH}" + +# Set up Python virtual environment +RUN python -m venv venv \ + && . venv/bin/activate \ + && rm -rf ~/.cache/pip +ENV PATH="/root/work/venv/bin:${PATH}" + +# Copy requirements.txt and install Python dependencies +COPY requirements.txt /root/work/ +WORKDIR /root/work + +# Set default shell to zsh +SHELL ["/bin/zsh", "-c"] + +# Activate virtual environment in zsh +RUN echo "source /root/work/venv/bin/activate" >> ~/.zshrc + +CMD ["/bin/zsh"] diff --git a/deepnote/requirements.txt b/deepnote/requirements.txt new file mode 100644 index 0000000..701471d --- /dev/null +++ b/deepnote/requirements.txt @@ -0,0 +1,3 @@ +pydantic +httpx +fastapi diff --git a/katbin/Dockerfile b/katbin/Dockerfile index 413d8a7..4e97f47 100644 --- a/katbin/Dockerfile +++ b/katbin/Dockerfile @@ -55,7 +55,7 @@ USER nobody ENV HOME=/app # Set default environment variables -ENV DATABASE_URL='postgres://postgres:postgres@db:5432/katbin' +ENV DATABASE_URL=postgres://postgres:katbin@db:5432/katbin ENV SECRET_KEY_BASE='default_secret_key_base_change_me_in_production' ENV SWOOSH_USERNAME='noreply@katb.in' ENV SWOOSH_PASSWORD='default_password_change_me' diff --git a/katbin/README.md b/katbin/README.md index a53cf48..aba72a7 100644 --- a/katbin/README.md +++ b/katbin/README.md @@ -28,10 +28,11 @@ services: katbin: image: ghcr.io/somehow22/katbin + container_name: katbin depends_on: - katbin-db ports: - - "8080:8080" + - "4000:4000" env_file: - .env networks: @@ -71,6 +72,6 @@ networks: ``` Look for any error messages or confirmation that the service has started successfully. -6. Access Katbin at `http://localhost:8080` +6. Access Katbin at `http://localhost:4000` For more details on Katbin, please refer to the original project: [https://github.com/sphericalkat/katbin](https://github.com/sphericalkat/katbin) \ No newline at end of file diff --git a/one-hub b/one-hub new file mode 160000 index 0000000..7a64889 --- /dev/null +++ b/one-hub @@ -0,0 +1 @@ +Subproject commit 7a64889d586b58fa29fa66af0b76de5077934a4d