-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Replace footer text * add COPYING.txt file * Add new logos * Use new logos in all layouts * New logos * Check license key on startup * Bypass license check when Mix.env == :dev * Use new logos with smaller wordmarks * Add generic logo_path/1 function * Use new favicons everywhere * Bypass license check in test env * Use sha256 for license key hash * Mix.env -> config_env() * Use Mix.evn at compile time rather than runtime * Mix format --------- Co-authored-by: Uku Taht <uku.taht@gmail.com>
- Loading branch information
Showing
35 changed files
with
179 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Plausible copyright notice | ||
|
||
This software is Copyright 2024 Plausible Insights OÜ | ||
|
||
This repository is provided for informational purposes only, and no rights to use, distribute or otherwise exploit this software are granted to you. Our other repositories include software that is offered under the Affero GPL, but this repository is not. If you wish to discuss a license, or our hosted service that uses the software, please contact us at hello@plausible.io |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Plausible copyright notice | ||
|
||
This software is Copyright 2024 Plausible Insights OÜ | ||
|
||
This repository is provided for informational purposes only, and no rights to use, distribute or otherwise exploit this software are granted to you. Our other repositories include software that is offered under the Affero GPL, but this repository is not. If you wish to discuss a license, or our hosted service that uses the software, please contact us at hello@plausible.io |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
defmodule Plausible.License do | ||
@moduledoc """ | ||
This module ensures that you cannot run Plausible Analytics Enterprise Edition without a valid license key. | ||
The software contained within the ee/ and assets/js/dashboard/ee directories are Copyright © Plausible Insights OÜ. | ||
We have made this code available solely for informational and transparency purposes. No rights are granted to use, | ||
distribute, or exploit this software in any form. | ||
Any attempt to disable or modify the behavior of this module will be considered a violation of copyright. | ||
If you wish to use the Plausible Analytics Enterprise Edition for your own requirements, please contact us | ||
at hello@plausible.io to discuss obtaining a license. | ||
""" | ||
|
||
require Logger | ||
|
||
if Mix.env() == :prod do | ||
def ensure_valid_license do | ||
if has_valid_license?() do | ||
:ok | ||
else | ||
Logger.error( | ||
"Invalid or no license key provided for Plausible Enterprise Edition. Please contact hello@plausible.io to acquire a license." | ||
) | ||
|
||
Logger.error("Shutting down") | ||
System.stop() | ||
end | ||
end | ||
|
||
@license_hash "4qidue2klxynf4vrprlxuouwjos7dnyn4nsquamkrfhtn3ts6ova====" | ||
defp has_valid_license?() do | ||
hash = | ||
:crypto.hash(:sha256, Application.fetch_env!(:plausible, :license_key)) | ||
|> Base.encode32(case: :lower) | ||
|
||
hash == @license_hash | ||
end | ||
else | ||
def ensure_valid_license do | ||
:ok | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<!DOCTYPE html> | ||
<html lang="en" class="h-full"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<PlausibleWeb.Components.Layout.favicon conn={@conn} /> | ||
<title>Plausible · Web analytics</title> | ||
<link rel="stylesheet" href={Routes.static_path(PlausibleWeb.Endpoint, "/css/app.css")} /> | ||
</head> | ||
<body class="flex flex-col h-full bg-gray-100 dark:bg-gray-900"> | ||
<div class="w-full my-8 text-center"> | ||
<a href={home_dest(@conn)}> | ||
<%= img_tag( | ||
PlausibleWeb.Router.Helpers.static_path( | ||
@conn, | ||
logo_path("logo_dark.svg") | ||
), | ||
class: "w-44 hidden dark:inline", | ||
alt: "Plausible logo", | ||
loading: "lazy" | ||
) %> | ||
<%= img_tag( | ||
PlausibleWeb.Router.Helpers.static_path( | ||
@conn, | ||
logo_path("logo_light.svg") | ||
), | ||
class: "w-44 inline dark:hidden", | ||
alt: "Plausible logo", | ||
loading: "lazy" | ||
) %> | ||
</a> | ||
</div> | ||
|
||
<%= @inner_content %> | ||
|
||
<script type="text/javascript" src={Routes.static_path(PlausibleWeb.Endpoint, "/js/app.js")}> | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Oops, something went wrong.