Skip to content

Commit

Permalink
Merge pull request #22 from laozhoubuluo/v20240330
Browse files Browse the repository at this point in the history
Use 20240330
  • Loading branch information
mizunashi-mana committed Apr 11, 2024
2 parents f881bbf + 59d1456 commit 41f8c7c
Show file tree
Hide file tree
Showing 16 changed files with 124 additions and 87 deletions.
42 changes: 14 additions & 28 deletions common/assets/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ db:
port: 5432
#ssl: false
# Database name
db: firefish
db: firefish_db

# Auth
user: example-firefish-user
pass: example-firefish-pass
user: firefish
pass: password

# Whether disable Caching queries
#disableCache: true
Expand Down Expand Up @@ -99,28 +99,6 @@ redis:
#prefix: example-prefix
#db: 1

# Please configure either MeiliSearch *or* Sonic.
# If both MeiliSearch and Sonic configurations are present, MeiliSearch will take precedence.

# ┌───────────────────────────┐
#───┘ MeiliSearch configuration └─────────────────────────────────────
#meilisearch:
# host: meilisearch
# port: 7700
# ssl: false
# apiKey:

# ┌─────────────────────┐
#───┘ Sonic configuration └─────────────────────────────────────

#sonic:
# host: localhost
# port: 1491
# auth: SecretPassword
# collection: notes
# bucket: default


# ┌───────────────┐
#───┘ ID generation └───────────────────────────────────────────

Expand Down Expand Up @@ -181,6 +159,17 @@ reservedUsernames: [
# IP address family used for outgoing request (ipv4, ipv6 or dual)
#outgoingAddressFamily: ipv4

# Log Option
# Production env: ['error', 'success', 'warning', 'info']
# Debug/Test env or Troubleshooting: ['error', 'success', 'warning', 'debug' ,'info']
# Production env which storage space or IO is tight: ['error', 'warning']
logLevel: [
'error',
'success',
'warning',
'info'
]

# Syslog option
#syslog:
# host: localhost
Expand All @@ -206,9 +195,6 @@ reservedUsernames: [
# Proxy remote files (default: false)
#proxyRemoteFiles: true

# Use authorized fetch for outgoing requests
signToActivityPubGet: true

#allowedPrivateNetworks: [
# '127.0.0.1/32'
#]
Expand Down
2 changes: 1 addition & 1 deletion common/env/env.make
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
include common/env/params.make

PKG_VERSION_FIREFISH?=20240206
PKG_VERSION_FIREFISH?=20240330

FIREFISH_SOURCE_GIT_REPO?=https://firefish.dev/firefish/firefish
FIREFISH_SOURCE_GIT_COMMIT_REF?=v$(PKG_VERSION_FIREFISH)
Expand Down
7 changes: 4 additions & 3 deletions common/tasks/build
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ pnpm run build
rm -rf node_modules
pnpm i --force --prod --frozen-lockfile

(cd packages/backend/native-utils && cargo about init)
tee packages/backend/native-utils/about.toml <<EOS
# Generate the license file
(cd packages/backend-rs && cargo about init)
tee packages/backend-rs/about.toml <<EOS
accepted = [
"Apache-2.0",
"BSD-2-Clause",
Expand All @@ -26,4 +27,4 @@ accepted = [
"Unicode-DFS-2016",
]
EOS
(cd packages/backend/native-utils && cargo about generate about.hbs > cargo-licenses.html)
(cd packages/backend-rs && cargo about generate about.hbs > cargo-licenses.html)
20 changes: 9 additions & 11 deletions common/tasks/install
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,25 @@ rsync --recursive --relative --links \
pnpm-workspace.yaml \
release.json \
title.svg \
CHANGELOG.md \
COPYING \
LICENSE \
README.md \
RELEASE_NOTES.md \
SECURITY.md \
built \
node_modules \
docs/api-change.md \
docs/changelog.md \
packages/backend/package.json \
packages/backend/ormconfig.js \
packages/backend/assets \
packages/backend/migration \
packages/backend/built \
packages/backend/node_modules \
packages/backend/native-utils/package.json \
packages/backend/native-utils/Cargo.toml \
packages/backend/native-utils/Cargo.lock \
packages/backend/native-utils/cargo-licenses.html \
packages/backend/native-utils/npm \
packages/backend/native-utils/built \
packages/backend/native-utils/node_modules \
packages/backend-rs/package.json \
packages/backend-rs/Cargo.toml \
packages/backend-rs/Cargo.lock \
packages/backend-rs/cargo-licenses.html \
packages/backend-rs/npm \
packages/backend-rs/built \
packages/backend-rs/node_modules \
packages/firefish-js/package.json \
packages/firefish-js/LICENSE \
packages/firefish-js/README.md \
Expand Down
2 changes: 1 addition & 1 deletion deb/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ rm -rf \
~/.cache \
~/.cargo \
~/.rustup \
pkg/firefish-*/packages/backend/native-utils/target \
pkg/firefish-*/packages/backend-rs/target \
/var/lib/apt/lists/*
EOT

Expand Down
1 change: 1 addition & 0 deletions deb/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ $(PKG_FILES_DIR): $(SOURCE_TARBALL)
rm -rf '$@'
mkdir -p '$@'
tar zxf '$<' --strip-components 1 -C '$@'
rm -rf '$@/Makefile'

$(DEBIAN_FILES_DIR): scripts/create-debian-files files $(PKG_FILES_DIR)
$< $@
Expand Down
16 changes: 15 additions & 1 deletion deb/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ services:
depends_on:
- redis
- postgres
- postgres-setup
ports:
- "3000:3000"
networks:
Expand All @@ -25,14 +26,27 @@ services:
- redis-data:/data

postgres:
image: docker.io/postgres:15-alpine
image: docker.io/groonga/pgroonga:3.1.9-alpine-16-slim
networks:
- internal-net
env_file:
- ./docker/postgres.env
volumes:
- postgres-data:/var/lib/postgresql/data

postgres-setup:
build:
context: ./docker/postgres-setup
image: ghcr.io/mizunashi-mana/firefish-dist-pkg/postgres-setup-runner
networks:
- internal-net
depends_on:
- postgres
env_file:
- ./docker/postgres.env
environment:
- POSTGRES_HOST=postgres

networks:
internal-net:

Expand Down
50 changes: 23 additions & 27 deletions deb/docker/firefish_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ url: https://example.com/
# The port that your Firefish server should listen on.
port: 3000

# The bind host your Firefish server should listen on.
# If unspecified, the wildcard address will be used.
#bind: 127.0.0.1

# ┌──────────────────────────┐
#───┘ PostgreSQL configuration └────────────────────────────────

Expand Down Expand Up @@ -95,28 +99,6 @@ redis:
#prefix: example-prefix
#db: 1

# Please configure either MeiliSearch *or* Sonic.
# If both MeiliSearch and Sonic configurations are present, MeiliSearch will take precedence.

# ┌───────────────────────────┐
#───┘ MeiliSearch configuration └─────────────────────────────────────
#meilisearch:
# host: meilisearch
# port: 7700
# ssl: false
# apiKey:

# ┌─────────────────────┐
#───┘ Sonic configuration └─────────────────────────────────────

#sonic:
# host: localhost
# port: 1491
# auth: SecretPassword
# collection: notes
# bucket: default


# ┌───────────────┐
#───┘ ID generation └───────────────────────────────────────────

Expand Down Expand Up @@ -153,11 +135,11 @@ reservedUsernames: [
# Whether disable HSTS
#disableHsts: true

# Number of worker processes
#clusterLimit: 1

# Worker only mode
#onlyQueueProcessor: 1
# Number of worker processes by type.
# The sum must not exceed the number of available cores.
#clusterLimits:
# web: 1
# queue: 1

# Job concurrency per worker
# deliverJobConcurrency: 128
Expand All @@ -171,9 +153,23 @@ reservedUsernames: [
# deliverJobMaxAttempts: 12
# inboxJobMaxAttempts: 8

# Local address used for outgoing requests
#outgoingAddress: 127.0.0.1

# IP address family used for outgoing request (ipv4, ipv6 or dual)
#outgoingAddressFamily: ipv4

# Log Option
# Production env: ['error', 'success', 'warning', 'info']
# Debug/Test env or Troubleshooting: ['error', 'success', 'warning', 'debug' ,'info']
# Production env which storage space or IO is tight: ['error', 'warning']
logLevel: [
'error',
'success',
'warning',
'info'
]

# Syslog option
#syslog:
# host: localhost
Expand Down
20 changes: 20 additions & 0 deletions deb/docker/postgres-setup/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# syntax=docker/dockerfile:1
FROM debian:bookworm

SHELL [ "bash", "-euxo", "pipefail", "-c" ]

RUN <<EOT
apt-get update
DEBIAN_FRONTEND=noninteractive \
apt-get install -y postgresql-client

apt-get clean
rm -rf \
/var/lib/apt/lists/*
EOT

COPY setup.bash /usr/local/bin/setup.bash

STOPSIGNAL SIGKILL

CMD [ "bash", "setup.bash" ]
16 changes: 16 additions & 0 deletions deb/docker/postgres-setup/setup.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env bash

set -euo pipefail
[ "${TRACE:-}" = 'true' ] && set -x

while ! env "PGPASSWORD=${POSTGRES_PASSWORD}" \
psql \
"--host=${POSTGRES_HOST}" \
"--user=${POSTGRES_USER}" \
"--dbname=${POSTGRES_DB}" \
"--command=CREATE EXTENSION IF NOT EXISTS pgroonga;"; do
echo 'Retrying...'
sleep 1
done

tail -f /var/log/faillog
3 changes: 1 addition & 2 deletions deb/files/assets/bin/firefish-migrate
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ set -euo pipefail
WORKDIR=/var/lib/firefish/live/packages/backend
cd "$WORKDIR"

npx typeorm migration:run --dataSource ormconfig.js
./native-utils/built/migration up
npx typeorm migration:run --dataSource built/ormconfig.js
7 changes: 7 additions & 0 deletions deb/files/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
firefish (20240330-d202404010001+release) unstable; urgency=high

* Fix bugs (including a critical security issue).
* Upstream Release Note: https://firefish.dev/firefish/firefish/-/blob/v20240330/docs/changelog.md

-- Mizunashi Mana <contact@mizunashi.work> Mon, 01 Apr 2024 02:00:00 +0900

firefish (20240206-d202402240001+release) unstable; urgency=medium

* Upstream Release Note: https://firefish.dev/firefish/firefish/-/releases/v20240206
Expand Down
3 changes: 1 addition & 2 deletions deb/files/control
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Build-Depends:
rsync,
nodejs (>= 20.0.0),
Standards-Version: 4.6.2
Homepage: https://joinfirefish.org/
Homepage: https://firefish.dev/
Vcs-Git: https://github.com/mizunashi-mana/firefish-dist-pkg.git
Vcs-browser: https://github.com/mizunashi-mana/firefish-dist-pkg

Expand All @@ -17,7 +17,6 @@ Architecture: any
Depends:
nodejs (>= 20.0.0),
ffmpeg,
libvips,
${misc:Depends},
Suggests:
postgresql,
Expand Down
4 changes: 2 additions & 2 deletions deb/files/copyright
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Source: https://git.joinfirefish.org/firefish/firefish
Source: https://firefish.dev/firefish/firefish
Upstream-Name: firefish
Upstream-Contact: info@firefish.social
Upstream-Contact: https://firefish.dev/firefish/firefish

Files:
var/lib/firefish/live/*
Expand Down
6 changes: 3 additions & 3 deletions deb/files/rules
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ override_dh_auto_clean:
find . -maxdepth 4 -name node_modules -type d -exec rm -rf {} +
find . -maxdepth 4 -name built -type d -exec rm -rf {} +
rm -rf \
packages/backend/native-utils/about.* \
packages/backend/native-utils/cargo-licenses.html
packages/backend-rs/about.* \
packages/backend-rs/cargo-licenses.html
rm -rf \
packages/backend/assets/instance.css \
packages/backend/native-utils/target \
packages/backend-rs/target \
packages/megalodon/lib

override_dh_dwz:
Expand Down
12 changes: 6 additions & 6 deletions deb/files/upstream/metadata
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Bug-Database: https://git.joinfirefish.org/firefish/firefish/-/issues
Bug-Submit: https://git.joinfirefish.org/firefish/firefish/-/issues/new
Changelog: https://git.joinfirefish.org/firefish/firefish/-/blob/main/RELEASE_NOTES.md
Documentation: https://joinfirefish.org/
Repository-Browse: https://git.joinfirefish.org/firefish/firefish
Repository: https://git.joinfirefish.org/firefish/firefish.git
Bug-Database: https://firefish.dev/firefish/firefish/-/issues
Bug-Submit: https://firefish.dev/firefish/firefish/-/issues/new
Changelog: https://firefish.dev/firefish/firefish/-/blob/develop/docs/changelog.md
Documentation: https://firefish.dev/firefish/firefish/-/tree/develop/docs
Repository-Browse: https://firefish.dev/firefish/firefish
Repository: https://firefish.dev/firefish/firefish.git

0 comments on commit 41f8c7c

Please sign in to comment.