{"action":"created","issue":{"url":"https://api.github.com/repos/DartVoid/Vane/issues/19","labels_url":"https://api.github.com/repos/DartVoid/Vane/issues/19/labels{/name}","comments_url":"https://api.github.com/repos/DartVoid/Vane/issues/19/comments","events_url":"https://api.github.com/repos/DartVoid/Vane/issues/19/events","html_url":"https://github.com/DartVoid/Vane/pull/19","id":55348147,"number":19,"title":"HTTPS support","user":{"login":"stevenroose","id":853468,"avatar_url":"https://avatars.githubusercontent.com/u/853468?v=3","gravatar_id":"","url":"https://api.github.com/users/stevenroose","html_url":"https://github.com/stevenroose","followers_url":"https://api.github.com/users/stevenroose/followers","following_url":"https://api.github.com/users/stevenroose/following{/other_user}","gists_url":"https://api.github.com/users/stevenroose/gists{/gist_id}","starred_url":"https://api.github.com/users/stevenroose/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stevenroose/subscriptions","organizations_url":"https://api.github.com/users/stevenroose/orgs","repos_url":"https://api.github.com/users/stevenroose/repos","events_url":"https://api.github.com/users/stevenroose/events{/privacy}","received_events_url":"https://api.github.com/users/stevenroose/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-01-23T23:50:48Z","updated_at":"2015-01-24T11:55:22Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/DartVoid/Vane/pulls/19","html_url":"https://github.com/DartVoid/Vane/pull/19","diff_url":"https://github.com/DartVoid/Vane/pull/19.diff","patch_url":"https://github.com/DartVoid/Vane/pull/19.patch"},"body":"I added support for HTTPS serving with certificates configured. It is possible to serve both HTTP and HTTPS or to automatically redirect HTTP requests to HTTPS.\r\n\r\nI also added the possibility to define the host and ports to listen on using the parameters of serve instead of only using the environment.\r\n\r\nThis change should not introduce breaking changes to existing users.\r\n\r\nPerhaps it is a good idea to allow users to pass the database password using an environment variable as well. I believe in that case the database files can be safely exposed, f.e. in a GitHub repo."},"comment":{"url":"https://api.github.com/repos/DartVoid/Vane/issues/comments/71313452","html_url":"https://github.com/DartVoid/Vane/pull/19#issuecomment-71313452","issue_url":"https://api.github.com/repos/DartVoid/Vane/issues/19","id":71313452,"user":{"login":"stevenroose","id":853468,"avatar_url":"https://avatars.githubusercontent.com/u/853468?v=3","gravatar_id":"","url":"https://api.github.com/users/stevenroose","html_url":"https://github.com/stevenroose","followers_url":"https://api.github.com/users/stevenroose/followers","following_url":"https://api.github.com/users/stevenroose/following{/other_user}","gists_url":"https://api.github.com/users/stevenroose/gists{/gist_id}","starred_url":"https://api.github.com/users/stevenroose/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stevenroose/subscriptions","organizations_url":"https://api.github.com/users/stevenroose/orgs","repos_url":"https://api.github.com/users/stevenroose/repos","events_url":"https://api.github.com/users/stevenroose/events{/privacy}","received_events_url":"https://api.github.com/users/stevenroose/received_events","type":"User","site_admin":false},"created_at":"2015-01-24T11:55:22Z","updated_at":"2015-01-24T11:55:22Z","body":"That's a lot of text :)\r\n\r\n- Question 1. I meant the certificate DB password, not the Mongo password. It has to be passed as a String to `SecureSockets.initialize()` and is currently a parameter of `serve()`.\r\n\r\n- Syntax 1. I first considered using HTTPS, I think that's what most users will understand the easiest. I changed to SSL because HTTPS seemed to long :D\r\n\r\n- Syntax 2. I do not agree. What's a boolean good for if you are gonna compare it to true? But will change because of consistency.\r\n\r\n- Syntax 3. `Uri` is a value class, all properties are read-only. I considered using `Uri.parse()` and serializing the URI myself, but that's just as ugly. I also considered using the original Uri's string and replacing the first occurrence of `http://` with `https://` but that's not as fool-proof as this method. (I know it sucks that it takes up so many lines.)\r\n\r\n- Syntax 4. Regardless of your remark on Semantics 2, which do you prefer? The first line gets extremely long, but adding an extra third line for each param seemed me too much.\r\n```dart\r\nsslCertificateDatabasePassword = sslCertificateDatabasePassword != null ? sslCertificateDatabasePassword : Platform.environment['SSL_CERT_DB_PASS'];\r\n// or\r\nif(sslCertificateDatabasePassword == null)\r\n    sslCertificateDatabasePassword = Platform.environment['SSL_CERT_DB_PASS'];\r\n```\r\n\r\n- Syntax 5. I only indent that way when the readability is key, like in public declarations (f.e. `serve()`), otherwise I use the minimum of 4 spaces for broken lines, as the style guide suggests\r\n> DO indent continued lines with at least four spaces.\r\n\r\n- Semantics 1 & 2. Environment over parameter makes more sense considering the default values of the environment. It's true that when the user does not pass a parameter with a default value defined, the environment will be ignored. However, I think that if a parameter is passed explicitly in `serve()`, it should overwrite environment variables to protect the user from environment variables it is not aware of that will otherwise tamper with his code. Perhaps removing all default values is a good solution?"}}