diff --git a/apps/nerves_hub_www/config/config.exs b/apps/nerves_hub_www/config/config.exs index 0690239d0..d68b04fac 100644 --- a/apps/nerves_hub_www/config/config.exs +++ b/apps/nerves_hub_www/config/config.exs @@ -27,6 +27,8 @@ config :nerves_hub_www, NervesHubWWW.Mailer, adapter: Bamboo.LocalAdapter config :nerves_hub_www, NervesHubWWWWeb.AccountController, allow_signups: true +config :phoenix, :template_engines, md: PhoenixMarkdown.Engine + # Import environment specific config. This must remain at the bottom # of this file so it overrides the configuration defined above. import_config "#{Mix.env()}.exs" diff --git a/apps/nerves_hub_www/config/dev.exs b/apps/nerves_hub_www/config/dev.exs index c36faae3d..deccd5381 100644 --- a/apps/nerves_hub_www/config/dev.exs +++ b/apps/nerves_hub_www/config/dev.exs @@ -37,7 +37,7 @@ config :nerves_hub_www, NervesHubWWWWeb.Endpoint, ~r{priv/static/.*(js|css|png|jpeg|jpg|gif|svg)$}, ~r{priv/gettext/.*(po)$}, ~r{lib/nerves_hub_www_web/views/.*(ex)$}, - ~r{lib/nerves_hub_www_web/templates/.*(eex)$} + ~r{lib/nerves_hub_www_web/templates/.*(eex|md)$} ] ] diff --git a/apps/nerves_hub_www/lib/nerves_hub_www_web/controllers/policy_controller.ex b/apps/nerves_hub_www/lib/nerves_hub_www_web/controllers/policy_controller.ex new file mode 100644 index 000000000..2db3fb999 --- /dev/null +++ b/apps/nerves_hub_www/lib/nerves_hub_www_web/controllers/policy_controller.ex @@ -0,0 +1,30 @@ +defmodule NervesHubWWWWeb.PolicyController do + use NervesHubWWWWeb, :controller + + def coc(conn, _params) do + render( + conn, + "coc.html", + title: "Code of Conduct", + container: "container page page-sm policies" + ) + end + + def privacy(conn, _params) do + render( + conn, + "privacy.html", + title: "Privacy Policy", + container: "container page page-sm policies" + ) + end + + def tos(conn, _params) do + render( + conn, + "tos.html", + title: "Terms of Service", + container: "container page page-sm policies" + ) + end +end diff --git a/apps/nerves_hub_www/lib/nerves_hub_www_web/router.ex b/apps/nerves_hub_www/lib/nerves_hub_www_web/router.ex index c35edd3ae..a24455931 100644 --- a/apps/nerves_hub_www/lib/nerves_hub_www_web/router.ex +++ b/apps/nerves_hub_www/lib/nerves_hub_www_web/router.ex @@ -41,6 +41,12 @@ defmodule NervesHubWWWWeb.Router do get("/invite/:token", AccountController, :invite) put("/invite/:token", AccountController, :accept_invite) + + scope "/policy" do + get("/tos", PolicyController, :tos) + get("/privacy", PolicyController, :privacy) + get("/coc", PolicyController, :coc) + end end scope "/", NervesHubWWWWeb do diff --git a/apps/nerves_hub_www/lib/nerves_hub_www_web/templates/layout/_footer.html.eex b/apps/nerves_hub_www/lib/nerves_hub_www_web/templates/layout/_footer.html.eex index c6afdd2c9..3de580f56 100644 --- a/apps/nerves_hub_www/lib/nerves_hub_www_web/templates/layout/_footer.html.eex +++ b/apps/nerves_hub_www/lib/nerves_hub_www_web/templates/layout/_footer.html.eex @@ -1,5 +1,5 @@ -
- +
+
diff --git a/apps/nerves_hub_www/lib/nerves_hub_www_web/templates/policy/coc.html.md b/apps/nerves_hub_www/lib/nerves_hub_www_web/templates/policy/coc.html.md new file mode 100644 index 000000000..97456b5ff --- /dev/null +++ b/apps/nerves_hub_www/lib/nerves_hub_www_web/templates/policy/coc.html.md @@ -0,0 +1,91 @@ +## Code of Conduct + +NervesHub exists to facilitate sharing firmware, by making it easy for Nerves developers to publish firmware and manage embedded devices. + +NervesHub is a piece of technology, but more importantly, it is a community. + +We believe that our mission is best served in an environment that is friendly, safe, and accepting; free from intimidation or harassment. + +Towards this end, certain behaviors and practices will not be tolerated. + +NervesHub is comprised of this website, an associated HTTP API, and the GitHub projects at [github.com/nerves-hub](https://github.com/nerves-hub). + +### tl;dr + +* Be respectful. +* We're here to help: +* Abusive behavior is never tolerated. +* Data published to NervesHub is hosted at the discretion of the NervesHub team, and may be removed. +* Violations of this code may result in swift and permanent expulsion from the NervesHub community. + +### Scope + +We expect all members of the NervesHub community, including paid and unpaid agents, administrators, and users to abide by this Code of Conduct at all times in all NervesHub community venues, online and in person, and in one-on-one communications pertaining to NervesHub affairs. + +This policy covers the usage of the NervesHub website and the NervesHub Open Source project communities, including but not limited to public GitHub repositories, IRC channels, social media, mailing lists, and public events. + +This Code of Conduct is in addition to, and does not in any way nullify or invalidate, any other terms or conditions related to use of the Service. + +The definitions of various subjective terms such as "discriminatory", "hateful", or "confusing" will be decided at the sole discretion of the NervesHub team (). + +### Friendly Harassment-Free Space + +We are committed to providing a friendly, safe and welcoming environment for all, regardless of gender identity, sexual orientation, disability, ethnicity, religion, age, physical appearance, body size, race, or similar personal characteristics. + +We ask that you please respect that people have differences of opinion regarding technical choices, and that every design or implementation choice carries a trade-off and numerous costs. There is seldom a single right answer. A difference of technology preferences is not a license to be rude. + +Any spamming, trolling, flaming, baiting, or other attention-stealing behaviour is not welcome, and will not be tolerated. + +Harassing other users of the Service is never tolerated, whether via public or private media. + +Avoid using offensive or harassing package names, nicknames, or other identifiers that might detract from a friendly, safe, and welcoming environment for all. + +Harassment includes, but is not limited to: harmful or prejudicial verbal or written comments related to gender identity, sexual orientation, disability, ethnicity, religion, age, physical appearance, body size, race, or similar personal characteristics; inappropriate use of nudity, sexual images, and/or sexually explicit language in public spaces; threats of physical or non-physical harm; deliberate intimidation, stalking or following; harassing photography or recording; sustained disruption of talks or other events; inappropriate physical contact; and unwelcome sexual attention. + +### Acceptable Firmware Content + +The NervesHub team reserve the right to make judgement calls about what is and isn't appropriate in published firmware. These are guidelines to help you be successful in our community. + +Firmware published to the Service must be created using the Nerves command-line tools, or a functionally equivalent implementation. For example, a "firmware" must not be a PNG or JPEG image, movie file, or text document. Using the Service as a personal general-purpose database is also not allowed for this reason. Firmware should be Nerves firmware files, and nothing else. + +Firmware must not contain illegal or infringing content. You should only publish firmware or other materials to the Service if you have the right to do so. This includes complying with all software license agreements or other intellectual property restrictions. For example, redistributing an MIT-licensed module with the copyright notice removed, would not be allowed. You will be responsible for any violation of laws or others’ intellectual property rights. + +Firmware must not be malware. For example, a firmware which is designed to maliciously exploit or damage computer systems, is not allowed. However, an explicitly documented penetration testing firmware designed to be used for white-hat security research would most likely be fine. + +Firmware name, description, and other visible metadata must not include abusive, inappropriate, or harassing content. + +### Reporting Violations of this Code of Conduct + +If you believe someone is harassing you or has otherwise violated this Code of Conduct, please contact us at to send us an abuse report. If this is the initial report of a problem, please include as much detail as possible. It is easiest for us to address issues when we have more context. + +### Consequences + +All content published to the Service, including user account credentials, is hosted at the sole discretion of the Nerves Hub team. + +Unacceptable behavior from any community member, including sponsors, employees, customers, or others with decision-making authority, will not be tolerated. + +Anyone asked to stop unacceptable behavior is expected to comply immediately. + +If a community member engages in unacceptable behavior, the NervesHub team may take any action they deem appropriate, up to and including a temporary ban or permanent expulsion from the community without warning (and without refund in the case of a paid event or service). + +### Addressing Grievances + +If you feel you have been falsely or unfairly accused of violating this Code of Conduct, you should notify Nerves Hub, we will do our best to ensure that your grievance is handled appropriately. + +In general, we will choose the course of action that we judge as being most in the interest of fostering a safe and friendly community. + +### Contact Info + +Please contact the NervesHub team at if you need to report a problem or address a grievance related to an abuse report. + +You are also encouraged to contact us if you are curious about something that might be "on the line" between appropriate and inappropriate content. We are happy to provide guidance to help you be a successful part of our community. + +### Changes + +This is a living document and may be updated from time to time. Please refer to the [git history](https://github.com/nerves-hub/nerves_hub_web/tree/master/apps/nerves_hub_www/lib/nerves_hub_www_web/templates/policy/coc.html.md) for this document to view the changes. + +### Credit and License + +This code of conduct is based on [hex.pm's code of conduct](https://hex.pm/policies/coc), which in turn borrows from [npm's code of conduct](http://www.npmjs.com/policies/conduct), the Stumptown Syndicate [Citizen's Code of Conduct](http://citizencodeofconduct.org), and the [Rust Project Code of Conduct](https://github.com/mozilla/rust/wiki/Note-development-policy#conduct). + +This document may be reused under a [Creative Commons Attribution-ShareAlike License](http://creativecommons.org/licenses/by-sa/4.0). diff --git a/apps/nerves_hub_www/lib/nerves_hub_www_web/templates/policy/privacy.html.md b/apps/nerves_hub_www/lib/nerves_hub_www_web/templates/policy/privacy.html.md new file mode 100644 index 000000000..c540489e2 --- /dev/null +++ b/apps/nerves_hub_www/lib/nerves_hub_www_web/templates/policy/privacy.html.md @@ -0,0 +1,61 @@ +## Privacy Policy + +We store information about access to and users on the [nerves-hub.org](https://nerves-hub.org/) website, the nerves-hub.org API and repository. This data is stored in the US on Amazon AWS servers. + +### Websites + +All requests to the nerves-hub.org website are logged. The logs include information about the time the request was made and to which URL, the IP address it was from and browser user agent. Devices additionally report a serial number and firmware metadata as detailed in the [nerves_hub device library](https://github.com/nerves-hub/nerves_hub). + +The logged data is only available to nerves-hub.org's administrative team, but may be made available in aggregate and anonymized forms. + +#### Cookies + +A cookie is a string of information that a website stores on a visitor’s computer, and that the visitor’s browser provides to the website each time the visitor returns. + +The websites uses cookies to help identify logged in users. Website visitors who do not wish to have cookies placed on their computers should not log in to the websites. + +### API + +A registered user is required to publish firmware, to otherwise consume the API a user is not required. See the "User information" section below for more information about what user information is stored and is public. + +Requests to the API is logged and the same information is stored as for the websites. + +### Repository + +Firmware metadata and contents are available to all user accounts associated with a tenant and all devices enabled to access that firmware. Firmware metadata and contents are also visible to the nerves-hub.org administrative team. Firmware metadata may be made available in aggregate and anonymized forms. Even though firmware metadata and contents have limited availability, care still needs to be taken to not include private or confidential information in the clear in the firmware. If credentials are accidentally published they should be changed immediately. + +Requests to the repository is logged and the same information is stored as for the websites. + +### User information + +For registered users their username, email address, and cryptographically hashed password is stored and is required to be provided by users. In addition to this profile information, such as user's full name and social media handles, may be stored of the user if the user chooses to provide it. + +### Disclosure + +nerves-hub.org may disclose personally identifiable information under special circumstances, such as to comply with subpoenas or when your actions violate the [Terms of Service](termsofservice). + +### United States Jurisdiction + +The nerves-hub.org service is hosted in the United States. This Privacy Policy is intended to comply with privacy laws in the United States and may not comply with all privacy laws in other countries. + +If you are a non-US user of the service, by using our service and providing us with data, you acknowledge, agree and provide your consent that your personal information may be processed in the United States for the purposes identified in this Privacy Policy. In addition, such data may be stored on servers located outside your resident jurisdiction, which may have less stringent privacy practices than your own. By using the nerves-hub.org service and providing us with your data, you consent to the transfer of such data and any less stringent privacy practices. + +### Communication + +All emails to `***@nerves-hub.org` are stored, including the email address of the sender and the contents of the email. This information is available internally to nerves-hub.org but will not be disclosed to the outside. See the "Disclosure" section for exceptions to this. + +### Questions + +Any questions about this Privacy Policy should be addressed to . + +### Changes + +Although most changes are likely to be minor, nerves-hub.org may change its Privacy Policy from time to time, and at nerves-hub.org's sole discretion. The detailed history of changes can be found in the [git repository](https://github.com/nerves-hub/nerves_hub_web/tree/master/apps/nerves_hub_www/lib/nerves_hub_www_web/templates/policy/privacy.html.md) history for this document. + +nerves-hub.org encourages visitors to frequently check this page for any changes to its Privacy Policy. Your continued use of the nerves-hub.org websites and the repository after any change in this Privacy Policy will constitute your acceptance of such change. + +### Credit and License + +This policy document is based on [hex.pm's Privacy Policy](https://hex.pm/policies/privacy) which is partly based on [npm's Privacy Policy](https://www.npmjs.com/policies/privacy) and [WordPress.org privacy policy](https://wordpress.org/about/privacy). + +This document may be reused under a [Creative Commons Attribution-ShareAlike License](http://creativecommons.org/licenses/by-sa/4.0). diff --git a/apps/nerves_hub_www/lib/nerves_hub_www_web/templates/policy/tos.html.md b/apps/nerves_hub_www/lib/nerves_hub_www_web/templates/policy/tos.html.md new file mode 100644 index 000000000..10885f365 --- /dev/null +++ b/apps/nerves_hub_www/lib/nerves_hub_www_web/templates/policy/tos.html.md @@ -0,0 +1,71 @@ +## Terms of Service + +By accessing or using the nerves-hub.org websites, HTTP API, repository or associated services (collectively, the "Services") of nerves-hub.org ("NervesHub") you are agreeing to be bound by this Terms of Service ("Terms"). Any information, text, graphics or other material on Services (collectively, the "Content") is also covered by the Terms. + +### 1. Basic Terms + +You are responsible for your use of the Services and any Content you post to the Services. Content you post to the Services can be viewed by anyone using the Services or using third party services. All Content you post to the Services is subject to these terms. + +You may use these Services only if you can form a binding contract with NervesHub. If you use the Services on behalf of another company, organization or other entity you must be authorized to do so. + +You may not use the Services for any illegal or unauthorized purpose. You must not in the use of the Services violate any laws in your jurisdiction, including but not limited to copyright or trademark laws. + +You are responsible for maintaining the security of your account and password. NervesHub cannot and will not be liable for any loss or damage from your failure to comply with this security obligation. + +### 2. Privacy + +Any information that you or other users provide is subject to our [Privacy Policy](privacy), which governs our collection and use of your information. As part of providing the Services we may send you information, these communications are considered part of the Services and are subject to these Terms. + +### 3. API Terms + +User may access Content via an API (Application Program Interface). Any use of the API, including use of the API through a third-party product that accesses NervesHub, is bound by these Terms. + +Abuse or excessively frequent access to NervesHub through the API may result in temporary or permanent suspension of access to the API. NervesHub, will determine abuse or excessive usage of the API. + +NervesHub reserves the right at any time to modify or discontinue, temporarily or permanently, your access to the API (or any part thereof) with or without notice. + +### 4. Copyright and Content Ownership + +All Content, whether publicly posted or privately transmitted, is the sole responsibility of the person who originated such Content. NervesHub may not monitor or control the Content posted via the Services and, NervesHub cannot take responsibility for such Content. Any use or reliance on any Content or materials posted via the Services or obtained by you through the Services is at your own risk. + +NervesHub does not endorse, support, represent or guarantee the completeness, truthfulness, accuracy, or reliability of any Content or communications posted via the Services or endorse any opinions expressed via the Services. You understand that by using the Services, you may be exposed to Content that might be offensive, harmful, inaccurate or otherwise inappropriate, or in some cases, postings that have been mislabeled or are otherwise deceptive. Under no circumstances will NervesHub be liable in any way for any Content, including, but not limited to, any errors or omissions in any Content, or any loss or damage of any kind incurred as a result of the use of any Content posted, emailed, transmitted or otherwise made available via the Services or broadcast elsewhere. + +You retain your rights to any Content you submit, post or display on or through the Services. By submitting, posting or displaying Content on or through the Services, you grant us a worldwide, non-exclusive, royalty-free license to use, copy, reproduce, process, adapt, modify, publish, transmit, display and distribute such Content in any and all media or distribution methods (now known or later developed). Any Content you submit or post to the Services may be stored by NervesHub and will be subject to these terms indefinitely or until NervesHub, at its sole discretion, terminates the Content. + +You are responsible for your use of the Services, for any Content you provide, and for any consequences thereof, including the use of your Content by other users and third party services. You understand that your Content may be syndicated, broadcast, distributed, or published by third party services and if you do not have the right to submit Content for such use, it may subject you to liability. NervesHub will not be responsible or liable for any use of your Content by NervesHub in accordance with these Terms. You represent and warrant that you have all the rights, power and authority necessary to grant the rights granted herein to any Content that you submit. + +### 5. Restrictions on Content and Use of the Services + +We reserve the right at all times (but will not have an obligation) to remove or refuse to distribute any Content on the Services, to suspend or terminate users, and to reclaim usernames or package names without liability to you. We also reserve the right to access, read, preserve, and disclose any information as we reasonably believe is necessary to satisfy any applicable law, regulation, legal process or governmental request, enforce the Terms, including investigation of potential violations hereof, detect, prevent, or otherwise address fraud, security or technical issues, respond to user support requests, or protect the rights, property or safety of NervesHub, its users and the public. + +You may not do any of the following while accessing or using the Services: access, tamper with, or use non-public areas of the Services, NervesHub’s computer systems, or the technical delivery systems of NervesHub's providers; breach or circumvent any security or authentication measures; access or search or attempt to access or search the Services by any means (automated or otherwise) other than through our currently available, published interfaces that are provided by NervesHub (and only pursuant to the applicable terms and conditions), unless you have been specifically allowed to do so in a separate agreement with NervesHub (NOTE: crawling the Services is permissible if done in accordance with the provisions of the robots.txt file, however, scraping the Services without the prior consent of NervesHub is expressly prohibited); or interfere with, or disrupt, (or attempt to do so), the access of any user, host or network, including, without limitation, sending a virus, overloading, flooding, spamming, mail-bombing the Services, or by scripting the creation of Content in such a manner as to interfere with or create an undue burden on the Services. + +Any Content that you submit, port or display on or through the Services is subject to our [Code of Conduct](codeofconduct), which governs your behavior and Content on the services. + +### 6. Copyright Policy + +NervesHub respects the intellectual property rights of others and expects users of the Services to do the same. We will respond to notices of alleged copyright infringement that comply with applicable law and are properly provided to us. If you believe that your Content has been copied in a way that constitutes copyright infringement, please provide us with the following information: a physical or electronic signature of the copyright owner or a person authorized to act on their behalf; identification of the copyrighted work claimed to have been infringed; identification of the material that is claimed to be infringing or to be the subject of infringing activity and that is to be removed or access to which is to be disabled, and information reasonably sufficient to permit us to locate the material; your contact information; a statement by you that you have a good faith belief that use of the material in the manner complained of is not authorized by the copyright owner, its agent, or the law; and a statement that the information in the notification is accurate, and, under penalty of perjury, that you are authorized to act on behalf of the copyright owner. + +We reserve the right to remove Content alleged to be infringing without prior notice, at our sole discretion, and without liability to you. In appropriate circumstances, NervesHub will also terminate a user’s account if the user is determined to be a repeat infringer. Under the U.S. Digital Millennium Copyright Act, our designated copyright agent for notice of alleged copyright infringement appearing on the Services is: . + +### 7. Ending These Terms + +The Terms will continue to apply indefinitely or until terminated by NervesHub. If you stop using the Services the Terms will continue to apply to any information you have submitted or posted to the Services. Nothing in this section shall affect NervesHub's rights to change, limit or stop the provision of the Services without prior notice. + +### 8. Disclaimers and Limitations of Liability + +Your access to and use of the Services or any Content are at your own risk. You understand and agree that the Services are provided to you on an “AS IS” and “AS AVAILABLE” basis. Without limiting the foregoing, to the maximum extent permitted under applicable law, NervesHub DISCLAIM ALL WARRANTIES AND CONDITIONS, WHETHER EXPRESS OR IMPLIED, OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. + +NervesHub make no warranty or representation and disclaim all responsibility and liability for: the completeness, accuracy, availability, timeliness, security or reliability of the Services or any Content; any harm to your computer system, loss of data, or other harm that results from your access to or use of the Services or any Content; the deletion of, or the failure to store or to transmit, any Content and other communications maintained by the Services; and whether the Services will meet your requirements or be available on an uninterrupted, secure, or error-free basis. No advice or information, whether oral or written, obtained from NervesHub or through the Services, will create any warranty or representation not expressly made herein. + +The Services may contain links to third-party websites or resources. You acknowledge and agree that NervesHub are not responsible or liable for: the availability or accuracy of such websites or resources; or the content, products, or services on or available from such websites or resources. Links to such websites or resources do not imply any endorsement by NervesHub of such websites or resources or the content, products, or services available from such websites or resources. You acknowledge sole responsibility for and assume all risk arising from your use of any such websites or resources. + +TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, NervesHub SHALL NOT BE LIABLE FOR ANY INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL OR PUNITIVE DAMAGES, OR ANY LOSS OF PROFITS OR REVENUES, WHETHER INCURRED DIRECTLY OR INDIRECTLY, OR ANY LOSS OF DATA, USE, GOOD-WILL, OR OTHER INTANGIBLE LOSSES, RESULTING FROM YOUR ACCESS TO OR USE OF OR INABILITY TO ACCESS OR USE THE SERVICES; ANY CONDUCT OR CONTENT OF ANY THIRD PARTY ON THE SERVICES, INCLUDING WITHOUT LIMITATION, ANY DEFAMATORY, OFFENSIVE OR ILLEGAL CONDUCT OF OTHER USERS OR THIRD PARTIES; ANY CONTENT OBTAINED FROM THE SERVICES; OR UNAUTHORIZED ACCESS, USE OR ALTERATION OF YOUR TRANSMISSIONS OR CONTENT. + +The failure of NervesHub to enforce any right or provision of these Terms will not be deemed a waiver of such right or provision. In the event that any provision of these Terms is held to be invalid or unenforceable, then that provision will be limited or eliminated to the minimum extent necessary, and the remaining provisions of these Terms will remain in full force and effect. + +### 10. Changes + +If NervesHub makes changes to these Terms we will post a notice on the nerves-hub.org website and notify you by email. New features, tools or resources added to the Services will be subject to the Terms. By continuing to use the Services you are agreeing to the Terms as it is subject to the changes. + +The detailed history of changes to these Terms can be found in the [git repository](https://github.com/nerves-hub/nerves_hub_web/tree/master/apps/nerves_hub_www/lib/nerves_hub_www_web/templates/policy/tos.html.md) history for this document. diff --git a/apps/nerves_hub_www/lib/nerves_hub_www_web/views/policy_view.ex b/apps/nerves_hub_www/lib/nerves_hub_www_web/views/policy_view.ex new file mode 100644 index 000000000..efde845e5 --- /dev/null +++ b/apps/nerves_hub_www/lib/nerves_hub_www_web/views/policy_view.ex @@ -0,0 +1,3 @@ +defmodule NervesHubWWWWeb.PolicyView do + use NervesHubWWWWeb, :view +end diff --git a/apps/nerves_hub_www/mix.exs b/apps/nerves_hub_www/mix.exs index cae58c86a..165dc5b8d 100644 --- a/apps/nerves_hub_www/mix.exs +++ b/apps/nerves_hub_www/mix.exs @@ -60,6 +60,7 @@ defmodule NervesHubWWW.MixProject do branch: "transport", override: true, only: :dev}, + {:phoenix_markdown, "~> 1.0"}, {:gettext, "~> 0.11"}, {:cowboy, "~> 2.0", override: true}, {:hackney, "~> 1.9"}, diff --git a/apps/nerves_hub_www/test/nerves_hub_www_web/controllers/policy_controller_test.exs b/apps/nerves_hub_www/test/nerves_hub_www_web/controllers/policy_controller_test.exs new file mode 100644 index 000000000..1102e60b6 --- /dev/null +++ b/apps/nerves_hub_www/test/nerves_hub_www_web/controllers/policy_controller_test.exs @@ -0,0 +1,26 @@ +defmodule NervesHubWWWWeb.PolicyControllerTest do + use NervesHubWWWWeb.ConnCase.Browser + + describe "policies" do + test "renders terms of service", %{ + conn: conn + } do + conn = get(conn, policy_path(conn, :tos)) + assert html_response(conn, 200) =~ "Terms of Service" + end + + test "renders code of conduct", %{ + conn: conn + } do + conn = get(conn, policy_path(conn, :coc)) + assert html_response(conn, 200) =~ "Code of Conduct" + end + + test "renders privacy policy", %{ + conn: conn + } do + conn = get(conn, policy_path(conn, :privacy)) + assert html_response(conn, 200) =~ "Privacy Policy" + end + end +end diff --git a/mix.lock b/mix.lock index 33373614a..89fd19378 100644 --- a/mix.lock +++ b/mix.lock @@ -11,6 +11,7 @@ "db_connection": {:hex, :db_connection, "1.1.3", "89b30ca1ef0a3b469b1c779579590688561d586694a3ce8792985d4d7e575a61", [:mix], [{:connection, "~> 1.0.2", [hex: :connection, repo: "hexpm", optional: false]}, {:poolboy, "~> 1.5", [hex: :poolboy, repo: "hexpm", optional: true]}, {:sbroker, "~> 1.0", [hex: :sbroker, repo: "hexpm", optional: true]}], "hexpm"}, "decimal": {:hex, :decimal, "1.5.0", "b0433a36d0e2430e3d50291b1c65f53c37d56f83665b43d79963684865beab68", [:mix], [], "hexpm"}, "distillery": {:hex, :distillery, "1.5.3", "b2f4fc34ec71ab4f1202a796f9290e068883b042319aa8c9aa45377ecac8597a", [:mix], [], "hexpm"}, + "earmark": {:hex, :earmark, "1.2.5", "4d21980d5d2862a2e13ec3c49ad9ad783ffc7ca5769cf6ff891a4553fbaae761", [:mix], [], "hexpm"}, "ecto": {:hex, :ecto, "2.2.10", "e7366dc82f48f8dd78fcbf3ab50985ceeb11cb3dc93435147c6e13f2cda0992e", [:mix], [{:db_connection, "~> 1.1", [hex: :db_connection, repo: "hexpm", optional: true]}, {:decimal, "~> 1.2", [hex: :decimal, repo: "hexpm", optional: false]}, {:mariaex, "~> 0.8.0", [hex: :mariaex, repo: "hexpm", optional: true]}, {:poison, "~> 2.2 or ~> 3.0", [hex: :poison, repo: "hexpm", optional: true]}, {:poolboy, "~> 1.5", [hex: :poolboy, repo: "hexpm", optional: false]}, {:postgrex, "~> 0.13.0", [hex: :postgrex, repo: "hexpm", optional: true]}, {:sbroker, "~> 1.0", [hex: :sbroker, repo: "hexpm", optional: true]}], "hexpm"}, "elixir_make": {:hex, :elixir_make, "0.4.2", "332c649d08c18bc1ecc73b1befc68c647136de4f340b548844efc796405743bf", [:mix], [], "hexpm"}, "ex_aws": {:hex, :ex_aws, "2.1.0", "b92651527d6c09c479f9013caa9c7331f19cba38a650590d82ebf2c6c16a1d8a", [:mix], [{:configparser_ex, "~> 2.0", [hex: :configparser_ex, repo: "hexpm", optional: true]}, {:hackney, "1.6.3 or 1.6.5 or 1.7.1 or 1.8.6 or ~> 1.9", [hex: :hackney, repo: "hexpm", optional: true]}, {:jsx, "~> 2.8", [hex: :jsx, repo: "hexpm", optional: true]}, {:poison, ">= 1.2.0", [hex: :poison, repo: "hexpm", optional: true]}, {:sweet_xml, "~> 0.6", [hex: :sweet_xml, repo: "hexpm", optional: true]}, {:xml_builder, "~> 0.1.0", [hex: :xml_builder, repo: "hexpm", optional: true]}], "hexpm"}, @@ -33,6 +34,7 @@ "phoenix_ecto": {:git, "https://github.com/phoenixframework/phoenix_ecto.git", "c45ed42470b47b1f73d85aef7815659cfe37a788", []}, "phoenix_html": {:hex, :phoenix_html, "2.11.2", "86ebd768258ba60a27f5578bec83095bdb93485d646fc4111db8844c316602d6", [:mix], [{:plug, "~> 1.5", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm"}, "phoenix_live_reload": {:git, "https://github.com/mobileoverlord/phoenix_live_reload.git", "231de7d51623eda49079255e38787b45d25f531f", [branch: "transport"]}, + "phoenix_markdown": {:hex, :phoenix_markdown, "1.0.1", "4630458ab453b6ac098dcf93ca5ee12dbfe4d7f0af1acd2de5ad87e768493dd8", [:mix], [{:earmark, "~> 1.2", [hex: :earmark, repo: "hexpm", optional: false]}, {:phoenix, ">= 1.1.0", [hex: :phoenix, repo: "hexpm", optional: false]}, {:phoenix_html, ">= 2.3.0", [hex: :phoenix_html, repo: "hexpm", optional: false]}], "hexpm"}, "phoenix_pubsub": {:hex, :phoenix_pubsub, "1.1.0", "d55e25ff1ff8ea2f9964638366dfd6e361c52dedfd50019353598d11d4441d14", [:mix], [], "hexpm"}, "plug": {:hex, :plug, "1.6.2", "e06a7bd2bb6de5145da0dd950070110dce88045351224bd98e84edfdaaf5ffee", [:mix], [{:cowboy, "~> 1.0.1 or ~> 1.1 or ~> 2.4", [hex: :cowboy, repo: "hexpm", optional: true]}, {:mime, "~> 1.0", [hex: :mime, repo: "hexpm", optional: false]}], "hexpm"}, "poison": {:hex, :poison, "3.1.0", "d9eb636610e096f86f25d9a46f35a9facac35609a7591b3be3326e99a0484665", [:mix], [], "hexpm"},