liyuan462 / rust_lang_cn Goto Github PK
View Code? Open in Web Editor NEWChina Community for Rust lang
License: MIT License
China Community for Rust lang
License: MIT License
如题。 掉到回调页面后, 没有下文了
论坛已经被刷爆了,建议在注册和发帖时做一些限制
look forward to RESTful API
忘记密码后通过验证过的 EMail 重新设置密码。
场景:
1、起初未登录 rust 论坛,打开论坛的几个页面
2、新开标签页登录 rust 论坛
3、刷新未登录前打开的页面,页面还是未登录
可能就是一个简单的会话问题,我看下能不能有时间改下
可选:
@liyuan462
你好, 现在各种社区非常多, 如果为每一个社区去注册一个帐号, 那么将有很多帐号需要记忆, 我觉得ruby china 以及 gitter.im 的登录模式就非常的不错, 使用github的帐号登录.
作为一个学习者可能跟希望能通过rss阅读器来订阅论坛下的最新文章
最近有些希望使用 Rust 编写网站程序,如果可以的话,希望能够基于本项目的基础开始。
但是因为本项目没有指明具体的协议,不能贸然作出决定。
希望能为本项目添加适当的开源协议。非常感谢!
版本:rust 1.18.0
命令:RUST_BACKTRACE=1 ./target/debug/rust_lang_cn
出错页面:http://localhost:3000/user/login
2017-06-22T16:07:12.495476+00:00 DEBUG hyper::server - Incoming stream
2017-06-22T16:07:12.495911+00:00 DEBUG hyper::server::request - Request Line: Get AbsolutePath("/user/login") Http11
2017-06-22T16:07:12.495964+00:00 DEBUG hyper::server::request - Headers { Host: localhost:3000
, Connection: keep-alive
, Cache-Control: max-age=0
, Upgrade-Insecure-Requests: 1
, User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36
, Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
, Referer: http://localhost:3000/
, Accept-Encoding: gzip, deflate, sdch, br
, Accept-Language: zh-CN,zh;q=0.8,en;q=0.6,zh-TW;q=0.4
, }
thread '<unnamed>' panicked at 'assertion failed: `(left == right)` (left: `-186318615`, right: `1`)', /Users/nswbmw/.cargo/registry/src/github.com-1ecc6299db9ec823/openssl-0.7.14/src/crypto/hmac.rs:100
stack backtrace:
0: std::sys::imp::backtrace::tracing::imp::unwind_backtrace
1: std::panicking::default_hook::{{closure}}
2: std::panicking::default_hook
3: std::panicking::rust_panic_with_hook
4: std::panicking::begin_panic
5: std::panicking::begin_panic_fmt
6: openssl::crypto::hmac::HMAC::init_once
7: openssl::crypto::hmac::HMAC::new
8: cookie::jar::secure::dosign
9: cookie::jar::secure::sign
10: cookie::jar::CookieJar::signed::sign
11: cookie::jar::CookieJar::add
12: <oven::OvenAfter as iron::middleware::AfterMiddleware>::after
13: <alloc::boxed::Box<iron::middleware::AfterMiddleware + 'static> as iron::middleware::AfterMiddleware>::after
14: iron::middleware::Chain::continue_from_after
15: iron::middleware::Chain::continue_from_handler
16: iron::middleware::Chain::continue_from_before
17: <iron::middleware::Chain as iron::middleware::Handler>::handle
18: <alloc::boxed::Box<iron::middleware::Handler + 'static> as iron::middleware::Handler>::handle
19: iron::middleware::Chain::continue_from_handler
20: iron::middleware::Chain::continue_from_before
21: <iron::middleware::Chain as iron::middleware::Handler>::handle
22: <alloc::boxed::Box<iron::middleware::Handler + 'static> as iron::middleware::Handler>::handle
23: <mount::mount::Mount as iron::middleware::Handler>::handle
24: <iron::iron::Iron<H> as hyper::server::Handler>::handle
25: <hyper::server::Worker<H>>::keep_alive_loop
26: <hyper::server::Worker<H>>::handle_connection
27: hyper::server::handle::{{closure}}
28: hyper::server::listener::spawn_with::{{closure}}
29: <std::panic::AssertUnwindSafe<F> as core::ops::FnOnce<()>>::call_once
30: std::panicking::try::do_call
31: __rust_maybe_catch_panic
32: std::panicking::try
33: std::panic::catch_unwind
34: std::thread::Builder::spawn::{{closure}}
35: <F as alloc::boxed::FnBox<A>>::call_box
36: std::sys::imp::thread::Thread::new::thread_start
37: _pthread_body
38: _pthread_start
2017-06-22T16:07:12.534896+00:00 DEBUG hyper::server::response - writing head: Http11 InternalServerError
2017-06-22T16:07:12.535165+00:00 DEBUG hyper::server::response - headers [
Headers { Date: Thu, 22 Jun 2017 16:07:12 GMT
, Transfer-Encoding: chunked
, }]
2017-06-22T16:07:12.535348+00:00 DEBUG hyper::server::response - drop successful
😍 rust_lang_cn git:(master) ✗ cargo build --verbose
error: unable to get packages from source
Caused by:
failed to parse manifest at `/Users/messense/.cargo/registry/src/github.com-1ecc6299db9ec823/iron-0.3.0/Cargo.toml`
Caused by:
you have already provided an operation, such as =, ~, or ^; only use one
😍 rust_lang_cn git:(master) ✗ rustc --version
rustc 1.12.0-nightly (576f76659 2016-08-09)
😍 rust_lang_cn git:(master) ✗ cargo --version
cargo 0.13.0-nightly (c205132 2016-08-09)
看起来是 iron 0.3.0 的锅
在 markdown 编辑器里面的预览可以正常显示。
提交文章之后,就无法显示正确了。
Rust编程语言社区2群 303838735
一直500
➜ rust_lang_cn cargo build --release
Compiling kernel32-sys v0.2.1
Compiling toml v0.1.28
Compiling conduit-mime-types v0.7.3
Compiling unicode-bidi v0.2.3
Compiling num v0.1.31
Compiling uuid v0.1.18
Compiling unicase v1.4.0
Compiling openssl-sys-extras v0.7.9
Build failed, waiting for other jobs to finish...
error: failed to run custom build command for `openssl-sys-extras v0.7.9`
Process didn't exit successfully: `/Users/julaud/www/rust/rust_lang_cn/target/release/build/openssl-sys-extras-358c9a6ad3e03664/build-script-build` (exit code: 101)
--- stdout
TARGET = Some("x86_64-apple-darwin")
OPT_LEVEL = Some("3")
PROFILE = Some("release")
TARGET = Some("x86_64-apple-darwin")
debug=false opt-level=3
HOST = Some("x86_64-apple-darwin")
TARGET = Some("x86_64-apple-darwin")
TARGET = Some("x86_64-apple-darwin")
HOST = Some("x86_64-apple-darwin")
CC_x86_64-apple-darwin = None
CC_x86_64_apple_darwin = None
HOST_CC = None
CC = None
HOST = Some("x86_64-apple-darwin")
TARGET = Some("x86_64-apple-darwin")
HOST = Some("x86_64-apple-darwin")
CFLAGS_x86_64-apple-darwin = None
CFLAGS_x86_64_apple_darwin = None
HOST_CFLAGS = None
CFLAGS = None
running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-m64" "-fPIC" "-o" "/Users/julaud/www/rust/rust_lang_cn/target/release/build/openssl-sys-extras-358c9a6ad3e03664/out/src/openssl_shim.o" "-c" "src/openssl_shim.c"
ExitStatus(ExitStatus(256))
command did not execute successfully, got: exit code: 1
--- stderr
src/openssl_shim.c:1:10: fatal error: 'openssl/hmac.h' file not found
#include <openssl/hmac.h>
^
1 error generated.
thread '<main>' panicked at 'explicit panic', /Users/julaud/.cargo/registry/src/github.com-88ac128001ac3a9a/gcc-0.3.26/src/lib.rs:818
note: Run with `RUST_BACKTRACE=1` for a backtrace.
访问后会发现你的 http://rust-lang-cn.org/ 被 lougout 了,实际上还可以用来进行发帖回帖之类的操作。
修复方案可以是检查 Referer 或者加 CSRF Token。
另外还有一些其他的小问题:
logined cookie
(其实是iron-login
的问题),实际上可以加一个nonce
避免每次的MAC
都一样。handlers/user.rs#L600password hash
,建议使用 argon2。handlers/user.rs#L81A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.