From 1281a3c5958df0673a26f76d2e8f7f559eebfc14 Mon Sep 17 00:00:00 2001 From: Fedor Katurov Date: Mon, 24 Mar 2025 15:41:23 +0700 Subject: [PATCH 1/2] fix images pattern --- .drone.yml | 4 ++-- .env.local | 4 ++-- next.config.js | 48 ++++++++++++++++++++++++++---------------------- 3 files changed, 30 insertions(+), 26 deletions(-) diff --git a/.drone.yml b/.drone.yml index 0d9eefa7..d8cf63c1 100644 --- a/.drone.yml +++ b/.drone.yml @@ -13,8 +13,8 @@ steps: branch: - master environment: - NEXT_PUBLIC_API_HOST: https://pig.vault48.org/ - NEXT_PUBLIC_REMOTE_CURRENT: https://pig.vault48.org/static/ + NEXT_PUBLIC_API_HOST: https://vault48.org/api/ + NEXT_PUBLIC_REMOTE_CURRENT: https://vault48.org/static/ NEXT_PUBLIC_PUBLIC_HOST: https://vault48.org/ NEXT_PUBLIC_BOT_USERNAME: vault48bot settings: diff --git a/.env.local b/.env.local index 7ce09d99..cf359933 100644 --- a/.env.local +++ b/.env.local @@ -2,6 +2,6 @@ # NEXT_PUBLIC_REMOTE_CURRENT=https://pig.staging.vault48.org/static/ # NEXT_PUBLIC_API_HOST=http://localhost:7777/ # NEXT_PUBLIC_REMOTE_CURRENT=http://localhost:7777/static/ -NEXT_PUBLIC_API_HOST=https://pig.vault48.org/ -NEXT_PUBLIC_REMOTE_CURRENT=https://pig.vault48.org/static/ +NEXT_PUBLIC_API_HOST=https://vault48.org/api/ +NEXT_PUBLIC_REMOTE_CURRENT=https://vault48.org/static/ NEXT_PUBLIC_BOT_USERNAME=vault48testbot \ No newline at end of file diff --git a/next.config.js b/next.config.js index 8fb923d7..64e56747 100644 --- a/next.config.js +++ b/next.config.js @@ -2,7 +2,10 @@ const withBundleAnalyzer = require('@next/bundle-analyzer')({ enabled: process.env.ANALYZE === 'true', }); -const withTM = require('next-transpile-modules')(['ramda', '@v9v/ts-react-telegram-login']); +const withTM = require('next-transpile-modules')([ + 'ramda', + '@v9v/ts-react-telegram-login', +]); module.exports = withBundleAnalyzer( withTM({ @@ -10,36 +13,37 @@ module.exports = withBundleAnalyzer( async rewrites() { return [ { - source: '/post:id', + // everything except 'post' is for backwards compatibility here + source: '/(post|photo|blog|song|video|cell):id', destination: '/node/:id', }, { source: '/~:username', destination: '/profile/:username', - } + }, ]; }, /** don't try to optimize fonts */ optimizeFonts: false, images: { - remotePatterns: [ - { - protocol: 'https', - hostname: '*.vault48.org', - pathname: '/**', - }, - { - protocol: 'https', - hostname: '*.ytimg.com', - pathname: '/**', - }, - { - protocol: 'http', - hostname: 'localhost', - pathname: '/**', - }, - ], - }, - }) + remotePatterns: [ + { + protocol: 'https', + hostname: 'vault48.org', + pathname: '/static/**', + }, + { + protocol: 'https', + hostname: '*.ytimg.com', + pathname: '/**', + }, + { + protocol: 'http', + hostname: 'localhost', + pathname: '/**', + }, + ], + }, + }), ); From a553fc9ff7eac15b58c17fd7d85701b974f7a58f Mon Sep 17 00:00:00 2001 From: Fedor Katurov Date: Mon, 24 Mar 2025 15:47:11 +0700 Subject: [PATCH 2/2] add forgejo workflow --- .forgejo/workflows/build.yml | 46 ++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .forgejo/workflows/build.yml diff --git a/.forgejo/workflows/build.yml b/.forgejo/workflows/build.yml new file mode 100644 index 00000000..25d067df --- /dev/null +++ b/.forgejo/workflows/build.yml @@ -0,0 +1,46 @@ +name: Build & Publish + +on: + push: + branches: [master] + +jobs: + push_to_registry: + name: Build & Publish + runs-on: ubuntu-22.04 + permissions: + packages: write + contents: read + attestations: write + id-token: write + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Registry Login + uses: docker/login-action@v3 + with: + registry: git.vault48.org + username: ${{ secrets.username }} + password: ${{ secrets.password }} + + - name: Extract docker metadata + id: meta + uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 + with: + images: git.vault48.org/${{ env.GITHUB_REPOSITORY }} + + - name: Build and push Docker image + id: push + uses: docker/build-push-action@v6 + with: + context: . + file: ./docker/nextjs/Dockerfile + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + build-args: | + NEXT_PUBLIC_API_HOST=https://vault48.org/api/ + NEXT_PUBLIC_REMOTE_CURRENT=https://vault48.org/static/ + NEXT_PUBLIC_PUBLIC_HOST=https://vault48.org/ + NEXT_PUBLIC_BOT_USERNAME=vault48bot \ No newline at end of file