Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): bump follow-redirects from 1.15.2 to 1.15.5 #357

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
5bd1269
Modify for ipv6.nostr.wirednet.jp
imksoo May 14, 2023
0f4f522
Merge branch 'main' of https://github.com/Cameri/nostream
imksoo May 14, 2023
7ed31fa
Merge branch 'main' of https://github.com/Cameri/nostream
imksoo Dec 11, 2023
7197159
Add event_tags table and update event-repository.ts
imksoo Dec 11, 2023
0ec2a4b
Update docker-compose.yml with new PostgreSQL and pgAdmin versions
imksoo Dec 11, 2023
c34d148
Remove foreign key constraint on event_id in event_tags table
imksoo Dec 11, 2023
4d13107
Fix tag name length check in insertTags method
imksoo Dec 11, 2023
8bd68e5
Update log_min_duration_statement in postgresql.conf
imksoo Dec 11, 2023
79bebc9
Refactor event tag insertion in EventRepository
imksoo Dec 12, 2023
e81bf71
Add PostgreSQL trigger for event tags
imksoo Dec 12, 2023
6824c0c
Add batch processing for event updates
imksoo Dec 12, 2023
9926dad
Refactor event tag processing logic
imksoo Dec 12, 2023
8b68de4
Add index on event_id in event_tags table
imksoo Dec 13, 2023
3bfcaed
Update PostgreSQL trigger and cursor query
imksoo Dec 14, 2023
e1cf50e
Add process_event_tags_direct function to handle event tags
imksoo Dec 14, 2023
49acefe
Add shm_size to nostream-db service in docker-compose.yml
imksoo Dec 14, 2023
a5ec630
Add index for event_tags table and optimize loop in trigger function
imksoo Dec 14, 2023
4fbba33
change docker-compose.yml
imksoo Jan 8, 2024
cc7ba4b
Merge branch 'main' of https://github.com/Cameri/nostream
imksoo Jan 8, 2024
246eb61
Merge branch 'main' of https://github.com/Cameri/nostream
imksoo Jan 13, 2024
af4d295
Revert "Merge branch 'main' of https://github.com/Cameri/nostream"
imksoo Jan 14, 2024
e0663b4
chore(deps): bump follow-redirects from 1.15.2 to 1.15.5
dependabot[bot] Jan 14, 2024
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: 0 additions & 3 deletions CONFIGURATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,3 @@ Running `nostream` for the first time creates the settings file in `<project_roo
| limits.message.rateLimits[].period | Rate limit period in milliseconds. |
| limits.message.rateLimits[].rate | Maximum number of messages during period. |
| limits.message.ipWhitelist | List of IPs (IPv4 or IPv6) to ignore rate limits. |
| limits.admissionCheck.rateLimits[].period | Rate limit period in milliseconds. |
| limits.admissionCheck.rateLimits[].rate | Maximum number of admission checks during period. |
| limits.admissionCheck.ipWhitelist | List of IPs (IPv4 or IPv6) to ignore rate limits. |
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ NIPs with a relay-specific implementation are listed here.
- [x] NIP-16: Event Treatment
- [x] NIP-20: Command Results
- [x] NIP-22: Event `created_at` Limits
- [ ] NIP-26: Delegated Event Signing (REMOVED)
- [x] NIP-26: Delegated Event Signing
- [x] NIP-28: Public Chat
- [x] NIP-33: Parameterized Replaceable Events
- [x] NIP-40: Expiration Timestamp
Expand Down
53 changes: 41 additions & 12 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
services:
nostream:
build: .
container_name: nostream
environment:
SECRET: ${SECRET}
RELAY_PORT: 8008
Expand All @@ -12,8 +11,8 @@ services:
DB_USER: nostr_ts_relay
DB_PASSWORD: nostr_ts_relay
DB_NAME: nostr_ts_relay
DB_MIN_POOL_SIZE: 16
DB_MAX_POOL_SIZE: 64
DB_MIN_POOL_SIZE: 4
DB_MAX_POOL_SIZE: 8
DB_ACQUIRE_CONNECTION_TIMEOUT: 60000
# Read Replica
READ_REPLICAS: 2
Expand Down Expand Up @@ -64,20 +63,24 @@ services:
volumes:
- ${PWD}/.nostr:/home/node/.nostr
ports:
- 127.0.0.1:8008:8008
- "8008:8008"
depends_on:
nostream-cache:
condition: service_healthy
nostream-db:
condition: service_healthy
nostream-migrate:
condition: service_completed_successfully
restart: on-failure
restart: always
networks:
default:
logging:
driver: journald
options:
tag: "{{.Name}}"
nostream-db:
image: postgres
container_name: nostream-db
image: postgres:15
shm_size: 1gb
environment:
POSTGRES_DB: nostr_ts_relay
POSTGRES_USER: nostr_ts_relay
Expand All @@ -96,9 +99,12 @@ services:
timeout: 5s
retries: 5
start_period: 360s
logging:
driver: journald
options:
tag: "{{.Name}}"
nostream-cache:
image: redis:7.0.5-alpine3.16
container_name: nostream-cache
volumes:
- cache:/data
command: redis-server --loglevel warning --requirepass nostr_ts_relay
Expand All @@ -110,9 +116,12 @@ services:
interval: 1s
timeout: 5s
retries: 5
logging:
driver: journald
options:
tag: "{{.Name}}"
nostream-migrate:
image: node:18-alpine3.16
container_name: nostream-migrate
environment:
DB_HOST: nostream-db
DB_PORT: 5432
Expand All @@ -131,15 +140,35 @@ services:
condition: service_healthy
networks:
default:
ipv4_address: 10.10.10.254
ipv4_address: 10.10.11.254
logging:
driver: journald
options:
tag: "{{.Name}}"
pgadmin:
image: dpage/pgadmin4:8
volumes:
- pgadmin:/var/lib/pgadmin
environment:
PGADMIN_DEFAULT_EMAIL: kirino.minato@gmail.com
PGADMIN_DEFAULT_PASSWORD: nostr_ts_relay
TZ: Asia/Tokyo
depends_on:
- nostream-db
ports:
- "5082:80"
networks:
default:
restart: always

networks:
default:
name: nostream
name: ipv6-relay
ipam:
driver: default
config:
- subnet: 10.10.10.0/24
- subnet: 10.10.11.0/24

volumes:
cache:
pgadmin:
40 changes: 40 additions & 0 deletions migrations/20231211_181212_add_event_tags.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
exports.up = async function (knex) {
await knex.schema.createTable('event_tags', function (table) {
table.uuid('id').primary().defaultTo(knex.raw('uuid_generate_v4()'));
table.binary('event_id').notNullable();
table.text('tag_name').notNullable();
table.text('tag_value').notNullable();
});

await knex.schema.table('event_tags', function (table) {
table.index(['tag_name', 'tag_value']);
});

const events = await knex.select('event_id', 'event_tags').from('events');
const totalEvents = events.length;
let processedEvents = 0;
let lastPercentage = 0;

for (const event of events) {
for (const tag of event.event_tags) {
const [tag_name, tag_value] = tag;
if (tag_name.length === 1 && tag_value) {
await knex('event_tags').insert({
events_event_id: event.event_id,
tag_name: tag_name,
tag_value: tag_value
});
}
}
processedEvents++;
const currentPercentage = Math.floor(processedEvents / totalEvents * 100);
if (currentPercentage > lastPercentage) {
console.log(`${new Date().toLocaleString()} Migration progress: ${currentPercentage}%`);
lastPercentage = currentPercentage;
}
}
};

exports.down = function (knex) {
return knex.schema.dropTable('event_tags');
};
18 changes: 0 additions & 18 deletions migrations/20240111204900_remove_delegator_from_events_table.js

This file was deleted.

Loading
Loading