Media upload
This commit is contained in:
		
							parent
							
								
									0b5eb2c946
								
							
						
					
					
						commit
						f44b6fffa3
					
				
							
								
								
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							| @ -7,3 +7,4 @@ translations | ||||
| po/*.po~ | ||||
| .env | ||||
| Rocket.toml | ||||
| media | ||||
|  | ||||
							
								
								
									
										415
									
								
								Cargo.lock
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										415
									
								
								Cargo.lock
									
									
									
										generated
									
									
									
								
							| @ -89,6 +89,11 @@ dependencies = [ | ||||
|  "nodrop 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
| ] | ||||
| 
 | ||||
| [[package]] | ||||
| name = "ascii" | ||||
| version = "0.8.7" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| 
 | ||||
| [[package]] | ||||
| name = "atom_syndication" | ||||
| version = "0.6.0" | ||||
| @ -99,6 +104,20 @@ dependencies = [ | ||||
|  "quick-xml 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
| ] | ||||
| 
 | ||||
| [[package]] | ||||
| name = "backtrace" | ||||
| version = "0.1.8" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| dependencies = [ | ||||
|  "backtrace-sys 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
|  "cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
|  "dbghelp-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
|  "debug-builders 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
|  "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
|  "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
|  "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
| ] | ||||
| 
 | ||||
| [[package]] | ||||
| name = "backtrace" | ||||
| version = "0.3.6" | ||||
| @ -150,6 +169,11 @@ dependencies = [ | ||||
|  "rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
| ] | ||||
| 
 | ||||
| [[package]] | ||||
| name = "bitflags" | ||||
| version = "0.7.0" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| 
 | ||||
| [[package]] | ||||
| name = "bitflags" | ||||
| version = "0.9.1" | ||||
| @ -178,6 +202,16 @@ dependencies = [ | ||||
|  "opaque-debug 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
| ] | ||||
| 
 | ||||
| [[package]] | ||||
| name = "buf_redux" | ||||
| version = "0.7.1" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| dependencies = [ | ||||
|  "memchr 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
|  "safemem 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
|  "slice-deque 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
| ] | ||||
| 
 | ||||
| [[package]] | ||||
| name = "build_const" | ||||
| version = "0.2.1" | ||||
| @ -212,6 +246,17 @@ name = "cfg-if" | ||||
| version = "0.1.2" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| 
 | ||||
| [[package]] | ||||
| name = "chomp" | ||||
| version = "0.3.1" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| dependencies = [ | ||||
|  "bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
|  "conv 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
|  "debugtrace 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
|  "either 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
| ] | ||||
| 
 | ||||
| [[package]] | ||||
| name = "chrono" | ||||
| version = "0.4.2" | ||||
| @ -223,6 +268,11 @@ dependencies = [ | ||||
|  "time 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
| ] | ||||
| 
 | ||||
| [[package]] | ||||
| name = "chunked_transfer" | ||||
| version = "0.3.1" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| 
 | ||||
| [[package]] | ||||
| name = "cloudabi" | ||||
| version = "0.0.3" | ||||
| @ -239,6 +289,14 @@ dependencies = [ | ||||
|  "lazy_static 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
| ] | ||||
| 
 | ||||
| [[package]] | ||||
| name = "conv" | ||||
| version = "0.3.3" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| dependencies = [ | ||||
|  "custom_derive 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
| ] | ||||
| 
 | ||||
| [[package]] | ||||
| name = "cookie" | ||||
| version = "0.11.0-dev" | ||||
| @ -326,11 +384,38 @@ dependencies = [ | ||||
|  "rust-crypto 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
| ] | ||||
| 
 | ||||
| [[package]] | ||||
| name = "custom_derive" | ||||
| version = "0.1.7" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| 
 | ||||
| [[package]] | ||||
| name = "data-encoding" | ||||
| version = "2.1.1" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| 
 | ||||
| [[package]] | ||||
| name = "dbghelp-sys" | ||||
| version = "0.2.0" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| dependencies = [ | ||||
|  "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
|  "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
| ] | ||||
| 
 | ||||
| [[package]] | ||||
| name = "debug-builders" | ||||
| version = "0.1.0" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| 
 | ||||
| [[package]] | ||||
| name = "debugtrace" | ||||
| version = "0.1.0" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| dependencies = [ | ||||
|  "backtrace 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
| ] | ||||
| 
 | ||||
| [[package]] | ||||
| name = "derive-error-chain" | ||||
| version = "0.11.1" | ||||
| @ -399,6 +484,68 @@ name = "dtoa" | ||||
| version = "0.4.2" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| 
 | ||||
| [[package]] | ||||
| name = "either" | ||||
| version = "0.1.7" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| 
 | ||||
| [[package]] | ||||
| name = "encoding" | ||||
| version = "0.2.33" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| dependencies = [ | ||||
|  "encoding-index-japanese 1.20141219.5 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
|  "encoding-index-korean 1.20141219.5 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
|  "encoding-index-simpchinese 1.20141219.5 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
|  "encoding-index-singlebyte 1.20141219.5 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
|  "encoding-index-tradchinese 1.20141219.5 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
| ] | ||||
| 
 | ||||
| [[package]] | ||||
| name = "encoding-index-japanese" | ||||
| version = "1.20141219.5" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| dependencies = [ | ||||
|  "encoding_index_tests 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
| ] | ||||
| 
 | ||||
| [[package]] | ||||
| name = "encoding-index-korean" | ||||
| version = "1.20141219.5" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| dependencies = [ | ||||
|  "encoding_index_tests 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
| ] | ||||
| 
 | ||||
| [[package]] | ||||
| name = "encoding-index-simpchinese" | ||||
| version = "1.20141219.5" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| dependencies = [ | ||||
|  "encoding_index_tests 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
| ] | ||||
| 
 | ||||
| [[package]] | ||||
| name = "encoding-index-singlebyte" | ||||
| version = "1.20141219.5" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| dependencies = [ | ||||
|  "encoding_index_tests 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
| ] | ||||
| 
 | ||||
| [[package]] | ||||
| name = "encoding-index-tradchinese" | ||||
| version = "1.20141219.5" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| dependencies = [ | ||||
|  "encoding_index_tests 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
| ] | ||||
| 
 | ||||
| [[package]] | ||||
| name = "encoding_index_tests" | ||||
| version = "0.1.4" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| 
 | ||||
| [[package]] | ||||
| name = "encoding_rs" | ||||
| version = "0.7.2" | ||||
| @ -519,6 +666,59 @@ name = "glob" | ||||
| version = "0.2.11" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| 
 | ||||
| [[package]] | ||||
| name = "groupable" | ||||
| version = "0.2.0" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| 
 | ||||
| [[package]] | ||||
| name = "guid" | ||||
| version = "0.1.0" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| dependencies = [ | ||||
|  "chomp 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
|  "failure 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
|  "failure_derive 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
|  "guid-macro-impl 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
|  "guid-parser 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
|  "proc-macro-hack 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
|  "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
| ] | ||||
| 
 | ||||
| [[package]] | ||||
| name = "guid-create" | ||||
| version = "0.1.1" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| dependencies = [ | ||||
|  "byteorder 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
|  "chomp 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
|  "guid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
|  "guid-parser 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
|  "rand 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
|  "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
| ] | ||||
| 
 | ||||
| [[package]] | ||||
| name = "guid-macro-impl" | ||||
| version = "0.1.0" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| dependencies = [ | ||||
|  "chomp 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
|  "guid-parser 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
|  "proc-macro-hack 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
|  "quote 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
|  "syn 0.12.15 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
| ] | ||||
| 
 | ||||
| [[package]] | ||||
| name = "guid-parser" | ||||
| version = "0.1.0" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| dependencies = [ | ||||
|  "chomp 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
|  "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
| ] | ||||
| 
 | ||||
| [[package]] | ||||
| name = "heck" | ||||
| version = "0.3.0" | ||||
| @ -640,6 +840,21 @@ dependencies = [ | ||||
|  "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
| ] | ||||
| 
 | ||||
| [[package]] | ||||
| name = "iron" | ||||
| version = "0.6.0" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| dependencies = [ | ||||
|  "hyper 0.10.13 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
|  "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
|  "mime_guess 1.8.6 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
|  "modifier 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
|  "num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
|  "plugin 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
|  "typemap 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
|  "url 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
| ] | ||||
| 
 | ||||
| [[package]] | ||||
| name = "isatty" | ||||
| version = "0.1.7" | ||||
| @ -737,6 +952,14 @@ name = "mac" | ||||
| version = "0.1.1" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| 
 | ||||
| [[package]] | ||||
| name = "mach" | ||||
| version = "0.2.2" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| dependencies = [ | ||||
|  "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
| ] | ||||
| 
 | ||||
| [[package]] | ||||
| name = "maplit" | ||||
| version = "1.0.1" | ||||
| @ -791,6 +1014,17 @@ dependencies = [ | ||||
|  "unicase 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
| ] | ||||
| 
 | ||||
| [[package]] | ||||
| name = "mime_guess" | ||||
| version = "1.8.6" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| dependencies = [ | ||||
|  "mime 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
|  "phf 0.7.22 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
|  "phf_codegen 0.7.22 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
|  "unicase 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
| ] | ||||
| 
 | ||||
| [[package]] | ||||
| name = "mime_guess" | ||||
| version = "2.0.0-alpha.4" | ||||
| @ -831,6 +1065,41 @@ dependencies = [ | ||||
|  "ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
| ] | ||||
| 
 | ||||
| [[package]] | ||||
| name = "modifier" | ||||
| version = "0.1.0" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| 
 | ||||
| [[package]] | ||||
| name = "multipart" | ||||
| version = "0.15.3" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| dependencies = [ | ||||
|  "buf_redux 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
|  "httparse 1.2.4 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
|  "hyper 0.10.13 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
|  "iron 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
|  "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
|  "mime 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
|  "mime_guess 1.8.6 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
|  "nickel 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
|  "quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
|  "rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
|  "safemem 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
|  "tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
|  "tiny_http 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
|  "twoway 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
| ] | ||||
| 
 | ||||
| [[package]] | ||||
| name = "mustache" | ||||
| version = "0.8.2" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| dependencies = [ | ||||
|  "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
|  "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
| ] | ||||
| 
 | ||||
| [[package]] | ||||
| name = "native-tls" | ||||
| version = "0.1.5" | ||||
| @ -863,6 +1132,25 @@ dependencies = [ | ||||
|  "unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
| ] | ||||
| 
 | ||||
| [[package]] | ||||
| name = "nickel" | ||||
| version = "0.10.1" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| dependencies = [ | ||||
|  "groupable 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
|  "hyper 0.10.13 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
|  "lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
|  "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
|  "modifier 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
|  "mustache 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
|  "plugin 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
|  "regex 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
|  "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
|  "time 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
|  "typemap 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
|  "url 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
| ] | ||||
| 
 | ||||
| [[package]] | ||||
| name = "nodrop" | ||||
| version = "0.1.12" | ||||
| @ -1009,6 +1297,14 @@ name = "pkg-config" | ||||
| version = "0.3.11" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| 
 | ||||
| [[package]] | ||||
| name = "plugin" | ||||
| version = "0.2.6" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| dependencies = [ | ||||
|  "typemap 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
| ] | ||||
| 
 | ||||
| [[package]] | ||||
| name = "plume" | ||||
| version = "0.1.0" | ||||
| @ -1020,13 +1316,15 @@ dependencies = [ | ||||
|  "dotenv 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
|  "failure 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
|  "gettext-rs 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
|  "guid-create 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
|  "heck 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
|  "multipart 0.15.3 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
|  "plume-common 0.1.0", | ||||
|  "plume-models 0.1.0", | ||||
|  "rocket 0.4.0-dev (git+https://github.com/SergioBenitez/Rocket?rev=df7111143e466c18d1f56377a8d9530a5a306aba)", | ||||
|  "rocket_codegen 0.4.0-dev (git+https://github.com/SergioBenitez/Rocket?rev=df7111143e466c18d1f56377a8d9530a5a306aba)", | ||||
|  "rocket_contrib 0.4.0-dev (git+https://github.com/SergioBenitez/Rocket?rev=df7111143e466c18d1f56377a8d9530a5a306aba)", | ||||
|  "rocket_csrf 0.1.0 (git+https://github.com/fdb-hiroshima/rocket_csrf?branch=plume)", | ||||
|  "rocket_csrf 0.1.0 (git+https://github.com/fdb-hiroshima/rocket_csrf?rev=0fbacab1bc6a32419a18edb600586c5c02fdac4d)", | ||||
|  "rocket_i18n 0.1.1 (git+https://github.com/BaptisteGelez/rocket_i18n?rev=5b4225d5bed5769482dc926a7e6d6b79f1217be6)", | ||||
|  "rpassword 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
|  "serde 1.0.42 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
| @ -1098,6 +1396,19 @@ name = "precomputed-hash" | ||||
| version = "0.1.1" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| 
 | ||||
| [[package]] | ||||
| name = "proc-macro-hack" | ||||
| version = "0.4.0" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| dependencies = [ | ||||
|  "proc-macro-hack-impl 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
| ] | ||||
| 
 | ||||
| [[package]] | ||||
| name = "proc-macro-hack-impl" | ||||
| version = "0.4.0" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| 
 | ||||
| [[package]] | ||||
| name = "proc-macro2" | ||||
| version = "0.2.3" | ||||
| @ -1130,6 +1441,11 @@ dependencies = [ | ||||
|  "bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
| ] | ||||
| 
 | ||||
| [[package]] | ||||
| name = "quick-error" | ||||
| version = "1.2.2" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| 
 | ||||
| [[package]] | ||||
| name = "quick-xml" | ||||
| version = "0.12.1" | ||||
| @ -1369,7 +1685,7 @@ dependencies = [ | ||||
| [[package]] | ||||
| name = "rocket_csrf" | ||||
| version = "0.1.0" | ||||
| source = "git+https://github.com/fdb-hiroshima/rocket_csrf?branch=plume#5309b7634a9cd204d003312cb70ce9d36b660e6b" | ||||
| source = "git+https://github.com/fdb-hiroshima/rocket_csrf?rev=0fbacab1bc6a32419a18edb600586c5c02fdac4d#0fbacab1bc6a32419a18edb600586c5c02fdac4d" | ||||
| dependencies = [ | ||||
|  "csrf 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
|  "data-encoding 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
| @ -1441,6 +1757,11 @@ name = "safemem" | ||||
| version = "0.2.0" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| 
 | ||||
| [[package]] | ||||
| name = "safemem" | ||||
| version = "0.3.0" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| 
 | ||||
| [[package]] | ||||
| name = "schannel" | ||||
| version = "0.1.12" | ||||
| @ -1549,6 +1870,16 @@ name = "slab" | ||||
| version = "0.4.0" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| 
 | ||||
| [[package]] | ||||
| name = "slice-deque" | ||||
| version = "0.1.13" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| dependencies = [ | ||||
|  "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
|  "mach 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
|  "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
| ] | ||||
| 
 | ||||
| [[package]] | ||||
| name = "slug" | ||||
| version = "0.1.3" | ||||
| @ -1733,6 +2064,19 @@ dependencies = [ | ||||
|  "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
| ] | ||||
| 
 | ||||
| [[package]] | ||||
| name = "tiny_http" | ||||
| version = "0.6.0" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| dependencies = [ | ||||
|  "ascii 0.8.7 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
|  "chrono 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
|  "chunked_transfer 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
|  "encoding 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
|  "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
|  "url 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
| ] | ||||
| 
 | ||||
| [[package]] | ||||
| name = "tokio" | ||||
| version = "0.1.5" | ||||
| @ -1895,11 +2239,27 @@ name = "traitobject" | ||||
| version = "0.1.0" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| 
 | ||||
| [[package]] | ||||
| name = "twoway" | ||||
| version = "0.1.8" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| dependencies = [ | ||||
|  "memchr 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
| ] | ||||
| 
 | ||||
| [[package]] | ||||
| name = "typeable" | ||||
| version = "0.1.2" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| 
 | ||||
| [[package]] | ||||
| name = "typemap" | ||||
| version = "0.3.3" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| dependencies = [ | ||||
|  "unsafe-any 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
| ] | ||||
| 
 | ||||
| [[package]] | ||||
| name = "typenum" | ||||
| version = "1.10.0" | ||||
| @ -1967,6 +2327,14 @@ dependencies = [ | ||||
|  "void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
| ] | ||||
| 
 | ||||
| [[package]] | ||||
| name = "unsafe-any" | ||||
| version = "0.4.2" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| dependencies = [ | ||||
|  "traitobject 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", | ||||
| ] | ||||
| 
 | ||||
| [[package]] | ||||
| name = "untrusted" | ||||
| version = "0.6.2" | ||||
| @ -2114,25 +2482,32 @@ source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| "checksum antidote 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "34fde25430d87a9388dadbe6e34d7f72a462c8b43ac8d309b42b0a8505d7e2a5" | ||||
| "checksum array_tool 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8f8cb5d814eb646a863c4f24978cff2880c4be96ad8cde2c0f0678732902e271" | ||||
| "checksum arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)" = "a1e964f9e24d588183fcb43503abda40d288c8657dfc27311516ce2f05675aef" | ||||
| "checksum ascii 0.8.7 (registry+https://github.com/rust-lang/crates.io-index)" = "97be891acc47ca214468e09425d02cef3af2c94d0d82081cd02061f996802f14" | ||||
| "checksum atom_syndication 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0a9a7ab83635ff7a3b04856f4ad95324dccc9b947ab1e790fc5c769ee6d6f60c" | ||||
| "checksum backtrace 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "150ae7828afa7afb6d474f909d64072d21de1f3365b6e8ad8029bf7b1c6350a0" | ||||
| "checksum backtrace 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "ebbe525f66f42d207968308ee86bc2dd60aa5fab535b22e616323a173d097d8e" | ||||
| "checksum backtrace-sys 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "44585761d6161b0f57afc49482ab6bd067e4edef48c12a152c237eb0203f7661" | ||||
| "checksum base64 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "96434f987501f0ed4eb336a411e0631ecd1afa11574fe148587adc4ff96143c9" | ||||
| "checksum base64 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9263aa6a38da271eec5c91a83ce1e800f093c8535788d403d626d8d5c3f8f007" | ||||
| "checksum bcrypt 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1a1512813db09170b44a00870b58421876d797b77b085c5205a24db90905f758" | ||||
| "checksum bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "aad18937a628ec6abcd26d1489012cc0e18c21798210f491af69ded9b881106d" | ||||
| "checksum bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4efd02e230a02e18f92fc2735f44597385ed02ad8f831e7c1c1156ee5e1ab3a5" | ||||
| "checksum bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b3c30d3802dfb7281680d6285f2ccdaa8c2d8fee41f93805dba5c4cf50dc23cf" | ||||
| "checksum block-cipher-trait 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d6136d803280ae3532efa36114335255ea94f3d75d735ddedd66b0d7cd30bad3" | ||||
| "checksum blowfish 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "95ede07672d9f4144c578439aa352604ec5c67a80c940fe8d382ddbeeeb3c6d8" | ||||
| "checksum buf_redux 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "20c6687a26c9ce967594b78038c06139a0d3a5b3005d16572284d543924a01aa" | ||||
| "checksum build_const 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "39092a32794787acd8525ee150305ff051b0aa6cc2abaf193924f5ab05425f39" | ||||
| "checksum byte-tools 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "560c32574a12a89ecd91f5e742165893f86e3ab98d21f8ea548658eb9eef5f40" | ||||
| "checksum byteorder 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "73b5bdfe7ee3ad0b99c9801d58807a9dbc9e09196365b0203853b99889ab3c87" | ||||
| "checksum bytes 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)" = "2f1d50c876fb7545f5f289cd8b2aee3f359d073ae819eed5d6373638e2c61e59" | ||||
| "checksum cc 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)" = "8b9d2900f78631a5876dc5d6c9033ede027253efcd33dd36b1309fc6cab97ee0" | ||||
| "checksum cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d4c819a1287eb618df47cc647173c5c4c66ba19d888a6e50d605672aed3140de" | ||||
| "checksum chomp 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9f74ad218e66339b11fd23f693fb8f1d621e80ba6ac218297be26073365d163d" | ||||
| "checksum chrono 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1cce36c92cb605414e9b824f866f5babe0a0368e39ea07393b9b63cf3844c0e6" | ||||
| "checksum chunked_transfer 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "498d20a7aaf62625b9bf26e637cf7736417cde1d0c99f1d04d1170229a85cf87" | ||||
| "checksum cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" | ||||
| "checksum colored 1.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b0aa3473e85a3161b59845d6096b289bb577874cafeaf75ea1b1beaa6572c7fc" | ||||
| "checksum conv 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "78ff10625fd0ac447827aa30ea8b861fead473bb60aeb73af6c1c58caf0d1299" | ||||
| "checksum cookie 0.11.0-dev (git+https://github.com/alexcrichton/cookie-rs?rev=0365a18)" = "<none>" | ||||
| "checksum core-foundation 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "25bfd746d203017f7d5cbd31ee5d8e17f94b6521c7af77ece6c9e4b2d4b16c67" | ||||
| "checksum core-foundation-sys 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "065a5d7ffdcbc8fa145d6f0746f3555025b9097a9e9cda59f7467abae670c78d" | ||||
| @ -2142,7 +2517,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| "checksum crossbeam-utils 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "2760899e32a1d58d5abb31129f8fae5de75220bc2176e77ff7c627ae45c918d9" | ||||
| "checksum crossbeam-utils 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d636a8b3bcc1b409d7ffd3facef8f21dcb4009626adbd0c5e6c4305c07253c7b" | ||||
| "checksum csrf 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "38f2ee2a7e76740d81de006e61eff53206c56448a30d8017b4ac97b5486682bd" | ||||
| "checksum custom_derive 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "ef8ae57c4978a2acd8b869ce6b9ca1dfe817bff704c220209fdef2c0b75a01b9" | ||||
| "checksum data-encoding 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "67df0571a74bf0d97fb8b2ed22abdd9a48475c96bd327db968b7d9cace99655e" | ||||
| "checksum dbghelp-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "97590ba53bcb8ac28279161ca943a924d1fd4a8fb3fa63302591647c4fc5b850" | ||||
| "checksum debug-builders 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0f5d8e3d14cabcb2a8a59d7147289173c6ada77a0bc526f6b85078f941c0cf12" | ||||
| "checksum debugtrace 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "62e432bd83c5d70317f6ebd8a50ed4afb32907c64d6e2e1e65e339b06dc553f3" | ||||
| "checksum derive-error-chain 0.11.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cb4450afbe280461e78299b39182a085b70e3e71be049cf4a588ad72f1e44d33" | ||||
| "checksum derive_builder 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8c998e6ab02a828dd9735c18f154e14100e674ed08cb4e1938f0e4177543f439" | ||||
| "checksum derive_builder_core 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "735e24ee9e5fa8e16b86da5007856e97d592e11867e45d76e0c0d0a164a0b757" | ||||
| @ -2150,6 +2529,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| "checksum diesel_derives 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6471a2b637b414d3ee1504cf230409a550381c79204282f8fe06c527e4ae56be" | ||||
| "checksum dotenv 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a70de3c590ce18df70743cace1cf12565637a0b26fd8b04ef10c7d33fdc66cdc" | ||||
| "checksum dtoa 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "09c3753c3db574d215cba4ea76018483895d7bff25a31b49ba45db21c48e50ab" | ||||
| "checksum either 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "a39bffec1e2015c5d8a6773cb0cf48d0d758c842398f624c34969071f5499ea7" | ||||
| "checksum encoding 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)" = "6b0d943856b990d12d3b55b359144ff341533e516d94098b1d3fc1ac666d36ec" | ||||
| "checksum encoding-index-japanese 1.20141219.5 (registry+https://github.com/rust-lang/crates.io-index)" = "04e8b2ff42e9a05335dbf8b5c6f7567e5591d0d916ccef4e0b1710d32a0d0c91" | ||||
| "checksum encoding-index-korean 1.20141219.5 (registry+https://github.com/rust-lang/crates.io-index)" = "4dc33fb8e6bcba213fe2f14275f0963fd16f0a02c878e3095ecfdf5bee529d81" | ||||
| "checksum encoding-index-simpchinese 1.20141219.5 (registry+https://github.com/rust-lang/crates.io-index)" = "d87a7194909b9118fc707194baa434a4e3b0fb6a5a757c73c3adb07aa25031f7" | ||||
| "checksum encoding-index-singlebyte 1.20141219.5 (registry+https://github.com/rust-lang/crates.io-index)" = "3351d5acffb224af9ca265f435b859c7c01537c0849754d3db3fdf2bfe2ae84a" | ||||
| "checksum encoding-index-tradchinese 1.20141219.5 (registry+https://github.com/rust-lang/crates.io-index)" = "fd0e20d5688ce3cab59eb3ef3a2083a5c77bf496cb798dc6fcdb75f323890c18" | ||||
| "checksum encoding_index_tests 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "a246d82be1c9d791c5dfde9a2bd045fc3cbba3fa2b11ad558f27d01712f00569" | ||||
| "checksum encoding_rs 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "98fd0f24d1fb71a4a6b9330c8ca04cbd4e7cc5d846b54ca74ff376bc7c9f798d" | ||||
| "checksum error-chain 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ff511d5dc435d703f4971bc399647c9bc38e20cb41452e3b9feb4765419ed3f3" | ||||
| "checksum failure 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "934799b6c1de475a012a02dab0ace1ace43789ee4b99bcfbf1a2e3e8ced5de82" | ||||
| @ -2166,6 +2553,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| "checksum gettext-rs 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3b8c2412d5758f68a9eeba161f9ecb9a55f56bfdbf17857650b98f2b9b281a47" | ||||
| "checksum gettext-sys 0.19.8 (registry+https://github.com/rust-lang/crates.io-index)" = "62c644c0b8b73706fb8c7420533fd30abf6f41c2703994bc6f0826fceb7fb3d6" | ||||
| "checksum glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "8be18de09a56b60ed0edf84bc9df007e30040691af7acd1c41874faac5895bfb" | ||||
| "checksum groupable 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "32619942b8be646939eaf3db0602b39f5229b74575b67efc897811ded1db4e57" | ||||
| "checksum guid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e691c64d9b226c7597e29aeb46be753beb8c9eeef96d8c78dfd4d306338a38da" | ||||
| "checksum guid-create 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "fcea207bf7a6092166ab590f98fe5dde5a7deed1f1920d98dcac31f80814c40d" | ||||
| "checksum guid-macro-impl 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "08d50f7c496073b5a5dec0f6f1c149113a50960ce25dd2a559987a5a71190816" | ||||
| "checksum guid-parser 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "abc7adb441828023999e6cff9eb1ea63156f7ec37ab5bf690005e8fc6c1148ad" | ||||
| "checksum heck 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ea04fa3ead4e05e51a7c806fc07271fdbde4e246a6c6d1efd52e72230b771b82" | ||||
| "checksum hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "805026a5d0141ffc30abb3be3173848ad46a1b1664fe632428479619a3644d77" | ||||
| "checksum html5ever 0.22.3 (registry+https://github.com/rust-lang/crates.io-index)" = "b04478cf718862650a0bf66acaf8f2f8c906fbc703f35c916c1f4211b069a364" | ||||
| @ -2178,6 +2570,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| "checksum if_chain 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "61bb90bdd39e3af69b0172dfc6130f6cd6332bf040fbb9bdd4401d37adbd48b8" | ||||
| "checksum indexmap 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "08173ba1e906efb6538785a8844dd496f5d34f0a2d88038e95195172fc667220" | ||||
| "checksum iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dbe6e417e7d0975db6512b90796e8ce223145ac4e33c377e4a42882a0e88bb08" | ||||
| "checksum iron 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d8e17268922834707e1c29e8badbf9c712c9c43378e1b6a3388946baff10be2" | ||||
| "checksum isatty 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "a118a53ba42790ef25c82bb481ecf36e2da892646cccd361e69a6bb881e19398" | ||||
| "checksum itoa 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8324a32baf01e2ae060e9de58ed0bc2320c9a2833491ee36cd3b4c414de4db8c" | ||||
| "checksum itoa 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c069bbec61e1ca5a596166e55dfe4773ff745c3d16b700013bcaff9a6df2c682" | ||||
| @ -2192,6 +2585,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| "checksum log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b" | ||||
| "checksum log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "89f010e843f2b1a31dbd316b3b8d443758bc634bed37aabade59c686d644e0a2" | ||||
| "checksum mac 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c41e0c4fef86961ac6d6f8a82609f55f31b05e4fce149ac5710e439df7619ba4" | ||||
| "checksum mach 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "977262a11cfd76b94da10b8898cea6e9ac391301ab74741e6da6bee13d7df46d" | ||||
| "checksum maplit 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "08cbb6b4fef96b6d77bfc40ec491b1690c779e77b05cd9f07f787ed376fd4c43" | ||||
| "checksum markup5ever 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "bfedc97d5a503e96816d10fedcd5b42f760b2e525ce2f7ec71f6a41780548475" | ||||
| "checksum matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "100aabe6b8ff4e4a7e32c1c13523379802df0772b82466207ac25b013f193376" | ||||
| @ -2199,12 +2593,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| "checksum memoffset 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0f9dc261e2b62d7a622bf416ea3c5245cdd5d9a7fcc428c0d06804dfce1775b3" | ||||
| "checksum mime 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "ba626b8a6de5da682e1caa06bdb42a335aee5a84db8e5046a3e8ab17ba0a3ae0" | ||||
| "checksum mime 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e2e00e17be181010a91dbfefb01660b17311059dc8c7f48b9017677721e732bd" | ||||
| "checksum mime_guess 1.8.6 (registry+https://github.com/rust-lang/crates.io-index)" = "2d4c0961143b8efdcfa29c3ae63281601b446a4a668165454b6c90f8024954c5" | ||||
| "checksum mime_guess 2.0.0-alpha.4 (registry+https://github.com/rust-lang/crates.io-index)" = "130ea3c9c1b65dba905ab5a4d9ac59234a9585c24d135f264e187fe7336febbd" | ||||
| "checksum mio 0.6.14 (registry+https://github.com/rust-lang/crates.io-index)" = "6d771e3ef92d58a8da8df7d6976bfca9371ed1de6619d9d5a5ce5b1f29b85bfe" | ||||
| "checksum miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919" | ||||
| "checksum modifier 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "41f5c9112cb662acd3b204077e0de5bc66305fa8df65c8019d5adb10e9ab6e58" | ||||
| "checksum multipart 0.15.3 (registry+https://github.com/rust-lang/crates.io-index)" = "b3bd50d71866514b14d2ca09823d81390d92daa40bc835f83a908c52ab0a802e" | ||||
| "checksum mustache 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "ddb004e419334fc9172d0a5ff91c0770bdd6239091b0b343eb5926101f0a7d13" | ||||
| "checksum native-tls 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "f74dbadc8b43df7864539cedb7bc91345e532fdd913cfdc23ad94f4d2d40fbc0" | ||||
| "checksum net2 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)" = "9044faf1413a1057267be51b5afba8eb1090bd2231c693664aa1db716fe1eae0" | ||||
| "checksum new_debug_unreachable 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0cdc457076c78ab54d5e0d6fa7c47981757f1e34dc39ff92787f217dede586c4" | ||||
| "checksum nickel 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "22b40e35b9f46a076dcbd8193125cea0e4130b1c015f68655038010f3e826e04" | ||||
| "checksum nodrop 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "9a2228dca57108069a5262f2ed8bd2e82496d2e074a06d1ccc7ce1687b6ae0a2" | ||||
| "checksum num-integer 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)" = "f8d26da319fb45674985c78f1d1caf99aa4941f785d384a2ae36d0740bc3e2fe" | ||||
| "checksum num-traits 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dee092fcdf725aee04dd7da1d21debff559237d49ef1cb3e69bcb8ece44c7364" | ||||
| @ -2223,12 +2622,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| "checksum phf_generator 0.7.22 (registry+https://github.com/rust-lang/crates.io-index)" = "05a079dd052e7b674d21cb31cbb6c05efd56a2cd2827db7692e2f1a507ebd998" | ||||
| "checksum phf_shared 0.7.22 (registry+https://github.com/rust-lang/crates.io-index)" = "c2261d544c2bb6aa3b10022b0be371b9c7c64f762ef28c6f5d4f1ef6d97b5930" | ||||
| "checksum pkg-config 0.3.11 (registry+https://github.com/rust-lang/crates.io-index)" = "110d5ee3593dbb73f56294327fe5668bcc997897097cbc76b51e7aed3f52452f" | ||||
| "checksum plugin 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "1a6a0dc3910bc8db877ffed8e457763b317cf880df4ae19109b9f77d277cf6e0" | ||||
| "checksum pq-sys 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "4dfb5e575ef93a1b7b2a381d47ba7c5d4e4f73bff37cee932195de769aad9a54" | ||||
| "checksum precomputed-hash 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" | ||||
| "checksum proc-macro-hack 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3ba8d4f9257b85eb6cdf13f055cea3190520aab1409ca2ab43493ea4820c25f0" | ||||
| "checksum proc-macro-hack-impl 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d5cb6f960ad471404618e9817c0e5d10b1ae74cfdf01fab89ea0641fe7fb2892" | ||||
| "checksum proc-macro2 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "cd07deb3c6d1d9ff827999c7f9b04cdfd66b1b17ae508e14fe47b620f2282ae0" | ||||
| "checksum proc-macro2 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "49b6a521dc81b643e9a51e0d1cf05df46d5a2f3c0280ea72bcb68276ba64a118" | ||||
| "checksum proc-macro2 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "effdb53b25cdad54f8f48843d67398f7ef2e14f12c1b4cb4effc549a6462a4d6" | ||||
| "checksum pulldown-cmark 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d6fdf85cda6cadfae5428a54661d431330b312bc767ddbc57adbedc24da66e32" | ||||
| "checksum quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9274b940887ce9addde99c4eee6b5c44cc494b182b97e73dc8ffdcb3397fd3f0" | ||||
| "checksum quick-xml 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b14c27e04216596a49f2b82398a24f67ed9f131a5c0e0235496ea446bdacfb12" | ||||
| "checksum quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e920b65c65f10b2ae65c831a81a073a89edd28c7cce89475bff467ab4167a" | ||||
| "checksum quote 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1eca14c727ad12702eb4b6bfb5a232287dcf8385cb8ca83a3eeaf6519c44c408" | ||||
| @ -2252,7 +2655,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| "checksum rocket_codegen 0.4.0-dev (git+https://github.com/SergioBenitez/Rocket?rev=df7111143e466c18d1f56377a8d9530a5a306aba)" = "<none>" | ||||
| "checksum rocket_codegen_next 0.4.0-dev (git+https://github.com/SergioBenitez/Rocket?rev=df7111143e466c18d1f56377a8d9530a5a306aba)" = "<none>" | ||||
| "checksum rocket_contrib 0.4.0-dev (git+https://github.com/SergioBenitez/Rocket?rev=df7111143e466c18d1f56377a8d9530a5a306aba)" = "<none>" | ||||
| "checksum rocket_csrf 0.1.0 (git+https://github.com/fdb-hiroshima/rocket_csrf?branch=plume)" = "<none>" | ||||
| "checksum rocket_csrf 0.1.0 (git+https://github.com/fdb-hiroshima/rocket_csrf?rev=0fbacab1bc6a32419a18edb600586c5c02fdac4d)" = "<none>" | ||||
| "checksum rocket_http 0.4.0-dev (git+https://github.com/SergioBenitez/Rocket?rev=df7111143e466c18d1f56377a8d9530a5a306aba)" = "<none>" | ||||
| "checksum rocket_i18n 0.1.1 (git+https://github.com/BaptisteGelez/rocket_i18n?rev=5b4225d5bed5769482dc926a7e6d6b79f1217be6)" = "<none>" | ||||
| "checksum rpassword 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d127299b02abda51634f14025aec43ae87a7aa7a95202b6a868ec852607d1451" | ||||
| @ -2260,6 +2663,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| "checksum rustc-demangle 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "11fb43a206a04116ffd7cfcf9bcb941f8eb6cc7ff667272246b0a1c74259a3cb" | ||||
| "checksum rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)" = "dcf128d1287d2ea9d80910b5f1120d0b8eede3fbf1abe91c40d39ea7d51e6fda" | ||||
| "checksum safemem 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e27a8b19b835f7aea908818e871f5cc3a5a186550c30773be987e155e8163d8f" | ||||
| "checksum safemem 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8dca453248a96cb0749e36ccdfe2b0b4e54a61bfef89fb97ec621eb8e0a93dd9" | ||||
| "checksum schannel 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "85fd9df495640643ad2d00443b3d78aae69802ad488debab4f1dd52fc1806ade" | ||||
| "checksum scheduled-thread-pool 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1a2ff3fc5223829be817806c6441279c676e454cc7da608faf03b0ccc09d3889" | ||||
| "checksum scoped-tls 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8674d439c964889e2476f474a3bf198cc9e199e77499960893bac5de7e9218a4" | ||||
| @ -2274,6 +2678,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| "checksum siphasher 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "0df90a788073e8d0235a67e50441d47db7c8ad9debd91cbf43736a2a92d36537" | ||||
| "checksum slab 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "17b4fcaed89ab08ef143da37bc52adbcc04d4a69014f4c1208d6b51f0c47bc23" | ||||
| "checksum slab 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fdeff4cd9ecff59ec7e3744cbca73dfe5ac35c2aedb2cfba8a1c715a18912e9d" | ||||
| "checksum slice-deque 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "79e5bb98247a0eb0cfdedb7e792962ec71ac1003033f70558bd9961f8912e487" | ||||
| "checksum slug 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "797bcb4d24e91239a8615415814f4afb2d8ca400c472de3c73f803a5a7689e11" | ||||
| "checksum smallvec 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4c8cbcd6df1e117c2210e13ab5109635ad68a929fcbb8964dc965b76cb5ee013" | ||||
| "checksum smallvec 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "26df3bb03ca5eac2e64192b723d51f56c1b1e0860e7c766281f4598f181acdc8" | ||||
| @ -2294,6 +2699,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| "checksum tera 0.11.7 (registry+https://github.com/rust-lang/crates.io-index)" = "e815b67d44c26feb06630011fb58b5b243f4e9585aac1ed0592c5795de64cd75" | ||||
| "checksum thread_local 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "279ef31c19ededf577bfd12dfae728040a21f635b06a24cd670ff510edd38963" | ||||
| "checksum time 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)" = "d825be0eb33fda1a7e68012d51e9c7f451dc1a69391e7fdc197060bb8c56667b" | ||||
| "checksum tiny_http 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a442681f9f72e440be192700eeb2861e4174b9983f16f4877c93a134cb5e5f63" | ||||
| "checksum tokio 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "be15ef40f675c9fe66e354d74c73f3ed012ca1aa14d65846a33ee48f1ae8d922" | ||||
| "checksum tokio-core 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)" = "aeeffbbb94209023feaef3c196a41cbcdafa06b4a6f893f68779bb5e53796f71" | ||||
| "checksum tokio-executor 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "8cac2a7883ff3567e9d66bb09100d09b33d90311feca0206c7ca034bc0c55113" | ||||
| @ -2308,7 +2714,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| "checksum tokio-udp 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "137bda266504893ac4774e0ec4c2108f7ccdbcb7ac8dced6305fe9e4e0b5041a" | ||||
| "checksum toml 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "a0263c6c02c4db6c8f7681f9fd35e90de799ebd4cfdeab77a38f4ff6b3d8c0d9" | ||||
| "checksum traitobject 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "efd1f82c56340fdf16f2a953d7bda4f8fdffba13d93b00844c25572110b26079" | ||||
| "checksum twoway 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "59b11b2b5241ba34be09c3cc85a36e56e48f9888862e19cedf23336d35316ed1" | ||||
| "checksum typeable 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1410f6f91f21d1612654e7cc69193b0334f909dcf2c790c4826254fbb86f8887" | ||||
| "checksum typemap 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "653be63c80a3296da5551e1bfd2cca35227e13cdd08c6668903ae2f4f77aa1f6" | ||||
| "checksum typenum 1.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "612d636f949607bdf9b123b4a6f6d966dedf3ff669f7f045890d3a4a73948169" | ||||
| "checksum ucd-util 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "fd2be2d6639d0f8fe6cdda291ad456e23629558d466e2789d2c3e9892bda285d" | ||||
| "checksum unicase 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7f4765f83163b74f957c797ad9253caf97f103fb064d3999aea9568d09fc8a33" | ||||
| @ -2320,6 +2728,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| "checksum unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" | ||||
| "checksum unidecode 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "402bb19d8e03f1d1a7450e2bd613980869438e0666331be3e073089124aa1adc" | ||||
| "checksum unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "382810877fe448991dfc7f0dd6e3ae5d58088fd0ea5e35189655f84e6814fa56" | ||||
| "checksum unsafe-any 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f30360d7979f5e9c6e6cea48af192ea8fab4afb3cf72597154b8f08935bc9c7f" | ||||
| "checksum untrusted 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "55cd1f4b4e96b46aeb8d4855db4a7a9bd96eeeb5c6a1ab54593328761642ce2f" | ||||
| "checksum url 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f808aadd8cfec6ef90e4a14eb46f24511824d1ac596b9682703c87056c8678b7" | ||||
| "checksum utf-8 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f1262dfab4c30d5cb7c07026be00ee343a6cf5027fdc0104a9160f354e5db75c" | ||||
|  | ||||
| @ -9,7 +9,9 @@ colored = "1.6" | ||||
| dotenv = "*" | ||||
| failure = "0.1" | ||||
| gettext-rs = "0.4" | ||||
| guid-create = "0.1" | ||||
| heck = "0.3.0" | ||||
| multipart = "0.15" | ||||
| rpassword = "2.0" | ||||
| serde = "1.0" | ||||
| serde_derive = "1.0" | ||||
| @ -43,8 +45,8 @@ git = "https://github.com/SergioBenitez/Rocket" | ||||
| rev = "df7111143e466c18d1f56377a8d9530a5a306aba" | ||||
| 
 | ||||
| [dependencies.rocket_csrf] | ||||
| branch = "plume" | ||||
| git = "https://github.com/fdb-hiroshima/rocket_csrf" | ||||
| rev = "0fbacab1bc6a32419a18edb600586c5c02fdac4d" | ||||
| 
 | ||||
| [dependencies.rocket_i18n] | ||||
| git = "https://github.com/BaptisteGelez/rocket_i18n" | ||||
|  | ||||
							
								
								
									
										2
									
								
								migrations/2018-09-02-123623_medias_owner_id/down.sql
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										2
									
								
								migrations/2018-09-02-123623_medias_owner_id/down.sql
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,2 @@ | ||||
| -- This file should undo anything in `up.sql` | ||||
| ALTER TABLE medias DROP COLUMN owner_id; | ||||
							
								
								
									
										2
									
								
								migrations/2018-09-02-123623_medias_owner_id/up.sql
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										2
									
								
								migrations/2018-09-02-123623_medias_owner_id/up.sql
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,2 @@ | ||||
| -- Your SQL goes here | ||||
| ALTER TABLE medias ADD COLUMN owner_id INTEGER REFERENCES users(id) ON DELETE CASCADE NOT NULL; | ||||
| @ -1,7 +1,11 @@ | ||||
| use diesel::{self, PgConnection, QueryDsl, ExpressionMethods, RunQueryDsl}; | ||||
| use serde_json; | ||||
| 
 | ||||
| use ap_url; | ||||
| use instance::Instance; | ||||
| use schema::medias; | ||||
| 
 | ||||
| #[derive(Queryable)] | ||||
| #[derive(Queryable, Serialize)] | ||||
| pub struct Media { | ||||
|     pub id: i32, | ||||
|     pub file_path: String, | ||||
| @ -9,7 +13,8 @@ pub struct Media { | ||||
|     pub is_remote: bool, | ||||
|     pub remote_url: Option<String>, | ||||
|     pub sensitive: bool, | ||||
|     pub content_warning: Option<String> | ||||
|     pub content_warning: Option<String>, | ||||
|     pub owner_id: i32 | ||||
| } | ||||
| 
 | ||||
| #[derive(Insertable)] | ||||
| @ -20,10 +25,38 @@ pub struct NewMedia { | ||||
|     pub is_remote: bool, | ||||
|     pub remote_url: Option<String>, | ||||
|     pub sensitive: bool, | ||||
|     pub content_warning: Option<String> | ||||
|     pub content_warning: Option<String>, | ||||
|     pub owner_id: i32 | ||||
| } | ||||
| 
 | ||||
| impl Media { | ||||
|     insert!(medias, NewMedia); | ||||
|     get!(medias); | ||||
|     list_by!(medias, for_user, owner_id as i32); | ||||
| 
 | ||||
|     pub fn to_json(&self, conn: &PgConnection) -> serde_json::Value { | ||||
|         let mut json = serde_json::to_value(self).unwrap(); | ||||
|         let (preview, html) = match self.file_path.rsplitn(2, '.').next().unwrap() { | ||||
|             "png" | "jpg" | "jpeg" | "gif" => ( | ||||
|                 format!("<img src=\"{}\" alt=\"{}\" title=\"{}\" class=\"preview\">", self.url(conn), self.alt_text, self.alt_text), | ||||
|                 format!("<img src=\"{}\" alt=\"{}\" title=\"{}\">", self.url(conn), self.alt_text, self.alt_text) | ||||
|             ), | ||||
|             "mp3" | "wav" | "flac" => ( | ||||
|                 format!("<audio src=\"{}\" title=\"{}\" class=\"preview\"></audio>", self.url(conn), self.alt_text), | ||||
|                 format!("<audio src=\"{}\" title=\"{}\"></audio>", self.url(conn), self.alt_text) | ||||
|             ), | ||||
|             "mp4" | "avi" | "webm" | "mov" => ( | ||||
|                 format!("<video src=\"{}\" title=\"{}\" class=\"preview\"></video>", self.url(conn), self.alt_text), | ||||
|                 format!("<video src=\"{}\" title=\"{}\"></video>", self.url(conn), self.alt_text) | ||||
|             ), | ||||
|             _ => (String::new(), String::new()) | ||||
|         }; | ||||
|         json["html_preview"] = json!(preview); | ||||
|         json["html"] = json!(html); | ||||
|         json | ||||
|     } | ||||
| 
 | ||||
|     pub fn url(&self, conn: &PgConnection) -> String { | ||||
|         ap_url(format!("{}/static/{}", Instance::get_local(conn).unwrap().public_domain, self.file_path)) | ||||
|     } | ||||
| } | ||||
|  | ||||
| @ -81,6 +81,7 @@ table! { | ||||
|         remote_url -> Nullable<Text>, | ||||
|         sensitive -> Bool, | ||||
|         content_warning -> Nullable<Text>, | ||||
|         owner_id -> Int4, | ||||
|     } | ||||
| } | ||||
| 
 | ||||
| @ -164,6 +165,7 @@ joinable!(comments -> posts (post_id)); | ||||
| joinable!(comments -> users (author_id)); | ||||
| joinable!(likes -> posts (post_id)); | ||||
| joinable!(likes -> users (user_id)); | ||||
| joinable!(medias -> users (owner_id)); | ||||
| joinable!(mentions -> comments (comment_id)); | ||||
| joinable!(mentions -> posts (post_id)); | ||||
| joinable!(mentions -> users (mentioned_id)); | ||||
|  | ||||
							
								
								
									
										12
									
								
								src/main.rs
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								src/main.rs
									
									
									
									
									
								
							| @ -1,6 +1,6 @@ | ||||
| #![feature(custom_derive, decl_macro, plugin)] | ||||
| #![plugin(rocket_codegen)] | ||||
|  
 | ||||
| 
 | ||||
| extern crate activitypub; | ||||
| extern crate atom_syndication; | ||||
| extern crate colored; | ||||
| @ -8,7 +8,9 @@ extern crate diesel; | ||||
| extern crate dotenv; | ||||
| extern crate failure; | ||||
| extern crate gettextrs; | ||||
| extern crate guid_create; | ||||
| extern crate heck; | ||||
| extern crate multipart; | ||||
| extern crate plume_common; | ||||
| extern crate plume_models; | ||||
| extern crate rocket; | ||||
| @ -61,6 +63,12 @@ fn main() { | ||||
|             routes::likes::create, | ||||
|             routes::likes::create_auth, | ||||
| 
 | ||||
|             routes::medias::list, | ||||
|             routes::medias::new, | ||||
|             routes::medias::upload, | ||||
|             routes::medias::details, | ||||
|             routes::medias::static_files, | ||||
| 
 | ||||
|             routes::notifications::paginated_notifications, | ||||
|             routes::notifications::notifications, | ||||
|             routes::notifications::notifications_auth, | ||||
| @ -123,7 +131,7 @@ fn main() { | ||||
|                 .add_exceptions(vec![ | ||||
|                     ("/inbox".to_owned(), "/inbox".to_owned(), rocket::http::Method::Post), | ||||
|                     ("/@/<name>/inbox".to_owned(), "/@/<name>/inbox".to_owned(), rocket::http::Method::Post), | ||||
| 
 | ||||
|                     ("/medias/new".to_owned(), "/medias/new".to_owned(), rocket::http::Method::Post), // not compatible with multipart/form-data
 | ||||
|                 ]) | ||||
|                 .finalize().unwrap()) | ||||
|         .launch(); | ||||
|  | ||||
							
								
								
									
										104
									
								
								src/routes/medias.rs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										104
									
								
								src/routes/medias.rs
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,104 @@ | ||||
| use guid_create::GUID; | ||||
| use multipart::server::{Multipart, save::{SavedData, SaveResult}}; | ||||
| use rocket::{Data, http::ContentType, response::{NamedFile, Redirect}}; | ||||
| use rocket_contrib::Template; | ||||
| use serde_json; | ||||
| use std::{fs, path::{Path, PathBuf}}; | ||||
| use plume_models::{db_conn::DbConn, medias::*, users::User}; | ||||
| 
 | ||||
| #[get("/medias")] | ||||
| fn list(user: User, conn: DbConn) -> Template { | ||||
|     let medias = Media::for_user(&*conn, user.id); | ||||
|     Template::render("medias/index", json!({ | ||||
|         "account": user, | ||||
|         "medias": medias.into_iter().map(|m| m.to_json(&*conn)).collect::<Vec<serde_json::Value>>() | ||||
|     })) | ||||
| } | ||||
| 
 | ||||
| #[get("/medias/new")] | ||||
| fn new(user: User) -> Template { | ||||
|     Template::render("medias/new", json!({ | ||||
|         "account": user, | ||||
|         "form": {}, | ||||
|         "errors": {} | ||||
|     })) | ||||
| } | ||||
| 
 | ||||
| #[post("/medias/new", data = "<data>")] | ||||
| fn upload(user: User, data: Data, ct: &ContentType, conn: DbConn) -> Redirect { | ||||
|     if ct.is_form_data() { | ||||
|         let (_, boundary) = ct.params().find(|&(k, _)| k == "boundary").expect("No boundary"); | ||||
| 
 | ||||
|         match Multipart::with_body(data.open(), boundary).save().temp() { | ||||
|             SaveResult::Full(entries) => { | ||||
|                 let fields = entries.fields; | ||||
| 
 | ||||
|                 let filename = fields.get(&"file".to_string()).unwrap().into_iter().next().unwrap().headers | ||||
|                     .filename.clone() | ||||
|                     .unwrap_or("x.png".to_string()); // PNG by default
 | ||||
|                 let ext = filename.rsplitn(2, ".") | ||||
|                     .next() | ||||
|                     .unwrap(); | ||||
|                 let dest = format!("media/{}.{}", GUID::rand().to_string(), ext); | ||||
| 
 | ||||
|                 if let SavedData::Bytes(ref bytes) = fields[&"file".to_string()][0].data { | ||||
|                     fs::write(&dest, bytes).expect("Couldn't save upload"); | ||||
|                 } else { | ||||
|                     if let SavedData::File(ref path, _) = fields[&"file".to_string()][0].data { | ||||
|                         fs::copy(path, &dest).expect("Couldn't copy temp upload"); | ||||
|                     } else { | ||||
|                         println!("not file"); | ||||
|                         return Redirect::to(uri!(new)); | ||||
|                     } | ||||
|                 } | ||||
| 
 | ||||
|                 let has_cw = read(&fields[&"cw".to_string()][0].data).len() > 0; | ||||
|                 let media = Media::insert(&*conn, NewMedia { | ||||
|                     file_path: dest, | ||||
|                     alt_text: read(&fields[&"alt".to_string()][0].data), | ||||
|                     is_remote: false, | ||||
|                     remote_url: None, | ||||
|                     sensitive: has_cw, | ||||
|                     content_warning: if has_cw { | ||||
|                         Some(read(&fields[&"cw".to_string()][0].data)) | ||||
|                     } else { | ||||
|                         None | ||||
|                     }, | ||||
|                     owner_id: user.id | ||||
|                 }); | ||||
|                 println!("ok"); | ||||
|                 Redirect::to(uri!(details: id = media.id)) | ||||
|             }, | ||||
|             SaveResult::Partial(_, _) | SaveResult::Error(_) => { | ||||
|                 println!("partial err"); | ||||
|                 Redirect::to(uri!(new)) | ||||
|             } | ||||
|         } | ||||
|     } else { | ||||
|         println!("not form data"); | ||||
|         Redirect::to(uri!(new)) | ||||
|     } | ||||
| } | ||||
| 
 | ||||
| fn read(data: &SavedData) -> String { | ||||
|     if let SavedData::Text(s) = data { | ||||
|         s.clone() | ||||
|     } else { | ||||
|         panic!("Field is not a string") | ||||
|     } | ||||
| } | ||||
| 
 | ||||
| #[get("/medias/<id>")] | ||||
| fn details(id: i32, user: User, conn: DbConn) -> Template { | ||||
|     let media = Media::get(&*conn, id); | ||||
|     Template::render("medias/details", json!({ | ||||
|         "account": user, | ||||
|         "media": media.map(|m| m.to_json(&*conn)) | ||||
|     })) | ||||
| } | ||||
| 
 | ||||
| #[get("/static/media/<file..>", rank = 1)] | ||||
| fn static_files(file: PathBuf) -> Option<NamedFile> { | ||||
|     NamedFile::open(Path::new("media/").join(file)).ok() | ||||
| } | ||||
| 
 | ||||
| @ -103,6 +103,7 @@ pub mod comments; | ||||
| pub mod errors; | ||||
| pub mod instance; | ||||
| pub mod likes; | ||||
| pub mod medias; | ||||
| pub mod notifications; | ||||
| pub mod posts; | ||||
| pub mod reshares; | ||||
| @ -110,7 +111,7 @@ pub mod session; | ||||
| pub mod user; | ||||
| pub mod well_known; | ||||
| 
 | ||||
| #[get("/static/<file..>")] | ||||
| #[get("/static/<file..>", rank = 2)] | ||||
| fn static_files(file: PathBuf) -> Option<NamedFile> { | ||||
|     NamedFile::open(Path::new("static/").join(file)).ok() | ||||
| } | ||||
|  | ||||
| @ -384,7 +384,7 @@ input:focus, textarea:focus { | ||||
| 
 | ||||
| textarea { | ||||
|  	resize: vertical; | ||||
|   | ||||
| 
 | ||||
|  	font-family: "Lora", serif; | ||||
|  	font-size: 1.1em; | ||||
|  	line-height: 1.5em; | ||||
| @ -577,7 +577,7 @@ form.new-post input[type="submit"]:hover { background: #DADADA; } | ||||
| 		flex-direction: column; | ||||
| 	} | ||||
| 
 | ||||
| 	header nav#menu {	 | ||||
| 	header nav#menu { | ||||
| 		display: inline-flex; | ||||
| 	} | ||||
| 
 | ||||
| @ -648,18 +648,18 @@ form.new-post input[type="submit"]:hover { background: #DADADA; } | ||||
| 		border: solid #F4F4F4 0.1rem; | ||||
| 	} | ||||
| 
 | ||||
| 	body > main > * {	 | ||||
| 	body > main > * { | ||||
| 		padding: 0 5%; | ||||
| 	} | ||||
| 	main .article-meta > * { margin: 0 5%; } | ||||
| 
 | ||||
| 	main .article-meta > p {	 | ||||
| 	main .article-meta > p { | ||||
| 		margin: 2em 5%; | ||||
| 		font-size: 0.9em; | ||||
| 	} | ||||
| 	main .article-meta .comments > * { margin-left: 5%; margin-right: 5%; } | ||||
| 
 | ||||
| 	.card {	 | ||||
| 	.card { | ||||
| 		min-width: 80%; | ||||
| 		min-height: 80%; | ||||
| 	} | ||||
| @ -678,7 +678,8 @@ form.new-post input[type="submit"]:hover { background: #DADADA; } | ||||
| /*== Flex boxes ==*/ | ||||
| .flex { | ||||
| 	display: flex; | ||||
| 	flex-direction: row; | ||||
|     flex-direction: row; | ||||
|     align-items: center; | ||||
| } | ||||
| 
 | ||||
| .flex .grow { | ||||
| @ -707,3 +708,30 @@ body > footer { | ||||
| body > footer * { | ||||
| 	margin: 5em 0; | ||||
| } | ||||
| 
 | ||||
| /** Medias **/ | ||||
| 
 | ||||
| figure { | ||||
|     text-align: center; | ||||
|     margin: 2em; | ||||
|     max-width: 100%; | ||||
|     width: auto; | ||||
|     height: auto; | ||||
| } | ||||
| 
 | ||||
| figure > * { | ||||
|     width: 100%; | ||||
| } | ||||
| 
 | ||||
| figcaption { | ||||
|     padding: 1em; | ||||
| } | ||||
| 
 | ||||
| .preview { | ||||
|     display: block; | ||||
|     max-width: 100px; | ||||
|     max-height: 100px; | ||||
|     width: auto; | ||||
|     height: auto; | ||||
|     margin-right: 20px; | ||||
| } | ||||
|  | ||||
							
								
								
									
										24
									
								
								templates/medias/details.html.tera
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										24
									
								
								templates/medias/details.html.tera
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,24 @@ | ||||
| {% extends "base" %} | ||||
| {% import "macros" as macros %} | ||||
| 
 | ||||
| {% block title %} | ||||
| Your medias | ||||
| {% endblock title %} | ||||
| 
 | ||||
| {% block content %} | ||||
|     <h1>{{ "Media details" }}</h1> | ||||
|     <section> | ||||
|         <a href="/medias">Go back to the gallery</a> | ||||
|     </section> | ||||
| 
 | ||||
|     <section> | ||||
|         <figure class="media"> | ||||
|             {{ media.html | safe }} | ||||
|             <figcaption>{{ media.alt_text }}</figcaption> | ||||
|         </figure> | ||||
|         <div> | ||||
|             <a href="/medias/{{ media.id }}/avatar" class="button inline-block">Use as avatar</a> | ||||
|             <a href="/medias/{{ media.id }}/delete" class="button inline-block">Delete</a> | ||||
|         </div> | ||||
|     </section> | ||||
| {% endblock content %} | ||||
							
								
								
									
										31
									
								
								templates/medias/index.html.tera
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										31
									
								
								templates/medias/index.html.tera
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,31 @@ | ||||
| {% extends "base" %} | ||||
| {% import "macros" as macros %} | ||||
| 
 | ||||
| {% block title %} | ||||
| Your medias | ||||
| {% endblock title %} | ||||
| 
 | ||||
| {% block content %} | ||||
|     <h1>{{ "Your medias" }}</h1> | ||||
|     <div> | ||||
|         <a href="/medias/new" class="inline-block button">Upload</a> | ||||
|     </div> | ||||
| 
 | ||||
|     <section> | ||||
|         {% if medias | length < 1 %} | ||||
|             <p>{{ "You don't have any media yet." | _ }}</p> | ||||
|         {% endif %} | ||||
|         <div class="list"> | ||||
|             {% for media in medias %} | ||||
|                 <div class="card flex"> | ||||
|                     {{ media.html_preview | safe }} | ||||
|                     <main class="grow"> | ||||
|                         <p><a href="/medias/{{ media.id }}">{{ media.alt_text }}</a></p> | ||||
|                     </main> | ||||
|                     <a href="/medias/{{ media.id }}/delete">Delete</a> | ||||
|                 </div> | ||||
|             {% endfor %} | ||||
|         </div> | ||||
|         {# macros::paginate(page=page, total=n_pages) #} | ||||
|     </section> | ||||
| {% endblock content %} | ||||
							
								
								
									
										17
									
								
								templates/medias/new.html.tera
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								templates/medias/new.html.tera
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,17 @@ | ||||
| {% extends "base" %} | ||||
| {% import "macros" as macros %} | ||||
| 
 | ||||
| {% block title %} | ||||
| {{ "Media upload" | _ }} | ||||
| {% endblock title %} | ||||
| 
 | ||||
| {% block content %} | ||||
| <h1>{{ "Media upload" | _ }}</h1> | ||||
| <form method="post" enctype="multipart/form-data"> | ||||
|     {{ macros::input(name="alt", label="Description", errors=errors, form=form, props='required minlength="1"', details='Useful for visually impaired people and licensing') }} | ||||
|     {{ macros::input(name="cw", label="Content warning", errors=errors, form=form, details='Let it empty if there is none') }} | ||||
|     {{ macros::input(name="file", type='file', label="File", errors=errors, form=form, props='required') }} | ||||
| 
 | ||||
|     <input type="submit" value="{{ "Send" | _ }}"/> | ||||
| </form> | ||||
| {% endblock content %} | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user