Compare commits
2 commits
master
...
drop-picts
Author | SHA1 | Date | |
---|---|---|---|
a1a8a2d0b4 | |||
2491a8022c |
68 changed files with 1365 additions and 1080 deletions
2
CODE_OF_CONDUCT.md
vendored
2
CODE_OF_CONDUCT.md
vendored
|
@ -30,6 +30,6 @@ In the Lemmy community we strive to go the extra step to look out for each other
|
|||
|
||||
And if someone takes issue with something you said or did, resist the urge to be defensive. Just stop doing what it was they complained about and apologize. Even if you feel you were misinterpreted or unfairly accused, chances are good there was something you could’ve communicated better — remember that it’s your responsibility to make others comfortable. Everyone wants to get along and we are all here first and foremost because we want to talk about cool technology. You will find that people will be eager to assume good intent and forgive as long as you earn their trust.
|
||||
|
||||
The enforcement policies listed above apply to all official Lemmy venues; including git repositories under [github.com/LemmyNet/lemmy](https://github.com/LemmyNet/lemmy) and [yerbamate.dev/LemmyNet/lemmy](https://yerbamate.dev/LemmyNet/lemmy), the [Matrix channel](https://matrix.to/#/!BZVTUuEiNmRcbFeLeI:matrix.org?via=matrix.org&via=privacytools.io&via=permaweb.io); and all instances under lemmy.ml. For other projects adopting the Rust Code of Conduct, please contact the maintainers of those projects for enforcement. If you wish to use this code of conduct for your own project, consider explicitly mentioning your moderation policy or making a copy with your own moderation policy so as to avoid confusion.
|
||||
The enforcement policies listed above apply to all official Lemmy venues; including git repositories under [github.com/LemmyNet/lemmy](https://github.com/LemmyNet/lemmy) and [yerbamate.dev/dessalines/lemmy](https://yerbamate.dev/dessalines/lemmy), the [Matrix channel](https://matrix.to/#/!BZVTUuEiNmRcbFeLeI:matrix.org?via=matrix.org&via=privacytools.io&via=permaweb.io); and all instances under lemmy.ml. For other projects adopting the Rust Code of Conduct, please contact the maintainers of those projects for enforcement. If you wish to use this code of conduct for your own project, consider explicitly mentioning your moderation policy or making a copy with your own moderation policy so as to avoid confusion.
|
||||
|
||||
Adapted from the [Rust Code of Conduct](https://www.rust-lang.org/policies/code-of-conduct), which is based on the [Node.js Policy on Trolling](http://blog.izs.me/post/30036893703/policy-on-trolling) as well as the [Contributor Covenant v1.3.0](https://www.contributor-covenant.org/version/1/3/0/).
|
||||
|
|
63
RELEASES.md
vendored
63
RELEASES.md
vendored
|
@ -1,66 +1,3 @@
|
|||
# Lemmy v0.7.0 Release (2020-06-23)
|
||||
|
||||
This release replaces [pictshare](https://github.com/HaschekSolutions/pictshare)
|
||||
with [pict-rs](https://git.asonix.dog/asonix/pict-rs), which improves performance
|
||||
and security.
|
||||
|
||||
Overall, since our last major release in January (v0.6.0), we have closed over
|
||||
[100 issues!](https://github.com/LemmyNet/lemmy/milestone/16?closed=1)
|
||||
|
||||
- Site-wide list of recent comments
|
||||
- Reconnecting websockets
|
||||
- Many more themes, including a default light one.
|
||||
- Expandable embeds for post links (and thumbnails), from
|
||||
[iframely](https://github.com/itteco/iframely)
|
||||
- Better icons
|
||||
- Emoji autocomplete to post and message bodies, and an Emoji Picker
|
||||
- Post body now searchable
|
||||
- Community title and description is now searchable
|
||||
- Simplified cross-posts
|
||||
- Better documentation
|
||||
- LOTS more languages
|
||||
- Lots of bugs squashed
|
||||
- And more ...
|
||||
|
||||
## Upgrading
|
||||
|
||||
Before starting the upgrade, make sure that you have a working backup of your
|
||||
database and image files. See our
|
||||
[documentation](https://dev.lemmy.ml/docs/administration_backup_and_restore.html)
|
||||
for backup instructions.
|
||||
|
||||
**With Ansible:**
|
||||
|
||||
```
|
||||
# deploy with ansible from your local lemmy git repo
|
||||
git pull
|
||||
cd ansible
|
||||
ansible-playbook lemmy.yml
|
||||
# connect via ssh to run the migration script
|
||||
ssh your-server
|
||||
cd /lemmy/
|
||||
wget https://raw.githubusercontent.com/LemmyNet/lemmy/master/docker/prod/migrate-pictshare-to-pictrs.bash
|
||||
chmod +x migrate-pictshare-to-pictrs.bash
|
||||
sudo ./migrate-pictshare-to-pictrs.bash
|
||||
```
|
||||
|
||||
**With manual Docker installation:**
|
||||
```
|
||||
# run these commands on your server
|
||||
cd /lemmy
|
||||
wget https://raw.githubusercontent.com/LemmyNet/lemmy/master/ansible/templates/nginx.conf
|
||||
# Replace the {{ vars }}
|
||||
sudo mv nginx.conf /etc/nginx/sites-enabled/lemmy.conf
|
||||
sudo nginx -s reload
|
||||
wget https://raw.githubusercontent.com/LemmyNet/lemmy/master/docker/prod/docker-compose.yml
|
||||
wget https://raw.githubusercontent.com/LemmyNet/lemmy/master/docker/prod/migrate-pictshare-to-pictrs.bash
|
||||
chmod +x migrate-pictshare-to-pictrs.bash
|
||||
sudo bash migrate-pictshare-to-pictrs.bash
|
||||
```
|
||||
|
||||
**Note:** After upgrading, all users need to reload the page, then logout and
|
||||
login again, so that images are loaded correctly.
|
||||
|
||||
# Lemmy v0.6.0 Release (2020-01-16)
|
||||
|
||||
`v0.6.0` is here, and we've closed [41 issues!](https://github.com/LemmyNet/lemmy/milestone/15?closed=1)
|
||||
|
|
2
ansible/VERSION
vendored
2
ansible/VERSION
vendored
|
@ -1 +1 @@
|
|||
v0.7.1
|
||||
v0.6.71
|
||||
|
|
1
ansible/ansible.cfg
vendored
1
ansible/ansible.cfg
vendored
|
@ -1,6 +1,5 @@
|
|||
[defaults]
|
||||
inventory=inventory
|
||||
interpreter_python=/usr/bin/python3
|
||||
|
||||
[ssh_connection]
|
||||
pipelining = True
|
||||
|
|
8
ansible/lemmy.yml
vendored
8
ansible/lemmy.yml
vendored
|
@ -24,11 +24,10 @@
|
|||
creates: '/etc/letsencrypt/live/{{domain}}/privkey.pem'
|
||||
|
||||
- name: create lemmy folder
|
||||
file: path={{item.path}} {{item.owner}} state=directory
|
||||
file: path={{item.path}} state=directory
|
||||
with_items:
|
||||
- { path: '/lemmy/', owner: 'root' }
|
||||
- { path: '/lemmy/volumes/', owner: 'root' }
|
||||
- { path: '/lemmy/volumes/pictrs/', owner: '991' }
|
||||
- { path: '/lemmy/' }
|
||||
- { path: '/lemmy/volumes/' }
|
||||
|
||||
- block:
|
||||
- name: add template files
|
||||
|
@ -60,7 +59,6 @@
|
|||
project_src: /lemmy/
|
||||
state: present
|
||||
pull: yes
|
||||
remove_orphans: yes
|
||||
|
||||
- name: reload nginx with new config
|
||||
shell: nginx -s reload
|
||||
|
|
8
ansible/lemmy_dev.yml
vendored
8
ansible/lemmy_dev.yml
vendored
|
@ -26,11 +26,10 @@
|
|||
creates: '/etc/letsencrypt/live/{{domain}}/privkey.pem'
|
||||
|
||||
- name: create lemmy folder
|
||||
file: path={{item.path}} owner={{item.owner}} state=directory
|
||||
file: path={{item.path}} state=directory
|
||||
with_items:
|
||||
- { path: '/lemmy/', owner: 'root' }
|
||||
- { path: '/lemmy/volumes/', owner: 'root' }
|
||||
- { path: '/lemmy/volumes/pictrs/', owner: '991' }
|
||||
- { path: '/lemmy/' }
|
||||
- { path: '/lemmy/volumes/' }
|
||||
|
||||
- block:
|
||||
- name: add template files
|
||||
|
@ -89,7 +88,6 @@
|
|||
project_src: /lemmy/
|
||||
state: present
|
||||
recreate: always
|
||||
remove_orphans: yes
|
||||
ignore_errors: yes
|
||||
|
||||
- name: reload nginx with new config
|
||||
|
|
11
ansible/templates/docker-compose.yml
vendored
11
ansible/templates/docker-compose.yml
vendored
|
@ -12,7 +12,7 @@ services:
|
|||
- ./lemmy.hjson:/config/config.hjson:ro
|
||||
depends_on:
|
||||
- postgres
|
||||
- pictrs
|
||||
- pictshare
|
||||
- iframely
|
||||
|
||||
postgres:
|
||||
|
@ -25,13 +25,12 @@ services:
|
|||
- ./volumes/postgres:/var/lib/postgresql/data
|
||||
restart: always
|
||||
|
||||
pictrs:
|
||||
image: asonix/pictrs:amd64-v0.1.0-r9
|
||||
user: 991:991
|
||||
pictshare:
|
||||
image: hascheksolutions/pictshare:latest
|
||||
ports:
|
||||
- "127.0.0.1:8537:8080"
|
||||
- "127.0.0.1:8537:80"
|
||||
volumes:
|
||||
- ./volumes/pictrs:/mnt
|
||||
- ./volumes/pictshare:/usr/share/nginx/html/data
|
||||
restart: always
|
||||
|
||||
iframely:
|
||||
|
|
26
ansible/templates/nginx.conf
vendored
26
ansible/templates/nginx.conf
vendored
|
@ -48,8 +48,8 @@ server {
|
|||
add_header X-Frame-Options "DENY";
|
||||
add_header X-XSS-Protection "1; mode=block";
|
||||
|
||||
# Upload limit for pictrs
|
||||
client_max_body_size 20M;
|
||||
# Upload limit for pictshare
|
||||
client_max_body_size 50M;
|
||||
|
||||
location / {
|
||||
proxy_pass http://0.0.0.0:8536;
|
||||
|
@ -70,21 +70,15 @@ server {
|
|||
proxy_cache_min_uses 5;
|
||||
}
|
||||
|
||||
# Redirect pictshare images to pictrs
|
||||
location ~ /pictshare/(.*)$ {
|
||||
return 301 /pictrs/image/$1;
|
||||
}
|
||||
location /pictshare/ {
|
||||
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;
|
||||
|
||||
# pict-rs images
|
||||
location /pictrs {
|
||||
location /pictrs/image {
|
||||
proxy_pass http://0.0.0.0:8537/image;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
}
|
||||
# Block the import
|
||||
return 403;
|
||||
if ($request_uri ~ \.(?:ico|gif|jpe?g|png|webp|bmp|mp4)$) {
|
||||
add_header Cache-Control "public, max-age=31536000, immutable";
|
||||
}
|
||||
}
|
||||
|
||||
location /iframely/ {
|
||||
|
|
15
docker/dev/Dockerfile
vendored
15
docker/dev/Dockerfile
vendored
|
@ -21,13 +21,17 @@ COPY server/Cargo.toml server/Cargo.lock ./
|
|||
RUN sudo chown -R rust:rust .
|
||||
RUN mkdir -p ./src/bin \
|
||||
&& echo 'fn main() { println!("Dummy") }' > ./src/bin/main.rs
|
||||
RUN cargo build
|
||||
RUN cargo build --release
|
||||
RUN rm -f ./target/x86_64-unknown-linux-musl/release/deps/lemmy_server*
|
||||
COPY server/src ./src/
|
||||
COPY server/migrations ./migrations/
|
||||
|
||||
# Build for debug
|
||||
RUN cargo build
|
||||
# Build for release
|
||||
RUN cargo build --frozen --release
|
||||
|
||||
# Get diesel-cli on there just in case
|
||||
# RUN cargo install diesel_cli --no-default-features --features postgres
|
||||
|
||||
|
||||
FROM ekidd/rust-musl-builder:1.42.0-openssl11 as docs
|
||||
WORKDIR /app
|
||||
|
@ -35,14 +39,15 @@ COPY docs ./docs
|
|||
RUN sudo chown -R rust:rust .
|
||||
RUN mdbook build docs/
|
||||
|
||||
FROM alpine:3.12
|
||||
|
||||
FROM alpine:3.10
|
||||
|
||||
# Install libpq for postgres
|
||||
RUN apk add libpq
|
||||
|
||||
# Copy resources
|
||||
COPY server/config/defaults.hjson /config/defaults.hjson
|
||||
COPY --from=rust /app/server/target/x86_64-unknown-linux-musl/debug/lemmy_server /app/lemmy
|
||||
COPY --from=rust /app/server/target/x86_64-unknown-linux-musl/release/lemmy_server /app/lemmy
|
||||
COPY --from=docs /app/docs/book/ /app/dist/documentation/
|
||||
COPY --from=node /app/ui/dist /app/dist
|
||||
|
||||
|
|
79
docker/dev/Dockerfile.aarch64
vendored
Normal file
79
docker/dev/Dockerfile.aarch64
vendored
Normal file
|
@ -0,0 +1,79 @@
|
|||
FROM node:10-jessie as node
|
||||
|
||||
WORKDIR /app/ui
|
||||
|
||||
# Cache deps
|
||||
COPY ui/package.json ui/yarn.lock ./
|
||||
RUN yarn install --pure-lockfile
|
||||
|
||||
# Build
|
||||
COPY ui /app/ui
|
||||
RUN yarn build
|
||||
|
||||
|
||||
# contains qemu-*-static for cross-compilation
|
||||
FROM multiarch/qemu-user-static as qemu
|
||||
|
||||
|
||||
FROM arm64v8/rust:1.40-buster as rust
|
||||
|
||||
COPY --from=qemu /usr/bin/qemu-aarch64-static /usr/bin
|
||||
#COPY --from=qemu /usr/bin/qemu-arm-static /usr/bin
|
||||
|
||||
|
||||
# Install musl
|
||||
#RUN apt-get update && apt-get install -y mc
|
||||
#RUN apt-get install -y musl-tools mc
|
||||
#libpq-dev mc
|
||||
#RUN rustup target add ${TARGET}
|
||||
|
||||
# Cache deps
|
||||
WORKDIR /app
|
||||
RUN USER=root cargo new server
|
||||
WORKDIR /app/server
|
||||
COPY server/Cargo.toml server/Cargo.lock ./
|
||||
RUN mkdir -p ./src/bin \
|
||||
&& echo 'fn main() { println!("Dummy") }' > ./src/bin/main.rs
|
||||
RUN cargo build --release
|
||||
# RUN cargo build
|
||||
COPY server/src ./src/
|
||||
COPY server/migrations ./migrations/
|
||||
RUN rm -f ./target/release/deps/lemmy_server* ; rm -f ./target/debug/deps/lemmy_server*
|
||||
|
||||
|
||||
# build for release
|
||||
RUN cargo build --frozen --release
|
||||
# RUN cargo build --frozen
|
||||
|
||||
# Get diesel-cli on there just in case
|
||||
# RUN cargo install diesel_cli --no-default-features --features postgres
|
||||
|
||||
# RUN cp /app/server/target/debug/lemmy_server /app/server/ready
|
||||
RUN cp /app/server/target/release/lemmy_server /app/server/ready
|
||||
|
||||
#FROM alpine:3.10
|
||||
# debian because build with dynamic linking with debian:buster
|
||||
FROM arm64v8/debian:buster-slim as lemmy
|
||||
|
||||
#COPY --from=qemu /usr/bin/qemu-arm-static /usr/bin
|
||||
COPY --from=qemu /usr/bin/qemu-aarch64-static /usr/bin
|
||||
|
||||
# Install libpq for postgres
|
||||
#RUN apk add libpq
|
||||
RUN apt-get update && apt-get install -y libpq5
|
||||
|
||||
RUN addgroup --gid 1000 lemmy
|
||||
# for alpine
|
||||
#RUN adduser -D -s /bin/sh -u 1000 -G lemmy lemmy
|
||||
# for debian
|
||||
RUN adduser --disabled-password --shell /bin/sh --uid 1000 --ingroup lemmy lemmy
|
||||
|
||||
# Copy resources
|
||||
COPY server/config/defaults.hjson /config/defaults.hjson
|
||||
COPY --from=rust /app/server/ready /app/lemmy
|
||||
COPY --from=node /app/ui/dist /app/dist
|
||||
|
||||
RUN chown lemmy:lemmy /app/lemmy
|
||||
USER lemmy
|
||||
EXPOSE 8536
|
||||
CMD ["/app/lemmy"]
|
79
docker/dev/Dockerfile.armv7hf
vendored
Normal file
79
docker/dev/Dockerfile.armv7hf
vendored
Normal file
|
@ -0,0 +1,79 @@
|
|||
FROM node:10-jessie as node
|
||||
|
||||
WORKDIR /app/ui
|
||||
|
||||
# Cache deps
|
||||
COPY ui/package.json ui/yarn.lock ./
|
||||
RUN yarn install --pure-lockfile
|
||||
|
||||
# Build
|
||||
COPY ui /app/ui
|
||||
RUN yarn build
|
||||
|
||||
|
||||
# contains qemu-*-static for cross-compilation
|
||||
FROM multiarch/qemu-user-static as qemu
|
||||
|
||||
|
||||
FROM arm32v7/rust:1.37-buster as rust
|
||||
|
||||
#COPY --from=qemu /usr/bin/qemu-aarch64-static /usr/bin
|
||||
COPY --from=qemu /usr/bin/qemu-arm-static /usr/bin
|
||||
|
||||
|
||||
# Install musl
|
||||
#RUN apt-get update && apt-get install -y mc
|
||||
#RUN apt-get install -y musl-tools mc
|
||||
#libpq-dev mc
|
||||
#RUN rustup target add ${TARGET}
|
||||
|
||||
# Cache deps
|
||||
WORKDIR /app
|
||||
RUN USER=root cargo new server
|
||||
WORKDIR /app/server
|
||||
COPY server/Cargo.toml server/Cargo.lock ./
|
||||
RUN mkdir -p ./src/bin \
|
||||
&& echo 'fn main() { println!("Dummy") }' > ./src/bin/main.rs
|
||||
#RUN cargo build --release
|
||||
# RUN cargo build
|
||||
RUN RUSTFLAGS='-Ccodegen-units=1' cargo build
|
||||
COPY server/src ./src/
|
||||
COPY server/migrations ./migrations/
|
||||
RUN rm -f ./target/release/deps/lemmy_server* ; rm -f ./target/debug/deps/lemmy_server*
|
||||
|
||||
|
||||
# build for release
|
||||
#RUN cargo build --frozen --release
|
||||
RUN cargo build --frozen
|
||||
|
||||
# Get diesel-cli on there just in case
|
||||
# RUN cargo install diesel_cli --no-default-features --features postgres
|
||||
|
||||
RUN cp /app/server/target/debug/lemmy_server /app/server/ready
|
||||
#RUN cp /app/server/target/release/lemmy_server /app/server/ready
|
||||
|
||||
#FROM alpine:3.10
|
||||
# debian because build with dynamic linking with debian:buster
|
||||
FROM arm32v7/debian:buster-slim as lemmy
|
||||
|
||||
COPY --from=qemu /usr/bin/qemu-arm-static /usr/bin
|
||||
|
||||
# Install libpq for postgres
|
||||
#RUN apk add libpq
|
||||
RUN apt-get update && apt-get install -y libpq5
|
||||
|
||||
RUN addgroup --gid 1000 lemmy
|
||||
# for alpine
|
||||
#RUN adduser -D -s /bin/sh -u 1000 -G lemmy lemmy
|
||||
# for debian
|
||||
RUN adduser --disabled-password --shell /bin/sh --uid 1000 --ingroup lemmy lemmy
|
||||
|
||||
# Copy resources
|
||||
COPY server/config/defaults.hjson /config/defaults.hjson
|
||||
COPY --from=rust /app/server/ready /app/lemmy
|
||||
COPY --from=node /app/ui/dist /app/dist
|
||||
|
||||
RUN chown lemmy:lemmy /app/lemmy
|
||||
USER lemmy
|
||||
EXPOSE 8536
|
||||
CMD ["/app/lemmy"]
|
88
docker/dev/Dockerfile.libc
vendored
Normal file
88
docker/dev/Dockerfile.libc
vendored
Normal file
|
@ -0,0 +1,88 @@
|
|||
# can be build on x64, arm32, arm64 platforms
|
||||
# to build on target platform run
|
||||
# docker build -f Dockerfile.libc -t dessalines/lemmy:version ../..
|
||||
#
|
||||
# to use docker buildx run
|
||||
# docker buildx build --platform linux/amd64,linux/arm64 -f Dockerfile.libc -t YOURNAME/lemmy --push ../..
|
||||
|
||||
FROM node:12-buster as node
|
||||
# use this if use docker buildx
|
||||
#FROM --platform=$BUILDPLATFORM node:12-buster as node
|
||||
|
||||
WORKDIR /app/ui
|
||||
|
||||
# Cache deps
|
||||
COPY ui/package.json ui/yarn.lock ./
|
||||
RUN yarn install --pure-lockfile --network-timeout 100000
|
||||
|
||||
# Build
|
||||
COPY ui /app/ui
|
||||
RUN yarn build
|
||||
|
||||
|
||||
FROM rust:1.42 as rust
|
||||
|
||||
# Cache deps
|
||||
WORKDIR /app
|
||||
|
||||
RUN USER=root cargo new server
|
||||
WORKDIR /app/server
|
||||
COPY server/Cargo.toml server/Cargo.lock ./
|
||||
RUN mkdir -p ./src/bin \
|
||||
&& echo 'fn main() { println!("Dummy") }' > ./src/bin/main.rs
|
||||
|
||||
|
||||
RUN cargo build --release
|
||||
#RUN cargo build && \
|
||||
# rm -f ./target/release/deps/lemmy_server* ; rm -f ./target/debug/deps/lemmy_server*
|
||||
COPY server/src ./src/
|
||||
COPY server/migrations ./migrations/
|
||||
|
||||
|
||||
# build for release
|
||||
# workaround for https://github.com/rust-lang/rust/issues/62896
|
||||
#RUN RUSTFLAGS='-Ccodegen-units=1' cargo build --release
|
||||
RUN cargo build --release --frozen
|
||||
#RUN cargo build --frozen
|
||||
|
||||
# Get diesel-cli on there just in case
|
||||
# RUN cargo install diesel_cli --no-default-features --features postgres
|
||||
|
||||
# make result place always the same for lemmy container
|
||||
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.42 as docs
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Build docs
|
||||
COPY docs ./docs
|
||||
RUN cargo install mdbook
|
||||
RUN mdbook build docs/
|
||||
|
||||
|
||||
#FROM alpine:3.10
|
||||
# debian because build with dynamic linking with debian:buster
|
||||
FROM debian:buster as lemmy
|
||||
|
||||
# Install libpq for postgres
|
||||
#RUN apk add libpq
|
||||
RUN apt-get update && apt-get install -y libpq5
|
||||
RUN addgroup --gid 1000 lemmy
|
||||
# for alpine
|
||||
#RUN adduser -D -s /bin/sh -u 1000 -G lemmy lemmy
|
||||
# for debian
|
||||
RUN adduser --disabled-password --shell /bin/sh --uid 1000 --ingroup lemmy lemmy
|
||||
|
||||
# Copy resources
|
||||
COPY server/config/defaults.hjson /config/defaults.hjson
|
||||
COPY --from=node /app/ui/dist /app/dist
|
||||
COPY --from=docs /app/docs/book/ /app/dist/documentation/
|
||||
COPY --from=rust /app/server/ready /app/lemmy
|
||||
|
||||
RUN chown lemmy:lemmy /app/lemmy
|
||||
USER lemmy
|
||||
EXPOSE 8536
|
||||
CMD ["/app/lemmy"]
|
48
docker/prod/deploy.sh → docker/dev/deploy.sh
vendored
48
docker/prod/deploy.sh → docker/dev/deploy.sh
vendored
|
@ -1,5 +1,4 @@
|
|||
#!/bin/sh
|
||||
set -e
|
||||
git checkout master
|
||||
|
||||
# Import translations
|
||||
|
@ -21,7 +20,7 @@ git add "server/src/version.rs"
|
|||
echo $new_tag > "ansible/VERSION"
|
||||
git add "ansible/VERSION"
|
||||
|
||||
cd docker/prod || exit
|
||||
cd docker/dev || exit
|
||||
|
||||
# Changing the docker-compose prod
|
||||
sed -i "s/dessalines\/lemmy:.*/dessalines\/lemmy:$new_tag/" ../prod/docker-compose.yml
|
||||
|
@ -33,24 +32,41 @@ git add ../../ansible/templates/docker-compose.yml
|
|||
git commit -m"Version $new_tag"
|
||||
git tag $new_tag
|
||||
|
||||
export COMPOSE_DOCKER_CLI_BUILD=1
|
||||
export DOCKER_BUILDKIT=1
|
||||
|
||||
# Rebuilding docker
|
||||
docker-compose build
|
||||
docker tag dev_lemmy:latest dessalines/lemmy:x64-$new_tag
|
||||
docker push dessalines/lemmy:x64-$new_tag
|
||||
|
||||
# Build for Raspberry Pi / other archs
|
||||
|
||||
# Arm currently not working
|
||||
# docker build -t lemmy:armv7hf -f Dockerfile.armv7hf ../../
|
||||
# docker tag lemmy:armv7hf dessalines/lemmy:armv7hf-$new_tag
|
||||
# docker push dessalines/lemmy:armv7hf-$new_tag
|
||||
|
||||
# aarch64
|
||||
# Only do this on major releases (IE the third semver is 0)
|
||||
if [ $third_semver -eq 0 ]; then
|
||||
# TODO get linux/arm/v7 build working
|
||||
# Build for Raspberry Pi / other archs too
|
||||
docker buildx build --platform linux/amd64,linux/arm64 ../../ \
|
||||
--file Dockerfile \
|
||||
--tag dessalines/lemmy:$new_tag \
|
||||
--push
|
||||
else
|
||||
docker buildx build --platform linux/amd64 ../../ \
|
||||
--file Dockerfile \
|
||||
--tag dessalines/lemmy:$new_tag \
|
||||
--push
|
||||
# Registering qemu binaries
|
||||
docker run --rm --privileged multiarch/qemu-user-static:register --reset
|
||||
|
||||
docker build -t lemmy:aarch64 -f Dockerfile.aarch64 ../../
|
||||
docker tag lemmy:aarch64 dessalines/lemmy:arm64-$new_tag
|
||||
docker push dessalines/lemmy:arm64-$new_tag
|
||||
fi
|
||||
|
||||
# Creating the manifest for the multi-arch build
|
||||
if [ $third_semver -eq 0 ]; then
|
||||
docker manifest create dessalines/lemmy:$new_tag \
|
||||
dessalines/lemmy:x64-$new_tag \
|
||||
dessalines/lemmy:arm64-$new_tag
|
||||
else
|
||||
docker manifest create dessalines/lemmy:$new_tag \
|
||||
dessalines/lemmy:x64-$new_tag
|
||||
fi
|
||||
|
||||
docker manifest push dessalines/lemmy:$new_tag
|
||||
|
||||
# Push
|
||||
git push origin $new_tag
|
||||
git push
|
32
docker/dev/docker-compose.yml
vendored
32
docker/dev/docker-compose.yml
vendored
|
@ -1,6 +1,15 @@
|
|||
version: '3.3'
|
||||
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:12-alpine
|
||||
environment:
|
||||
- POSTGRES_USER=lemmy
|
||||
- POSTGRES_PASSWORD=password
|
||||
- POSTGRES_DB=lemmy
|
||||
volumes:
|
||||
- ./volumes/postgres:/var/lib/postgresql/data
|
||||
restart: always
|
||||
|
||||
lemmy:
|
||||
build:
|
||||
|
@ -14,27 +23,16 @@ services:
|
|||
volumes:
|
||||
- ../lemmy.hjson:/config/config.hjson
|
||||
depends_on:
|
||||
- pictrs
|
||||
- postgres
|
||||
- pictshare
|
||||
- iframely
|
||||
|
||||
postgres:
|
||||
image: postgres:12-alpine
|
||||
environment:
|
||||
- POSTGRES_USER=lemmy
|
||||
- POSTGRES_PASSWORD=password
|
||||
- POSTGRES_DB=lemmy
|
||||
pictshare:
|
||||
image: hascheksolutions/pictshare:latest
|
||||
ports:
|
||||
- "127.0.0.1:8537:80"
|
||||
volumes:
|
||||
- ./volumes/postgres:/var/lib/postgresql/data
|
||||
restart: always
|
||||
|
||||
pictrs:
|
||||
image: asonix/pictrs:v0.1.13-r0
|
||||
ports:
|
||||
- "127.0.0.1:8537:8080"
|
||||
user: 991:991
|
||||
volumes:
|
||||
- ./volumes/pictrs:/mnt
|
||||
- ./volumes/pictshare:/usr/share/nginx/html/data
|
||||
restart: always
|
||||
|
||||
iframely:
|
||||
|
|
4
docker/dev/docker_update.sh
vendored
4
docker/dev/docker_update.sh
vendored
|
@ -1,6 +1,2 @@
|
|||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
export COMPOSE_DOCKER_CLI_BUILD=1
|
||||
export DOCKER_BUILDKIT=1
|
||||
docker-compose up -d --no-deps --build
|
||||
|
|
4
docker/dev/test_deploy.sh
vendored
4
docker/dev/test_deploy.sh
vendored
|
@ -1,8 +1,4 @@
|
|||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
export COMPOSE_DOCKER_CLI_BUILD=1
|
||||
export DOCKER_BUILDKIT=1
|
||||
|
||||
# Rebuilding dev docker
|
||||
docker-compose build
|
||||
|
|
64
docker/prod/Dockerfile
vendored
64
docker/prod/Dockerfile
vendored
|
@ -1,64 +0,0 @@
|
|||
ARG RUST_BUILDER_IMAGE=shtripok/rust-musl-builder:arm
|
||||
|
||||
FROM $RUST_BUILDER_IMAGE as rust
|
||||
|
||||
#ARG RUSTRELEASEDIR="debug"
|
||||
ARG RUSTRELEASEDIR="release"
|
||||
|
||||
# Cache deps
|
||||
WORKDIR /app
|
||||
RUN sudo chown -R rust:rust .
|
||||
RUN USER=root cargo new server
|
||||
WORKDIR /app/server
|
||||
COPY --chown=rust:rust server/Cargo.toml server/Cargo.lock ./
|
||||
#RUN sudo chown -R rust:rust .
|
||||
RUN mkdir -p ./src/bin \
|
||||
&& echo 'fn main() { println!("Dummy") }' > ./src/bin/main.rs
|
||||
RUN cargo build --release
|
||||
RUN rm -f ./target/$CARGO_BUILD_TARGET/$RUSTRELEASEDIR/deps/lemmy_server*
|
||||
COPY --chown=rust:rust server/src ./src/
|
||||
COPY --chown=rust:rust server/migrations ./migrations/
|
||||
|
||||
# build for release
|
||||
# workaround for https://github.com/rust-lang/rust/issues/62896
|
||||
RUN cargo build --frozen --release
|
||||
|
||||
# reduce binary size
|
||||
RUN strip ./target/$CARGO_BUILD_TARGET/$RUSTRELEASEDIR/lemmy_server
|
||||
|
||||
RUN cp ./target/$CARGO_BUILD_TARGET/$RUSTRELEASEDIR/lemmy_server /app/server/
|
||||
|
||||
FROM $RUST_BUILDER_IMAGE as docs
|
||||
WORKDIR /app
|
||||
COPY --chown=rust:rust docs ./docs
|
||||
RUN mdbook build docs/
|
||||
|
||||
FROM node:12-buster as node
|
||||
|
||||
WORKDIR /app/ui
|
||||
|
||||
# Cache deps
|
||||
COPY ui/package.json ui/yarn.lock ./
|
||||
RUN yarn install --pure-lockfile --network-timeout 600000
|
||||
|
||||
# Build
|
||||
COPY ui /app/ui
|
||||
RUN yarn build
|
||||
|
||||
FROM alpine:3.12 as lemmy
|
||||
|
||||
# Install libpq for postgres
|
||||
RUN apk add libpq
|
||||
RUN addgroup -g 1000 lemmy
|
||||
RUN adduser -D -s /bin/sh -u 1000 -G lemmy lemmy
|
||||
|
||||
# Copy resources
|
||||
COPY --chown=lemmy:lemmy server/config/defaults.hjson /config/defaults.hjson
|
||||
COPY --chown=lemmy:lemmy --from=rust /app/server/lemmy_server /app/lemmy
|
||||
COPY --chown=lemmy:lemmy --from=docs /app/docs/book/ /app/dist/documentation/
|
||||
COPY --chown=lemmy:lemmy --from=node /app/ui/dist /app/dist
|
||||
|
||||
RUN chown lemmy:lemmy /app/lemmy
|
||||
USER lemmy
|
||||
EXPOSE 8536
|
||||
CMD ["/app/lemmy"]
|
16
docker/prod/docker-compose.yml
vendored
16
docker/prod/docker-compose.yml
vendored
|
@ -12,7 +12,7 @@ services:
|
|||
restart: always
|
||||
|
||||
lemmy:
|
||||
image: dessalines/lemmy:v0.7.1
|
||||
image: dessalines/lemmy:v0.6.71
|
||||
ports:
|
||||
- "127.0.0.1:8536:8536"
|
||||
restart: always
|
||||
|
@ -22,17 +22,17 @@ services:
|
|||
- ./lemmy.hjson:/config/config.hjson
|
||||
depends_on:
|
||||
- postgres
|
||||
- pictrs
|
||||
- pictshare
|
||||
- iframely
|
||||
|
||||
pictrs:
|
||||
image: asonix/pictrs:v0.1.13-r0
|
||||
ports:
|
||||
- "127.0.0.1:8537:8080"
|
||||
user: 991:991
|
||||
pictshare:
|
||||
image: hascheksolutions/pictshare:latest
|
||||
ports:
|
||||
- "127.0.0.1:8537:80"
|
||||
volumes:
|
||||
- ./volumes/pictrs:/mnt
|
||||
- ./volumes/pictshare:/usr/share/nginx/html/data
|
||||
restart: always
|
||||
mem_limit: 100m
|
||||
|
||||
iframely:
|
||||
image: dogbin/iframely:latest
|
||||
|
|
60
docker/prod/migrate-pictshare-to-pictrs.bash
vendored
60
docker/prod/migrate-pictshare-to-pictrs.bash
vendored
|
@ -1,60 +0,0 @@
|
|||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
if [[ $(id -u) != 0 ]]; then
|
||||
echo "This migration needs to be run as root"
|
||||
exit
|
||||
fi
|
||||
|
||||
if [[ ! -f docker-compose.yml ]]; then
|
||||
echo "No docker-compose.yml found in current directory. Is this the right folder?"
|
||||
exit
|
||||
fi
|
||||
|
||||
# Fixing pictrs permissions
|
||||
mkdir -p volumes/pictrs
|
||||
sudo chown -R 991:991 volumes/pictrs
|
||||
|
||||
echo "Restarting docker-compose, making sure that pictrs is started and pictshare is removed"
|
||||
docker-compose up -d --remove-orphans
|
||||
|
||||
if [[ -z $(docker-compose ps | grep pictrs) ]]; then
|
||||
echo "Pict-rs is not running, make sure you update Lemmy first"
|
||||
exit
|
||||
fi
|
||||
|
||||
# echo "Stopping Lemmy so that users dont upload new images during the migration"
|
||||
# docker-compose stop lemmy
|
||||
|
||||
pushd volumes/pictshare/
|
||||
echo "Importing pictshare images to pict-rs..."
|
||||
IMAGE_NAMES=*
|
||||
for image in $IMAGE_NAMES; do
|
||||
IMAGE_PATH="$(pwd)/$image/$image"
|
||||
if [[ ! -f $IMAGE_PATH ]]; then
|
||||
continue
|
||||
fi
|
||||
echo -e "\nImporting $IMAGE_PATH"
|
||||
ret=0
|
||||
curl --silent --fail -F "images[]=@$IMAGE_PATH" http://127.0.0.1:8537/import || ret=$?
|
||||
if [[ $ret != 0 ]]; then
|
||||
echo "Error for $IMAGE_PATH : $ret"
|
||||
fi
|
||||
done
|
||||
|
||||
echo "Fixing permissions on pictshare folder"
|
||||
find . -type d -exec chmod 755 {} \;
|
||||
find . -type f -exec chmod 644 {} \;
|
||||
|
||||
popd
|
||||
|
||||
echo "Rewrite image links in Lemmy database"
|
||||
docker-compose exec -u postgres postgres psql -U lemmy -c "UPDATE user_ SET avatar = REPLACE(avatar, 'pictshare', 'pictrs/image') WHERE avatar is not null;"
|
||||
docker-compose exec -u postgres postgres psql -U lemmy -c "UPDATE post SET url = REPLACE(url, 'pictshare', 'pictrs/image') WHERE url is not null;"
|
||||
|
||||
echo "Moving pictshare data folder to pictshare_backup"
|
||||
mv volumes/pictshare volumes/pictshare_backup
|
||||
|
||||
echo "Migration done, starting Lemmy again"
|
||||
echo "If everything went well, you can delete ./volumes/pictshare_backup/"
|
||||
docker-compose start lemmy
|
17
docs/src/administration_install_docker.md
vendored
17
docs/src/administration_install_docker.md
vendored
|
@ -6,25 +6,20 @@ Make sure you have both docker and docker-compose(>=`1.24.0`) installed. On Ubun
|
|||
# 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/LemmyNet/lemmy/master/docker/prod/docker-compose.yml
|
||||
wget https://raw.githubusercontent.com/LemmyNet/lemmy/master/docker/lemmy.hjson
|
||||
wget https://raw.githubusercontent.com/LemmyNet/lemmy/master/docker/iframely.config.local.js
|
||||
|
||||
# Set correct permissions for pictrs folder
|
||||
mkdir -p volumes/pictrs
|
||||
sudo chown -R 991:991 volumes/pictrs
|
||||
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
|
||||
```
|
||||
|
||||
After this, have a look at the [config file](administration_configuration.md) named `lemmy.hjson`, and adjust it, in particular the hostname, and possibly the db password. Then run:
|
||||
|
||||
`docker-compose up -d`
|
||||
|
||||
To make Lemmy available outside the server, you need to setup a reverse proxy, like Nginx. [A sample nginx config](https://raw.githubusercontent.com/LemmyNet/lemmy/master/ansible/templates/nginx.conf), could be setup with:
|
||||
To make Lemmy available outside the server, you need to setup a reverse proxy, like Nginx. [A sample nginx config](https://raw.githubusercontent.com/dessalines/lemmy/master/ansible/templates/nginx.conf), could be setup with:
|
||||
|
||||
```bash
|
||||
wget https://raw.githubusercontent.com/LemmyNet/lemmy/master/ansible/templates/nginx.conf
|
||||
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
|
||||
```
|
||||
|
@ -36,6 +31,6 @@ You will also need to setup TLS, for example with [Let's Encrypt](https://letsen
|
|||
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/LemmyNet/lemmy/master/docker/prod/docker-compose.yml
|
||||
wget https://raw.githubusercontent.com/dessalines/lemmy/master/docker/prod/docker-compose.yml
|
||||
docker-compose up -d
|
||||
```
|
||||
|
|
6
docs/src/contributing.md
vendored
6
docs/src/contributing.md
vendored
|
@ -4,9 +4,9 @@ Information about contributing to Lemmy, whether it is translating, testing, des
|
|||
|
||||
## Issue tracking / Repositories
|
||||
|
||||
- [GitHub (for issues and pull requests)](https://github.com/LemmyNet/lemmy)
|
||||
- [Gitea (only for pull requests)](https://yerbamate.dev/LemmyNet/lemmy)
|
||||
- [GitLab (only code-mirror)](https://gitlab.com/dessalines/lemmy)
|
||||
- [GitHub (for issues)](https://github.com/LemmyNet/lemmy)
|
||||
- [Gitea](https://yerbamate.dev/dessalines/lemmy)
|
||||
- [GitLab](https://gitlab.com/dessalines/lemmy)
|
||||
|
||||
## Translating
|
||||
|
||||
|
|
15
docs/src/contributing_docker_development.md
vendored
15
docs/src/contributing_docker_development.md
vendored
|
@ -3,22 +3,11 @@
|
|||
## Running
|
||||
|
||||
```bash
|
||||
sudo apt install git docker-compose
|
||||
git clone https://github.com/LemmyNet/lemmy
|
||||
cd lemmy/docker/dev
|
||||
sudo docker-compose up --no-deps --build
|
||||
./docker_update.sh # This builds and runs it, updating for your changes
|
||||
```
|
||||
|
||||
and go to http://localhost:8536.
|
||||
|
||||
To speed up the Docker compile, add the following to `/etc/docker/daemon.json` and restart Docker.
|
||||
```
|
||||
{
|
||||
"features": {
|
||||
"buildkit": true
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
If the build is still too slow, you will have to use a
|
||||
[local build](contributing_local_development.md) instead.
|
||||
Note that compile times when changing `Cargo.toml` are relatively long with Docker, because builds can't be incrementally cached. If this is a problem for you, you should use [Local Development](contributing_local_development.md).
|
||||
|
|
74
docs/src/contributing_local_development.md
vendored
74
docs/src/contributing_local_development.md
vendored
|
@ -1,67 +1,31 @@
|
|||
### Ubuntu
|
||||
#### Requirements
|
||||
|
||||
- [Rust](https://www.rust-lang.org/)
|
||||
- [Yarn](https://yarnpkg.com/en/)
|
||||
- [Postgres](https://www.postgresql.org/)
|
||||
|
||||
#### Build requirements:
|
||||
```
|
||||
sudo apt install git cargo libssl-dev pkg-config libpq-dev yarn curl gnupg2 git
|
||||
# install yarn
|
||||
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
|
||||
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
|
||||
sudo apt update && sudo apt install yarn
|
||||
```
|
||||
#### Set up Postgres DB
|
||||
|
||||
#### Get the source code
|
||||
```
|
||||
git clone https://github.com/LemmyNet/lemmy.git
|
||||
# or alternatively from gitea
|
||||
# git clone https://yerbamate.dev/LemmyNet/lemmy.git
|
||||
```
|
||||
|
||||
All the following commands need to be run either in `lemmy/server` or `lemmy/ui`, as indicated
|
||||
by the `cd` command.
|
||||
|
||||
#### Build the backend (Rust)
|
||||
```
|
||||
```bash
|
||||
cd server
|
||||
cargo build
|
||||
# for development, use `cargo check` instead)
|
||||
./db-init.sh
|
||||
```
|
||||
|
||||
#### Build the frontend (Typescript)
|
||||
```
|
||||
cd ui
|
||||
yarn
|
||||
yarn build
|
||||
```
|
||||
Or run the commands manually:
|
||||
|
||||
#### Setup postgresql
|
||||
```
|
||||
sudo apt install postgresql
|
||||
sudo systemctl start postgresql
|
||||
# initialize postgres database
|
||||
sudo -u postgres psql -c "create user lemmy with password 'password' superuser;" -U postgres
|
||||
sudo -u postgres psql -c 'create database lemmy with owner lemmy;' -U postgres
|
||||
```bash
|
||||
psql -c "create user lemmy with password 'password' superuser;" -U postgres
|
||||
psql -c 'create database lemmy with owner lemmy;' -U postgres
|
||||
export LEMMY_DATABASE_URL=postgres://lemmy:password@localhost:5432/lemmy
|
||||
# or execute server/db-init.sh
|
||||
```
|
||||
|
||||
#### Run a local development instance
|
||||
```
|
||||
# run each of these in a seperate terminal
|
||||
cd server && cargo run
|
||||
ui & yarn start
|
||||
```
|
||||
#### Running
|
||||
|
||||
Then open [localhost:4444](http://localhost:4444) in your browser. It will auto-refresh if you edit
|
||||
any frontend files. For backend coding, you will have to rerun `cargo run`. You can use
|
||||
`cargo check` as a faster way to find compilation errors.
|
||||
|
||||
To speed up incremental builds, you can add the following to `~/.cargo/config`:
|
||||
```bash
|
||||
git clone https://github.com/LemmyNet/lemmy
|
||||
cd lemmy
|
||||
./install.sh
|
||||
# For live coding, where both the front and back end, automagically reload on any save, do:
|
||||
# cd ui && yarn start
|
||||
# cd server && cargo watch -x run
|
||||
```
|
||||
[target.x86_64-unknown-linux-gnu]
|
||||
rustflags = ["-Clink-arg=-fuse-ld=lld"]
|
||||
```
|
||||
|
||||
Note that this setup doesn't include image uploads or link previews (provided by pict-rs and
|
||||
iframely respectively). If you want to test those, you should use the
|
||||
[Docker development](contributing_docker_development.md).
|
||||
|
|
6
docs/src/lemmy_council.md
vendored
6
docs/src/lemmy_council.md
vendored
|
@ -49,7 +49,5 @@
|
|||
## Member List / Contact Info
|
||||
General Contact [@LemmyDev Mastodon](https://mastodon.social/@LemmyDev)
|
||||
|
||||
- [Dessalines](https://dev.lemmy.ml/u/dessalines)
|
||||
- [Nutomic](https://dev.lemmy.ml/u/nutomic)
|
||||
- [AgreeableLandscape](https://dev.lemmy.ml/u/AgreeableLandscape)
|
||||
- [fruechtchen](https://dev.lemmy.ml/u/fruechtchen)
|
||||
- Dessalines [Matrix](https://matrix.to/#/@happydooby:matrix.org)
|
||||
- Nutomic [Matrix](https://matrix.to/#/@nutomic:matrix.org), [Mastodon](https://radical.town/@felix)
|
||||
|
|
736
server/Cargo.lock
generated
vendored
736
server/Cargo.lock
generated
vendored
File diff suppressed because it is too large
Load diff
17
server/Cargo.toml
vendored
17
server/Cargo.toml
vendored
|
@ -4,24 +4,22 @@ version = "0.0.1"
|
|||
authors = ["Dessalines <tyhou13@gmx.com>"]
|
||||
edition = "2018"
|
||||
|
||||
[profile.release]
|
||||
lto = true
|
||||
|
||||
[dependencies]
|
||||
diesel = { version = "1.4.2", features = ["postgres","chrono", "r2d2", "64-column-tables"] }
|
||||
diesel_migrations = "1.4.0"
|
||||
dotenv = "0.15.0"
|
||||
bcrypt = "0.7.0"
|
||||
activitypub = "0.2.0"
|
||||
chrono = "0.4.7"
|
||||
chrono = { version = "0.4.7", features = ["serde"] }
|
||||
failure = "0.1.8"
|
||||
serde_json = "1.0.52"
|
||||
serde = "1.0.105"
|
||||
serde_json = { version = "1.0.52", features = ["preserve_order"]}
|
||||
serde = { version = "1.0.105", features = ["derive"] }
|
||||
actix = "0.9.0"
|
||||
actix-web = "2.0.0"
|
||||
actix-files = "0.2.1"
|
||||
actix-web-actors = "2.0.0"
|
||||
actix-rt = "1.1.1"
|
||||
actix-multipart = "0.2.0"
|
||||
log = "0.4.0"
|
||||
env_logger = "0.7.1"
|
||||
rand = "0.7.3"
|
||||
|
@ -35,9 +33,12 @@ lettre_email = "0.9.4"
|
|||
sha2 = "0.8.1"
|
||||
rss = "1.9.0"
|
||||
htmlescape = "0.3.1"
|
||||
config = {version = "0.10.1", default-features = false, features = ["hjson"] }
|
||||
config = "0.10.1"
|
||||
hjson = "0.8.2"
|
||||
percent-encoding = "2.1.0"
|
||||
attohttpc = { version = "0.14.0", default-features = false, features = ["tls-rustls"] }
|
||||
isahc = "0.9"
|
||||
comrak = "0.7"
|
||||
tokio = "0.2.20"
|
||||
futures = "0.3.4"
|
||||
image = "0.23.4"
|
||||
mime-db = "0.1.5"
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
use super::*;
|
||||
use crate::is_valid_community_name;
|
||||
|
||||
#[derive(Serialize, Deserialize)]
|
||||
pub struct GetCommunity {
|
||||
|
@ -221,10 +220,6 @@ impl Perform for Oper<CreateCommunity> {
|
|||
}
|
||||
}
|
||||
|
||||
if !is_valid_community_name(&data.name) {
|
||||
return Err(APIError::err("invalid_community_name").into());
|
||||
}
|
||||
|
||||
let user_id = claims.id;
|
||||
|
||||
let conn = pool.get()?;
|
||||
|
@ -311,10 +306,6 @@ impl Perform for Oper<EditCommunity> {
|
|||
Err(_e) => return Err(APIError::err("not_logged_in").into()),
|
||||
};
|
||||
|
||||
if !is_valid_community_name(&data.name) {
|
||||
return Err(APIError::err("invalid_community_name").into());
|
||||
}
|
||||
|
||||
let user_id = claims.id;
|
||||
|
||||
let conn = pool.get()?;
|
||||
|
|
|
@ -18,7 +18,7 @@ use crate::db::user_mention_view::*;
|
|||
use crate::db::user_view::*;
|
||||
use crate::db::*;
|
||||
use crate::{
|
||||
extract_usernames, fetch_iframely_and_pictrs_data, generate_random_string, naive_from_unix,
|
||||
extract_usernames, fetch_iframely_and_pictshare_data, generate_random_string, naive_from_unix,
|
||||
naive_now, remove_slurs, send_email, slur_check, slurs_vec_to_str,
|
||||
};
|
||||
|
||||
|
|
|
@ -116,9 +116,9 @@ impl Perform for Oper<CreatePost> {
|
|||
return Err(APIError::err("site_ban").into());
|
||||
}
|
||||
|
||||
// Fetch Iframely and pictrs cached image
|
||||
let (iframely_title, iframely_description, iframely_html, pictrs_thumbnail) =
|
||||
fetch_iframely_and_pictrs_data(data.url.to_owned());
|
||||
// Fetch Iframely and Pictshare cached image
|
||||
let (iframely_title, iframely_description, iframely_html, pictshare_thumbnail) =
|
||||
fetch_iframely_and_pictshare_data(data.url.to_owned());
|
||||
|
||||
let post_form = PostForm {
|
||||
name: data.name.to_owned(),
|
||||
|
@ -135,7 +135,7 @@ impl Perform for Oper<CreatePost> {
|
|||
embed_title: iframely_title,
|
||||
embed_description: iframely_description,
|
||||
embed_html: iframely_html,
|
||||
thumbnail_url: pictrs_thumbnail,
|
||||
thumbnail_url: pictshare_thumbnail,
|
||||
};
|
||||
|
||||
let inserted_post = match Post::create(&conn, &post_form) {
|
||||
|
@ -450,9 +450,9 @@ impl Perform for Oper<EditPost> {
|
|||
return Err(APIError::err("site_ban").into());
|
||||
}
|
||||
|
||||
// Fetch Iframely and Pictrs cached image
|
||||
let (iframely_title, iframely_description, iframely_html, pictrs_thumbnail) =
|
||||
fetch_iframely_and_pictrs_data(data.url.to_owned());
|
||||
// Fetch Iframely and Pictshare cached image
|
||||
let (iframely_title, iframely_description, iframely_html, pictshare_thumbnail) =
|
||||
fetch_iframely_and_pictshare_data(data.url.to_owned());
|
||||
|
||||
let post_form = PostForm {
|
||||
name: data.name.to_owned(),
|
||||
|
@ -469,7 +469,7 @@ impl Perform for Oper<EditPost> {
|
|||
embed_title: iframely_title,
|
||||
embed_description: iframely_description,
|
||||
embed_html: iframely_html,
|
||||
thumbnail_url: pictrs_thumbnail,
|
||||
thumbnail_url: pictshare_thumbnail,
|
||||
};
|
||||
|
||||
let _updated_post = match Post::update(&conn, data.edit_id, &post_form) {
|
||||
|
|
|
@ -36,6 +36,7 @@ pub mod websocket;
|
|||
|
||||
use actix_web::dev::ConnectionInfo;
|
||||
use chrono::{DateTime, NaiveDateTime, Utc};
|
||||
use isahc::prelude::*;
|
||||
use lettre::smtp::authentication::{Credentials, Mechanism};
|
||||
use lettre::smtp::extension::ClientId;
|
||||
use lettre::smtp::ConnectionReuseParameters;
|
||||
|
@ -73,8 +74,7 @@ pub fn is_email_regex(test: &str) -> bool {
|
|||
}
|
||||
|
||||
pub fn is_image_content_type(test: &str) -> Result<(), failure::Error> {
|
||||
if attohttpc::get(test)
|
||||
.send()?
|
||||
if isahc::get(test)?
|
||||
.headers()
|
||||
.get("Content-Type")
|
||||
.ok_or_else(|| format_err!("No Content-Type header"))?
|
||||
|
@ -182,40 +182,30 @@ pub struct IframelyResponse {
|
|||
|
||||
pub fn fetch_iframely(url: &str) -> Result<IframelyResponse, failure::Error> {
|
||||
let fetch_url = format!("http://iframely/oembed?url={}", url);
|
||||
let text: String = attohttpc::get(&fetch_url).send()?.text()?;
|
||||
let text = isahc::get(&fetch_url)?.text()?;
|
||||
let res: IframelyResponse = serde_json::from_str(&text)?;
|
||||
Ok(res)
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Debug, Clone)]
|
||||
pub struct PictrsResponse {
|
||||
files: Vec<PictrsFile>,
|
||||
msg: String,
|
||||
#[derive(Deserialize, Debug)]
|
||||
pub struct PictshareResponse {
|
||||
status: String,
|
||||
url: String,
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Debug, Clone)]
|
||||
pub struct PictrsFile {
|
||||
file: String,
|
||||
delete_token: String,
|
||||
}
|
||||
|
||||
pub fn fetch_pictrs(image_url: &str) -> Result<PictrsResponse, failure::Error> {
|
||||
pub fn fetch_pictshare(image_url: &str) -> Result<PictshareResponse, failure::Error> {
|
||||
is_image_content_type(image_url)?;
|
||||
|
||||
let fetch_url = format!(
|
||||
"http://pictrs:8080/image/download?url={}",
|
||||
utf8_percent_encode(image_url, NON_ALPHANUMERIC) // TODO this might not be needed
|
||||
"http://pictshare/api/geturl.php?url={}",
|
||||
utf8_percent_encode(image_url, NON_ALPHANUMERIC)
|
||||
);
|
||||
let text = attohttpc::get(&fetch_url).send()?.text()?;
|
||||
let res: PictrsResponse = serde_json::from_str(&text)?;
|
||||
if res.msg == "ok" {
|
||||
Ok(res)
|
||||
} else {
|
||||
Err(format_err!("{}", &res.msg))
|
||||
}
|
||||
let text = isahc::get(&fetch_url)?.text()?;
|
||||
let res: PictshareResponse = serde_json::from_str(&text)?;
|
||||
Ok(res)
|
||||
}
|
||||
|
||||
fn fetch_iframely_and_pictrs_data(
|
||||
fn fetch_iframely_and_pictshare_data(
|
||||
url: Option<String>,
|
||||
) -> (
|
||||
Option<String>,
|
||||
|
@ -235,20 +225,20 @@ fn fetch_iframely_and_pictrs_data(
|
|||
}
|
||||
};
|
||||
|
||||
// Fetch pictrs thumbnail
|
||||
let pictrs_thumbnail = match iframely_thumbnail_url {
|
||||
Some(iframely_thumbnail_url) => match fetch_pictrs(&iframely_thumbnail_url) {
|
||||
Ok(res) => Some(res.files[0].file.to_owned()),
|
||||
// Fetch pictshare thumbnail
|
||||
let pictshare_thumbnail = match iframely_thumbnail_url {
|
||||
Some(iframely_thumbnail_url) => match fetch_pictshare(&iframely_thumbnail_url) {
|
||||
Ok(res) => Some(res.url),
|
||||
Err(e) => {
|
||||
error!("pictrs err: {}", e);
|
||||
error!("pictshare err: {}", e);
|
||||
None
|
||||
}
|
||||
},
|
||||
// Try to generate a small thumbnail if iframely is not supported
|
||||
None => match fetch_pictrs(&url) {
|
||||
Ok(res) => Some(res.files[0].file.to_owned()),
|
||||
None => match fetch_pictshare(&url) {
|
||||
Ok(res) => Some(res.url),
|
||||
Err(e) => {
|
||||
error!("pictrs err: {}", e);
|
||||
error!("pictshare err: {}", e);
|
||||
None
|
||||
}
|
||||
},
|
||||
|
@ -258,7 +248,7 @@ fn fetch_iframely_and_pictrs_data(
|
|||
iframely_title,
|
||||
iframely_description,
|
||||
iframely_html,
|
||||
pictrs_thumbnail,
|
||||
pictshare_thumbnail,
|
||||
)
|
||||
}
|
||||
None => (None, None, None, None),
|
||||
|
@ -283,15 +273,11 @@ pub fn is_valid_username(name: &str) -> bool {
|
|||
VALID_USERNAME_REGEX.is_match(name)
|
||||
}
|
||||
|
||||
pub fn is_valid_community_name(name: &str) -> bool {
|
||||
VALID_COMMUNITY_NAME_REGEX.is_match(name)
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use crate::{
|
||||
extract_usernames, is_email_regex, is_image_content_type, is_valid_community_name,
|
||||
is_valid_username, remove_slurs, slur_check, slurs_vec_to_str,
|
||||
extract_usernames, is_email_regex, is_image_content_type, is_valid_username, remove_slurs,
|
||||
slur_check, slurs_vec_to_str,
|
||||
};
|
||||
|
||||
#[test]
|
||||
|
@ -318,15 +304,6 @@ mod tests {
|
|||
assert!(!is_valid_username(""));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_valid_community_name() {
|
||||
assert!(is_valid_community_name("example"));
|
||||
assert!(is_valid_community_name("example_community"));
|
||||
assert!(!is_valid_community_name("Example"));
|
||||
assert!(!is_valid_community_name("Ex"));
|
||||
assert!(!is_valid_community_name(""));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_slur_filter() {
|
||||
let test =
|
||||
|
@ -389,5 +366,4 @@ lazy_static! {
|
|||
static ref SLUR_REGEX: Regex = RegexBuilder::new(r"(fag(g|got|tard)?|maricos?|cock\s?sucker(s|ing)?|nig(\b|g?(a|er)?(s|z)?)\b|dindu(s?)|mudslime?s?|kikes?|mongoloids?|towel\s*heads?|\bspi(c|k)s?\b|\bchinks?|niglets?|beaners?|\bnips?\b|\bcoons?\b|jungle\s*bunn(y|ies?)|jigg?aboo?s?|\bpakis?\b|rag\s*heads?|gooks?|cunts?|bitch(es|ing|y)?|puss(y|ies?)|twats?|feminazis?|whor(es?|ing)|\bslut(s|t?y)?|\btrann?(y|ies?)|ladyboy(s?)|\b(b|re|r)tard(ed)?s?)").case_insensitive(true).build().unwrap();
|
||||
static ref USERNAME_MATCHES_REGEX: Regex = Regex::new(r"/u/[a-zA-Z][0-9a-zA-Z_]*").unwrap();
|
||||
static ref VALID_USERNAME_REGEX: Regex = Regex::new(r"^[a-zA-Z0-9_]{3,20}$").unwrap();
|
||||
static ref VALID_COMMUNITY_NAME_REGEX: Regex = Regex::new(r"^[a-z0-9_]{3,20}$").unwrap();
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ use diesel::r2d2::{ConnectionManager, Pool};
|
|||
use diesel::PgConnection;
|
||||
use lemmy_server::{
|
||||
rate_limit::{rate_limiter::RateLimiter, RateLimit},
|
||||
routes::{api, federation, feeds, index, nodeinfo, webfinger},
|
||||
routes::{api, federation, feeds, images, index, nodeinfo, webfinger},
|
||||
settings::Settings,
|
||||
websocket::server::*,
|
||||
};
|
||||
|
@ -75,6 +75,7 @@ async fn main() -> io::Result<()> {
|
|||
.configure(move |cfg| api::config(cfg, &rate_limiter))
|
||||
.configure(federation::config)
|
||||
.configure(feeds::config)
|
||||
.configure(images::config)
|
||||
.configure(index::config)
|
||||
.configure(nodeinfo::config)
|
||||
.configure(webfinger::config)
|
||||
|
|
92
server/src/routes/images.rs
Normal file
92
server/src/routes/images.rs
Normal file
|
@ -0,0 +1,92 @@
|
|||
use super::*;
|
||||
use actix_multipart::Multipart;
|
||||
use actix_web::{web, HttpResponse};
|
||||
use failure::Error;
|
||||
use futures::{StreamExt, TryStreamExt};
|
||||
use image::imageops::FilterType;
|
||||
use rand::distributions::Alphanumeric;
|
||||
use rand::{thread_rng, Rng};
|
||||
use std::fs::{DirBuilder, File};
|
||||
use std::io::Write;
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
const DATA_DIR: &str = "volumes/pictshare/";
|
||||
const THUMBNAIL_SIZES: [u32; 2] = [192, 96];
|
||||
|
||||
pub fn config(cfg: &mut web::ServiceConfig) {
|
||||
cfg.service(
|
||||
web::scope("/pictshare")
|
||||
.route("/api/upload.php", web::post().to(images::upload))
|
||||
.route("/{image_name}", web::get().to(serve_image))
|
||||
.route("/{resolution}/{image_name}", web::get().to(serve_thumbnail)),
|
||||
);
|
||||
}
|
||||
|
||||
// https://github.com/actix/examples/blob/master/multipart/src/main.rs
|
||||
async fn upload(mut payload: Multipart) -> Result<HttpResponse, actix_web::Error> {
|
||||
// iterate over multipart stream
|
||||
let mut field = payload.try_next().await?.unwrap();
|
||||
// TODO: afaik this is coming from the client, would be better to detect the mime ourselves
|
||||
let mime = field.content_type().essence_str();
|
||||
let ext = mime_db::extension(mime).unwrap();
|
||||
let filename = format!("{}.{}", generate_image_id(), ext);
|
||||
let filepath = format!("{}/{}/{}", DATA_DIR, &filename, &filename);
|
||||
DirBuilder::new()
|
||||
.recursive(true)
|
||||
.create(format!("{}/{}", DATA_DIR, &filename))?;
|
||||
let mut f = File::create(filepath)?;
|
||||
// Field in turn is stream of *Bytes* object
|
||||
while let Some(chunk) = field.next().await {
|
||||
let data = chunk.unwrap();
|
||||
f = web::block(move || f.write_all(&data).map(|_| f)).await?;
|
||||
}
|
||||
let response = format!("{{\"url\":\"{}\",\"filetype\":\"{}\"}}", &filename, ext);
|
||||
Ok(HttpResponse::Ok().body(response))
|
||||
}
|
||||
|
||||
async fn serve_image(path: web::Path<String>) -> Result<NamedFile, Error> {
|
||||
let path = path.into_inner();
|
||||
let path = image_path(&path);
|
||||
Ok(NamedFile::open(path)?)
|
||||
}
|
||||
|
||||
// Note: this function doesnt use thumbnails generated by pictshare,
|
||||
// we will have to remove those later
|
||||
async fn serve_thumbnail(path: web::Path<(u32, String)>) -> Result<NamedFile, Error> {
|
||||
let image_name = &path.1;
|
||||
let size = path.0;
|
||||
let thumbnail_path = thumbnail_path(image_name, size)?;
|
||||
if thumbnail_path.exists() {
|
||||
Ok(NamedFile::open(thumbnail_path)?)
|
||||
} else {
|
||||
let image = image::open(image_path(image_name))?;
|
||||
let thumbnail = image.resize(size, size, FilterType::Triangle);
|
||||
thumbnail.save(&thumbnail_path)?;
|
||||
Ok(NamedFile::open(thumbnail_path)?)
|
||||
}
|
||||
}
|
||||
|
||||
fn image_path(image_name: &str) -> PathBuf {
|
||||
let raw_path = format!("{}/{}/{}", DATA_DIR, image_name, image_name);
|
||||
Path::new(&raw_path).to_owned()
|
||||
}
|
||||
|
||||
fn thumbnail_path(image_name: &str, size: u32) -> Result<PathBuf, Error> {
|
||||
if !THUMBNAIL_SIZES.contains(&size) {
|
||||
return Err(format_err!("Invalid thumbnail size {}", size));
|
||||
}
|
||||
let split: Vec<&str> = image_name.splitn(2, '.').collect();
|
||||
let id = split[0];
|
||||
let ext = split[1];
|
||||
let raw_path = format!("{}/{}/{}-{}.{}", DATA_DIR, image_name, id, size, ext);
|
||||
Ok(Path::new(&raw_path).to_owned())
|
||||
}
|
||||
|
||||
fn generate_image_id() -> String {
|
||||
let id: String = thread_rng().sample_iter(&Alphanumeric).take(6).collect();
|
||||
if image_path(&id).exists() {
|
||||
generate_image_id()
|
||||
} else {
|
||||
id
|
||||
}
|
||||
}
|
|
@ -29,6 +29,7 @@ pub type ChatServerParam = web::Data<Addr<ChatServer>>;
|
|||
pub mod api;
|
||||
pub mod federation;
|
||||
pub mod feeds;
|
||||
pub mod images;
|
||||
pub mod index;
|
||||
pub mod nodeinfo;
|
||||
pub mod webfinger;
|
||||
|
|
|
@ -1 +1 @@
|
|||
pub const VERSION: &str = "v0.7.1";
|
||||
pub const VERSION: &str = "v0.6.71";
|
||||
|
|
2
ui/assets/css/main.css
vendored
2
ui/assets/css/main.css
vendored
|
@ -37,7 +37,7 @@
|
|||
}
|
||||
|
||||
.md-div img {
|
||||
max-height: 40vh;
|
||||
max-height: 90vh;
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
|
|
30
ui/assets/css/themes/_variables.litely.scss
vendored
30
ui/assets/css/themes/_variables.litely.scss
vendored
|
@ -1,30 +0,0 @@
|
|||
|
||||
$white: #ffffff;
|
||||
$orange: #faa077;
|
||||
$cyan: #02bdc2;
|
||||
$green: #d4e9d7;
|
||||
$secondary: $green;
|
||||
$body-color: $gray-700;
|
||||
$link-color: theme-color("danger");;
|
||||
$primary: $orange;
|
||||
$red: #d8486a;
|
||||
$border-radius: 1.5rem;
|
||||
$border-radius-lg: 1.5rem;
|
||||
$border-radius-sm: 1rem;
|
||||
$font-family-sans-serif: Guardian-EgypTT,serif,-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
|
||||
$headings-color: $gray-700;
|
||||
$input-btn-focus-color: rgba($component-active-bg, .75);
|
||||
$form-feedback-valid-color: theme-color("info");
|
||||
$navbar-light-color: $gray-600;
|
||||
$black: #222222;
|
||||
$navbar-dark-toggler-border-color: rgba($black, .1);
|
||||
$navbar-light-active-color: $gray-900;
|
||||
$card-color: $gray-700;
|
||||
$card-cap-color: $gray-700;
|
||||
$info: darken($green, 25%);;
|
||||
$body-bg: #f2f0f0;
|
||||
$success: darken($green, 25%);;
|
||||
$danger: darken($primary, 25%);
|
||||
$navbar-light-hover-color: $gray-900;
|
||||
$card-bg: $gray-100;
|
||||
$border-color: $gray-700;
|
1
ui/assets/css/themes/litely.min.css
vendored
1
ui/assets/css/themes/litely.min.css
vendored
File diff suppressed because one or more lines are too long
95
ui/src/components/comment-form.tsx
vendored
95
ui/src/components/comment-form.tsx
vendored
|
@ -18,7 +18,6 @@ import {
|
|||
setupTribute,
|
||||
wsJsonToRes,
|
||||
emojiPicker,
|
||||
pictrsDeleteToast,
|
||||
} from '../utils';
|
||||
import { WebSocketService, UserService } from '../services';
|
||||
import autosize from 'autosize';
|
||||
|
@ -61,7 +60,7 @@ export class CommentForm extends Component<CommentFormProps, CommentFormState> {
|
|||
buttonTitle: !this.props.node
|
||||
? capitalizeFirstLetter(i18n.t('post'))
|
||||
: this.props.edit
|
||||
? capitalizeFirstLetter(i18n.t('save'))
|
||||
? capitalizeFirstLetter(i18n.t('edit'))
|
||||
: capitalizeFirstLetter(i18n.t('reply')),
|
||||
previewMode: false,
|
||||
loading: false,
|
||||
|
@ -138,7 +137,7 @@ export class CommentForm extends Component<CommentFormProps, CommentFormState> {
|
|||
/>
|
||||
{this.state.previewMode && (
|
||||
<div
|
||||
className="card card-body md-div"
|
||||
className="md-div"
|
||||
dangerouslySetInnerHTML={mdToHtml(
|
||||
this.state.commentForm.content
|
||||
)}
|
||||
|
@ -151,7 +150,7 @@ export class CommentForm extends Component<CommentFormProps, CommentFormState> {
|
|||
<button
|
||||
type="submit"
|
||||
class="btn btn-sm btn-secondary mr-2"
|
||||
disabled={this.props.disabled || this.state.loading}
|
||||
disabled={this.props.disabled}
|
||||
>
|
||||
{this.state.loading ? (
|
||||
<svg class="icon icon-spinner spin">
|
||||
|
@ -163,9 +162,8 @@ export class CommentForm extends Component<CommentFormProps, CommentFormState> {
|
|||
</button>
|
||||
{this.state.commentForm.content && (
|
||||
<button
|
||||
className={`btn btn-sm mr-2 btn-secondary ${
|
||||
this.state.previewMode && 'active'
|
||||
}`}
|
||||
className={`btn btn-sm mr-2 btn-secondary ${this.state
|
||||
.previewMode && 'active'}`}
|
||||
onClick={linkEvent(this, this.handlePreviewToggle)}
|
||||
>
|
||||
{i18n.t('preview')}
|
||||
|
@ -245,32 +243,18 @@ export class CommentForm extends Component<CommentFormProps, CommentFormState> {
|
|||
});
|
||||
}
|
||||
|
||||
handleFinished(data: CommentResponse) {
|
||||
let isReply =
|
||||
this.props.node !== undefined && data.comment.parent_id !== null;
|
||||
let xor =
|
||||
+!(data.comment.parent_id !== null) ^ +(this.props.node !== undefined);
|
||||
|
||||
if (
|
||||
(data.comment.creator_id == UserService.Instance.user.id &&
|
||||
// If its a reply, make sure parent child match
|
||||
isReply &&
|
||||
data.comment.parent_id == this.props.node.comment.id) ||
|
||||
// Otherwise, check the XOR of the two
|
||||
(!isReply && xor)
|
||||
) {
|
||||
this.state.previewMode = false;
|
||||
this.state.loading = false;
|
||||
this.state.commentForm.content = '';
|
||||
this.setState(this.state);
|
||||
let form: any = document.getElementById(this.formId);
|
||||
form.reset();
|
||||
if (this.props.node) {
|
||||
this.props.onReplyCancel();
|
||||
}
|
||||
autosize.update(form);
|
||||
this.setState(this.state);
|
||||
handleFinished() {
|
||||
this.state.previewMode = false;
|
||||
this.state.loading = false;
|
||||
this.state.commentForm.content = '';
|
||||
this.setState(this.state);
|
||||
let form: any = document.getElementById(this.formId);
|
||||
form.reset();
|
||||
if (this.props.node) {
|
||||
this.props.onReplyCancel();
|
||||
}
|
||||
autosize.update(document.querySelector('textarea'));
|
||||
this.setState(this.state);
|
||||
}
|
||||
|
||||
handleCommentSubmit(i: CommentForm, event: any) {
|
||||
|
@ -320,9 +304,9 @@ export class CommentForm extends Component<CommentFormProps, CommentFormState> {
|
|||
file = event;
|
||||
}
|
||||
|
||||
const imageUploadUrl = `/pictrs/image`;
|
||||
const imageUploadUrl = `/pictshare/api/upload.php`;
|
||||
const formData = new FormData();
|
||||
formData.append('images[]', file);
|
||||
formData.append('file', file);
|
||||
|
||||
i.state.imageLoading = true;
|
||||
i.setState(i.state);
|
||||
|
@ -333,31 +317,16 @@ export class CommentForm extends Component<CommentFormProps, CommentFormState> {
|
|||
})
|
||||
.then(res => res.json())
|
||||
.then(res => {
|
||||
console.log('pictrs upload:');
|
||||
console.log(res);
|
||||
if (res.msg == 'ok') {
|
||||
let hash = res.files[0].file;
|
||||
let url = `${window.location.origin}/pictrs/image/${hash}`;
|
||||
let deleteToken = res.files[0].delete_token;
|
||||
let deleteUrl = `${window.location.origin}/pictrs/image/delete/${deleteToken}/${hash}`;
|
||||
let imageMarkdown = `![](${url})`;
|
||||
let content = i.state.commentForm.content;
|
||||
content = content ? `${content}\n${imageMarkdown}` : imageMarkdown;
|
||||
i.state.commentForm.content = content;
|
||||
i.state.imageLoading = false;
|
||||
i.setState(i.state);
|
||||
let textarea: any = document.getElementById(i.id);
|
||||
autosize.update(textarea);
|
||||
pictrsDeleteToast(
|
||||
i18n.t('click_to_delete_picture'),
|
||||
i18n.t('picture_deleted'),
|
||||
deleteUrl
|
||||
);
|
||||
} else {
|
||||
i.state.imageLoading = false;
|
||||
i.setState(i.state);
|
||||
toast(JSON.stringify(res), 'danger');
|
||||
}
|
||||
let url = `${window.location.origin}/pictshare/${res.url}`;
|
||||
let imageMarkdown =
|
||||
res.filetype == 'mp4' ? `[vid](${url}/raw)` : `![](${url})`;
|
||||
let content = i.state.commentForm.content;
|
||||
content = content ? `${content}\n${imageMarkdown}` : imageMarkdown;
|
||||
i.state.commentForm.content = content;
|
||||
i.state.imageLoading = false;
|
||||
i.setState(i.state);
|
||||
let textarea: any = document.getElementById(i.id);
|
||||
autosize.update(textarea);
|
||||
})
|
||||
.catch(error => {
|
||||
i.state.imageLoading = false;
|
||||
|
@ -373,10 +342,14 @@ export class CommentForm extends Component<CommentFormProps, CommentFormState> {
|
|||
if (UserService.Instance.user) {
|
||||
if (res.op == UserOperation.CreateComment) {
|
||||
let data = res.data as CommentResponse;
|
||||
this.handleFinished(data);
|
||||
if (data.comment.creator_id == UserService.Instance.user.id) {
|
||||
this.handleFinished();
|
||||
}
|
||||
} else if (res.op == UserOperation.EditComment) {
|
||||
let data = res.data as CommentResponse;
|
||||
this.handleFinished(data);
|
||||
if (data.comment.creator_id == UserService.Instance.user.id) {
|
||||
this.handleFinished();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
47
ui/src/components/comment-node.tsx
vendored
47
ui/src/components/comment-node.tsx
vendored
|
@ -132,7 +132,7 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> {
|
|||
>
|
||||
<div
|
||||
id={`comment-${node.comment.id}`}
|
||||
className={`details comment-node border-top border-light py-2 ${
|
||||
className={`details comment-node border-top border-light ${
|
||||
this.isCommentNew ? 'mark' : ''
|
||||
}`}
|
||||
style={
|
||||
|
@ -148,7 +148,7 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> {
|
|||
'ml-2'
|
||||
}`}
|
||||
>
|
||||
<div class="d-flex flex-wrap align-items-center text-muted small">
|
||||
<div class="d-flex flex-wrap align-items-center mb-1 mt-1 text-muted small">
|
||||
<span class="mr-2">
|
||||
<UserListing
|
||||
user={{
|
||||
|
@ -294,6 +294,25 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> {
|
|||
)}
|
||||
</button>
|
||||
)}
|
||||
<button
|
||||
class="btn btn-link btn-animate text-muted"
|
||||
onClick={linkEvent(this, this.handleSaveCommentClick)}
|
||||
data-tippy-content={
|
||||
node.comment.saved ? i18n.t('unsave') : i18n.t('save')
|
||||
}
|
||||
>
|
||||
{this.state.saveLoading ? (
|
||||
this.loadingIcon
|
||||
) : (
|
||||
<svg
|
||||
class={`icon icon-inline ${
|
||||
node.comment.saved && 'text-warning'
|
||||
}`}
|
||||
>
|
||||
<use xlinkHref="#icon-star"></use>
|
||||
</svg>
|
||||
)}
|
||||
</button>
|
||||
<button
|
||||
class="btn btn-link btn-animate text-muted"
|
||||
onClick={linkEvent(this, this.handleReplyClick)}
|
||||
|
@ -329,30 +348,6 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> {
|
|||
</button>
|
||||
)}
|
||||
{!this.props.showContext && this.linkBtn}
|
||||
<button
|
||||
class="btn btn-link btn-animate text-muted"
|
||||
onClick={linkEvent(
|
||||
this,
|
||||
this.handleSaveCommentClick
|
||||
)}
|
||||
data-tippy-content={
|
||||
node.comment.saved
|
||||
? i18n.t('unsave')
|
||||
: i18n.t('save')
|
||||
}
|
||||
>
|
||||
{this.state.saveLoading ? (
|
||||
this.loadingIcon
|
||||
) : (
|
||||
<svg
|
||||
class={`icon icon-inline ${
|
||||
node.comment.saved && 'text-warning'
|
||||
}`}
|
||||
>
|
||||
<use xlinkHref="#icon-star"></use>
|
||||
</svg>
|
||||
)}
|
||||
</button>
|
||||
<button
|
||||
className="btn btn-link btn-animate text-muted"
|
||||
onClick={linkEvent(this, this.handleViewSource)}
|
||||
|
|
6
ui/src/components/community-form.tsx
vendored
6
ui/src/components/community-form.tsx
vendored
|
@ -207,11 +207,7 @@ export class CommunityForm extends Component<
|
|||
)}
|
||||
<div class="form-group row">
|
||||
<div class="col-12">
|
||||
<button
|
||||
type="submit"
|
||||
class="btn btn-secondary mr-2"
|
||||
disabled={this.state.loading}
|
||||
>
|
||||
<button type="submit" class="btn btn-secondary mr-2">
|
||||
{this.state.loading ? (
|
||||
<svg class="icon icon-spinner spin">
|
||||
<use xlinkHref="#icon-spinner"></use>
|
||||
|
|
20
ui/src/components/inbox.tsx
vendored
20
ui/src/components/inbox.tsx
vendored
|
@ -123,10 +123,7 @@ export class Inbox extends Component<any, InboxState> {
|
|||
this.state.unreadOrAll == UnreadOrAll.Unread && (
|
||||
<ul class="list-inline mb-1 text-muted small font-weight-bold">
|
||||
<li className="list-inline-item">
|
||||
<span
|
||||
class="pointer"
|
||||
onClick={linkEvent(this, this.markAllAsRead)}
|
||||
>
|
||||
<span class="pointer" onClick={this.markAllAsRead}>
|
||||
{i18n.t('mark_all_as_read')}
|
||||
</span>
|
||||
</li>
|
||||
|
@ -395,14 +392,8 @@ export class Inbox extends Component<any, InboxState> {
|
|||
this.refetch();
|
||||
}
|
||||
|
||||
markAllAsRead(i: Inbox) {
|
||||
markAllAsRead() {
|
||||
WebSocketService.Instance.markAllAsRead();
|
||||
i.state.replies = [];
|
||||
i.state.mentions = [];
|
||||
i.state.messages = [];
|
||||
i.sendUnreadCount();
|
||||
window.scrollTo(0, 0);
|
||||
i.setState(i.state);
|
||||
}
|
||||
|
||||
parseMessage(msg: WebSocketJsonResponse) {
|
||||
|
@ -456,7 +447,12 @@ export class Inbox extends Component<any, InboxState> {
|
|||
this.setState(this.state);
|
||||
setupTippy();
|
||||
} else if (res.op == UserOperation.MarkAllAsRead) {
|
||||
// Moved to be instant
|
||||
this.state.replies = [];
|
||||
this.state.mentions = [];
|
||||
this.state.messages = [];
|
||||
this.sendUnreadCount();
|
||||
window.scrollTo(0, 0);
|
||||
this.setState(this.state);
|
||||
} else if (res.op == UserOperation.EditComment) {
|
||||
let data = res.data as CommentResponse;
|
||||
editCommentRes(data, this.state.replies);
|
||||
|
|
1
ui/src/components/login.tsx
vendored
1
ui/src/components/login.tsx
vendored
|
@ -111,7 +111,6 @@ export class Login extends Component<any, State> {
|
|||
required
|
||||
/>
|
||||
<button
|
||||
type="button"
|
||||
disabled={!validEmail(this.state.loginForm.username_or_email)}
|
||||
onClick={linkEvent(this, this.handlePasswordReset)}
|
||||
className="btn p-0 btn-link d-inline-block float-right text-muted small font-weight-bold"
|
||||
|
|
6
ui/src/components/navbar.tsx
vendored
6
ui/src/components/navbar.tsx
vendored
|
@ -22,7 +22,7 @@ import {
|
|||
} from '../interfaces';
|
||||
import {
|
||||
wsJsonToRes,
|
||||
pictrsAvatarThumbnail,
|
||||
pictshareAvatarThumbnail,
|
||||
showAvatars,
|
||||
fetchLimit,
|
||||
isCommentType,
|
||||
|
@ -218,7 +218,7 @@ export class Navbar extends Component<any, NavbarState> {
|
|||
<span>
|
||||
{UserService.Instance.user.avatar && showAvatars() && (
|
||||
<img
|
||||
src={pictrsAvatarThumbnail(
|
||||
src={pictshareAvatarThumbnail(
|
||||
UserService.Instance.user.avatar
|
||||
)}
|
||||
height="32"
|
||||
|
@ -381,7 +381,7 @@ export class Navbar extends Component<any, NavbarState> {
|
|||
|
||||
requestNotificationPermission() {
|
||||
if (UserService.Instance.user) {
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
if (!Notification) {
|
||||
toast(i18n.t('notifications_error'), 'danger');
|
||||
return;
|
||||
|
|
42
ui/src/components/post-form.tsx
vendored
42
ui/src/components/post-form.tsx
vendored
|
@ -35,7 +35,6 @@ import {
|
|||
setupTribute,
|
||||
setupTippy,
|
||||
emojiPicker,
|
||||
pictrsDeleteToast,
|
||||
} from '../utils';
|
||||
import autosize from 'autosize';
|
||||
import Tribute from 'tributejs/src/Tribute.js';
|
||||
|
@ -284,7 +283,7 @@ export class PostForm extends Component<PostFormProps, PostFormState> {
|
|||
/>
|
||||
{this.state.previewMode && (
|
||||
<div
|
||||
className="card card-body md-div"
|
||||
className="md-div"
|
||||
dangerouslySetInnerHTML={mdToHtml(this.state.postForm.body)}
|
||||
/>
|
||||
)}
|
||||
|
@ -360,9 +359,7 @@ export class PostForm extends Component<PostFormProps, PostFormState> {
|
|||
<div class="form-group row">
|
||||
<div class="col-sm-10">
|
||||
<button
|
||||
disabled={
|
||||
!this.state.postForm.community_id || this.state.loading
|
||||
}
|
||||
disabled={!this.state.postForm.community_id}
|
||||
type="submit"
|
||||
class="btn btn-secondary mr-2"
|
||||
>
|
||||
|
@ -408,12 +405,6 @@ export class PostForm extends Component<PostFormProps, PostFormState> {
|
|||
|
||||
handlePostSubmit(i: PostForm, event: any) {
|
||||
event.preventDefault();
|
||||
|
||||
// Coerce empty url string to undefined
|
||||
if (i.state.postForm.url && i.state.postForm.url === '') {
|
||||
i.state.postForm.url = undefined;
|
||||
}
|
||||
|
||||
if (i.props.post) {
|
||||
WebSocketService.Instance.editPost(i.state.postForm);
|
||||
} else {
|
||||
|
@ -527,9 +518,9 @@ export class PostForm extends Component<PostFormProps, PostFormState> {
|
|||
file = event;
|
||||
}
|
||||
|
||||
const imageUploadUrl = `/pictrs/image`;
|
||||
const imageUploadUrl = `/pictshare/api/upload.php`;
|
||||
const formData = new FormData();
|
||||
formData.append('images[]', file);
|
||||
formData.append('file', file);
|
||||
|
||||
i.state.imageLoading = true;
|
||||
i.setState(i.state);
|
||||
|
@ -540,26 +531,13 @@ export class PostForm extends Component<PostFormProps, PostFormState> {
|
|||
})
|
||||
.then(res => res.json())
|
||||
.then(res => {
|
||||
console.log('pictrs upload:');
|
||||
console.log(res);
|
||||
if (res.msg == 'ok') {
|
||||
let hash = res.files[0].file;
|
||||
let url = `${window.location.origin}/pictrs/image/${hash}`;
|
||||
let deleteToken = res.files[0].delete_token;
|
||||
let deleteUrl = `${window.location.origin}/pictrs/image/delete/${deleteToken}/${hash}`;
|
||||
i.state.postForm.url = url;
|
||||
i.state.imageLoading = false;
|
||||
i.setState(i.state);
|
||||
pictrsDeleteToast(
|
||||
i18n.t('click_to_delete_picture'),
|
||||
i18n.t('picture_deleted'),
|
||||
deleteUrl
|
||||
);
|
||||
} else {
|
||||
i.state.imageLoading = false;
|
||||
i.setState(i.state);
|
||||
toast(JSON.stringify(res), 'danger');
|
||||
let url = `${window.location.origin}/pictshare/${encodeURI(res.url)}`;
|
||||
if (res.filetype == 'mp4') {
|
||||
url += '/raw';
|
||||
}
|
||||
i.state.postForm.url = url;
|
||||
i.state.imageLoading = false;
|
||||
i.setState(i.state);
|
||||
})
|
||||
.catch(error => {
|
||||
i.state.imageLoading = false;
|
||||
|
|
10
ui/src/components/post-listing.tsx
vendored
10
ui/src/components/post-listing.tsx
vendored
|
@ -28,7 +28,7 @@ import {
|
|||
isImage,
|
||||
isVideo,
|
||||
getUnixTime,
|
||||
pictrsImage,
|
||||
pictshareImage,
|
||||
setupTippy,
|
||||
previewLines,
|
||||
} from '../utils';
|
||||
|
@ -161,15 +161,15 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
|
|||
getImage(thumbnail: boolean = false) {
|
||||
let post = this.props.post;
|
||||
if (isImage(post.url)) {
|
||||
if (post.url.includes('pictrs')) {
|
||||
return pictrsImage(post.url, thumbnail);
|
||||
if (post.url.includes('pictshare')) {
|
||||
return pictshareImage(post.url, thumbnail);
|
||||
} else if (post.thumbnail_url) {
|
||||
return pictrsImage(post.thumbnail_url, thumbnail);
|
||||
return pictshareImage(post.thumbnail_url, thumbnail);
|
||||
} else {
|
||||
return post.url;
|
||||
}
|
||||
} else if (post.thumbnail_url) {
|
||||
return pictrsImage(post.thumbnail_url, thumbnail);
|
||||
return pictshareImage(post.thumbnail_url, thumbnail);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
8
ui/src/components/private-message-form.tsx
vendored
8
ui/src/components/private-message-form.tsx
vendored
|
@ -154,7 +154,7 @@ export class PrivateMessageForm extends Component<
|
|||
/>
|
||||
{this.state.previewMode && (
|
||||
<div
|
||||
className="card card-body md-div"
|
||||
className="md-div"
|
||||
dangerouslySetInnerHTML={mdToHtml(
|
||||
this.state.privateMessageForm.content
|
||||
)}
|
||||
|
@ -183,11 +183,7 @@ export class PrivateMessageForm extends Component<
|
|||
)}
|
||||
<div class="form-group row">
|
||||
<div class="offset-sm-2 col-sm-10">
|
||||
<button
|
||||
type="submit"
|
||||
class="btn btn-secondary mr-2"
|
||||
disabled={this.state.loading}
|
||||
>
|
||||
<button type="submit" class="btn btn-secondary mr-2">
|
||||
{this.state.loading ? (
|
||||
<svg class="icon icon-spinner spin">
|
||||
<use xlinkHref="#icon-spinner"></use>
|
||||
|
|
24
ui/src/components/private-message.tsx
vendored
24
ui/src/components/private-message.tsx
vendored
|
@ -5,7 +5,12 @@ import {
|
|||
EditPrivateMessageForm,
|
||||
} from '../interfaces';
|
||||
import { WebSocketService, UserService } from '../services';
|
||||
import { mdToHtml, pictrsAvatarThumbnail, showAvatars, toast } from '../utils';
|
||||
import {
|
||||
mdToHtml,
|
||||
pictshareAvatarThumbnail,
|
||||
showAvatars,
|
||||
toast,
|
||||
} from '../utils';
|
||||
import { MomentTime } from './moment-time';
|
||||
import { PrivateMessageForm } from './private-message-form';
|
||||
import { i18n } from '../i18next';
|
||||
|
@ -73,7 +78,7 @@ export class PrivateMessage extends Component<
|
|||
<img
|
||||
height="32"
|
||||
width="32"
|
||||
src={pictrsAvatarThumbnail(
|
||||
src={pictshareAvatarThumbnail(
|
||||
this.mine
|
||||
? message.recipient_avatar
|
||||
: message.creator_avatar
|
||||
|
@ -139,9 +144,8 @@ export class PrivateMessage extends Component<
|
|||
}
|
||||
>
|
||||
<svg
|
||||
class={`icon icon-inline ${
|
||||
message.read && 'text-success'
|
||||
}`}
|
||||
class={`icon icon-inline ${message.read &&
|
||||
'text-success'}`}
|
||||
>
|
||||
<use xlinkHref="#icon-check"></use>
|
||||
</svg>
|
||||
|
@ -184,9 +188,8 @@ export class PrivateMessage extends Component<
|
|||
}
|
||||
>
|
||||
<svg
|
||||
class={`icon icon-inline ${
|
||||
message.deleted && 'text-danger'
|
||||
}`}
|
||||
class={`icon icon-inline ${message.deleted &&
|
||||
'text-danger'}`}
|
||||
>
|
||||
<use xlinkHref="#icon-trash"></use>
|
||||
</svg>
|
||||
|
@ -201,9 +204,8 @@ export class PrivateMessage extends Component<
|
|||
data-tippy-content={i18n.t('view_source')}
|
||||
>
|
||||
<svg
|
||||
class={`icon icon-inline ${
|
||||
this.state.viewSource && 'text-success'
|
||||
}`}
|
||||
class={`icon icon-inline ${this.state.viewSource &&
|
||||
'text-success'}`}
|
||||
>
|
||||
<use xlinkHref="#icon-file-text"></use>
|
||||
</svg>
|
||||
|
|
2
ui/src/components/search.tsx
vendored
2
ui/src/components/search.tsx
vendored
|
@ -22,7 +22,7 @@ import {
|
|||
fetchLimit,
|
||||
routeSearchTypeToEnum,
|
||||
routeSortTypeToEnum,
|
||||
pictrsAvatarThumbnail,
|
||||
pictshareAvatarThumbnail,
|
||||
showAvatars,
|
||||
toast,
|
||||
createCommentLikeRes,
|
||||
|
|
2
ui/src/components/sidebar.tsx
vendored
2
ui/src/components/sidebar.tsx
vendored
|
@ -11,7 +11,7 @@ import { WebSocketService, UserService } from '../services';
|
|||
import {
|
||||
mdToHtml,
|
||||
getUnixTime,
|
||||
pictrsAvatarThumbnail,
|
||||
pictshareAvatarThumbnail,
|
||||
showAvatars,
|
||||
} from '../utils';
|
||||
import { CommunityForm } from './community-form';
|
||||
|
|
8
ui/src/components/site-form.tsx
vendored
8
ui/src/components/site-form.tsx
vendored
|
@ -78,7 +78,7 @@ export class SiteForm extends Component<SiteFormProps, SiteFormState> {
|
|||
<form onSubmit={linkEvent(this, this.handleCreateSiteSubmit)}>
|
||||
<h5>{`${
|
||||
this.props.site
|
||||
? capitalizeFirstLetter(i18n.t('save'))
|
||||
? capitalizeFirstLetter(i18n.t('edit'))
|
||||
: capitalizeFirstLetter(i18n.t('name'))
|
||||
} ${i18n.t('your_site')}`}</h5>
|
||||
<div class="form-group row">
|
||||
|
@ -175,11 +175,7 @@ export class SiteForm extends Component<SiteFormProps, SiteFormState> {
|
|||
</div>
|
||||
<div class="form-group row">
|
||||
<div class="col-12">
|
||||
<button
|
||||
type="submit"
|
||||
class="btn btn-secondary mr-2"
|
||||
disabled={this.state.loading}
|
||||
>
|
||||
<button type="submit" class="btn btn-secondary mr-2">
|
||||
{this.state.loading ? (
|
||||
<svg class="icon icon-spinner spin">
|
||||
<use xlinkHref="#icon-spinner"></use>
|
||||
|
|
5
ui/src/components/sponsors.tsx
vendored
5
ui/src/components/sponsors.tsx
vendored
|
@ -10,9 +10,10 @@ interface SilverUser {
|
|||
}
|
||||
|
||||
let general = [
|
||||
'Ernest Wiśniewski',
|
||||
'HN',
|
||||
'Forrest Weghorst',
|
||||
'Serge Tarkovski',
|
||||
'alexx henry',
|
||||
'Nathan J. Goode',
|
||||
'Andre Vallestero',
|
||||
'NotTooHighToHack',
|
||||
];
|
||||
|
|
4
ui/src/components/user-listing.tsx
vendored
4
ui/src/components/user-listing.tsx
vendored
|
@ -1,7 +1,7 @@
|
|||
import { Component } from 'inferno';
|
||||
import { Link } from 'inferno-router';
|
||||
import { UserView } from '../interfaces';
|
||||
import { pictrsAvatarThumbnail, showAvatars } from '../utils';
|
||||
import { pictshareAvatarThumbnail, showAvatars } from '../utils';
|
||||
|
||||
interface UserOther {
|
||||
name: string;
|
||||
|
@ -25,7 +25,7 @@ export class UserListing extends Component<UserListingProps, any> {
|
|||
<img
|
||||
height="32"
|
||||
width="32"
|
||||
src={pictrsAvatarThumbnail(user.avatar)}
|
||||
src={pictshareAvatarThumbnail(user.avatar)}
|
||||
class="rounded-circle mr-2"
|
||||
/>
|
||||
)}
|
||||
|
|
25
ui/src/components/user.tsx
vendored
25
ui/src/components/user.tsx
vendored
|
@ -922,7 +922,7 @@ export class User extends Component<any, UserState> {
|
|||
|
||||
handleUserSettingsThemeChange(i: User, event: any) {
|
||||
i.state.userSettingsForm.theme = event.target.value;
|
||||
setTheme(event.target.value, true);
|
||||
setTheme(event.target.value);
|
||||
i.setState(i.state);
|
||||
}
|
||||
|
||||
|
@ -988,9 +988,9 @@ export class User extends Component<any, UserState> {
|
|||
handleImageUpload(i: User, event: any) {
|
||||
event.preventDefault();
|
||||
let file = event.target.files[0];
|
||||
const imageUploadUrl = `/pictrs/image`;
|
||||
const imageUploadUrl = `/pictshare/api/upload.php`;
|
||||
const formData = new FormData();
|
||||
formData.append('images[]', file);
|
||||
formData.append('file', file);
|
||||
|
||||
i.state.avatarLoading = true;
|
||||
i.setState(i.state);
|
||||
|
@ -1001,19 +1001,14 @@ export class User extends Component<any, UserState> {
|
|||
})
|
||||
.then(res => res.json())
|
||||
.then(res => {
|
||||
console.log('pictrs upload:');
|
||||
console.log(res);
|
||||
if (res.msg == 'ok') {
|
||||
let hash = res.files[0].file;
|
||||
let url = `${window.location.origin}/pictrs/image/${hash}`;
|
||||
i.state.userSettingsForm.avatar = url;
|
||||
i.state.avatarLoading = false;
|
||||
i.setState(i.state);
|
||||
} else {
|
||||
i.state.avatarLoading = false;
|
||||
i.setState(i.state);
|
||||
toast(JSON.stringify(res), 'danger');
|
||||
let url = `${window.location.origin}/pictshare/${res.url}`;
|
||||
if (res.filetype == 'mp4') {
|
||||
url += '/raw';
|
||||
}
|
||||
i.state.userSettingsForm.avatar = url;
|
||||
console.log(url);
|
||||
i.state.avatarLoading = false;
|
||||
i.setState(i.state);
|
||||
})
|
||||
.catch(error => {
|
||||
i.state.avatarLoading = false;
|
||||
|
|
10
ui/src/i18next.ts
vendored
10
ui/src/i18next.ts
vendored
|
@ -16,14 +16,9 @@ import { fi } from './translations/fi';
|
|||
import { ca } from './translations/ca';
|
||||
import { fa } from './translations/fa';
|
||||
import { hi } from './translations/hi';
|
||||
import { pl } from './translations/pl';
|
||||
import { pt_BR } from './translations/pt_BR';
|
||||
import { ja } from './translations/ja';
|
||||
import { ka } from './translations/ka';
|
||||
import { gl } from './translations/gl';
|
||||
import { tr } from './translations/tr';
|
||||
import { hu } from './translations/hu';
|
||||
import { uk } from './translations/uk';
|
||||
|
||||
// https://github.com/nimbusec-oss/inferno-i18next/blob/master/tests/T.test.js#L66
|
||||
const resources = {
|
||||
|
@ -44,13 +39,8 @@ const resources = {
|
|||
fi,
|
||||
ca,
|
||||
fa,
|
||||
pl,
|
||||
pt_BR,
|
||||
ja,
|
||||
gl,
|
||||
tr,
|
||||
hu,
|
||||
uk,
|
||||
};
|
||||
|
||||
function format(value: any, format: any, lng: any): any {
|
||||
|
|
3
ui/src/index.html
vendored
3
ui/src/index.html
vendored
|
@ -15,8 +15,7 @@
|
|||
<link rel="stylesheet" type="text/css" href="/static/assets/css/toastify.css" />
|
||||
<link rel="stylesheet" type="text/css" href="/static/assets/css/selectr.min.css" />
|
||||
<link rel="stylesheet" type="text/css" href="/static/assets/css/tippy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="/static/assets/css/themes/litely.min.css" id="default-light" media="(prefers-color-scheme: light)" />
|
||||
<link rel="stylesheet" type="text/css" href="/static/assets/css/themes/darkly.min.css" id="default-dark" media="(prefers-color-scheme: no-preference), (prefers-color-scheme: dark)" />
|
||||
<link rel="stylesheet" type="text/css" href="/static/assets/css/themes/darkly.min.css" id="darkly" />
|
||||
<link rel="stylesheet" type="text/css" href="/static/assets/css/main.css" />
|
||||
|
||||
<!-- Scripts -->
|
||||
|
|
4
ui/src/services/UserService.ts
vendored
4
ui/src/services/UserService.ts
vendored
|
@ -41,7 +41,9 @@ export class UserService {
|
|||
|
||||
private setUser(jwt: string) {
|
||||
this.user = jwt_decode(jwt);
|
||||
setTheme(this.user.theme, true);
|
||||
if (this.user.theme != 'darkly') {
|
||||
setTheme(this.user.theme);
|
||||
}
|
||||
this.sub.next({ user: this.user });
|
||||
console.log(this.user);
|
||||
}
|
||||
|
|
122
ui/src/utils.ts
vendored
122
ui/src/utils.ts
vendored
|
@ -12,15 +12,10 @@ import 'moment/locale/it';
|
|||
import 'moment/locale/fi';
|
||||
import 'moment/locale/ca';
|
||||
import 'moment/locale/fa';
|
||||
import 'moment/locale/pl';
|
||||
import 'moment/locale/pt-br';
|
||||
import 'moment/locale/ja';
|
||||
import 'moment/locale/ka';
|
||||
import 'moment/locale/hi';
|
||||
import 'moment/locale/gl';
|
||||
import 'moment/locale/tr';
|
||||
import 'moment/locale/hu';
|
||||
import 'moment/locale/uk';
|
||||
|
||||
import {
|
||||
UserOperation,
|
||||
|
@ -71,20 +66,15 @@ export const languages = [
|
|||
{ code: 'eo', name: 'Esperanto' },
|
||||
{ code: 'es', name: 'Español' },
|
||||
{ code: 'de', name: 'Deutsch' },
|
||||
{ code: 'gl', name: 'Galego' },
|
||||
{ code: 'hu', name: 'Magyar Nyelv' },
|
||||
{ code: 'ka', name: 'ქართული ენა' },
|
||||
{ code: 'hi', name: 'मानक हिन्दी' },
|
||||
{ code: 'fa', name: 'فارسی' },
|
||||
{ code: 'ja', name: '日本語' },
|
||||
{ code: 'pl', name: 'Polski' },
|
||||
{ code: 'pt_BR', name: 'Português Brasileiro' },
|
||||
{ code: 'zh', name: '中文' },
|
||||
{ code: 'fi', name: 'Suomi' },
|
||||
{ code: 'fr', name: 'Français' },
|
||||
{ code: 'sv', name: 'Svenska' },
|
||||
{ code: 'tr', name: 'Türkçe' },
|
||||
{ code: 'uk', name: 'українська мова' },
|
||||
{ code: 'ru', name: 'Русский' },
|
||||
{ code: 'nl', name: 'Nederlands' },
|
||||
{ code: 'it', name: 'Italiano' },
|
||||
|
@ -103,7 +93,6 @@ export const themes = [
|
|||
'vaporwave',
|
||||
'vaporwave-dark',
|
||||
'i386',
|
||||
'litely',
|
||||
];
|
||||
|
||||
export const emojiPicker = new EmojiButton({
|
||||
|
@ -114,26 +103,11 @@ export const emojiPicker = new EmojiButton({
|
|||
// TODO i18n
|
||||
});
|
||||
|
||||
const DEFAULT_ALPHABET =
|
||||
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
|
||||
|
||||
function getRandomCharFromAlphabet(alphabet: string): string {
|
||||
return alphabet.charAt(Math.floor(Math.random() * alphabet.length));
|
||||
}
|
||||
|
||||
export function randomStr(
|
||||
idDesiredLength: number = 20,
|
||||
alphabet = DEFAULT_ALPHABET
|
||||
): string {
|
||||
/**
|
||||
* Create n-long array and map it to random chars from given alphabet.
|
||||
* Then join individual chars as string
|
||||
*/
|
||||
return Array.from({ length: idDesiredLength })
|
||||
.map(() => {
|
||||
return getRandomCharFromAlphabet(alphabet);
|
||||
})
|
||||
.join('');
|
||||
export function randomStr() {
|
||||
return Math.random()
|
||||
.toString(36)
|
||||
.replace(/[^a-z]+/g, '')
|
||||
.substr(2, 10);
|
||||
}
|
||||
|
||||
export function wsJsonToRes(msg: WebSocketJsonResponse): WebSocketResponse {
|
||||
|
@ -392,8 +366,6 @@ export function getMomentLanguage(): string {
|
|||
lang = 'ca';
|
||||
} else if (lang.startsWith('fa')) {
|
||||
lang = 'fa';
|
||||
} else if (lang.startsWith('pl')) {
|
||||
lang = 'pl';
|
||||
} else if (lang.startsWith('pt')) {
|
||||
lang = 'pt-br';
|
||||
} else if (lang.startsWith('ja')) {
|
||||
|
@ -406,21 +378,13 @@ export function getMomentLanguage(): string {
|
|||
lang = 'el';
|
||||
} else if (lang.startsWith('eu')) {
|
||||
lang = 'eu';
|
||||
} else if (lang.startsWith('gl')) {
|
||||
lang = 'gl';
|
||||
} else if (lang.startsWith('tr')) {
|
||||
lang = 'tr';
|
||||
} else if (lang.startsWith('hu')) {
|
||||
lang = 'hu';
|
||||
} else if (lang.startsWith('uk')) {
|
||||
lang = 'uk';
|
||||
} else {
|
||||
lang = 'en';
|
||||
}
|
||||
return lang;
|
||||
}
|
||||
|
||||
export function setTheme(theme: string = 'darkly', loggedIn: boolean = false) {
|
||||
export function setTheme(theme: string = 'darkly') {
|
||||
// unload all the other themes
|
||||
for (var i = 0; i < themes.length; i++) {
|
||||
let styleSheet = document.getElementById(themes[i]);
|
||||
|
@ -429,23 +393,10 @@ export function setTheme(theme: string = 'darkly', loggedIn: boolean = false) {
|
|||
}
|
||||
}
|
||||
|
||||
// if the user is not logged in, we load the default themes and let the browser decide
|
||||
if (!loggedIn) {
|
||||
document.getElementById('default-light').removeAttribute('disabled');
|
||||
document.getElementById('default-dark').removeAttribute('disabled');
|
||||
} else {
|
||||
document
|
||||
.getElementById('default-light')
|
||||
.setAttribute('disabled', 'disabled');
|
||||
document
|
||||
.getElementById('default-dark')
|
||||
.setAttribute('disabled', 'disabled');
|
||||
|
||||
// Load the theme dynamically
|
||||
let cssLoc = `/static/assets/css/themes/${theme}.min.css`;
|
||||
loadCss(theme, cssLoc);
|
||||
document.getElementById(theme).removeAttribute('disabled');
|
||||
}
|
||||
// Load the theme dynamically
|
||||
let cssLoc = `/static/assets/css/themes/${theme}.min.css`;
|
||||
loadCss(theme, cssLoc);
|
||||
document.getElementById(theme).removeAttribute('disabled');
|
||||
}
|
||||
|
||||
export function loadCss(id: string, loc: string) {
|
||||
|
@ -469,12 +420,10 @@ export function objectFlip(obj: any) {
|
|||
return ret;
|
||||
}
|
||||
|
||||
export function pictrsAvatarThumbnail(src: string): string {
|
||||
// sample url: http://localhost:8535/pictrs/image/thumbnail256/gs7xuu.jpg
|
||||
let split = src.split('/pictrs/image');
|
||||
let out = `${split[0]}/pictrs/image/${
|
||||
canUseWebP() ? 'webp/' : ''
|
||||
}thumbnail96${split[1]}`;
|
||||
export function pictshareAvatarThumbnail(src: string): string {
|
||||
// sample url: http://localhost:8535/pictshare/gs7xuu.jpg
|
||||
let split = src.split('pictshare');
|
||||
let out = `${split[0]}pictshare/${canUseWebP() ? 'webp/' : ''}96${split[1]}`;
|
||||
return out;
|
||||
}
|
||||
|
||||
|
@ -486,18 +435,21 @@ export function showAvatars(): boolean {
|
|||
}
|
||||
|
||||
// Converts to image thumbnail
|
||||
export function pictrsImage(hash: string, thumbnail: boolean = false): string {
|
||||
let root = `/pictrs/image`;
|
||||
export function pictshareImage(
|
||||
hash: string,
|
||||
thumbnail: boolean = false
|
||||
): string {
|
||||
let root = `/pictshare`;
|
||||
|
||||
// Necessary for other servers / domains
|
||||
if (hash.includes('pictrs')) {
|
||||
let split = hash.split('/pictrs/image/');
|
||||
root = `${split[0]}/pictrs/image`;
|
||||
if (hash.includes('pictshare')) {
|
||||
let split = hash.split('/pictshare/');
|
||||
root = `${split[0]}/pictshare`;
|
||||
hash = split[1];
|
||||
}
|
||||
|
||||
let out = `${root}/${canUseWebP() ? 'webp/' : ''}${
|
||||
thumbnail ? 'thumbnail256/' : ''
|
||||
thumbnail ? '192/' : ''
|
||||
}${hash}`;
|
||||
return out;
|
||||
}
|
||||
|
@ -516,29 +468,6 @@ export function toast(text: string, background: string = 'success') {
|
|||
}).showToast();
|
||||
}
|
||||
|
||||
export function pictrsDeleteToast(
|
||||
clickToDeleteText: string,
|
||||
deletePictureText: string,
|
||||
deleteUrl: string
|
||||
) {
|
||||
let backgroundColor = `var(--light)`;
|
||||
let toast = Toastify({
|
||||
text: clickToDeleteText,
|
||||
backgroundColor: backgroundColor,
|
||||
gravity: 'top',
|
||||
position: 'right',
|
||||
duration: 10000,
|
||||
onClick: () => {
|
||||
if (toast) {
|
||||
window.location.replace(deleteUrl);
|
||||
alert(deletePictureText);
|
||||
toast.hideToast();
|
||||
}
|
||||
},
|
||||
close: true,
|
||||
}).showToast();
|
||||
}
|
||||
|
||||
export function messageToastify(
|
||||
creator: string,
|
||||
avatar: string,
|
||||
|
@ -552,11 +481,11 @@ export function messageToastify(
|
|||
text: `${body}<br />${creator}`,
|
||||
avatar: avatar,
|
||||
backgroundColor: backgroundColor,
|
||||
className: 'text-dark',
|
||||
className: 'text-body',
|
||||
close: true,
|
||||
gravity: 'top',
|
||||
position: 'right',
|
||||
duration: 5000,
|
||||
duration: 0,
|
||||
onClick: () => {
|
||||
if (toast) {
|
||||
toast.hideToast();
|
||||
|
@ -938,6 +867,7 @@ function canUseWebP() {
|
|||
return false;
|
||||
|
||||
// var elem = document.createElement('canvas');
|
||||
|
||||
// if (!!(elem.getContext && elem.getContext('2d'))) {
|
||||
// var testString = !(window.mozInnerScreenX == null) ? 'png' : 'webp';
|
||||
// // was able or not to get WebP representation
|
||||
|
|
2
ui/src/version.ts
vendored
2
ui/src/version.ts
vendored
|
@ -1 +1 @@
|
|||
export const version: string = 'v0.7.1';
|
||||
export const version: string = 'v0.6.71';
|
||||
|
|
3
ui/translations/en.json
vendored
3
ui/translations/en.json
vendored
|
@ -27,7 +27,6 @@
|
|||
"number_of_communities": "{{count}} Community",
|
||||
"number_of_communities_plural": "{{count}} Communities",
|
||||
"community_reqs": "lowercase, underscores, and no spaces.",
|
||||
"invalid_community_name": "Invalid name.",
|
||||
"create_private_message": "Create Private Message",
|
||||
"send_secure_message": "Send Secure Message",
|
||||
"send_message": "Send Message",
|
||||
|
@ -76,8 +75,6 @@
|
|||
"delete_account": "Delete Account",
|
||||
"delete_account_confirm":
|
||||
"Warning: this will permanently delete all your data. Enter your password to confirm.",
|
||||
"click_to_delete_picture": "Click to delete picture.",
|
||||
"picture_deleted": "Picture deleted.",
|
||||
"restore": "restore",
|
||||
"ban": "ban",
|
||||
"ban_from_site": "ban from site",
|
||||
|
|
16
ui/translations/es.json
vendored
16
ui/translations/es.json
vendored
|
@ -5,7 +5,7 @@
|
|||
"create_a_post": "Crear una publicación",
|
||||
"create_post": "Crear Publicación",
|
||||
"number_of_posts": "{{count}} Publicación",
|
||||
"number_of_posts_plural": "{{count}} Publicaciones",
|
||||
"number_of_posts_plural": "{{count}} Publicaciónes",
|
||||
"posts": "Publicaciones",
|
||||
"related_posts": "Estas publicaciones podrían estar relacionadas",
|
||||
"cross_posts": "Este link también ha sido publicado en:",
|
||||
|
@ -57,16 +57,16 @@
|
|||
"remove_as_admin": "eliminar como administrador",
|
||||
"appoint_as_admin": "designar como administrador",
|
||||
"remove": "eliminar",
|
||||
"removed": "eliminado por moderador",
|
||||
"removed": "eliminado",
|
||||
"locked": "bloqueado",
|
||||
"stickied": "fijado",
|
||||
"reason": "Razón",
|
||||
"mark_as_read": "marcar como leído",
|
||||
"mark_as_unread": "marcar como no leído",
|
||||
"delete": "eliminar",
|
||||
"deleted": "eliminado por creador",
|
||||
"deleted": "eliminado",
|
||||
"delete_account": "Eliminar Cuenta",
|
||||
"delete_account_confirm": "Advertencia: esta acción eliminará permanentemente toda tu información. Introduce tu contraseña para confirmar.",
|
||||
"delete_account_confirm": "Aviso: esta acción eliminará permanentemente tu información. Introduce tu contraseña para continuar",
|
||||
"restore": "restaurar",
|
||||
"ban": "expulsar",
|
||||
"ban_from_site": "expulsar del sitio",
|
||||
|
@ -169,7 +169,7 @@
|
|||
"theme": "Tema",
|
||||
"sponsors": "Patrocinadores",
|
||||
"sponsors_of_lemmy": "Patrocinadores de Lemmy",
|
||||
"sponsor_message": "Lemmy es software libre y de <1>código abierto</1>, lo que significa que nunca tendrá publicidad, monetización, ni capitales emprendedores. Tus donaciones apoyan directamente el desarrollo a tiempo completo del proyecto. Muchas gracias a las siguientes personas:",
|
||||
"sponsor_message": "Lemmy es software libre y de <1>código abierto</1>, lo que significa que no tendrá publicidades, monetización, ni capitales emprendedores, nunca. Tus donaciones apoyan directamente el desarrollo a tiempo completo del proyecto. Muchas gracias a las siguientes personas:",
|
||||
"support_on_patreon": "Apoyo en Patreon",
|
||||
"support_on_liberapay": "Apoyo en Liberapay",
|
||||
"donate_to_lemmy": "Donar a Lemmy",
|
||||
|
@ -250,8 +250,6 @@
|
|||
"banned_users": "Usuarios Baneados",
|
||||
"support_on_open_collective": "Dona en OpenCollective",
|
||||
"site_saved": "Sitio Guardado.",
|
||||
"emoji_picker": "Lista de emojis",
|
||||
"admin_settings": "Panel de Administración",
|
||||
"select_a_community": "Selecciona una comunidad",
|
||||
"invalid_username": "Nombre de usuario inválido."
|
||||
"emoji_picker": "Emoji Picker",
|
||||
"admin_settings": "Panel de Administración"
|
||||
}
|
||||
|
|
73
ui/translations/fr.json
vendored
73
ui/translations/fr.json
vendored
|
@ -10,7 +10,7 @@
|
|||
"related_posts": "Publications similaires",
|
||||
"cross_posts": "Ce lien a également été publié sur :",
|
||||
"cross_post": "publication croisée",
|
||||
"cross_posted_to": "publication croisée sur : ",
|
||||
"cross_posted_to": "publication croisée à : ",
|
||||
"comments": "Commentaires",
|
||||
"number_of_comments": "{{count}} Commentaire",
|
||||
"number_of_comments_plural": "{{count}} Commentaires",
|
||||
|
@ -25,59 +25,59 @@
|
|||
"list_of_communities": "Liste des communautés",
|
||||
"number_of_communities": "{{count}} Communauté",
|
||||
"number_of_communities_plural": "{{count}} Communautés",
|
||||
"community_reqs": "en minuscule, tirets du bas et sans espace.",
|
||||
"community_reqs": "en minuscule, sans espace et avec tiret du bas.",
|
||||
"create_private_message": "Créer un message privé",
|
||||
"send_secure_message": "Envoyer un message sécurisé",
|
||||
"send_message": "Envoyer le message",
|
||||
"send_secure_message": "Envoyer le message sécurisé",
|
||||
"send_message": "Enovyer le message",
|
||||
"message": "Message",
|
||||
"edit": "éditer",
|
||||
"reply": "répondre",
|
||||
"cancel": "Annuler",
|
||||
"preview": "Prévisualiser",
|
||||
"preview": "prévisualiser",
|
||||
"upload_image": "envoyer une image",
|
||||
"avatar": "Avatar",
|
||||
"upload_avatar": "Télécharger un avatar",
|
||||
"upload_avatar": "Télécharger une avatar",
|
||||
"show_avatars": "Afficher les avatars",
|
||||
"formatting_help": "aide au formatage",
|
||||
"formatting_help": "aide au formattage",
|
||||
"view_source": "voir la source",
|
||||
"unlock": "déverrouiller",
|
||||
"lock": "verrouiller",
|
||||
"unlock": "débloquer",
|
||||
"lock": "bloquer",
|
||||
"sticky": "épingler",
|
||||
"unsticky": "désépingler",
|
||||
"unsticky": "décrocher",
|
||||
"link": "lien",
|
||||
"archive_link": "archiver le lien",
|
||||
"mod": "modérateur",
|
||||
"mods": "modérateurs",
|
||||
"moderates": "Modérer",
|
||||
"settings": "Paramètres",
|
||||
"remove_as_mod": "supprimer comme modérateur",
|
||||
"appoint_as_mod": "nommer comme modérateur",
|
||||
"remove_as_mod": "Supprimer comme modérateur",
|
||||
"appoint_as_mod": "Nommer comme modérateur",
|
||||
"modlog": "Historique de modération",
|
||||
"admin": "admin",
|
||||
"admins": "admins",
|
||||
"remove_as_admin": "supprimer comme admin",
|
||||
"appoint_as_admin": "nommer comme admin",
|
||||
"remove_as_admin": "Supprimer comme admin",
|
||||
"appoint_as_admin": "Nommer comme admin",
|
||||
"remove": "retirer",
|
||||
"removed": "supprimé par le modérateur",
|
||||
"locked": "verrouillé",
|
||||
"removed": "retiré",
|
||||
"locked": "bloqué",
|
||||
"stickied": "épinglé",
|
||||
"reason": "Raison",
|
||||
"mark_as_read": "marquer comme lu",
|
||||
"mark_as_unread": "marquer comme non-lu",
|
||||
"delete": "supprimer",
|
||||
"deleted": "supprimé par le créateur",
|
||||
"deleted": "supprimé",
|
||||
"delete_account": "Supprimer le compte",
|
||||
"delete_account_confirm": "Avertissement : cette action supprimera toutes vos données de façons permanente ! Saisissez votre mot de passe pour confirmer.",
|
||||
"restore": "restaurer",
|
||||
"ban": "bannir",
|
||||
"ban_from_site": "bannir du site",
|
||||
"unban": "débannir",
|
||||
"unban_from_site": "débannir du site",
|
||||
"unban": "pardon",
|
||||
"unban_from_site": "faire revenir sur le site",
|
||||
"banned": "banni",
|
||||
"save": "sauvegarder",
|
||||
"unsave": "retirer",
|
||||
"create": "créer",
|
||||
"creator": "créateur",
|
||||
"creator": "createur",
|
||||
"username": "Nom d’utilisateur·rice",
|
||||
"email_or_username": "Email ou nom d’utilisateur·rice",
|
||||
"number_of_users": "{{count}} Utilisateur",
|
||||
|
@ -128,7 +128,7 @@
|
|||
"login_sign_up": "Se connecter / S’inscrire",
|
||||
"login": "Se connecter",
|
||||
"sign_up": "S’inscrire",
|
||||
"notifications_error": "Les notifications de bureau ne sont pas disponibles sur votre navigateur. Essayez Firefox ou Chrome.",
|
||||
"notifications_error": "Les notifications de bureau ne sont pas discponibles sur votre navigateur. Essayez Firefox ou Chrome.",
|
||||
"unread_messages": "Messages non-lu",
|
||||
"messages": "Messages",
|
||||
"password": "Mot de passe",
|
||||
|
@ -143,7 +143,7 @@
|
|||
"matrix_user_id": "Utilisateur Matrix",
|
||||
"private_message_disclaimer": "Attention : les messages privés dans Lemmy ne sont pas sécurisés. Veuillez créer un compte sur <1>Riot.im</1> pour pouvoir envoyer des messages sécurisés.",
|
||||
"send_notifications_to_email": "Envoyer des notifications par email",
|
||||
"optional": "Facultatif",
|
||||
"optional": "Optionnel",
|
||||
"expires": "Expire",
|
||||
"language": "Langue",
|
||||
"browser_default": "Défaut pour le navigateur",
|
||||
|
@ -171,12 +171,12 @@
|
|||
"theme": "Thème",
|
||||
"sponsors": "Sponsors",
|
||||
"sponsors_of_lemmy": "Sponsors de Lemmy",
|
||||
"sponsor_message": "Lemmy est un logiciel libre et <1>open-source</1>, sans jamais aucune publicité, ni monétisation ou capital-risque. Vos dons soutiennent directement le développement du projet à temps plein. Merci à toutes ces personnes :",
|
||||
"sponsor_message": "Lemmy est un logiciel libre et <1>open-source</1>, c’est à dire, il fonctionne sans publicité et sans monétisation aucune. Vos dons soutiennent directement le développement du projet à temps plein. Merci à toutes ces personnes :",
|
||||
"support_on_patreon": "Soutenir sur Patreon",
|
||||
"support_on_liberapay": "Soutenir sur Liberapay",
|
||||
"donate_to_lemmy": "Faire un don à Lemmy",
|
||||
"donate": "Faire un don",
|
||||
"general_sponsors": "Les Sponsors Généraux sont celles et ceux qui ont fait une donation entre 10 et 39$.",
|
||||
"general_sponsors": "Les sponsors généraux sont ceux garantissant de 10 à 39$.",
|
||||
"crypto": "Cryptomonnaies",
|
||||
"bitcoin": "Bitcoin",
|
||||
"ethereum": "Ethereum",
|
||||
|
@ -192,7 +192,7 @@
|
|||
"yes": "oui",
|
||||
"no": "non",
|
||||
"powered_by": "Propulsé par",
|
||||
"landing": "Lemmy est un <1>aggrégateur de liens</1>, similaire à Reddit et conçu pour fonctionner sur le <2>Fédivers</2>.<3></3>Il est auto-hébergeable, se met à jour en direct et est léger (<4>~80kB</4>). La fédération via ActivityPub est prévue dans sa feuille de route. <5></5>Lemmy est une <6>version beta très précoce</6> et de nombreuses fonctionnalités sont manquantes ou non fonctionnelles. <7></7>Vous pouvez signaler des bugs et suggérer de nouvelles fonctionnalités <8>ici.</8><9></9>Créé avec <10>Rust</10>, <11>Actix</11>, <12>Inferno</12>, <13>Typescript</13>.",
|
||||
"landing": "Lemmy est un <1>aggrégateur de liens</1>, similaire à reddit et conçu pour fonctionner sur le <2>fédiverse</2>.<3></3>Il est auto-hébergeable, se met à jour en direct et est léger (<4>~80kB</4>). La fédération via ActivityPub est prévue dans sa feuille de route. <5></5>Lemmy est une <6>version beta très précoce</6> et de nombreuses fonctionnalités sont manquantes ou non fonctionnelles. <7></7>Vous pouvez rapporter des bugs et suggérer de nouvelles fonctionnalités <8>ici.</8><9></9>Crée avec <10>Rust</10>, <11>Actix</11>, <12>Inferno</12>, <13>Typescript</13>.",
|
||||
"not_logged_in": "Vous n’êtes pas connecté.",
|
||||
"logged_in": "Vous êtes connecté.",
|
||||
"community_ban": "Vous avez été banni de cette communauté.",
|
||||
|
@ -201,7 +201,7 @@
|
|||
"couldnt_like_comment": "Impossible d’aimer le commentaire.",
|
||||
"couldnt_update_comment": "Impossible de mettre à jour le commentaire.",
|
||||
"couldnt_save_comment": "Impossible de sauvegarder le commentaire.",
|
||||
"couldnt_get_comments": "Impossible d'obtenir les commentaires.",
|
||||
"couldnt_get_comments": "Impossible de obtenir les commentaires.",
|
||||
"no_comment_edit_allowed": "Vous n’êtes pas autorisé à éditer ce commentaire.",
|
||||
"no_post_edit_allowed": "Vous n’êtes pas autorisé à éditer la publication.",
|
||||
"no_community_edit_allowed": "Vous n’êtes pas autorisé à éditer cette communauté.",
|
||||
|
@ -236,25 +236,20 @@
|
|||
"time": "Temps",
|
||||
"action": "Action",
|
||||
"more": "plus",
|
||||
"admin_settings": "Paramètres Administrateur",
|
||||
"admin_settings": "Paramètres administratifs",
|
||||
"site_config": "Configuration du site",
|
||||
"banned_users": "Utilisateurs interdits",
|
||||
"site_saved": "Site sauvegardé.",
|
||||
"support_on_open_collective": "Soutien sur OpenCollective",
|
||||
"support_on_open_collective": "Soutien à OpenCollective",
|
||||
"sorting_help": "aide au tri",
|
||||
"upvote": "Voter pour",
|
||||
"upvote": "Aime",
|
||||
"show_context": "Afficher le contexte",
|
||||
"block_leaving": "Vous êtes sûr de vouloir partir ?",
|
||||
"number_of_upvotes": "{{count}} Votes pour",
|
||||
"number_of_upvotes_plural": "{{count}} Votes contre",
|
||||
"number_of_downvotes": "{{count}} Vote contre",
|
||||
"number_of_downvotes_plural": "{{count}} Votes contre",
|
||||
"number_of_upvotes": "{{count}} votes pour",
|
||||
"number_of_upvotes_plural": "{{count}} votes contre",
|
||||
"number_of_downvotes": "{{count}} vote contre",
|
||||
"number_of_downvotes_plural": "{{count}} votes contre",
|
||||
"downvote": "Voter contre",
|
||||
"emoji_picker": "Sélecteur d’émojis",
|
||||
"silver_sponsors": "Les Sponsors Argent sont celles et ceux qui ont fait une donation de 40$ à Lemmy.",
|
||||
"select_a_community": "Sélectionner une communauté",
|
||||
"invalid_username": "Nom d'utilisateur invalide.",
|
||||
"invalid_community_name": "Nom invalide.",
|
||||
"click_to_delete_picture": "Cliquer pour supprimer l'image.",
|
||||
"picture_deleted": "Image supprimée."
|
||||
"silver_sponsors": "Les sponsors argent sont ceux et celles qui ont fait une donation de 40$ à Lemmy."
|
||||
}
|
||||
|
|
1
ui/translations/gl.json
vendored
1
ui/translations/gl.json
vendored
|
@ -1 +0,0 @@
|
|||
{}
|
154
ui/translations/hu.json
vendored
154
ui/translations/hu.json
vendored
|
@ -1,154 +0,0 @@
|
|||
{
|
||||
"post": "Elküld",
|
||||
"remove_post": "Bejegyzés eltávolítása",
|
||||
"no_posts": "Nincs bejegyzés.",
|
||||
"create_post": "Bejegyzés létrehozása",
|
||||
"create_a_post": "Bejegyzés létrehozása",
|
||||
"number_of_posts": "{{count}} bejegyzés",
|
||||
"number_of_posts_plural": "{{count}} bejegyzés",
|
||||
"posts": "Bejegyzések",
|
||||
"related_posts": "Ezek a bejegyzések kapcsolódhatnak",
|
||||
"cross_posts": "Ez a hivatkozás itt is be lett küldve:",
|
||||
"cross_post": "keresztbejegyzés",
|
||||
"comments": "Hozzászólások",
|
||||
"remove_comment": "Hozzászólások eltávolítása",
|
||||
"cross_posted_to": "beküldve ide is: ",
|
||||
"number_of_comments": "{{count}} hozzászólás",
|
||||
"number_of_comments_plural": "{{count}} hozzászólás",
|
||||
"communities": "Közösségek",
|
||||
"users": "Felhasználók",
|
||||
"create_a_community": "Közösség létrehozása",
|
||||
"select_a_community": "Közösség kiválasztása",
|
||||
"create_community": "Közösség létrehozása",
|
||||
"remove_community": "Közösség eltávolítása",
|
||||
"trending_communities": "Népszerű <1>közösségek</1>",
|
||||
"list_of_communities": "Közösségek listája",
|
||||
"community_reqs": "Kisbetű és alsóvonás megengedett, szóköz nem.",
|
||||
"create_private_message": "Privát üzenet létrehozása",
|
||||
"send_secure_message": "Biztonságos üzenet küldése",
|
||||
"send_message": "Üzenet küldése",
|
||||
"message": "Üzenet",
|
||||
"edit": "szerkesztés",
|
||||
"reply": "válasz",
|
||||
"more": "több",
|
||||
"cancel": "Mégse",
|
||||
"preview": "Előnézet",
|
||||
"upload_image": "kép feltöltése",
|
||||
"avatar": "Avatár",
|
||||
"upload_avatar": "Avatár feltöltése",
|
||||
"show_avatars": "Avatárok mutatása",
|
||||
"show_context": "Összefüggés mutatása",
|
||||
"sorting_help": "rendezési segítség",
|
||||
"view_source": "forrás megtekintése",
|
||||
"unlock": "zárolás feloldása",
|
||||
"lock": "zárolás",
|
||||
"sticky": "rögzítés",
|
||||
"unsticky": "rögzítés feloldása",
|
||||
"link": "hivatkozás",
|
||||
"mod": "moderátor",
|
||||
"mods": "moderátorok",
|
||||
"moderates": "Moderált közösségek",
|
||||
"settings": "Beállítások",
|
||||
"admin_settings": "Adminisztrációs beállítások",
|
||||
"remove_as_mod": "moderátori jog eltávolítása",
|
||||
"appoint_as_mod": "kinevezés moderátornak",
|
||||
"modlog": "Moderációs napló",
|
||||
"admin": "admin",
|
||||
"admins": "adminok",
|
||||
"remove_as_admin": "adminjog eltávolítása",
|
||||
"appoint_as_admin": "kinevezés adminnak",
|
||||
"remove": "eltávolítás",
|
||||
"locked": "zárolva",
|
||||
"stickied": "rögzítve",
|
||||
"reason": "Indok",
|
||||
"mark_as_read": "megjelölés olvasottnak",
|
||||
"mark_as_unread": "megjelölés olvasatlannak",
|
||||
"delete": "törlés",
|
||||
"deleted": "eltávolítva a szerző által",
|
||||
"delete_account": "FIók törlése",
|
||||
"restore": "visszaállítás",
|
||||
"ban": "kitiltás",
|
||||
"ban_from_site": "kitiltás az oldalról",
|
||||
"unban": "kitiltás visszavonása",
|
||||
"unban_from_site": "az oldalról történő kitiltás visszavonása",
|
||||
"banned": "kitiltva",
|
||||
"banned_users": "Kitiltott felhasználók",
|
||||
"save": "mentés",
|
||||
"unsave": "mentés visszavonása",
|
||||
"create": "létrehozás",
|
||||
"creator": "szerző",
|
||||
"username": "Felhasználónév",
|
||||
"number_of_points": "{{count}} pont",
|
||||
"number_of_points_plural": "{{count}} pont",
|
||||
"number_of_subscribers": "{{count}} feliratkozó",
|
||||
"number_of_subscribers_plural": "{{count}} feliratkozó",
|
||||
"name": "Név",
|
||||
"title": "Cím",
|
||||
"category": "Kategória",
|
||||
"both": "Mindkettő",
|
||||
"saved": "Mentve",
|
||||
"unsubscribe": "Leiratkozás",
|
||||
"subscribe": "Feliratkozás",
|
||||
"subscribed": "Feliratkozva",
|
||||
"subscribed_to_communities": "Követett <1>közösségek</1>",
|
||||
"number_of_communities": "{{count}} közösség",
|
||||
"number_of_communities_plural": "{{count}} közösség",
|
||||
"formatting_help": "formázási segítség",
|
||||
"archive_link": "hivatkozás archiválása",
|
||||
"site_config": "Oldalbeállítások",
|
||||
"removed": "eltávolítva egy mod által",
|
||||
"delete_account_confirm": "Figyelmeztetés: ez véglegesen törölni fogja az összes adatodat. A megerősítéshez írd be a jelszavad!",
|
||||
"email_or_username": "Email vagy felhasználónév",
|
||||
"number_of_users": "{{count}} felhasználó",
|
||||
"number_of_users_plural": "{{count}} felhasználó",
|
||||
"number_online": "{{count}} online felhasználó",
|
||||
"number_online_plural": "{{count}} online felhasználó",
|
||||
"subscribers": "Feliratkozók",
|
||||
"prev": "Előző",
|
||||
"next": "Következő",
|
||||
"sidebar": "Oldalsáv",
|
||||
"sort_type": "Rendezési mód",
|
||||
"hot": "Népszerű",
|
||||
"new": "Új",
|
||||
"old": "Régi",
|
||||
"invalid_community_name": "Érvénytelen név.",
|
||||
"inbox_for": "Bejövő üzenetek <1>{{user}}</1> részére",
|
||||
"overview": "Áttekintés",
|
||||
"notifications_error": "Az asztali értesítések nem érhetőek el a böngésződben. Próbáld meg Firefoxszal vagy Chrome-mal!",
|
||||
"no_email_setup": "Az email nincs megfelelően beállítva ezen a szerveren.",
|
||||
"click_to_delete_picture": "Kattints a kép törléséhez!",
|
||||
"picture_deleted": "Kép törölve.",
|
||||
"top_day": "A nap bejegyzése",
|
||||
"week": "Hét",
|
||||
"month": "Hónap",
|
||||
"year": "Év",
|
||||
"all": "Mind",
|
||||
"top": "Legjobb",
|
||||
"api": "API",
|
||||
"docs": "Dokumentáció",
|
||||
"inbox": "Bejövő üzenetek",
|
||||
"mark_all_as_read": "az összes megjelölése olvasottként",
|
||||
"type": "Típus",
|
||||
"unread": "Olvastalan",
|
||||
"replies": "Válaszok",
|
||||
"mentions": "Említések",
|
||||
"reply_sent": "Válasz elküldve",
|
||||
"message_sent": "Üzenet elküldve",
|
||||
"search": "Keresés",
|
||||
"view": "Nézet",
|
||||
"logout": "Kijelentkezés",
|
||||
"login_sign_up": "Bejelentkezés / Regisztráció",
|
||||
"login": "Bejelentkezés",
|
||||
"sign_up": "Regisztráció",
|
||||
"unread_messages": "Olvastalan üzenetek",
|
||||
"messages": "Üzenetek",
|
||||
"password": "Jelszó",
|
||||
"verify_password": "Jelszó megerősítése",
|
||||
"old_password": "Régi jelszó",
|
||||
"forgot_password": "elfelejtettem a jelszavamat",
|
||||
"reset_password_mail_sent": "Egy email el lett küldve a jelszó visszaállításához.",
|
||||
"password_change": "Jelszó megváltoztatása",
|
||||
"new_password": "Új jelszó",
|
||||
"email": "Email",
|
||||
"matrix_user_id": "Matrix felhasználó"
|
||||
}
|
13
ui/translations/it.json
vendored
13
ui/translations/it.json
vendored
|
@ -49,14 +49,14 @@
|
|||
"remove_as_admin": "rimuovi come amministratore",
|
||||
"appoint_as_admin": "nomina come amministratore",
|
||||
"remove": "rimuovi",
|
||||
"removed": "rimosso da un moderatore",
|
||||
"removed": "rimosso",
|
||||
"locked": "bloccato",
|
||||
"stickied": "evidenziato",
|
||||
"reason": "Motivo",
|
||||
"mark_as_read": "segna come letto",
|
||||
"mark_as_unread": "segna come non letto",
|
||||
"delete": "cancella",
|
||||
"deleted": "eliminato dal creatore",
|
||||
"deleted": "cancellato",
|
||||
"delete_account": "Cancella Account",
|
||||
"delete_account_confirm": "Attenzione: stai per cancellare permanentemente tutti i tuoi dati. Inserisci la tua password per confermare questa azione.",
|
||||
"restore": "ripristina",
|
||||
|
@ -142,7 +142,7 @@
|
|||
"theme": "Tema",
|
||||
"sponsors": "Sponsor",
|
||||
"sponsors_of_lemmy": "Sponsor di Lemmy",
|
||||
"sponsor_message": "Lemmy è software libero e <1>open-source</1>, senza nessuna pubblicità, monetizzazione o investitori esterni, per sempre. Le tue donazioni sostengono direttamente lo sviluppo full-time del progetto. Si ringraziano le seguenti persone:",
|
||||
"sponsor_message": "Lemmy è software libero e <1>open-source</1>, il che significa nessuna pubblicità, monetizzazione o investitori esterni, per sempre. Le tue donazioni sostengono direttamente lo sviluppo full-time del progetto. Si ringraziano le seguenti persone:",
|
||||
"support_on_patreon": "Sostieni su Patreon",
|
||||
"support_on_liberapay": "Sostieni su Liberapay",
|
||||
"general_sponsors": "Gli sponsor generali sono quelli che hanno investito dai 10$ ai 39$ su Lemmy.",
|
||||
|
@ -251,10 +251,5 @@
|
|||
"no_private_message_edit_allowed": "Non hai i permessi per modificare un messaggio privato.",
|
||||
"time": "Tempo",
|
||||
"action": "Azione",
|
||||
"silver_sponsors": "Gli sponsor generali sono quelli che hanno investito 40$ su Lemmy.",
|
||||
"invalid_community_name": "Nome non valido.",
|
||||
"click_to_delete_picture": "Clicca per eliminare la foto.",
|
||||
"picture_deleted": "Foto eliminata.",
|
||||
"select_a_community": "Seleziona una comunità",
|
||||
"invalid_username": "Username non valido."
|
||||
"silver_sponsors": "Gli sponsor generali sono quelli che hanno investito 40$ su Lemmy."
|
||||
}
|
||||
|
|
12
ui/translations/pl.json
vendored
12
ui/translations/pl.json
vendored
|
@ -65,14 +65,14 @@
|
|||
"remove_as_admin": "wycofaj uprawnienia administratora",
|
||||
"appoint_as_admin": "przyznaj uprawnienia administratora",
|
||||
"remove": "usuń",
|
||||
"removed": "usunięte przez moderatora",
|
||||
"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 przez autora",
|
||||
"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óć",
|
||||
|
@ -189,7 +189,7 @@
|
|||
"theme": "Motyw",
|
||||
"sponsors": "Sponsorzy",
|
||||
"sponsors_of_lemmy": "Sponsorzy projektu Lemmy",
|
||||
"sponsor_message": "Lemmy jest wolnym, <1>otwartoźródłowym</1> oprogramowaniem, bez 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:",
|
||||
"sponsor_message": "Lemmy jest wolnym, <1>otwartoźródłowym</1> 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",
|
||||
|
@ -209,7 +209,7 @@
|
|||
"are_you_sure": "na pewno?",
|
||||
"no": "nie",
|
||||
"powered_by": "Powered by",
|
||||
"landing_0": "Lemmy jest <1>agregatorem linków</1> / alternatywą dla reddita. Jest przeznaczony do działania w ramach cyfrowej przestrzeni nazywanej <2>fediverse</2>. <3></3>Opiera się na samodzielnym hostingu, posiada aktualizowane na żywo wątki z komentarzami, i zajmuje bardzo mało miejsce (<4>~80kB</4>). Federacja w ramach sieci ActivityPub jest w planach. <5></5>Ta wersja jest <6>bardzo wczesną wersją beta</6>, co oznacza, że wiele funkcji nadal nie działa tak jak powinny. <7></7><8>Pod tym adresem</8> można sugerować nową funkcjonalność i zgłaszać błędy.<9></9>Stworzono z wykorzystaniem <10>Rust</10>, <11>Actix</11>, <12>Inferno</12>, <13>Typescript</13>.",
|
||||
"landing": "Lemmy jest <1>agregatorem linków</1> / alternatywą dla reddita. Jest przeznaczony do działania w ramach cyfrowej przestrzeni nazywanej <2>fediverse<2>. <3></3>Opiera się na samodzielnym hostingu, posiada aktualizowane na żywo wątki z komentarzami, i zajmuje bardzo mało miejsce (<4>~80kB</4>). Federacja w ramach sieci ActivityPub jest w planach. <5></5>Ta wersja jest <6>bardzo wczesną wersją beta</6>, co oznacza, że wiele funkcji nadal nie działa tak jak powinny. <7></7><8>Pod tym adresem</8> można sugerować nową funkcjonalność i zgłaszać błędy.<9></9>Stworzono z wykorzystaniem <10>Rust</10>, <11>Actix</11>, <12>Inferno</12>, <13>Typescript</13>.",
|
||||
"not_logged_in": "Nie jesteś zalogowana/y.",
|
||||
"logged_in": "Zalogowano.",
|
||||
"community_ban": "Zostałaś/eś zbanowana/y z tej społeczności.",
|
||||
|
@ -260,7 +260,5 @@
|
|||
"site_saved": "Witryna Zapisana.",
|
||||
"admin_settings": "Ustawienia Administratora",
|
||||
"emoji_picker": "Wybór Emoji",
|
||||
"silver_sponsors": "Srebrni Sponsorzy to ci, którzy wpłacili co najmniej $40 na Lemmiego.",
|
||||
"select_a_community": "Wybierz społeczność",
|
||||
"invalid_username": "Nieprawidłowa nazwa użytkownika."
|
||||
"silver_sponsors": "Srebrni Sponsorzy to ci, którzy wpłacili co najmniej $40 na Lemmiego."
|
||||
}
|
||||
|
|
1
ui/translations/tr.json
vendored
1
ui/translations/tr.json
vendored
|
@ -1 +0,0 @@
|
|||
{}
|
1
ui/translations/uk.json
vendored
1
ui/translations/uk.json
vendored
|
@ -1 +0,0 @@
|
|||
{}
|
12
ui/translations/zh.json
vendored
12
ui/translations/zh.json
vendored
|
@ -35,13 +35,13 @@
|
|||
"remove_as_admin": "移除管理权限",
|
||||
"appoint_as_admin": "添加管理权限",
|
||||
"remove": "移除",
|
||||
"removed": "已被管理员移除",
|
||||
"removed": "已移除",
|
||||
"locked": "已加锁",
|
||||
"reason": "原因",
|
||||
"mark_as_read": "标记未读",
|
||||
"mark_as_unread": "标记已读",
|
||||
"delete": "删除",
|
||||
"deleted": "作者已删除",
|
||||
"deleted": "已删除",
|
||||
"restore": "恢复",
|
||||
"ban": "禁止",
|
||||
"ban_from_site": "禁止此站点",
|
||||
|
@ -235,11 +235,5 @@
|
|||
"time": "时间",
|
||||
"action": "行动",
|
||||
"block_leaving": "确定要离开吗?",
|
||||
"show_context": "显示上下文",
|
||||
"admin_settings": "管理员设置",
|
||||
"site_config": "网站配置",
|
||||
"banned_users": "被禁止用户",
|
||||
"site_saved": "网站已保存",
|
||||
"emoji_picker": "选择表情",
|
||||
"invalid_username": "用户名无效"
|
||||
"show_context": "显示上下文"
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue