gourami

[UNMAINTAINED] Activitypub server in Rust
Log | Files | Refs | README | LICENSE

commit b5f8bc53b794f3100eaffd24be52d6740b76ee2b
parent 3880388f67c9a7064af4361e846fa7fff1ed572e
Author: alex wennerberg <alex@alexwennerberg.com>
Date:   Tue,  9 Jun 2020 09:37:35 -0500

Revert some neighborhood changes

Diffstat:
MCargo.lock | 2+-
Msample_env | 2--
Msrc/routes.rs | 8+++-----
Mtemplates/createnote.html | 2+-
Mtemplates/server_info.html | 2+-
Mtemplates/user_header.html | 2+-
6 files changed, 7 insertions(+), 11 deletions(-)

diff --git a/Cargo.lock b/Cargo.lock @@ -649,7 +649,7 @@ dependencies = [ [[package]] name = "gourami_social" -version = "0.1.4" +version = "0.1.5" dependencies = [ "activitystreams", "ammonia", diff --git a/sample_env b/sample_env @@ -2,8 +2,6 @@ export DATABASE_URL=sample.db export RUST_LOG=debug,hyper=info,html5ever=info export GOURAMI_DOMAIN="localhost:3030" export SSL_ENABLED="0" -# Public instances will make all posts visible to anyone -export PUBLIC="0" # Used for http signature verification. Not necessary if you aren't federating your server. # If you are using federation, you'll have to generate these keys. diff --git a/src/routes.rs b/src/routes.rs @@ -11,8 +11,6 @@ use warp::{ }; pub async fn run_server() { - // NOT TESTED YET - let optional_session_filter = move || session::create_session_filter(true).clone(); let session_filter = move || session::create_session_filter(false).clone(); // Background worker for sending activitypub messages @@ -63,14 +61,14 @@ pub async fn run_server() { ); let home = warp::path::end() - .and(optional_session_filter()) + .and(session_filter()) .and(query()) .and(path::full()) .map(|user: Option<User>, params, url| render_timeline(user.clone(), &params, url, get_notes(user.is_some(), &params))); // a bit awkward let user_alias = warp::path!("user" / String) - .and(optional_session_filter()) + .and(session_filter()) .and(query::<GetPostsParams>()) .and(path::full()) .map(|username: String, user: Option<User>, mut params: GetPostsParams, url| { @@ -80,7 +78,7 @@ pub async fn run_server() { // a bit awkward let note_alias = warp::path!("note" / i32) - .and(optional_session_filter()) + .and(session_filter()) .and(query::<GetPostsParams>()) .and(path::full()) .map(|note: i32, user: Option<User>, mut params: GetPostsParams, url| { diff --git a/templates/createnote.html b/templates/createnote.html @@ -9,7 +9,7 @@ checked> {% else %} unchecked> {% endif %} -<label for="neighborhood">Share with neighborhood (public)?</label> +<label for="neighborhood">Share with neighborhood?</label> <input type="hidden" name="redirect_url" value="{{global.page}}"> </form> </div> diff --git a/templates/server_info.html b/templates/server_info.html @@ -18,7 +18,7 @@ Here is a list of users on this server -- maybe introduce yourself to someone yo <br> {% for user in users %} -{% include "user_header.html" %} +<a href="/?user_id={{user.id}}">@{{user.username}}</a> {% endfor %} </div> </table> diff --git a/templates/user_header.html b/templates/user_header.html @@ -3,10 +3,10 @@ <b>user:</b> {{ user.username }} (#{{user.id}}) <br> <b>bio:</b> {{user.bio}} + <br> {% match user.email %} {%when Some with (e) %} {%if user.show_email%} - <br> <b>email:</b> <a href="mailto:{{e}}">{{e}}</a><br> {%endif %} {% when None %}