From aa341933da04a21f9bb342b3b2840ee2acde8a94 Mon Sep 17 00:00:00 2001 From: Felix Date: Wed, 11 Mar 2020 00:22:34 +0100 Subject: [PATCH 01/43] Deploy multiple Lemmy instances to the same server (ref #474) --- .gitignore | 1 + ansible/lemmy_dev.yml | 50 ++++++++++++++++++++++------ ansible/templates/docker-compose.yml | 6 ++-- ansible/templates/nginx.conf | 14 ++++---- ansible/uninstall.yml | 16 ++------- 5 files changed, 54 insertions(+), 33 deletions(-) diff --git a/.gitignore b/.gitignore index d823aaca..a19ca3fd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ ansible/inventory ansible/inventory_dev ansible/passwords/ +ansible/vars/ docker/lemmy_mine.hjson docker/dev/env_deploy.sh build/ diff --git a/ansible/lemmy_dev.yml b/ansible/lemmy_dev.yml index e9b8364f..1d8e40ae 100644 --- a/ansible/lemmy_dev.yml +++ b/ansible/lemmy_dev.yml @@ -16,6 +16,32 @@ - setup: # gather facts tasks: + # TODO: this task is running on all hosts at the same time so there is a race condition + - name: xxx + shell: | + mkdir -p "vars/{{ inventory_hostname }}/" + if [ ! -f "vars/{{ inventory_hostname }}/port_counter" ]; then + if [ -f "vars/max_port_counter" ]; then + MAX_PORT=$(cat vars/max_port_counter) + else + MAX_PORT=8000 + fi + OUR_PORT=$(expr $MAX_PORT + 10) + echo $OUR_PORT > "vars/{{ inventory_hostname }}/port_counter" + echo $OUR_PORT > "vars/max_port_counter" + fi + cat "vars/{{ inventory_hostname }}/port_counter" + args: + executable: /bin/bash + delegate_to: localhost + register: lemmy_port + + - set_fact: "lemmy_port={{ lemmy_port.stdout_lines[0] }}" + - set_fact: "pictshare_port={{ lemmy_port|int + 1 }}" + - set_fact: "iframely_port={{ lemmy_port|int + 2 }}" + - debug: + msg: "lemmy_port={{ lemmy_port }} pictshare_port={{pictshare_port}} iframely_port={{iframely_port}}" + - name: install dependencies apt: pkg: ['nginx', 'docker-compose', 'docker.io', 'certbot', 'python-certbot-nginx'] @@ -25,25 +51,29 @@ args: creates: '/etc/letsencrypt/live/{{domain}}/privkey.pem' + # TODO: need to use different path per domain - name: create lemmy folder file: path={{item.path}} state=directory with_items: - - { path: '/lemmy/' } - - { path: '/lemmy/volumes/' } + - { path: '/lemmy/{{ domain }}/' } + - { path: '/lemmy/{{ domain }}/volumes/' } + - { path: '/var/cache/lemmy/{{ domain }}/' } - block: - name: add template files template: src={{item.src}} dest={{item.dest}} mode={{item.mode}} with_items: - - { src: 'templates/docker-compose.yml', dest: '/lemmy/docker-compose.yml', mode: '0600' } - - { src: 'templates/nginx.conf', dest: '/etc/nginx/sites-enabled/lemmy.conf', mode: '0644' } - - { src: '../docker/iframely.config.local.js', dest: '/lemmy/iframely.config.local.js', mode: '0600' } + - { src: 'templates/docker-compose.yml', dest: '/lemmy/{{domain}}/docker-compose.yml', mode: '0600' } + - { src: 'templates/nginx.conf', dest: '/etc/nginx/sites-enabled/lemmy-{{ domain }}.conf', mode: '0644' } + - { src: '../docker/iframely.config.local.js', dest: '/lemmy/{{ domain }}/iframely.config.local.js', mode: '0600' } - name: add config file (only during initial setup) - template: src='templates/config.hjson' dest='/lemmy/lemmy.hjson' mode='0600' force='no' owner='1000' group='1000' + template: src='templates/config.hjson' dest='/lemmy/{{domain}}/lemmy.hjson' mode='0600' force='no' owner='1000' group='1000' vars: - postgres_password: "{{ lookup('password', 'passwords/{{ inventory_hostname }}/postgres chars=ascii_letters,digits') }}" - jwt_password: "{{ lookup('password', 'passwords/{{ inventory_hostname }}/jwt chars=ascii_letters,digits') }}" + # TODO: these paths are changed, need to move the files + # TODO: not sure what to call the local var folder, its not mentioned in the ansible docs + postgres_password: "{{ lookup('password', 'vars/{{ inventory_hostname }}/postgres_password chars=ascii_letters,digits') }}" + jwt_password: "{{ lookup('password', 'vars/{{ inventory_hostname }}/jwt_password chars=ascii_letters,digits') }}" - name: build the dev docker image local_action: shell cd .. && sudo docker build . -f docker/dev/Dockerfile -t lemmy:dev @@ -85,7 +115,7 @@ # be a problem for testing - name: start docker-compose docker_compose: - project_src: /lemmy/ + project_src: "/lemmy/{{ domain }}/" state: present recreate: always ignore_errors: yes @@ -96,6 +126,6 @@ - name: certbot renewal cronjob cron: special_time=daily - name=certbot-renew-lemmy + name=certbot-renew-lemmy-{{ domain }} user=root job="certbot certonly --nginx -d '{{ domain }}' --deploy-hook 'nginx -s reload'" diff --git a/ansible/templates/docker-compose.yml b/ansible/templates/docker-compose.yml index 57ee142a..e96b312c 100644 --- a/ansible/templates/docker-compose.yml +++ b/ansible/templates/docker-compose.yml @@ -4,7 +4,7 @@ services: lemmy: image: {{ lemmy_docker_image }} ports: - - "127.0.0.1:8536:8536" + - "127.0.0.1:{{ lemmy_port }}:8536" restart: always volumes: - ./lemmy.hjson:/config/config.hjson:ro @@ -26,7 +26,7 @@ services: pictshare: image: shtripok/pictshare:latest ports: - - "127.0.0.1:8537:80" + - "127.0.0.1:{{ pictshare_port }}:80" volumes: - ./volumes/pictshare:/usr/share/nginx/html/data restart: always @@ -34,7 +34,7 @@ services: iframely: image: dogbin/iframely:latest ports: - - "127.0.0.1:8061:80" + - "127.0.0.1:{{ iframely_port }}:80" volumes: - ./iframely.config.local.js:/iframely/config.local.js:ro restart: always diff --git a/ansible/templates/nginx.conf b/ansible/templates/nginx.conf index 04e5a643..003720bc 100644 --- a/ansible/templates/nginx.conf +++ b/ansible/templates/nginx.conf @@ -1,4 +1,4 @@ -proxy_cache_path /var/cache/lemmy_frontend levels=1:2 keys_zone=lemmy_frontend_cache:10m max_size=100m use_temp_path=off; +proxy_cache_path /var/cache/lemmy/{{ domain }} levels=1:2 keys_zone=lemmy_frontend_cache_{{ domain }}:10m max_size=100m use_temp_path=off; server { listen 80; @@ -52,7 +52,7 @@ server { client_max_body_size 50M; location / { - proxy_pass http://0.0.0.0:8536; + proxy_pass http://0.0.0.0:{{ lemmy_port }}; proxy_set_header X-Real-IP $remote_addr; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; @@ -63,7 +63,7 @@ server { proxy_set_header Connection "upgrade"; # Proxy Cache - proxy_cache lemmy_frontend_cache; + proxy_cache lemmy_frontend_cache_{{ domain }}; proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504; proxy_cache_revalidate on; proxy_cache_lock on; @@ -71,7 +71,7 @@ server { } location /pictshare/ { - proxy_pass http://0.0.0.0:8537/; + proxy_pass http://0.0.0.0:{{ pictshare_port }}/; proxy_set_header X-Real-IP $remote_addr; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; @@ -82,7 +82,7 @@ server { } location /iframely/ { - proxy_pass http://0.0.0.0:8061/; + proxy_pass http://0.0.0.0:{{ iframely_port }}/; proxy_set_header X-Real-IP $remote_addr; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; @@ -98,6 +98,6 @@ map $remote_addr $remote_addr_anon { ::1 $remote_addr; default 0.0.0.0; } -log_format main '$remote_addr_anon - $remote_user [$time_local] "$request" ' +log_format main_{{ domain }} '$remote_addr_anon - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" "$http_user_agent"'; -access_log /var/log/nginx/access.log main; +access_log /var/log/nginx/access.log main_{{ domain }}; diff --git a/ansible/uninstall.yml b/ansible/uninstall.yml index 252c5bd1..08d5316c 100644 --- a/ansible/uninstall.yml +++ b/ansible/uninstall.yml @@ -22,24 +22,14 @@ - name: stop docker-compose docker_compose: - project_src: /lemmy/ + project_src: /lemmy/{{domain}}/ state: absent - name: delete data file: path={{item.path}} state=absent with_items: - - { path: '/lemmy/' } - - { path: '/etc/nginx/sites-enabled/lemmy.conf' } - - - name: Remove a volume - docker_volume: name={{item.name}} state=absent - with_items: - - { name: 'lemmy_lemmy_db' } - - { name: 'lemmy_lemmy_pictshare' } - - - name: delete entire ecloud folder - file: path='/mnt/repo-base/' state=absent - when: delete_certs|bool + - { path: '/lemmy/{{domain}}/' } + - { path: '/etc/nginx/sites-enabled/lemmy-{{ domain }}.conf' } - name: remove certbot cronjob cron: From bda31b578a30f2685d8edacb434efb998108f3a5 Mon Sep 17 00:00:00 2001 From: Kitaiti Makoto Date: Tue, 17 Mar 2020 01:06:46 +0000 Subject: [PATCH 02/43] Translated using Weblate (Japanese) Currently translated at 85.5% (202 of 236 strings) Translation: Lemmy/lemmy Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/ja/ --- ui/translations/ja.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ui/translations/ja.json b/ui/translations/ja.json index 81a2898f..d2e48a4f 100644 --- a/ui/translations/ja.json +++ b/ui/translations/ja.json @@ -198,5 +198,7 @@ "upvote": "賛成票", "downvote": "反対票", "sorting_help": "並び順のヘルプ", - "block_leaving": "このページから離れてもよろしいですか?" + "block_leaving": "このページから離れてもよろしいですか?", + "number_of_upvotes": "{{count}} 票の賛成", + "number_of_downvotes": "{{count}} 票の反対" } From cf2ebb399388638a0b927974413f93e0bcf6dc8f Mon Sep 17 00:00:00 2001 From: olivia maia Date: Tue, 17 Mar 2020 01:06:47 +0000 Subject: [PATCH 03/43] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (236 of 236 strings) Translation: Lemmy/lemmy Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/pt_BR/ --- ui/translations/pt_BR.json | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ui/translations/pt_BR.json b/ui/translations/pt_BR.json index 31725270..a9b36b48 100644 --- a/ui/translations/pt_BR.json +++ b/ui/translations/pt_BR.json @@ -239,5 +239,9 @@ "upvote": "Voto positivo", "downvote": "Voto negativo", "block_leaving": "Tem certeza que quer sair?", - "sorting_help": "ajuda sobre ordenação" + "sorting_help": "ajuda sobre ordenação", + "number_of_upvotes": "{{count}} voto positivo", + "number_of_upvotes_plural": "{{count}} votos positivos", + "number_of_downvotes": "{{count}} voto negativo", + "number_of_downvotes_plural": "{{count}} votos negativos" } From 70500a1fc7757b28f9b3ab07fbe14b17fcb7b1da Mon Sep 17 00:00:00 2001 From: Serge Tarkovski Date: Tue, 17 Mar 2020 01:06:47 +0000 Subject: [PATCH 04/43] Translated using Weblate (Russian) Currently translated at 87.2% (206 of 236 strings) Translation: Lemmy/lemmy Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/ru/ --- ui/translations/ru.json | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/ui/translations/ru.json b/ui/translations/ru.json index 071066ed..5de4a829 100644 --- a/ui/translations/ru.json +++ b/ui/translations/ru.json @@ -4,11 +4,15 @@ "no_posts": "Нет записей.", "create_a_post": "Создать запись", "create_post": "Создать запись", - "number_of_posts": "{{count}} записей", + "number_of_posts_0": "{{count}} запись", + "number_of_posts_1": "{{count}} записи", + "number_of_posts_2": "{{count}} записей", "posts": "Записи", "related_posts": "Эти записи могут быть связаны", "comments": "Комментарии", - "number_of_comments": "{{count}} комментариев", + "number_of_comments_0": "{{count}} комментарий", + "number_of_comments_1": "{{count}} комментария", + "number_of_comments_2": "{{count}} комментариев", "remove_comment": "Удалить комментарий", "communities": "Сообщества", "users": "Пользователи", @@ -169,14 +173,14 @@ "sticky": "", "stickied": "закрепленный пост", "delete_account": "Удалить аккаунт", - "delete_account_confirm": "Предупреждение: это действите полностью уничтожит все данные вашего аккаунта. Введите свой пароль для подтверждения.", + "delete_account_confirm": "Предупреждение: это действие полностью уничтожит все данные вашего аккаунта. Введите свой пароль для подтверждения.", "docs": "Документация", "replies": "Ответы", "mentions": "Упоминания", "message_sent": "Сообщение отправлено", "old_password": "Действующий пароль", "forgot_password": "я забыл(а) пароль", - "reset_password_mail_sent": "Имейл для восстановления пароля был выслан.", + "reset_password_mail_sent": "Письмо для восстановления пароля было выслано.", "private_message_disclaimer": "Предупреждение: Приватные сообщения Lemmy на данный момент не зашифрованы. Для безопасной коммуникации создайте аккаунт на <1>Riot.im.", "send_notifications_to_email": "Посылать уведомления на e-mail адрес", "language": "Язык", @@ -200,5 +204,15 @@ "theme": "Визуальная тема", "post_title_too_long": "Длина названия поста превышает допустимый лимит.", "time": "Время", - "action": "Действие" + "action": "Действие", + "view_source": "исходный код сообщения", + "more": "больше", + "sorting_help": "справка по сортировке", + "by": "от", + "number_of_communities_0": "{{count}} сообщество", + "number_of_communities_1": "{{count}} сообщества", + "number_of_communities_2": "{{count}} сообществ", + "creator": "автор", + "old": "Старое", + "to": "в" } From 0d1019092bdc2123bdac9e6b2d36bd33c41ac503 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Wed, 18 Mar 2020 19:59:34 -0400 Subject: [PATCH 05/43] Adding repos to contributing main page. --- docs/src/contributing.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/src/contributing.md b/docs/src/contributing.md index e73cc4b9..9a01ad5d 100644 --- a/docs/src/contributing.md +++ b/docs/src/contributing.md @@ -2,6 +2,12 @@ Information about contributing to Lemmy, whether it is translating, testing, designing or programming. +## Issue tracking / Repositories + +- [GitHub (for issues)](https://github.com/dessalines/lemmy) +- [Gitea](https://yerbamate.dev/dessalines/lemmy) +- [GitLab](https://gitlab.com/dessalines/lemmy) + ## Translating Go [here](https://github.com/dessalines/lemmy#translations) for translation instructions. From 43b954c5af1df740a30a7423c771c10a1c16c624 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Wed, 18 Mar 2020 22:30:16 -0400 Subject: [PATCH 06/43] Updating rust, rust deps, yarn deps. Fixes #605 --- docker/dev/Dockerfile | 4 +- docker/dev/Dockerfile.libc | 4 +- server/Cargo.lock | 98 +++++----- server/Cargo.toml | 12 +- ui/package.json | 26 +-- ui/yarn.lock | 392 ++++++++++++++++++++++--------------- 6 files changed, 312 insertions(+), 224 deletions(-) diff --git a/docker/dev/Dockerfile b/docker/dev/Dockerfile index aa0c2a8e..d9ffc2f3 100644 --- a/docker/dev/Dockerfile +++ b/docker/dev/Dockerfile @@ -10,7 +10,7 @@ RUN yarn install --pure-lockfile COPY ui /app/ui RUN yarn build -FROM ekidd/rust-musl-builder:1.40.0-openssl11 as rust +FROM ekidd/rust-musl-builder:1.42.0-openssl11 as rust # Cache deps WORKDIR /app @@ -33,7 +33,7 @@ RUN cargo build --frozen --release # RUN cargo install diesel_cli --no-default-features --features postgres -FROM ekidd/rust-musl-builder:1.40.0-openssl11 as docs +FROM ekidd/rust-musl-builder:1.42.0-openssl11 as docs WORKDIR /app COPY docs ./docs RUN sudo chown -R rust:rust . diff --git a/docker/dev/Dockerfile.libc b/docker/dev/Dockerfile.libc index 5eec3895..6348342f 100644 --- a/docker/dev/Dockerfile.libc +++ b/docker/dev/Dockerfile.libc @@ -20,7 +20,7 @@ COPY ui /app/ui RUN yarn build -FROM rust:1.40 as rust +FROM rust:1.42 as rust # Cache deps WORKDIR /app @@ -53,7 +53,7 @@ RUN cp /app/server/target/release/lemmy_server /app/server/ready #RUN cp /app/server/target/debug/lemmy_server /app/server/ready -FROM rust:1.40 as docs +FROM rust:1.42 as docs WORKDIR /app diff --git a/server/Cargo.lock b/server/Cargo.lock index a58e0438..418c8a01 100644 --- a/server/Cargo.lock +++ b/server/Cargo.lock @@ -8,8 +8,8 @@ dependencies = [ "activitystreams-derive 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "activitystreams-traits 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "activitystreams-types 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.48 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -28,7 +28,7 @@ name = "activitystreams-traits" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.48 (registry+https://github.com/rust-lang/crates.io-index)", "thiserror 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -42,8 +42,8 @@ dependencies = [ "activitystreams-traits 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "chrono 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)", "mime 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.48 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -159,8 +159,8 @@ dependencies = [ "percent-encoding 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "pin-project 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.48 (registry+https://github.com/rust-lang/crates.io-index)", "serde_urlencoded 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "sha1 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -185,8 +185,8 @@ dependencies = [ "bytestring 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "http 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -315,8 +315,8 @@ dependencies = [ "mime 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", "net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", "pin-project 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.48 (registry+https://github.com/rust-lang/crates.io-index)", "serde_urlencoded 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", @@ -443,7 +443,7 @@ dependencies = [ "mime 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", "percent-encoding 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.48 (registry+https://github.com/rust-lang/crates.io-index)", "serde_urlencoded 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -490,12 +490,17 @@ name = "base64" version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "base64" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "bcrypt" -version = "0.6.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "base64 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "base64 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", "blowfish 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -629,7 +634,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "num-integer 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -668,7 +673,7 @@ dependencies = [ "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "nom 5.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "rust-ini 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", "serde-hjson 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.48 (registry+https://github.com/rust-lang/crates.io-index)", "toml 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1001,7 +1006,7 @@ dependencies = [ "atty 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", "humantime 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.3.5 (registry+https://github.com/rust-lang/crates.io-index)", "termcolor 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1394,7 +1399,7 @@ dependencies = [ "base64 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", "pem 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "ring 0.16.11 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.48 (registry+https://github.com/rust-lang/crates.io-index)", "simple_asn1 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1433,7 +1438,7 @@ dependencies = [ "actix-rt 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "actix-web 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "actix-web-actors 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "bcrypt 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", + "bcrypt 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", "chrono 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)", "chttp 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", "config 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1451,13 +1456,13 @@ dependencies = [ "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "percent-encoding 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.3.5 (registry+https://github.com/rust-lang/crates.io-index)", "rss 1.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.48 (registry+https://github.com/rust-lang/crates.io-index)", "sha2 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", - "strum 0.17.1 (registry+https://github.com/rust-lang/crates.io-index)", - "strum_macros 0.17.1 (registry+https://github.com/rust-lang/crates.io-index)", + "strum 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)", + "strum_macros 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1472,8 +1477,8 @@ dependencies = [ "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "native-tls 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", "nom 4.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.48 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1832,7 +1837,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "base64 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.3.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2113,12 +2118,12 @@ dependencies = [ [[package]] name = "regex" -version = "1.3.4" +version = "1.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "aho-corasick 0.7.9 (registry+https://github.com/rust-lang/crates.io-index)", "memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "regex-syntax 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)", + "regex-syntax 0.6.17 (registry+https://github.com/rust-lang/crates.io-index)", "thread_local 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2129,7 +2134,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "regex-syntax" -version = "0.6.16" +version = "0.6.17" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -2267,10 +2272,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "serde" -version = "1.0.104" +version = "1.0.105" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2281,7 +2286,7 @@ dependencies = [ "lazy_static 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", "linked-hash-map 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.3.5 (registry+https://github.com/rust-lang/crates.io-index)", "serde 0.8.23 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2293,13 +2298,13 @@ dependencies = [ "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "linked-hash-map 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.3.5 (registry+https://github.com/rust-lang/crates.io-index)", "serde 0.8.23 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "serde_derive" -version = "1.0.104" +version = "1.0.105" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2326,7 +2331,7 @@ dependencies = [ "indexmap 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "itoa 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "ryu 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2344,7 +2349,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "dtoa 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "itoa 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", "url 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2436,12 +2441,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "strum" -version = "0.17.1" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "strum_macros" -version = "0.17.1" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "heck 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2591,7 +2596,7 @@ name = "toml" version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2917,8 +2922,9 @@ dependencies = [ "checksum backtrace-sys 0.1.33 (registry+https://github.com/rust-lang/crates.io-index)" = "e17b52e737c40a7d75abca20b29a19a0eb7ba9fc72c5a72dd282a0a3c2c0dc35" "checksum base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0b25d992356d2eb0ed82172f5248873db5560c4721f564b13cb5193bda5e668e" "checksum base64 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b41b7ea54a0c9d92199de89e20e58d49f02f8e699814ef3fdf266f6f748d15c7" +"checksum base64 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7d5ca2cd0adc3f48f9e9ea5a6bbdf9ccc0bfade884847e484d452414c7ccffb3" "checksum base64 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)" = "489d6c0ed21b11d038c31b6ceccca973e65d73ba3bd8ecb9a2babf5546164643" -"checksum bcrypt 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "28dff1c1a22f9401213d983f6c309e807e72c33d5dc5514fe5005b0205c46e8f" +"checksum bcrypt 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c158d9cf14495dbd2ac5ce1f31d75b3253f75c54cc865dd7e5fc864eb5fb8633" "checksum bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" "checksum block-buffer 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b" "checksum block-cipher-trait 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1c924d49bd09e7c06003acda26cd9742e796e34282ec6c1189404dee0c1f4774" @@ -3101,9 +3107,9 @@ dependencies = [ "checksum rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" "checksum redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)" = "2439c63f3f6139d1b57529d16bc3b8bb855230c8efcc5d3a896c8bea7c3b1e84" "checksum regex 0.1.80 (registry+https://github.com/rust-lang/crates.io-index)" = "4fd4ace6a8cf7860714a2c2280d6c1f7e6a413486c13298bbc86fd3da019402f" -"checksum regex 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "322cf97724bea3ee221b78fe25ac9c46114ebb51747ad5babd51a2fc6a8235a8" +"checksum regex 1.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "8900ebc1363efa7ea1c399ccc32daed870b4002651e0bed86e72d501ebbe0048" "checksum regex-syntax 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "f9ec002c35e86791825ed294b50008eea9ddfc8def4420124fbc6b08db834957" -"checksum regex-syntax 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)" = "1132f845907680735a84409c3bebc64d1364a5683ffbce899550cd09d5eaefc1" +"checksum regex-syntax 0.6.17 (registry+https://github.com/rust-lang/crates.io-index)" = "7fe5bd57d1d7414c6b5ed48563a2c855d995ff777729dcd91c369ec7fea395ae" "checksum remove_dir_all 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4a83fa3702a688b9359eccba92d153ac33fd2e8462f9e0e3fdf155239ea7792e" "checksum resolv-conf 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "11834e137f3b14e309437a8276714eed3a80d1ef894869e510f2c0c0b98b9f4a" "checksum ring 0.16.11 (registry+https://github.com/rust-lang/crates.io-index)" = "741ba1704ae21999c00942f9f5944f801e977f54302af346b596287599ad1862" @@ -3122,10 +3128,10 @@ dependencies = [ "checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" "checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" "checksum serde 0.8.23 (registry+https://github.com/rust-lang/crates.io-index)" = "9dad3f759919b92c3068c696c15c3d17238234498bbdcc80f2c469606f948ac8" -"checksum serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)" = "414115f25f818d7dfccec8ee535d76949ae78584fc4f79a6f45a904bf8ab4449" +"checksum serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)" = "e707fbbf255b8fc8c3b99abb91e7257a622caeb20a9818cbadbeeede4e0932ff" "checksum serde-hjson 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "0b833c5ad67d52ced5f5938b2980f32a9c1c5ef047f0b4fb3127e7a423c76153" "checksum serde-hjson 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "6a3a4e0ea8a88553209f6cc6cfe8724ecad22e1acf372793c27d995290fe74f8" -"checksum serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)" = "128f9e303a5a29922045a830221b8f78ec74a5f544944f3d5984f8ec3895ef64" +"checksum serde_derive 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)" = "ac5d00fc561ba2724df6758a17de23df5914f20e41cb00f94d5b7ae42fffaff8" "checksum serde_json 0.8.6 (registry+https://github.com/rust-lang/crates.io-index)" = "67f7d2e9edc3523a9c8ec8cd6ec481b3a27810aafee3e625d311febd3e656b4c" "checksum serde_json 1.0.48 (registry+https://github.com/rust-lang/crates.io-index)" = "9371ade75d4c2d6cb154141b9752cf3781ec9c05e0e5cf35060e1e70ee7b9c25" "checksum serde_test 0.8.23 (registry+https://github.com/rust-lang/crates.io-index)" = "110b3dbdf8607ec493c22d5d947753282f3bae73c0f56d322af1e8c78e4c23d5" @@ -3142,8 +3148,8 @@ dependencies = [ "checksum static_assertions 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "7f3eb36b47e512f8f1c9e3d10c2c1965bc992bd9cdb024fa581e2194501c83d3" "checksum strsim 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "67f84c44fbb2f91db7fef94554e6b2ac05909c9c0b0bc23bb98d3a1aebfe7f7c" "checksum strsim 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)" = "6446ced80d6c486436db5c078dde11a9f73d42b57fb273121e160b84f63d894c" -"checksum strum 0.17.1 (registry+https://github.com/rust-lang/crates.io-index)" = "530efb820d53b712f4e347916c5e7ed20deb76a4f0457943b3182fb889b06d2c" -"checksum strum_macros 0.17.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5e6e163a520367c465f59e0a61a23cfae3b10b6546d78b6f672a382be79f7110" +"checksum strum 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)" = "57bd81eb48f4c437cadc685403cad539345bf703d78e63707418431cecd4522b" +"checksum strum_macros 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)" = "87c85aa3f8ea653bfd3ddf25f7ee357ee4d204731f6aa9ad04002306f6e2774c" "checksum syn 1.0.16 (registry+https://github.com/rust-lang/crates.io-index)" = "123bd9499cfb380418d509322d7a6d52e5315f064fe4b3ad18a53d6b92c07859" "checksum synstructure 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)" = "67656ea1dc1b41b1451851562ea232ec2e5a80242139f7e679ceccfb5d61f545" "checksum tempfile 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9" diff --git a/server/Cargo.toml b/server/Cargo.toml index 10c0dfc8..97fc12cb 100644 --- a/server/Cargo.toml +++ b/server/Cargo.toml @@ -8,12 +8,12 @@ edition = "2018" diesel = { version = "1.4.2", features = ["postgres","chrono", "r2d2", "64-column-tables"] } diesel_migrations = "1.4.0" dotenv = "0.15.0" -bcrypt = "0.6.1" +bcrypt = "0.6.2" activitypub = "0.2.0" chrono = { version = "0.4.7", features = ["serde"] } failure = "0.1.5" -serde_json = { version = "1.0.45", features = ["preserve_order"]} -serde = { version = "1.0.94", features = ["derive"] } +serde_json = { version = "1.0.48", features = ["preserve_order"]} +serde = { version = "1.0.105", features = ["derive"] } actix = "0.9.0" actix-web = "2.0.0" actix-files = "0.2.1" @@ -22,10 +22,10 @@ actix-rt = "1.0.0" log = "0.4.0" env_logger = "0.7.1" rand = "0.7.3" -strum = "0.17.1" -strum_macros = "0.17.1" +strum = "0.18.0" +strum_macros = "0.18.0" jsonwebtoken = "7.0.1" -regex = "1.3.4" +regex = "1.3.5" lazy_static = "1.3.0" lettre = "0.9.2" lettre_email = "0.9.2" diff --git a/ui/package.json b/ui/package.json index e3cabae5..7d946614 100644 --- a/ui/package.json +++ b/ui/package.json @@ -15,18 +15,18 @@ "keywords": [], "dependencies": { "@types/autosize": "^3.0.6", - "@types/js-cookie": "^2.2.1", + "@types/js-cookie": "^2.2.5", "@types/jwt-decode": "^2.2.1", "@types/markdown-it": "^0.0.9", "@types/markdown-it-container": "^2.0.2", - "@types/node": "^13.7.0", + "@types/node": "^13.9.2", "autosize": "^4.0.2", "bootswatch": "^4.3.1", "classcat": "^1.1.3", "dotenv": "^8.2.0", "emoji-short-name": "^1.0.0", - "husky": "^4.2.1", - "i18next": "^19.0.3", + "husky": "^4.2.3", + "i18next": "^19.3.3", "inferno": "^7.4.2", "inferno-i18next": "nimbusec-oss/inferno-i18next", "inferno-router": "^7.4.2", @@ -40,21 +40,21 @@ "prettier": "^1.18.2", "reconnecting-websocket": "^4.4.0", "rxjs": "^6.4.0", - "terser": "^4.6.3", - "tippy.js": "^6.0.0", - "toastify-js": "^1.6.2", - "tributejs": "^5.0.0", + "terser": "^4.6.7", + "tippy.js": "^6.1.0", + "toastify-js": "^1.7.0", + "tributejs": "^5.1.2", "twemoji": "^12.1.2", - "ws": "^7.0.0" + "ws": "^7.2.3" }, "devDependencies": { "eslint": "^6.5.1", "eslint-plugin-inferno": "^7.14.3", - "eslint-plugin-jane": "^7.0.2", + "eslint-plugin-jane": "^7.2.0", "fuse-box": "^3.1.3", - "lint-staged": "^10.0.2", - "sortpack": "^2.0.1", - "ts-node": "^8.6.2", + "lint-staged": "^10.0.8", + "sortpack": "^2.1.2", + "ts-node": "^8.7.0", "ts-transform-classcat": "^0.0.2", "ts-transform-inferno": "^4.0.2", "typescript": "^3.8.3" diff --git a/ui/yarn.lock b/ui/yarn.lock index 0d382f8f..8d75052b 100644 --- a/ui/yarn.lock +++ b/ui/yarn.lock @@ -9,12 +9,12 @@ dependencies: "@babel/highlight" "^7.8.3" -"@babel/generator@^7.8.4": - version "7.8.4" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.8.4.tgz#35bbc74486956fe4251829f9f6c48330e8d0985e" - integrity sha512-PwhclGdRpNAf3IxZb0YVuITPZmmrXz9zf6fH8lT4XbrmfQKr6ryBzhv593P5C6poJRciFCL/eHGW2NuGrgEyxA== +"@babel/generator@^7.8.6": + version "7.8.8" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.8.8.tgz#cdcd58caab730834cee9eeadb729e833b625da3e" + integrity sha512-HKyUVu69cZoclptr8t8U5b6sx6zoWjh8jiUhnuj3MpZuKT2dJ8zPTuiy31luq32swhI0SpwItCIlU8XW7BZeJg== dependencies: - "@babel/types" "^7.8.3" + "@babel/types" "^7.8.7" jsesc "^2.5.1" lodash "^4.17.13" source-map "^0.5.0" @@ -51,7 +51,12 @@ esutils "^2.0.2" js-tokens "^4.0.0" -"@babel/parser@^7.0.0", "@babel/parser@^7.8.3", "@babel/parser@^7.8.4": +"@babel/parser@^7.7.0", "@babel/parser@^7.8.6": + version "7.8.8" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.8.8.tgz#4c3b7ce36db37e0629be1f0d50a571d2f86f6cd4" + integrity sha512-mO5GWzBPsPf6865iIbzNE0AvkKF3NE+2S3eRUpE+FE07BOAkXh6G+GW/Pj01hhXjve1WScbaIO4UlY1JKeqCcA== + +"@babel/parser@^7.8.3": version "7.8.4" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.8.4.tgz#d1dbe64691d60358a974295fa53da074dd2ce8e8" integrity sha512-0fKu/QqildpXmPVaRBoXOlyBb3MC+J0A66x97qEfLOMkn3u6nfY5esWogQwi/K0BjASYy4DbnsEWnpNL6qT5Mw== @@ -64,6 +69,14 @@ core-js-pure "^3.0.0" regenerator-runtime "^0.13.2" +"@babel/runtime-corejs3@^7.8.3": + version "7.8.7" + resolved "https://registry.yarnpkg.com/@babel/runtime-corejs3/-/runtime-corejs3-7.8.7.tgz#8209d9dff2f33aa2616cb319c83fe159ffb07b8c" + integrity sha512-sc7A+H4I8kTd7S61dgB9RomXu/C+F4IrRr4Ytze4dnfx7AXEpCrejSNpjx7vq6y/Bak9S6Kbk65a/WgMLtg43Q== + dependencies: + core-js-pure "^3.0.0" + regenerator-runtime "^0.13.4" + "@babel/runtime@^7.1.2", "@babel/runtime@^7.3.1", "@babel/runtime@^7.4.5", "@babel/runtime@^7.6.3", "@babel/runtime@^7.7.4": version "7.8.4" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.8.4.tgz#d79f5a2040f7caa24d53e563aad49cbc05581308" @@ -80,22 +93,31 @@ "@babel/parser" "^7.8.3" "@babel/types" "^7.8.3" -"@babel/traverse@^7.0.0": - version "7.8.4" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.8.4.tgz#f0845822365f9d5b0e312ed3959d3f827f869e3c" - integrity sha512-NGLJPZwnVEyBPLI+bl9y9aSnxMhsKz42so7ApAv9D+b4vAFPpY013FTS9LdKxcABoIYFU52HcYga1pPlx454mg== +"@babel/traverse@^7.7.0": + version "7.8.6" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.8.6.tgz#acfe0c64e1cd991b3e32eae813a6eb564954b5ff" + integrity sha512-2B8l0db/DPi8iinITKuo7cbPznLCEk0kCxDoB9/N6gGNg/gxOXiR/IcymAFPiBwk5w6TtQ27w4wpElgp9btR9A== dependencies: "@babel/code-frame" "^7.8.3" - "@babel/generator" "^7.8.4" + "@babel/generator" "^7.8.6" "@babel/helper-function-name" "^7.8.3" "@babel/helper-split-export-declaration" "^7.8.3" - "@babel/parser" "^7.8.4" - "@babel/types" "^7.8.3" + "@babel/parser" "^7.8.6" + "@babel/types" "^7.8.6" debug "^4.1.0" globals "^11.1.0" lodash "^4.17.13" -"@babel/types@^7.0.0", "@babel/types@^7.8.3": +"@babel/types@^7.7.0", "@babel/types@^7.8.6", "@babel/types@^7.8.7": + version "7.8.7" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.8.7.tgz#1fc9729e1acbb2337d5b6977a63979b4819f5d1d" + integrity sha512-k2TreEHxFA4CjGkL+GYjRyx35W0Mr7DP5+9q6WMkyKXB+904bYmG40syjMFV0oLlhhFCwWl0vA0DyzTDkwAiJw== + dependencies: + esutils "^2.0.2" + lodash "^4.17.13" + to-fast-properties "^2.0.0" + +"@babel/types@^7.8.3": version "7.8.3" resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.8.3.tgz#5a383dffa5416db1b73dedffd311ffd0788fb31c" integrity sha512-jBD+G8+LWpMBBWvVcdr4QysjUE4mU/syrhN17o1u3gx0/WzJB1kwiVZAXRtWbsIPOwW8pF/YJV5+nmetPzepXg== @@ -104,10 +126,10 @@ lodash "^4.17.13" to-fast-properties "^2.0.0" -"@popperjs/core@^2.0.6": - version "2.0.6" - resolved "https://registry.yarnpkg.com/@popperjs/core/-/core-2.0.6.tgz#5a39ac118811ca844155b0ad5190b8c24f35e533" - integrity sha512-zj7Gw8QC4jmR92eKUvtrZUEpl2ypRbq+qlE4pwf9n2hnUO9BOAcWUs4/Ht+gNIbFt98xtqhLvccdCfD469MzpQ== +"@popperjs/core@^2.1.1": + version "2.1.1" + resolved "https://registry.yarnpkg.com/@popperjs/core/-/core-2.1.1.tgz#12c572ab88ef7345b43f21883fca26631c223085" + integrity sha512-sLqWxCzC5/QHLhziXSCAksBxHfOnQlhPRVgPK0egEw+ktWvG75T2k+aYWVjVh9+WKeT3tlG3ZNbZQvZLmfuOIw== "@samverschueren/stream-to-observable@^0.3.0": version "0.3.0" @@ -140,10 +162,10 @@ dependencies: "@types/sizzle" "*" -"@types/js-cookie@^2.2.1": - version "2.2.4" - resolved "https://registry.yarnpkg.com/@types/js-cookie/-/js-cookie-2.2.4.tgz#f79720b4755aa197c2e15e982e2f438f5748e348" - integrity sha512-WTfSE1Eauak/Nrg6cA9FgPTFvVawejsai6zXoq0QYTQ3mxONeRtGhKxa7wMlUzWWmzrmTeV+rwLjHgsCntdrsA== +"@types/js-cookie@^2.2.5": + version "2.2.5" + resolved "https://registry.yarnpkg.com/@types/js-cookie/-/js-cookie-2.2.5.tgz#38dfaacae8623b37cc0b0d27398e574e3fc28b1e" + integrity sha512-cpmwBRcHJmmZx0OGU7aPVwGWGbs4iKwVYchk9iuMtxNCA2zorwdaTz4GkLgs2WGxiRZRFKnV1k6tRUHX7tBMxg== "@types/json-schema@^7.0.3": version "7.0.4" @@ -174,10 +196,10 @@ dependencies: "@types/linkify-it" "*" -"@types/node@^13.7.0": - version "13.7.0" - resolved "https://registry.yarnpkg.com/@types/node/-/node-13.7.0.tgz#b417deda18cf8400f278733499ad5547ed1abec4" - integrity sha512-GnZbirvmqZUzMgkFn70c74OQpTTUcCzlhQliTzYjQMqg+hVKcDnxdL19Ne3UdYzdMA/+W3eb646FWn/ZaT1NfQ== +"@types/node@^13.9.2": + version "13.9.2" + resolved "https://registry.yarnpkg.com/@types/node/-/node-13.9.2.tgz#ace1880c03594cc3e80206d96847157d8e7fa349" + integrity sha512-bnoqK579sAYrQbp73wwglccjJ4sfRdKU7WNEZ5FW4K2U6Kc0/eZ5kvXG0JKsEKFB50zrFmfFt52/cvBbZa7eXg== "@types/normalize-package-data@^2.4.0": version "2.4.0" @@ -194,18 +216,27 @@ resolved "https://registry.yarnpkg.com/@types/sizzle/-/sizzle-2.3.2.tgz#a811b8c18e2babab7d542b3365887ae2e4d9de47" integrity sha512-7EJYyKTL7tFR8+gDbB6Wwz/arpGa0Mywk1TJbNzKzHtzbwVmY4HR9WqS5VV7dsBUKQmPNr192jHr/VpBluj/hg== -"@typescript-eslint/eslint-plugin@2.18.0": - version "2.18.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.18.0.tgz#f8cf272dfb057ecf1ea000fea1e0b3f06a32f9cb" - integrity sha512-kuO8WQjV+RCZvAXVRJfXWiJ8iYEtfHlKgcqqqXg9uUkIolEHuUaMmm8/lcO4xwCOtaw6mY0gStn2Lg4/eUXXYQ== +"@typescript-eslint/eslint-plugin@2.24.0": + version "2.24.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.24.0.tgz#a86cf618c965a462cddf3601f594544b134d6d68" + integrity sha512-wJRBeaMeT7RLQ27UQkDFOu25MqFOBus8PtOa9KaT5ZuxC1kAsd7JEHqWt4YXuY9eancX0GK9C68i5OROnlIzBA== dependencies: - "@typescript-eslint/experimental-utils" "2.18.0" + "@typescript-eslint/experimental-utils" "2.24.0" eslint-utils "^1.4.3" functional-red-black-tree "^1.0.1" regexpp "^3.0.0" tsutils "^3.17.1" -"@typescript-eslint/experimental-utils@2.18.0", "@typescript-eslint/experimental-utils@^2.5.0": +"@typescript-eslint/experimental-utils@2.24.0": + version "2.24.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-2.24.0.tgz#a5cb2ed89fedf8b59638dc83484eb0c8c35e1143" + integrity sha512-DXrwuXTdVh3ycNCMYmWhUzn/gfqu9N0VzNnahjiDJvcyhfBy4gb59ncVZVxdp5XzBC77dCncu0daQgOkbvPwBw== + dependencies: + "@types/json-schema" "^7.0.3" + "@typescript-eslint/typescript-estree" "2.24.0" + eslint-scope "^5.0.0" + +"@typescript-eslint/experimental-utils@^2.5.0": version "2.18.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-2.18.0.tgz#e4eab839082030282496c1439bbf9fdf2a4f3da8" integrity sha512-J6MopKPHuJYmQUkANLip7g9I82ZLe1naCbxZZW3O2sIxTiq/9YYoOELEKY7oPg0hJ0V/AQ225h2z0Yp+RRMXhw== @@ -214,14 +245,14 @@ "@typescript-eslint/typescript-estree" "2.18.0" eslint-scope "^5.0.0" -"@typescript-eslint/parser@2.18.0": - version "2.18.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-2.18.0.tgz#d5f7fc1839abd4a985394e40e9d2454bd56aeb1f" - integrity sha512-SJJPxFMEYEWkM6pGfcnjLU+NJIPo+Ko1QrCBL+i0+zV30ggLD90huEmMMhKLHBpESWy9lVEeWlQibweNQzyc+A== +"@typescript-eslint/parser@2.24.0": + version "2.24.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-2.24.0.tgz#2cf0eae6e6dd44d162486ad949c126b887f11eb8" + integrity sha512-H2Y7uacwSSg8IbVxdYExSI3T7uM1DzmOn2COGtCahCC3g8YtM1xYAPi2MAHyfPs61VKxP/J/UiSctcRgw4G8aw== dependencies: "@types/eslint-visitor-keys" "^1.0.0" - "@typescript-eslint/experimental-utils" "2.18.0" - "@typescript-eslint/typescript-estree" "2.18.0" + "@typescript-eslint/experimental-utils" "2.24.0" + "@typescript-eslint/typescript-estree" "2.24.0" eslint-visitor-keys "^1.1.0" "@typescript-eslint/typescript-estree@2.18.0": @@ -237,6 +268,19 @@ semver "^6.3.0" tsutils "^3.17.1" +"@typescript-eslint/typescript-estree@2.24.0": + version "2.24.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-2.24.0.tgz#38bbc8bb479790d2f324797ffbcdb346d897c62a" + integrity sha512-RJ0yMe5owMSix55qX7Mi9V6z2FDuuDpN6eR5fzRJrp+8in9UF41IGNQHbg5aMK4/PjVaEQksLvz0IA8n+Mr/FA== + dependencies: + debug "^4.1.1" + eslint-visitor-keys "^1.1.0" + glob "^7.1.6" + is-glob "^4.0.1" + lodash "^4.17.15" + semver "^6.3.0" + tsutils "^3.17.1" + accepts@~1.3.7: version "1.3.7" resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.7.tgz#531bc726517a3b2b41f850021c6cc15eaab507cd" @@ -504,15 +548,15 @@ axobject-query@^2.0.2: "@babel/runtime" "^7.7.4" "@babel/runtime-corejs3" "^7.7.4" -babel-eslint@10.0.3: - version "10.0.3" - resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-10.0.3.tgz#81a2c669be0f205e19462fed2482d33e4687a88a" - integrity sha512-z3U7eMY6r/3f3/JB9mTsLjyxrv0Yb1zb8PCWCLpguxfCzBIZUwy23R1t/XKewP+8mEN2Ck8Dtr4q20z6ce6SoA== +babel-eslint@10.1.0: + version "10.1.0" + resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-10.1.0.tgz#6968e568a910b78fb3779cdd8b6ac2f479943232" + integrity sha512-ifWaTHQ0ce+448CYop8AdrQiBsGrnC+bMgfyKFdi6EsPLTAWG+QfyDeM6OH+FmWnKvEq5NnBMLvlBUPKQZoDSg== dependencies: "@babel/code-frame" "^7.0.0" - "@babel/parser" "^7.0.0" - "@babel/traverse" "^7.0.0" - "@babel/types" "^7.0.0" + "@babel/parser" "^7.7.0" + "@babel/traverse" "^7.7.0" + "@babel/types" "^7.7.0" eslint-visitor-keys "^1.0.0" resolve "^1.12.0" @@ -1207,10 +1251,10 @@ eslint-plugin-es@^3.0.0: eslint-utils "^2.0.0" regexpp "^3.0.0" -eslint-plugin-import@2.20.0: - version "2.20.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.20.0.tgz#d749a7263fb6c29980def8e960d380a6aa6aecaa" - integrity sha512-NK42oA0mUc8Ngn4kONOPsPB1XhbUvNHqF+g307dPV28aknPoiNnKLFd9em4nkswwepdF5ouieqv5Th/63U7YJQ== +eslint-plugin-import@2.20.1: + version "2.20.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.20.1.tgz#802423196dcb11d9ce8435a5fc02a6d3b46939b3" + integrity sha512-qQHgFOTjguR+LnYRoToeZWT62XM55MBVXObHM6SKFd1VzDcX/vqT1kAz8ssqigh5eMj8qXcRoXXGZpPP6RfdCw== dependencies: array-includes "^3.0.3" array.prototype.flat "^1.2.1" @@ -1239,33 +1283,32 @@ eslint-plugin-inferno@^7.14.3: object.values "^1.1.0" resolve "^1.12.0" -eslint-plugin-jane@^7.0.2: - version "7.1.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-jane/-/eslint-plugin-jane-7.1.0.tgz#ee087405329e6bc9bfe9316fc5881c1d4e27bc71" - integrity sha512-ScsxkkeTUnGYKLaiIk5zz/x7ZkDh7+rTj94daZboNmkJejdYka0sLFpfvDGm/7B8ImKacKdjRatQD0HjxlaPzA== +eslint-plugin-jane@^7.2.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-jane/-/eslint-plugin-jane-7.2.0.tgz#a2454a6700c644e6c86821ca294adf303e75eddc" + integrity sha512-/BPZrfxWX9T45gJSf4/2GHfBYgsBYTW7StAQfxL8PxWABZIQKWPWy/5ZokX7UaJlgKHAoC42rJHCQLK5hmfJNA== dependencies: - "@typescript-eslint/eslint-plugin" "2.18.0" - "@typescript-eslint/parser" "2.18.0" - babel-eslint "10.0.3" + "@typescript-eslint/eslint-plugin" "2.24.0" + "@typescript-eslint/parser" "2.24.0" + babel-eslint "10.1.0" eslint-config-prettier "6.10.0" eslint-plugin-babel "5.3.0" - eslint-plugin-import "2.20.0" - eslint-plugin-jest "23.6.0" + eslint-plugin-import "2.20.1" + eslint-plugin-jest "23.8.2" eslint-plugin-jsx-a11y "6.2.3" eslint-plugin-node "11.0.0" eslint-plugin-prettier "3.1.2" eslint-plugin-promise "4.2.1" - eslint-plugin-react "7.18.0" - eslint-plugin-react-hooks "2.3.0" - eslint-plugin-unicorn "15.0.1" + eslint-plugin-react "7.19.0" + eslint-plugin-react-hooks "2.5.0" + eslint-plugin-unicorn "17.2.0" -eslint-plugin-jest@23.6.0: - version "23.6.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-23.6.0.tgz#508b32f80d44058c8c01257c0ee718cfbd521e9d" - integrity sha512-GH8AhcFXspOLqak7fqnddLXEJsrFyvgO8Bm60SexvKSn1+3rWYESnCiWUOCUcBTprNSDSE4CtAZdM4EyV6gPPw== +eslint-plugin-jest@23.8.2: + version "23.8.2" + resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-23.8.2.tgz#6f28b41c67ef635f803ebd9e168f6b73858eb8d4" + integrity sha512-xwbnvOsotSV27MtAe7s8uGWOori0nUsrXh2f1EnpmXua8sDfY6VZhHAhHg2sqK7HBNycRQExF074XSZ7DvfoFg== dependencies: "@typescript-eslint/experimental-utils" "^2.5.0" - micromatch "^4.0.2" eslint-plugin-jsx-a11y@6.2.3: version "6.2.3" @@ -1306,15 +1349,15 @@ eslint-plugin-promise@4.2.1: resolved "https://registry.yarnpkg.com/eslint-plugin-promise/-/eslint-plugin-promise-4.2.1.tgz#845fd8b2260ad8f82564c1222fce44ad71d9418a" integrity sha512-VoM09vT7bfA7D+upt+FjeBO5eHIJQBUWki1aPvB+vbNiHS3+oGIJGIeyBtKQTME6UPXXy3vV07OL1tHd3ANuDw== -eslint-plugin-react-hooks@2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-2.3.0.tgz#53e073961f1f5ccf8dd19558036c1fac8c29d99a" - integrity sha512-gLKCa52G4ee7uXzdLiorca7JIQZPPXRAQDXV83J4bUEeUuc5pIEyZYAZ45Xnxe5IuupxEqHS+hUhSLIimK1EMw== +eslint-plugin-react-hooks@2.5.0: + version "2.5.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-2.5.0.tgz#c50ab7ca5945ce6d1cf8248d9e185c80b54171b6" + integrity sha512-bzvdX47Jx847bgAYf0FPX3u1oxU+mKU8tqrpj4UX9A96SbAmj/HVEefEy6rJUog5u8QIlOPTKZcBpGn5kkKfAQ== -eslint-plugin-react@7.18.0: - version "7.18.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.18.0.tgz#2317831284d005b30aff8afb7c4e906f13fa8e7e" - integrity sha512-p+PGoGeV4SaZRDsXqdj9OWcOrOpZn8gXoGPcIQTzo2IDMbAKhNDnME9myZWqO3Ic4R3YmwAZ1lDjWl2R2hMUVQ== +eslint-plugin-react@7.19.0: + version "7.19.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.19.0.tgz#6d08f9673628aa69c5559d33489e855d83551666" + integrity sha512-SPT8j72CGuAP+JFbT0sJHOB80TX/pu44gQ4vXH/cq+hQTiY2PuZ6IHkqXJV6x1b28GDdo1lbInjKUrrdUf0LOQ== dependencies: array-includes "^3.1.1" doctrine "^2.1.0" @@ -1324,29 +1367,27 @@ eslint-plugin-react@7.18.0: object.fromentries "^2.0.2" object.values "^1.1.1" prop-types "^15.7.2" - resolve "^1.14.2" + resolve "^1.15.1" + semver "^6.3.0" + string.prototype.matchall "^4.0.2" + xregexp "^4.3.0" -eslint-plugin-unicorn@15.0.1: - version "15.0.1" - resolved "https://registry.yarnpkg.com/eslint-plugin-unicorn/-/eslint-plugin-unicorn-15.0.1.tgz#8379d1d6882f9f8631bec8025ac9e8fe89e43945" - integrity sha512-yahqrPGFUzwH5cnmnj+iPlgPapAiBIZ/ZNSDkhTVPgPCo7/mOEjJ2gDhEclrtQVBE9olmec4N+CKDnJuZ9XpRA== +eslint-plugin-unicorn@17.2.0: + version "17.2.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-unicorn/-/eslint-plugin-unicorn-17.2.0.tgz#8f147ba24d417dc5de948c7df7d006108a37a540" + integrity sha512-0kYjrywf0kQxevFz571KrDfYMIRZ5Kq6dDgPU1EEBFeC181r+fAaPatBScWX+/hisKJ4+eCRFebxTeVylsSYmw== dependencies: ci-info "^2.0.0" clean-regexp "^1.0.0" eslint-ast-utils "^1.1.0" eslint-template-visitor "^1.1.0" import-modules "^2.0.0" - lodash.camelcase "^4.3.0" - lodash.defaultsdeep "^4.6.1" - lodash.kebabcase "^4.1.1" - lodash.snakecase "^4.1.1" - lodash.upperfirst "^4.3.1" + lodash "^4.17.15" read-pkg-up "^7.0.1" - regexp-tree "^0.1.17" - regexpp "^3.0.0" + regexp-tree "^0.1.20" reserved-words "^0.1.2" safe-regex "^2.1.1" - semver "^6.3.0" + semver "^7.1.2" eslint-rule-composer@^0.3.0: version "0.3.0" @@ -2141,10 +2182,10 @@ human-signals@^1.1.1: resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-1.1.1.tgz#c5b1cd14f50aeae09ab6c59fe63ba3395fe4dfa3" integrity sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw== -husky@^4.2.1: - version "4.2.1" - resolved "https://registry.yarnpkg.com/husky/-/husky-4.2.1.tgz#b09f1bd9129e6c323cc515dc17081d0615e2d7c1" - integrity sha512-Qa0lRreeIf4Tl92sSs42ER6qc3hzoyQPPorzOrFWfPEVbdi6LuvJEqWKPk905fOWIR76iBpp7ECZNIwk+a8xuQ== +husky@^4.2.3: + version "4.2.3" + resolved "https://registry.yarnpkg.com/husky/-/husky-4.2.3.tgz#3b18d2ee5febe99e27f2983500202daffbc3151e" + integrity sha512-VxTsSTRwYveKXN4SaH1/FefRJYCtx+wx04sSVcOpD7N2zjoHxa+cEJ07Qg5NmV3HAK+IRKOyNVpi2YBIVccIfQ== dependencies: chalk "^3.0.0" ci-info "^2.0.0" @@ -2157,10 +2198,10 @@ husky@^4.2.1: slash "^3.0.0" which-pm-runs "^1.0.0" -i18next@^19.0.3: - version "19.1.0" - resolved "https://registry.yarnpkg.com/i18next/-/i18next-19.1.0.tgz#fe1a1da3d208872946307c7d2d115da45d46159f" - integrity sha512-ISbmukX4L6Dz0QoH9+EW1AnBw7j+NRLoMu9uLPMaNSSTP9Eie9/oUL0dOyWX15baB3gYOpkHJpGZRHOqcnl0ew== +i18next@^19.3.3: + version "19.3.3" + resolved "https://registry.yarnpkg.com/i18next/-/i18next-19.3.3.tgz#04bd79b315e5fe2c87ab8f411e5d55eda0a17bd8" + integrity sha512-CnuPqep5/JsltkGvQqzYN4d79eCe0TreCBRF3a8qHHi8x4SON1qqZ/pvR2X7BfNkNqpA5HXIqw0E731H+VsgSg== dependencies: "@babel/runtime" "^7.3.1" @@ -2339,6 +2380,15 @@ inquirer@^7.0.0: strip-ansi "^5.1.0" through "^2.3.6" +internal-slot@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/internal-slot/-/internal-slot-1.0.2.tgz#9c2e9fb3cd8e5e4256c6f45fe310067fcfa378a3" + integrity sha512-2cQNfwhAfJIkU4KZPkDI+Gj5yNNnbqi40W9Gge6dfnk4TocEVm00B3bdiL+JINrbGJil2TeHvM4rETGzk/f/0g== + dependencies: + es-abstract "^1.17.0-next.1" + has "^1.0.3" + side-channel "^1.0.2" + ipaddr.js@1.9.0: version "1.9.0" resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.9.0.tgz#37df74e430a0e47550fe54a2defe30d8acd95f65" @@ -2764,10 +2814,10 @@ linkify-it@^2.0.0: dependencies: uc.micro "^1.0.1" -lint-staged@^10.0.2: - version "10.0.7" - resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-10.0.7.tgz#d205f92d9359419a23bc6aa3b6f8546b1998da64" - integrity sha512-Byj0F4l7GYUpYYHEqyFH69NiI6ICTg0CeCKbhRorL+ickbzILKUlZLiyCkljZV02wnoh7yH7PmFyYm9PRNwk9g== +lint-staged@^10.0.8: + version "10.0.8" + resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-10.0.8.tgz#0f7849cdc336061f25f5d4fcbcfa385701ff4739" + integrity sha512-Oa9eS4DJqvQMVdywXfEor6F4vP+21fPHF8LUXgBbVWUSWBddjqsvO6Bv1LwMChmgQZZqwUvgJSHlu8HFHAPZmA== dependencies: chalk "^3.0.0" commander "^4.0.1" @@ -2852,36 +2902,11 @@ locate-path@^5.0.0: dependencies: p-locate "^4.1.0" -lodash.camelcase@^4.3.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz#b28aa6288a2b9fc651035c7711f65ab6190331a6" - integrity sha1-soqmKIorn8ZRA1x3EfZathkDMaY= - -lodash.defaultsdeep@^4.6.1: - version "4.6.1" - resolved "https://registry.yarnpkg.com/lodash.defaultsdeep/-/lodash.defaultsdeep-4.6.1.tgz#512e9bd721d272d94e3d3a63653fa17516741ca6" - integrity sha512-3j8wdDzYuWO3lM3Reg03MuQR957t287Rpcxp1njpEa8oDrikb+FwGdW3n+FELh/A6qib6yPit0j/pv9G/yeAqA== - lodash.get@^4.4.2: version "4.4.2" resolved "https://registry.yarnpkg.com/lodash.get/-/lodash.get-4.4.2.tgz#2d177f652fa31e939b4438d5341499dfa3825e99" integrity sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk= -lodash.kebabcase@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/lodash.kebabcase/-/lodash.kebabcase-4.1.1.tgz#8489b1cb0d29ff88195cceca448ff6d6cc295c36" - integrity sha1-hImxyw0p/4gZXM7KRI/21swpXDY= - -lodash.snakecase@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/lodash.snakecase/-/lodash.snakecase-4.1.1.tgz#39d714a35357147837aefd64b5dcbb16becd8f8d" - integrity sha1-OdcUo1NXFHg3rv1ktdy7Fr7Nj40= - -lodash.upperfirst@^4.3.1: - version "4.3.1" - resolved "https://registry.yarnpkg.com/lodash.upperfirst/-/lodash.upperfirst-4.3.1.tgz#1365edf431480481ef0d1c68957a5ed99d49f7ce" - integrity sha1-E2Xt9DFIBIHvDRxolXpe2Z1J984= - lodash.zip@^4.2.0: version "4.2.0" resolved "https://registry.yarnpkg.com/lodash.zip/-/lodash.zip-4.2.0.tgz#ec6662e4896408ed4ab6c542a3990b72cc080020" @@ -3782,6 +3807,11 @@ regenerator-runtime@^0.13.2: resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.3.tgz#7cf6a77d8f5c6f60eb73c5fc1955b2ceb01e6bf5" integrity sha512-naKIZz2GQ8JWh///G7L3X6LaQUAMp2lvb1rvwwsURe/VXwD6VMfr+/1NuNw3ag8v2kY1aQ/go5SNn79O9JU7yw== +regenerator-runtime@^0.13.4: + version "0.13.5" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.5.tgz#d878a1d094b4306d10b9096484b33ebd55e26697" + integrity sha512-ZS5w8CpKFinUzOwW3c83oPeVXoNsrLsaCoLtJvAClH135j/R77RuymhiSErhm2lKcwSCIpmvIWSbDkIfAqKQlA== + regex-cache@^0.4.2: version "0.4.4" resolved "https://registry.yarnpkg.com/regex-cache/-/regex-cache-0.4.4.tgz#75bdc58a2a1496cec48a12835bc54c8d562336dd" @@ -3797,11 +3827,24 @@ regex-not@^1.0.0, regex-not@^1.0.2: extend-shallow "^3.0.2" safe-regex "^1.1.0" -regexp-tree@^0.1.17, regexp-tree@~0.1.1: +regexp-tree@^0.1.20: + version "0.1.21" + resolved "https://registry.yarnpkg.com/regexp-tree/-/regexp-tree-0.1.21.tgz#55e2246b7f7d36f1b461490942fa780299c400d7" + integrity sha512-kUUXjX4AnqnR8KRTCrayAo9PzYMRKmVoGgaz2tBuz0MF3g1ZbGebmtW0yFHfFK9CmBjQKeYIgoL22pFLBJY7sw== + +regexp-tree@~0.1.1: version "0.1.18" resolved "https://registry.yarnpkg.com/regexp-tree/-/regexp-tree-0.1.18.tgz#ed4819a9f03ec2de9613421d6eaf47512e7fdaf1" integrity sha512-mKLUfTDU1GE5jGR7cn2IEPDzYjmOviZOHYAR1XGe8Lg48Mdk684waD1Fqhv2Nef+TsDVdmIj08m/GUKTMk7J2Q== +regexp.prototype.flags@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.3.0.tgz#7aba89b3c13a64509dabcf3ca8d9fbb9bdf5cb75" + integrity sha512-2+Q0C5g951OlYlJz6yu5/M33IcsESLlLfsyIaLJaG4FA2r4yP8MvVMJUUP/fVBkSpbbbZlS5gynbEWLipiiXiQ== + dependencies: + define-properties "^1.1.3" + es-abstract "^1.17.0-next.1" + regexpp@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-2.0.1.tgz#8d19d31cf632482b589049f8281f93dbcba4d07f" @@ -3897,13 +3940,20 @@ resolve-url@^0.2.1: resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo= -resolve@^1.10.0, resolve@^1.10.1, resolve@^1.12.0, resolve@^1.13.1, resolve@^1.14.2: +resolve@^1.10.0, resolve@^1.10.1, resolve@^1.12.0, resolve@^1.13.1: version "1.15.0" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.15.0.tgz#1b7ca96073ebb52e741ffd799f6b39ea462c67f5" integrity sha512-+hTmAldEGE80U2wJJDC1lebb5jWqvTYAfm3YZ1ckk1gBr0MnCqUKlwK1e+anaFljIl+F5tR5IoZcm4ZDA1zMQw== dependencies: path-parse "^1.0.6" +resolve@^1.15.1: + version "1.15.1" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.15.1.tgz#27bdcdeffeaf2d6244b95bb0f9f4b4653451f3e8" + integrity sha512-84oo6ZTtoTUpjgNEr5SJyzQhzL72gaRodsSfyxC/AXRvwu0Yse9H8eF9IpGo7b8YetZhlI6v7ZQ6bKBFV/6S7w== + dependencies: + path-parse "^1.0.6" + restore-cursor@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf" @@ -4007,6 +4057,11 @@ semver@^6.1.0, semver@^6.1.2, semver@^6.3.0: resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== +semver@^7.1.2: + version "7.1.3" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.1.3.tgz#e4345ce73071c53f336445cfc19efb1c311df2a6" + integrity sha512-ekM0zfiA9SCBlsKa2X1hxyxiI4L3B6EbVJkkdgQXnSEEaHlGdvyodMruTiulSRWMMB4NeIuYNMC9rTKTz97GxA== + send@0.17.1: version "0.17.1" resolved "https://registry.yarnpkg.com/send/-/send-0.17.1.tgz#c1d8b059f7900f7466dd4938bdc44e11ddb376c8" @@ -4080,6 +4135,14 @@ shorthash@0.0.2: resolved "https://registry.yarnpkg.com/shorthash/-/shorthash-0.0.2.tgz#59b268eecbde59038b30da202bcfbddeb2c4a4eb" integrity sha1-WbJo7sveWQOLMNogK8+93rLEpOs= +side-channel@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.2.tgz#df5d1abadb4e4bf4af1cd8852bf132d2f7876947" + integrity sha512-7rL9YlPHg7Ancea1S96Pa8/QWb4BtXL/TZvS6B8XFetGBeuhAsfmUspK6DokBeZ64+Kj9TCNRD/30pVz1BvQNA== + dependencies: + es-abstract "^1.17.0-next.1" + object-inspect "^1.7.0" + signal-exit@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" @@ -4134,10 +4197,10 @@ snapdragon@^0.8.1: source-map-resolve "^0.5.0" use "^3.1.0" -sortpack@^2.0.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/sortpack/-/sortpack-2.1.1.tgz#e94280616a517851257728721dd6749619aca309" - integrity sha512-/jtQAzl9JeTXZxzznW6L729M+Q7uv9k9Dm89eF0UxMj4Rna3CmO0IYT0MUS6aLyHUOTnwpT7kIDs4PQmMTEhLw== +sortpack@^2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/sortpack/-/sortpack-2.1.2.tgz#25bf86f2923c81f43a00a2166ff4d271fafeed11" + integrity sha512-43fSND1vmAdyfgC38aOkVxZBV331f4blF8acjwQmx7Gba4nuL2ene/Cq5eixNmDhKA/qQHnvSeAl+jEWb31rfg== source-map-resolve@^0.5.0: version "0.5.3" @@ -4299,6 +4362,18 @@ string-width@^4.1.0: is-fullwidth-code-point "^3.0.0" strip-ansi "^6.0.0" +string.prototype.matchall@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/string.prototype.matchall/-/string.prototype.matchall-4.0.2.tgz#48bb510326fb9fdeb6a33ceaa81a6ea04ef7648e" + integrity sha512-N/jp6O5fMf9os0JU3E72Qhf590RSRZU/ungsL/qJUYVTNv7hTG0P/dbPjxINVN9jpscu3nzYwKESU3P3RY5tOg== + dependencies: + define-properties "^1.1.3" + es-abstract "^1.17.0" + has-symbols "^1.0.1" + internal-slot "^1.0.2" + regexp.prototype.flags "^1.3.0" + side-channel "^1.0.2" + string.prototype.trimleft@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/string.prototype.trimleft/-/string.prototype.trimleft-2.1.1.tgz#9bdb8ac6abd6d602b17a4ed321870d2f8dcefc74" @@ -4408,10 +4483,10 @@ table@^5.2.3: slice-ansi "^2.1.0" string-width "^3.0.0" -terser@^4.6.3: - version "4.6.3" - resolved "https://registry.yarnpkg.com/terser/-/terser-4.6.3.tgz#e33aa42461ced5238d352d2df2a67f21921f8d87" - integrity sha512-Lw+ieAXmY69d09IIc/yqeBqXpEQIpDGZqT34ui1QWXIUpR2RjbqEkT8X7Lgex19hslSqcWM5iMN2kM11eMsESQ== +terser@^4.6.7: + version "4.6.7" + resolved "https://registry.yarnpkg.com/terser/-/terser-4.6.7.tgz#478d7f9394ec1907f0e488c5f6a6a9a2bad55e72" + integrity sha512-fmr7M1f7DBly5cX2+rFDvmGBAaaZyPrHYK4mMdHEDAdNTqXSZgSOfqsfGq2HqPGT/1V0foZZuCZFx8CHKgAk3g== dependencies: commander "^2.20.0" source-map "~0.6.1" @@ -4437,12 +4512,12 @@ tiny-warning@^1.0.0: resolved "https://registry.yarnpkg.com/tiny-warning/-/tiny-warning-1.0.3.tgz#94a30db453df4c643d0fd566060d60a875d84754" integrity sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA== -tippy.js@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/tippy.js/-/tippy.js-6.0.0.tgz#6bc4f477ea82ef344db51ae34f106a8b25f2d02c" - integrity sha512-2NVc5A8cnO9N/Fk+tTU6KEm6m8ZXT1u3pOY756zZ5BE38rWDl/hVyoWhTfM79HW1nEJSpn/VujqAMMZGHsE9qQ== +tippy.js@^6.1.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/tippy.js/-/tippy.js-6.1.0.tgz#9c58b94f92f3044d5e861b9d83da3c2a6d3d4323" + integrity sha512-cRFydlVZlvo4soQSUfVNbH2K77zDUhDAzaAjxseyn81gGIa+j72y98yDL2yB0n8gas/E+Zlr1iOyR5ckslUFqA== dependencies: - "@popperjs/core" "^2.0.6" + "@popperjs/core" "^2.1.1" tmp@^0.0.33: version "0.0.33" @@ -4488,10 +4563,10 @@ to-regex@^3.0.1, to-regex@^3.0.2: regex-not "^1.0.2" safe-regex "^1.1.0" -toastify-js@^1.6.2: - version "1.6.2" - resolved "https://registry.yarnpkg.com/toastify-js/-/toastify-js-1.6.2.tgz#38af35625797d3d3f51fa09851f0bda449271423" - integrity sha512-ECQzgjTjxaElfwp/8e8qoIYx7U5rU2G54e5aiPMv+UtmGOYEitrtNp/Kr8uMgntnQNrDZEQJNGjBtoNnEgR5EA== +toastify-js@^1.7.0: + version "1.7.0" + resolved "https://registry.yarnpkg.com/toastify-js/-/toastify-js-1.7.0.tgz#d6b44937ae2844a19c25fcc69ee5933165dbf666" + integrity sha512-GmPy4zJ/ulCfmCHlfCtgcB+K2xhx2AXW3T/ZZOSjyjaIGevhz+uvR8HSCTay/wBq4tt2mUnBqlObP1sSWGlsnQ== toidentifier@1.0.0: version "1.0.0" @@ -4506,15 +4581,15 @@ tough-cookie@~2.4.3: psl "^1.1.24" punycode "^1.4.1" -tributejs@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/tributejs/-/tributejs-5.0.0.tgz#2c5301a79c19d7a72d23e995bf7c9f47c2a34f23" - integrity sha512-aPUpq4+NTXRq1OcdoeiFg9d+wM+J0b7dpL7MNVxqo8JIgChtkx8HnsPVl/uZ4Z1ChTF9UI1ffbvTfJRHqJjjAw== +tributejs@^5.1.2: + version "5.1.2" + resolved "https://registry.yarnpkg.com/tributejs/-/tributejs-5.1.2.tgz#d8492d974d3098d6016248d689fb063cda6e77f7" + integrity sha512-R9ff/q6w4T5f3Y9+RL+qinog3X1eAj1UnR/yfZaGJ8D3wuJs4/vicrGYul9+fgS9EJ/iYgwARekTb92xwark0g== -ts-node@^8.6.2: - version "8.6.2" - resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-8.6.2.tgz#7419a01391a818fbafa6f826a33c1a13e9464e35" - integrity sha512-4mZEbofxGqLL2RImpe3zMJukvEvcO1XP8bj8ozBPySdCUXEcU5cIRwR0aM3R+VoZq7iXc8N86NC0FspGRqP4gg== +ts-node@^8.7.0: + version "8.7.0" + resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-8.7.0.tgz#266186947596bef9f3a034687595b30e31b20976" + integrity sha512-s659CsHrsxaRVDEleuOkGvbsA0rWHtszUNEt1r0CgAFN5ZZTQtDzpsluS7W5pOGJIa1xZE8R/zK4dEs+ldFezg== dependencies: arg "^4.1.0" diff "^4.0.1" @@ -4803,10 +4878,17 @@ ws@^1.1.1: options ">=0.0.5" ultron "1.0.x" -ws@^7.0.0: - version "7.2.1" - resolved "https://registry.yarnpkg.com/ws/-/ws-7.2.1.tgz#03ed52423cd744084b2cf42ed197c8b65a936b8e" - integrity sha512-sucePNSafamSKoOqoNfBd8V0StlkzJKL2ZAhGQinCfNQ+oacw+Pk7lcdAElecBF2VkLNZRiIb5Oi1Q5lVUVt2A== +ws@^7.2.3: + version "7.2.3" + resolved "https://registry.yarnpkg.com/ws/-/ws-7.2.3.tgz#a5411e1fb04d5ed0efee76d26d5c46d830c39b46" + integrity sha512-HTDl9G9hbkNDk98naoR/cHDws7+EyYMOdL1BmjsZXRUjf7d+MficC4B7HLUPlSiho0vg+CWKrGIt/VJBd1xunQ== + +xregexp@^4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/xregexp/-/xregexp-4.3.0.tgz#7e92e73d9174a99a59743f67a4ce879a04b5ae50" + integrity sha512-7jXDIFXh5yJ/orPn4SXjuVrWWoi4Cr8jfV1eHv9CixKSbU+jY4mxfrBwAuDvupPNKpMUY+FeIqsVw/JLT9+B8g== + dependencies: + "@babel/runtime-corejs3" "^7.8.3" yaml@^1.7.2: version "1.7.2" From 72a50aae0756bf51c709a3c1f597a2cf0cbbca05 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Wed, 18 Mar 2020 23:11:37 -0400 Subject: [PATCH 07/43] Updating chttp to isahc. --- server/Cargo.lock | 130 +++++++++++----------------------------------- server/Cargo.toml | 2 +- server/src/lib.rs | 6 +-- 3 files changed, 34 insertions(+), 104 deletions(-) diff --git a/server/Cargo.lock b/server/Cargo.lock index 418c8a01..f6ce6550 100644 --- a/server/Cargo.lock +++ b/server/Cargo.lock @@ -587,15 +587,6 @@ name = "byteorder" version = "1.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "bytes" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "iovec 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "bytes" version = "0.5.4" @@ -638,25 +629,6 @@ dependencies = [ "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "chttp" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", - "chrono 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)", - "crossbeam-channel 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", - "curl 0.4.26 (registry+https://github.com/rust-lang/crates.io-index)", - "curl-sys 0.4.28+curl-7.69.0 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-io-preview 0.3.0-alpha.17 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-util-preview 0.3.0-alpha.17 (registry+https://github.com/rust-lang/crates.io-index)", - "http 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "sluice 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "cloudabi" version = "0.0.3" @@ -707,14 +679,6 @@ dependencies = [ "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "crossbeam-channel" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "crossbeam-channel" version = "0.4.2" @@ -724,15 +688,6 @@ dependencies = [ "maybe-uninit 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "crossbeam-utils" -version = "0.6.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "crossbeam-utils" version = "0.7.2" @@ -1114,24 +1069,11 @@ dependencies = [ "futures-sink 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "futures-channel-preview" -version = "0.3.0-alpha.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "futures-core-preview 0.3.0-alpha.17 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "futures-core" version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "futures-core-preview" -version = "0.3.0-alpha.17" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "futures-executor" version = "0.3.4" @@ -1147,11 +1089,6 @@ name = "futures-io" version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "futures-io-preview" -version = "0.3.0-alpha.17" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "futures-macro" version = "0.3.4" @@ -1191,18 +1128,6 @@ dependencies = [ "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "futures-util-preview" -version = "0.3.0-alpha.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "futures-core-preview 0.3.0-alpha.17 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-io-preview 0.3.0-alpha.17 (registry+https://github.com/rust-lang/crates.io-index)", - "memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "pin-utils 0.1.0-alpha.4 (registry+https://github.com/rust-lang/crates.io-index)", - "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "fxhash" version = "0.2.1" @@ -1298,16 +1223,6 @@ name = "htmlescape" version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "http" -version = "0.1.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", - "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", - "itoa 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "http" version = "0.2.0" @@ -1373,6 +1288,28 @@ dependencies = [ "winreg 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "isahc" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-channel 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", + "curl 0.4.26 (registry+https://github.com/rust-lang/crates.io-index)", + "curl-sys 0.4.28+curl-7.69.0 (registry+https://github.com/rust-lang/crates.io-index)", + "encoding_rs 0.8.22 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-channel 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-io 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-util 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "http 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "mime 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", + "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "sluice 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "itoa" version = "0.1.1" @@ -1440,7 +1377,6 @@ dependencies = [ "actix-web-actors 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "bcrypt 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", "chrono 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)", - "chttp 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", "config 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", "diesel 1.4.3 (registry+https://github.com/rust-lang/crates.io-index)", "diesel_migrations 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1449,6 +1385,7 @@ dependencies = [ "failure 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", "hjson 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", "htmlescape 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "isahc 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", "jsonwebtoken 7.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "lettre 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2395,12 +2332,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "sluice" -version = "0.4.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "futures-channel-preview 0.3.0-alpha.17 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-core-preview 0.3.0-alpha.17 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-io-preview 0.3.0-alpha.17 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-channel 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-core 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-io 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-util 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2936,23 +2874,19 @@ dependencies = [ "checksum bumpalo 3.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1f359dc14ff8911330a51ef78022d376f25ed00248912803b58f00cb1c27f742" "checksum byte-tools 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" "checksum byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de" -"checksum bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)" = "206fdffcfa2df7cbe15601ef46c813fce0965eb3286db6b56c583b814b51c81c" "checksum bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)" = "130aac562c0dd69c56b3b1cc8ffd2e17be31d0b6c25b61c96b76231aa23e39e1" "checksum bytestring 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "fc267467f58ef6cc8874064c62a0423eb0d099362c8a23edd1c6d044f46eead4" "checksum c2-chacha 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "214238caa1bf3a496ec3392968969cab8549f96ff30652c9e56885329315f6bb" "checksum cc 1.0.50 (registry+https://github.com/rust-lang/crates.io-index)" = "95e28fa049fda1c330bcf9d723be7663a899c4679724b34c81e9f5a326aab8cd" "checksum cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" "checksum chrono 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)" = "80094f509cf8b5ae86a4966a39b3ff66cd7e2a3e594accec3743ff3fabeab5b2" -"checksum chttp 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)" = "ca699a61cc91c90af209d6bf546fc69d29e9d474c77fa86b9410eb3cf1e6eb31" "checksum cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" "checksum config 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "19b076e143e1d9538dde65da30f8481c2a6c44040edb8e02b9bf1351edb92ce3" "checksum copyless 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "6ff9c56c9fb2a49c05ef0e431485a22400af20d33226dc0764d891d09e724127" "checksum core-foundation 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "57d24c7a13c43e870e37c1556b74555437870a04514f7685f5b354e090567171" "checksum core-foundation-sys 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b3a71ab494c0b5b860bdc8407ae08978052417070c2ced38573a9157ad75b8ac" "checksum crc32fast 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ba125de2af0df55319f41944744ad91c71113bf74a4646efff39afe1f6842db1" -"checksum crossbeam-channel 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "c8ec7fcd21571dc78f96cc96243cab8d8f035247c3efd16c687be154c3fa9efa" "checksum crossbeam-channel 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "cced8691919c02aac3cb0a1bc2e9b73d89e832bf9a06fc579d4e71b68a2da061" -"checksum crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)" = "04973fa96e96579258a5091af6003abde64af786b860f18622b82e026cca60e6" "checksum crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8" "checksum curl 0.4.26 (registry+https://github.com/rust-lang/crates.io-index)" = "ecb534fed9060d04bccaa8b8e1e2d3d5a0d7a9ec6d9c667691c80a3c6b7d19ef" "checksum curl-sys 0.4.28+curl-7.69.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2c6b7fa5d36aa192e410788b77af65f339af24c8786419e8b48173689a484bf" @@ -2995,17 +2929,13 @@ dependencies = [ "checksum fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" "checksum futures 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "5c329ae8753502fb44ae4fc2b622fa2a94652c41e795143765ba0927f92ab780" "checksum futures-channel 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "f0c77d04ce8edd9cb903932b608268b3fffec4163dc053b3b402bf47eac1f1a8" -"checksum futures-channel-preview 0.3.0-alpha.17 (registry+https://github.com/rust-lang/crates.io-index)" = "21c71ed547606de08e9ae744bb3c6d80f5627527ef31ecf2a7210d0e67bc8fae" "checksum futures-core 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "f25592f769825e89b92358db00d26f965761e094951ac44d3663ef25b7ac464a" -"checksum futures-core-preview 0.3.0-alpha.17 (registry+https://github.com/rust-lang/crates.io-index)" = "4b141ccf9b7601ef987f36f1c0d9522f76df3bba1cf2e63bfacccc044c4558f5" "checksum futures-executor 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "f674f3e1bcb15b37284a90cedf55afdba482ab061c407a9c0ebbd0f3109741ba" "checksum futures-io 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "a638959aa96152c7a4cddf50fcb1e3fede0583b27157c26e67d6f99904090dc6" -"checksum futures-io-preview 0.3.0-alpha.17 (registry+https://github.com/rust-lang/crates.io-index)" = "082e402605fcb8b1ae1e5ba7d7fdfd3e31ef510e2a8367dd92927bb41ae41b3a" "checksum futures-macro 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "9a5081aa3de1f7542a794a397cde100ed903b0630152d0973479018fd85423a7" "checksum futures-sink 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "3466821b4bc114d95b087b850a724c6f83115e929bc88f1fa98a3304a944c8a6" "checksum futures-task 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "7b0a34e53cf6cdcd0178aa573aed466b646eb3db769570841fda0c7ede375a27" "checksum futures-util 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "22766cf25d64306bedf0384da004d05c9974ab104fcc4528f1236181c18004c5" -"checksum futures-util-preview 0.3.0-alpha.17 (registry+https://github.com/rust-lang/crates.io-index)" = "af8198c48b222f02326940ce2b3aa9e6e91a32886eeaad7ca3b8e4c70daa3f4e" "checksum fxhash 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" "checksum generic-array 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c68f0274ae0e023facc3c97b2e00f076be70e254bc851d972503b328db79b2ec" "checksum getrandom 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)" = "7abc8dd8451921606d809ba32e95b6111925cd2906060d2dcc29c070220503eb" @@ -3016,7 +2946,6 @@ dependencies = [ "checksum hostname 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "21ceb46a83a85e824ef93669c8b390009623863b5c195d1ba747292c0c72f94e" "checksum hostname 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3c731c3e10504cc8ed35cfe2f1db4c9274c3d35fa486e3b31df46f068ef3e867" "checksum htmlescape 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e9025058dae765dee5070ec375f591e2ba14638c63feff74f13805a72e523163" -"checksum http 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)" = "d6ccf5ede3a895d8856620237b2f02972c1bbc78d2965ad7fe8838d4a0ed41f0" "checksum http 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b708cc7f06493459026f53b9a61a7a121a5d1ec6238dee58ea4941132b30156b" "checksum httparse 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "cd179ae861f0c2e53da70d892f5f3029f9594be0c41dc5269cd371691b1dc2f9" "checksum humantime 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "df004cfca50ef23c36850aaaa59ad52cc70d0e90243c3c7737a4dd32dc7a3c4f" @@ -3025,6 +2954,7 @@ dependencies = [ "checksum indexmap 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "076f042c5b7b98f31d205f1249267e12a6518c1481e9dae9764af19b707d2292" "checksum iovec 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e" "checksum ipconfig 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "aa79fa216fbe60834a9c0737d7fcd30425b32d1c58854663e24d4c4b328ed83f" +"checksum isahc 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "50bdb3bdcbf6d534daaad1a686eda0d0dc1946818fa71e3edd3124d001adfdc2" "checksum itoa 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ae3088ea4baeceb0284ee9eea42f591226e6beaecf65373e41b38d95a1b8e7a1" "checksum itoa 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "b8b7a7c0c47db5545ed3fef7468ee7bb5b74691498139e4b3f6a20685dc6dd8e" "checksum js-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)" = "1cb931d43e71f560c81badb0191596562bafad2be06a3f9025b845c847c60df5" @@ -3141,7 +3071,7 @@ dependencies = [ "checksum signal-hook-registry 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "94f478ede9f64724c5d173d7bb56099ec3e2d9fc2774aac65d34b8b890405f41" "checksum simple_asn1 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2b25ecba7165254f0c97d6c22a64b1122a03634b18d20a34daf21e18f892e618" "checksum slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" -"checksum sluice 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ec70d7c3b17c262d4a18f7291c6ce62bf47170915f3b795434d3c5c49a4e59b7" +"checksum sluice 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "fed13b7cb46f13a15db2c4740f087a848acc8b31af89f95844d40137451f89b1" "checksum smallvec 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5c2fb2ec9bcd216a5b0d0ccf31ab17b5ed1d627960edff65bbe95d3ce221cefc" "checksum socket2 0.3.11 (registry+https://github.com/rust-lang/crates.io-index)" = "e8b74de517221a2cb01a53349cf54182acdc31a074727d3079068448c0676d85" "checksum spin 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" diff --git a/server/Cargo.toml b/server/Cargo.toml index 97fc12cb..156ccb87 100644 --- a/server/Cargo.toml +++ b/server/Cargo.toml @@ -35,4 +35,4 @@ htmlescape = "0.3.1" config = "0.10.1" hjson = "0.8.2" percent-encoding = "2.1.0" -chttp = "0.5.5" +isahc = "0.9" diff --git a/server/src/lib.rs b/server/src/lib.rs index eeaadb63..01f01ff1 100644 --- a/server/src/lib.rs +++ b/server/src/lib.rs @@ -33,7 +33,7 @@ pub mod websocket; use crate::settings::Settings; use chrono::{DateTime, NaiveDateTime, Utc}; -use chttp::prelude::*; +use isahc::prelude::*; use lettre::smtp::authentication::{Credentials, Mechanism}; use lettre::smtp::extension::ClientId; use lettre::smtp::ConnectionReuseParameters; @@ -157,7 +157,7 @@ pub struct IframelyResponse { pub fn fetch_iframely(url: &str) -> Result { let fetch_url = format!("http://iframely/oembed?url={}", url); - let text = chttp::get(&fetch_url)?.text()?; + let text = isahc::get(&fetch_url)?.text()?; let res: IframelyResponse = serde_json::from_str(&text)?; Ok(res) } @@ -173,7 +173,7 @@ pub fn fetch_pictshare(image_url: &str) -> Result Date: Thu, 19 Mar 2020 00:52:08 -0400 Subject: [PATCH 08/43] Changing comment action button size. Adding comment dividers. Fixes #604 --- ui/assets/css/main.css | 4 +- ui/src/components/comment-node.tsx | 134 ++++++++++++++--------------- ui/src/components/post-listing.tsx | 74 ++++++++-------- 3 files changed, 103 insertions(+), 109 deletions(-) diff --git a/ui/assets/css/main.css b/ui/assets/css/main.css index 618efa40..1c8206e3 100644 --- a/ui/assets/css/main.css +++ b/ui/assets/css/main.css @@ -152,7 +152,7 @@ svg.thumbnail { } hr { - border-top: 1px solid var(--secondary); + border-top: 1px solid var(--light); } .emoji { @@ -186,7 +186,7 @@ hr { max-height: 90vh; } -.vote-animate:active { +.btn-animate:active { transform: scale(1.2); -webkit-transform: scale(1.2); -ms-transform: scale(1.2); diff --git a/ui/src/components/comment-node.tsx b/ui/src/components/comment-node.tsx index 32e43fdc..cbe58725 100644 --- a/ui/src/components/comment-node.tsx +++ b/ui/src/components/comment-node.tsx @@ -121,18 +121,12 @@ export class CommentNode extends Component { return (
- {!node.comment.parent_id && !this.props.noIndent && ( - <> -
-
- - )}
{ 'ml-2'}`} >
    -
  • +
  • { {i18n.t('banned')}
  • )} +
  • +
    + {this.state.collapsed ? ( + + + + ) : ( + + + + )} +
    +
  • {this.props.showCommunity && (
  • {i18n.t('to')} @@ -212,22 +222,6 @@ export class CommentNode extends Component {
  • -
  • -
    - {this.state.collapsed ? ( - - - - ) : ( - - - - )} -
    -
{this.state.showEdit && ( { )} /> )} -
    +
      {this.props.markable && ( -
    • - +
    • )} {UserService.Instance.user && !this.props.viewOnly && ( <> -
    • +
    • {WebSocketService.Instance.site.enable_downvotes && ( -
    • +
    • )} -
    • - +
    • -
    • +
    • @@ -334,23 +328,23 @@ export class CommentNode extends Component {
    • {!this.state.showAdvanced ? ( -
    • - +
    • ) : ( <> {!this.myComment && ( -
    • +
    • @@ -360,9 +354,9 @@ export class CommentNode extends Component {
    • )} -
    • - +
    • -
    • - +
    • {this.myComment && ( <> -
    • -
    • -
    • +
    • +
    • -
    • - +
    • )} {/* Admins and mods can remove comments */} {(this.canMod || this.canAdmin) && ( <> -
    • +
    • {!node.comment.removed ? ( { {this.canMod && ( <> {!this.isMod && ( -
    • +
    • {!node.comment.banned_from_community ? ( {
    • )} {!node.comment.banned_from_community && ( -
    • +
    • {!this.state.showConfirmAppointAsMod ? ( { {/* Community creators and admins can transfer community to another mod */} {(this.amCommunityCreator || this.canAdmin) && this.isMod && ( -
    • +
    • {!this.state.showConfirmTransferCommunity ? ( { {this.canAdmin && ( <> {!this.isAdmin && ( -
    • +
    • {!node.comment.banned ? ( {
    • )} {!node.comment.banned && ( -
    • +
    • {!this.state.showConfirmAppointAsAdmin ? ( { )} {/* Site Creator can transfer to another admin */} {this.amSiteCreator && this.isAdmin && ( -
    • +
    • {!this.state.showConfirmTransferSite ? ( {
      {WebSocketService.Instance.site.enable_downvotes && (
    -
      - {this.props.post.duplicates && ( + {this.props.post.duplicates && ( +
        <>
      • {i18n.t('cross_posted_to')} @@ -515,16 +515,16 @@ export class PostListing extends Component {
      • ))} - )} -
      -
        +
      + )} +
        {UserService.Instance.user && ( <> {this.props.showBody && ( <> -
      • - +
      • -
      • +
      • @@ -553,20 +553,20 @@ export class PostListing extends Component { )} {this.myPost && this.props.showBody && ( <> -
      • - +
      • -
      • - +
      • )} {!this.state.showAdvanced && this.props.showBody ? ( -
      • - +
      • ) : ( <> {this.props.showBody && post.body && ( -
      • - +
      • )} {this.canModOnSelf && ( <> -
      • - +
      • -
      • - +
      • )} From b797c2b3aeb2e2c79a6fc9623fc5c9c48a127349 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Thu, 19 Mar 2020 00:53:34 -0400 Subject: [PATCH 09/43] Version v0.6.40 --- ansible/VERSION | 2 +- docker/prod/docker-compose.yml | 2 +- server/src/version.rs | 2 +- ui/src/version.ts | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ansible/VERSION b/ansible/VERSION index f9fc17d6..827c4570 100644 --- a/ansible/VERSION +++ b/ansible/VERSION @@ -1 +1 @@ -v0.6.39 +v0.6.40 diff --git a/docker/prod/docker-compose.yml b/docker/prod/docker-compose.yml index 9f5e8925..9a053b33 100644 --- a/docker/prod/docker-compose.yml +++ b/docker/prod/docker-compose.yml @@ -12,7 +12,7 @@ services: restart: always lemmy: - image: dessalines/lemmy:v0.6.39 + image: dessalines/lemmy:v0.6.40 ports: - "127.0.0.1:8536:8536" restart: always diff --git a/server/src/version.rs b/server/src/version.rs index b7bdab09..702c363d 100644 --- a/server/src/version.rs +++ b/server/src/version.rs @@ -1 +1 @@ -pub const VERSION: &str = "v0.6.39"; +pub const VERSION: &str = "v0.6.40"; diff --git a/ui/src/version.ts b/ui/src/version.ts index b6ddc840..a3bd08f7 100644 --- a/ui/src/version.ts +++ b/ui/src/version.ts @@ -1 +1 @@ -export const version: string = 'v0.6.39'; +export const version: string = 'v0.6.40'; From 409c14b5e09e0181852cb305b47fbd3a311b7826 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Thu, 19 Mar 2020 11:43:14 -0400 Subject: [PATCH 10/43] Fix ansible deploy. --- ansible/lemmy.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ansible/lemmy.yml b/ansible/lemmy.yml index 8d5e2264..bc01623f 100644 --- a/ansible/lemmy.yml +++ b/ansible/lemmy.yml @@ -36,13 +36,17 @@ - { src: 'templates/docker-compose.yml', dest: '/lemmy/docker-compose.yml', mode: '0600' } - { src: 'templates/nginx.conf', dest: '/etc/nginx/sites-enabled/lemmy.conf', mode: '0644' } - { src: '../docker/iframely.config.local.js', dest: '/lemmy/iframely.config.local.js', mode: '0600' } + vars: + lemmy_docker_image: "dessalines/lemmy:{{ lookup('file', 'VERSION') }}" + lemmy_port: "8536" + pictshare_port: "8537" + iframely_port: "8538" - name: add config file (only during initial setup) template: src='templates/config.hjson' dest='/lemmy/lemmy.hjson' mode='0600' force='no' owner='1000' group='1000' vars: postgres_password: "{{ lookup('password', 'passwords/{{ inventory_hostname }}/postgres chars=ascii_letters,digits') }}" jwt_password: "{{ lookup('password', 'passwords/{{ inventory_hostname }}/jwt chars=ascii_letters,digits') }}" - lemmy_docker_image: "dessalines/lemmy:{{ lookup('file', 'VERSION') }}" - name: enable and start docker service systemd: From 763c2a46102087dd0456b3f3c98f71b8aa424383 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Thu, 19 Mar 2020 11:45:23 -0400 Subject: [PATCH 11/43] Adding loading indicators to save and mark as read. #519 --- ui/src/components/comment-node.tsx | 109 +++++++++++++++++--------- ui/src/components/post-listings.tsx | 3 +- ui/src/components/post.tsx | 2 +- ui/src/components/private-message.tsx | 44 +++++------ 4 files changed, 95 insertions(+), 63 deletions(-) diff --git a/ui/src/components/comment-node.tsx b/ui/src/components/comment-node.tsx index cbe58725..8809c5b7 100644 --- a/ui/src/components/comment-node.tsx +++ b/ui/src/components/comment-node.tsx @@ -56,6 +56,8 @@ interface CommentNodeState { upvotes: number; downvotes: number; borderColor: string; + readLoading: boolean; + saveLoading: boolean; } interface CommentNodeProps { @@ -97,6 +99,8 @@ export class CommentNode extends Component { borderColor: this.props.node.comment.depth ? colorList[this.props.node.comment.depth % colorList.length] : colorList[0], + readLoading: false, + saveLoading: false, }; constructor(props: any, context: any) { @@ -113,6 +117,8 @@ export class CommentNode extends Component { this.state.upvotes = nextProps.node.comment.upvotes; this.state.downvotes = nextProps.node.comment.downvotes; this.state.score = nextProps.node.comment.score; + this.state.readLoading = false; + this.state.saveLoading = false; this.setState(this.state); } @@ -255,12 +261,16 @@ export class CommentNode extends Component { : i18n.t('mark_as_read') } > - - - + {this.state.readLoading ? ( + this.loadingIcon + ) : ( + + + + )} )} @@ -305,6 +315,28 @@ export class CommentNode extends Component { )} +
      • + +
      • -
      • - - - - - -
      • + {this.props.markable && this.linkBtn} {!this.state.showAdvanced ? (
      • )} -
      • - -
      • + {!this.props.markable && this.linkBtn}
      • -
      • - +
      • )} {this.mine && ( <> -
      • - +
      • -
      • - +
      • )} -
      • - +
From 86aef7c686099e576fba44d49ae26c1212a6af3e Mon Sep 17 00:00:00 2001 From: Dessalines Date: Thu, 19 Mar 2020 12:11:41 -0400 Subject: [PATCH 12/43] Adding polish translation file. --- ui/translations/pl.json | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 ui/translations/pl.json diff --git a/ui/translations/pl.json b/ui/translations/pl.json new file mode 100644 index 00000000..bfd870e4 --- /dev/null +++ b/ui/translations/pl.json @@ -0,0 +1,3 @@ +{ +} + From b13febd34a79f9d9debcb7816aa6a34b42f0a1f3 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Thu, 19 Mar 2020 12:17:26 -0400 Subject: [PATCH 13/43] Version v0.6.41 --- ansible/VERSION | 2 +- docker/prod/docker-compose.yml | 2 +- server/src/version.rs | 2 +- ui/src/version.ts | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ansible/VERSION b/ansible/VERSION index 827c4570..de2652f2 100644 --- a/ansible/VERSION +++ b/ansible/VERSION @@ -1 +1 @@ -v0.6.40 +v0.6.41 diff --git a/docker/prod/docker-compose.yml b/docker/prod/docker-compose.yml index 9a053b33..3343c0d8 100644 --- a/docker/prod/docker-compose.yml +++ b/docker/prod/docker-compose.yml @@ -12,7 +12,7 @@ services: restart: always lemmy: - image: dessalines/lemmy:v0.6.40 + image: dessalines/lemmy:v0.6.41 ports: - "127.0.0.1:8536:8536" restart: always diff --git a/server/src/version.rs b/server/src/version.rs index 702c363d..b5062ef5 100644 --- a/server/src/version.rs +++ b/server/src/version.rs @@ -1 +1 @@ -pub const VERSION: &str = "v0.6.40"; +pub const VERSION: &str = "v0.6.41"; diff --git a/ui/src/version.ts b/ui/src/version.ts index a3bd08f7..531b5a8e 100644 --- a/ui/src/version.ts +++ b/ui/src/version.ts @@ -1 +1 @@ -export const version: string = 'v0.6.40'; +export const version: string = 'v0.6.41'; From 4e8d6a551fe4ba9de0254e27b5f5f94cca63da74 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Thu, 19 Mar 2020 20:56:21 -0400 Subject: [PATCH 14/43] Adding score spacing, hiding user tags on thin screen. --- ui/src/components/comment-node.tsx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/ui/src/components/comment-node.tsx b/ui/src/components/comment-node.tsx index 8809c5b7..d5d872f5 100644 --- a/ui/src/components/comment-node.tsx +++ b/ui/src/components/comment-node.tsx @@ -166,17 +166,17 @@ export class CommentNode extends Component { {this.isMod && ( -
  • +
  • {i18n.t('mod')}
  • )} {this.isAdmin && ( -
  • +
  • {i18n.t('admin')}
  • )} {this.isPostCreator && ( -
  • +
  • {i18n.t('creator')}
  • )} @@ -209,8 +209,7 @@ export class CommentNode extends Component { )} -
  • -
  • +
  • Date: Fri, 20 Mar 2020 16:13:54 -0400 Subject: [PATCH 15/43] Notification improvements. - Adding a navbar notification icon for mobile. - Adding an in-app notification toast. To be improved later. - Fixes #607 --- docs/src/about_goals.md | 2 ++ ui/.eslintrc.json | 1 + ui/src/components/navbar.tsx | 48 +++++++++++++++++++++++++++++------- ui/src/utils.ts | 24 +++++++++++++++++- 4 files changed, 65 insertions(+), 10 deletions(-) diff --git a/docs/src/about_goals.md b/docs/src/about_goals.md index 1463eeb0..0d666f4f 100644 --- a/docs/src/about_goals.md +++ b/docs/src/about_goals.md @@ -47,3 +47,5 @@ - https://docs.rs/activitypub/0.1.4/activitypub/ - [Activitypub vocab.](https://www.w3.org/TR/activitystreams-vocabulary/) - [Activitypub main](https://www.w3.org/TR/activitypub/) +- [Federation.md](https://github.com/dariusk/gathio/blob/7fc93dbe9d4d99457a0e85c6c532112f415b7af2/FEDERATION.md) +- [Activitypub implementers guide](https://socialhub.activitypub.rocks/t/draft-guide-for-new-activitypub-implementers/479) diff --git a/ui/.eslintrc.json b/ui/.eslintrc.json index bee9e538..a4aecfa0 100644 --- a/ui/.eslintrc.json +++ b/ui/.eslintrc.json @@ -38,6 +38,7 @@ "inferno/no-direct-mutation-state": 0, "inferno/no-unknown-property": 0, "max-statements": 0, + "max-params": 0, "new-cap": 0, "no-console": 0, "no-duplicate-imports": 0, diff --git a/ui/src/components/navbar.tsx b/ui/src/components/navbar.tsx index ef3f8430..76930e3b 100644 --- a/ui/src/components/navbar.tsx +++ b/ui/src/components/navbar.tsx @@ -26,6 +26,8 @@ import { fetchLimit, isCommentType, toast, + messageToastify, + md, } from '../utils'; import { version } from '../version'; import { i18n } from '../i18next'; @@ -100,6 +102,22 @@ export class Navbar extends Component { {this.state.siteName} + {this.state.isLoggedIn && ( + + + + + {this.state.unreadCount > 0 && ( + + {this.state.unreadCount} + + )} + + )}
  • - {this.props.markable && this.linkBtn} {!this.state.showAdvanced ? (
  • @@ -555,7 +555,7 @@ export class PostListing extends Component { <>
  • @@ -327,6 +328,7 @@ export class User extends Component { nodes={commentsToFlatNodes(this.state.comments)} admins={this.state.admins} noIndent + showContext />
    ); diff --git a/ui/translations/en.json b/ui/translations/en.json index e9df20ba..0281aaf4 100644 --- a/ui/translations/en.json +++ b/ui/translations/en.json @@ -39,6 +39,7 @@ "avatar": "Avatar", "upload_avatar": "Upload Avatar", "show_avatars": "Show Avatars", + "show_context": "Show context", "formatting_help": "formatting help", "sorting_help": "sorting help", "view_source": "view source", From 5b7e75c5cd9110fb9a4d65f1cee1b90fc73e91c6 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Fri, 20 Mar 2020 17:20:59 -0400 Subject: [PATCH 17/43] Fixing navbar bell padding. --- ui/src/components/navbar.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/src/components/navbar.tsx b/ui/src/components/navbar.tsx index 76930e3b..ea9b619b 100644 --- a/ui/src/components/navbar.tsx +++ b/ui/src/components/navbar.tsx @@ -104,7 +104,7 @@ export class Navbar extends Component { {this.state.isLoggedIn && ( From 6ac4ce46ac01b2b5424e9eef00931a23279f3619 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Fri, 20 Mar 2020 18:35:33 -0400 Subject: [PATCH 18/43] Switch to radios for user and inbox pages for clarity. Fixes #608 --- ui/src/components/comment-node.tsx | 22 ++--- ui/src/components/inbox.tsx | 132 ++++++++++++++++++++++------- ui/src/components/post-listing.tsx | 16 ++-- ui/src/components/user.tsx | 83 ++++++++++++++---- 4 files changed, 187 insertions(+), 66 deletions(-) diff --git a/ui/src/components/comment-node.tsx b/ui/src/components/comment-node.tsx index c1dceed2..b2d04150 100644 --- a/ui/src/components/comment-node.tsx +++ b/ui/src/components/comment-node.tsx @@ -254,7 +254,7 @@ export class CommentNode extends Component { {this.props.markable && (
  • @@ -555,7 +555,7 @@ export class PostListing extends Component { <>
  • -
  • + )} {UserService.Instance.user && !this.props.viewOnly && ( <> -
  • + + {WebSocketService.Instance.site.enable_downvotes && ( -
  • - {WebSocketService.Instance.site.enable_downvotes && ( -
  • - -
  • )} -
  • + + + {!this.state.showAdvanced ? ( -
  • -
  • - -
  • - {!this.state.showAdvanced ? ( -
  • - -
  • ) : ( <> {!this.myComment && ( -
  • +
  • + )} {!this.props.showContext && this.linkBtn} -
  • - -
  • + + + {this.myComment && ( <> -
  • -
  • - + -
  • -
  • - -
  • + + + )} {/* Admins and mods can remove comments */} {(this.canMod || this.canAdmin) && ( <> -
  • - {!node.comment.removed ? ( - - {i18n.t('remove')} - - ) : ( - - {i18n.t('restore')} - - )} -
  • + {!node.comment.removed ? ( + + ) : ( + + )} )} {/* Mods can ban from community, and appoint as mods to community */} {this.canMod && ( <> - {!this.isMod && ( -
  • - {!node.comment.banned_from_community ? ( - + {i18n.t('ban')} + + ) : ( + + ))} + {!node.comment.banned_from_community && + (!this.state.showConfirmAppointAsMod ? ( + + ) : ( + <> + +
  • - )} - {!node.comment.banned_from_community && ( -
  • - {!this.state.showConfirmAppointAsMod ? ( - - {this.isMod - ? i18n.t('remove_as_mod') - : i18n.t('appoint_as_mod')} - - ) : ( - <> - - {i18n.t('are_you_sure')} - - - {i18n.t('yes')} - - - {i18n.t('no')} - - - )} -
  • - )} + {i18n.t('no')} + + + ))} )} {/* Community creators and admins can transfer community to another mod */} {(this.amCommunityCreator || this.canAdmin) && - this.isMod && ( -
  • - {!this.state.showConfirmTransferCommunity ? ( - - {i18n.t('transfer_community')} - - ) : ( - <> - - {i18n.t('are_you_sure')} - - - {i18n.t('yes')} - - - {i18n.t('no')} - - + this.isMod && + (!this.state.showConfirmTransferCommunity ? ( + + ) : ( + <> + + + + + ))} {/* Admins can ban from all, and appoint other admins */} {this.canAdmin && ( <> - {!this.isAdmin && ( -
  • - {!node.comment.banned ? ( - + {i18n.t('ban_from_site')} + + ) : ( + + ))} + {!node.comment.banned && + (!this.state.showConfirmAppointAsAdmin ? ( + + ) : ( + <> + +
  • - )} - {!node.comment.banned && ( -
  • - {!this.state.showConfirmAppointAsAdmin ? ( - - {this.isAdmin - ? i18n.t('remove_as_admin') - : i18n.t('appoint_as_admin')} - - ) : ( - <> - - {i18n.t('are_you_sure')} - - - {i18n.t('yes')} - - - {i18n.t('no')} - - - )} -
  • - )} + {i18n.t('no')} + + + ))} )} {/* Site Creator can transfer to another admin */} - {this.amSiteCreator && this.isAdmin && ( -
  • - {!this.state.showConfirmTransferSite ? ( - + {i18n.t('transfer_site')} + + ) : ( + <> + +
  • - )} + {i18n.t('yes')} + + + + ))} )} )} - + + {/* end of button group */} )} @@ -761,9 +707,9 @@ export class CommentNode extends Component { get linkBtn() { let node = this.props.node; return ( -
  • +
  • + ); } From 46cf85a451181a5e847d962cc58acc4c6ec0f0c6 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Sat, 21 Mar 2020 10:20:03 -0400 Subject: [PATCH 24/43] Adding flex-wrap. --- ui/src/components/comment-node.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/src/components/comment-node.tsx b/ui/src/components/comment-node.tsx index 7813168b..39f29b5f 100644 --- a/ui/src/components/comment-node.tsx +++ b/ui/src/components/comment-node.tsx @@ -147,7 +147,7 @@ export class CommentNode extends Component { this.props.node.comment.parent_id && 'ml-2'}`} > -
    +
    Date: Sat, 21 Mar 2020 10:38:42 -0400 Subject: [PATCH 25/43] Version v0.6.43 --- ansible/VERSION | 2 +- docker/prod/docker-compose.yml | 2 +- server/src/version.rs | 2 +- ui/src/version.ts | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ansible/VERSION b/ansible/VERSION index d74bb982..d320ef7f 100644 --- a/ansible/VERSION +++ b/ansible/VERSION @@ -1 +1 @@ -v0.6.42 +v0.6.43 diff --git a/docker/prod/docker-compose.yml b/docker/prod/docker-compose.yml index 477cda69..06ece48e 100644 --- a/docker/prod/docker-compose.yml +++ b/docker/prod/docker-compose.yml @@ -12,7 +12,7 @@ services: restart: always lemmy: - image: dessalines/lemmy:v0.6.42 + image: dessalines/lemmy:v0.6.43 ports: - "127.0.0.1:8536:8536" restart: always diff --git a/server/src/version.rs b/server/src/version.rs index 25653ba4..16428303 100644 --- a/server/src/version.rs +++ b/server/src/version.rs @@ -1 +1 @@ -pub const VERSION: &str = "v0.6.42"; +pub const VERSION: &str = "v0.6.43"; diff --git a/ui/src/version.ts b/ui/src/version.ts index 53d49520..00ecf57d 100644 --- a/ui/src/version.ts +++ b/ui/src/version.ts @@ -1 +1 @@ -export const version: string = 'v0.6.42'; +export const version: string = 'v0.6.43'; From cca5ea4d36fd1cb2a87d374d6cd37539034dfb3e Mon Sep 17 00:00:00 2001 From: Dessalines Date: Sat, 21 Mar 2020 11:21:15 -0400 Subject: [PATCH 26/43] Hide toast on click. --- ui/src/utils.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ui/src/utils.ts b/ui/src/utils.ts index cab1fd5b..48bd175e 100644 --- a/ui/src/utils.ts +++ b/ui/src/utils.ts @@ -444,7 +444,8 @@ export function messageToastify( router: any ) { let backgroundColor = `var(--light)`; - Toastify({ + + let toast = Toastify({ text: `${body}
    ${creator}`, avatar: avatar, backgroundColor: backgroundColor, @@ -453,7 +454,10 @@ export function messageToastify( position: 'right', duration: 0, onClick: () => { - router.history.push(link); + if (toast) { + toast.hideToast(); + router.history.push(link); + } }, }).showToast(); } From 941c3bb09816f70032034d129b4da713a237e29d Mon Sep 17 00:00:00 2001 From: Dessalines Date: Tue, 24 Mar 2020 09:58:01 -0400 Subject: [PATCH 27/43] Add some docs. --- docs/src/about_goals.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/src/about_goals.md b/docs/src/about_goals.md index 0d666f4f..b78c7818 100644 --- a/docs/src/about_goals.md +++ b/docs/src/about_goals.md @@ -49,3 +49,4 @@ - [Activitypub main](https://www.w3.org/TR/activitypub/) - [Federation.md](https://github.com/dariusk/gathio/blob/7fc93dbe9d4d99457a0e85c6c532112f415b7af2/FEDERATION.md) - [Activitypub implementers guide](https://socialhub.activitypub.rocks/t/draft-guide-for-new-activitypub-implementers/479) +- [Data storage questions](https://socialhub.activitypub.rocks/t/data-storage-questions/579/3) From 260f93fd9140b1f9a5f9d30e78e2622228c8c432 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Tue, 24 Mar 2020 10:46:39 -0400 Subject: [PATCH 28/43] Making vote buttons bigger. --- ui/src/components/post-listing.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/src/components/post-listing.tsx b/ui/src/components/post-listing.tsx index c5afe9ce..edb858dd 100644 --- a/ui/src/components/post-listing.tsx +++ b/ui/src/components/post-listing.tsx @@ -250,7 +250,7 @@ export class PostListing extends Component {
    {WebSocketService.Instance.site.enable_downvotes && (
    {
    {WebSocketService.Instance.site.enable_downvotes && ( )} diff --git a/ui/src/components/symbols.tsx b/ui/src/components/symbols.tsx index 1220413c..16deec3e 100644 --- a/ui/src/components/symbols.tsx +++ b/ui/src/components/symbols.tsx @@ -97,6 +97,12 @@ export class Symbols extends Component { + + + + + + From c06016f27a307524473fd73ea3e6eee1820c73d0 Mon Sep 17 00:00:00 2001 From: Felix Date: Thu, 26 Mar 2020 15:45:56 +0100 Subject: [PATCH 31/43] Add documentation for contributing to federation development --- docs/src/SUMMARY.md | 1 + .../contributing_federation_development.md | 37 +++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 docs/src/contributing_federation_development.md diff --git a/docs/src/SUMMARY.md b/docs/src/SUMMARY.md index 10a6153e..70c423c7 100644 --- a/docs/src/SUMMARY.md +++ b/docs/src/SUMMARY.md @@ -13,6 +13,7 @@ - [Contributing](contributing.md) - [Docker Development](contributing_docker_development.md) - [Local Development](contributing_local_development.md) + - [Federation Development](contributing_federation_development.md) - [Websocket/HTTP API](contributing_websocket_http_api.md) - [ActivityPub API Outline](contributing_apub_api_outline.md) - [Theming Guide](contributing_theming.md) diff --git a/docs/src/contributing_federation_development.md b/docs/src/contributing_federation_development.md new file mode 100644 index 00000000..13a047d0 --- /dev/null +++ b/docs/src/contributing_federation_development.md @@ -0,0 +1,37 @@ +# Federation Development + +## Setup + +If you don't have a local clone of the Lemmy repo yet, just run the following command: + +```bash +git clone https://yerbamate.dev/nutomic/lemmy.git -b federation +``` + +If you already have the Lemmy repo cloned, you need to add a new remote: +```bash +git remote add federation https://yerbamate.dev/nutomic/lemmy.git +git checkout federation +git pull federation federation +``` + +## Running + +You need to have the following packages installed, the Docker service needs to be running. + +- docker +- docker-compose +- cargo +- yarn + +Then run the following +```bash +cd dev/federation-test +./run-federation-test.bash +``` + +After the build is finished and the docker-compose setup is running, open [127.0.0.1:8540](http://127.0.0.1:8540) and +[127.0.0.1:8541](http://127.0.0.1:8541) in your browser to use the test instances. You can login as admin with +username `lemmy` and password `lemmy`, or create new accounts. + +Please get in touch if you want to contribute to this, so we can coordinate things and avoid duplicate work. \ No newline at end of file From 0090ae63e524349d1db93a2c441ad905830799d0 Mon Sep 17 00:00:00 2001 From: Felix Date: Sat, 28 Mar 2020 16:56:20 +0100 Subject: [PATCH 32/43] Convert md to html for feeds, try to deduplicate code --- server/Cargo.lock | 11 +++ server/Cargo.toml | 1 + server/src/routes/feeds.rs | 198 +++++++++++++++++-------------------- 3 files changed, 100 insertions(+), 110 deletions(-) diff --git a/server/Cargo.lock b/server/Cargo.lock index f6ce6550..265abfc7 100644 --- a/server/Cargo.lock +++ b/server/Cargo.lock @@ -1,5 +1,14 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. +[[package]] +name = "Markdown-to-HTML-rs" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.3.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "activitypub" version = "0.2.0" @@ -1369,6 +1378,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" name = "lemmy_server" version = "0.0.1" dependencies = [ + "Markdown-to-HTML-rs 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "activitypub 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "actix 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "actix-files 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2823,6 +2833,7 @@ dependencies = [ ] [metadata] +"checksum Markdown-to-HTML-rs 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b1a9bda9d68f643d9b63888996896ce5be873d0f22fe1c859bce84dd4bd4661b" "checksum activitypub 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d538a21b137ec0f63cc579ef4afa4ab13aa85b4f8af15a033683edd97c50718d" "checksum activitystreams-derive 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "65608fdeae5eb05485d5b71a3d2242d76b2b7413608c196d47eb4dff3eed7b85" "checksum activitystreams-traits 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a0c2a3958d240f40eff1f31b5f679a6e0d4ce2a16812886a3ec0164f3a2ca517" diff --git a/server/Cargo.toml b/server/Cargo.toml index 156ccb87..3803485b 100644 --- a/server/Cargo.toml +++ b/server/Cargo.toml @@ -36,3 +36,4 @@ config = "0.10.1" hjson = "0.8.2" percent-encoding = "2.1.0" isahc = "0.9" +Markdown-to-HTML-rs = "0.1.0" diff --git a/server/src/routes/feeds.rs b/server/src/routes/feeds.rs index ad0f28d5..c94a60d4 100644 --- a/server/src/routes/feeds.rs +++ b/server/src/routes/feeds.rs @@ -10,7 +10,7 @@ use crate::db::user_mention_view::{UserMentionQueryBuilder, UserMentionView}; use crate::db::{ListingType, SortType}; use crate::Settings; use actix_web::{web, HttpResponse, Result}; -use chrono::{DateTime, Utc}; +use chrono::{DateTime, NaiveDateTime, Utc}; use diesel::r2d2::{ConnectionManager, Pool}; use diesel::PgConnection; use failure::Error; @@ -18,6 +18,7 @@ use rss::{CategoryBuilder, ChannelBuilder, GuidBuilder, Item, ItemBuilder}; use serde::Deserialize; use std::str::FromStr; use strum::ParseError; +extern crate Markdown_to_HTML_rs; #[derive(Deserialize)] pub struct Params { @@ -34,7 +35,6 @@ enum RequestType { pub fn config(cfg: &mut web::ServiceConfig) { cfg .route("/feeds/{type}/{name}.xml", web::get().to(feeds::get_feed)) - .route("/feeds/all.xml", web::get().to(feeds::get_all_feed)) .route("/feeds/all.xml", web::get().to(feeds::get_all_feed)); } @@ -44,9 +44,7 @@ async fn get_all_feed( ) -> Result { let res = web::block(move || { let conn = db.get()?; - - let sort_type = get_sort_type(info)?; - get_feed_all_data(&conn, &sort_type) + get_feed_all_data(&conn, &get_sort_type(info)?) }) .await .map(|rss| { @@ -58,6 +56,29 @@ async fn get_all_feed( Ok(res) } +fn get_feed_all_data(conn: &PgConnection, sort_type: &SortType) -> Result { + let site_view = SiteView::read(&conn)?; + + let posts = PostQueryBuilder::create(&conn) + .listing_type(ListingType::All) + .sort(sort_type) + .list()?; + + let items = create_post_items(posts); + + let mut channel_builder = ChannelBuilder::default(); + channel_builder + .title(&format!("{} - All", site_view.name)) + .link(format!("https://{}", Settings::get().hostname)) + .items(items); + + if let Some(site_desc) = site_view.description { + channel_builder.description(&site_desc); + } + + Ok(channel_builder.build().unwrap().to_string()) +} + async fn get_feed( path: web::Path<(String, String)>, info: web::Query, @@ -86,6 +107,7 @@ async fn get_feed( } }) .await + .map(|builder| builder.build().unwrap().to_string()) .map(|rss| { HttpResponse::Ok() .content_type("application/rss+xml") @@ -103,34 +125,11 @@ fn get_sort_type(info: web::Query) -> Result { SortType::from_str(&sort_query) } -fn get_feed_all_data(conn: &PgConnection, sort_type: &SortType) -> Result { - let site_view = SiteView::read(&conn)?; - - let posts = PostQueryBuilder::create(&conn) - .listing_type(ListingType::All) - .sort(sort_type) - .list()?; - - let items = create_post_items(posts); - - let mut channel_builder = ChannelBuilder::default(); - channel_builder - .title(&format!("{} - All", site_view.name)) - .link(format!("https://{}", Settings::get().hostname)) - .items(items); - - if let Some(site_desc) = site_view.description { - channel_builder.description(&site_desc); - } - - Ok(channel_builder.build().unwrap().to_string()) -} - fn get_feed_user( conn: &PgConnection, sort_type: &SortType, user_name: String, -) -> Result { +) -> Result { let site_view = SiteView::read(&conn)?; let user = User_::find_by_username(&conn, &user_name)?; let user_url = user.get_profile_url(); @@ -149,14 +148,14 @@ fn get_feed_user( .link(user_url) .items(items); - Ok(channel_builder.build().unwrap().to_string()) + Ok(channel_builder) } fn get_feed_community( conn: &PgConnection, sort_type: &SortType, community_name: String, -) -> Result { +) -> Result { let site_view = SiteView::read(&conn)?; let community = Community::read_from_name(&conn, community_name)?; let community_url = community.get_url(); @@ -179,10 +178,14 @@ fn get_feed_community( channel_builder.description(&community_desc); } - Ok(channel_builder.build().unwrap().to_string()) + Ok(channel_builder) } -fn get_feed_front(conn: &PgConnection, sort_type: &SortType, jwt: String) -> Result { +fn get_feed_front( + conn: &PgConnection, + sort_type: &SortType, + jwt: String, +) -> Result { let site_view = SiteView::read(&conn)?; let user_id = Claims::decode(&jwt)?.claims.id; @@ -204,10 +207,10 @@ fn get_feed_front(conn: &PgConnection, sort_type: &SortType, jwt: String) -> Res channel_builder.description(&site_desc); } - Ok(channel_builder.build().unwrap().to_string()) + Ok(channel_builder) } -fn get_feed_inbox(conn: &PgConnection, jwt: String) -> Result { +fn get_feed_inbox(conn: &PgConnection, jwt: String) -> Result { let site_view = SiteView::read(&conn)?; let user_id = Claims::decode(&jwt)?.claims.id; @@ -233,86 +236,61 @@ fn get_feed_inbox(conn: &PgConnection, jwt: String) -> Result { channel_builder.description(&site_desc); } - Ok(channel_builder.build().unwrap().to_string()) + Ok(channel_builder) } fn create_reply_and_mention_items( replies: Vec, mentions: Vec, ) -> Vec { - let mut items: Vec = Vec::new(); + let mut reply_items: Vec = replies + .iter() + .map(|r| { + let reply_url = format!( + "https://{}/post/{}/comment/{}", + Settings::get().hostname, + r.post_id, + r.id + ); + build_item(&r.creator_name, &r.published, &reply_url, &r.content) + }) + .collect(); - for r in replies { - let mut i = ItemBuilder::default(); + let mut mention_items: Vec = mentions + .iter() + .map(|m| { + let mention_url = format!( + "https://{}/post/{}/comment/{}", + Settings::get().hostname, + m.post_id, + m.id + ); + build_item(&m.creator_name, &m.published, &mention_url, &m.content) + }) + .collect(); - i.title(format!("Reply from {}", r.creator_name)); + reply_items.append(&mut mention_items); + reply_items +} - let author_url = format!("https://{}/u/{}", Settings::get().hostname, r.creator_name); - i.author(format!( - "/u/{}
    (link)", - r.creator_name, author_url - )); - - let dt = DateTime::::from_utc(r.published, Utc); - i.pub_date(dt.to_rfc2822()); - - let reply_url = format!( - "https://{}/post/{}/comment/{}", - Settings::get().hostname, - r.post_id, - r.id - ); - i.comments(reply_url.to_owned()); - let guid = GuidBuilder::default() - .permalink(true) - .value(&reply_url) - .build(); - i.guid(guid.unwrap()); - - i.link(reply_url); - - // TODO find a markdown to html parser here, do images, etc - i.description(r.content); - - items.push(i.build().unwrap()); - } - - for m in mentions { - let mut i = ItemBuilder::default(); - - i.title(format!("Mention from {}", m.creator_name)); - - let author_url = format!("https://{}/u/{}", Settings::get().hostname, m.creator_name); - i.author(format!( - "/u/{} (link)", - m.creator_name, author_url - )); - - let dt = DateTime::::from_utc(m.published, Utc); - i.pub_date(dt.to_rfc2822()); - - let mention_url = format!( - "https://{}/post/{}/comment/{}", - Settings::get().hostname, - m.post_id, - m.id - ); - i.comments(mention_url.to_owned()); - let guid = GuidBuilder::default() - .permalink(true) - .value(&mention_url) - .build(); - i.guid(guid.unwrap()); - - i.link(mention_url); - - // TODO find a markdown to html parser here, do images, etc - i.description(m.content); - - items.push(i.build().unwrap()); - } - - items +fn build_item(creator_name: &str, published: &NaiveDateTime, url: &str, content: &str) -> Item { + let mut i = ItemBuilder::default(); + i.title(format!("Reply from {}", creator_name)); + let author_url = format!("https://{}/u/{}", Settings::get().hostname, creator_name); + i.author(format!( + "/u/{} (link)", + creator_name, author_url + )); + let dt = DateTime::::from_utc(*published, Utc); + i.pub_date(dt.to_rfc2822()); + i.comments(url.to_owned()); + let guid = GuidBuilder::default().permalink(true).value(url).build(); + i.guid(guid.unwrap()); + i.link(url.to_owned()); + // TODO add images + let html = Markdown_to_HTML_rs::replace_all(&content.to_string()); + i.description(html); + i.build().unwrap() } fn create_post_items(posts: Vec) -> Vec { @@ -359,9 +337,8 @@ fn create_post_items(posts: Vec) -> Vec { i.link(url); } - // TODO find a markdown to html parser here, do images, etc - let mut description = format!(" - submitted by {} to {}
    {} points | {} comments", + // TODO add images + let mut description = format!("submitted by {} to {}
    {} points | {} comments", author_url, p.creator_name, community_url, @@ -371,7 +348,8 @@ fn create_post_items(posts: Vec) -> Vec { p.number_of_comments); if let Some(body) = p.body { - description.push_str(&format!("

    {}", body)); + let html = Markdown_to_HTML_rs::replace_all(&body); + description.push_str(&format!("

    {}", html)); } i.description(description); From 5abdc617e6a2dd4e56b0d8fc15e2b595bb4c5b0a Mon Sep 17 00:00:00 2001 From: Dessalines Date: Sat, 28 Mar 2020 15:43:56 -0400 Subject: [PATCH 33/43] Adding a resource to docs. --- docs/src/about_goals.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/src/about_goals.md b/docs/src/about_goals.md index b78c7818..caa6948a 100644 --- a/docs/src/about_goals.md +++ b/docs/src/about_goals.md @@ -50,3 +50,4 @@ - [Federation.md](https://github.com/dariusk/gathio/blob/7fc93dbe9d4d99457a0e85c6c532112f415b7af2/FEDERATION.md) - [Activitypub implementers guide](https://socialhub.activitypub.rocks/t/draft-guide-for-new-activitypub-implementers/479) - [Data storage questions](https://socialhub.activitypub.rocks/t/data-storage-questions/579/3) +- [Activitypub as it has been understood](https://flak.tedunangst.com/post/ActivityPub-as-it-has-been-understood) From b0affad98197e0a3967703aa82cf95d9a2f1188b Mon Sep 17 00:00:00 2001 From: Dessalines Date: Sat, 28 Mar 2020 18:02:49 -0400 Subject: [PATCH 34/43] Changing markdown parser to comrak. Moving crate imports to lib.rs. --- server/Cargo.lock | 181 +++++++++++++++++++++++++++++++--- server/Cargo.toml | 2 +- server/src/db/mod.rs | 1 - server/src/lib.rs | 6 ++ server/src/routes/feeds.rs | 11 +-- server/src/routes/nodeinfo.rs | 1 - server/src/settings.rs | 1 - 7 files changed, 181 insertions(+), 22 deletions(-) diff --git a/server/Cargo.lock b/server/Cargo.lock index 265abfc7..2a3bc033 100644 --- a/server/Cargo.lock +++ b/server/Cargo.lock @@ -1,14 +1,5 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -[[package]] -name = "Markdown-to-HTML-rs" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 1.3.5 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "activitypub" version = "0.2.0" @@ -387,6 +378,14 @@ dependencies = [ "memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "ansi_term" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "arc-swap" version = "0.4.4" @@ -638,6 +637,20 @@ dependencies = [ "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "clap" +version = "2.33.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "atty 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "strsim 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-width 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "cloudabi" version = "0.0.3" @@ -646,6 +659,22 @@ dependencies = [ "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "comrak" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)", + "entities 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "pest 2.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "pest_derive 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "twoway 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "typed-arena 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode_categories 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "config" version = "0.10.1" @@ -951,6 +980,11 @@ dependencies = [ "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "entities" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "enum-as-inner" version = "0.3.2" @@ -1378,7 +1412,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" name = "lemmy_server" version = "0.0.1" dependencies = [ - "Markdown-to-HTML-rs 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "activitypub 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "actix 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "actix-files 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1387,6 +1420,7 @@ dependencies = [ "actix-web-actors 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "bcrypt 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", "chrono 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)", + "comrak 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "config 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", "diesel 1.4.3 (registry+https://github.com/rust-lang/crates.io-index)", "diesel_migrations 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1517,6 +1551,11 @@ dependencies = [ "linked-hash-map 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "maplit" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "match_cfg" version = "0.1.0" @@ -1792,6 +1831,45 @@ name = "percent-encoding" version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "pest" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "ucd-trie 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "pest_derive" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "pest 2.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "pest_generator 2.1.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "pest_generator" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "pest 2.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "pest_meta 2.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.16 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "pest_meta" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "maplit 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "pest 2.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "sha-1 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "pin-project" version = "0.4.8" @@ -2300,6 +2378,17 @@ dependencies = [ "url 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "sha-1" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "block-buffer 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", + "digest 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", + "fake-simd 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "opaque-debug 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "sha1" version = "0.6.0" @@ -2382,6 +2471,11 @@ name = "strsim" version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "strsim" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "strsim" version = "0.9.3" @@ -2445,6 +2539,14 @@ dependencies = [ "winapi-util 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "textwrap" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "unicode-width 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "thiserror" version = "1.0.11" @@ -2584,11 +2686,35 @@ dependencies = [ "trust-dns-proto 0.18.0-alpha.2 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "twoway" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "unchecked-index 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "typed-arena" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "typenum" version = "1.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "ucd-trie" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "unchecked-index" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "unicase" version = "2.6.0" @@ -2618,11 +2744,21 @@ name = "unicode-segmentation" version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "unicode-width" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "unicode-xid" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "unicode_categories" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "untrusted" version = "0.7.0" @@ -2684,6 +2820,11 @@ name = "vcpkg" version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "vec_map" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "version_check" version = "0.1.5" @@ -2833,7 +2974,6 @@ dependencies = [ ] [metadata] -"checksum Markdown-to-HTML-rs 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b1a9bda9d68f643d9b63888996896ce5be873d0f22fe1c859bce84dd4bd4661b" "checksum activitypub 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d538a21b137ec0f63cc579ef4afa4ab13aa85b4f8af15a033683edd97c50718d" "checksum activitystreams-derive 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "65608fdeae5eb05485d5b71a3d2242d76b2b7413608c196d47eb4dff3eed7b85" "checksum activitystreams-traits 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a0c2a3958d240f40eff1f31b5f679a6e0d4ce2a16812886a3ec0164f3a2ca517" @@ -2859,6 +2999,7 @@ dependencies = [ "checksum adler32 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "5d2e7343e7fc9de883d1b0341e0b13970f764c14101234857d2ddafa1cb1cac2" "checksum aho-corasick 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ca972c2ea5f742bfce5687b9aef75506a764f61d37f8f649047846a9686ddb66" "checksum aho-corasick 0.7.9 (registry+https://github.com/rust-lang/crates.io-index)" = "d5e63fd144e18ba274ae7095c0197a870a7b9468abc801dd62f190d80817d2ec" +"checksum ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" "checksum arc-swap 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "d7b8a9123b8027467bce0099fe556c628a53c8d83df0507084c31e9ba2e39aff" "checksum arrayvec 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)" = "cd9fd44efafa8690358b7408d253adf110036b88f55672a933f01d616ad9b1b9" "checksum ascii_utils 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)" = "71938f30533e4d95a6d17aa530939da3842c2ab6f4f84b9dae68447e4129f74a" @@ -2891,7 +3032,9 @@ dependencies = [ "checksum cc 1.0.50 (registry+https://github.com/rust-lang/crates.io-index)" = "95e28fa049fda1c330bcf9d723be7663a899c4679724b34c81e9f5a326aab8cd" "checksum cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" "checksum chrono 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)" = "80094f509cf8b5ae86a4966a39b3ff66cd7e2a3e594accec3743ff3fabeab5b2" +"checksum clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5067f5bb2d80ef5d68b4c87db81601f0b75bca627bc2ef76b141d7b846a3c6d9" "checksum cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" +"checksum comrak 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e17058cc536cf290563e88787d7b9e6030ce4742943017cc2ffb71f88034021c" "checksum config 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "19b076e143e1d9538dde65da30f8481c2a6c44040edb8e02b9bf1351edb92ce3" "checksum copyless 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "6ff9c56c9fb2a49c05ef0e431485a22400af20d33226dc0764d891d09e724127" "checksum core-foundation 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "57d24c7a13c43e870e37c1556b74555437870a04514f7685f5b354e090567171" @@ -2925,6 +3068,7 @@ dependencies = [ "checksum encoding-index-tradchinese 1.20141219.5 (registry+https://github.com/rust-lang/crates.io-index)" = "fd0e20d5688ce3cab59eb3ef3a2083a5c77bf496cb798dc6fcdb75f323890c18" "checksum encoding_index_tests 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "a246d82be1c9d791c5dfde9a2bd045fc3cbba3fa2b11ad558f27d01712f00569" "checksum encoding_rs 0.8.22 (registry+https://github.com/rust-lang/crates.io-index)" = "cd8d03faa7fe0c1431609dfad7bbe827af30f82e1e2ae6f7ee4fca6bd764bc28" +"checksum entities 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b5320ae4c3782150d900b79807611a59a99fc9a1d61d686faafc24b93fc8d7ca" "checksum enum-as-inner 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "bc4bfcfacb61d231109d1d55202c1f33263319668b168843e02ad4652725ec9c" "checksum env_logger 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "44533bbbb3bb3c1fa17d9f2e4e38bbbaf8396ba82193c4cb1b6445d711445d36" "checksum failure 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "b8529c2421efa3066a5cbd8063d2244603824daccb6936b079010bb2aa89464b" @@ -2985,6 +3129,7 @@ dependencies = [ "checksum lock_api 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "79b2de95ecb4691949fea4716ca53cdbcfccb2c612e19644a8bad05edcf9f47b" "checksum log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7" "checksum lru-cache 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "31e24f1ad8321ca0e8a1e0ac13f23cb668e6f5466c2c57319f6a5cf1cc8e3b1c" +"checksum maplit 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d" "checksum match_cfg 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ffbee8634e0d45d258acb448e7eaab3fce7a0a467395d4d9f228e3c1f01fb2e4" "checksum matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" "checksum maybe-uninit 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" @@ -3016,6 +3161,10 @@ dependencies = [ "checksum parking_lot_core 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7582838484df45743c8434fbff785e8edf260c28748353d44bc0da32e0ceabf1" "checksum pem 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a1581760c757a756a41f0ee3ff01256227bdf64cb752839779b95ffb01c59793" "checksum percent-encoding 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" +"checksum pest 2.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "10f4872ae94d7b90ae48754df22fd42ad52ce740b8f370b03da4835417403e53" +"checksum pest_derive 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "833d1ae558dc601e9a60366421196a8d94bc0ac980476d0b67e1d0988d72b2d0" +"checksum pest_generator 2.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "99b8db626e31e5b81787b9783425769681b347011cc59471e33ea46d2ea0cf55" +"checksum pest_meta 2.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "54be6e404f5317079812fc8f9f5279de376d8856929e21c184ecf6bbd692a11d" "checksum pin-project 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "7804a463a8d9572f13453c516a5faea534a2403d7ced2f0c7e100eeff072772c" "checksum pin-project-internal 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "385322a45f2ecf3410c68d2a549a4a2685e8051d0f278e39743ff4e451cb9b3f" "checksum pin-project-lite 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "237844750cfbb86f67afe27eee600dfbbcb6188d734139b534cbfbf4f96792ae" @@ -3077,6 +3226,7 @@ dependencies = [ "checksum serde_json 1.0.48 (registry+https://github.com/rust-lang/crates.io-index)" = "9371ade75d4c2d6cb154141b9752cf3781ec9c05e0e5cf35060e1e70ee7b9c25" "checksum serde_test 0.8.23 (registry+https://github.com/rust-lang/crates.io-index)" = "110b3dbdf8607ec493c22d5d947753282f3bae73c0f56d322af1e8c78e4c23d5" "checksum serde_urlencoded 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9ec5d77e2d4c73717816afac02670d5c4f534ea95ed430442cad02e7a6e32c97" +"checksum sha-1 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f7d94d0bede923b3cea61f3f1ff57ff8cdfd77b400fb8f9998949e0cf04163df" "checksum sha1 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2579985fda508104f7587689507983eadd6a6e84dd35d6d115361f530916fa0d" "checksum sha2 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "27044adfd2e1f077f649f59deb9490d3941d674002f7d062870a60ebe9bd47a0" "checksum signal-hook-registry 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "94f478ede9f64724c5d173d7bb56099ec3e2d9fc2774aac65d34b8b890405f41" @@ -3088,6 +3238,7 @@ dependencies = [ "checksum spin 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" "checksum static_assertions 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "7f3eb36b47e512f8f1c9e3d10c2c1965bc992bd9cdb024fa581e2194501c83d3" "checksum strsim 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "67f84c44fbb2f91db7fef94554e6b2ac05909c9c0b0bc23bb98d3a1aebfe7f7c" +"checksum strsim 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" "checksum strsim 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)" = "6446ced80d6c486436db5c078dde11a9f73d42b57fb273121e160b84f63d894c" "checksum strum 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)" = "57bd81eb48f4c437cadc685403cad539345bf703d78e63707418431cecd4522b" "checksum strum_macros 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)" = "87c85aa3f8ea653bfd3ddf25f7ee357ee4d204731f6aa9ad04002306f6e2774c" @@ -3095,6 +3246,7 @@ dependencies = [ "checksum synstructure 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)" = "67656ea1dc1b41b1451851562ea232ec2e5a80242139f7e679ceccfb5d61f545" "checksum tempfile 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9" "checksum termcolor 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bb6bfa289a4d7c5766392812c0a1f4c1ba45afa1ad47803c11e1f407d846d75f" +"checksum textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" "checksum thiserror 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)" = "ee14bf8e6767ab4c687c9e8bc003879e042a96fd67a3ba5934eadb6536bef4db" "checksum thiserror-impl 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)" = "a7b51e1fbc44b5a0840be594fbc0f960be09050f2617e61e6aa43bef97cd3ef4" "checksum thread-id 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a9539db560102d1cef46b8b78ce737ff0bb64e7e18d35b2a5688f7d097d0ff03" @@ -3107,12 +3259,18 @@ dependencies = [ "checksum toml 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)" = "ffc92d160b1eef40665be3a05630d003936a3bc7da7421277846c2613e92c71a" "checksum trust-dns-proto 0.18.0-alpha.2 (registry+https://github.com/rust-lang/crates.io-index)" = "2a7f3a2ab8a919f5eca52a468866a67ed7d3efa265d48a652a9a3452272b413f" "checksum trust-dns-resolver 0.18.0-alpha.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6f90b1502b226f8b2514c6d5b37bafa8c200d7ca4102d57dc36ee0f3b7a04a2f" +"checksum twoway 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "6b40075910de3a912adbd80b5d8bad6ad10a23eeb1f5bf9d4006839e899ba5bc" +"checksum typed-arena 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a9b2228007eba4120145f785df0f6c92ea538f5a3635a612ecf4e334c8c1446d" "checksum typenum 1.11.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6d2783fe2d6b8c1101136184eb41be8b1ad379e4657050b8aaff0c79ee7575f9" +"checksum ucd-trie 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "56dee185309b50d1f11bfedef0fe6d036842e3fb77413abef29f8f8d1c5d4c1c" +"checksum unchecked-index 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "eeba86d422ce181a719445e51872fa30f1f7413b62becb52e95ec91aa262d85c" "checksum unicase 2.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6" "checksum unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" "checksum unicode-normalization 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "5479532badd04e128284890390c1e876ef7a993d0570b3597ae43dfa1d59afa4" "checksum unicode-segmentation 1.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e83e153d1053cbb5a118eeff7fd5be06ed99153f00dbcd8ae310c5fb2b22edc0" +"checksum unicode-width 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "caaa9d531767d1ff2150b9332433f32a24622147e5ebb1f26409d5da67afd479" "checksum unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c" +"checksum unicode_categories 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "39ec24b3121d976906ece63c9daad25b85969647682eee313cb5779fdd69e14e" "checksum untrusted 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "60369ef7a31de49bcb3f6ca728d4ba7300d9a1658f94c727d4cab8c8d9f4aece" "checksum url 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "829d4a8476c35c9bf0bbce5a3b23f4106f79728039b726d292bb93bc106787cb" "checksum utf8-ranges 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a1ca13c08c41c9c3e04224ed9ff80461d97e121589ff27c753a16cb10830ae0f" @@ -3121,6 +3279,7 @@ dependencies = [ "checksum v_escape_derive 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c2ca2a14bc3fc5b64d188b087a7d3a927df87b152e941ccfbc66672e20c467ae" "checksum v_htmlescape 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e33e939c0d8cf047514fb6ba7d5aac78bc56677a6938b2ee67000b91f2e97e41" "checksum vcpkg 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "3fc439f2794e98976c88a2a2dafce96b930fe8010b0a256b3c2199a773933168" +"checksum vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "05c78687fb1a80548ae3250346c3db86a80a7cdd77bda190189f2d0a0987c81a" "checksum version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "914b1a6776c4c929a602fafd8bc742e06365d4bcbe48c30f9cca5824f70dc9dd" "checksum version_check 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "078775d0255232fb988e6fccf26ddc9d1ac274299aaedcedce21c6f72cc533ce" "checksum wasi 0.9.0+wasi-snapshot-preview1 (registry+https://github.com/rust-lang/crates.io-index)" = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" diff --git a/server/Cargo.toml b/server/Cargo.toml index 3803485b..5a4fdcec 100644 --- a/server/Cargo.toml +++ b/server/Cargo.toml @@ -36,4 +36,4 @@ config = "0.10.1" hjson = "0.8.2" percent-encoding = "2.1.0" isahc = "0.9" -Markdown-to-HTML-rs = "0.1.0" +comrak = "0.7" diff --git a/server/src/db/mod.rs b/server/src/db/mod.rs index dacdb6f6..e0d358ff 100644 --- a/server/src/db/mod.rs +++ b/server/src/db/mod.rs @@ -1,4 +1,3 @@ -extern crate lazy_static; use crate::settings::Settings; use diesel::dsl::*; use diesel::result::Error; diff --git a/server/src/lib.rs b/server/src/lib.rs index 01f01ff1..8257dab9 100644 --- a/server/src/lib.rs +++ b/server/src/lib.rs @@ -11,12 +11,14 @@ pub extern crate actix; pub extern crate actix_web; pub extern crate bcrypt; pub extern crate chrono; +pub extern crate comrak; pub extern crate dotenv; pub extern crate jsonwebtoken; pub extern crate lettre; pub extern crate lettre_email; pub extern crate rand; pub extern crate regex; +pub extern crate rss; pub extern crate serde; pub extern crate serde_json; pub extern crate sha2; @@ -218,6 +220,10 @@ fn fetch_iframely_and_pictshare_data( ) } +pub fn markdown_to_html(text: &str) -> String { + comrak::markdown_to_html(text, &comrak::ComrakOptions::default()) +} + #[cfg(test)] mod tests { use crate::{extract_usernames, is_email_regex, remove_slurs, slur_check, slurs_vec_to_str}; diff --git a/server/src/routes/feeds.rs b/server/src/routes/feeds.rs index c94a60d4..6826cf5c 100644 --- a/server/src/routes/feeds.rs +++ b/server/src/routes/feeds.rs @@ -1,5 +1,3 @@ -extern crate rss; - use super::*; use crate::db::comment_view::{ReplyQueryBuilder, ReplyView}; use crate::db::community::Community; @@ -8,7 +6,7 @@ use crate::db::site_view::SiteView; use crate::db::user::{Claims, User_}; use crate::db::user_mention_view::{UserMentionQueryBuilder, UserMentionView}; use crate::db::{ListingType, SortType}; -use crate::Settings; +use crate::{markdown_to_html, Settings}; use actix_web::{web, HttpResponse, Result}; use chrono::{DateTime, NaiveDateTime, Utc}; use diesel::r2d2::{ConnectionManager, Pool}; @@ -18,7 +16,6 @@ use rss::{CategoryBuilder, ChannelBuilder, GuidBuilder, Item, ItemBuilder}; use serde::Deserialize; use std::str::FromStr; use strum::ParseError; -extern crate Markdown_to_HTML_rs; #[derive(Deserialize)] pub struct Params { @@ -288,7 +285,7 @@ fn build_item(creator_name: &str, published: &NaiveDateTime, url: &str, content: i.guid(guid.unwrap()); i.link(url.to_owned()); // TODO add images - let html = Markdown_to_HTML_rs::replace_all(&content.to_string()); + let html = markdown_to_html(&content.to_string()); i.description(html); i.build().unwrap() } @@ -348,8 +345,8 @@ fn create_post_items(posts: Vec) -> Vec { p.number_of_comments); if let Some(body) = p.body { - let html = Markdown_to_HTML_rs::replace_all(&body); - description.push_str(&format!("

    {}", html)); + let html = markdown_to_html(&body); + description.push_str(&html); } i.description(description); diff --git a/server/src/routes/nodeinfo.rs b/server/src/routes/nodeinfo.rs index 75568608..1263cef8 100644 --- a/server/src/routes/nodeinfo.rs +++ b/server/src/routes/nodeinfo.rs @@ -1,4 +1,3 @@ -extern crate lazy_static; use crate::db::site_view::SiteView; use crate::version; use crate::Settings; diff --git a/server/src/settings.rs b/server/src/settings.rs index ee3a3c07..d04ea880 100644 --- a/server/src/settings.rs +++ b/server/src/settings.rs @@ -1,4 +1,3 @@ -extern crate lazy_static; use config::{Config, ConfigError, Environment, File}; use serde::Deserialize; use std::env; From f8bdd6853e63b488fdea1fa62abaad49271db51f Mon Sep 17 00:00:00 2001 From: Dessalines Date: Sat, 28 Mar 2020 18:18:20 -0400 Subject: [PATCH 35/43] Revert "Deploy multiple Lemmy instances to the same server (ref #474)" This reverts commit aa341933da04a21f9bb342b3b2840ee2acde8a94. --- .gitignore | 1 - ansible/lemmy_dev.yml | 50 ++++++---------------------- ansible/templates/docker-compose.yml | 6 ++-- ansible/templates/nginx.conf | 14 ++++---- ansible/uninstall.yml | 16 +++++++-- 5 files changed, 33 insertions(+), 54 deletions(-) diff --git a/.gitignore b/.gitignore index ef03389c..9f7fa1e3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,6 @@ ansible/inventory ansible/inventory_dev ansible/passwords/ -ansible/vars/ docker/lemmy_mine.hjson docker/dev/env_deploy.sh build/ diff --git a/ansible/lemmy_dev.yml b/ansible/lemmy_dev.yml index 1d8e40ae..e9b8364f 100644 --- a/ansible/lemmy_dev.yml +++ b/ansible/lemmy_dev.yml @@ -16,32 +16,6 @@ - setup: # gather facts tasks: - # TODO: this task is running on all hosts at the same time so there is a race condition - - name: xxx - shell: | - mkdir -p "vars/{{ inventory_hostname }}/" - if [ ! -f "vars/{{ inventory_hostname }}/port_counter" ]; then - if [ -f "vars/max_port_counter" ]; then - MAX_PORT=$(cat vars/max_port_counter) - else - MAX_PORT=8000 - fi - OUR_PORT=$(expr $MAX_PORT + 10) - echo $OUR_PORT > "vars/{{ inventory_hostname }}/port_counter" - echo $OUR_PORT > "vars/max_port_counter" - fi - cat "vars/{{ inventory_hostname }}/port_counter" - args: - executable: /bin/bash - delegate_to: localhost - register: lemmy_port - - - set_fact: "lemmy_port={{ lemmy_port.stdout_lines[0] }}" - - set_fact: "pictshare_port={{ lemmy_port|int + 1 }}" - - set_fact: "iframely_port={{ lemmy_port|int + 2 }}" - - debug: - msg: "lemmy_port={{ lemmy_port }} pictshare_port={{pictshare_port}} iframely_port={{iframely_port}}" - - name: install dependencies apt: pkg: ['nginx', 'docker-compose', 'docker.io', 'certbot', 'python-certbot-nginx'] @@ -51,29 +25,25 @@ args: creates: '/etc/letsencrypt/live/{{domain}}/privkey.pem' - # TODO: need to use different path per domain - name: create lemmy folder file: path={{item.path}} state=directory with_items: - - { path: '/lemmy/{{ domain }}/' } - - { path: '/lemmy/{{ domain }}/volumes/' } - - { path: '/var/cache/lemmy/{{ domain }}/' } + - { path: '/lemmy/' } + - { path: '/lemmy/volumes/' } - block: - name: add template files template: src={{item.src}} dest={{item.dest}} mode={{item.mode}} with_items: - - { src: 'templates/docker-compose.yml', dest: '/lemmy/{{domain}}/docker-compose.yml', mode: '0600' } - - { src: 'templates/nginx.conf', dest: '/etc/nginx/sites-enabled/lemmy-{{ domain }}.conf', mode: '0644' } - - { src: '../docker/iframely.config.local.js', dest: '/lemmy/{{ domain }}/iframely.config.local.js', mode: '0600' } + - { src: 'templates/docker-compose.yml', dest: '/lemmy/docker-compose.yml', mode: '0600' } + - { src: 'templates/nginx.conf', dest: '/etc/nginx/sites-enabled/lemmy.conf', mode: '0644' } + - { src: '../docker/iframely.config.local.js', dest: '/lemmy/iframely.config.local.js', mode: '0600' } - name: add config file (only during initial setup) - template: src='templates/config.hjson' dest='/lemmy/{{domain}}/lemmy.hjson' mode='0600' force='no' owner='1000' group='1000' + template: src='templates/config.hjson' dest='/lemmy/lemmy.hjson' mode='0600' force='no' owner='1000' group='1000' vars: - # TODO: these paths are changed, need to move the files - # TODO: not sure what to call the local var folder, its not mentioned in the ansible docs - postgres_password: "{{ lookup('password', 'vars/{{ inventory_hostname }}/postgres_password chars=ascii_letters,digits') }}" - jwt_password: "{{ lookup('password', 'vars/{{ inventory_hostname }}/jwt_password chars=ascii_letters,digits') }}" + postgres_password: "{{ lookup('password', 'passwords/{{ inventory_hostname }}/postgres chars=ascii_letters,digits') }}" + jwt_password: "{{ lookup('password', 'passwords/{{ inventory_hostname }}/jwt chars=ascii_letters,digits') }}" - name: build the dev docker image local_action: shell cd .. && sudo docker build . -f docker/dev/Dockerfile -t lemmy:dev @@ -115,7 +85,7 @@ # be a problem for testing - name: start docker-compose docker_compose: - project_src: "/lemmy/{{ domain }}/" + project_src: /lemmy/ state: present recreate: always ignore_errors: yes @@ -126,6 +96,6 @@ - name: certbot renewal cronjob cron: special_time=daily - name=certbot-renew-lemmy-{{ domain }} + name=certbot-renew-lemmy user=root job="certbot certonly --nginx -d '{{ domain }}' --deploy-hook 'nginx -s reload'" diff --git a/ansible/templates/docker-compose.yml b/ansible/templates/docker-compose.yml index d6afd253..a4d54f6d 100644 --- a/ansible/templates/docker-compose.yml +++ b/ansible/templates/docker-compose.yml @@ -4,7 +4,7 @@ services: lemmy: image: {{ lemmy_docker_image }} ports: - - "127.0.0.1:{{ lemmy_port }}:8536" + - "127.0.0.1:8536:8536" restart: always environment: - RUST_LOG=error @@ -28,7 +28,7 @@ services: pictshare: image: shtripok/pictshare:latest ports: - - "127.0.0.1:{{ pictshare_port }}:80" + - "127.0.0.1:8537:80" volumes: - ./volumes/pictshare:/usr/share/nginx/html/data restart: always @@ -36,7 +36,7 @@ services: iframely: image: dogbin/iframely:latest ports: - - "127.0.0.1:{{ iframely_port }}:80" + - "127.0.0.1:8061:80" volumes: - ./iframely.config.local.js:/iframely/config.local.js:ro restart: always diff --git a/ansible/templates/nginx.conf b/ansible/templates/nginx.conf index 003720bc..04e5a643 100644 --- a/ansible/templates/nginx.conf +++ b/ansible/templates/nginx.conf @@ -1,4 +1,4 @@ -proxy_cache_path /var/cache/lemmy/{{ domain }} levels=1:2 keys_zone=lemmy_frontend_cache_{{ domain }}:10m max_size=100m use_temp_path=off; +proxy_cache_path /var/cache/lemmy_frontend levels=1:2 keys_zone=lemmy_frontend_cache:10m max_size=100m use_temp_path=off; server { listen 80; @@ -52,7 +52,7 @@ server { client_max_body_size 50M; location / { - proxy_pass http://0.0.0.0:{{ lemmy_port }}; + proxy_pass http://0.0.0.0:8536; proxy_set_header X-Real-IP $remote_addr; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; @@ -63,7 +63,7 @@ server { proxy_set_header Connection "upgrade"; # Proxy Cache - proxy_cache lemmy_frontend_cache_{{ domain }}; + proxy_cache lemmy_frontend_cache; proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504; proxy_cache_revalidate on; proxy_cache_lock on; @@ -71,7 +71,7 @@ server { } location /pictshare/ { - proxy_pass http://0.0.0.0:{{ pictshare_port }}/; + proxy_pass http://0.0.0.0:8537/; proxy_set_header X-Real-IP $remote_addr; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; @@ -82,7 +82,7 @@ server { } location /iframely/ { - proxy_pass http://0.0.0.0:{{ iframely_port }}/; + proxy_pass http://0.0.0.0:8061/; proxy_set_header X-Real-IP $remote_addr; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; @@ -98,6 +98,6 @@ map $remote_addr $remote_addr_anon { ::1 $remote_addr; default 0.0.0.0; } -log_format main_{{ domain }} '$remote_addr_anon - $remote_user [$time_local] "$request" ' +log_format main '$remote_addr_anon - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" "$http_user_agent"'; -access_log /var/log/nginx/access.log main_{{ domain }}; +access_log /var/log/nginx/access.log main; diff --git a/ansible/uninstall.yml b/ansible/uninstall.yml index 08d5316c..252c5bd1 100644 --- a/ansible/uninstall.yml +++ b/ansible/uninstall.yml @@ -22,14 +22,24 @@ - name: stop docker-compose docker_compose: - project_src: /lemmy/{{domain}}/ + project_src: /lemmy/ state: absent - name: delete data file: path={{item.path}} state=absent with_items: - - { path: '/lemmy/{{domain}}/' } - - { path: '/etc/nginx/sites-enabled/lemmy-{{ domain }}.conf' } + - { path: '/lemmy/' } + - { path: '/etc/nginx/sites-enabled/lemmy.conf' } + + - name: Remove a volume + docker_volume: name={{item.name}} state=absent + with_items: + - { name: 'lemmy_lemmy_db' } + - { name: 'lemmy_lemmy_pictshare' } + + - name: delete entire ecloud folder + file: path='/mnt/repo-base/' state=absent + when: delete_certs|bool - name: remove certbot cronjob cron: From 892e1066df9ba63078c0de6e9ddd7b4da65f66b8 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Sat, 28 Mar 2020 18:21:10 -0400 Subject: [PATCH 36/43] Testing out another travis build. #397 --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index d765ecb4..602a8613 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,7 +12,6 @@ before_cache: - rm -rfv target/debug/build/lemmy_server-* - rm -rfv target/debug/deps/lemmy_server-* - rm -rfv target/debug/lemmy_server.d - - cargo clean before_script: - psql -c "create user lemmy with password 'password' superuser;" -U postgres - psql -c 'create database lemmy with owner lemmy;' -U postgres From c12fd12d9c255d7f8ce72b89b9e46c2e427fd19f Mon Sep 17 00:00:00 2001 From: Felix Date: Thu, 26 Mar 2020 15:23:15 +0100 Subject: [PATCH 37/43] Automatic instance setup based on config variables (fixes #404) --- docker/lemmy.hjson | 11 ++++++++- server/config/defaults.hjson | 11 +++++++++ server/src/api/site.rs | 48 ++++++++++++++++++++++++++++-------- server/src/api/user.rs | 14 +++++------ server/src/settings.rs | 9 +++++++ 5 files changed, 75 insertions(+), 18 deletions(-) diff --git a/docker/lemmy.hjson b/docker/lemmy.hjson index 5a6d1ff1..b61ea826 100644 --- a/docker/lemmy.hjson +++ b/docker/lemmy.hjson @@ -41,7 +41,16 @@ # interval length for registration limit register_per_second: 3600 } -# # email sending configuration +# # optional: parameters for automatic configuration of new instance (only used at first start) +# setup: { +# # username for the admin user +# admin_username: "lemmy" +# # password for the admin user +# admin_password: "lemmy" +# # name of the site (can be changed later) +# site_name: "Lemmy Test" +# } +# # optional: email sending configuration # email: { # # hostname of the smtp server # smtp_server: "" diff --git a/server/config/defaults.hjson b/server/config/defaults.hjson index 2b37f3bb..97b9429c 100644 --- a/server/config/defaults.hjson +++ b/server/config/defaults.hjson @@ -1,4 +1,15 @@ { +# # optional: parameters for automatic configuration of new instance (only used at first start) +# setup: { +# # username for the admin user +# admin_username: "" +# # password for the admin user +# admin_password: "" +# # optional: email for the admin user (can be omitted and set later through the website) +# admin_email: "" +# # name of the site (can be changed later) +# site_name: "" +# } # settings related to the postgresql database database: { # username to connect to postgres diff --git a/server/src/api/site.rs b/server/src/api/site.rs index ef1a2828..6bd90149 100644 --- a/server/src/api/site.rs +++ b/server/src/api/site.rs @@ -1,5 +1,9 @@ use super::*; +use crate::api::user::Register; +use crate::api::{Oper, Perform}; +use crate::settings::Settings; use diesel::PgConnection; +use log::info; use std::str::FromStr; #[derive(Serialize, Deserialize)] @@ -53,12 +57,12 @@ pub struct GetModlogResponse { #[derive(Serialize, Deserialize)] pub struct CreateSite { - name: String, - description: Option, - enable_downvotes: bool, - open_registration: bool, - enable_nsfw: bool, - auth: String, + pub name: String, + pub description: Option, + pub enable_downvotes: bool, + pub open_registration: bool, + pub enable_nsfw: bool, + pub auth: String, } #[derive(Serialize, Deserialize)] @@ -277,10 +281,34 @@ impl Perform for Oper { fn perform(&self, conn: &PgConnection) -> Result { let _data: &GetSite = &self.data; - // It can return a null site in order to redirect - let site_view = match Site::read(&conn, 1) { - Ok(_site) => Some(SiteView::read(&conn)?), - Err(_e) => None, + let site = Site::read(&conn, 1); + let site_view = if site.is_ok() { + Some(SiteView::read(&conn)?) + } else if let Some(setup) = Settings::get().setup.as_ref() { + let register = Register { + username: setup.admin_username.to_owned(), + email: setup.admin_email.to_owned(), + password: setup.admin_password.to_owned(), + password_verify: setup.admin_password.to_owned(), + admin: true, + show_nsfw: true, + }; + let login_response = Oper::new(register).perform(&conn)?; + info!("Admin {} created", setup.admin_username); + + let create_site = CreateSite { + name: setup.site_name.to_owned(), + description: None, + enable_downvotes: false, + open_registration: false, + enable_nsfw: false, + auth: login_response.jwt, + }; + Oper::new(create_site).perform(&conn)?; + info!("Site {} created", setup.site_name); + Some(SiteView::read(&conn)?) + } else { + None }; let mut admins = UserView::admins(&conn)?; diff --git a/server/src/api/user.rs b/server/src/api/user.rs index 333fd949..056a2a84 100644 --- a/server/src/api/user.rs +++ b/server/src/api/user.rs @@ -14,12 +14,12 @@ pub struct Login { #[derive(Serialize, Deserialize)] pub struct Register { - username: String, - email: Option, - password: String, - password_verify: String, - admin: bool, - show_nsfw: bool, + pub username: String, + pub email: Option, + pub password: String, + pub password_verify: String, + pub admin: bool, + pub show_nsfw: bool, } #[derive(Serialize, Deserialize)] @@ -42,7 +42,7 @@ pub struct SaveUserSettings { #[derive(Serialize, Deserialize)] pub struct LoginResponse { - jwt: String, + pub jwt: String, } #[derive(Serialize, Deserialize)] diff --git a/server/src/settings.rs b/server/src/settings.rs index ee3a3c07..a2d61edb 100644 --- a/server/src/settings.rs +++ b/server/src/settings.rs @@ -9,6 +9,7 @@ static CONFIG_FILE: &str = "config/config.hjson"; #[derive(Debug, Deserialize)] pub struct Settings { + pub setup: Option, pub database: Database, pub hostname: String, pub bind: IpAddr, @@ -20,6 +21,14 @@ pub struct Settings { pub federation_enabled: bool, } +#[derive(Debug, Deserialize)] +pub struct Setup { + pub admin_username: String, + pub admin_password: String, + pub admin_email: Option, + pub site_name: String, +} + #[derive(Debug, Deserialize)] pub struct RateLimitConfig { pub message: i32, From c69fbb5021e0aad7bb110b2df9731f5323719c17 Mon Sep 17 00:00:00 2001 From: Felix Date: Tue, 31 Mar 2020 02:06:31 +0200 Subject: [PATCH 38/43] Improve installation docs --- docs/src/administration_install_ansible.md | 9 +++++++++ docs/src/administration_install_docker.md | 18 +++++++++++------- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/docs/src/administration_install_ansible.md b/docs/src/administration_install_ansible.md index 875dae6a..bf5e6749 100644 --- a/docs/src/administration_install_ansible.md +++ b/docs/src/administration_install_ansible.md @@ -1,5 +1,7 @@ # Ansible Installation +This is the same as the [Docker installation](administration_install_docker.md), except that Ansible handles all of it automatically. It also does some extra things like setting up TLS and email for your Lemmy instance. + First, you need to [install Ansible on your local computer](https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html) (e.g. using `sudo apt install ansible`) or the equivalent for you platform. Then run the following commands on your local computer: @@ -11,3 +13,10 @@ cp inventory.example inventory nano inventory # enter your server, domain, contact email ansible-playbook lemmy.yml --become ``` + +To update to a new version, just run the following in your local Lemmy repo: +```bash +git pull origin master +cd ansible +ansible-playbook lemmy.yml --become +``` \ No newline at end of file diff --git a/docs/src/administration_install_docker.md b/docs/src/administration_install_docker.md index 99204983..391299b3 100644 --- a/docs/src/administration_install_docker.md +++ b/docs/src/administration_install_docker.md @@ -1,29 +1,33 @@ # Docker Installation -Make sure you have both docker and docker-compose(>=`1.24.0`) installed: +Make sure you have both docker and docker-compose(>=`1.24.0`) installed. On Ubuntu, just run `apt install docker-compose docker.io`. Next, ```bash -mkdir lemmy/ -cd lemmy/ +# create a folder for the lemmy files. the location doesnt matter, you can put this anywhere you want +mkdir /lemmy +cd /lemmy +# download default config files wget https://raw.githubusercontent.com/dessalines/lemmy/master/docker/prod/docker-compose.yml wget https://raw.githubusercontent.com/dessalines/lemmy/master/docker/lemmy.hjson wget https://raw.githubusercontent.com/dessalines/lemmy/master/docker/iframely.config.local.js -# Edit lemmy.hjson, and docker-compose.yml to do more configuration (like adding a custom password) docker-compose up -d ``` -and go to http://localhost:8536. +After this, have a look at the [config file](administration_configuration.md) named `lemmy.hjson`, and adjust it, in particular the hostname. -[A sample nginx config](/ansible/templates/nginx.conf) (Note: Avatar / Image uploading won't work without this), could be setup with: +To make Lemmy available outside the server, you need to setup a reverse proxy, like Nginx. [A sample nginx config](/ansible/templates/nginx.conf), could be setup with: ```bash wget https://raw.githubusercontent.com/dessalines/lemmy/master/ansible/templates/nginx.conf # Replace the {{ vars }} sudo mv nginx.conf /etc/nginx/sites-enabled/lemmy.conf ``` + +You will also need to setup TLS, for example with [Let's Encrypt](https://letsencrypt.org/). After this you need to restart Nginx to reload the config. + ## Updating -To update to the newest version, run: +To update to the newest version, you can manually change the version in `docker-compose.yml`. Alternatively, fetch the latest version from our git repo: ```bash wget https://raw.githubusercontent.com/dessalines/lemmy/master/docker/prod/docker-compose.yml From 6900eb2d346647d9671ed5056bbf40a8261bbbf1 Mon Sep 17 00:00:00 2001 From: Adam Adamsky Date: Wed, 1 Apr 2020 13:15:15 +0000 Subject: [PATCH 39/43] Translated using Weblate (Polish) Currently translated at 100.0% (237 of 237 strings) Translation: Lemmy/lemmy Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/pl/ --- ui/translations/pl.json | 256 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 255 insertions(+), 1 deletion(-) diff --git a/ui/translations/pl.json b/ui/translations/pl.json index bfd870e4..9da7dc94 100644 --- a/ui/translations/pl.json +++ b/ui/translations/pl.json @@ -1,3 +1,257 @@ { + "remove_post": "Usuń Post", + "no_posts": "Brak Postów.", + "create_a_post": "Stwórz post", + "create_post": "Stwórz Post", + "number_of_posts_0": "Post", + "number_of_posts_1": "Posty/ów", + "number_of_posts_2": "Posty/ów", + "posts": "Posty", + "related_posts": "Te posty mogą być powiązane", + "cross_posts": "Ten link został też zapostowany na:", + "comments": "Komentarze", + "number_of_comments_0": "Komentarz", + "number_of_comments_1": "Komentarzy/e", + "number_of_comments_2": "Komentarzy/e", + "post": "post", + "cross_post": "post zewnętrzny", + "cross_posted_to": "post wrzucony na zewnątrz: ", + "remove_comment": "Usuń Komentarz", + "communities": "Społeczności", + "users": "Użytkownicy", + "create_a_community": "Stwórz społeczność", + "create_community": "Stwórz Społeczność", + "remove_community": "Usuń Społeczność", + "subscribed_to_communities": "Subskrybowane <1>społeczności", + "trending_communities": "Popularne <1>społeczności", + "list_of_communities": "Lista społeczności", + "community_reqs": "małe litery, podkreślniki, bez spacji.", + "create_private_message": "Stwórz Prywatną Wiadomość", + "send_secure_message": "Wyślij Bezpieczną Wiadomość", + "send_message": "Wyślij Wiadomość", + "message": "Wiadomość", + "edit": "edytuj", + "reply": "odpowiedz", + "more": "więcej", + "cancel": "Anuluj", + "preview": "Podgląd", + "upload_image": "prześlij obraz", + "avatar": "Awatar", + "upload_avatar": "Prześlij Awatar", + "show_avatars": "Pokaż Awatary", + "formatting_help": "poradnik formatowania", + "lock": "zablokuj", + "messages": "Wiadomości", + "yes": "tak", + "number_of_communities_0": "Społeczność", + "number_of_communities_1": "Społeczności", + "number_of_communities_2": "Społeczności", + "sorting_help": "poradnik sortowania", + "view_source": "pokaż źródło", + "unlock": "odblokuj", + "sticky": "przyklej", + "unsticky": "odklej", + "link": "link", + "archive_link": "link archiwalny", + "mod": "moderator", + "mods": "moderatorzy", + "moderates": "Moderuje", + "settings": "Ustawienia", + "remove_as_mod": "zabierz uprawnienia moderatora", + "appoint_as_mod": "przyznaj uprawnienia moderatora", + "modlog": "Log moderatorski", + "admin": "administrator", + "admins": "administratorzy", + "remove_as_admin": "wycofaj uprawnienia administratora", + "appoint_as_admin": "przyznaj uprawnienia administratora", + "remove": "usuń", + "removed": "usunięte", + "locked": "zablokowane", + "stickied": "przyklejone", + "reason": "Powód", + "mark_as_read": "zaznacz jako przeczytane", + "mark_as_unread": "zaznacz jako nieprzeczytane", + "delete": "usuń", + "deleted": "usunięte", + "delete_account": "Usuń Konto", + "delete_account_confirm": "Ostrzeżenie: twoje dane zostaną bezpowrotnie usunięte. Wpisz swoje hasło aby potwierdzić.", + "restore": "przywróć", + "ban": "zbanuj", + "ban_from_site": "zbanuj ze strony", + "unban": "odbanuj", + "unban_from_site": "odbanuj ze strony", + "banned": "zbanowano", + "save": "zapisz", + "unsave": "cofnij zapis", + "create": "stwórz", + "creator": "autor", + "username": "Nazwa użytkownika", + "email_or_username": "Email lub Nazwa Użytkownika", + "number_of_users_0": "Użytkownik", + "number_of_users_1": "Użytkownicy/ków", + "number_of_users_2": "Użytkownicy/ków", + "number_of_subscribers_0": "Subskrybent", + "number_of_subscribers_1": "Subskrybenci/tów", + "number_of_subscribers_2": "Subskrybenci/tów", + "number_of_points_0": "Punkt", + "number_of_points_1": "Punkty/ów", + "number_of_points_2": "Punkty/ów", + "number_online_0": "Użytkownik Online", + "number_online_1": "Użytkowników Online", + "number_online_2": "Użytkowników Online", + "name": "Nazwa", + "title": "Tytuł", + "category": "Kategoria", + "subscribers": "Subskrybenci", + "both": "Obydwa", + "saved": "Zapisane", + "unsubscribe": "Odsubskrybuj", + "subscribe": "Subskrybuj", + "subscribed": "Zasubskrybowane", + "prev": "Wstecz", + "next": "Dalej", + "sidebar": "Pasek boczny", + "sort_type": "Sortuj typ", + "hot": "Popularne", + "new": "Nowe", + "old": "Stare", + "top_day": "Popularne dzisiaj", + "week": "Tydzień", + "month": "Miesiąc", + "year": "Rok", + "all": "Wszystko", + "top": "Popularne", + "api": "API", + "docs": "Dokumentacja", + "inbox": "Skrzynka odbiorcza", + "inbox_for": "Skrzynka odbiorcza <1>{{user}}", + "mark_all_as_read": "zaznacz wszystko jako przeczytane", + "type": "Rodzaj", + "unread": "Nieprzeczytane", + "replies": "Odpowiedzi", + "mentions": "Wzmianki", + "reply_sent": "Odpowiedź wysłana", + "message_sent": "Wiadomość wysłana", + "search": "Szukaj", + "overview": "Podgląd", + "view": "Widok", + "logout": "Wyloguj", + "login_sign_up": "Zaloguj / Zarejestruj", + "login": "Zaloguj", + "sign_up": "Zarejestruj", + "notifications_error": "Powiadomienia na pulpicie są niedostępne w Twojej przeglądarce. Spróbuj przeglądarkę Firefox lub Chrome.", + "unread_messages": "Nieprzeczytane Wiadomości", + "password": "Hasło", + "verify_password": "Zweryfikuj Hasło", + "old_password": "Stare Hasło", + "forgot_password": "nie pamiętam hasła", + "reset_password_mail_sent": "Wysłano email w celu zresetowania hasła.", + "password_change": "Zmiana Hasła", + "new_password": "Nowe Hasło", + "no_email_setup": "Email nie został poprawnie ustawiony na tym serwerze.", + "email": "Email", + "matrix_user_id": "Użytkownik Matrixa", + "private_message_disclaimer": "Ostrzeżenie: Prywatne wiadomości w Lemmym nie są bezpieczne. Jeśli chcesz wysyłać i odbierać bezpieczne wiadomości załóż konto na <1>Riot.im.", + "send_notifications_to_email": "Wysyłaj powiadomienia na Email", + "optional": "Opcjonalne", + "expires": "Wygasa", + "language": "Język", + "browser_default": "Domyślna wartość przeglądarki", + "downvotes_disabled": "Wdółgłosy wyłączone", + "enable_downvotes": "Włącz Wdółgłosy", + "upvote": "Wgóręgłos", + "number_of_upvotes_0": "Wgóręgłos", + "number_of_upvotes_1": "Wgóręgłosy/ów", + "number_of_upvotes_2": "Wgóręgłosy/ów", + "downvote": "Wdółgłos", + "number_of_downvotes_0": "Wdółgłos", + "number_of_downvotes_1": "Wdółgłosy/ów", + "number_of_downvotes_2": "Wdółgłosy/ów", + "open_registration": "Rejestracja Otwarta", + "registration_closed": "Rejestracja Zamknięta", + "enable_nsfw": "Włącz NSFW", + "url": "URL", + "body": "Treść", + "copy_suggested_title": "skopiuj sugerowany tytuł: {{title}}", + "community": "Społeczność", + "expand_here": "Rozwiń tutaj", + "subscribe_to_communities": "Zasubskrybuj kilka <1>społeczności.", + "chat": "Czat", + "recent_comments": "Najnowsze Komentarze", + "no_results": "Brak wyników.", + "setup": "Instalacja", + "lemmy_instance_setup": "Instalacja Instancji Lemmy", + "setup_admin": "Ustaw Administratora Strony", + "your_site": "twoja witryna", + "modified": "zmodyfikowane", + "nsfw": "NSFW", + "show_nsfw": "Pokaż treści NSFW (+18)", + "theme": "Motyw", + "sponsors": "Sponsorzy", + "sponsors_of_lemmy": "Sponsorzy projektu Lemmy", + "sponsor_message": "Lemmy jest wolnym, <1>otwartoźródłowym oprogramowaniem, co oznacza zero reklam, opłat, czy innych form kapitalizacji, od zawsze na zawsze. Twoje darowizny idą bezpośrednio na rozwój projektu w pełno-etatowym wymiarze. Specjalne wyrazy podziękowania dla następujących osób:", + "support_on_patreon": "Wspieraj w serwisie Patreon", + "support_on_liberapay": "Wspieraj na Liberapay", + "donate_to_lemmy": "Przekaż datek na Lemmiego", + "donate": "Przekaż datek", + "general_sponsors": "Główni Sponsorzy to osoby które wsparły Lemmiego kwotą od $10 do $39.", + "crypto": "Kryptowaluta", + "bitcoin": "Bitcoin", + "ethereum": "Ethereum", + "monero": "Monero", + "code": "Kod", + "joined": "Dołączono", + "by": "przez", + "to": "do", + "from": "od", + "transfer_community": "transfer społeczności", + "transfer_site": "transfer witryny", + "are_you_sure": "na pewno?", + "no": "nie", + "powered_by": "Powered by", + "landing": "Lemmy jest <1>agregatorem linków / alternatywą dla reddita. Jest przeznaczony do działania w ramach cyfrowej przestrzeni nazywanej <2>fediverse<2>. <3>Opiera się na samodzielnym hostingu, posiada aktualizowane na żywo wątki z komentarzami, i zajmuje bardzo mało miejsce (<4>~80kB). Federacja w ramach sieci ActivityPub jest w planach. <5>Ta wersja jest <6>bardzo wczesną wersją beta, co oznacza, że wiele funkcji nadal nie działa tak jak powinny. <7><8>Pod tym adresem można sugerować nową funkcjonalność i zgłaszać błędy.<9>Stworzono z wykorzystaniem <10>Rust, <11>Actix, <12>Inferno, <13>Typescript.", + "not_logged_in": "Nie jesteś zalogowana/y.", + "logged_in": "Zalogowano.", + "community_ban": "Zostałaś/eś zbanowana/y z tej społeczności.", + "site_ban": "Zostałaś/eś zbanowana/y z tej witryny", + "couldnt_create_comment": "Nie udało się stworzyć komentarza.", + "couldnt_like_comment": "Polubienie komentarza nie powiodło się.", + "couldnt_update_comment": "Zaktualizowanie komentarza nie powiodło się.", + "couldnt_save_comment": "Zapisanie komentarza nie powiodło się.", + "couldnt_get_comments": "Pobranie komentarzy nie powiodło się.", + "no_comment_edit_allowed": "Nie masz uprawnień do edycji komentarza.", + "no_post_edit_allowed": "Nie masz uprawnień do edycji posta.", + "no_community_edit_allowed": "Nie masz uprawnień do edycji społeczności.", + "couldnt_find_community": "Nie udało się znaleźć społeczności.", + "couldnt_update_community": "Nie udało się zaktualizować Społeczności.", + "community_already_exists": "Społeczność już istnieje.", + "community_moderator_already_exists": "Moderator społeczności już istnieje.", + "community_follower_already_exists": "Osoba obserwująca społeczność już istnieje.", + "community_user_already_banned": "Użytkownik społeczności jest już zbanowany.", + "couldnt_create_post": "Nie udało się stworzyć posta.", + "post_title_too_long": "Tytuł posta zbyt długi.", + "couldnt_like_post": "Nie udało się polubić posta.", + "couldnt_find_post": "Nie udało się znaleźć posta.", + "couldnt_update_post": "Nie udało się zaktualizować postów", + "couldnt_get_posts": "Nie udało się pobrać postów", + "couldnt_save_post": "Nie udało się zapisać posta.", + "no_slurs": "Bez obelg.", + "not_an_admin": "Nie jest administratorem.", + "site_already_exists": "Witryna już istnieje.", + "couldnt_update_site": "Nie udało się zaktualizować witryny.", + "couldnt_find_that_username_or_email": "Nie udało się znaleźć takiej nazwy użytkownika lub adresu email.", + "password_incorrect": "Hasło niepoprawne.", + "passwords_dont_match": "Hasła nie pasują do siebie.", + "admin_already_created": "Wybacz, funkcja administratora jest już przypisana.", + "user_already_exists": "Użytkownik już istnieje.", + "email_already_exists": "Email już istnieje.", + "couldnt_update_user": "Nie udało się zaktualizować użytkownika.", + "system_err_login": "Błąd systemu. Spróbuj wylogować się i następnie zalogować ponownie.", + "couldnt_create_private_message": "Nie udało się stworzyć prywatnej wiadomości.", + "no_private_message_edit_allowed": "Brak uprawnień do edycji prywatnej wiadomości.", + "couldnt_update_private_message": "Nie udało się zaktualizować prywatnej wiadomości.", + "time": "Czas", + "action": "Akcja", + "block_leaving": "Czy na pewno chcesz wyjść?", + "show_context": "Pokaż kontekst" } - From 55f97c49e3d2d226effb83575d442cc04003bdc3 Mon Sep 17 00:00:00 2001 From: olivia maia Date: Wed, 1 Apr 2020 13:15:16 +0000 Subject: [PATCH 40/43] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (237 of 237 strings) Translation: Lemmy/lemmy Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/pt_BR/ --- ui/translations/pt_BR.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ui/translations/pt_BR.json b/ui/translations/pt_BR.json index a9b36b48..c7cce202 100644 --- a/ui/translations/pt_BR.json +++ b/ui/translations/pt_BR.json @@ -243,5 +243,6 @@ "number_of_upvotes": "{{count}} voto positivo", "number_of_upvotes_plural": "{{count}} votos positivos", "number_of_downvotes": "{{count}} voto negativo", - "number_of_downvotes_plural": "{{count}} votos negativos" + "number_of_downvotes_plural": "{{count}} votos negativos", + "show_context": "Mostrar contexto" } From dc1945b5a8e2fc00b7dcc3eb4794399c834c8a5c Mon Sep 17 00:00:00 2001 From: Dessalines Date: Wed, 1 Apr 2020 11:31:24 -0400 Subject: [PATCH 41/43] Browser notification as plain markdown. Fixes #618 --- ui/src/components/navbar.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ui/src/components/navbar.tsx b/ui/src/components/navbar.tsx index ea9b619b..d7f3b5a8 100644 --- a/ui/src/components/navbar.tsx +++ b/ui/src/components/navbar.tsx @@ -375,12 +375,13 @@ export class Navbar extends Component { let link = isCommentType(reply) ? `/post/${reply.post_id}/comment/${reply.id}` : `/inbox`; - let body = md.render(reply.content); + let htmlBody = md.render(reply.content); + let body = reply.content; // Unfortunately the notifications API can't do html messageToastify( creator_name, creator_avatar, - body, + htmlBody, link, this.context.router ); From a8c7468af9830d90cd13531b7ce15abdb9eb9a41 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Wed, 1 Apr 2020 13:22:44 -0400 Subject: [PATCH 42/43] Add georgian language for weblate. --- ui/src/utils.ts | 4 ++++ ui/translations/ka.json | 2 ++ 2 files changed, 6 insertions(+) create mode 100644 ui/translations/ka.json diff --git a/ui/src/utils.ts b/ui/src/utils.ts index 48bd175e..8ecef19b 100644 --- a/ui/src/utils.ts +++ b/ui/src/utils.ts @@ -12,6 +12,7 @@ import 'moment/locale/ca'; import 'moment/locale/fa'; import 'moment/locale/pt-br'; import 'moment/locale/ja'; +import 'moment/locale/ka'; import { UserOperation, @@ -59,6 +60,7 @@ export const languages = [ { code: 'eo', name: 'Esperanto' }, { code: 'es', name: 'Español' }, { code: 'de', name: 'Deutsch' }, + { code: 'ka', name: 'ქართული ენა' }, { code: 'fa', name: 'فارسی' }, { code: 'ja', name: '日本語' }, { code: 'pt_BR', name: 'Português Brasileiro' }, @@ -353,6 +355,8 @@ export function getMomentLanguage(): string { lang = 'pt-br'; } else if (lang.startsWith('ja')) { lang = 'ja'; + } else if (lang.startsWith('ka')) { + lang = 'ka'; } else { lang = 'en'; } diff --git a/ui/translations/ka.json b/ui/translations/ka.json new file mode 100644 index 00000000..2c63c085 --- /dev/null +++ b/ui/translations/ka.json @@ -0,0 +1,2 @@ +{ +} From 705ac32c930a611301604382717884377f02851f Mon Sep 17 00:00:00 2001 From: Dessalines Date: Fri, 3 Apr 2020 00:12:05 -0400 Subject: [PATCH 43/43] Federation DB Changes. - Creating an activity table. - Adding some federation-related columns to the user_ and community tables. - Generating the actor_id and keys in code, updating the tables. --- server/Cargo.lock | 1 + server/Cargo.toml | 1 + .../down.sql | 16 + .../up.sql | 36 ++ server/src/api/community.rs | 20 + server/src/api/user.rs | 37 +- server/src/apub/mod.rs | 27 +- server/src/db/code_migrations.rs | 101 ++++ server/src/db/comment.rs | 11 + server/src/db/comment_view.rs | 11 + server/src/db/community.rs | 26 + server/src/db/mod.rs | 1 + server/src/db/moderator.rs | 17 + server/src/db/password_reset_request.rs | 6 + server/src/db/post.rs | 11 + server/src/db/post_view.rs | 11 + server/src/db/private_message.rs | 12 + server/src/db/user.rs | 25 + server/src/db/user_mention.rs | 17 + server/src/lib.rs | 1 + server/src/main.rs | 2 + server/src/schema.rs | 488 +++++++++--------- 22 files changed, 643 insertions(+), 235 deletions(-) create mode 100644 server/migrations/2020-03-26-192410_add_activitypub_tables/down.sql create mode 100644 server/migrations/2020-03-26-192410_add_activitypub_tables/up.sql create mode 100644 server/src/db/code_migrations.rs diff --git a/server/Cargo.lock b/server/Cargo.lock index ceb09b75..025d40a5 100644 --- a/server/Cargo.lock +++ b/server/Cargo.lock @@ -1545,6 +1545,7 @@ dependencies = [ "lettre", "lettre_email", "log", + "openssl", "percent-encoding", "rand 0.7.3", "regex 1.3.6", diff --git a/server/Cargo.toml b/server/Cargo.toml index 1455428d..d94d5640 100644 --- a/server/Cargo.toml +++ b/server/Cargo.toml @@ -38,3 +38,4 @@ url = "2.1.1" percent-encoding = "2.1.0" isahc = "0.9" comrak = "0.7" +openssl = "0.10" diff --git a/server/migrations/2020-03-26-192410_add_activitypub_tables/down.sql b/server/migrations/2020-03-26-192410_add_activitypub_tables/down.sql new file mode 100644 index 00000000..b1710623 --- /dev/null +++ b/server/migrations/2020-03-26-192410_add_activitypub_tables/down.sql @@ -0,0 +1,16 @@ +drop table activity; + +alter table user_ +drop column actor_id, +drop column private_key, +drop column public_key, +drop column bio, +drop column local, +drop column last_refreshed_at; + +alter table community +drop column actor_id, +drop column private_key, +drop column public_key, +drop column local, +drop column last_refreshed_at; diff --git a/server/migrations/2020-03-26-192410_add_activitypub_tables/up.sql b/server/migrations/2020-03-26-192410_add_activitypub_tables/up.sql new file mode 100644 index 00000000..8fe3b8ed --- /dev/null +++ b/server/migrations/2020-03-26-192410_add_activitypub_tables/up.sql @@ -0,0 +1,36 @@ +-- The Activitypub activity table +-- All user actions must create a row here. +create table activity ( + id serial primary key, + user_id int references user_ on update cascade on delete cascade not null, -- Ensures that the user is set up here. + data jsonb not null, + local boolean not null default true, + published timestamp not null default now(), + updated timestamp +); + +-- Making sure that id is unique +create unique index idx_activity_unique_apid on activity ((data ->> 'id'::text)); + +-- Add federation columns to the two actor tables +alter table user_ +-- TODO uniqueness constraints should be added on these 3 columns later +add column actor_id character varying(255) not null default 'changeme', -- This needs to be checked and updated in code, building from the site url if local +add column bio text, -- not on community, already has description +add column local boolean not null default true, +add column private_key text, -- These need to be generated from code +add column public_key text, +add column last_refreshed_at timestamp not null default now() -- Used to re-fetch federated actor periodically +; + +-- Community +alter table community +add column actor_id character varying(255) not null default 'changeme', -- This needs to be checked and updated in code, building from the site url if local +add column local boolean not null default true, +add column private_key text, -- These need to be generated from code +add column public_key text, +add column last_refreshed_at timestamp not null default now() -- Used to re-fetch federated actor periodically +; + +-- Don't worry about rebuilding the views right now. + diff --git a/server/src/api/community.rs b/server/src/api/community.rs index dac8733b..e81f3be0 100644 --- a/server/src/api/community.rs +++ b/server/src/api/community.rs @@ -1,5 +1,6 @@ use super::*; use crate::apub::puller::{get_all_communities, get_remote_community}; +use crate::apub::{gen_keypair_str, make_apub_endpoint, EndpointType}; use crate::settings::Settings; use diesel::PgConnection; use std::str::FromStr; @@ -208,6 +209,8 @@ impl Perform for Oper { } // When you create a community, make sure the user becomes a moderator and a follower + let (community_public_key, community_private_key) = gen_keypair_str(); + let community_form = CommunityForm { name: data.name.to_owned(), title: data.title.to_owned(), @@ -218,6 +221,11 @@ impl Perform for Oper { deleted: None, nsfw: data.nsfw, updated: None, + actor_id: make_apub_endpoint(EndpointType::Community, &data.name).to_string(), + local: true, + private_key: Some(community_private_key), + public_key: Some(community_public_key), + last_refreshed_at: None, }; let inserted_community = match Community::create(&conn, &community_form) { @@ -298,6 +306,8 @@ impl Perform for Oper { return Err(APIError::err("no_community_edit_allowed").into()); } + let read_community = Community::read(&conn, data.edit_id)?; + let community_form = CommunityForm { name: data.name.to_owned(), title: data.title.to_owned(), @@ -308,6 +318,11 @@ impl Perform for Oper { deleted: data.deleted.to_owned(), nsfw: data.nsfw, updated: Some(naive_now()), + actor_id: read_community.actor_id, + local: read_community.local, + private_key: read_community.private_key, + public_key: read_community.public_key, + last_refreshed_at: None, }; let _updated_community = match Community::update(&conn, data.edit_id, &community_form) { @@ -571,6 +586,11 @@ impl Perform for Oper { deleted: None, nsfw: read_community.nsfw, updated: Some(naive_now()), + actor_id: read_community.actor_id, + local: read_community.local, + private_key: read_community.private_key, + public_key: read_community.public_key, + last_refreshed_at: None, }; let _updated_community = match Community::update(&conn, data.community_id, &community_form) { diff --git a/server/src/api/user.rs b/server/src/api/user.rs index 056a2a84..59a3d623 100644 --- a/server/src/api/user.rs +++ b/server/src/api/user.rs @@ -1,4 +1,5 @@ use super::*; +use crate::apub::{gen_keypair_str, make_apub_endpoint, EndpointType}; use crate::settings::Settings; use crate::{generate_random_string, send_email}; use bcrypt::verify; @@ -250,6 +251,8 @@ impl Perform for Oper { return Err(APIError::err("admin_already_created").into()); } + let (user_public_key, user_private_key) = gen_keypair_str(); + // Register the new user let user_form = UserForm { name: data.username.to_owned(), @@ -269,6 +272,12 @@ impl Perform for Oper { lang: "browser".into(), show_avatars: true, send_notifications_to_email: false, + actor_id: make_apub_endpoint(EndpointType::User, &data.username).to_string(), + bio: None, + local: true, + private_key: Some(user_private_key), + public_key: Some(user_public_key), + last_refreshed_at: None, }; // Create the user @@ -287,12 +296,15 @@ impl Perform for Oper { } }; + let (community_public_key, community_private_key) = gen_keypair_str(); + // Create the main community if it doesn't exist let main_community: Community = match Community::read(&conn, 2) { Ok(c) => c, Err(_e) => { + let default_community_name = "main"; let community_form = CommunityForm { - name: "main".to_string(), + name: default_community_name.to_string(), title: "The Default Community".to_string(), description: Some("The Default Community".to_string()), category_id: 1, @@ -301,6 +313,11 @@ impl Perform for Oper { removed: None, deleted: None, updated: None, + actor_id: make_apub_endpoint(EndpointType::Community, default_community_name).to_string(), + local: true, + private_key: Some(community_private_key), + public_key: Some(community_public_key), + last_refreshed_at: None, }; Community::create(&conn, &community_form).unwrap() } @@ -403,6 +420,12 @@ impl Perform for Oper { lang: data.lang.to_owned(), show_avatars: data.show_avatars, send_notifications_to_email: data.send_notifications_to_email, + actor_id: read_user.actor_id, + bio: read_user.bio, + local: read_user.local, + private_key: read_user.private_key, + public_key: read_user.public_key, + last_refreshed_at: None, }; let updated_user = match User_::update(&conn, user_id, &user_form) { @@ -561,6 +584,12 @@ impl Perform for Oper { lang: read_user.lang, show_avatars: read_user.show_avatars, send_notifications_to_email: read_user.send_notifications_to_email, + actor_id: read_user.actor_id, + bio: read_user.bio, + local: read_user.local, + private_key: read_user.private_key, + public_key: read_user.public_key, + last_refreshed_at: None, }; match User_::update(&conn, data.user_id, &user_form) { @@ -624,6 +653,12 @@ impl Perform for Oper { lang: read_user.lang, show_avatars: read_user.show_avatars, send_notifications_to_email: read_user.send_notifications_to_email, + actor_id: read_user.actor_id, + bio: read_user.bio, + local: read_user.local, + private_key: read_user.private_key, + public_key: read_user.public_key, + last_refreshed_at: None, }; match User_::update(&conn, data.user_id, &user_form) { diff --git a/server/src/apub/mod.rs b/server/src/apub/mod.rs index ed6ac656..661c2026 100644 --- a/server/src/apub/mod.rs +++ b/server/src/apub/mod.rs @@ -3,6 +3,7 @@ pub mod post; pub mod puller; pub mod user; use crate::Settings; +use openssl::{pkey::PKey, rsa::Rsa}; use actix_web::body::Body; use actix_web::HttpResponse; @@ -17,13 +18,13 @@ where .json(json) } -enum EndpointType { +pub enum EndpointType { Community, User, Post, } -fn make_apub_endpoint(endpoint_type: EndpointType, name: &str) -> Url { +pub fn make_apub_endpoint(endpoint_type: EndpointType, name: &str) -> Url { let point = match endpoint_type { EndpointType::Community => "c", EndpointType::User => "u", @@ -47,3 +48,25 @@ pub fn get_apub_protocol_string() -> &'static str { "http" } } + +pub fn gen_keypair() -> (Vec, Vec) { + let rsa = Rsa::generate(2048).expect("sign::gen_keypair: key generation error"); + let pkey = PKey::from_rsa(rsa).expect("sign::gen_keypair: parsing error"); + ( + pkey + .public_key_to_pem() + .expect("sign::gen_keypair: public key encoding error"), + pkey + .private_key_to_pem_pkcs8() + .expect("sign::gen_keypair: private key encoding error"), + ) +} + +pub fn gen_keypair_str() -> (String, String) { + let (public_key, private_key) = gen_keypair(); + (vec_bytes_to_str(public_key), vec_bytes_to_str(private_key)) +} + +fn vec_bytes_to_str(bytes: Vec) -> String { + String::from_utf8_lossy(&bytes).into_owned() +} diff --git a/server/src/db/code_migrations.rs b/server/src/db/code_migrations.rs new file mode 100644 index 00000000..e0c736e1 --- /dev/null +++ b/server/src/db/code_migrations.rs @@ -0,0 +1,101 @@ +// This is for db migrations that require code +use super::community::{Community, CommunityForm}; +use super::user::{UserForm, User_}; +use super::*; +use crate::apub::{gen_keypair_str, make_apub_endpoint, EndpointType}; +use crate::naive_now; +use log::info; + +pub fn run_advanced_migrations(conn: &PgConnection) -> Result<(), Error> { + user_updates_2020_04_02(conn)?; + community_updates_2020_04_02(conn)?; + + Ok(()) +} + +fn user_updates_2020_04_02(conn: &PgConnection) -> Result<(), Error> { + use crate::schema::user_::dsl::*; + + info!("Running user_updates_2020_04_02"); + + // Update the actor_id, private_key, and public_key, last_refreshed_at + let incorrect_users = user_ + .filter(actor_id.eq("changeme")) + .filter(local.eq(true)) + .load::(conn)?; + + for cuser in &incorrect_users { + let (user_public_key, user_private_key) = gen_keypair_str(); + + let form = UserForm { + name: cuser.name.to_owned(), + fedi_name: cuser.fedi_name.to_owned(), + email: cuser.email.to_owned(), + matrix_user_id: cuser.matrix_user_id.to_owned(), + avatar: cuser.avatar.to_owned(), + password_encrypted: cuser.password_encrypted.to_owned(), + preferred_username: cuser.preferred_username.to_owned(), + updated: None, + admin: cuser.admin, + banned: cuser.banned, + show_nsfw: cuser.show_nsfw, + theme: cuser.theme.to_owned(), + default_sort_type: cuser.default_sort_type, + default_listing_type: cuser.default_listing_type, + lang: cuser.lang.to_owned(), + show_avatars: cuser.show_avatars, + send_notifications_to_email: cuser.send_notifications_to_email, + actor_id: make_apub_endpoint(EndpointType::User, &cuser.name).to_string(), + bio: cuser.bio.to_owned(), + local: cuser.local, + private_key: Some(user_private_key), + public_key: Some(user_public_key), + last_refreshed_at: Some(naive_now()), + }; + + User_::update(&conn, cuser.id, &form)?; + } + + info!("{} user rows updated.", incorrect_users.len()); + + Ok(()) +} + +fn community_updates_2020_04_02(conn: &PgConnection) -> Result<(), Error> { + use crate::schema::community::dsl::*; + + info!("Running community_updates_2020_04_02"); + + // Update the actor_id, private_key, and public_key, last_refreshed_at + let incorrect_communities = community + .filter(actor_id.eq("changeme")) + .filter(local.eq(true)) + .load::(conn)?; + + for ccommunity in &incorrect_communities { + let (community_public_key, community_private_key) = gen_keypair_str(); + + let form = CommunityForm { + name: ccommunity.name.to_owned(), + title: ccommunity.title.to_owned(), + description: ccommunity.description.to_owned(), + category_id: ccommunity.category_id, + creator_id: ccommunity.creator_id, + removed: None, + deleted: None, + nsfw: ccommunity.nsfw, + updated: None, + actor_id: make_apub_endpoint(EndpointType::Community, &ccommunity.name).to_string(), + local: ccommunity.local, + private_key: Some(community_private_key), + public_key: Some(community_public_key), + last_refreshed_at: Some(naive_now()), + }; + + Community::update(&conn, ccommunity.id, &form)?; + } + + info!("{} community rows updated.", incorrect_communities.len()); + + Ok(()) +} diff --git a/server/src/db/comment.rs b/server/src/db/comment.rs index c9bfbac6..8110fc5b 100644 --- a/server/src/db/comment.rs +++ b/server/src/db/comment.rs @@ -186,6 +186,12 @@ mod tests { lang: "browser".into(), show_avatars: true, send_notifications_to_email: false, + actor_id: "changeme".into(), + bio: None, + local: true, + private_key: None, + public_key: None, + last_refreshed_at: None, }; let inserted_user = User_::create(&conn, &new_user).unwrap(); @@ -200,6 +206,11 @@ mod tests { deleted: None, updated: None, nsfw: false, + actor_id: "changeme".into(), + local: true, + private_key: None, + public_key: None, + last_refreshed_at: None, }; let inserted_community = Community::create(&conn, &new_community).unwrap(); diff --git a/server/src/db/comment_view.rs b/server/src/db/comment_view.rs index 85b41d82..97c03c53 100644 --- a/server/src/db/comment_view.rs +++ b/server/src/db/comment_view.rs @@ -450,6 +450,12 @@ mod tests { lang: "browser".into(), show_avatars: true, send_notifications_to_email: false, + actor_id: "changeme".into(), + bio: None, + local: true, + private_key: None, + public_key: None, + last_refreshed_at: None, }; let inserted_user = User_::create(&conn, &new_user).unwrap(); @@ -464,6 +470,11 @@ mod tests { deleted: None, updated: None, nsfw: false, + actor_id: "changeme".into(), + local: true, + private_key: None, + public_key: None, + last_refreshed_at: None, }; let inserted_community = Community::create(&conn, &new_community).unwrap(); diff --git a/server/src/db/community.rs b/server/src/db/community.rs index 63500963..ff578224 100644 --- a/server/src/db/community.rs +++ b/server/src/db/community.rs @@ -15,6 +15,11 @@ pub struct Community { pub updated: Option, pub deleted: bool, pub nsfw: bool, + pub actor_id: String, + pub local: bool, + pub private_key: Option, + pub public_key: Option, + pub last_refreshed_at: chrono::NaiveDateTime, } #[derive(Insertable, AsChangeset, Clone, Serialize, Deserialize)] @@ -29,6 +34,11 @@ pub struct CommunityForm { pub updated: Option, pub deleted: Option, pub nsfw: bool, + pub actor_id: String, + pub local: bool, + pub private_key: Option, + pub public_key: Option, + pub last_refreshed_at: Option, } impl Crud for Community { @@ -232,6 +242,12 @@ mod tests { lang: "browser".into(), show_avatars: true, send_notifications_to_email: false, + actor_id: "changeme".into(), + bio: None, + local: true, + private_key: None, + public_key: None, + last_refreshed_at: None, }; let inserted_user = User_::create(&conn, &new_user).unwrap(); @@ -246,6 +262,11 @@ mod tests { removed: None, deleted: None, updated: None, + actor_id: "changeme".into(), + local: true, + private_key: None, + public_key: None, + last_refreshed_at: None, }; let inserted_community = Community::create(&conn, &new_community).unwrap(); @@ -262,6 +283,11 @@ mod tests { deleted: false, published: inserted_community.published, updated: None, + actor_id: "changeme".into(), + local: true, + private_key: None, + public_key: None, + last_refreshed_at: inserted_community.published, }; let community_follower_form = CommunityFollowerForm { diff --git a/server/src/db/mod.rs b/server/src/db/mod.rs index e0d358ff..f434f728 100644 --- a/server/src/db/mod.rs +++ b/server/src/db/mod.rs @@ -5,6 +5,7 @@ use diesel::*; use serde::{Deserialize, Serialize}; pub mod category; +pub mod code_migrations; pub mod comment; pub mod comment_view; pub mod community; diff --git a/server/src/db/moderator.rs b/server/src/db/moderator.rs index a8c3df4f..b01dc5cc 100644 --- a/server/src/db/moderator.rs +++ b/server/src/db/moderator.rs @@ -454,6 +454,12 @@ mod tests { lang: "browser".into(), show_avatars: true, send_notifications_to_email: false, + actor_id: "changeme".into(), + bio: None, + local: true, + private_key: None, + public_key: None, + last_refreshed_at: None, }; let inserted_mod = User_::create(&conn, &new_mod).unwrap(); @@ -476,6 +482,12 @@ mod tests { lang: "browser".into(), show_avatars: true, send_notifications_to_email: false, + actor_id: "changeme".into(), + bio: None, + local: true, + private_key: None, + public_key: None, + last_refreshed_at: None, }; let inserted_user = User_::create(&conn, &new_user).unwrap(); @@ -490,6 +502,11 @@ mod tests { deleted: None, updated: None, nsfw: false, + actor_id: "changeme".into(), + local: true, + private_key: None, + public_key: None, + last_refreshed_at: None, }; let inserted_community = Community::create(&conn, &new_community).unwrap(); diff --git a/server/src/db/password_reset_request.rs b/server/src/db/password_reset_request.rs index 6951fd39..c9d18e1c 100644 --- a/server/src/db/password_reset_request.rs +++ b/server/src/db/password_reset_request.rs @@ -104,6 +104,12 @@ mod tests { lang: "browser".into(), show_avatars: true, send_notifications_to_email: false, + actor_id: "changeme".into(), + bio: None, + local: true, + private_key: None, + public_key: None, + last_refreshed_at: None, }; let inserted_user = User_::create(&conn, &new_user).unwrap(); diff --git a/server/src/db/post.rs b/server/src/db/post.rs index ffde14d3..bf9a9ad7 100644 --- a/server/src/db/post.rs +++ b/server/src/db/post.rs @@ -207,6 +207,12 @@ mod tests { lang: "browser".into(), show_avatars: true, send_notifications_to_email: false, + actor_id: "changeme".into(), + bio: None, + local: true, + private_key: None, + public_key: None, + last_refreshed_at: None, }; let inserted_user = User_::create(&conn, &new_user).unwrap(); @@ -221,6 +227,11 @@ mod tests { deleted: None, updated: None, nsfw: false, + actor_id: "changeme".into(), + local: true, + private_key: None, + public_key: None, + last_refreshed_at: None, }; let inserted_community = Community::create(&conn, &new_community).unwrap(); diff --git a/server/src/db/post_view.rs b/server/src/db/post_view.rs index f48f4f68..587ae52b 100644 --- a/server/src/db/post_view.rs +++ b/server/src/db/post_view.rs @@ -375,6 +375,12 @@ mod tests { lang: "browser".into(), show_avatars: true, send_notifications_to_email: false, + actor_id: "changeme".into(), + bio: None, + local: true, + private_key: None, + public_key: None, + last_refreshed_at: None, }; let inserted_user = User_::create(&conn, &new_user).unwrap(); @@ -389,6 +395,11 @@ mod tests { deleted: None, updated: None, nsfw: false, + actor_id: "changeme".into(), + local: true, + private_key: None, + public_key: None, + last_refreshed_at: None, }; let inserted_community = Community::create(&conn, &new_community).unwrap(); diff --git a/server/src/db/private_message.rs b/server/src/db/private_message.rs index cc073b59..18ec4963 100644 --- a/server/src/db/private_message.rs +++ b/server/src/db/private_message.rs @@ -81,6 +81,12 @@ mod tests { lang: "browser".into(), show_avatars: true, send_notifications_to_email: false, + actor_id: "changeme".into(), + bio: None, + local: true, + private_key: None, + public_key: None, + last_refreshed_at: None, }; let inserted_creator = User_::create(&conn, &creator_form).unwrap(); @@ -103,6 +109,12 @@ mod tests { lang: "browser".into(), show_avatars: true, send_notifications_to_email: false, + actor_id: "changeme".into(), + bio: None, + local: true, + private_key: None, + public_key: None, + last_refreshed_at: None, }; let inserted_recipient = User_::create(&conn, &recipient_form).unwrap(); diff --git a/server/src/db/user.rs b/server/src/db/user.rs index e7c76965..32596c27 100644 --- a/server/src/db/user.rs +++ b/server/src/db/user.rs @@ -27,6 +27,12 @@ pub struct User_ { pub show_avatars: bool, pub send_notifications_to_email: bool, pub matrix_user_id: Option, + pub actor_id: String, + pub bio: Option, + pub local: bool, + pub private_key: Option, + pub public_key: Option, + pub last_refreshed_at: chrono::NaiveDateTime, } #[derive(Insertable, AsChangeset, Clone)] @@ -49,6 +55,12 @@ pub struct UserForm { pub show_avatars: bool, pub send_notifications_to_email: bool, pub matrix_user_id: Option, + pub actor_id: String, + pub bio: Option, + pub local: bool, + pub private_key: Option, + pub public_key: Option, + pub last_refreshed_at: Option, } impl Crud for User_ { @@ -78,6 +90,7 @@ impl User_ { Self::create(&conn, &edited_user) } + // TODO do more individual updates like these pub fn update_password( conn: &PgConnection, user_id: i32, @@ -202,6 +215,12 @@ mod tests { lang: "browser".into(), show_avatars: true, send_notifications_to_email: false, + actor_id: "changeme".into(), + bio: None, + local: true, + private_key: None, + public_key: None, + last_refreshed_at: None, }; let inserted_user = User_::create(&conn, &new_user).unwrap(); @@ -226,6 +245,12 @@ mod tests { lang: "browser".into(), show_avatars: true, send_notifications_to_email: false, + actor_id: "changeme".into(), + bio: None, + local: true, + private_key: None, + public_key: None, + last_refreshed_at: inserted_user.published, }; let read_user = User_::read(&conn, inserted_user.id).unwrap(); diff --git a/server/src/db/user_mention.rs b/server/src/db/user_mention.rs index 0cf25795..48814c89 100644 --- a/server/src/db/user_mention.rs +++ b/server/src/db/user_mention.rs @@ -80,6 +80,12 @@ mod tests { lang: "browser".into(), show_avatars: true, send_notifications_to_email: false, + actor_id: "changeme".into(), + bio: None, + local: true, + private_key: None, + public_key: None, + last_refreshed_at: None, }; let inserted_user = User_::create(&conn, &new_user).unwrap(); @@ -102,6 +108,12 @@ mod tests { lang: "browser".into(), show_avatars: true, send_notifications_to_email: false, + actor_id: "changeme".into(), + bio: None, + local: true, + private_key: None, + public_key: None, + last_refreshed_at: None, }; let inserted_recipient = User_::create(&conn, &recipient_form).unwrap(); @@ -116,6 +128,11 @@ mod tests { deleted: None, updated: None, nsfw: false, + actor_id: "changeme".into(), + local: true, + private_key: None, + public_key: None, + last_refreshed_at: None, }; let inserted_community = Community::create(&conn, &new_community).unwrap(); diff --git a/server/src/lib.rs b/server/src/lib.rs index 9f882b7f..e45311ee 100644 --- a/server/src/lib.rs +++ b/server/src/lib.rs @@ -17,6 +17,7 @@ pub extern crate jsonwebtoken; pub extern crate lettre; pub extern crate lettre_email; extern crate log; +pub extern crate openssl; pub extern crate rand; pub extern crate regex; pub extern crate rss; diff --git a/server/src/main.rs b/server/src/main.rs index 601c2e0d..f2a19d30 100644 --- a/server/src/main.rs +++ b/server/src/main.rs @@ -6,6 +6,7 @@ use actix::prelude::*; use actix_web::*; use diesel::r2d2::{ConnectionManager, Pool}; use diesel::PgConnection; +use lemmy_server::db::code_migrations::run_advanced_migrations; use lemmy_server::routes::{api, federation, feeds, index, nodeinfo, webfinger, websocket}; use lemmy_server::settings::Settings; use lemmy_server::websocket::server::*; @@ -28,6 +29,7 @@ async fn main() -> io::Result<()> { // Run the migrations from code let conn = pool.get().unwrap(); embedded_migrations::run(&conn).unwrap(); + run_advanced_migrations(&conn).unwrap(); // Set up websocket server let server = ChatServer::startup(pool.clone()).start(); diff --git a/server/src/schema.rs b/server/src/schema.rs index d9449fef..41769ded 100644 --- a/server/src/schema.rs +++ b/server/src/schema.rs @@ -1,316 +1,339 @@ table! { - category (id) { - id -> Int4, - name -> Varchar, - } + activity (id) { + id -> Int4, + user_id -> Int4, + data -> Jsonb, + local -> Bool, + published -> Timestamp, + updated -> Nullable, + } } table! { - comment (id) { - id -> Int4, - creator_id -> Int4, - post_id -> Int4, - parent_id -> Nullable, - content -> Text, - removed -> Bool, - read -> Bool, - published -> Timestamp, - updated -> Nullable, - deleted -> Bool, - } + category (id) { + id -> Int4, + name -> Varchar, + } } table! { - comment_like (id) { - id -> Int4, - user_id -> Int4, - comment_id -> Int4, - post_id -> Int4, - score -> Int2, - published -> Timestamp, - } + comment (id) { + id -> Int4, + creator_id -> Int4, + post_id -> Int4, + parent_id -> Nullable, + content -> Text, + removed -> Bool, + read -> Bool, + published -> Timestamp, + updated -> Nullable, + deleted -> Bool, + } } table! { - comment_saved (id) { - id -> Int4, - comment_id -> Int4, - user_id -> Int4, - published -> Timestamp, - } + comment_like (id) { + id -> Int4, + user_id -> Int4, + comment_id -> Int4, + post_id -> Int4, + score -> Int2, + published -> Timestamp, + } } table! { - community (id) { - id -> Int4, - name -> Varchar, - title -> Varchar, - description -> Nullable, - category_id -> Int4, - creator_id -> Int4, - removed -> Bool, - published -> Timestamp, - updated -> Nullable, - deleted -> Bool, - nsfw -> Bool, - } + comment_saved (id) { + id -> Int4, + comment_id -> Int4, + user_id -> Int4, + published -> Timestamp, + } } table! { - community_follower (id) { - id -> Int4, - community_id -> Int4, - user_id -> Int4, - published -> Timestamp, - } + community (id) { + id -> Int4, + name -> Varchar, + title -> Varchar, + description -> Nullable, + category_id -> Int4, + creator_id -> Int4, + removed -> Bool, + published -> Timestamp, + updated -> Nullable, + deleted -> Bool, + nsfw -> Bool, + actor_id -> Varchar, + local -> Bool, + private_key -> Nullable, + public_key -> Nullable, + last_refreshed_at -> Timestamp, + } } table! { - community_moderator (id) { - id -> Int4, - community_id -> Int4, - user_id -> Int4, - published -> Timestamp, - } + community_follower (id) { + id -> Int4, + community_id -> Int4, + user_id -> Int4, + published -> Timestamp, + } } table! { - community_user_ban (id) { - id -> Int4, - community_id -> Int4, - user_id -> Int4, - published -> Timestamp, - } + community_moderator (id) { + id -> Int4, + community_id -> Int4, + user_id -> Int4, + published -> Timestamp, + } } table! { - mod_add (id) { - id -> Int4, - mod_user_id -> Int4, - other_user_id -> Int4, - removed -> Nullable, - when_ -> Timestamp, - } + community_user_ban (id) { + id -> Int4, + community_id -> Int4, + user_id -> Int4, + published -> Timestamp, + } } table! { - mod_add_community (id) { - id -> Int4, - mod_user_id -> Int4, - other_user_id -> Int4, - community_id -> Int4, - removed -> Nullable, - when_ -> Timestamp, - } + mod_add (id) { + id -> Int4, + mod_user_id -> Int4, + other_user_id -> Int4, + removed -> Nullable, + when_ -> Timestamp, + } } table! { - mod_ban (id) { - id -> Int4, - mod_user_id -> Int4, - other_user_id -> Int4, - reason -> Nullable, - banned -> Nullable, - expires -> Nullable, - when_ -> Timestamp, - } + mod_add_community (id) { + id -> Int4, + mod_user_id -> Int4, + other_user_id -> Int4, + community_id -> Int4, + removed -> Nullable, + when_ -> Timestamp, + } } table! { - mod_ban_from_community (id) { - id -> Int4, - mod_user_id -> Int4, - other_user_id -> Int4, - community_id -> Int4, - reason -> Nullable, - banned -> Nullable, - expires -> Nullable, - when_ -> Timestamp, - } + mod_ban (id) { + id -> Int4, + mod_user_id -> Int4, + other_user_id -> Int4, + reason -> Nullable, + banned -> Nullable, + expires -> Nullable, + when_ -> Timestamp, + } } table! { - mod_lock_post (id) { - id -> Int4, - mod_user_id -> Int4, - post_id -> Int4, - locked -> Nullable, - when_ -> Timestamp, - } + mod_ban_from_community (id) { + id -> Int4, + mod_user_id -> Int4, + other_user_id -> Int4, + community_id -> Int4, + reason -> Nullable, + banned -> Nullable, + expires -> Nullable, + when_ -> Timestamp, + } } table! { - mod_remove_comment (id) { - id -> Int4, - mod_user_id -> Int4, - comment_id -> Int4, - reason -> Nullable, - removed -> Nullable, - when_ -> Timestamp, - } + mod_lock_post (id) { + id -> Int4, + mod_user_id -> Int4, + post_id -> Int4, + locked -> Nullable, + when_ -> Timestamp, + } } table! { - mod_remove_community (id) { - id -> Int4, - mod_user_id -> Int4, - community_id -> Int4, - reason -> Nullable, - removed -> Nullable, - expires -> Nullable, - when_ -> Timestamp, - } + mod_remove_comment (id) { + id -> Int4, + mod_user_id -> Int4, + comment_id -> Int4, + reason -> Nullable, + removed -> Nullable, + when_ -> Timestamp, + } } table! { - mod_remove_post (id) { - id -> Int4, - mod_user_id -> Int4, - post_id -> Int4, - reason -> Nullable, - removed -> Nullable, - when_ -> Timestamp, - } + mod_remove_community (id) { + id -> Int4, + mod_user_id -> Int4, + community_id -> Int4, + reason -> Nullable, + removed -> Nullable, + expires -> Nullable, + when_ -> Timestamp, + } } table! { - mod_sticky_post (id) { - id -> Int4, - mod_user_id -> Int4, - post_id -> Int4, - stickied -> Nullable, - when_ -> Timestamp, - } + mod_remove_post (id) { + id -> Int4, + mod_user_id -> Int4, + post_id -> Int4, + reason -> Nullable, + removed -> Nullable, + when_ -> Timestamp, + } } table! { - password_reset_request (id) { - id -> Int4, - user_id -> Int4, - token_encrypted -> Text, - published -> Timestamp, - } + mod_sticky_post (id) { + id -> Int4, + mod_user_id -> Int4, + post_id -> Int4, + stickied -> Nullable, + when_ -> Timestamp, + } } table! { - post (id) { - id -> Int4, - name -> Varchar, - url -> Nullable, - body -> Nullable, - creator_id -> Int4, - community_id -> Int4, - removed -> Bool, - locked -> Bool, - published -> Timestamp, - updated -> Nullable, - deleted -> Bool, - nsfw -> Bool, - stickied -> Bool, - embed_title -> Nullable, - embed_description -> Nullable, - embed_html -> Nullable, - thumbnail_url -> Nullable, - } + password_reset_request (id) { + id -> Int4, + user_id -> Int4, + token_encrypted -> Text, + published -> Timestamp, + } } table! { - post_like (id) { - id -> Int4, - post_id -> Int4, - user_id -> Int4, - score -> Int2, - published -> Timestamp, - } + post (id) { + id -> Int4, + name -> Varchar, + url -> Nullable, + body -> Nullable, + creator_id -> Int4, + community_id -> Int4, + removed -> Bool, + locked -> Bool, + published -> Timestamp, + updated -> Nullable, + deleted -> Bool, + nsfw -> Bool, + stickied -> Bool, + embed_title -> Nullable, + embed_description -> Nullable, + embed_html -> Nullable, + thumbnail_url -> Nullable, + } } table! { - post_read (id) { - id -> Int4, - post_id -> Int4, - user_id -> Int4, - published -> Timestamp, - } + post_like (id) { + id -> Int4, + post_id -> Int4, + user_id -> Int4, + score -> Int2, + published -> Timestamp, + } } table! { - post_saved (id) { - id -> Int4, - post_id -> Int4, - user_id -> Int4, - published -> Timestamp, - } + post_read (id) { + id -> Int4, + post_id -> Int4, + user_id -> Int4, + published -> Timestamp, + } } table! { - private_message (id) { - id -> Int4, - creator_id -> Int4, - recipient_id -> Int4, - content -> Text, - deleted -> Bool, - read -> Bool, - published -> Timestamp, - updated -> Nullable, - } + post_saved (id) { + id -> Int4, + post_id -> Int4, + user_id -> Int4, + published -> Timestamp, + } } table! { - site (id) { - id -> Int4, - name -> Varchar, - description -> Nullable, - creator_id -> Int4, - published -> Timestamp, - updated -> Nullable, - enable_downvotes -> Bool, - open_registration -> Bool, - enable_nsfw -> Bool, - } + private_message (id) { + id -> Int4, + creator_id -> Int4, + recipient_id -> Int4, + content -> Text, + deleted -> Bool, + read -> Bool, + published -> Timestamp, + updated -> Nullable, + } } table! { - user_ (id) { - id -> Int4, - name -> Varchar, - fedi_name -> Varchar, - preferred_username -> Nullable, - password_encrypted -> Text, - email -> Nullable, - avatar -> Nullable, - admin -> Bool, - banned -> Bool, - published -> Timestamp, - updated -> Nullable, - show_nsfw -> Bool, - theme -> Varchar, - default_sort_type -> Int2, - default_listing_type -> Int2, - lang -> Varchar, - show_avatars -> Bool, - send_notifications_to_email -> Bool, - matrix_user_id -> Nullable, - } + site (id) { + id -> Int4, + name -> Varchar, + description -> Nullable, + creator_id -> Int4, + published -> Timestamp, + updated -> Nullable, + enable_downvotes -> Bool, + open_registration -> Bool, + enable_nsfw -> Bool, + } } table! { - user_ban (id) { - id -> Int4, - user_id -> Int4, - published -> Timestamp, - } + user_ (id) { + id -> Int4, + name -> Varchar, + fedi_name -> Varchar, + preferred_username -> Nullable, + password_encrypted -> Text, + email -> Nullable, + avatar -> Nullable, + admin -> Bool, + banned -> Bool, + published -> Timestamp, + updated -> Nullable, + show_nsfw -> Bool, + theme -> Varchar, + default_sort_type -> Int2, + default_listing_type -> Int2, + lang -> Varchar, + show_avatars -> Bool, + send_notifications_to_email -> Bool, + matrix_user_id -> Nullable, + actor_id -> Varchar, + bio -> Nullable, + local -> Bool, + private_key -> Nullable, + public_key -> Nullable, + last_refreshed_at -> Timestamp, + } } table! { - user_mention (id) { - id -> Int4, - recipient_id -> Int4, - comment_id -> Int4, - read -> Bool, - published -> Timestamp, - } + user_ban (id) { + id -> Int4, + user_id -> Int4, + published -> Timestamp, + } } +table! { + user_mention (id) { + id -> Int4, + recipient_id -> Int4, + comment_id -> Int4, + read -> Bool, + published -> Timestamp, + } +} + +joinable!(activity -> user_ (user_id)); joinable!(comment -> post (post_id)); joinable!(comment -> user_ (creator_id)); joinable!(comment_like -> comment (comment_id)); @@ -353,6 +376,7 @@ joinable!(user_mention -> comment (comment_id)); joinable!(user_mention -> user_ (recipient_id)); allow_tables_to_appear_in_same_query!( + activity, category, comment, comment_like,