diff options
67 files changed, 2386 insertions, 1243 deletions
diff --git a/.travis.yml b/.travis.yml index d765ecb4..602a8613 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,7 +12,6 @@ before_cache: - rm -rfv target/debug/build/lemmy_server-* - rm -rfv target/debug/deps/lemmy_server-* - rm -rfv target/debug/lemmy_server.d - - cargo clean before_script: - psql -c "create user lemmy with password 'password' superuser;" -U postgres - psql -c 'create database lemmy with owner lemmy;' -U postgres diff --git a/ansible/VERSION b/ansible/VERSION index f9fc17d6..83ca525b 100644 --- a/ansible/VERSION +++ b/ansible/VERSION @@ -1 +1 @@ -v0.6.39 +v0.6.44 diff --git a/ansible/lemmy.yml b/ansible/lemmy.yml index 8d5e2264..bc01623f 100644 --- a/ansible/lemmy.yml +++ b/ansible/lemmy.yml @@ -36,13 +36,17 @@ - { src: 'templates/docker-compose.yml', dest: '/lemmy/docker-compose.yml', mode: '0600' } - { src: 'templates/nginx.conf', dest: '/etc/nginx/sites-enabled/lemmy.conf', mode: '0644' } - { src: '../docker/iframely.config.local.js', dest: '/lemmy/iframely.config.local.js', mode: '0600' } + vars: + lemmy_docker_image: "dessalines/lemmy:{{ lookup('file', 'VERSION') }}" + lemmy_port: "8536" + pictshare_port: "8537" + iframely_port: "8538" - name: add config file (only during initial setup) template: src='templates/config.hjson' dest='/lemmy/lemmy.hjson' mode='0600' force='no' owner='1000' group='1000' vars: postgres_password: "{{ lookup('password', 'passwords/{{ inventory_hostname }}/postgres chars=ascii_letters,digits') }}" jwt_password: "{{ lookup('password', 'passwords/{{ inventory_hostname }}/jwt chars=ascii_letters,digits') }}" - lemmy_docker_image: "dessalines/lemmy:{{ lookup('file', 'VERSION') }}" - name: enable and start docker service systemd: diff --git a/ansible/templates/docker-compose.yml b/ansible/templates/docker-compose.yml index ffd5b9c2..a4d54f6d 100644 --- a/ansible/templates/docker-compose.yml +++ b/ansible/templates/docker-compose.yml @@ -7,7 +7,7 @@ services: - "127.0.0.1:8536:8536" restart: always environment: - - RUST_LOG=debug + - RUST_LOG=error volumes: - ./lemmy.hjson:/config/config.hjson:ro depends_on: diff --git a/docker/dev/Dockerfile b/docker/dev/Dockerfile index aa0c2a8e..d9ffc2f3 100644 --- a/docker/dev/Dockerfile +++ b/docker/dev/Dockerfile @@ -10,7 +10,7 @@ RUN yarn install --pure-lockfile COPY ui /app/ui RUN yarn build -FROM ekidd/rust-musl-builder:1.40.0-openssl11 as rust +FROM ekidd/rust-musl-builder:1.42.0-openssl11 as rust # Cache deps WORKDIR /app @@ -33,7 +33,7 @@ RUN cargo build --frozen --release # RUN cargo install diesel_cli --no-default-features --features postgres -FROM ekidd/rust-musl-builder:1.40.0-openssl11 as docs +FROM ekidd/rust-musl-builder:1.42.0-openssl11 as docs WORKDIR /app COPY docs ./docs RUN sudo chown -R rust:rust . diff --git a/docker/dev/Dockerfile.libc b/docker/dev/Dockerfile.libc index 5eec3895..6348342f 100644 --- a/docker/dev/Dockerfile.libc +++ b/docker/dev/Dockerfile.libc @@ -20,7 +20,7 @@ COPY ui /app/ui RUN yarn build -FROM rust:1.40 as rust +FROM rust:1.42 as rust # Cache deps WORKDIR /app @@ -53,7 +53,7 @@ RUN cp /app/server/target/release/lemmy_server /app/server/ready #RUN cp /app/server/target/debug/lemmy_server /app/server/ready -FROM rust:1.40 as docs +FROM rust:1.42 as docs WORKDIR /app diff --git a/docker/lemmy.hjson b/docker/lemmy.hjson index 5a6d1ff1..b61ea826 100644 --- a/docker/lemmy.hjson +++ b/docker/lemmy.hjson @@ -41,7 +41,16 @@ # interval length for registration limit register_per_second: 3600 } -# # email sending configuration +# # optional: parameters for automatic configuration of new instance (only used at first start) +# setup: { +# # username for the admin user +# admin_username: "lemmy" +# # password for the admin user +# admin_password: "lemmy" +# # name of the site (can be changed later) +# site_name: "Lemmy Test" +# } +# # optional: email sending configuration # email: { # # hostname of the smtp server # smtp_server: "" diff --git a/docker/prod/docker-compose.yml b/docker/prod/docker-compose.yml index 9f5e8925..76f5ae14 100644 --- a/docker/prod/docker-compose.yml +++ b/docker/prod/docker-compose.yml @@ -12,12 +12,12 @@ services: restart: always lemmy: - image: dessalines/lemmy:v0.6.39 + image: dessalines/lemmy:v0.6.44 ports: - "127.0.0.1:8536:8536" restart: always environment: - - RUST_LOG=debug + - RUST_LOG=error volumes: - ./lemmy.hjson:/config/config.hjson:ro depends_on: diff --git a/docs/src/SUMMARY.md b/docs/src/SUMMARY.md index 10a6153e..70c423c7 100644 --- a/docs/src/SUMMARY.md +++ b/docs/src/SUMMARY.md @@ -13,6 +13,7 @@ - [Contributing](contributing.md) - [Docker Development](contributing_docker_development.md) - [Local Development](contributing_local_development.md) + - [Federation Development](contributing_federation_development.md) - [Websocket/HTTP API](contributing_websocket_http_api.md) - [ActivityPub API Outline](contributing_apub_api_outline.md) - [Theming Guide](contributing_theming.md) diff --git a/docs/src/about_goals.md b/docs/src/about_goals.md index 1463eeb0..caa6948a 100644 --- a/docs/src/about_goals.md +++ b/docs/src/about_goals.md @@ -47,3 +47,7 @@ - https://docs.rs/activitypub/0.1.4/activitypub/ - [Activitypub vocab.](https://www.w3.org/TR/activitystreams-vocabulary/) - [Activitypub main](https://www.w3.org/TR/activitypub/) +- [Federation.md](https://github.com/dariusk/gathio/blob/7fc93dbe9d4d99457a0e85c6c532112f415b7af2/FEDERATION.md) +- [Activitypub implementers guide](https://socialhub.activitypub.rocks/t/draft-guide-for-new-activitypub-implementers/479) +- [Data storage questions](https://socialhub.activitypub.rocks/t/data-storage-questions/579/3) +- [Activitypub as it has been understood](https://flak.tedunangst.com/post/ActivityPub-as-it-has-been-understood) diff --git a/docs/src/administration_install_ansible.md b/docs/src/administration_install_ansible.md index 875dae6a..bf5e6749 100644 --- a/docs/src/administration_install_ansible.md +++ b/docs/src/administration_install_ansible.md @@ -1,5 +1,7 @@ # Ansible Installation +This is the same as the [Docker installation](administration_install_docker.md), except that Ansible handles all of it automatically. It also does some extra things like setting up TLS and email for your Lemmy instance. + First, you need to [install Ansible on your local computer](https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html) (e.g. using `sudo apt install ansible`) or the equivalent for you platform. Then run the following commands on your local computer: @@ -11,3 +13,10 @@ cp inventory.example inventory nano inventory # enter your server, domain, contact email ansible-playbook lemmy.yml --become ``` + +To update to a new version, just run the following in your local Lemmy repo: +```bash +git pull origin master +cd ansible +ansible-playbook lemmy.yml --become +```
\ No newline at end of file diff --git a/docs/src/administration_install_docker.md b/docs/src/administration_install_docker.md index 99204983..391299b3 100644 --- a/docs/src/administration_install_docker.md +++ b/docs/src/administration_install_docker.md @@ -1,29 +1,33 @@ # Docker Installation -Make sure you have both docker and docker-compose(>=`1.24.0`) installed: +Make sure you have both docker and docker-compose(>=`1.24.0`) installed. On Ubuntu, just run `apt install docker-compose docker.io`. Next, ```bash -mkdir lemmy/ -cd lemmy/ +# create a folder for the lemmy files. the location doesnt matter, you can put this anywhere you want +mkdir /lemmy +cd /lemmy +# download default config files wget https://raw.githubusercontent.com/dessalines/lemmy/master/docker/prod/docker-compose.yml wget https://raw.githubusercontent.com/dessalines/lemmy/master/docker/lemmy.hjson wget https://raw.githubusercontent.com/dessalines/lemmy/master/docker/iframely.config.local.js -# Edit lemmy.hjson, and docker-compose.yml to do more configuration (like adding a custom password) docker-compose up -d ``` -and go to http://localhost:8536. +After this, have a look at the [config file](administration_configuration.md) named `lemmy.hjson`, and adjust it, in particular the hostname. -[A sample nginx config](/ansible/templates/nginx.conf) (Note: Avatar / Image uploading won't work without this), could be setup with: +To make Lemmy available outside the server, you need to setup a reverse proxy, like Nginx. [A sample nginx config](/ansible/templates/nginx.conf), could be setup with: ```bash wget https://raw.githubusercontent.com/dessalines/lemmy/master/ansible/templates/nginx.conf # Replace the {{ vars }} sudo mv nginx.conf /etc/nginx/sites-enabled/lemmy.conf ``` + +You will also need to setup TLS, for example with [Let's Encrypt](https://letsencrypt.org/). After this you need to restart Nginx to reload the config. + ## Updating -To update to the newest version, run: +To update to the newest version, you can manually change the version in `docker-compose.yml`. Alternatively, fetch the latest version from our git repo: ```bash wget https://raw.githubusercontent.com/dessalines/lemmy/master/docker/prod/docker-compose.yml diff --git a/docs/src/contributing.md b/docs/src/contributing.md index e73cc4b9..9a01ad5d 100644 --- a/docs/src/contributing.md +++ b/docs/src/contributing.md @@ -2,6 +2,12 @@ Information about contributing to Lemmy, whether it is translating, testing, designing or programming. +## Issue tracking / Repositories + +- [GitHub (for issues)](https://github.com/dessalines/lemmy) +- [Gitea](https://yerbamate.dev/dessalines/lemmy) +- [GitLab](https://gitlab.com/dessalines/lemmy) + ## Translating Go [here](https://github.com/dessalines/lemmy#translations) for translation instructions. diff --git a/docs/src/contributing_federation_development.md b/docs/src/contributing_federation_development.md new file mode 100644 index 00000000..13a047d0 --- /dev/null +++ b/docs/src/contributing_federation_development.md @@ -0,0 +1,37 @@ +# Federation Development + +## Setup + +If you don't have a local clone of the Lemmy repo yet, just run the following command: + +```bash +git clone https://yerbamate.dev/nutomic/lemmy.git -b federation +``` + +If you already have the Lemmy repo cloned, you need to add a new remote: +```bash +git remote add federation https://yerbamate.dev/nutomic/lemmy.git +git checkout federation +git pull federation federation +``` + +## Running + +You need to have the following packages installed, the Docker service needs to be running. + +- docker +- docker-compose +- cargo +- yarn + +Then run the following +```bash +cd dev/federation-test +./run-federation-test.bash +``` + +After the build is finished and the docker-compose setup is running, open [127.0.0.1:8540](http://127.0.0.1:8540) and +[127.0.0.1:8541](http://127.0.0.1:8541) in your browser to use the test instances. You can login as admin with +username `lemmy` and password `lemmy`, or create new accounts. + +Please get in touch if you want to contribute to this, so we can coordinate things and avoid duplicate work.
\ No newline at end of file diff --git a/server/Cargo.lock b/server/Cargo.lock index ee1b922b..9cef0b2c 100644 --- a/server/Cargo.lock +++ b/server/Cargo.lock @@ -2,10 +2,10 @@ # It is not intended for manual editing. [[package]] name = "activitystreams" -version = "0.5.0-alpha.15" +version = "0.5.0-alpha.16" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "activitystreams-derive 0.5.0-alpha.7 (registry+https://github.com/rust-lang/crates.io-index)", + "activitystreams-derive 0.5.0-alpha.8 (registry+https://github.com/rust-lang/crates.io-index)", "chrono 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)", "mime 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", @@ -16,7 +16,7 @@ dependencies = [ [[package]] name = "activitystreams-derive" -version = "0.5.0-alpha.7" +version = "0.5.0-alpha.8" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", @@ -356,6 +356,14 @@ dependencies = [ ] [[package]] +name = "ansi_term" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] name = "arc-swap" version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -566,15 +574,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "bytes" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "iovec 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "bytes" version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -608,22 +607,17 @@ dependencies = [ ] [[package]] -name = "chttp" -version = "0.5.5" +name = "clap" +version = "2.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", - "chrono 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)", - "crossbeam-channel 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", - "curl 0.4.28 (registry+https://github.com/rust-lang/crates.io-index)", - "curl-sys 0.4.30+curl-7.69.1 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-io-preview 0.3.0-alpha.17 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-util-preview 0.3.0-alpha.17 (registry+https://github.com/rust-lang/crates.io-index)", - "http 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "sluice 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "atty 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "strsim 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-width 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -635,6 +629,22 @@ dependencies = [ ] [[package]] +name = "comrak" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)", + "entities 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "pest 2.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "pest_derive 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "twoway 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "typed-arena 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode_categories 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] name = "config" version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -678,14 +688,6 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "crossbeam-channel" version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ @@ -695,15 +697,6 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.6.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "crossbeam-utils" version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ @@ -957,6 +950,11 @@ dependencies = [ ] [[package]] +name = "entities" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] name = "enum-as-inner" version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1084,24 +1082,11 @@ dependencies = [ ] [[package]] -name = "futures-channel-preview" -version = "0.3.0-alpha.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "futures-core-preview 0.3.0-alpha.17 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] name = "futures-core" version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] -name = "futures-core-preview" -version = "0.3.0-alpha.17" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] name = "futures-executor" version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1117,11 +1102,6 @@ version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] -name = "futures-io-preview" -version = "0.3.0-alpha.17" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] name = "futures-macro" version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1161,18 +1141,6 @@ dependencies = [ ] [[package]] -name = "futures-util-preview" -version = "0.3.0-alpha.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "futures-core-preview 0.3.0-alpha.17 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-io-preview 0.3.0-alpha.17 (registry+https://github.com/rust-lang/crates.io-index)", - "memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "pin-utils 0.1.0-alpha.4 (registry+https://github.com/rust-lang/crates.io-index)", - "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] name = "fxhash" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1269,16 +1237,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "http" -version = "0.1.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", - "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", - "itoa 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "http" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ @@ -1343,6 +1301,28 @@ dependencies = [ ] [[package]] +name = "isahc" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-channel 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", + "curl 0.4.28 (registry+https:// |