From: Dessalines Date: Tue, 14 Apr 2020 20:07:20 +0000 (-0400) Subject: Merge branch 'dev' into federation X-Git-Url: http://these/git/%7B%60%24%7BwebArchiveUrl%7D/%22%7B%7D/readmes/%7B%7D/%22%7Burl%7D/%7BpictrsAvatarThumbnail%28?a=commitdiff_plain;h=1336b4ed6023e7fcf0fd40be63569966ee4b1b45;p=lemmy.git Merge branch 'dev' into federation --- 1336b4ed6023e7fcf0fd40be63569966ee4b1b45 diff --cc server/src/main.rs index 59dc2cb7,f3887527..88d62eb9 --- a/server/src/main.rs +++ b/server/src/main.rs @@@ -55,32 -38,31 +55,33 @@@ async fn main() -> Result<(), Error> ); // Create Http server with websocket support - HttpServer::new(move || { - let settings = Settings::get(); - App::new() - .wrap(middleware::Logger::default()) - .data(pool.clone()) - .data(server.clone()) - // The routes - .configure(api::config) - .configure(federation::config) - .configure(feeds::config) - .configure(index::config) - .configure(nodeinfo::config) - .configure(webfinger::config) - .configure(websocket::config) - // static files - .service(actix_files::Files::new( - "/static", - settings.front_end_dir.to_owned(), - )) - .service(actix_files::Files::new( - "/docs", - settings.front_end_dir + "/documentation", - )) - }) - .bind((settings.bind, settings.port))? - .run() - .await + Ok( + HttpServer::new(move || { ++ let settings = Settings::get(); + App::new() + .wrap(middleware::Logger::default()) + .data(pool.clone()) + .data(server.clone()) + // The routes + .configure(api::config) + .configure(federation::config) + .configure(feeds::config) + .configure(index::config) + .configure(nodeinfo::config) + .configure(webfinger::config) + .configure(websocket::config) + // static files + .service(actix_files::Files::new( + "/static", + settings.front_end_dir.to_owned(), + )) + .service(actix_files::Files::new( + "/docs", + settings.front_end_dir.to_owned() + "/documentation", + )) + }) + .bind((settings.bind, settings.port))? + .run() + .await?, + ) } diff --cc server/src/settings.rs index 29d5966b,6e5667cb..8c3cd6a1 --- a/server/src/settings.rs +++ b/server/src/settings.rs @@@ -17,10 -20,10 +20,10 @@@ pub struct Settings pub front_end_dir: String, pub rate_limit: RateLimitConfig, pub email: Option, - pub federation_enabled: bool, + pub federation: Federation, } - #[derive(Debug, Deserialize)] + #[derive(Debug, Deserialize, Clone)] pub struct Setup { pub admin_username: String, pub admin_password: String, @@@ -57,20 -60,11 +60,18 @@@ pub struct Database pub pool_size: u32, } +#[derive(Debug, Deserialize)] +pub struct Federation { + pub enabled: bool, + pub followed_instances: String, + pub tls_enabled: bool, +} + lazy_static! { - static ref SETTINGS: Settings = { - match Settings::init() { - Ok(c) => c, - Err(e) => panic!("{}", e), - } - }; + static ref SETTINGS: RwLock = RwLock::new(match Settings::init() { + Ok(c) => c, + Err(e) => panic!("{}", e), + }); } impl Settings { diff --cc ui/package.json index 7d946614,21458f0d..d2eb1de9 --- a/ui/package.json +++ b/ui/package.json @@@ -14,19 -14,20 +14,20 @@@ }, "keywords": [], "dependencies": { + "@joeattardi/emoji-button": "^2.12.1", "@types/autosize": "^3.0.6", - "@types/js-cookie": "^2.2.5", + "@types/js-cookie": "^2.2.6", "@types/jwt-decode": "^2.2.1", - "@types/markdown-it": "^10.0.0", + "@types/markdown-it": "^0.0.9", "@types/markdown-it-container": "^2.0.2", - "@types/node": "^13.9.2", + "@types/node": "^13.11.1", "autosize": "^4.0.2", "bootswatch": "^4.3.1", - "classcat": "^1.1.3", + "classcat": "^4.0.2", "dotenv": "^8.2.0", "emoji-short-name": "^1.0.0", - "husky": "^4.2.3", - "i18next": "^19.3.3", + "husky": "^4.2.5", + "i18next": "^19.4.1", "inferno": "^7.4.2", "inferno-i18next": "nimbusec-oss/inferno-i18next", "inferno-router": "^7.4.2", diff --cc ui/src/components/comment-form.tsx index ae3e7cfc,5239eb2c..b3c1a9a1 --- a/ui/src/components/comment-form.tsx +++ b/ui/src/components/comment-form.tsx @@@ -158,8 -162,8 +162,9 @@@ export class CommentForm extends Compon {this.state.commentForm.content && (