Compare commits
1 Commits
main
...
floreal/tr
Author | SHA1 | Date | |
---|---|---|---|
|
9be5804b3e |
@ -1,10 +0,0 @@
|
|||||||
[target.wasm32-unknown-unknown]
|
|
||||||
# required for clippy
|
|
||||||
rustflags = [
|
|
||||||
"--cfg", "web_sys_unstable_apis",
|
|
||||||
]
|
|
||||||
|
|
||||||
[target.x86_64-unknown-linux-gnu]
|
|
||||||
rustflags = [
|
|
||||||
"--cfg", "web_sys_unstable_apis",
|
|
||||||
]
|
|
@ -10,8 +10,8 @@ executors:
|
|||||||
type: boolean
|
type: boolean
|
||||||
default: false
|
default: false
|
||||||
docker:
|
docker:
|
||||||
- image: plumeorg/plume-buildenv:v0.8.0
|
- image: plumeorg/plume-buildenv:v0.0.9
|
||||||
- image: <<#parameters.postgres>>cimg/postgres:14.2<</parameters.postgres>><<^parameters.postgres>>alpine:latest<</parameters.postgres>>
|
- image: <<#parameters.postgres>>circleci/postgres:9.6-alpine<</parameters.postgres>><<^parameters.postgres>>alpine:latest<</parameters.postgres>>
|
||||||
environment:
|
environment:
|
||||||
POSTGRES_USER: postgres
|
POSTGRES_USER: postgres
|
||||||
POSTGRES_DB: plume
|
POSTGRES_DB: plume
|
||||||
@ -21,7 +21,6 @@ executors:
|
|||||||
RUST_TEST_THREADS: 1
|
RUST_TEST_THREADS: 1
|
||||||
FEATURES: <<#parameters.postgres>>postgres<</ parameters.postgres>><<^parameters.postgres>>sqlite<</parameters.postgres>>
|
FEATURES: <<#parameters.postgres>>postgres<</ parameters.postgres>><<^parameters.postgres>>sqlite<</parameters.postgres>>
|
||||||
DATABASE_URL: <<#parameters.postgres>>postgres://postgres@localhost/plume<</parameters.postgres>><<^parameters.postgres>>plume.sqlite<</parameters.postgres>>
|
DATABASE_URL: <<#parameters.postgres>>postgres://postgres@localhost/plume<</parameters.postgres>><<^parameters.postgres>>plume.sqlite<</parameters.postgres>>
|
||||||
ROCKET_SECRET_KEY: VN5xV1DN7XdpATadOCYcuGeR/dV0hHfgx9mx9TarLdM=
|
|
||||||
|
|
||||||
|
|
||||||
commands:
|
commands:
|
||||||
@ -38,7 +37,7 @@ commands:
|
|||||||
- restore_cache:
|
- restore_cache:
|
||||||
keys:
|
keys:
|
||||||
- v0-<< parameters.cache >>-{{ checksum "Cargo.lock" }}-{{ .Branch }}
|
- v0-<< parameters.cache >>-{{ checksum "Cargo.lock" }}-{{ .Branch }}
|
||||||
- v0-<< parameters.cache >>-{{ checksum "Cargo.lock" }}-main
|
- v0-<< parameters.cache >>-{{ checksum "Cargo.lock" }}-master
|
||||||
|
|
||||||
cache:
|
cache:
|
||||||
description: push cache
|
description: push cache
|
||||||
@ -63,7 +62,6 @@ commands:
|
|||||||
type: boolean
|
type: boolean
|
||||||
default: false
|
default: false
|
||||||
steps:
|
steps:
|
||||||
- run: rustup component add clippy --toolchain nightly-2022-07-19-x86_64-unknown-linux-gnu
|
|
||||||
- run: cargo clippy <<^parameters.no_feature>>--no-default-features --features="${FEATURES}"<</parameters.no_feature>> --release -p <<parameters.package>> -- -D warnings
|
- run: cargo clippy <<^parameters.no_feature>>--no-default-features --features="${FEATURES}"<</parameters.no_feature>> --release -p <<parameters.package>> -- -D warnings
|
||||||
|
|
||||||
run_with_coverage:
|
run_with_coverage:
|
||||||
@ -73,7 +71,7 @@ commands:
|
|||||||
type: string
|
type: string
|
||||||
steps:
|
steps:
|
||||||
- run: |
|
- run: |
|
||||||
export RUSTFLAGS="-Zprofile -Zfewer-names -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Clink-arg=-Xlinker -Clink-arg=--no-keep-memory -Clink-arg=-Xlinker -Clink-arg=--reduce-memory-overheads"
|
export RUSTFLAGS="-Zprofile -Zfewer-names -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Zno-landing-pads -Clink-arg=-Xlinker -Clink-arg=--no-keep-memory -Clink-arg=-Xlinker -Clink-arg=--reduce-memory-overheads"
|
||||||
export CARGO_INCREMENTAL=0
|
export CARGO_INCREMENTAL=0
|
||||||
<< parameters.cmd >>
|
<< parameters.cmd >>
|
||||||
|
|
||||||
@ -101,7 +99,7 @@ commands:
|
|||||||
steps:
|
steps:
|
||||||
- run: |
|
- run: |
|
||||||
cmd="cargo build <<#parameters.release>>--release<</parameters.release>> --no-default-features --features="${FEATURES}" -p <<parameters.package>> -j"
|
cmd="cargo build <<#parameters.release>>--release<</parameters.release>> --no-default-features --features="${FEATURES}" -p <<parameters.package>> -j"
|
||||||
for i in 16 4 2 1 1; do
|
for i in 36 4 2 1 1; do
|
||||||
$cmd $i && exit 0
|
$cmd $i && exit 0
|
||||||
done
|
done
|
||||||
exit 1
|
exit 1
|
||||||
@ -112,7 +110,6 @@ jobs:
|
|||||||
name: default
|
name: default
|
||||||
steps:
|
steps:
|
||||||
- restore_env
|
- restore_env
|
||||||
- run: rustup component add rustfmt --toolchain nightly-2022-07-19-x86_64-unknown-linux-gnu
|
|
||||||
- run: cargo fmt --all -- --check
|
- run: cargo fmt --all -- --check
|
||||||
|
|
||||||
clippy:
|
clippy:
|
||||||
@ -146,14 +143,11 @@ jobs:
|
|||||||
cache: <<#parameters.postgres>>postgres<</ parameters.postgres>><<^parameters.postgres>>sqlite<</parameters.postgres>>
|
cache: <<#parameters.postgres>>postgres<</ parameters.postgres>><<^parameters.postgres>>sqlite<</parameters.postgres>>
|
||||||
- run_with_coverage:
|
- run_with_coverage:
|
||||||
cmd: |
|
cmd: |
|
||||||
cargo build -p plume-cli --no-default-features --features=${FEATURES} -j 4
|
|
||||||
./target/debug/plm migration run
|
|
||||||
./target/debug/plm search init
|
|
||||||
cmd="cargo test --all --exclude plume-front --exclude plume-macro --no-run --no-default-features --features=${FEATURES} -j"
|
cmd="cargo test --all --exclude plume-front --exclude plume-macro --no-run --no-default-features --features=${FEATURES} -j"
|
||||||
for i in 16 4 2 1 1; do
|
for i in 36 4 2 1 1; do
|
||||||
$cmd $i && break
|
$cmd $i && break
|
||||||
done
|
done
|
||||||
cargo test --all --exclude plume-front --exclude plume-macro --no-default-features --features="${FEATURES}" -j1
|
cargo test --all --exclude plume-front --exclude plume-macro --no-default-features --features="${FEATURES}" -j1 -- --test-threads=1
|
||||||
- upload_coverage:
|
- upload_coverage:
|
||||||
type: unit
|
type: unit
|
||||||
- cache:
|
- cache:
|
||||||
@ -170,18 +164,18 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- restore_env:
|
- restore_env:
|
||||||
cache: <<#parameters.postgres>>postgres<</ parameters.postgres>><<^parameters.postgres>>sqlite<</parameters.postgres>>
|
cache: <<#parameters.postgres>>postgres<</ parameters.postgres>><<^parameters.postgres>>sqlite<</parameters.postgres>>
|
||||||
- run: wasm-pack build --target web --release plume-front
|
- run: cargo web deploy -p plume-front
|
||||||
- run_with_coverage:
|
- run_with_coverage:
|
||||||
cmd: |
|
cmd: |
|
||||||
cmd="cargo install --debug --no-default-features --features="${FEATURES}",test --force --path . -j"
|
cmd="cargo install --debug --no-default-features --features="${FEATURES}",test --force --path . -j"
|
||||||
for i in 16 4 2 1 1; do
|
for i in 36 4 2 1 1; do
|
||||||
$cmd $i && exit 0
|
$cmd $i && exit 0
|
||||||
done
|
done
|
||||||
exit 1
|
exit 1
|
||||||
- run_with_coverage:
|
- run_with_coverage:
|
||||||
cmd: |
|
cmd: |
|
||||||
cmd="cargo install --debug --no-default-features --features="${FEATURES}" --force --path plume-cli -j"
|
cmd="cargo install --debug --no-default-features --features="${FEATURES}" --force --path plume-cli -j"
|
||||||
for i in 16 4 2 1 1; do
|
for i in 36 4 2 1 1; do
|
||||||
$cmd $i && exit 0
|
$cmd $i && exit 0
|
||||||
done
|
done
|
||||||
exit 1
|
exit 1
|
||||||
@ -205,7 +199,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- restore_env:
|
- restore_env:
|
||||||
cache: release-<<#parameters.postgres>>postgres<</ parameters.postgres>><<^parameters.postgres>>sqlite<</parameters.postgres>>
|
cache: release-<<#parameters.postgres>>postgres<</ parameters.postgres>><<^parameters.postgres>>sqlite<</parameters.postgres>>
|
||||||
- run: wasm-pack build --target web --release plume-front
|
- run: cargo web deploy -p plume-front --release
|
||||||
- build:
|
- build:
|
||||||
package: plume
|
package: plume
|
||||||
release: true
|
release: true
|
||||||
@ -260,4 +254,4 @@ workflows:
|
|||||||
filters:
|
filters:
|
||||||
branches:
|
branches:
|
||||||
only:
|
only:
|
||||||
- /^main/
|
- /^master/
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
localhost {
|
localhost:443 {
|
||||||
reverse_proxy localhost:7878
|
proxy / localhost:7878 {
|
||||||
|
transparent
|
||||||
|
}
|
||||||
|
tls self_signed
|
||||||
}
|
}
|
||||||
|
@ -1,24 +1,21 @@
|
|||||||
FROM rust:1
|
FROM debian:stretch-20190326
|
||||||
ENV PATH="/root/.cargo/bin:${PATH}"
|
ENV PATH="/root/.cargo/bin:${PATH}"
|
||||||
|
|
||||||
#install native/circleci/build dependancies
|
#install native/circleci/build dependancies
|
||||||
RUN apt update &&\
|
RUN apt update &&\
|
||||||
apt install -y --no-install-recommends git ssh tar gzip ca-certificates default-jre&&\
|
apt install -y --no-install-recommends git ssh tar gzip ca-certificates default-jre&&\
|
||||||
echo "deb [trusted=yes] https://apt.fury.io/caddy/ /" \
|
apt install -y --no-install-recommends binutils-dev build-essential cmake curl gcc gettext git libcurl4-openssl-dev libdw-dev libelf-dev libiberty-dev libpq-dev libsqlite3-dev libssl-dev make openssl pkg-config postgresql postgresql-contrib python zlib1g-dev python3-pip zip unzip libclang-dev&&\
|
||||||
| tee -a /etc/apt/sources.list.d/caddy-fury.list &&\
|
|
||||||
wget -qO - https://artifacts.crowdin.com/repo/GPG-KEY-crowdin | apt-key add - &&\
|
|
||||||
echo "deb https://artifacts.crowdin.com/repo/deb/ /" > /etc/apt/sources.list.d/crowdin.list &&\
|
|
||||||
apt update &&\
|
|
||||||
apt install -y --no-install-recommends binutils-dev build-essential cmake curl gcc gettext git libcurl4-openssl-dev libdw-dev libelf-dev libiberty-dev libpq-dev libsqlite3-dev libssl-dev make openssl pkg-config postgresql postgresql-contrib python zlib1g-dev python3-dev python3-pip python3-setuptools zip unzip libclang-dev clang caddy crowdin3 &&\
|
|
||||||
rm -rf /var/lib/apt/lists/*
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
#stick rust environment
|
#install and configure rust
|
||||||
COPY rust-toolchain ./
|
RUN curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain nightly-2020-01-15 -y &&\
|
||||||
RUN rustup component add rustfmt clippy
|
rustup component add rustfmt clippy &&\
|
||||||
|
rustup component add rust-std --target wasm32-unknown-unknown
|
||||||
|
|
||||||
#compile some deps
|
#compile some deps
|
||||||
RUN cargo install wasm-pack &&\
|
RUN cargo install cargo-web &&\
|
||||||
cargo install grcov &&\
|
cargo install grcov &&\
|
||||||
|
strip /root/.cargo/bin/* &&\
|
||||||
rm -fr ~/.cargo/registry
|
rm -fr ~/.cargo/registry
|
||||||
|
|
||||||
#set some compilation parametters
|
#set some compilation parametters
|
||||||
@ -27,5 +24,14 @@ COPY cargo_config /root/.cargo/config
|
|||||||
#install selenium for front end tests
|
#install selenium for front end tests
|
||||||
RUN pip3 install selenium
|
RUN pip3 install selenium
|
||||||
|
|
||||||
#configure caddy
|
#install and configure caddy
|
||||||
|
RUN curl https://getcaddy.com | bash -s personal
|
||||||
COPY Caddyfile /Caddyfile
|
COPY Caddyfile /Caddyfile
|
||||||
|
|
||||||
|
#install crowdin
|
||||||
|
RUN mkdir /crowdin && cd /crowdin &&\
|
||||||
|
curl -O https://downloads.crowdin.com/cli/v2/crowdin-cli.zip &&\
|
||||||
|
unzip crowdin-cli.zip && rm crowdin-cli.zip &&\
|
||||||
|
cd * && mv crowdin-cli.jar /usr/local/bin && cd && rm -rf /crowdin &&\
|
||||||
|
/bin/echo -e '#!/bin/sh\njava -jar /usr/local/bin/crowdin-cli.jar $@' > /usr/local/bin/crowdin &&\
|
||||||
|
chmod +x /usr/local/bin/crowdin
|
||||||
|
@ -1 +0,0 @@
|
|||||||
nightly-2022-07-19
|
|
@ -3,5 +3,3 @@ data
|
|||||||
Dockerfile
|
Dockerfile
|
||||||
docker-compose.yml
|
docker-compose.yml
|
||||||
.env
|
.env
|
||||||
target
|
|
||||||
data
|
|
||||||
|
12
.env.sample
12
.env.sample
@ -15,9 +15,6 @@ DATABASE_URL=postgres://plume:plume@localhost/plume
|
|||||||
# The domain of your instance
|
# The domain of your instance
|
||||||
BASE_URL=plu.me
|
BASE_URL=plu.me
|
||||||
|
|
||||||
# Log level for each crate
|
|
||||||
RUST_LOG=info
|
|
||||||
|
|
||||||
# The secret key for private cookies and CSRF protection
|
# The secret key for private cookies and CSRF protection
|
||||||
# You can generate one with `openssl rand -base64 32`
|
# You can generate one with `openssl rand -base64 32`
|
||||||
ROCKET_SECRET_KEY=
|
ROCKET_SECRET_KEY=
|
||||||
@ -48,12 +45,3 @@ ROCKET_ADDRESS=127.0.0.1
|
|||||||
#PLUME_LOGO_192=icons/trwnh/paragraphs/plumeParagraphs192.png
|
#PLUME_LOGO_192=icons/trwnh/paragraphs/plumeParagraphs192.png
|
||||||
#PLUME_LOGO_256=icons/trwnh/paragraphs/plumeParagraphs256.png
|
#PLUME_LOGO_256=icons/trwnh/paragraphs/plumeParagraphs256.png
|
||||||
#PLUME_LOGO_512=icons/trwnh/paragraphs/plumeParagraphs512.png
|
#PLUME_LOGO_512=icons/trwnh/paragraphs/plumeParagraphs512.png
|
||||||
|
|
||||||
## LDAP CONFIG ##
|
|
||||||
# the object that will be bound is "${USER_NAME_ATTR}=${username},${BASE_DN}"
|
|
||||||
#LDAP_ADDR=ldap://127.0.0.1:1389
|
|
||||||
#LDAP_BASE_DN="ou=users,dc=your-org,dc=eu"
|
|
||||||
#LDAP_USER_NAME_ATTR=cn
|
|
||||||
#LDAP_USER_MAIL_ATTR=mail
|
|
||||||
#LDAP_TLS=false
|
|
||||||
|
|
||||||
|
10
.github/ISSUE_TEMPLATE/bug_report.md
vendored
10
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@ -7,16 +7,6 @@ assignees: ''
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
<!--
|
|
||||||
We would appreciated if you report a bug at our Gitea instance's issue page:
|
|
||||||
https://git.joinplu.me/Plume/Plume/issues
|
|
||||||
You can login to the Gitea with your GitHub account.
|
|
||||||
|
|
||||||
We welcome to receive bug reports here, GitHub, too.
|
|
||||||
-->
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Describe your bug, explaining how to reproduce it, and what was expected -->
|
<!-- Describe your bug, explaining how to reproduce it, and what was expected -->
|
||||||
|
|
||||||
|
|
||||||
|
9
.github/ISSUE_TEMPLATE/feature_request.md
vendored
9
.github/ISSUE_TEMPLATE/feature_request.md
vendored
@ -7,15 +7,6 @@ assignees: ''
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
<!--
|
|
||||||
We would appreciated if you request a feature at our Gitea instance's issue page:
|
|
||||||
https://git.joinplu.me/Plume/Plume/issues
|
|
||||||
You can login to the Gitea with your GitHub account.
|
|
||||||
|
|
||||||
We welcome to receive feature requests here, GitHub, too.
|
|
||||||
-->
|
|
||||||
|
|
||||||
|
|
||||||
**Is your feature request related to a problem? Please describe.**
|
**Is your feature request related to a problem? Please describe.**
|
||||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||||
|
|
||||||
|
6
.github/dependabot.yml
vendored
6
.github/dependabot.yml
vendored
@ -1,6 +0,0 @@
|
|||||||
version: 2
|
|
||||||
updates:
|
|
||||||
- package-ecosystem: cargo
|
|
||||||
directory: /
|
|
||||||
schedule:
|
|
||||||
interval: daily
|
|
7
.github/pull_request_template.md
vendored
7
.github/pull_request_template.md
vendored
@ -1,7 +0,0 @@
|
|||||||
<!--
|
|
||||||
We would appreciated if you report a bug at our Gitea instance's pull request page:
|
|
||||||
https://git.joinplu.me/Plume/Plume/pulls
|
|
||||||
You can login to the Gitea with your GitHub account.
|
|
||||||
|
|
||||||
We welcome to receive pull requests here, GitHub, too.
|
|
||||||
-->
|
|
30
.github/workflows/deploy-docker-latest.yaml
vendored
30
.github/workflows/deploy-docker-latest.yaml
vendored
@ -1,30 +0,0 @@
|
|||||||
name: cd
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- 'main'
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
docker:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
-
|
|
||||||
name: Set up QEMU
|
|
||||||
uses: docker/setup-qemu-action@v2
|
|
||||||
-
|
|
||||||
name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v2
|
|
||||||
-
|
|
||||||
name: Login to DockerHub
|
|
||||||
uses: docker/login-action@v2
|
|
||||||
with:
|
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
||||||
-
|
|
||||||
name: Build and push
|
|
||||||
id: docker_build
|
|
||||||
uses: docker/build-push-action@v3
|
|
||||||
with:
|
|
||||||
push: true
|
|
||||||
tags: plumeorg/plume:latest
|
|
36
.github/workflows/deploy-docker-tag.yaml
vendored
36
.github/workflows/deploy-docker-tag.yaml
vendored
@ -1,36 +0,0 @@
|
|||||||
name: cd
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
tags:
|
|
||||||
- '*.*.*'
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
docker:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
-
|
|
||||||
name: Set up QEMU
|
|
||||||
uses: docker/setup-qemu-action@v2
|
|
||||||
-
|
|
||||||
name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v2
|
|
||||||
-
|
|
||||||
name: Docker meta
|
|
||||||
id: meta
|
|
||||||
uses: docker/metadata-action@v3
|
|
||||||
with:
|
|
||||||
images: plumeorg/plume
|
|
||||||
-
|
|
||||||
name: Login to DockerHub
|
|
||||||
uses: docker/login-action@v2
|
|
||||||
with:
|
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
||||||
-
|
|
||||||
name: Build and push
|
|
||||||
id: docker_build
|
|
||||||
uses: docker/build-push-action@v3
|
|
||||||
with:
|
|
||||||
push: true
|
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
|
5
.gitignore
vendored
5
.gitignore
vendored
@ -18,7 +18,4 @@ tags.*
|
|||||||
search_index
|
search_index
|
||||||
.buildconfig
|
.buildconfig
|
||||||
__pycache__
|
__pycache__
|
||||||
.vscode/
|
/.vscode/
|
||||||
*-journal
|
|
||||||
.direnv/
|
|
||||||
build.log*
|
|
||||||
|
303
CHANGELOG.md
303
CHANGELOG.md
@ -1,303 +0,0 @@
|
|||||||
# Changelog
|
|
||||||
|
|
||||||
<!-- next-header -->
|
|
||||||
|
|
||||||
## [Unreleased] - ReleaseDate
|
|
||||||
|
|
||||||
### Added
|
|
||||||
|
|
||||||
- Add 'My feed' to i18n timeline name (#1084)
|
|
||||||
- Bidirectional support for user page header (#1092)
|
|
||||||
- Add non anonymous bind to LDAP server, taken from https://git.joinplu.me/Plume/Plume/src/branch/ldap-non-anon PR
|
|
||||||
|
|
||||||
### Changed
|
|
||||||
|
|
||||||
- Use blog title as slug (#1094, #1126, #1127)
|
|
||||||
- Bump Rust to nightly 2022-07-19 (#1119)
|
|
||||||
- Force LDAP simple bind with *cn* rdn instead of *uid*
|
|
||||||
- Update rust-toolchain to nightly-2023-04-14
|
|
||||||
- Update chrono from 0.4.0 to 0.4.31
|
|
||||||
- Update scheduled-thread-pool from 0.2.6 to 0.2.7
|
|
||||||
|
|
||||||
### Fixed
|
|
||||||
|
|
||||||
- Malfunction while creating a blog post in Persian (#1116)
|
|
||||||
- Email block list is ignored when email sign-up (#1122)
|
|
||||||
- Bug that some Activity Sytreams properties are not parsed properly (#1129)
|
|
||||||
- Allow empty avatar for remote users (#1129)
|
|
||||||
- Percent encode blog FQN for federation interoperability (#1129)
|
|
||||||
- The same to `preferredUsername` (#1129)
|
|
||||||
- Deprecation warnings during build process(see rust crate updates)
|
|
||||||
- Server error 500 creating new blog with white spaces inside title. Bug reported on https://git.joinplu.me/Plume/Plume/issues/1152
|
|
||||||
- Show _Subscribe_ button in column format instead of row format in screen smaller than 600px. https://git.lainoa.eus/aitzol/Plume/commit/db8cc6e7e8351a5d74f7ce0399126e13493c62d9
|
|
||||||
### To do
|
|
||||||
|
|
||||||
- Choose rdn via environment variables for LDAP simple bind
|
|
||||||
|
|
||||||
## [[0.7.2]] - 2022-05-11
|
|
||||||
|
|
||||||
### Added
|
|
||||||
|
|
||||||
- Basque language (#1013)
|
|
||||||
- Unit tests for ActivityPub (#1021)
|
|
||||||
- Move to action area after liking/boosting/commenting (#1074)
|
|
||||||
|
|
||||||
### Changed
|
|
||||||
|
|
||||||
- Bump Rust to nightly 2022-01-26 (#1015)
|
|
||||||
- Remove "Latest articles" timeline (#1069)
|
|
||||||
- Change order of timeline tabs (#1069, #1070, #1072)
|
|
||||||
- Migrate ActivityPub-related crates from activitypub 0.1 to activitystreams 0.7 (#1022)
|
|
||||||
|
|
||||||
### Fixed
|
|
||||||
|
|
||||||
- Add explanation of sign-up step at sign-up page when email sign-up mode (#1012)
|
|
||||||
- Add NOT NULL constraint to email_blocklist table fields (#1016)
|
|
||||||
- Don't fill empty content when switching rich editor (#1017)
|
|
||||||
- Fix accept header (#1058)
|
|
||||||
- Render 404 page instead of 500 when data is not found (#1062)
|
|
||||||
- Reuse reqwest client on broadcasting (#1059)
|
|
||||||
- Reduce broadcasting HTTP request at once to prevent them being timed out (#1068, #1071)
|
|
||||||
- Some ActivityPub data (#1021)
|
|
||||||
|
|
||||||
## [[0.7.1]] - 2022-01-12
|
|
||||||
|
|
||||||
### Added
|
|
||||||
|
|
||||||
- Introduce environment variable `MAIL_PORT` (#980)
|
|
||||||
- Introduce email sign-up feature (#636, #1002)
|
|
||||||
|
|
||||||
### Changed
|
|
||||||
|
|
||||||
- Some styling improvements (#976, #977, #978)
|
|
||||||
- Respond with error status code when error (#1002)
|
|
||||||
|
|
||||||
### Fiexed
|
|
||||||
|
|
||||||
- Fix comment link (#974)
|
|
||||||
- Fix a bug that prevents posting articles (#975)
|
|
||||||
- Fix a bug that notification page doesn't show (#981)
|
|
||||||
|
|
||||||
## [[0.7.0]] - 2022-01-02
|
|
||||||
|
|
||||||
### Added
|
|
||||||
|
|
||||||
- Allow `dir` attributes for LtoR text in RtoL document (#860)
|
|
||||||
- More translation languages (#862)
|
|
||||||
- Proxy support (#829)
|
|
||||||
- Riker a actor system library (#870)
|
|
||||||
- (request-target) and Host header in HTTP Signature (#872)
|
|
||||||
- Default log levels for RUST_LOG (#885, #886, #919)
|
|
||||||
|
|
||||||
### Changed
|
|
||||||
|
|
||||||
- Upgrade some dependent crates (#858)
|
|
||||||
- Use tracing crate (#868)
|
|
||||||
- Update Rust version to nightly-2021-11-27 (#961)
|
|
||||||
- Upgrade Tantivy to 0.13.3 and lindera-tantivy to 0.7.1 (#878)
|
|
||||||
- Run searcher on actor system (#870)
|
|
||||||
- Extract a function to calculate posts' ap_url and share it with some places (#918)
|
|
||||||
- Use article title as its slug instead of capitalizing and inserting hyphens (#920)
|
|
||||||
- Sign GET requests to other instances (#957)
|
|
||||||
|
|
||||||
### Fixed
|
|
||||||
|
|
||||||
- Percent-encode URI for remote_interact (#866, #857)
|
|
||||||
- Menu animation not opening on iOS (#876, #897)
|
|
||||||
- Make actors subscribe to channel once (#913)
|
|
||||||
- Upsert posts and media instead of trying to insert and fail (#912)
|
|
||||||
- Update post's ActivityPub id when published by update (#915)
|
|
||||||
- Calculate media URI properly even when MEDIA_UPLOAD_DIRECTORY configured (#916)
|
|
||||||
- Prevent duplicated posts in 'all' timeline (#917)
|
|
||||||
- Draw side line for blockquote on start (#933)
|
|
||||||
- Fix URIs of posts on Mastodon (#947)
|
|
||||||
- Place edit link proper position (#956, #963, #964)
|
|
||||||
|
|
||||||
## [[0.6.0]] - 2020-12-29
|
|
||||||
|
|
||||||
### Added
|
|
||||||
|
|
||||||
- Vazir font for better support of languages written in Arabic script (#787)
|
|
||||||
- Login via LDAP (#826)
|
|
||||||
- cargo-release (#835)
|
|
||||||
- Care about weak ETag header for better caching (#840)
|
|
||||||
- Support for right to left languages in post content (#853)
|
|
||||||
|
|
||||||
### Changed
|
|
||||||
|
|
||||||
- Bump Docker base images to Buster flavor (#797)
|
|
||||||
- Upgrade Rocket to 0.4.5 (#800)
|
|
||||||
- Keep tags as-is (#832)
|
|
||||||
- Update Docker image for testing (#838)
|
|
||||||
- Update Dockerfile.dev (#841)
|
|
||||||
|
|
||||||
### Fixed
|
|
||||||
|
|
||||||
- Recreate search index if its format is outdated (#802)
|
|
||||||
- Make it possible to switch to rich text editor (#808)
|
|
||||||
- Fix margins for the mobile devices (#817)
|
|
||||||
- GPU acceleration for the mobile menu (#818)
|
|
||||||
- Natural title position for RtoL languages (#825)
|
|
||||||
- Remove link to unimplemented page (#827)
|
|
||||||
- Fix displaying not found page when submitting a duplicated blocklist email (#831)
|
|
||||||
|
|
||||||
### Security
|
|
||||||
|
|
||||||
- Validate spoofing of activity
|
|
||||||
|
|
||||||
## [0.5.0] - 2020-06-21
|
|
||||||
|
|
||||||
### Added
|
|
||||||
|
|
||||||
- Email blocklisting (#718)
|
|
||||||
- Syntax highlighting (#691)
|
|
||||||
- Persian localization (#782)
|
|
||||||
- Switchable tokenizer - enables Japanese full-text search (#776)
|
|
||||||
- Make database connections configurable by environment variables (#768)
|
|
||||||
|
|
||||||
### Changed
|
|
||||||
|
|
||||||
- Display likes and boost on post cards (#744)
|
|
||||||
- Rust 2018 (#726)
|
|
||||||
- Bump to LLVM to 9.0.0 to fix ARM builds (#737)
|
|
||||||
- Remove dependency on runtime-fmt (#773)
|
|
||||||
- Drop the -alpha suffix in release names, it is implied that Plume is not stable yet because of the 0 major version (Plume 1.0.0 will be the first stable release).
|
|
||||||
|
|
||||||
### Fixed
|
|
||||||
|
|
||||||
- Fix parsing of mentions inside a Markdown code block (be430c6)
|
|
||||||
- Fix RSS issues (#720)
|
|
||||||
- Fix Atom feed (#764)
|
|
||||||
- Fix default theme (#746)
|
|
||||||
- Fix shown password on remote interact pages (#741)
|
|
||||||
- Allow unicode hashtags (#757)
|
|
||||||
- Fix French grammar for for 0 (#760)
|
|
||||||
- Don't show boosts and likes for "all" and "local" in timelines (#781)
|
|
||||||
- Fix liking and boosting posts on remote instances (#762)
|
|
||||||
|
|
||||||
## [0.4.0] - 2019-12-23
|
|
||||||
|
|
||||||
### Added
|
|
||||||
|
|
||||||
- Add support for generic timeline (#525)
|
|
||||||
- Federate user deletion (#551)
|
|
||||||
- import migrations and don't require diesel_cli for admins (#555)
|
|
||||||
- Cache local instance (#572)
|
|
||||||
- Initial RTL support #575 (#577)
|
|
||||||
- Confirm deletion of blog (#602)
|
|
||||||
- Make a distinction between moderators and admins (#619)
|
|
||||||
- Theming (#624)
|
|
||||||
- Add clap to plume in order to print help and version (#631)
|
|
||||||
- Add Snapcraft metadata and install/maintenance hooks (#666)
|
|
||||||
- Add environmental variable to control path of media (#683)
|
|
||||||
- Add autosaving to the editor (#688)
|
|
||||||
- CI: Upload artifacts to pull request deploy environment (#539)
|
|
||||||
- CI: Upload artifact of wasm binary (#571)
|
|
||||||
|
|
||||||
### Changed
|
|
||||||
|
|
||||||
- Update follow_remote.rs.html grammar (#548)
|
|
||||||
- Add some feedback when performing some actions (#552)
|
|
||||||
- Theme update (#553)
|
|
||||||
- Remove the new index lock tantivy uses (#556)
|
|
||||||
- Reduce reqwest timeout to 5s (#557)
|
|
||||||
- Improve notification management (#561)
|
|
||||||
- Fix occurrences of 'have been' to 'has been' (#578) + Direct follow-up to #578 (#603)
|
|
||||||
- Store password reset requests in database (#610)
|
|
||||||
- Use futures and tokio to send activities (#620)
|
|
||||||
- Don't ignore dotenv errors (#630)
|
|
||||||
- Replace the input! macro with an Input builder (#646)
|
|
||||||
- Update default license (#659)
|
|
||||||
- Paginate the outbox responses. Fixes #669 (#681)
|
|
||||||
- Use the "classic" editor by default (#697)
|
|
||||||
- Fix issue #705 (#708)
|
|
||||||
- Make comments in styleshhets a bit clearer (#545)
|
|
||||||
- Rewrite circleci config (#558)
|
|
||||||
- Use openssl instead of sha256sum for build.rs (#568)
|
|
||||||
- Update dependencies (#574)
|
|
||||||
- Refactor code to use Shrinkwraprs and diesel-derive-newtype (#598)
|
|
||||||
- Add enum containing all successful route returns (#614)
|
|
||||||
- Update dependencies which depended on nix -- fixes arm32 builds (#615)
|
|
||||||
- Update some documents (#616)
|
|
||||||
- Update dependencies (#643)
|
|
||||||
- Make the comment syntax consistent across all CSS (#487)
|
|
||||||
|
|
||||||
### Fixed
|
|
||||||
|
|
||||||
- Remove r (#535)
|
|
||||||
- Fix certain improper rendering of forms (#560)
|
|
||||||
- make hashtags work in profile summary (#562)
|
|
||||||
- Fix some federation issue (#573)
|
|
||||||
- Prevent comment form submit button distortion on iOS (#592)
|
|
||||||
- Update textarea overflow to scroll (#609)
|
|
||||||
- Fix arm builds (#612)
|
|
||||||
- Fix theme caching (#647)
|
|
||||||
- Fix issue #642, frontend not in English if the user language does not exist (#648)
|
|
||||||
- Don't index drafts (#656)
|
|
||||||
- Fill entirely user on creation (#657)
|
|
||||||
- Delete notification on user deletion (#658)
|
|
||||||
- Order media so that latest added are top (#660)
|
|
||||||
- Fix logo URL (#664)
|
|
||||||
- Snap: Ensure cargo-web doesn't erroneously adopt our workspace. (#667)
|
|
||||||
- Snap: Another fix for building (#668)
|
|
||||||
- Snap: Fix build for non-Tier-1 Rust platforms (#672)
|
|
||||||
- Don't split sentences for translations (#677)
|
|
||||||
- Escape href quotation marks (#678)
|
|
||||||
- Re-add empty strings in translation (#682)
|
|
||||||
- Make the search index creation during migration respect SEARCH_INDEX (#689)
|
|
||||||
- Fix the navigation menu not opening on touch (#690)
|
|
||||||
- Make search items optional (#693)
|
|
||||||
- Various snap fixes (#698)
|
|
||||||
- Fix #637 : Markdown footnotes (#700)
|
|
||||||
- Fix lettre (#706)
|
|
||||||
- CI: Fix Crowdin upload (#576)
|
|
||||||
|
|
||||||
### Removed
|
|
||||||
|
|
||||||
- Remove the Canapi dependency (#540)
|
|
||||||
- Remove use of Rust in migrations (#704)
|
|
||||||
|
|
||||||
## [0.3.0] - 2019-04-19
|
|
||||||
|
|
||||||
### Added
|
|
||||||
|
|
||||||
- Cover for articles (#299, #387)
|
|
||||||
- Password reset (#448)
|
|
||||||
- New editor (#293, #458, #482, #483, #486, #530)
|
|
||||||
- Search (#324, #375, #445)
|
|
||||||
- Edit blogs (#460, #494, #497)
|
|
||||||
- Hashtags in articles (#283, #295)
|
|
||||||
- API endpoints (#245, #285, #307)
|
|
||||||
- A bunch of new translations! (#479, #501, #506, #510, #512, #514)
|
|
||||||
|
|
||||||
### Changed
|
|
||||||
|
|
||||||
- Federation improvements (#216, #217, #357, #364, #399, #443, #446, #455, #502, #519)
|
|
||||||
- Improved build process (#281, #374, #392, #402, #489, #498, #503, #511, #513, #515, #528)
|
|
||||||
|
|
||||||
### Fixes
|
|
||||||
|
|
||||||
- UI usability fixes (#370, #386, #401, #417, #418, #444, #452, #480, #516, #518, #522, #532)
|
|
||||||
|
|
||||||
## [0.2.0] - 2018-09-12
|
|
||||||
|
|
||||||
### Added
|
|
||||||
|
|
||||||
- Article publishing, or save as a draft
|
|
||||||
- Like, or boost an article
|
|
||||||
- Basic Markdown editor
|
|
||||||
- Federated commenting system
|
|
||||||
- User account creation
|
|
||||||
- Limited federation on other platforms and subscribing to users
|
|
||||||
- Ability to create multiple blogs
|
|
||||||
|
|
||||||
<!-- next-url -->
|
|
||||||
[Unreleased]: https://github.com/Plume-org/Plume/compare/0.7.2...HEAD
|
|
||||||
[[0.7.2]]: https://github.com/Plume-org/Plume/compare/0.7.1...0.7.2
|
|
||||||
[[0.7.1]]: https://github.com/Plume-org/Plume/compare/0.7.0...0.7.1
|
|
||||||
[[0.7.0]]: https://github.com/Plume-org/Plume/compare/0.6.0...0.7.0
|
|
||||||
[[0.6.0]]: https://github.com/Plume-org/Plume/compare/0.5.0...0.6.0
|
|
||||||
[0.5.0]: https://github.com/Plume-org/Plume/compare/0.4.0-alpha-4...0.5.0
|
|
||||||
[0.4.0]: https://github.com/Plume-org/Plume/compare/0.3.0-alpha-2...0.4.0-alpha-4
|
|
||||||
[0.3.0]: https://github.com/Plume-org/Plume/compare/0.2.0-alpha-1...0.3.0-alpha-2
|
|
||||||
[0.2.0]: https://github.com/Plume-org/Plume/releases/tag/0.2.0-alpha-1
|
|
6142
Cargo.lock
generated
6142
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
70
Cargo.toml
70
Cargo.toml
@ -1,33 +1,39 @@
|
|||||||
[package]
|
[package]
|
||||||
authors = ["Plume contributors"]
|
authors = ["Plume contributors"]
|
||||||
name = "plume"
|
name = "plume"
|
||||||
version = "0.7.3-dev-fork"
|
version = "0.4.0"
|
||||||
repository = "https://git.lainoa.eus/aitzol/Plume"
|
repository = "https://github.com/Plume-org/Plume"
|
||||||
edition = "2021"
|
edition = "2018"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
atom_syndication = "0.12.0"
|
activitypub = "0.1.3"
|
||||||
|
askama_escape = "0.1"
|
||||||
|
atom_syndication = "0.6"
|
||||||
clap = "2.33"
|
clap = "2.33"
|
||||||
dotenv = "0.15.0"
|
colored = "1.8"
|
||||||
gettext = "0.4.0"
|
dotenv = "0.14"
|
||||||
gettext-macros = "0.6.1"
|
gettext = { git = "https://github.com/Plume-org/gettext/", rev = "294c54d74c699fbc66502b480a37cc66c1daa7f3" }
|
||||||
gettext-utils = "0.1.0"
|
gettext-macros = { git = "https://github.com/Plume-org/gettext-macros/", rev = "a7c605f7edd6bfbfbfe7778026bfefd88d82db10" }
|
||||||
guid-create = "0.2"
|
gettext-utils = { git = "https://github.com/Plume-org/gettext-macros/", rev = "a7c605f7edd6bfbfbfe7778026bfefd88d82db10" }
|
||||||
|
guid-create = "0.1"
|
||||||
|
heck = "0.3.0"
|
||||||
|
lettre = "0.9.2"
|
||||||
lettre_email = "0.9.2"
|
lettre_email = "0.9.2"
|
||||||
num_cpus = "1.16.0"
|
num_cpus = "1.10"
|
||||||
rocket = "0.4.11"
|
rocket = "0.4.2"
|
||||||
rocket_contrib = { version = "0.4.11", features = ["json"] }
|
rocket_contrib = { version = "0.4.2", features = ["json"] }
|
||||||
rocket_i18n = "0.4.1"
|
rocket_i18n = { git = "https://github.com/Plume-org/rocket_i18n", rev = "e922afa7c366038b3433278c03b1456b346074f2" }
|
||||||
scheduled-thread-pool = "0.2.7"
|
rpassword = "4.0"
|
||||||
serde = "1.0.137"
|
runtime-fmt = "0.4.0"
|
||||||
serde_json = "1.0.81"
|
scheduled-thread-pool = "0.2.2"
|
||||||
shrinkwraprs = "0.3.0"
|
serde = "1.0"
|
||||||
validator = { version = "0.15", features = ["derive"] }
|
serde_json = "1.0"
|
||||||
|
serde_qs = "0.5"
|
||||||
|
shrinkwraprs = "0.2.1"
|
||||||
|
syntect = "3.3"
|
||||||
|
validator = "0.8"
|
||||||
|
validator_derive = "0.8"
|
||||||
webfinger = "0.4.1"
|
webfinger = "0.4.1"
|
||||||
tracing = "0.1.35"
|
|
||||||
tracing-subscriber = "0.3.10"
|
|
||||||
riker = "0.4.2"
|
|
||||||
activitystreams = "=0.7.0-alpha.20"
|
|
||||||
|
|
||||||
[[bin]]
|
[[bin]]
|
||||||
name = "plume"
|
name = "plume"
|
||||||
@ -35,20 +41,20 @@ path = "src/main.rs"
|
|||||||
|
|
||||||
[dependencies.chrono]
|
[dependencies.chrono]
|
||||||
features = ["serde"]
|
features = ["serde"]
|
||||||
version = "0.4.31"
|
version = "0.4"
|
||||||
|
|
||||||
[dependencies.ctrlc]
|
[dependencies.ctrlc]
|
||||||
features = ["termination"]
|
features = ["termination"]
|
||||||
version = "3.2.2"
|
version = "3.1.2"
|
||||||
|
|
||||||
[dependencies.diesel]
|
[dependencies.diesel]
|
||||||
features = ["r2d2", "chrono"]
|
features = ["r2d2", "chrono"]
|
||||||
version = "1.4.5"
|
version = "*"
|
||||||
|
|
||||||
[dependencies.multipart]
|
[dependencies.multipart]
|
||||||
default-features = false
|
default-features = false
|
||||||
features = ["server"]
|
features = ["server"]
|
||||||
version = "0.18"
|
version = "0.16"
|
||||||
|
|
||||||
[dependencies.plume-api]
|
[dependencies.plume-api]
|
||||||
path = "plume-api"
|
path = "plume-api"
|
||||||
@ -60,21 +66,19 @@ path = "plume-common"
|
|||||||
path = "plume-models"
|
path = "plume-models"
|
||||||
|
|
||||||
[dependencies.rocket_csrf]
|
[dependencies.rocket_csrf]
|
||||||
git = "https://git.joinplu.me/plume/rocket_csrf"
|
git = "https://github.com/fdb-hiroshima/rocket_csrf"
|
||||||
rev = "0.1.2"
|
rev = "29910f2829e7e590a540da3804336577b48c7b31"
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
ructe = "0.15.0"
|
ructe = "0.9.0"
|
||||||
rsass = "0.26"
|
rsass = "0.9"
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["postgres", "s3"]
|
default = ["postgres"]
|
||||||
postgres = ["plume-models/postgres", "diesel/postgres"]
|
postgres = ["plume-models/postgres", "diesel/postgres"]
|
||||||
sqlite = ["plume-models/sqlite", "diesel/sqlite"]
|
sqlite = ["plume-models/sqlite", "diesel/sqlite"]
|
||||||
debug-mailer = []
|
debug-mailer = []
|
||||||
test = []
|
test = []
|
||||||
search-lindera = ["plume-models/search-lindera"]
|
|
||||||
s3 = ["plume-models/s3"]
|
|
||||||
|
|
||||||
[workspace]
|
[workspace]
|
||||||
members = ["plume-api", "plume-cli", "plume-models", "plume-common", "plume-front", "plume-macro"]
|
members = ["plume-api", "plume-cli", "plume-models", "plume-common", "plume-front", "plume-macro"]
|
||||||
|
11
Dockerfile
11
Dockerfile
@ -1,4 +1,4 @@
|
|||||||
FROM rust:1 as builder
|
FROM rust:1-stretch as builder
|
||||||
|
|
||||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||||
ca-certificates \
|
ca-certificates \
|
||||||
@ -18,19 +18,22 @@ COPY script/wasm-deps.sh .
|
|||||||
RUN chmod a+x ./wasm-deps.sh && sleep 1 && ./wasm-deps.sh
|
RUN chmod a+x ./wasm-deps.sh && sleep 1 && ./wasm-deps.sh
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
COPY Cargo.toml Cargo.lock rust-toolchain ./
|
||||||
|
RUN cargo install cargo-web
|
||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN cargo install wasm-pack
|
|
||||||
RUN chmod a+x ./script/plume-front.sh && sleep 1 && ./script/plume-front.sh
|
RUN chmod a+x ./script/plume-front.sh && sleep 1 && ./script/plume-front.sh
|
||||||
RUN cargo install --path ./ --force --no-default-features --features postgres
|
RUN cargo install --path ./ --force --no-default-features --features postgres
|
||||||
RUN cargo install --path plume-cli --force --no-default-features --features postgres
|
RUN cargo install --path plume-cli --force --no-default-features --features postgres
|
||||||
RUN cargo clean
|
RUN cargo clean
|
||||||
|
|
||||||
FROM debian:stable-slim
|
FROM debian:stretch-slim
|
||||||
|
|
||||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||||
ca-certificates \
|
ca-certificates \
|
||||||
libpq5
|
libpq5 \
|
||||||
|
libssl1.1
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
FROM rust:1-buster
|
FROM rust:1-stretch
|
||||||
|
|
||||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||||
ca-certificates \
|
ca-certificates \
|
||||||
@ -10,8 +10,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|||||||
gcc \
|
gcc \
|
||||||
make \
|
make \
|
||||||
openssl \
|
openssl \
|
||||||
libssl-dev\
|
libssl-dev
|
||||||
clang
|
|
||||||
|
|
||||||
WORKDIR /scratch
|
WORKDIR /scratch
|
||||||
COPY script/wasm-deps.sh .
|
COPY script/wasm-deps.sh .
|
||||||
@ -20,7 +19,7 @@ RUN chmod a+x ./wasm-deps.sh && sleep 1 && ./wasm-deps.sh
|
|||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY Cargo.toml Cargo.lock rust-toolchain ./
|
COPY Cargo.toml Cargo.lock rust-toolchain ./
|
||||||
RUN cargo install diesel_cli --no-default-features --features postgres --version '=1.3.0'
|
RUN cargo install diesel_cli --no-default-features --features postgres --version '=1.3.0'
|
||||||
RUN cargo install wasm-pack
|
RUN cargo install cargo-web
|
||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
<h1 align="center">
|
<h1 align="center">
|
||||||
<img src="https://raw.githubusercontent.com/Plume-org/Plume/main/assets/icons/trwnh/feather/plumeFeather64.png" alt="Plume's logo">
|
<img src="https://raw.githubusercontent.com/Plume-org/Plume/master/assets/icons/trwnh/feather/plumeFeather64.png" alt="Plume's logo">
|
||||||
Plume
|
Plume
|
||||||
</h1>
|
</h1>
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<a href="https://github.com/Plume-org/Plume/"><img alt="CircleCI" src="https://img.shields.io/circleci/build/gh/Plume-org/Plume.svg"></a>
|
<a href="https://github.com/Plume-org/Plume/"><img alt="CircleCI" src="https://img.shields.io/circleci/build/gh/Plume-org/Plume.svg"></a>
|
||||||
<a href="https://codecov.io/gh/Plume-org/Plume"><img src="https://codecov.io/gh/Plume-org/Plume/branch/main/graph/badge.svg" alt="Code coverage"></a>
|
<a href="https://codecov.io/gh/Plume-org/Plume"><img src="https://codecov.io/gh/Plume-org/Plume/branch/master/graph/badge.svg" alt="Code coverage"></a>
|
||||||
<a title="Crowdin" target="_blank" href="https://crowdin.com/project/plume"><img src="https://d322cqt584bo4o.cloudfront.net/plume/localized.svg"></a>
|
<a title="Crowdin" target="_blank" href="https://crowdin.com/project/plume"><img src="https://d322cqt584bo4o.cloudfront.net/plume/localized.svg"></a>
|
||||||
<a href="https://hub.docker.com/r/plumeorg/plume"><img alt="Docker Pulls" src="https://img.shields.io/docker/pulls/plumeorg/plume.svg"></a>
|
<a href="https://hub.docker.com/r/plumeorg/plume"><img alt="Docker Pulls" src="https://img.shields.io/docker/pulls/plumeorg/plume.svg"></a>
|
||||||
<a href="https://liberapay.com/Plume"><img alt="Liberapay patrons" src="https://img.shields.io/liberapay/patrons/Plume.svg"></a>
|
<a href="https://liberapay.com/Plume"><img alt="Liberapay patrons" src="https://img.shields.io/liberapay/patrons/Plume.svg"></a>
|
||||||
@ -30,11 +30,11 @@ A lot of features are still missing, but what is already here should be quite st
|
|||||||
- **Media management**: you can upload pictures to illustrate your articles, but also audio files if you host a podcast, and manage them all from Plume.
|
- **Media management**: you can upload pictures to illustrate your articles, but also audio files if you host a podcast, and manage them all from Plume.
|
||||||
- **Federation**: Plume is part of a network of interconnected websites called the Fediverse. Each of these websites (often called *instances*) have their own
|
- **Federation**: Plume is part of a network of interconnected websites called the Fediverse. Each of these websites (often called *instances*) have their own
|
||||||
rules and thematics, but they can all communicate with each other.
|
rules and thematics, but they can all communicate with each other.
|
||||||
- **Collaborative writing**: invite other people to your blogs, and write articles together. (Not implemented yet, but will be in 1.0)
|
- **Collaborative writing**: invite other people to your blogs, and write articles together.
|
||||||
|
|
||||||
## Get involved
|
## Get involved
|
||||||
|
|
||||||
If you want to have regular news about the project, the best place is probably [our blog](https://fediverse.blog/~/PlumeDev), or our Matrix room: [`#plume-blog:matrix.org`](https://matrix.to/#/#plume-blog:matrix.org).
|
If you want to have regular news about the project, the best place is probably [our blog](https://fediverse.blog/~/PlumeDev), or our Matrix room: [`#plume:disroot.org`](https://riot.im/app/#/room/#plume:disroot.org).
|
||||||
|
|
||||||
If you want to contribute more, a good first step is to read [our contribution guides](https://docs.joinplu.me/contribute). We accept all kind of contribution:
|
If you want to contribute more, a good first step is to read [our contribution guides](https://docs.joinplu.me/contribute). We accept all kind of contribution:
|
||||||
|
|
||||||
@ -53,4 +53,3 @@ As we want the various spaces related to the project (GitHub, Matrix, Loomio, et
|
|||||||
|
|
||||||
We provide various way to install Plume: from source, with pre-built binaries, with Docker or with YunoHost.
|
We provide various way to install Plume: from source, with pre-built binaries, with Docker or with YunoHost.
|
||||||
For detailed explanations, please refer to [the documentation](https://docs.joinplu.me/installation/).
|
For detailed explanations, please refer to [the documentation](https://docs.joinplu.me/installation/).
|
||||||
|
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
* {
|
* {
|
||||||
font-family: monospace;
|
font-family: monospace;
|
||||||
}
|
}
|
||||||
|
@ -40,7 +40,7 @@ main header.article {
|
|||||||
|
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
justify-content: flex-end;
|
justify-content: end;
|
||||||
|
|
||||||
h1, .article-info {
|
h1, .article-info {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
@ -64,41 +64,41 @@ main header.article {
|
|||||||
}
|
}
|
||||||
|
|
||||||
main .article-info {
|
main .article-info {
|
||||||
margin: 0 auto 3em;
|
margin: 0 auto 3em;
|
||||||
font-size: 0.95em;
|
font-size: 0.95em;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
|
|
||||||
.author, .author a {
|
.author, .author a {
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The article itself */
|
/* The article itself */
|
||||||
main article {
|
main article {
|
||||||
max-width: $article-width;
|
max-width: $article-width;
|
||||||
margin: 2.5em auto;
|
margin: 2.5em auto;
|
||||||
font-family: $lora;
|
font-family: $lora;
|
||||||
font-size: 1.2em;
|
font-size: 1.2em;
|
||||||
line-height: 1.7;
|
line-height: 1.7;
|
||||||
|
|
||||||
a:hover {
|
a:hover {
|
||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
}
|
}
|
||||||
|
|
||||||
img {
|
img {
|
||||||
display: block;
|
display: block;
|
||||||
margin: 3em auto;
|
margin: 3em auto;
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
pre {
|
pre {
|
||||||
padding: 1em;
|
padding: 1em;
|
||||||
background: $gray;
|
background: $gray;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
blockquote {
|
blockquote {
|
||||||
border-inline-start: 5px solid $gray;
|
border-left: 5px solid $gray;
|
||||||
margin: 1em auto;
|
margin: 1em auto;
|
||||||
padding: 0em 2em;
|
padding: 0em 2em;
|
||||||
}
|
}
|
||||||
@ -126,7 +126,7 @@ main .article-meta {
|
|||||||
|
|
||||||
> p {
|
> p {
|
||||||
margin: 2em $horizontal-margin;
|
margin: 2em $horizontal-margin;
|
||||||
font-size: 0.9em;
|
font-size: 0.9em;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Article Tags */
|
/* Article Tags */
|
||||||
@ -157,15 +157,15 @@ main .article-meta {
|
|||||||
/* Likes & Boosts */
|
/* Likes & Boosts */
|
||||||
.actions {
|
.actions {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
justify-content: space-around;
|
justify-content: space-around;
|
||||||
}
|
}
|
||||||
|
|
||||||
.likes, .reshares {
|
.likes, .reshares {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
padding: 0.5em 0;
|
padding: 0.5em 0;
|
||||||
|
|
||||||
p {
|
p {
|
||||||
font-size: 1.5em;
|
font-size: 1.5em;
|
||||||
@ -175,34 +175,34 @@ main .article-meta {
|
|||||||
|
|
||||||
.action {
|
.action {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
background: none;
|
background: none;
|
||||||
color: $text-color;
|
color: $text-color;
|
||||||
border: none;
|
border: none;
|
||||||
font-size: 1.1em;
|
font-size: 1.1em;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|
||||||
svg.feather {
|
svg.feather {
|
||||||
transition: background 0.1s ease-in;
|
transition: background 0.1s ease-in;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|
||||||
margin: 0.5em 0;
|
margin: 0.5em 0;
|
||||||
width: 2.5em;
|
width: 2.5em;
|
||||||
height: 2.5em;
|
height: 2.5em;
|
||||||
|
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.reshared, &.liked {
|
&.reshared, &.liked {
|
||||||
svg.feather {
|
svg.feather {
|
||||||
color: $background;
|
color: $background;
|
||||||
font-weight: 900;
|
font-weight: 900;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -213,14 +213,14 @@ main .article-meta {
|
|||||||
|
|
||||||
.action svg.feather {
|
.action svg.feather {
|
||||||
padding: 0.7em;
|
padding: 0.7em;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
color: $red;
|
color: $red;
|
||||||
fill: none;
|
fill: none;
|
||||||
border: solid $red thin;
|
border: solid $red thin;
|
||||||
}
|
}
|
||||||
|
|
||||||
.action:hover svg.feather {
|
.action:hover svg.feather {
|
||||||
background: transparentize($red, 0.85);
|
background: transparentize($red, 0.85);
|
||||||
}
|
}
|
||||||
|
|
||||||
.action.liked svg.feather {
|
.action.liked svg.feather {
|
||||||
@ -228,7 +228,7 @@ main .article-meta {
|
|||||||
fill: currentColor;
|
fill: currentColor;
|
||||||
}
|
}
|
||||||
.action.liked:hover svg.feather {
|
.action.liked:hover svg.feather {
|
||||||
background: transparentize($red, 0.75);
|
background: transparentize($red, 0.75)
|
||||||
color: $red;
|
color: $red;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -238,22 +238,22 @@ main .article-meta {
|
|||||||
|
|
||||||
.action svg.feather {
|
.action svg.feather {
|
||||||
padding: 0.7em;
|
padding: 0.7em;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
color: $primary;
|
color: $primary;
|
||||||
border: solid $primary thin;
|
border: solid $primary thin;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
}
|
}
|
||||||
|
|
||||||
.action:hover svg.feather {
|
.action:hover svg.feather {
|
||||||
background: transparentize($primary, 0.85);
|
background: transparentize($primary, 0.85);
|
||||||
}
|
}
|
||||||
|
|
||||||
.action.reshared svg.feather {
|
.action.reshared svg.feather {
|
||||||
background: $primary;
|
background: $primary;
|
||||||
}
|
}
|
||||||
.action.reshared:hover svg.feather {
|
.action.reshared:hover svg.feather {
|
||||||
background: transparentize($primary, 0.75);
|
background: transparentize($primary, 0.75)
|
||||||
color: $primary;
|
color: $primary;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -262,9 +262,9 @@ main .article-meta {
|
|||||||
margin: 0 $horizontal-margin;
|
margin: 0 $horizontal-margin;
|
||||||
|
|
||||||
h2 {
|
h2 {
|
||||||
color: $primary;
|
color: $primary;
|
||||||
font-size: 1.5em;
|
font-size: 1.5em;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
}
|
}
|
||||||
|
|
||||||
summary {
|
summary {
|
||||||
@ -279,16 +279,16 @@ main .article-meta {
|
|||||||
|
|
||||||
// Respond & delete comment buttons
|
// Respond & delete comment buttons
|
||||||
a.button, form.inline, form.inline input {
|
a.button, form.inline, form.inline input {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
background: none;
|
background: none;
|
||||||
color: $text-color;
|
color: $text-color;
|
||||||
margin-right: 2em;
|
margin-right: 2em;
|
||||||
font-family: $route159;
|
font-family: $route159;
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
|
|
||||||
&::before {
|
&::before {
|
||||||
color: $primary;
|
color: $primary;
|
||||||
padding-right: 0.5em;
|
padding-right: 0.5em;
|
||||||
}
|
}
|
||||||
|
|
||||||
&:hover { color: $primary; }
|
&:hover { color: $primary; }
|
||||||
@ -296,8 +296,8 @@ main .article-meta {
|
|||||||
|
|
||||||
.comment {
|
.comment {
|
||||||
margin: 1em 0;
|
margin: 1em 0;
|
||||||
font-size: 1em;
|
font-size: 1em;
|
||||||
border: none;
|
border: none;
|
||||||
|
|
||||||
.content {
|
.content {
|
||||||
background: $gray;
|
background: $gray;
|
||||||
@ -328,36 +328,36 @@ main .article-meta {
|
|||||||
color: transparentize($text-color, 0.6);
|
color: transparentize($text-color, 0.6);
|
||||||
}
|
}
|
||||||
|
|
||||||
.author {
|
.author {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
align-content: center;
|
align-content: center;
|
||||||
|
|
||||||
* {
|
* {
|
||||||
transition: all 0.1s ease-in;
|
transition: all 0.1s ease-in;
|
||||||
}
|
}
|
||||||
|
|
||||||
.display-name {
|
.display-name {
|
||||||
color: $text-color;
|
color: $text-color;
|
||||||
}
|
}
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
.display-name { color: $primary; }
|
.display-name { color: $primary; }
|
||||||
small { opacity: 1; }
|
small { opacity: 1; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
& > .comment {
|
& > .comment {
|
||||||
padding-left: 2em;
|
padding-left: 2em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.text {
|
.text {
|
||||||
padding: 1.25em 0;
|
padding: 1.25em 0;
|
||||||
font-family: $lora;
|
font-family: $lora;
|
||||||
font-size: 1.1em;
|
font-size: 1.1em;
|
||||||
line-height: 1.4;
|
line-height: 1.4;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -490,37 +490,3 @@ input:checked ~ .cw-container > .cw-text {
|
|||||||
display: inline;
|
display: inline;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Small screens
|
|
||||||
@media screen and (max-width: 600px) {
|
|
||||||
#plume-editor header {
|
|
||||||
flex-direction: column-reverse;
|
|
||||||
|
|
||||||
button {
|
|
||||||
flex: 0 0 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.popup {
|
|
||||||
top: 10vh;
|
|
||||||
bottom: 10vh;
|
|
||||||
left: 1vw;
|
|
||||||
right: 1vw;
|
|
||||||
}
|
|
||||||
|
|
||||||
main article {
|
|
||||||
margin: 2.5em .5em;
|
|
||||||
max-width: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
main .article-meta > *, main .article-meta .comments, main .article-meta > .banner > * {
|
|
||||||
margin: 0 5%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.bottom-bar {
|
|
||||||
align-items: center;
|
|
||||||
& > div:nth-child(2) {
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -1,27 +1,27 @@
|
|||||||
label {
|
label {
|
||||||
display: block;
|
display: block;
|
||||||
margin: 2em auto .5em;
|
margin: 2em auto .5em;
|
||||||
font-size: 1.2em;
|
font-size: 1.2em;
|
||||||
}
|
}
|
||||||
input, textarea, select {
|
input, textarea, select {
|
||||||
transition: all 0.1s ease-in;
|
transition: all 0.1s ease-in;
|
||||||
display: block;
|
display: block;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
margin: auto;
|
margin: auto;
|
||||||
padding: 1em;
|
padding: 1em;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
-webkit-appearance: textarea;
|
-webkit-appearance: textarea;
|
||||||
|
|
||||||
background: $form-input-background;
|
background: $form-input-background;
|
||||||
color: $text-color;
|
color: $text-color;
|
||||||
border: solid $form-input-border thin;
|
border: solid $form-input-border thin;
|
||||||
|
|
||||||
font-size: 1.2em;
|
font-size: 1.2em;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
|
|
||||||
&:focus {
|
&:focus {
|
||||||
border-color: $primary;
|
border-color: $primary;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
form input[type="submit"] {
|
form input[type="submit"] {
|
||||||
margin: 2em auto;
|
margin: 2em auto;
|
||||||
@ -29,18 +29,18 @@ form input[type="submit"] {
|
|||||||
}
|
}
|
||||||
|
|
||||||
textarea {
|
textarea {
|
||||||
resize: vertical;
|
resize: vertical;
|
||||||
overflow-y: scroll;
|
overflow-y: scroll;
|
||||||
font-family: $lora;
|
font-family: $lora;
|
||||||
font-size: 1.1em;
|
font-size: 1.1em;
|
||||||
line-height: 1.5;
|
line-height: 1.5;
|
||||||
}
|
}
|
||||||
|
|
||||||
input[type="checkbox"] {
|
input[type="checkbox"] {
|
||||||
display: inline;
|
display: inline;
|
||||||
margin: initial;
|
margin: initial;
|
||||||
min-width: initial;
|
min-width: initial;
|
||||||
width: initial;
|
width: initial;
|
||||||
-webkit-appearance: checkbox;
|
-webkit-appearance: checkbox;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -71,31 +71,31 @@ form.inline {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.button, .button:visited, input[type="submit"], input[type="submit"].button {
|
.button, .button:visited, input[type="submit"], input[type="submit"].button {
|
||||||
transition: all 0.1s ease-in;
|
transition: all 0.1s ease-in;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
-webkit-appearance: none;
|
-webkit-appearance: none;
|
||||||
|
|
||||||
margin: 0.5em auto;
|
margin: 0.5em auto;
|
||||||
padding: 0.75em 1em;
|
padding: 0.75em 1em;
|
||||||
|
|
||||||
background: $primary;
|
background: $primary;
|
||||||
color: $primary-text-color;
|
color: $primary-text-color;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
border: none;
|
border: none;
|
||||||
|
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
background: transparentize($primary, 0.1);
|
background: transparentize($primary, 0.1);
|
||||||
}
|
}
|
||||||
|
|
||||||
&.destructive {
|
&.destructive {
|
||||||
background: $red;
|
background: $red;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
background: transparentize($red, 0.1);
|
background: transparentize($red, 0.1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&.secondary {
|
&.secondary {
|
||||||
background: $gray;
|
background: $gray;
|
||||||
@ -115,27 +115,26 @@ input[type="submit"] {
|
|||||||
form.new-post {
|
form.new-post {
|
||||||
max-width: 60em;
|
max-width: 60em;
|
||||||
.title {
|
.title {
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
padding: 0.75em 0;
|
padding: 0.75em 0;
|
||||||
|
|
||||||
background: none;
|
background: none;
|
||||||
border: none;
|
border: none;
|
||||||
|
|
||||||
font-family: $playfair;
|
font-family: $playfair;
|
||||||
font-size: 2em;
|
font-size: 2em;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
}
|
}
|
||||||
textarea {
|
textarea {
|
||||||
min-height: 20em;
|
min-height: 20em;
|
||||||
overflow-y: scroll;
|
overflow-y: scroll;
|
||||||
resize: none;
|
resize: none;
|
||||||
-webkit-appearance: textarea;
|
-webkit-appearance: textarea;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.button + .button {
|
.button + .button {
|
||||||
margin-left: 1em;
|
margin-left: 1em;
|
||||||
margin-inline-start: 1em;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.split {
|
.split {
|
||||||
|
@ -6,43 +6,43 @@ html {
|
|||||||
}
|
}
|
||||||
|
|
||||||
html, body {
|
html, body {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
background: $background;
|
background: $background;
|
||||||
color: $text-color;
|
color: $text-color;
|
||||||
font-family: $route159;
|
font-family: $route159;
|
||||||
|
|
||||||
::selection {
|
::selection {
|
||||||
background: transparentize($primary, 0.7);
|
background: transparentize($primary, 0.7);
|
||||||
}
|
}
|
||||||
::-moz-selection {
|
::-moz-selection {
|
||||||
background: transparentize($primary, 0.7);
|
background: transparentize($primary, 0.7);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
a, a:visited {
|
a, a:visited {
|
||||||
color: $primary;
|
color: $primary;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
a::selection {
|
a::selection {
|
||||||
color: $background;
|
color: $background;
|
||||||
}
|
}
|
||||||
a::-moz-selection {
|
a::-moz-selection {
|
||||||
color: $background;
|
color: $background;
|
||||||
}
|
}
|
||||||
small {
|
small {
|
||||||
margin-left: 1em;
|
margin-left: 1em;
|
||||||
color: transparentize($text-color, 0.6);
|
color: transparentize($text-color, 0.6);
|
||||||
font-size: 0.75em;
|
font-size: 0.75em;
|
||||||
word-wrap: break-word;
|
word-wrap: break-word;
|
||||||
word-break: break-all;
|
word-break: break-all;
|
||||||
}
|
}
|
||||||
|
|
||||||
.center {
|
.center {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
opacity: 0.6;
|
opacity: 0.6;
|
||||||
padding: 5em;
|
padding: 5em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.right {
|
.right {
|
||||||
@ -53,28 +53,28 @@ small {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.spaced {
|
.spaced {
|
||||||
margin: 4rem 0;
|
margin: 4rem 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.banner {
|
.banner {
|
||||||
background: $gray;
|
background: $gray;
|
||||||
padding-top: 2em;
|
padding-top: 2em;
|
||||||
padding-bottom: 1em;
|
padding-bottom: 1em;
|
||||||
margin: 3em 0px;
|
margin: 3em 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.hidden {
|
.hidden {
|
||||||
display: none;
|
display: none;
|
||||||
appearance: none;
|
appearance: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Main */
|
/* Main */
|
||||||
body > main > *, .h-feed > * {
|
body > main > *, .h-feed > * {
|
||||||
margin: 1em $horizontal-margin;
|
margin: 1em $horizontal-margin;
|
||||||
}
|
}
|
||||||
|
|
||||||
body > main > .h-entry, .h-feed {
|
body > main > .h-entry, .h-feed {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
body > main {
|
body > main {
|
||||||
@ -98,18 +98,18 @@ main {
|
|||||||
margin-top: 1em;
|
margin-top: 1em;
|
||||||
|
|
||||||
&.article {
|
&.article {
|
||||||
margin: 1em auto 0.5em;
|
margin: 1em auto 0.5em;
|
||||||
font-family: $playfair;
|
font-family: $playfair;
|
||||||
font-size: 2.5em;
|
font-size: 2.5em;
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
h2 {
|
h2 {
|
||||||
font-size: 1.75em;
|
font-size: 1.75em;
|
||||||
font-weight: 300;
|
font-weight: 300;
|
||||||
|
|
||||||
&.article {
|
&.article {
|
||||||
font-size: 1.25em;
|
font-size: 1.25em;
|
||||||
margin-bottom: 0.5em;
|
margin-bottom: 0.5em;
|
||||||
}
|
}
|
||||||
@ -139,15 +139,15 @@ main {
|
|||||||
|
|
||||||
/* Errors */
|
/* Errors */
|
||||||
p.error {
|
p.error {
|
||||||
color: $red;
|
color: $red;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* User page */
|
/* User page */
|
||||||
.user h1 {
|
.user h1 {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
margin: 0px;
|
margin: 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -156,14 +156,14 @@ p.error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.badge {
|
.badge {
|
||||||
margin-right: 1em;
|
margin-right: 1em;
|
||||||
padding: 0.35em 1em;
|
padding: 0.35em 1em;
|
||||||
|
|
||||||
background: $background;
|
background: $background;
|
||||||
color: $primary;
|
color: $primary;
|
||||||
border: 1px solid $primary;
|
border: 1px solid $primary;
|
||||||
|
|
||||||
font-size: 1rem;
|
font-size: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.user-summary {
|
.user-summary {
|
||||||
@ -172,25 +172,23 @@ p.error {
|
|||||||
|
|
||||||
/* Cards */
|
/* Cards */
|
||||||
.cards {
|
.cards {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
padding: 0 5%;
|
padding: 0 5%;
|
||||||
margin: 1rem 0 5rem;
|
margin: 1rem 0 5rem;
|
||||||
}
|
}
|
||||||
.card {
|
.card {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|
||||||
position: relative;
|
min-width: 20em;
|
||||||
|
min-height: 20em;
|
||||||
|
margin: 1em;
|
||||||
|
box-sizing: border-box;
|
||||||
|
|
||||||
min-width: 20em;
|
background: $gray;
|
||||||
min-height: 20em;
|
|
||||||
margin: 1em;
|
|
||||||
box-sizing: border-box;
|
|
||||||
|
|
||||||
background: $gray;
|
|
||||||
|
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
|
|
||||||
@ -215,68 +213,38 @@ p.error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
> * {
|
> * {
|
||||||
margin: 20px;
|
margin: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cover-link {
|
.cover {
|
||||||
margin: 0;
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
opacity: 0.9;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.cover {
|
|
||||||
min-height: 10em;
|
min-height: 10em;
|
||||||
background-position: center;
|
background-position: center;
|
||||||
background-size: cover;
|
background-size: cover;
|
||||||
margin: 0px;
|
margin: 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
header {
|
|
||||||
display: flex;
|
|
||||||
}
|
|
||||||
|
|
||||||
h3 {
|
h3 {
|
||||||
flex-grow: 1;
|
margin: 0.75em 20px;
|
||||||
margin: 0;
|
font-family: $playfair;
|
||||||
font-family: $playfair;
|
font-size: 1.75em;
|
||||||
font-size: 1.75em;
|
font-weight: normal;
|
||||||
font-weight: normal;
|
a {
|
||||||
line-height: 1.10;
|
transition: color 0.1s ease-in;
|
||||||
display: inline-block;
|
color: $text-color;
|
||||||
position: relative;
|
|
||||||
a {
|
|
||||||
display: block;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
padding-block-start: 0.5em;
|
|
||||||
transition: color 0.1s ease-in;
|
|
||||||
color: $text-color;
|
|
||||||
|
|
||||||
&:hover { color: $primary; }
|
&:hover { color: $primary; }
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
.controls {
|
|
||||||
flex-shrink: 0;
|
|
||||||
text-align: end;
|
|
||||||
|
|
||||||
.button {
|
|
||||||
margin-top: 0;
|
|
||||||
margin-bottom: 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
main {
|
main {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
|
|
||||||
font-family: $lora;
|
font-family: $lora;
|
||||||
font-size: 1em;
|
font-size: 1em;
|
||||||
line-height: 1.25;
|
line-height: 1.25;
|
||||||
text-align: initial;
|
text-align: left;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -318,15 +286,15 @@ p.error {
|
|||||||
|
|
||||||
/* Stats */
|
/* Stats */
|
||||||
.stats {
|
.stats {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-around;
|
justify-content: space-around;
|
||||||
margin: 2em;
|
margin: 2em;
|
||||||
|
|
||||||
> div {
|
> div {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
p {
|
p {
|
||||||
@ -479,10 +447,9 @@ figure {
|
|||||||
|
|
||||||
/// Avatars
|
/// Avatars
|
||||||
.avatar {
|
.avatar {
|
||||||
background-position: center !important;
|
background-position: center;
|
||||||
background-size: cover;
|
background-size: cover;
|
||||||
border-radius: 100%;
|
border-radius: 100%;
|
||||||
flex-shrink: 0;
|
|
||||||
|
|
||||||
&.small {
|
&.small {
|
||||||
width: 50px;
|
width: 50px;
|
||||||
@ -507,7 +474,6 @@ figure {
|
|||||||
margin: auto $horizontal-margin 2em;
|
margin: auto $horizontal-margin 2em;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
|
||||||
|
|
||||||
a {
|
a {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
@ -524,10 +490,6 @@ figure {
|
|||||||
|
|
||||||
/// Small screens
|
/// Small screens
|
||||||
@media screen and (max-width: 600px) {
|
@media screen and (max-width: 600px) {
|
||||||
body > main > *, .h-feed > * {
|
|
||||||
margin: 1em;
|
|
||||||
}
|
|
||||||
|
|
||||||
main .article-meta {
|
main .article-meta {
|
||||||
> *, .comments {
|
> *, .comments {
|
||||||
margin: 0 5%;
|
margin: 0 5%;
|
||||||
@ -573,7 +535,15 @@ figure {
|
|||||||
margin: 0;
|
margin: 0;
|
||||||
|
|
||||||
& > * {
|
& > * {
|
||||||
max-width: 100% !important;
|
max-width: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.bottom-bar {
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
& > div {
|
||||||
|
margin: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,8 +3,8 @@ body > header {
|
|||||||
|
|
||||||
#content {
|
#content {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-content: center;
|
align-content: center;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
}
|
}
|
||||||
|
|
||||||
nav#menu {
|
nav#menu {
|
||||||
@ -19,44 +19,44 @@ body > header {
|
|||||||
|
|
||||||
a {
|
a {
|
||||||
transform: skewX(15deg);
|
transform: skewX(15deg);
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
width: 1.4em;
|
width: 1.4em;
|
||||||
height: 1.4em;
|
height: 1.4em;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
color: $gray;
|
color: $gray;
|
||||||
font-size: 1.33em;
|
font-size: 1.33em;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
nav {
|
nav {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
hr {
|
hr {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
width: 0.2em;
|
width: 0.2em;
|
||||||
background: $primary;
|
background: $primary;
|
||||||
border: none;
|
border: none;
|
||||||
transform: skewX(-15deg);
|
transform: skewX(-15deg);
|
||||||
}
|
}
|
||||||
a {
|
a {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
position: relative;
|
position: relative;
|
||||||
align-self: stretch;
|
align-self: stretch;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0 2em;
|
padding: 0 2em;
|
||||||
font-size: 1em;
|
font-size: 1em;
|
||||||
|
|
||||||
i { font-size: 1.2em; }
|
i { font-size: 1.2em; }
|
||||||
|
|
||||||
&.title {
|
&.title {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
padding: 0.5em 1em;
|
padding: 0.5em 1em;
|
||||||
font-size: 1.75em;
|
font-size: 1.75em;
|
||||||
@ -70,7 +70,7 @@ body > header {
|
|||||||
margin: 0;
|
margin: 0;
|
||||||
padding-left: 0.5em;
|
padding-left: 0.5em;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -115,18 +115,6 @@ body > header {
|
|||||||
opacity: 1;
|
opacity: 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@-webkit-keyframes menuOpening {
|
|
||||||
from {
|
|
||||||
-webkit-transform: scaleX(0);
|
|
||||||
transform-origin: left;
|
|
||||||
opacity: 0;
|
|
||||||
}
|
|
||||||
to {
|
|
||||||
-webkit-transform: scaleX(1);
|
|
||||||
transform-origin: left;
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
body > header {
|
body > header {
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
@ -144,7 +132,7 @@ body > header {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
body > header:focus-within #content, .show + #content {
|
body > header:focus-within #content, #content.show {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
@ -205,133 +193,31 @@ body > header {
|
|||||||
|
|
||||||
/* Only enable label animations on large screens */
|
/* Only enable label animations on large screens */
|
||||||
@media screen and (min-width: 600px) {
|
@media screen and (min-width: 600px) {
|
||||||
header nav a {
|
header nav a {
|
||||||
i {
|
i {
|
||||||
transition: all 0.2s ease;
|
transition: all 0.2s ease;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mobile-label {
|
.mobile-label {
|
||||||
transition: all 0.2s ease;
|
transition: all 0.2s ease;
|
||||||
display: block;
|
display: block;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 50%;
|
left: 50%;
|
||||||
transform: translateZ(0);
|
transform: translate(-50%, 0);
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
font-size: 0.9em;
|
font-size: 0.9em;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
img + .mobile-label { display: none; }
|
img + .mobile-label { display: none; }
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
i { margin-bottom: 0.75em; }
|
i { margin-bottom: 0.75em; }
|
||||||
.mobile-label {
|
.mobile-label {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
transform: translate(-50%, 80%);
|
transform: translate(-50%, 80%);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Small screens
|
|
||||||
@media screen and (max-width: 600px) {
|
|
||||||
@keyframes menuOpening {
|
|
||||||
from {
|
|
||||||
transform: scaleX(0);
|
|
||||||
transform-origin: left;
|
|
||||||
opacity: 0;
|
|
||||||
}
|
|
||||||
to {
|
|
||||||
transform: scaleX(1);
|
|
||||||
transform-origin: left;
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@-webkit-keyframes menuOpening {
|
|
||||||
from {
|
|
||||||
-webkit-transform: scaleX(0);
|
|
||||||
transform-origin: left;
|
|
||||||
opacity: 0;
|
|
||||||
}
|
|
||||||
to {
|
|
||||||
-webkit-transform: scaleX(1);
|
|
||||||
transform-origin: left;
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
body > header {
|
|
||||||
flex-direction: column;
|
|
||||||
|
|
||||||
nav#menu {
|
|
||||||
display: inline-flex;
|
|
||||||
z-index: 21;
|
|
||||||
}
|
|
||||||
|
|
||||||
#content {
|
|
||||||
display: none;
|
|
||||||
appearance: none;
|
|
||||||
text-align: center;
|
|
||||||
z-index: 20;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
body > header:focus-within #content, .show + #content {
|
|
||||||
position: fixed;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
justify-content: flex-start;
|
|
||||||
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
box-sizing: border-box;
|
|
||||||
|
|
||||||
animation: 0.2s menuOpening;
|
|
||||||
|
|
||||||
&::before {
|
|
||||||
content: "";
|
|
||||||
position: absolute;
|
|
||||||
transform: skewX(-10deg);
|
|
||||||
top: 0;
|
|
||||||
left: -20%;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
|
|
||||||
z-index: -10;
|
|
||||||
|
|
||||||
background: $primary;
|
|
||||||
}
|
|
||||||
|
|
||||||
> nav {
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: flex-start;
|
|
||||||
|
|
||||||
a {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: row;
|
|
||||||
align-items: center;
|
|
||||||
margin: 0;
|
|
||||||
padding: 1rem 1.5rem;
|
|
||||||
color: $background;
|
|
||||||
font-size: 1.4em;
|
|
||||||
font-weight: 300;
|
|
||||||
|
|
||||||
&.title { font-size: 1.8em; }
|
|
||||||
|
|
||||||
> *:first-child { width: 3rem; }
|
|
||||||
> img:first-child { height: 3rem; }
|
|
||||||
> *:last-child { margin-left: 1rem; }
|
|
||||||
> nav hr {
|
|
||||||
display: block;
|
|
||||||
margin: 0;
|
|
||||||
width: 100%;
|
|
||||||
border: solid $background 0.1rem;
|
|
||||||
}
|
|
||||||
.mobile-label { display: initial; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
/* Color Scheme */
|
/* Color Scheme */
|
||||||
$gray: #f3f3f3;
|
$gray: #F3F3F3;
|
||||||
$black: #242424;
|
$black: #242424;
|
||||||
$white: #f8f8f8;
|
$white: #F8F8F8;
|
||||||
$purple: #7765e3;
|
$purple: #7765E3;
|
||||||
$lightpurple: #c2bbee;
|
$lightpurple: #c2bbee;
|
||||||
$red: #e92f2f;
|
$red: #E92F2F;
|
||||||
$yellow: #ffe347;
|
$yellow: #ffe347;
|
||||||
$green: #23f0c7;
|
$green: #23f0c7;
|
||||||
|
|
||||||
@ -24,14 +24,14 @@ $margin: 0 $horizontal-margin;
|
|||||||
|
|
||||||
/* Fonts */
|
/* Fonts */
|
||||||
|
|
||||||
$route159: "Shabnam", "Route159", serif;
|
$route159: "Route159", serif;
|
||||||
$playfair: "Vazir", "Playfair Display", serif;
|
$playfair: "Playfair Display", serif;
|
||||||
$lora: "Vazir", "Lora", serif;
|
$lora: "Lora", serif;
|
||||||
|
|
||||||
//Code Highlighting
|
//Code Highlighting
|
||||||
$code-keyword-color: #45244a;
|
$code-keyword-color: #45244a;
|
||||||
$code-source-color: #4c588c;
|
$code-source-color: #4c588c;
|
||||||
$code-constant-color: scale-color(magenta, $lightness: -5%);
|
$code-constant-color: scale-color(magenta,$lightness:-5%);
|
||||||
$code-operator-color: scale-color($code-source-color, $lightness: -5%);
|
$code-operator-color: scale-color($code-source-color,$lightness:-5%);
|
||||||
$code-string-color: #8a571c;
|
$code-string-color: #8a571c;
|
||||||
$code-comment-color: #1c4c8a;
|
$code-comment-color: #1c4c8a;
|
||||||
|
@ -1,14 +1,12 @@
|
|||||||
/* color palette: https://coolors.co/23f0c7-ef767a-7765e3-6457a6-ffe347 */
|
/* color palette: https://coolors.co/23f0c7-ef767a-7765e3-6457a6-ffe347 */
|
||||||
|
|
||||||
@import url("./feather.css");
|
@import url('./feather.css');
|
||||||
@import url("./fonts/Route159/Route159.css");
|
@import url('./fonts/Route159/Route159.css');
|
||||||
@import url("./fonts/Lora/Lora.css");
|
@import url('./fonts/Lora/Lora.css');
|
||||||
@import url("./fonts/Playfair_Display/PlayfairDisplay.css");
|
@import url('./fonts/Playfair_Display/PlayfairDisplay.css');
|
||||||
@import url("./fonts/Vazir_WOL/Vazir_WOL.css");
|
|
||||||
@import url("./fonts/Shabnam_WOL/Shabnam_WOL.css");
|
|
||||||
|
|
||||||
@import "dark_variables";
|
@import 'dark_variables';
|
||||||
@import "global";
|
@import 'global';
|
||||||
@import "header";
|
@import 'header';
|
||||||
@import "article";
|
@import 'article';
|
||||||
@import "forms";
|
@import 'forms';
|
||||||
|
@ -1,94 +0,0 @@
|
|||||||
Copyright (c) 2015, Saber Rastikerdar (saber.rastikerdar@gmail.com),
|
|
||||||
Glyphs and data from Roboto font are licensed under the Apache License, Version 2.0.
|
|
||||||
|
|
||||||
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
|
||||||
This license is copied below, and is also available with a FAQ at:
|
|
||||||
http://scripts.sil.org/OFL
|
|
||||||
|
|
||||||
|
|
||||||
-----------------------------------------------------------
|
|
||||||
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
|
||||||
-----------------------------------------------------------
|
|
||||||
|
|
||||||
PREAMBLE
|
|
||||||
The goals of the Open Font License (OFL) are to stimulate worldwide
|
|
||||||
development of collaborative font projects, to support the font creation
|
|
||||||
efforts of academic and linguistic communities, and to provide a free and
|
|
||||||
open framework in which fonts may be shared and improved in partnership
|
|
||||||
with others.
|
|
||||||
|
|
||||||
The OFL allows the licensed fonts to be used, studied, modified and
|
|
||||||
redistributed freely as long as they are not sold by themselves. The
|
|
||||||
fonts, including any derivative works, can be bundled, embedded,
|
|
||||||
redistributed and/or sold with any software provided that any reserved
|
|
||||||
names are not used by derivative works. The fonts and derivatives,
|
|
||||||
however, cannot be released under any other type of license. The
|
|
||||||
requirement for fonts to remain under this license does not apply
|
|
||||||
to any document created using the fonts or their derivatives.
|
|
||||||
|
|
||||||
DEFINITIONS
|
|
||||||
"Font Software" refers to the set of files released by the Copyright
|
|
||||||
Holder(s) under this license and clearly marked as such. This may
|
|
||||||
include source files, build scripts and documentation.
|
|
||||||
|
|
||||||
"Reserved Font Name" refers to any names specified as such after the
|
|
||||||
copyright statement(s).
|
|
||||||
|
|
||||||
"Original Version" refers to the collection of Font Software components as
|
|
||||||
distributed by the Copyright Holder(s).
|
|
||||||
|
|
||||||
"Modified Version" refers to any derivative made by adding to, deleting,
|
|
||||||
or substituting -- in part or in whole -- any of the components of the
|
|
||||||
Original Version, by changing formats or by porting the Font Software to a
|
|
||||||
new environment.
|
|
||||||
|
|
||||||
"Author" refers to any designer, engineer, programmer, technical
|
|
||||||
writer or other person who contributed to the Font Software.
|
|
||||||
|
|
||||||
PERMISSION & CONDITIONS
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining
|
|
||||||
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
|
||||||
redistribute, and sell modified and unmodified copies of the Font
|
|
||||||
Software, subject to the following conditions:
|
|
||||||
|
|
||||||
1) Neither the Font Software nor any of its individual components,
|
|
||||||
in Original or Modified Versions, may be sold by itself.
|
|
||||||
|
|
||||||
2) Original or Modified Versions of the Font Software may be bundled,
|
|
||||||
redistributed and/or sold with any software, provided that each copy
|
|
||||||
contains the above copyright notice and this license. These can be
|
|
||||||
included either as stand-alone text files, human-readable headers or
|
|
||||||
in the appropriate machine-readable metadata fields within text or
|
|
||||||
binary files as long as those fields can be easily viewed by the user.
|
|
||||||
|
|
||||||
3) No Modified Version of the Font Software may use the Reserved Font
|
|
||||||
Name(s) unless explicit written permission is granted by the corresponding
|
|
||||||
Copyright Holder. This restriction only applies to the primary font name as
|
|
||||||
presented to the users.
|
|
||||||
|
|
||||||
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
|
||||||
Software shall not be used to promote, endorse or advertise any
|
|
||||||
Modified Version, except to acknowledge the contribution(s) of the
|
|
||||||
Copyright Holder(s) and the Author(s) or with their explicit written
|
|
||||||
permission.
|
|
||||||
|
|
||||||
5) The Font Software, modified or unmodified, in part or in whole,
|
|
||||||
must be distributed entirely under this license, and must not be
|
|
||||||
distributed under any other license. The requirement for fonts to
|
|
||||||
remain under this license does not apply to any document created
|
|
||||||
using the Font Software.
|
|
||||||
|
|
||||||
TERMINATION
|
|
||||||
This license becomes null and void if any of the above conditions are
|
|
||||||
not met.
|
|
||||||
|
|
||||||
DISCLAIMER
|
|
||||||
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
||||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
|
||||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
|
||||||
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
|
||||||
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
||||||
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
|
||||||
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
||||||
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
|
||||||
OTHER DEALINGS IN THE FONT SOFTWARE.
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,49 +0,0 @@
|
|||||||
@font-face {
|
|
||||||
font-family: Shabnam;
|
|
||||||
src: url("Shabnam-WOL.eot");
|
|
||||||
src: url("Shabnam-WOL.eot?#iefix") format("embedded-opentype"),
|
|
||||||
url("Shabnam-WOL.woff2") format("woff2"),
|
|
||||||
url("Shabnam-WOL.woff") format("woff"),
|
|
||||||
url("Shabnam-WOL.ttf") format("truetype");
|
|
||||||
font-weight: normal;
|
|
||||||
}
|
|
||||||
|
|
||||||
@font-face {
|
|
||||||
font-family: Shabnam;
|
|
||||||
src: url("Shabnam-Bold-WOL.eot");
|
|
||||||
src: url("Shabnam-Bold-WOL.eot?#iefix") format("embedded-opentype"),
|
|
||||||
url("Shabnam-Bold-WOL.woff2") format("woff2"),
|
|
||||||
url("Shabnam-Bold-WOL.woff") format("woff"),
|
|
||||||
url("Shabnam-Bold-WOL.ttf") format("truetype");
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
|
|
||||||
@font-face {
|
|
||||||
font-family: Shabnam;
|
|
||||||
src: url("Shabnam-Thin-WOL.eot");
|
|
||||||
src: url("Shabnam-Thin-WOL.eot?#iefix") format("embedded-opentype"),
|
|
||||||
url("Shabnam-Thin-WOL.woff2") format("woff2"),
|
|
||||||
url("Shabnam-Thin-WOL.woff") format("woff"),
|
|
||||||
url("Shabnam-Thin-WOL.ttf") format("truetype");
|
|
||||||
font-weight: 100;
|
|
||||||
}
|
|
||||||
|
|
||||||
@font-face {
|
|
||||||
font-family: Shabnam;
|
|
||||||
src: url("Shabnam-Light-WOL.eot");
|
|
||||||
src: url("Shabnam-Light-WOL.eot?#iefix") format("embedded-opentype"),
|
|
||||||
url("Shabnam-Light-WOL.woff2") format("woff2"),
|
|
||||||
url("Shabnam-Light-WOL.woff") format("woff"),
|
|
||||||
url("Shabnam-Light-WOL.ttf") format("truetype");
|
|
||||||
font-weight: 300;
|
|
||||||
}
|
|
||||||
|
|
||||||
@font-face {
|
|
||||||
font-family: Shabnam;
|
|
||||||
src: url("Shabnam-Medium-WOL.eot");
|
|
||||||
src: url("Shabnam-Medium-WOL.eot?#iefix") format("embedded-opentype"),
|
|
||||||
url("Shabnam-Medium-WOL.woff2") format("woff2"),
|
|
||||||
url("Shabnam-Medium-WOL.woff") format("woff"),
|
|
||||||
url("Shabnam-Medium-WOL.ttf") format("truetype");
|
|
||||||
font-weight: 500;
|
|
||||||
}
|
|
@ -1,51 +0,0 @@
|
|||||||
Changes by Saber Rastikerdar (saber.rastikerdar@gmail.com) are in public domain.
|
|
||||||
Glyphs and data from Roboto font are licensed under the Apache License, Version 2.0.
|
|
||||||
|
|
||||||
Fonts are (c) Bitstream (see below). DejaVu changes are in public domain.
|
|
||||||
|
|
||||||
Bitstream Vera Fonts Copyright
|
|
||||||
------------------------------
|
|
||||||
|
|
||||||
Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Bitstream Vera is
|
|
||||||
a trademark of Bitstream, Inc.
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of the fonts accompanying this license ("Fonts") and associated
|
|
||||||
documentation files (the "Font Software"), to reproduce and distribute the
|
|
||||||
Font Software, including without limitation the rights to use, copy, merge,
|
|
||||||
publish, distribute, and/or sell copies of the Font Software, and to permit
|
|
||||||
persons to whom the Font Software is furnished to do so, subject to the
|
|
||||||
following conditions:
|
|
||||||
|
|
||||||
The above copyright and trademark notices and this permission notice shall
|
|
||||||
be included in all copies of one or more of the Font Software typefaces.
|
|
||||||
|
|
||||||
The Font Software may be modified, altered, or added to, and in particular
|
|
||||||
the designs of glyphs or characters in the Fonts may be modified and
|
|
||||||
additional glyphs or characters may be added to the Fonts, only if the fonts
|
|
||||||
are renamed to names not containing either the words "Bitstream" or the word
|
|
||||||
"Vera".
|
|
||||||
|
|
||||||
This License becomes null and void to the extent applicable to Fonts or Font
|
|
||||||
Software that has been modified and is distributed under the "Bitstream
|
|
||||||
Vera" names.
|
|
||||||
|
|
||||||
The Font Software may be sold as part of a larger software package but no
|
|
||||||
copy of one or more of the Font Software typefaces may be sold by itself.
|
|
||||||
|
|
||||||
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
||||||
OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT,
|
|
||||||
TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL BITSTREAM OR THE GNOME
|
|
||||||
FOUNDATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING
|
|
||||||
ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES,
|
|
||||||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
|
|
||||||
THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE
|
|
||||||
FONT SOFTWARE.
|
|
||||||
|
|
||||||
Except as contained in this notice, the names of Gnome, the Gnome
|
|
||||||
Foundation, and Bitstream Inc., shall not be used in advertising or
|
|
||||||
otherwise to promote the sale, use or other dealings in this Font Software
|
|
||||||
without prior written authorization from the Gnome Foundation or Bitstream
|
|
||||||
Inc., respectively. For further information, contact: fonts at gnome dot
|
|
||||||
org.
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,65 +0,0 @@
|
|||||||
@font-face {
|
|
||||||
font-family: Vazir;
|
|
||||||
src: url('Vazir-WOL.eot');
|
|
||||||
src: url('Vazir-WOL.eot?#iefix') format('embedded-opentype'),
|
|
||||||
url('Vazir-WOL.woff2') format('woff2'),
|
|
||||||
url('Vazir-WOL.woff') format('woff'),
|
|
||||||
url('Vazir-WOL.ttf') format('truetype');
|
|
||||||
font-weight: normal;
|
|
||||||
font-style: normal;
|
|
||||||
}
|
|
||||||
|
|
||||||
@font-face {
|
|
||||||
font-family: Vazir;
|
|
||||||
src: url('Vazir-Bold-WOL.eot');
|
|
||||||
src: url('Vazir-Bold-WOL.eot?#iefix') format('embedded-opentype'),
|
|
||||||
url('Vazir-Bold-WOL.woff2') format('woff2'),
|
|
||||||
url('Vazir-Bold-WOL.woff') format('woff'),
|
|
||||||
url('Vazir-Bold-WOL.ttf') format('truetype');
|
|
||||||
font-weight: bold;
|
|
||||||
font-style: normal;
|
|
||||||
}
|
|
||||||
|
|
||||||
@font-face {
|
|
||||||
font-family: Vazir;
|
|
||||||
src: url('Vazir-Black-WOL.eot');
|
|
||||||
src: url('Vazir-Black-WOL.eot?#iefix') format('embedded-opentype'),
|
|
||||||
url('Vazir-Black-WOL.woff2') format('woff2'),
|
|
||||||
url('Vazir-Black-WOL.woff') format('woff'),
|
|
||||||
url('Vazir-Black-WOL.ttf') format('truetype');
|
|
||||||
font-weight: 900;
|
|
||||||
font-style: normal;
|
|
||||||
}
|
|
||||||
|
|
||||||
@font-face {
|
|
||||||
font-family: Vazir;
|
|
||||||
src: url('Vazir-Medium-WOL.eot');
|
|
||||||
src: url('Vazir-Medium-WOL.eot?#iefix') format('embedded-opentype'),
|
|
||||||
url('Vazir-Medium-WOL.woff2') format('woff2'),
|
|
||||||
url('Vazir-Medium-WOL.woff') format('woff'),
|
|
||||||
url('Vazir-Medium-WOL.ttf') format('truetype');
|
|
||||||
font-weight: 500;
|
|
||||||
font-style: normal;
|
|
||||||
}
|
|
||||||
|
|
||||||
@font-face {
|
|
||||||
font-family: Vazir;
|
|
||||||
src: url('Vazir-Light-WOL.eot');
|
|
||||||
src: url('Vazir-Light-WOL.eot?#iefix') format('embedded-opentype'),
|
|
||||||
url('Vazir-Light-WOL.woff2') format('woff2'),
|
|
||||||
url('Vazir-Light-WOL.woff') format('woff'),
|
|
||||||
url('Vazir-Light-WOL.ttf') format('truetype');
|
|
||||||
font-weight: 300;
|
|
||||||
font-style: normal;
|
|
||||||
}
|
|
||||||
|
|
||||||
@font-face {
|
|
||||||
font-family: Vazir;
|
|
||||||
src: url('Vazir-Thin-WOL.eot');
|
|
||||||
src: url('Vazir-Thin-WOL.eot?#iefix') format('embedded-opentype'),
|
|
||||||
url('Vazir-Thin-WOL.woff2') format('woff2'),
|
|
||||||
url('Vazir-Thin-WOL.woff') format('woff'),
|
|
||||||
url('Vazir-Thin-WOL.ttf') format('truetype');
|
|
||||||
font-weight: 100;
|
|
||||||
font-style: normal;
|
|
||||||
}
|
|
@ -1,14 +1,12 @@
|
|||||||
/* color palette: https://coolors.co/23f0c7-ef767a-7765e3-6457a6-ffe347 */
|
/* color palette: https://coolors.co/23f0c7-ef767a-7765e3-6457a6-ffe347 */
|
||||||
|
|
||||||
@import url("./feather.css");
|
@import url('./feather.css');
|
||||||
@import url("./fonts/Route159/Route159.css");
|
@import url('./fonts/Route159/Route159.css');
|
||||||
@import url("./fonts/Lora/Lora.css");
|
@import url('./fonts/Lora/Lora.css');
|
||||||
@import url("./fonts/Playfair_Display/PlayfairDisplay.css");
|
@import url('./fonts/Playfair_Display/PlayfairDisplay.css');
|
||||||
@import url("./fonts/Vazir_WOL/Vazir_WOL.css");
|
|
||||||
@import url("./fonts/Shabnam_WOL/Shabnam_WOL.css");
|
|
||||||
|
|
||||||
@import "variables";
|
@import 'variables';
|
||||||
@import "global";
|
@import 'global';
|
||||||
@import "header";
|
@import 'header';
|
||||||
@import "article";
|
@import 'article';
|
||||||
@import "forms";
|
@import 'forms';
|
||||||
|
42
build.rs
42
build.rs
@ -1,3 +1,5 @@
|
|||||||
|
use rsass;
|
||||||
|
|
||||||
use ructe::Ructe;
|
use ructe::Ructe;
|
||||||
use std::process::{Command, Stdio};
|
use std::process::{Command, Stdio};
|
||||||
use std::{ffi::OsStr, fs::*, io::Write, path::*};
|
use std::{ffi::OsStr, fs::*, io::Write, path::*};
|
||||||
@ -41,20 +43,26 @@ fn main() {
|
|||||||
.expect("compile templates");
|
.expect("compile templates");
|
||||||
|
|
||||||
compile_themes().expect("Theme compilation error");
|
compile_themes().expect("Theme compilation error");
|
||||||
recursive_copy(&Path::new("assets").join("icons"), Path::new("static"))
|
recursive_copy(&Path::new("assets").join("icons"), &Path::new("static"))
|
||||||
.expect("Couldn't copy icons");
|
.expect("Couldn't copy icons");
|
||||||
recursive_copy(&Path::new("assets").join("images"), Path::new("static"))
|
recursive_copy(&Path::new("assets").join("images"), &Path::new("static"))
|
||||||
.expect("Couldn't copy images");
|
.expect("Couldn't copy images");
|
||||||
create_dir_all(&Path::new("static").join("media")).expect("Couldn't init media directory");
|
create_dir_all(&Path::new("static").join("media")).expect("Couldn't init media directory");
|
||||||
|
|
||||||
let cache_id = &compute_static_hash()[..8];
|
let cache_id = &compute_static_hash()[..8];
|
||||||
println!("cargo:rerun-if-changed=plume-front/pkg/plume_front_bg.wasm");
|
println!("cargo:rerun-if-changed=target/deploy/plume-front.wasm");
|
||||||
copy(
|
copy("target/deploy/plume-front.wasm", "static/plume-front.wasm")
|
||||||
"plume-front/pkg/plume_front_bg.wasm",
|
.and_then(|_| read_to_string("target/deploy/plume-front.js"))
|
||||||
"static/plume_front_bg.wasm",
|
.and_then(|js| {
|
||||||
)
|
write(
|
||||||
.and_then(|_| copy("plume-front/pkg/plume_front.js", "static/plume_front.js"))
|
"static/plume-front.js",
|
||||||
.ok();
|
js.replace(
|
||||||
|
"\"plume-front.wasm\"",
|
||||||
|
&format!("\"/static/cached/{}/plume-front.wasm\"", cache_id),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
})
|
||||||
|
.ok();
|
||||||
|
|
||||||
println!("cargo:rustc-env=CACHE_ID={}", cache_id)
|
println!("cargo:rustc-env=CACHE_ID={}", cache_id)
|
||||||
}
|
}
|
||||||
@ -97,12 +105,12 @@ fn compile_theme(path: &Path, out_dir: &Path) -> std::io::Result<()> {
|
|||||||
.components()
|
.components()
|
||||||
.skip_while(|c| *c != Component::Normal(OsStr::new("themes")))
|
.skip_while(|c| *c != Component::Normal(OsStr::new("themes")))
|
||||||
.skip(1)
|
.skip(1)
|
||||||
.map(|c| {
|
.filter_map(|c| {
|
||||||
c.as_os_str()
|
c.as_os_str()
|
||||||
.to_str()
|
.to_str()
|
||||||
.unwrap_or_default()
|
.unwrap_or_default()
|
||||||
.split_once('.')
|
.splitn(2, '.')
|
||||||
.map_or(c.as_os_str().to_str().unwrap_or_default(), |x| x.0)
|
.next()
|
||||||
})
|
})
|
||||||
.collect::<Vec<_>>()
|
.collect::<Vec<_>>()
|
||||||
.join("-");
|
.join("-");
|
||||||
@ -120,14 +128,8 @@ fn compile_theme(path: &Path, out_dir: &Path) -> std::io::Result<()> {
|
|||||||
// compile the .scss/.sass file
|
// compile the .scss/.sass file
|
||||||
let mut out = File::create(out.join("theme.css"))?;
|
let mut out = File::create(out.join("theme.css"))?;
|
||||||
out.write_all(
|
out.write_all(
|
||||||
&rsass::compile_scss_path(
|
&rsass::compile_scss_file(path, rsass::OutputStyle::Compressed)
|
||||||
path,
|
.expect("SCSS compilation error"),
|
||||||
rsass::output::Format {
|
|
||||||
style: rsass::output::Style::Compressed,
|
|
||||||
..rsass::output::Format::default()
|
|
||||||
},
|
|
||||||
)
|
|
||||||
.expect("SCSS compilation error"),
|
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
"project_id": 352097
|
"project_identifier": "plume"
|
||||||
"api_token_env": "CROWDIN_API_KEY"
|
"api_key_env": CROWDIN_API_KEY
|
||||||
preserve_hierarchy: true
|
preserve_hierarchy: true
|
||||||
files:
|
files:
|
||||||
- source: /po/plume/plume.pot
|
- source: /po/plume/plume.pot
|
||||||
|
116
flake.lock
116
flake.lock
@ -1,116 +0,0 @@
|
|||||||
{
|
|
||||||
"nodes": {
|
|
||||||
"flake-utils": {
|
|
||||||
"inputs": {
|
|
||||||
"systems": "systems"
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1681202837,
|
|
||||||
"narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=",
|
|
||||||
"owner": "numtide",
|
|
||||||
"repo": "flake-utils",
|
|
||||||
"rev": "cfacdce06f30d2b68473a46042957675eebb3401",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "numtide",
|
|
||||||
"repo": "flake-utils",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"flake-utils_2": {
|
|
||||||
"inputs": {
|
|
||||||
"systems": "systems_2"
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1681202837,
|
|
||||||
"narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=",
|
|
||||||
"owner": "numtide",
|
|
||||||
"repo": "flake-utils",
|
|
||||||
"rev": "cfacdce06f30d2b68473a46042957675eebb3401",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "numtide",
|
|
||||||
"repo": "flake-utils",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nixpkgs": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1683408522,
|
|
||||||
"narHash": "sha256-9kcPh6Uxo17a3kK3XCHhcWiV1Yu1kYj22RHiymUhMkU=",
|
|
||||||
"owner": "NixOS",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"rev": "897876e4c484f1e8f92009fd11b7d988a121a4e7",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "NixOS",
|
|
||||||
"ref": "nixos-unstable",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"root": {
|
|
||||||
"inputs": {
|
|
||||||
"flake-utils": "flake-utils",
|
|
||||||
"nixpkgs": "nixpkgs",
|
|
||||||
"rust-overlay": "rust-overlay"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"rust-overlay": {
|
|
||||||
"inputs": {
|
|
||||||
"flake-utils": "flake-utils_2",
|
|
||||||
"nixpkgs": [
|
|
||||||
"nixpkgs"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1683857898,
|
|
||||||
"narHash": "sha256-pyVY4UxM6zUX97g6bk6UyCbZGCWZb2Zykrne8YxacRA=",
|
|
||||||
"owner": "oxalica",
|
|
||||||
"repo": "rust-overlay",
|
|
||||||
"rev": "4e7fba3f37f5e184ada0ef3cf1e4d8ef450f240b",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "oxalica",
|
|
||||||
"repo": "rust-overlay",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"systems": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1681028828,
|
|
||||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
|
||||||
"owner": "nix-systems",
|
|
||||||
"repo": "default",
|
|
||||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "nix-systems",
|
|
||||||
"repo": "default",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"systems_2": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1681028828,
|
|
||||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
|
||||||
"owner": "nix-systems",
|
|
||||||
"repo": "default",
|
|
||||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "nix-systems",
|
|
||||||
"repo": "default",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"root": "root",
|
|
||||||
"version": 7
|
|
||||||
}
|
|
60
flake.nix
60
flake.nix
@ -1,60 +0,0 @@
|
|||||||
{
|
|
||||||
description = "Developpment shell for Plume including nightly Rust compiler";
|
|
||||||
|
|
||||||
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
|
||||||
inputs.rust-overlay = {
|
|
||||||
url = "github:oxalica/rust-overlay";
|
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
};
|
|
||||||
inputs.flake-utils.url = "github:numtide/flake-utils";
|
|
||||||
|
|
||||||
outputs = { self, nixpkgs, flake-utils, rust-overlay, ... }:
|
|
||||||
flake-utils.lib.eachDefaultSystem (system:
|
|
||||||
let
|
|
||||||
overlays = [ (import rust-overlay) ];
|
|
||||||
pkgs = import nixpkgs { inherit system overlays; };
|
|
||||||
inputs = with pkgs; [
|
|
||||||
(rust-bin.nightly.latest.default.override {
|
|
||||||
targets = [ "wasm32-unknown-unknown" ];
|
|
||||||
})
|
|
||||||
wasm-pack
|
|
||||||
openssl
|
|
||||||
pkg-config
|
|
||||||
gettext
|
|
||||||
postgresql
|
|
||||||
sqlite
|
|
||||||
];
|
|
||||||
in {
|
|
||||||
packages.default = pkgs.rustPlatform.buildRustPackage {
|
|
||||||
pname = "plume";
|
|
||||||
version = "0.7.3-dev";
|
|
||||||
|
|
||||||
src = ./.;
|
|
||||||
|
|
||||||
cargoLock = {
|
|
||||||
lockFile = ./Cargo.lock;
|
|
||||||
outputHashes = {
|
|
||||||
"pulldown-cmark-0.8.0" = "sha256-lpfoRDuY3zJ3QmUqJ5k9OL0MEdGDpwmpJ+u5BCj2kIA=";
|
|
||||||
"rocket_csrf-0.1.2" = "sha256-WywZfMiwZqTPfSDcAE7ivTSYSaFX+N9fjnRsLSLb9wE=";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
buildNoDefaultFeatures = true;
|
|
||||||
buildFeatures = ["postgresql" "s3"];
|
|
||||||
|
|
||||||
nativeBuildInputs = inputs;
|
|
||||||
|
|
||||||
buildPhase = ''
|
|
||||||
wasm-pack build --target web --release plume-front
|
|
||||||
cargo build --no-default-features --features postgresql,s3 --path .
|
|
||||||
cargo build --no-default-features --features postgresql,s3 --path plume-cli
|
|
||||||
'';
|
|
||||||
installPhase = ''
|
|
||||||
cargo install --no-default-features --features postgresql,s3 --path . --target-dir $out
|
|
||||||
cargo install --no-default-features --features postgresql,s3 --path plume-cli --target-dir $out
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
devShells.default = pkgs.mkShell {
|
|
||||||
packages = inputs;
|
|
||||||
};
|
|
||||||
});
|
|
||||||
}
|
|
@ -1 +0,0 @@
|
|||||||
DROP INDEX medias_index_file_path;
|
|
@ -1 +0,0 @@
|
|||||||
CREATE INDEX medias_index_file_path ON medias (file_path);
|
|
@ -1 +0,0 @@
|
|||||||
DROP TABLE email_signups;
|
|
@ -1,9 +0,0 @@
|
|||||||
CREATE TABLE email_signups (
|
|
||||||
id SERIAL PRIMARY KEY,
|
|
||||||
email VARCHAR NOT NULL,
|
|
||||||
token VARCHAR NOT NULL,
|
|
||||||
expiration_date TIMESTAMP NOT NULL
|
|
||||||
);
|
|
||||||
|
|
||||||
CREATE INDEX email_signups_token ON email_signups (token);
|
|
||||||
CREATE UNIQUE INDEX email_signups_token_requests_email ON email_signups (email);
|
|
@ -1,4 +0,0 @@
|
|||||||
ALTER TABLE email_blocklist ALTER COLUMN notification_text DROP NOT NULL;
|
|
||||||
ALTER TABLE email_blocklist ALTER COLUMN notify_user DROP NOT NULL;
|
|
||||||
ALTER TABLE email_blocklist ALTER COLUMN note DROP NOT NULL;
|
|
||||||
ALTER TABLE email_blocklist ALTER COLUMN email_address DROP NOT NULL;
|
|
@ -1,4 +0,0 @@
|
|||||||
ALTER TABLE email_blocklist ALTER COLUMN email_address SET NOT NULL;
|
|
||||||
ALTER TABLE email_blocklist ALTER COLUMN note SET NOT NULL;
|
|
||||||
ALTER TABLE email_blocklist ALTER COLUMN notify_user SET NOT NULL;
|
|
||||||
ALTER TABLE email_blocklist ALTER COLUMN notification_text SET NOT NULL;
|
|
@ -1 +0,0 @@
|
|||||||
DROP INDEX medias_index_file_path;
|
|
@ -1 +0,0 @@
|
|||||||
CREATE INDEX medias_index_file_path ON medias (file_path);
|
|
@ -1 +0,0 @@
|
|||||||
DROP TABLE email_signups;
|
|
@ -1,9 +0,0 @@
|
|||||||
CREATE TABLE email_signups (
|
|
||||||
id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
|
|
||||||
email VARCHAR NOT NULL,
|
|
||||||
token VARCHAR NOT NULL,
|
|
||||||
expiration_date TIMESTAMP NOT NULL
|
|
||||||
);
|
|
||||||
|
|
||||||
CREATE INDEX email_signups_token ON email_signups (token);
|
|
||||||
CREATE UNIQUE INDEX email_signups_token_requests_email ON email_signups (email);
|
|
@ -1,9 +0,0 @@
|
|||||||
CREATE TABLE email_blocklist2(id INTEGER PRIMARY KEY,
|
|
||||||
email_address TEXT UNIQUE,
|
|
||||||
note TEXT,
|
|
||||||
notify_user BOOLEAN DEFAULT FALSE,
|
|
||||||
notification_text TEXT);
|
|
||||||
|
|
||||||
INSERT INTO email_blocklist2 SELECT * FROM email_blocklist;
|
|
||||||
DROP TABLE email_blocklist;
|
|
||||||
ALTER TABLE email_blocklist2 RENAME TO email_blocklist;
|
|
@ -1,9 +0,0 @@
|
|||||||
CREATE TABLE email_blocklist2(id INTEGER PRIMARY KEY,
|
|
||||||
email_address TEXT UNIQUE NOT NULL,
|
|
||||||
note TEXT NOT NULL,
|
|
||||||
notify_user BOOLEAN DEFAULT FALSE NOT NULL,
|
|
||||||
notification_text TEXT NOT NULL);
|
|
||||||
|
|
||||||
INSERT INTO email_blocklist2 SELECT * FROM email_blocklist;
|
|
||||||
DROP TABLE email_blocklist;
|
|
||||||
ALTER TABLE email_blocklist2 RENAME TO email_blocklist;
|
|
@ -1,9 +1,9 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "plume-api"
|
name = "plume-api"
|
||||||
version = "0.7.2"
|
version = "0.4.0"
|
||||||
authors = ["Plume contributors"]
|
authors = ["Plume contributors"]
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
serde = "1.0.137"
|
serde = "1.0"
|
||||||
serde_derive = "1.0"
|
serde_derive = "1.0"
|
||||||
|
@ -1,3 +0,0 @@
|
|||||||
pre-release-hook = ["cargo", "fmt"]
|
|
||||||
pre-release-replacements = []
|
|
||||||
release = false
|
|
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "plume-cli"
|
name = "plume-cli"
|
||||||
version = "0.7.2"
|
version = "0.4.0"
|
||||||
authors = ["Plume contributors"]
|
authors = ["Plume contributors"]
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
|
|
||||||
@ -10,12 +10,12 @@ path = "src/main.rs"
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
clap = "2.33"
|
clap = "2.33"
|
||||||
dotenv = "0.15"
|
dotenv = "0.14"
|
||||||
rpassword = "6.0.1"
|
rpassword = "4.0"
|
||||||
|
|
||||||
[dependencies.diesel]
|
[dependencies.diesel]
|
||||||
features = ["r2d2", "chrono"]
|
features = ["r2d2", "chrono"]
|
||||||
version = "1.4.5"
|
version = "*"
|
||||||
|
|
||||||
[dependencies.plume-models]
|
[dependencies.plume-models]
|
||||||
path = "../plume-models"
|
path = "../plume-models"
|
||||||
@ -23,5 +23,3 @@ path = "../plume-models"
|
|||||||
[features]
|
[features]
|
||||||
postgres = ["plume-models/postgres", "diesel/postgres"]
|
postgres = ["plume-models/postgres", "diesel/postgres"]
|
||||||
sqlite = ["plume-models/sqlite", "diesel/sqlite"]
|
sqlite = ["plume-models/sqlite", "diesel/sqlite"]
|
||||||
search-lindera = ["plume-models/search-lindera"]
|
|
||||||
s3 = ["plume-models/s3"]
|
|
||||||
|
@ -1,3 +0,0 @@
|
|||||||
pre-release-hook = ["cargo", "fmt"]
|
|
||||||
pre-release-replacements = []
|
|
||||||
release = false
|
|
@ -68,6 +68,4 @@ fn new<'a>(args: &ArgMatches<'a>, conn: &Connection) {
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
.expect("Couldn't save instance");
|
.expect("Couldn't save instance");
|
||||||
Instance::cache_local(conn);
|
|
||||||
Instance::create_local_instance_user(conn).expect("Couldn't save local instance user");
|
|
||||||
}
|
}
|
||||||
|
@ -1,262 +0,0 @@
|
|||||||
use clap::{App, Arg, ArgMatches, SubCommand};
|
|
||||||
|
|
||||||
use plume_models::{blogs::Blog, instance::Instance, lists::*, users::User, Connection};
|
|
||||||
|
|
||||||
pub fn command<'a, 'b>() -> App<'a, 'b> {
|
|
||||||
SubCommand::with_name("lists")
|
|
||||||
.about("Manage lists")
|
|
||||||
.subcommand(
|
|
||||||
SubCommand::with_name("new")
|
|
||||||
.arg(
|
|
||||||
Arg::with_name("name")
|
|
||||||
.short("n")
|
|
||||||
.long("name")
|
|
||||||
.takes_value(true)
|
|
||||||
.help("The name of this list"),
|
|
||||||
)
|
|
||||||
.arg(
|
|
||||||
Arg::with_name("type")
|
|
||||||
.short("t")
|
|
||||||
.long("type")
|
|
||||||
.takes_value(true)
|
|
||||||
.help(
|
|
||||||
r#"The type of this list (one of "user", "blog", "word" or "prefix")"#,
|
|
||||||
),
|
|
||||||
)
|
|
||||||
.arg(
|
|
||||||
Arg::with_name("user")
|
|
||||||
.short("u")
|
|
||||||
.long("user")
|
|
||||||
.takes_value(true)
|
|
||||||
.help("Username of whom this list is for. Empty for an instance list"),
|
|
||||||
)
|
|
||||||
.about("Create a new list"),
|
|
||||||
)
|
|
||||||
.subcommand(
|
|
||||||
SubCommand::with_name("delete")
|
|
||||||
.arg(
|
|
||||||
Arg::with_name("name")
|
|
||||||
.short("n")
|
|
||||||
.long("name")
|
|
||||||
.takes_value(true)
|
|
||||||
.help("The name of the list to delete"),
|
|
||||||
)
|
|
||||||
.arg(
|
|
||||||
Arg::with_name("user")
|
|
||||||
.short("u")
|
|
||||||
.long("user")
|
|
||||||
.takes_value(true)
|
|
||||||
.help("Username of whom this list was for. Empty for instance list"),
|
|
||||||
)
|
|
||||||
.arg(
|
|
||||||
Arg::with_name("yes")
|
|
||||||
.short("y")
|
|
||||||
.long("yes")
|
|
||||||
.help("Confirm the deletion"),
|
|
||||||
)
|
|
||||||
.about("Delete a list"),
|
|
||||||
)
|
|
||||||
.subcommand(
|
|
||||||
SubCommand::with_name("add")
|
|
||||||
.arg(
|
|
||||||
Arg::with_name("name")
|
|
||||||
.short("n")
|
|
||||||
.long("name")
|
|
||||||
.takes_value(true)
|
|
||||||
.help("The name of the list to add an element to"),
|
|
||||||
)
|
|
||||||
.arg(
|
|
||||||
Arg::with_name("user")
|
|
||||||
.short("u")
|
|
||||||
.long("user")
|
|
||||||
.takes_value(true)
|
|
||||||
.help("Username of whom this list is for. Empty for instance list"),
|
|
||||||
)
|
|
||||||
.arg(
|
|
||||||
Arg::with_name("value")
|
|
||||||
.short("v")
|
|
||||||
.long("value")
|
|
||||||
.takes_value(true)
|
|
||||||
.help("The value to add"),
|
|
||||||
)
|
|
||||||
.about("Add element to a list"),
|
|
||||||
)
|
|
||||||
.subcommand(
|
|
||||||
SubCommand::with_name("rm")
|
|
||||||
.arg(
|
|
||||||
Arg::with_name("name")
|
|
||||||
.short("n")
|
|
||||||
.long("name")
|
|
||||||
.takes_value(true)
|
|
||||||
.help("The name of the list to remove an element from"),
|
|
||||||
)
|
|
||||||
.arg(
|
|
||||||
Arg::with_name("user")
|
|
||||||
.short("u")
|
|
||||||
.long("user")
|
|
||||||
.takes_value(true)
|
|
||||||
.help("Username of whom this list is for. Empty for instance list"),
|
|
||||||
)
|
|
||||||
.arg(
|
|
||||||
Arg::with_name("value")
|
|
||||||
.short("v")
|
|
||||||
.long("value")
|
|
||||||
.takes_value(true)
|
|
||||||
.help("The value to remove"),
|
|
||||||
)
|
|
||||||
.about("Remove element from list"),
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn run<'a>(args: &ArgMatches<'a>, conn: &Connection) {
|
|
||||||
let conn = conn;
|
|
||||||
match args.subcommand() {
|
|
||||||
("new", Some(x)) => new(x, conn),
|
|
||||||
("delete", Some(x)) => delete(x, conn),
|
|
||||||
("add", Some(x)) => add(x, conn),
|
|
||||||
("rm", Some(x)) => rm(x, conn),
|
|
||||||
("", None) => command().print_help().unwrap(),
|
|
||||||
_ => println!("Unknown subcommand"),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn get_list_identifier(args: &ArgMatches<'_>) -> (String, Option<String>) {
|
|
||||||
let name = args
|
|
||||||
.value_of("name")
|
|
||||||
.map(String::from)
|
|
||||||
.expect("No name provided for the list");
|
|
||||||
let user = args.value_of("user").map(String::from);
|
|
||||||
(name, user)
|
|
||||||
}
|
|
||||||
|
|
||||||
fn get_list_type(args: &ArgMatches<'_>) -> ListType {
|
|
||||||
let typ = args
|
|
||||||
.value_of("type")
|
|
||||||
.map(String::from)
|
|
||||||
.expect("No name type for the list");
|
|
||||||
match typ.as_str() {
|
|
||||||
"user" => ListType::User,
|
|
||||||
"blog" => ListType::Blog,
|
|
||||||
"word" => ListType::Word,
|
|
||||||
"prefix" => ListType::Prefix,
|
|
||||||
_ => panic!("Invalid list type: {}", typ),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn get_value(args: &ArgMatches<'_>) -> String {
|
|
||||||
args.value_of("value")
|
|
||||||
.map(String::from)
|
|
||||||
.expect("No query provided")
|
|
||||||
}
|
|
||||||
|
|
||||||
fn resolve_user(username: &str, conn: &Connection) -> User {
|
|
||||||
let instance = Instance::get_local_uncached(conn).expect("Failed to load local instance");
|
|
||||||
|
|
||||||
User::find_by_name(conn, username, instance.id).expect("User not found")
|
|
||||||
}
|
|
||||||
|
|
||||||
fn new(args: &ArgMatches<'_>, conn: &Connection) {
|
|
||||||
let (name, user) = get_list_identifier(args);
|
|
||||||
let typ = get_list_type(args);
|
|
||||||
|
|
||||||
let user = user.map(|user| resolve_user(&user, conn));
|
|
||||||
|
|
||||||
List::new(conn, &name, user.as_ref(), typ).expect("failed to create list");
|
|
||||||
}
|
|
||||||
|
|
||||||
fn delete(args: &ArgMatches<'_>, conn: &Connection) {
|
|
||||||
let (name, user) = get_list_identifier(args);
|
|
||||||
|
|
||||||
if !args.is_present("yes") {
|
|
||||||
panic!("Warning, this operation is destructive. Add --yes to confirm you want to do it.")
|
|
||||||
}
|
|
||||||
|
|
||||||
let user = user.map(|user| resolve_user(&user, conn));
|
|
||||||
|
|
||||||
let list =
|
|
||||||
List::find_for_user_by_name(conn, user.map(|u| u.id), &name).expect("list not found");
|
|
||||||
|
|
||||||
list.delete(conn).expect("Failed to update list");
|
|
||||||
}
|
|
||||||
|
|
||||||
fn add(args: &ArgMatches<'_>, conn: &Connection) {
|
|
||||||
let (name, user) = get_list_identifier(args);
|
|
||||||
let value = get_value(args);
|
|
||||||
|
|
||||||
let user = user.map(|user| resolve_user(&user, conn));
|
|
||||||
|
|
||||||
let list =
|
|
||||||
List::find_for_user_by_name(conn, user.map(|u| u.id), &name).expect("list not found");
|
|
||||||
|
|
||||||
match list.kind() {
|
|
||||||
ListType::Blog => {
|
|
||||||
let blog_id = Blog::find_by_fqn(conn, &value).expect("unknown blog").id;
|
|
||||||
if !list.contains_blog(conn, blog_id).unwrap() {
|
|
||||||
list.add_blogs(conn, &[blog_id]).unwrap();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ListType::User => {
|
|
||||||
let user_id = User::find_by_fqn(conn, &value).expect("unknown user").id;
|
|
||||||
if !list.contains_user(conn, user_id).unwrap() {
|
|
||||||
list.add_users(conn, &[user_id]).unwrap();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ListType::Word => {
|
|
||||||
if !list.contains_word(conn, &value).unwrap() {
|
|
||||||
list.add_words(conn, &[&value]).unwrap();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ListType::Prefix => {
|
|
||||||
if !list.contains_prefix(conn, &value).unwrap() {
|
|
||||||
list.add_prefixes(conn, &[&value]).unwrap();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn rm(args: &ArgMatches<'_>, conn: &Connection) {
|
|
||||||
let (name, user) = get_list_identifier(args);
|
|
||||||
let value = get_value(args);
|
|
||||||
|
|
||||||
let user = user.map(|user| resolve_user(&user, conn));
|
|
||||||
|
|
||||||
let list =
|
|
||||||
List::find_for_user_by_name(conn, user.map(|u| u.id), &name).expect("list not found");
|
|
||||||
|
|
||||||
match list.kind() {
|
|
||||||
ListType::Blog => {
|
|
||||||
let blog_id = Blog::find_by_fqn(conn, &value).expect("unknown blog").id;
|
|
||||||
let mut blogs = list.list_blogs(conn).unwrap();
|
|
||||||
if let Some(index) = blogs.iter().position(|b| b.id == blog_id) {
|
|
||||||
blogs.swap_remove(index);
|
|
||||||
let blogs = blogs.iter().map(|b| b.id).collect::<Vec<_>>();
|
|
||||||
list.set_blogs(conn, &blogs).unwrap();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ListType::User => {
|
|
||||||
let user_id = User::find_by_fqn(conn, &value).expect("unknown user").id;
|
|
||||||
let mut users = list.list_users(conn).unwrap();
|
|
||||||
if let Some(index) = users.iter().position(|u| u.id == user_id) {
|
|
||||||
users.swap_remove(index);
|
|
||||||
let users = users.iter().map(|u| u.id).collect::<Vec<_>>();
|
|
||||||
list.set_users(conn, &users).unwrap();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ListType::Word => {
|
|
||||||
let mut words = list.list_words(conn).unwrap();
|
|
||||||
if let Some(index) = words.iter().position(|w| *w == value) {
|
|
||||||
words.swap_remove(index);
|
|
||||||
let words = words.iter().map(String::as_str).collect::<Vec<_>>();
|
|
||||||
list.set_words(conn, &words).unwrap();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ListType::Prefix => {
|
|
||||||
let mut prefixes = list.list_prefixes(conn).unwrap();
|
|
||||||
if let Some(index) = prefixes.iter().position(|p| *p == value) {
|
|
||||||
prefixes.swap_remove(index);
|
|
||||||
let prefixes = prefixes.iter().map(String::as_str).collect::<Vec<_>>();
|
|
||||||
list.set_prefixes(conn, &prefixes).unwrap();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,13 +1,13 @@
|
|||||||
|
use dotenv;
|
||||||
|
|
||||||
use clap::App;
|
use clap::App;
|
||||||
use diesel::Connection;
|
use diesel::Connection;
|
||||||
use plume_models::{instance::Instance, Connection as Conn, CONFIG};
|
use plume_models::{instance::Instance, Connection as Conn, CONFIG};
|
||||||
use std::io::{self, prelude::*};
|
use std::io::{self, prelude::*};
|
||||||
|
|
||||||
mod instance;
|
mod instance;
|
||||||
mod list;
|
|
||||||
mod migration;
|
mod migration;
|
||||||
mod search;
|
mod search;
|
||||||
mod timeline;
|
|
||||||
mod users;
|
mod users;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
@ -18,8 +18,6 @@ fn main() {
|
|||||||
.subcommand(instance::command())
|
.subcommand(instance::command())
|
||||||
.subcommand(migration::command())
|
.subcommand(migration::command())
|
||||||
.subcommand(search::command())
|
.subcommand(search::command())
|
||||||
.subcommand(timeline::command())
|
|
||||||
.subcommand(list::command())
|
|
||||||
.subcommand(users::command());
|
.subcommand(users::command());
|
||||||
let matches = app.clone().get_matches();
|
let matches = app.clone().get_matches();
|
||||||
|
|
||||||
@ -29,7 +27,7 @@ fn main() {
|
|||||||
e => e.map(|_| ()).unwrap(),
|
e => e.map(|_| ()).unwrap(),
|
||||||
}
|
}
|
||||||
let conn = Conn::establish(CONFIG.database_url.as_str());
|
let conn = Conn::establish(CONFIG.database_url.as_str());
|
||||||
let _ = conn.as_ref().map(Instance::cache_local);
|
let _ = conn.as_ref().map(|conn| Instance::cache_local(conn));
|
||||||
|
|
||||||
match matches.subcommand() {
|
match matches.subcommand() {
|
||||||
("instance", Some(args)) => {
|
("instance", Some(args)) => {
|
||||||
@ -41,10 +39,6 @@ fn main() {
|
|||||||
("search", Some(args)) => {
|
("search", Some(args)) => {
|
||||||
search::run(args, &conn.expect("Couldn't connect to the database."))
|
search::run(args, &conn.expect("Couldn't connect to the database."))
|
||||||
}
|
}
|
||||||
("timeline", Some(args)) => {
|
|
||||||
timeline::run(args, &conn.expect("Couldn't connect to the database."))
|
|
||||||
}
|
|
||||||
("lists", Some(args)) => list::run(args, &conn.expect("Couldn't connect to the database.")),
|
|
||||||
("users", Some(args)) => {
|
("users", Some(args)) => {
|
||||||
users::run(args, &conn.expect("Couldn't connect to the database."))
|
users::run(args, &conn.expect("Couldn't connect to the database."))
|
||||||
}
|
}
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user