repo_name
stringlengths
1
62
dataset
stringclasses
1 value
lang
stringclasses
11 values
pr_id
int64
1
20.1k
owner
stringlengths
2
34
reviewer
stringlengths
2
39
diff_hunk
stringlengths
15
262k
code_review_comment
stringlengths
1
99.6k
mbin
github_2023
others
474
MbinOrg
melroy89
@@ -167,23 +167,23 @@ add_new_video: Добавяне на ново видео rules: Правила columns: Колони alphabetically: По азбучен ред -up_votes: Подсилвания +up_votes: Препубликации
You sure about this? It's actually more Подсилвания
mbin
github_2023
others
488
MbinOrg
BentiGorlich
@@ -58,6 +58,7 @@ security: # This makes the logout route accessible during two-factor authentication. Allows the user to # cancel two-factor authentication, if they need to. - { path: ^/logout, role: PUBLIC_ACCESS } + - { path: ^/custom-style, role: PUBLIC_ACCESS }
can you put a comment here why this is needs to be publicly accessible?
mbin
github_2023
others
433
MbinOrg
asdfzdfj
@@ -237,6 +240,8 @@ realpath_cache_ttl = 600 Optionally also enable OPCache for improved performances with PHP: ```ini +zend_extension=opcache
I may be missing something but isn't this already added/loaded when installing `php8.2-opcache` package? (from quick check in php sury that the guide recommends this should've been done already), or was there some situation where this isn't the case?
mbin
github_2023
others
433
MbinOrg
asdfzdfj
@@ -421,6 +426,15 @@ npm run build # Builds frontend Make sure you have substituted all the passwords and configured the basic services. +#### Let's Encrypt (TLS) + +Follow the prompts to create TLS certificates; if you didn't already have nginx up, you can use +standalone mode. + +```bash +sudo certbot certonly +...
missing instructions? like maybe you probably need to specify `-d mbin.domain.tld` to specify the domain(s) to request certs for or something (I can't help you fill in this as I haven't used certbot, If anyone has more info and could help fill this in that'd be appreciated)
mbin
github_2023
others
433
MbinOrg
melroy89
@@ -27,7 +27,7 @@ sudo apt-get update && sudo apt-get upgrade -y Install prequirements: ```bash -sudo apt-get install lsb-release ca-certificates curl wget unzip gnupg apt-transport-https software-properties-common python3-launchpadlib git redis-server postgresql postgresql-contrib nginx acl -y +sudo apt-get instal...
no. certbot from APT is very outdated and NOT adviced. Hence the reason to use snap if you have Ubuntu or Debian. See: https://certbot.eff.org/instructions?ws=nginx&os=debiantesting
mbin
github_2023
others
433
MbinOrg
melroy89
@@ -421,6 +426,15 @@ npm run build # Builds frontend Make sure you have substituted all the passwords and configured the basic services. +#### Let's Encrypt (TLS) + +Follow the prompts to create TLS certificates; if you didn't already have nginx up, you can use
it's called NGINX (with caps).
mbin
github_2023
others
433
MbinOrg
melroy89
@@ -659,39 +672,6 @@ Restart (or reload) NGINX: sudo systemctl restart nginx ``` -#### Let's Encrypt (TLS)
Restore this section. Again Certbot shouldn't be installed from APT. The package might be too old.
mbin
github_2023
others
433
MbinOrg
melroy89
@@ -421,6 +424,36 @@ npm run build # Builds frontend Make sure you have substituted all the passwords and configured the basic services. +#### Let's Encrypt (TLS) + +> **Note** +> The certbot authors recommend installing through snap as some distros' versions from apt tend to fall out of date; see https://eff-cert...
```suggestion > The Certbot authors recommend installing through snap as some distros' versions from APT tend to fall out-of-date; see https://eff-certbot.readthedocs.io/en/latest/install.html#snap-recommended for more. ```
mbin
github_2023
others
433
MbinOrg
melroy89
@@ -421,6 +424,36 @@ npm run build # Builds frontend Make sure you have substituted all the passwords and configured the basic services. +#### Let's Encrypt (TLS) + +> **Note** +> The Certbot authors recommend installing through snap as some distros' versions from APT tend to fall out-of-date; see https://eff-cert...
```suggestion sudo certbot certonly # Or if you wish not to use the standalone mode but the Nginx plugin: sudo certbot --nginx -d domain.tld ```
mbin
github_2023
others
433
MbinOrg
melroy89
@@ -443,7 +479,6 @@ Edit the main NGINX config file: `sudo nano /etc/nginx/nginx.conf` with the foll ```nginx ssl_protocols TLSv1.2 TLSv1.3; # Requires nginx >= 1.13.0 else only use TLSv1.2 -ssl_prefer_server_ciphers on;
Yea you're right you most likely want to have this set to `off` (default is off). Which was already documented on line 484 I see.
mbin
github_2023
others
433
MbinOrg
melroy89
@@ -178,11 +178,14 @@ KBIN_STORAGE_URL=https://domain.tld/media POSTGRES_VERSION=14 # Configure email, eg. using SMTP -MAILER_DSN=smtp://127.0.0.1:25?encryption=ssl&auth_mode=login&username=&password= +MAILER_DSN=smtp://127.0.0.1 # When you have a local SMTP server listening # But if already have Postfix configure...
Do not uncomment all the lines. Just, since this will fail as well. I used the first `MAILER_DSN` as default. If the user want to user another setting they need to comment that line and uncomment another line.
mbin
github_2023
others
433
MbinOrg
melroy89
@@ -178,11 +178,14 @@ KBIN_STORAGE_URL=https://domain.tld/media POSTGRES_VERSION=14 # Configure email, eg. using SMTP -MAILER_DSN=smtp://127.0.0.1:25?encryption=ssl&auth_mode=login&username=&password= +MAILER_DSN=smtp://127.0.0.1 # When you have a local SMTP server listening # But if already have Postfix configure...
```suggestion # Or remote SMTP with SSL on port 465 MAILER_DSN=smtp://username:password@smtpserver.tld:465?encryption=ssl&auth_mode=log ```
mbin
github_2023
others
433
MbinOrg
melroy89
@@ -178,11 +178,15 @@ KBIN_STORAGE_URL=https://domain.tld/media POSTGRES_VERSION=14 # Configure email, eg. using SMTP -MAILER_DSN=smtp://127.0.0.1:25?encryption=ssl&auth_mode=login&username=&password= +MAILER_DSN=smtp://127.0.0.1 # When you have a local SMTP server listening # But if already have Postfix configure...
```suggestion # Or remote SMTP with TLS on port 587: ```
mbin
github_2023
others
425
MbinOrg
BentiGorlich
@@ -50,6 +50,7 @@ For developers: - [Official repository on GitHub](https://github.com/MbinOrg/mbin) - [Matrix Space for discussions](https://matrix.to/#/#mbin:melroy.org) +- [Unofficial magazine for discussions within fediverse](https://kbin.run/m/Mdev)
`within the fediverse` would be better I think
mbin
github_2023
others
397
MbinOrg
BentiGorlich
@@ -1,6 +1,7 @@ {%- set V_TRUE = constant('App\\Controller\\User\\ThemeSettingsController::TRUE') -%} {%- set V_FALSE = constant('App\\Controller\\User\\ThemeSettingsController::FALSE') -%} {%- set V_TREE = constant('App\\Controller\\User\\ThemeSettingsController::TREE') -%} +{%- set V_CLASSIC = constant('App\\Contr...
what is this for? I didn't fine any use of it in your changes
mbin
github_2023
php
402
MbinOrg
e-five256
@@ -108,8 +108,12 @@ public function createCcFromBody(string $body): array * * @return User|Magazine|null or Magazine or null on error */ - public function findActorOrCreate(string $actorUrlOrHandle): null|User|Magazine + public function findActorOrCreate(?string $actorUrlOrHandle): null|User|Ma...
slightly curious when this and `handle()` were being called with null args, maybe that is more wrong than this accepting null?
mbin
github_2023
others
355
MbinOrg
e-five256
@@ -175,4 +175,13 @@ $aspect-ratios: ( --kbin-footer-link-color: #fff; --kbin-footer-link-hover-color: var(--kbin-header-link-hover-color); + // details + --mbin-details-border: var(--kbin-section-border); + --mbin-details-separator-border: var(--kbin-meta-border); + + --mbin-details-detail-color: var(--kbi...
might be wrong but guessing these don't get translated. since they only appear when a user doesn't specify a summary, doesn't seem worth holding up the change to me
mbin
github_2023
others
342
MbinOrg
melroy89
@@ -0,0 +1,43 @@ +{# this fragment is only meant to be used in entry component #}
this is just a comment right.. ? or a todo?
mbin
github_2023
others
333
MbinOrg
e-five256
@@ -81,9 +81,9 @@ {% if entry.image %} {% if entry.type is same as 'link' or entry.type is same as 'video' %} <figure> - <div class="image-filler" - style="background-image: url({{ asset(entry.image...
this might need a fallback? I'm getting `Error rendering "blurhash_image" component: Expected argument of type "string", "null" given at property path "blurhash".`
mbin
github_2023
others
333
MbinOrg
e-five256
@@ -171,6 +171,7 @@ $comment-margin-sm: .3rem; figure img { margin: .5rem 0; max-width: 100%; + border: var(--kbin-avatar-border);
I'm slightly curious what situations you weren't seeing this in. It looks like it goes away at breakpoint < sm but looking at your instance that still might be true
mbin
github_2023
php
329
MbinOrg
e-five256
@@ -18,6 +18,16 @@ class EntryPageFactory { + public const ADDITIONAL_CONTEXTS = [ + 'lemmy' => 'https://join-lemmy.org/ns#',
I'm a bit confused by this and peertube. I had assumed this is the context applied to outgoing AP events. I wouldn't think we would want to advertise other software, as I assume that is what lemmy/peertube are doing with their activities. Not sure what docs there are for appropriate contexts, https://www.w3.org/TR/acti...
mbin
github_2023
php
331
MbinOrg
e-five256
@@ -254,6 +260,10 @@ public function ban(User $user): void { $user->isBanned = true; + if ($user->isAdmin() || $user->isModerator()) {
I think it might be safer if this comes before `$user->isBanned = true;` I assume it's ok as long as a flush isn't executed (or is it? does the change get thrown out if the function returns without a persist/flush or does it happen next time those are called?), but just in case anyone adds code after ln 261 without rea...
mbin
github_2023
others
325
MbinOrg
e-five256
@@ -778,3 +778,5 @@ user_badge_moderator: Mod user_badge_bot: Bot announcement: Announcement keywords: Keywords +deleted_by_moderator: Thread, post or comment is deleted by the moderator.
I do think we should translate these but I think it should remain more technical than a sentence. reddit/lemmy use `[deleted by moderator]` `[deleted by author]`, I think? Writing a sentence makes it seem no different than a message someone sent
mbin
github_2023
others
325
MbinOrg
e-five256
@@ -49,9 +49,9 @@ </h2> {% endif %} {% elseif(entry.visibility is same as 'trashed') %} - <p class="text-muted">{{ 'deleted_by_moderator' }}</p> + <p class="text-muted"><i>{{ 'deleted_by_moderator'|trans }}</i></p>
Not sure on `<i>` tags here, I thought `<i>` and `<b>` had both been deprecated out of html, but it looks like https://developer.mozilla.org/en-US/docs/Web/HTML/Element/em#i_vs._em `<i>` can still be used for "technical terms" but it's hard to say what that exactly means, perhaps if this is a reference code or somethin...
mbin
github_2023
others
325
MbinOrg
e-five256
@@ -49,9 +49,9 @@ </h2> {% endif %} {% elseif(entry.visibility is same as 'trashed') %} - <p class="text-muted">{{ 'deleted_by_moderator' }}</p> + <p class="text-muted font-italic">&lsqb;<i>{{ 'deleted_by_moderator'|tra...
`font-italic` might be leftover here? Looks like is isn't a class in any `scss` file so might be able to remove it, as it's not on any of the others
mbin
github_2023
others
325
MbinOrg
e-five256
@@ -778,3 +778,5 @@ user_badge_moderator: Mod user_badge_bot: Bot announcement: Announcement keywords: Keywords +deleted_by_moderator: Thread, post or comment is deleted by the moderator +deleted_by_author: Thread, post or comment is deleted by the author
```suggestion deleted_by_moderator: Thread, post or comment was deleted by the moderator deleted_by_author: Thread, post or comment was deleted by the author ``` suggest changing action to past tense
mbin
github_2023
others
297
MbinOrg
e-five256
@@ -749,18 +749,18 @@ restore_magazine: Restore magazine purge_magazine: Purge magazine magazine_is_deleted: Magazine is deleted. You can <a href="%link_target%">restore</a> it within 30 days. -suspend_account: Suspend account +mute_account: Mute account request_account_deletion_revoke_button: Revoke the account ...
Not quite sure on the wording of this, The intent seemed to be not only to hide their content, but make them unable to reply, in which case I would think it should mention they can't reply anymore, and am not sure it makes sense to mention things will federate if they can't make posts, but I guess they can still subscr...
mbin
github_2023
others
297
MbinOrg
e-five256
@@ -37,7 +37,7 @@ {{ component('entries_cross', {entry: entry}) }} {% include 'layout/_flash.html.twig' %} {% include 'entry/comment/_options.html.twig' %} - {% include('user/_visibility_info.html.twig') %} + {% include('user/_muted_info.html.twig') %} {% if u...
all of these likely need to change to check muted instead now edit: if the goal is to make them unable to reply, asked for clarification in the comment above I started to collect a list but it's easily dozens of places in https://github.com/MbinOrg/mbin/pull/212/files#diff-4474cfa4c5acf2dcb955841f0e57b248d4ee61e6954...
mbin
github_2023
php
297
MbinOrg
e-five256
@@ -0,0 +1,33 @@ +<?php + +declare(strict_types=1); + +namespace DoctrineMigrations; + +use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; + +/** + * Auto-generated Migration: Please modify to your needs! + */ +final class Version20231125005121 extends AbstractMigration +{ + public function...
I'm a bit torn on how important it is to reverse the state the DB is in now. for instance the up could do something like ```sql update public.user set visibility = 'visible', muted = true where visibility = 'trashed' and marked_for_deletion_at is null; ``` (I _think_ the only way to get a trashed user besides s...
mbin
github_2023
javascript
313
MbinOrg
e-five256
@@ -8,6 +8,8 @@ export default class extends Controller { } handleInput (event) { + let wrapKeys = ['`', '*', '_', '"', '\''];
should `~` be added to this for strikethrough?
mbin
github_2023
javascript
313
MbinOrg
e-five256
@@ -23,9 +25,12 @@ export default class extends Controller { this.toggleFormattingEnclosure('_'); } - // grave to toggle inline code - else if (event.key === "`") { - this.toggleFormattingEnclosure('`'); + // toggle wrapping on selection texts + else if ( +...
both `*` and `_` evaluate to italic. this might be too crazy, but would it be possible to get doing `*` to add `**` on both sides instead so it adds bold? or should we not assume that was the users intent?
mbin
github_2023
php
263
MbinOrg
e-five256
@@ -128,6 +130,13 @@ public function download(string $url): ?string return $tempFile; } + public function cleanExif(string $filePath) + { + if ($this->exifCleaner->isEnabled()) {
do you think it'd be cheaper if we also checked whether there still was exif data (was already scrubbed) with something like `exif_read_data()` and early out if not?
mbin
github_2023
others
263
MbinOrg
melroy89
@@ -72,6 +72,12 @@ OAUTH_KEYCLOAK_VERSION= # If true, sign ins and sign ups will only be possible through the OAuth providers configured above SSO_ONLY_MODE= +# image exif cleaning options +# available value: none, sanitize, scrub +EXIF_CLEAN_MODE=sanitize
keep in mind, to also set some defaults. To avoid regression during updating for server owners who do not yet have this option in the config.
mbin
github_2023
php
263
MbinOrg
e-five256
@@ -0,0 +1,102 @@ +<?php + +declare(strict_types=1); + +namespace App\Utils; + +use Psr\Log\LoggerInterface; +use Symfony\Component\DependencyInjection\ParameterBag\ContainerBagInterface; +use Symfony\Component\Process\Exception\ProcessFailedException; +use Symfony\Component\Process\ExecutableFinder; +use Symfony\Compo...
getting a 500 with no `.env` changes: ``` Cannot assign string to property App\Utils\ExifCleaner::$timeout of type int ``` not sure if `(int:default:` would help here https://github.com/MbinOrg/mbin/blob/d795f4810da7e9b2333c43d4d4177bcd996d418f/config/services.yaml#L78 I think melroy had some issues with int pa...
mbin
github_2023
php
287
MbinOrg
BentiGorlich
@@ -20,11 +25,19 @@ class ImageRepository extends ServiceEntityRepository { private ImageManager $imageManager; - - public function __construct(ManagerRegistry $registry, ImageManager $imageManager) - { + private LoggerInterface $logger; + private EventDispatcherInterface $dispatcher; + + public f...
if you put a `public` or `private` in front of the types you don't have to manually add the class variables and initialize them
mbin
github_2023
others
270
MbinOrg
e-five256
@@ -1,144 +1,140 @@ ap_webfinger: - controller: App\Controller\ActivityPub\WebFingerController - path: '/.well-known/webfinger' - methods: [ GET ] + controller: App\Controller\ActivityPub\WebFingerController + path: '/.well-known/webfinger' + methods: [GET] ap_hostmeta: - controller: App\Controller\Act...
`.well-known/nodeinfo` seems to generate a 500 for me: ``` Unable to generate a URL for the named route "ap_node_info_v21" as such route does not exist. ``` ~~(will swap back to main and see if that's always been the case or not, never checked since I have federation off in dev)~~ appears to work on main
mbin
github_2023
others
270
MbinOrg
e-five256
@@ -1,35 +1,24 @@ <?xml version="1.0" encoding="UTF-8"?> - -<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/6.0/phpunit.xsd" - backupGlobals="false" - colors="true" - bootstrap="tests/bootstrap.php" -> - <php> ...
this is slightly strange to me that `include` and `exclude` were inside `coverage` and now it's not but I'm not sure I know enough to know why it changed ~edit: it kind of reads like it might still want to be inside https://docs.phpunit.de/en/10.4/code-coverage.html#including-files~ incorrect
mbin
github_2023
php
270
MbinOrg
e-five256
@@ -25,60 +22,31 @@ class Unique extends Constraint self::NOT_UNIQUE_ERROR => 'NOT_UNIQUE_ERROR', ]; - public $message = 'This value is already used.'; + public string $message = 'This value is already used.'; /** - * @var string + * @param non-empty-array<int|string, string> $field...
I'm wondering if this also needs to do `(null === $this->entityClass || '' === $this->entityClass)` or that gets checked elsewhere. I'm at least still able to hit unique validator errors so perhaps I'm mistaken, just noticed other things did when doing `'' ===`
mbin
github_2023
others
268
MbinOrg
e-five256
@@ -306,9 +306,16 @@ docker compose exec redis redis-cli ## Backup and restore +Backup: + +```bash +docker compose exec -it db pg_dump -U kbin kbin > dump.sql +``` + +Restore: + ```bash -docker exec -it container_id pg_dump -U kbin mbin > dump.sql -docker compose exec -T database psql -U kbin mbin < dump.sql +cat...
hmm, this gets me `the input device is not a TTY`. I tried without `-i`, with `-it`, with `-t`
mbin
github_2023
others
268
MbinOrg
e-five256
@@ -139,9 +169,14 @@ services: # More info: https://hub.docker.com/r/ixdotai/smtp #mailserver: # image: ixdotai/smtp:latest + # networks: + # - mbin_external_network # environment: # - SMARTHOST_ADDRESS=mail.mysmtp.com # - SMARTHOST_PORT=587 # - SMARTHOST_USER=myuser # - SMAR...
I'm not super familiar with docker networks. Based on the docs, it was using the default one, now this one, is there any concern of being unable to communicate? I guess it still exposes the same ports, it was only if people had custom containers they also ran, they'll have to move them over to the network as well?
mbin
github_2023
others
268
MbinOrg
BentiGorlich
@@ -306,9 +306,16 @@ docker compose exec redis redis-cli ## Backup and restore +Backup: + +```bash +docker compose exec -it db pg_dump -U kbin kbin > dump.sql
is kbin still supposed to be here?
mbin
github_2023
others
268
MbinOrg
BentiGorlich
@@ -306,9 +306,16 @@ docker compose exec redis redis-cli ## Backup and restore +Backup: + +```bash +docker compose exec -it db pg_dump -U kbin kbin > dump.sql +``` + +Restore: + ```bash -docker exec -it container_id pg_dump -U kbin mbin > dump.sql -docker compose exec -T database psql -U kbin mbin < dump.sql +doc...
is kbin still supposed to be here?
mbin
github_2023
php
259
MbinOrg
melroy89
@@ -11,7 +11,7 @@ class NodeInfoFactory { private const NODE_PROTOCOL = 'activitypub'; private const MBIN_REPOSITORY_URL = 'https://github.com/MbinOrg/mbin'; - private const MBIN_VERSION = '1.0.0'; // TODO: Should be read from package.json or composer.json + private const MBIN_VERSION = '1.1.0'; // TOD...
```suggestion private const MBIN_VERSION = '1.1.0'; // TODO: Should come from git tags? ```
mbin
github_2023
php
252
MbinOrg
melroy89
@@ -25,22 +26,22 @@ class SidebarSubscriptionComponent public ?string $sort; + public function __construct(private readonly MagazineRepository $magazineRepository) + { + } + #[PostMount] public function PostMount(): void { $max = 50; $this->magazines = []; - for...
sorry equal to max?
mbin
github_2023
php
252
MbinOrg
melroy89
@@ -25,22 +26,22 @@ class SidebarSubscriptionComponent public ?string $sort; + public function __construct(private readonly MagazineRepository $magazineRepository) + { + } + #[PostMount] public function PostMount(): void { $max = 50; $this->magazines = []; - for...
yea this of course was indeed not ideal... lol
mbin
github_2023
others
233
MbinOrg
BentiGorlich
@@ -2,7 +2,7 @@ Mbin is a fork of [/kbin](https://codeberg.org/Kbin/kbin-core), community-focused. Feel free to discuss on [Matrix](https://matrix.to/#/#mbin:melroy.org) and to create Pull Requests. -**Important:** Mbin is focused on what the community wants, pull requests can be merged by any repo member. Discuss...
`by a of` -> `by one of`
mbin
github_2023
others
209
MbinOrg
e-five256
@@ -17,6 +17,7 @@ tools/vendor/ # Mbin specific .env /public/media/* +/public/media
I think you could also do a single rule of `/public/media*` to cover both situations but that is a minor nitpick
mbin
github_2023
others
209
MbinOrg
e-five256
@@ -124,10 +124,12 @@ That said, if you are _experiencing serious issues_ with your instance which you ## I changed my .env configuration but the error still appears/new config doesn't seem to be applied? -After you edited your `.env` configuration file on a bare metal/VM setup, you always need to execute the dump...
I'm not super knowledgeable on the command as a non-docker user but I assume there isn't a downside to running it when unneeded
mbin
github_2023
others
190
MbinOrg
e-five256
@@ -176,16 +176,24 @@ </li> {% endif %} + <li class="dropdown__separator"></li> <li> - <a data-action="clipboard#copy" - ...
I would move this below the `is_granted` for each file, I don't think it's needed if there aren't more entries, the end of the list is a decent enough separator
mbin
github_2023
others
180
MbinOrg
melroy89
@@ -86,7 +86,13 @@ Talking about plugins, we advise to also enable the `rabbitmq_management` plugin sudo rabbitmq-plugins enable rabbitmq_management ``` -This allows you to go to the RabbitMQ management page: `http://<server-ip>:15672`. [More info can be found here](https://www.rabbitmq.com/management.html#getting-...
I could also create a separate user with management permissions, that least that is what I did via: `sudo rabbitmqctl add_user <user>` And then give this user management permissions: `sudo rabbitmqctl set_user_tags <user> administrator`
mbin
github_2023
others
133
MbinOrg
melroy89
@@ -28,40 +28,42 @@ if [ "$1" == "php-fpm" ] || [ "$1" == "php" ] || [ "$1" == "bin/console" ]; then composer dump-env dev fi - echo "Waiting for db to be ready..." - ATTEMPTS_LEFT_TO_REACH_DATABASE=60 - until [ $ATTEMPTS_LEFT_TO_REACH_DATABASE -eq 0 ] || DATABASE_ERROR=$(bin/console dbal:run-...
The if needs to be lower I think. We still want to have a blocking waiting before those services continue to boot further. That was fine to have. I think the `if` should only be added around the migration part. So before line 53, and also directly the `fi` after around line 56.
mbin
github_2023
others
16
MbinOrg
melroy89
@@ -152,13 +152,13 @@ Add any auxiliary container as you want. For example, add a Nginx container as r Uploaded media files (e.g. photos uploaded by users) will be stored on the host directory `storage/media`. They will be served by the Caddy web server in the `www` container as static files. -Make sure `KBIN_STOR...
Nope.. not yet. We still have those KBIN env vars.
mbin
github_2023
others
16
MbinOrg
melroy89
@@ -152,13 +152,13 @@ Add any auxiliary container as you want. For example, add a Nginx container as r Uploaded media files (e.g. photos uploaded by users) will be stored on the host directory `storage/media`. They will be served by the Caddy web server in the `www` container as static files. -Make sure `KBIN_STOR...
Same here..
mbin
github_2023
others
16
MbinOrg
melroy89
@@ -129,17 +129,17 @@ See your running containers via: `docker ps`. Then, you should be able to access the new instance via [http://localhost](http://localhost). You can also access RabbitMQ management UI via [http://localhost:15672](http://localhost:15672). -### Kbin first setup +### mbin first setup Create n...
this will definitely not work yet. It's still all called kbin in the code.
mbin
github_2023
others
15
MbinOrg
melroy89
@@ -133,7 +133,7 @@ Other important `.env` configs: ```conf # Configure your media URL correctly: -KBIN_STORAGE_URL=https://domain.tld/media +mbin_STORAGE_URL=https://domain.tld/media
This won't work.
mbin
github_2023
others
15
MbinOrg
melroy89
@@ -148,7 +148,7 @@ MAILER_DSN=gmail://username:password@localhost?encryption=tls&auth_mode=oauth # Mercure (assuming you are using Mercure Caddy on port 3000) MERCURE_HOST=localhost:3000 MERCURE_URL=http://${MERCURE_HOST}/.well-known/mercure -MERCURE_PUBLIC_URL=https://${KBIN_DOMAIN}/.well-known/mercure +MERCURE_PU...
Neither will this.
mbin
github_2023
others
15
MbinOrg
melroy89
@@ -790,24 +790,24 @@ _Hint:_ If you wish to restart your supervisor jobs in the future, use: sudo supervisorctl restart all ``` -### Kbin first setup +### mbin first setup Create new admin user (without email verification), please change the `username`, `email` and `password` below: ```bash -php bin/console ...
This also need changes in the code to have it working.
mbin
github_2023
others
15
MbinOrg
melroy89
@@ -883,14 +883,14 @@ oneup_flysystem: local: location: "%kernel.project_dir%/public/media" - kbin.s3_adapter: + mbin.s3_adapter:
This all requires changes in the code as well.
mbin
github_2023
javascript
78
MbinOrg
melroy89
@@ -43,9 +43,12 @@ export default class extends Controller { window.es = Subscribe(topics, cb); // firefox bug: https://github.com/dunglas/mercure/issues/339#issuecomment-650978605
```suggestion // firefox bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1803431 ```
mbin
github_2023
others
114
MbinOrg
melroy89
@@ -20,9 +20,9 @@ This guide is aimed for Debian / Ubuntu distribution servers, but it could run o ```bash sudo apt-get update && sudo apt-get upgrade -y +sudo apt-get install software-properties-common python3-launchpadlib -y sudo add-apt-repository ppa:ondrej/php -y sudo apt-get install git redis-server postgre...
Why remove the composer installation?
mbin
github_2023
others
114
MbinOrg
melroy89
@@ -132,7 +133,6 @@ Other important `.env` configs: KBIN_STORAGE_URL=https://domain.tld/media # Ubuntu 22.04 installs PostgreSQL v14 by default, Debian 12 PostgreSQL v15 is the default -POSTGRES_VERSION=14
You removed `POSTGRES_VERSION=14`??? Maybe you need some sleep 😪 ?
mbin
github_2023
others
101
MbinOrg
melroy89
@@ -80,7 +80,8 @@ Execute: `sudo rabbitmqctl status`, that should provide details about your Rabbi Ensure you do not see any connection errors in your `var/log/prod.log` file. -Talking about plugins, we advise to also enable the `rabbitmq_management` plugin by execute: `rabbitmq-plugins enable rabbitmq_management`...
Fixed.
mbin
github_2023
others
99
MbinOrg
melroy89
@@ -51,9 +51,15 @@ if [ "$1" == "php-fpm" ] || [ "$1" == "php" ] || [ "$1" == "bin/console" ]; then bin/console doctrine:migrations:migrate --no-interaction fi - if [ $ENABLE_ACL = 1 ]; then - setfacl -R -m u:www-data:rwX -m u:"$(whoami)":rwX var - setfacl -dR -m u:www-data:rwX -m u:"$(...
```suggestion if [ -n "$ENABLE_ACL" ]; then ``` This will do it as well, right?
mbin
github_2023
others
99
MbinOrg
melroy89
@@ -51,9 +51,15 @@ if [ "$1" == "php-fpm" ] || [ "$1" == "php" ] || [ "$1" == "bin/console" ]; then bin/console doctrine:migrations:migrate --no-interaction fi - if [ $ENABLE_ACL = 1 ]; then - setfacl -R -m u:www-data:rwX -m u:"$(whoami)":rwX var - setfacl -dR -m u:www-data:rwX -m u:"$(...
I would change this to: ```suggestion if [ "$ENABLE_ACL" -eq 1 ]; then ```
mbin
github_2023
php
87
MbinOrg
melroy89
@@ -84,20 +84,22 @@ private function provideUsers(): iterable 'username' => 'adminUser', 'password' => 'adminUser123', 'email' => 'adminUser@example.com', + 'type' => 'Person', ]; yield [ 'username' => 'JohnDoe', 'password' ...
```suggestion private function createUser(string $username, string $email = null, string $password = null, string $type = 'Person', $active = true, $hideAdult = true, $about = null): User ``` This will set a default value as input parameter.
mbin
github_2023
php
87
MbinOrg
melroy89
@@ -84,20 +84,22 @@ private function provideUsers(): iterable 'username' => 'adminUser', 'password' => 'adminUser123', 'email' => 'adminUser@example.com', + 'type' => 'Person', ]; yield [ 'username' => 'JohnDoe', 'password' ...
Assuming you set a default above, you can just use this I think: ```suggestion $user = new User($email ?: $username.'@example.com', $username, $password ?: 'secret', $type); ```
mbin
github_2023
others
85
MbinOrg
TheVillageGuy
@@ -0,0 +1,79 @@ +# FAQ + +See below our Frequently Asked Questions (FAQ). The questions (and corresponding answers) below are in random order. + +## What is Mbin? + +Mbin is an _open-source federated link aggregration, content rating and discussion_ software that is built on top of _ActivityPub_. + +## What is Activit...
Mbin uses
mbin
github_2023
others
85
MbinOrg
TheVillageGuy
@@ -0,0 +1,79 @@ +# FAQ + +See below our Frequently Asked Questions (FAQ). The questions (and corresponding answers) below are in random order. + +## What is Mbin? + +Mbin is an _open-source federated link aggregration, content rating and discussion_ software that is built on top of _ActivityPub_. + +## What is Activit...
Can help
mbin
github_2023
others
85
MbinOrg
TheVillageGuy
@@ -0,0 +1,79 @@ +# FAQ + +See below our Frequently Asked Questions (FAQ). The questions (and corresponding answers) below are in random order. + +## What is Mbin? + +Mbin is an _open-source federated link aggregration, content rating and discussion_ software that is built on top of _ActivityPub_. + +## What is Activit...
Your own public instance
mbin
github_2023
others
85
MbinOrg
TheVillageGuy
@@ -0,0 +1,79 @@ +# FAQ + +See below our Frequently Asked Questions (FAQ). The questions (and corresponding answers) below are in random order. + +## What is Mbin? + +Mbin is an _open-source federated link aggregration, content rating and discussion_ software that is built on top of _ActivityPub_. + +## What is Activit...
That being said, if you are experiencing serious problems with your instance which you are unable to resolve using the ... , you can try...
mbin
github_2023
others
85
MbinOrg
TheVillageGuy
@@ -0,0 +1,79 @@ +# FAQ + +See below our Frequently Asked Questions (FAQ). The questions (and corresponding answers) below are in random order. + +## What is Mbin? + +Mbin is an _open-source federated link aggregration, content rating and discussion_ software that is built on top of _ActivityPub_. + +## What is Activit...
Public instance -to the public
mbin
github_2023
others
4
MbinOrg
melroy89
@@ -44,33 +44,33 @@ Please note, that the command may take some time and data will not be visible du ## Translations -Translations are done in [Weblate](https://translate.codeberg.org/projects/kbin/). +Translations will be done in Weblate ## Documentation -Documentation is stored at in the [`docs` folder](htt...
```suggestion If you still feel the need for asking a question, we recommend [joining our community on Matrix](https://matrix.to/#/#mbin:melroy.org) where you can ask your questions to our community members. ```
mbin
github_2023
php
1,526
MbinOrg
melroy89
@@ -89,4 +92,49 @@ public function testExternalMentionLink(): void // assert that this community does not exist, and we get a search link for it that does not link to the external instance self::assertStringContainsString('https://kbin.test2', $markdown); } + + public function testExternalMaga...
👍🏽 for an additional tests.
mbin
github_2023
php
1,526
MbinOrg
melroy89
@@ -95,6 +95,10 @@ public function findLocalByApId(string $apId): ?array 'type' => Post::class, ]; } else { + if (0 === $id) {
Maybe also explain this code, just for future references so we still understand why this was added. ```suggestion // Ignore processing $id of zero, because ... if (0 === $id) { ```
mbin
github_2023
php
1,526
MbinOrg
melroy89
@@ -108,7 +112,17 @@ public function findLocalByApId(string $apId): ?array 'id' => $id, 'type' => Entry::class, ]; + } elseif (5 === \count($exploded)) { + // entry url with slug (non-ap route) + ...
Same here :)
mbin
github_2023
php
1,525
MbinOrg
melroy89
@@ -146,15 +146,21 @@ private function getMissingMentionsFromMarkdown(string $markdown): array /** @return string[] */ private function getMissingMagazineMentions(string $markdown): array { - $words = preg_split('/[ \n\[\]()]/', $markdown); + $words = preg_split('/[ \n\[\]()]/', str_replace...
cntrl?
mbin
github_2023
php
1,525
MbinOrg
melroy89
@@ -146,15 +146,21 @@ private function getMissingMentionsFromMarkdown(string $markdown): array /** @return string[] */ private function getMissingMagazineMentions(string $markdown): array { - $words = preg_split('/[ \n\[\]()]/', $markdown); + $words = preg_split('/[ \n\[\]()]/', str_replace...
```suggestion // Remove newline (\n), tab (\t), carriage return (\r), etc. $word2 = preg_replace('/[[:cntrl:]]/', '', $word); ```
mbin
github_2023
php
1,525
MbinOrg
melroy89
@@ -146,15 +146,22 @@ private function getMissingMentionsFromMarkdown(string $markdown): array /** @return string[] */ private function getMissingMagazineMentions(string $markdown): array { - $words = preg_split('/[ \n\[\]()]/', $markdown); + $words = preg_split('/[ \n\[\]()]/', str_replace...
```suggestion // No-break space is causing issues with word splitting. So replace a no-break (0xc2 0xa0) by a normal space first. $words = preg_split('/[ \n\[\]()]/', str_replace(\chr(194).\chr(160), '&nbsp;', $markdown)); ```
riven
github_2023
python
1,036
rivenmedia
coderabbitai[bot]
@@ -1,3 +1,4 @@ +import asyncio
_⚠️ Potential issue_ **Unnecessary import of `asyncio`** The `asyncio` module is imported but not used anywhere in this file. While several of the functions are marked as `async` functions, they don't utilize any `asyncio` functionality. ```diff -import asyncio ``` Remove this unused import to keep the code clean ...
riven
github_2023
python
1,024
rivenmedia
coderabbitai[bot]
@@ -51,7 +50,7 @@ def __init__(self, settings: TraktModel): self.oauth_redirect_uri = self.settings.oauth.oauth_redirect_uri rate_limit_params = get_rate_limit_params(max_calls=1000, period=300) trakt_cache = get_cache_params("trakt", 86400) - use_cache = os.environ.get("SKIP_TRAKT_CAC...
_⚠️ Potential issue_ **Verify the caching logic - possible logic inversion.** The environment variable name `SKIP_TRAKT_CACHE` suggests that when set to "true", caching should be skipped. However, the current implementation sets `use_cache = True` when `SKIP_TRAKT_CACHE` is "true", which seems contradictory. ```dif...
riven
github_2023
python
1,024
rivenmedia
coderabbitai[bot]
@@ -350,9 +346,11 @@ async def remove_item(request: Request, ids: str) -> RemoveResponse: ids: list[str] = handle_ids(ids) try: media_items: list[MediaItem] = db_functions.get_items_by_ids(ids, ["movie", "show"]) - if not media_items: + if not media_items or not all(isinstance(item, Med...
_⚠️ Potential issue_ **Replace return with raise for HTTPException.** Returning an HTTPException object won’t produce the intended HTTP 404 response. Use `raise HTTPException(...)` instead. <!-- This is an auto-generated comment by CodeRabbit -->
riven
github_2023
python
1,024
rivenmedia
coderabbitai[bot]
@@ -331,17 +329,17 @@ def get_items_from_filepath(session: Session, filepath: str) -> "MediaItem": def get_by_symlink_path(session: Session, filepath: str) -> list["MediaItem"]: if season_number and episode_number: - filter = ItemFilter(symlink_path=filepath, type=["episode"]) + qu...
_🛠️ Refactor suggestion_ **Confirm type assumptions for direct lookups.** When falling back to direct lookup by `imdb_id`, you assume a “movie” type if no `episode_number` is present. Ensure that trackable “season” or “show” items aren’t inadvertently excluded. <!-- This is an auto-generated comment by CodeRabbit ...
riven
github_2023
python
1,024
rivenmedia
coderabbitai[bot]
@@ -1,3 +1,4 @@ +import regex
_💡 Verification agent_ <details> <summary>🧩 Analysis chain</summary> **Consider verifying `regex` availability.** Make sure the `regex` library is installed and recognized in all relevant environments, as it is not part of the standard library. --- 🏁 Script executed: ```shell #!/bin/bash # Checking whether 'r...
riven
github_2023
python
1,024
rivenmedia
coderabbitai[bot]
@@ -126,15 +126,37 @@ def update_item_attributes(self, item: MediaItem, download_result: DownloadedTor if not download_result.container: raise NotCachedException(f"No container found for {item.log_string} ({item.id})") + episode_cap: int = None + show: Optional[Show] = None + ...
_⚠️ Potential issue_ **Handle single-season edge cases to avoid IndexError.** If there's only one season—or if multiple seasons exist but are empty—referencing `seasons[-2]` for a new season with no episodes can trigger a second `IndexError`. Consider adding a safety check: ```diff - except IndexError: - ...
riven
github_2023
python
1,011
rivenmedia
dreulavelle
@@ -96,13 +96,15 @@ def _parse_results(item: MediaItem, results: Dict[str, str], log_msg: bool = Tru elif item.type == "show": if torrent.data.seasons and not torrent.data.episodes: - # We subtract one because Trakt doesn't always index - # shows ac...
The log message could get pretty long for shows that have a lot of seasons, thats why I didnt include that lol.
riven
github_2023
python
1,011
rivenmedia
dreulavelle
@@ -96,13 +96,15 @@ def _parse_results(item: MediaItem, results: Dict[str, str], log_msg: bool = Tru elif item.type == "show": if torrent.data.seasons and not torrent.data.episodes: - # We subtract one because Trakt doesn't always index - # shows ac...
do we want this log message?
riven
github_2023
python
1,009
rivenmedia
coderabbitai[bot]
@@ -40,7 +40,7 @@ class StartSessionResponse(BaseModel): session_id: str torrent_id: str torrent_info: TorrentInfo - containers: Optional[List[TorrentContainer]] + containers: Optional[TorrentContainer]
_:warning: Potential issue_ **Fix type mismatch between definition and usage.** The `containers` attribute in `StartSessionResponse` is defined as `Optional[TorrentContainer]`, but it's being used as a list in the response construction: `[container] if container else None`. This creates a type mismatch. Apply one of...
riven
github_2023
python
1,009
rivenmedia
coderabbitai[bot]
@@ -221,17 +221,25 @@ async def add_items(request: Request, imdb_ids: str = None) -> MessageResponse: ) async def get_item(_: Request, id: str, use_tmdb_id: Optional[bool] = False) -> dict: with db.Session() as session: + query = select(MediaItem) + if use_tmdb_id: + query = query.where(...
_:warning: Potential issue_ **Improve error handling in get_item.** The error handling has been enhanced, but there's a missing `from` clause in the exception re-raising on line 239 as flagged by the static analysis tool. Apply this diff to fix the exception chaining: ```diff - raise HTTPException(status...
riven
github_2023
python
1,009
rivenmedia
coderabbitai[bot]
@@ -77,18 +77,26 @@ def create( return cls(filename=filename, filesize=filesize_bytes, file_id=file_id) + def to_dict(self) -> Dict[str, Union[int, str]]: + """Convert the DebridFile to a dictionary""" + return { + "filename": self.filename, + "filesize": self.filesiz...
_:warning: Potential issue_ **Use `default_factory=list` for mutable defaults.** Using a mutable default value (`default=[]`) can lead to unexpected behavior where the same list object is shared between instances. Pydantic's `default_factory=list` is the recommended approach for mutable defaults. ```diff - episod...
riven
github_2023
python
1,009
rivenmedia
coderabbitai[bot]
@@ -77,18 +77,26 @@ def create( return cls(filename=filename, filesize=filesize_bytes, file_id=file_id) + def to_dict(self) -> Dict[str, Union[int, str]]: + """Convert the DebridFile to a dictionary""" + return { + "filename": self.filename, + "filesize": self.filesiz...
_:warning: Potential issue_ **Use `default_factory=list` for mutable defaults.** Using a mutable default value (`default=[]`) can lead to unexpected behavior where the same list object is shared between instances. Pydantic's `default_factory=list` is the recommended approach for mutable defaults. ```diff - files:...
riven
github_2023
python
1,009
rivenmedia
coderabbitai[bot]
@@ -1,5 +1,5 @@ from datetime import datetime -from typing import Dict, List, Literal, Optional, Union +from typing import Any, Dict, List, Literal, Optional, Union
_:hammer_and_wrench: Refactor suggestion_ **Remove unused import.** The `Any` import from `typing` is not used in the code. ```diff -from typing import Any, Dict, List, Literal, Optional, Union +from typing import Dict, List, Literal, Optional, Union ``` <!-- suggestion_start --> <details> <summary>📝 Committable...
riven
github_2023
others
920
rivenmedia
coderabbitai[bot]
@@ -1,5 +1,29 @@ # Changelog +## [1.0.0](https://github.com/rivenmedia/riven/compare/v0.20.1...v1.0.0) (2025-01-20) + + +### ⚠ BREAKING CHANGES + +* Torbox Removal ([#971](https://github.com/rivenmedia/riven/issues/971)) + +### Features + +* Add 6th retry attempt to symlinker ([#926](https://github.com/rivenmedia/ri...
_:hammer_and_wrench: Refactor suggestion_ **Duplicate entry for Torbox removal.** The Torbox removal is mentioned both in the breaking changes section and bug fixes section. This is redundant and might confuse users. Remove the duplicate entry from the bug fixes section since it's already covered in the breaking cha...
riven
github_2023
python
1,007
rivenmedia
coderabbitai[bot]
@@ -0,0 +1,88 @@ +from fastapi import WebSocket, WebSocketDisconnect +from typing import Dict, List, Any +import asyncio +import json +from datetime import datetime + +class ConnectionManager: + def __init__(self): + # Store active connections by topic + self.active_connections: Dict[str, List[WebSocke...
_:hammer_and_wrench: Refactor suggestion_ **Add error handling for WebSocket acceptance.** The `connect` method should handle potential exceptions during WebSocket acceptance to ensure graceful error handling. Apply this diff to add error handling: ```diff async def connect(self, websocket: WebSocket, topic: str):...
riven
github_2023
python
1,007
rivenmedia
coderabbitai[bot]
@@ -0,0 +1,88 @@ +from fastapi import WebSocket, WebSocketDisconnect +from typing import Dict, List, Any +import asyncio +import json +from datetime import datetime + +class ConnectionManager: + def __init__(self): + # Store active connections by topic + self.active_connections: Dict[str, List[WebSocke...
_:hammer_and_wrench: Refactor suggestion_ **Use proper logging and remove commented code.** The method uses `print` statements for logging and contains commented-out code. Apply this diff to improve logging and remove commented code: ```diff +from loguru import logger + def publish(self, topic: str, message: Any):...
riven
github_2023
python
1,007
rivenmedia
coderabbitai[bot]
@@ -0,0 +1,88 @@ +from fastapi import WebSocket, WebSocketDisconnect +from typing import Dict, List, Any +import asyncio +import json +from datetime import datetime + +class ConnectionManager: + def __init__(self): + # Store active connections by topic + self.active_connections: Dict[str, List[WebSocke...
_:hammer_and_wrench: Refactor suggestion_ **Improve error handling and logging in broadcast task.** The broadcast task uses generic error handling and print statements for logging. Apply this diff to improve error handling and logging: ```diff +from loguru import logger +from fastapi import WebSocketDisconnect, Web...
riven
github_2023
python
977
rivenmedia
coderabbitai[bot]
@@ -48,17 +50,39 @@ def validate(self): def run(self, item: MediaItem) -> Generator[MediaItem, None, None]: """Scrape an item.""" + if item.state == States.Paused: + logger.debug(f"Skipping scrape for {item.log_string}: Item is paused") + yield item + + logger.debug(f...
_:hammer_and_wrench: Refactor suggestion_ **Edge case with `max_failed_attempts = 0`.** If `max_failed_attempts` is zero, items could be marked as failed immediately on the first unsuccessful scrape. Consider clarifying or guarding this scenario if zero means “unlimited” or if immediate failure is indeed desired. ...
riven
github_2023
python
977
rivenmedia
coderabbitai[bot]
@@ -74,14 +257,14 @@ def get_item_by_external_id(imdb_id: str = None, tvdb_id: int = None, tmdb_id: i _session.expunge(item) return item -def delete_media_item(item: "MediaItem"): +def delete_media_item(item: "MediaItem") -> bool:
_:warning: Potential issue_ **Functions declare `-> bool` but never return.** These functions commit changes but do not explicitly return a boolean. This contradicts their function signatures and can cause confusion. ```diff def delete_media_item(item: "MediaItem") -> bool: with db.Session() as session: ...
riven
github_2023
python
977
rivenmedia
coderabbitai[bot]
@@ -432,4 +433,71 @@ async def unblacklist_stream(_: Request, item_id: str, stream_id: int, db: Sessi return { "message": f"Unblacklisted stream {stream_id} for item {item_id}", - } \ No newline at end of file + } + +class PauseResponse(BaseModel): + message: str + ids: list[str] + +@router....
_:hammer_and_wrench: Refactor suggestion_ **Fix f-strings and error handling.** The implementation has a few minor issues: 1. Line 503: f-string without any placeholders 2. Line 501: Exception re-raising without preserving the traceback Apply this diff to fix the issues: ```diff - return {"message": f"Successful...
riven
github_2023
python
977
rivenmedia
coderabbitai[bot]
@@ -432,4 +433,71 @@ async def unblacklist_stream(_: Request, item_id: str, stream_id: int, db: Sessi return { "message": f"Unblacklisted stream {stream_id} for item {item_id}", - } \ No newline at end of file + } + +class PauseResponse(BaseModel): + message: str + ids: list[str] + +@router....
_:hammer_and_wrench: Refactor suggestion_ **Fix f-strings and error handling.** The implementation has a few minor issues: 1. Line 467: f-string without any placeholders 2. Line 472: Exception re-raising without preserving the traceback Apply this diff to fix the issues: ```diff - logger.info(f"Successfu...
riven
github_2023
python
977
rivenmedia
coderabbitai[bot]
@@ -0,0 +1,143 @@ +import pytest +from datetime import datetime, timedelta + +from program.db.db_functions import ItemFilter, get_items_from_filter +from program.media.state import States + +class TestItemFilter: + def test_basic_id_filter(self): + """Test filtering by a single ID""" + filter = ItemFil...
_:hammer_and_wrench: Refactor suggestion_ **Enhance load options test.** The load options test only verifies that no errors occur. Consider adding assertions to verify that the requested data is actually loaded. ```diff def test_load_options(self, load_option): """Test different load options""" ...