-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1a9d2c6
commit 032da05
Showing
42 changed files
with
1,284 additions
and
1 deletion.
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,27 @@ | ||
# App artifacts | ||
/_build | ||
/db | ||
/deps | ||
/*.ez | ||
|
||
# Generated on crash by the VM | ||
erl_crash.dump | ||
|
||
# Generated on crash by NPM | ||
npm-debug.log | ||
|
||
# Static artifacts | ||
/assets/node_modules | ||
|
||
# Since we are building assets from assets/, | ||
# we ignore priv/static. You may want to comment | ||
# this depending on your deployment strategy. | ||
/priv/static/ | ||
|
||
# Files matching config/*.secret.exs pattern contain sensitive | ||
# data and you should not commit them into version control. | ||
# | ||
# Alternatively, you may comment the line below and commit the | ||
# secrets files as long as you replace their contents by environment | ||
# variables. | ||
/config/*.secret.exs |
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 |
---|---|---|
@@ -1,2 +1,20 @@ | ||
# HEBornMigration | ||
Small website to provide HE1 players a call-to-action to migrate their accounts to HEBorn | ||
|
||
To start your Phoenix server: | ||
|
||
* Install dependencies with `mix deps.get` | ||
* Create and migrate your database with `mix ecto.create && mix ecto.migrate` | ||
* Install Node.js dependencies with `cd assets && npm install` | ||
* Start Phoenix endpoint with `mix phx.server` | ||
|
||
Now you can visit [`localhost:4000`](http://localhost:4000) from your browser. | ||
|
||
Ready to run in production? Please [check our deployment guides](http://www.phoenixframework.org/docs/deployment). | ||
|
||
## Learn more | ||
|
||
* Official website: http://www.phoenixframework.org/ | ||
* Guides: http://phoenixframework.org/docs/overview | ||
* Docs: https://hexdocs.pm/phoenix | ||
* Mailing list: http://groups.google.com/group/phoenix-talk | ||
* Source: https://github.com/phoenixframework/phoenix |
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,63 @@ | ||
exports.config = { | ||
// See http://brunch.io/#documentation for docs. | ||
files: { | ||
javascripts: { | ||
joinTo: "js/app.js" | ||
|
||
// To use a separate vendor.js bundle, specify two files path | ||
// https://github.com/brunch/brunch/blob/master/docs/config.md#files | ||
// joinTo: { | ||
// "js/app.js": /^(js)/, | ||
// "js/vendor.js": /^(vendor)|(deps)/ | ||
// } | ||
// | ||
// To change the order of concatenation of files, explicitly mention here | ||
// https://github.com/brunch/brunch/tree/master/docs#concatenation | ||
// order: { | ||
// before: [ | ||
// "vendor/js/jquery-2.1.1.js", | ||
// "vendor/js/bootstrap.min.js" | ||
// ] | ||
// } | ||
}, | ||
stylesheets: { | ||
joinTo: "css/app.css" | ||
}, | ||
templates: { | ||
joinTo: "js/app.js" | ||
} | ||
}, | ||
|
||
conventions: { | ||
// This option sets where we should place non-css and non-js assets in. | ||
// By default, we set this to "/assets/static". Files in this directory | ||
// will be copied to `paths.public`, which is "priv/static" by default. | ||
assets: /^(static)/ | ||
}, | ||
|
||
// Phoenix paths configuration | ||
paths: { | ||
// Dependencies and current project directories to watch | ||
watched: ["static", "css", "js", "vendor"], | ||
// Where to compile files to | ||
public: "../priv/static" | ||
}, | ||
|
||
// Configure your plugins | ||
plugins: { | ||
babel: { | ||
// Do not use ES6 compiler in vendor code | ||
ignore: [/vendor/] | ||
} | ||
}, | ||
|
||
modules: { | ||
autoRequire: { | ||
"js/app.js": ["js/app"] | ||
} | ||
}, | ||
|
||
npm: { | ||
enabled: true | ||
} | ||
}; |
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 @@ | ||
/* This file is for your main application css. */ |
Large diffs are not rendered by default.
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,21 @@ | ||
// Brunch automatically concatenates all files in your | ||
// watched paths. Those paths can be configured at | ||
// config.paths.watched in "brunch-config.js". | ||
// | ||
// However, those files will only be executed if | ||
// explicitly imported. The only exception are files | ||
// in vendor, which are never wrapped in imports and | ||
// therefore are always executed. | ||
|
||
// Import dependencies | ||
// | ||
// If you no longer want to use a dependency, remember | ||
// to also remove its path from "config.paths.watched". | ||
import "phoenix_html" | ||
|
||
// Import local files | ||
// | ||
// Local files can be imported directly using relative | ||
// paths "./socket" or full ones "web/static/js/socket". | ||
|
||
// import socket from "./socket" |
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,62 @@ | ||
// NOTE: The contents of this file will only be executed if | ||
// you uncomment its entry in "assets/js/app.js". | ||
|
||
// To use Phoenix channels, the first step is to import Socket | ||
// and connect at the socket path in "lib/web/endpoint.ex": | ||
import {Socket} from "phoenix" | ||
|
||
let socket = new Socket("/socket", {params: {token: window.userToken}}) | ||
|
||
// When you connect, you'll often need to authenticate the client. | ||
// For example, imagine you have an authentication plug, `MyAuth`, | ||
// which authenticates the session and assigns a `:current_user`. | ||
// If the current user exists you can assign the user's token in | ||
// the connection for use in the layout. | ||
// | ||
// In your "lib/web/router.ex": | ||
// | ||
// pipeline :browser do | ||
// ... | ||
// plug MyAuth | ||
// plug :put_user_token | ||
// end | ||
// | ||
// defp put_user_token(conn, _) do | ||
// if current_user = conn.assigns[:current_user] do | ||
// token = Phoenix.Token.sign(conn, "user socket", current_user.id) | ||
// assign(conn, :user_token, token) | ||
// else | ||
// conn | ||
// end | ||
// end | ||
// | ||
// Now you need to pass this token to JavaScript. You can do so | ||
// inside a script tag in "lib/web/templates/layout/app.html.eex": | ||
// | ||
// <script>window.userToken = "<%= assigns[:user_token] %>";</script> | ||
// | ||
// You will need to verify the user token in the "connect/2" function | ||
// in "lib/web/channels/user_socket.ex": | ||
// | ||
// def connect(%{"token" => token}, socket) do | ||
// # max_age: 1209600 is equivalent to two weeks in seconds | ||
// case Phoenix.Token.verify(socket, "user socket", token, max_age: 1209600) do | ||
// {:ok, user_id} -> | ||
// {:ok, assign(socket, :user, user_id)} | ||
// {:error, reason} -> | ||
// :error | ||
// end | ||
// end | ||
// | ||
// Finally, pass the token on connect as below. Or remove it | ||
// from connect if you don't care about authentication. | ||
|
||
socket.connect() | ||
|
||
// Now that you are connected, you can join channels with a topic: | ||
let channel = socket.channel("topic:subtopic", {}) | ||
channel.join() | ||
.receive("ok", resp => { console.log("Joined successfully", resp) }) | ||
.receive("error", resp => { console.log("Unable to join", resp) }) | ||
|
||
export default socket |
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,19 @@ | ||
{ | ||
"repository": {}, | ||
"license": "MIT", | ||
"scripts": { | ||
"deploy": "brunch build --production", | ||
"watch": "brunch watch --stdin" | ||
}, | ||
"dependencies": { | ||
"phoenix": "file:../deps/phoenix", | ||
"phoenix_html": "file:../deps/phoenix_html" | ||
}, | ||
"devDependencies": { | ||
"babel-brunch": "6.0.6", | ||
"brunch": "2.10.7", | ||
"clean-css-brunch": "2.10.0", | ||
"css-brunch": "2.10.0", | ||
"uglify-js-brunch": "2.1.1" | ||
} | ||
} |
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.
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 @@ | ||
# See http://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file | ||
# | ||
# To ban all spiders from the entire site uncomment the next two lines: | ||
# User-agent: * | ||
# Disallow: / |
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,28 @@ | ||
# This file is responsible for configuring your application | ||
# and its dependencies with the aid of the Mix.Config module. | ||
# | ||
# This configuration file is loaded before any dependency and | ||
# is restricted to this project. | ||
use Mix.Config | ||
|
||
# General application configuration | ||
config :heborn_migration, | ||
namespace: HEBornMigration, | ||
ecto_repos: [HEBornMigration.Repo] | ||
|
||
# Configures the endpoint | ||
config :heborn_migration, HEBornMigration.Web.Endpoint, | ||
url: [host: "localhost"], | ||
secret_key_base: "olDQeg9L+hxxUdn5QrPJBnDxhu4Kr2cVVEsHGzzeyKABmASbtc2s59pARcUcBxwe", | ||
render_errors: [view: HEBornMigration.Web.ErrorView, accepts: ~w(html json)], | ||
pubsub: [name: HEBornMigration.PubSub, | ||
adapter: Phoenix.PubSub.PG2] | ||
|
||
# Configures Elixir's Logger | ||
config :logger, :console, | ||
format: "$time $metadata[$level] $message\n", | ||
metadata: [:request_id] | ||
|
||
# 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" |
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,58 @@ | ||
use Mix.Config | ||
|
||
# For development, we disable any cache and enable | ||
# debugging and code reloading. | ||
# | ||
# The watchers configuration can be used to run external | ||
# watchers to your application. For example, we use it | ||
# with brunch.io to recompile .js and .css sources. | ||
config :heborn_migration, HEBornMigration.Web.Endpoint, | ||
http: [port: 4000], | ||
debug_errors: true, | ||
code_reloader: true, | ||
check_origin: false, | ||
watchers: [node: ["node_modules/brunch/bin/brunch", "watch", "--stdin", | ||
cd: Path.expand("../assets", __DIR__)]] | ||
|
||
# ## SSL Support | ||
# | ||
# In order to use HTTPS in development, a self-signed | ||
# certificate can be generated by running the following | ||
# command from your terminal: | ||
# | ||
# openssl req -new -newkey rsa:4096 -days 365 -nodes -x509 -subj "/C=US/ST=Denial/L=Springfield/O=Dis/CN=www.example.com" -keyout priv/server.key -out priv/server.pem | ||
# | ||
# The `http:` config above can be replaced with: | ||
# | ||
# https: [port: 4000, keyfile: "priv/server.key", certfile: "priv/server.pem"], | ||
# | ||
# If desired, both `http:` and `https:` keys can be | ||
# configured to run both http and https servers on | ||
# different ports. | ||
|
||
# Watch static and templates for browser reloading. | ||
config :heborn_migration, HEBornMigration.Web.Endpoint, | ||
live_reload: [ | ||
patterns: [ | ||
~r{priv/static/.*(js|css|png|jpeg|jpg|gif|svg)$}, | ||
~r{priv/gettext/.*(po)$}, | ||
~r{lib/heborn_migration/web/views/.*(ex)$}, | ||
~r{lib/heborn_migration/web/templates/.*(eex)$} | ||
] | ||
] | ||
|
||
# Do not include metadata nor timestamps in development logs | ||
config :logger, :console, format: "[$level] $message\n" | ||
|
||
# Set a higher stacktrace during development. Avoid configuring such | ||
# in production as building large stacktraces may be expensive. | ||
config :phoenix, :stacktrace_depth, 20 | ||
|
||
# Configure your database | ||
config :heborn_migration, HEBornMigration.Repo, | ||
adapter: Ecto.Adapters.Postgres, | ||
username: "postgres", | ||
password: "postgres", | ||
database: "heborn_migration_dev", | ||
hostname: "localhost", | ||
pool_size: 10 |
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,64 @@ | ||
use Mix.Config | ||
|
||
# For production, we often load configuration from external | ||
# sources, such as your system environment. For this reason, | ||
# you won't find the :http configuration below, but set inside | ||
# HEBornMigration.Web.Endpoint.load_from_system_env/1 dynamically. | ||
# Any dynamic configuration should be moved to such function. | ||
# | ||
# Don't forget to configure the url host to something meaningful, | ||
# Phoenix uses this information when generating URLs. | ||
# | ||
# Finally, we also include the path to a cache manifest | ||
# containing the digested version of static files. This | ||
# manifest is generated by the mix phoenix.digest task | ||
# which you typically run after static files are built. | ||
config :heborn_migration, HEBornMigration.Web.Endpoint, | ||
on_init: {HEBornMigration.Web.Endpoint, :load_from_system_env, []}, | ||
url: [host: "example.com", port: 80], | ||
cache_static_manifest: "priv/static/cache_manifest.json" | ||
|
||
# Do not print debug messages in production | ||
config :logger, level: :info | ||
|
||
# ## SSL Support | ||
# | ||
# To get SSL working, you will need to add the `https` key | ||
# to the previous section and set your `:url` port to 443: | ||
# | ||
# config :heborn_migration, HEBornMigration.Web.Endpoint, | ||
# ... | ||
# url: [host: "example.com", port: 443], | ||
# https: [:inet6, | ||
# port: 443, | ||
# keyfile: System.get_env("SOME_APP_SSL_KEY_PATH"), | ||
# certfile: System.get_env("SOME_APP_SSL_CERT_PATH")] | ||
# | ||
# Where those two env variables return an absolute path to | ||
# the key and cert in disk or a relative path inside priv, | ||
# for example "priv/ssl/server.key". | ||
# | ||
# We also recommend setting `force_ssl`, ensuring no data is | ||
# ever sent via http, always redirecting to https: | ||
# | ||
# config :heborn_migration, HEBornMigration.Web.Endpoint, | ||
# force_ssl: [hsts: true] | ||
# | ||
# Check `Plug.SSL` for all available options in `force_ssl`. | ||
|
||
# ## Using releases | ||
# | ||
# If you are doing OTP releases, you need to instruct Phoenix | ||
# to start the server for all endpoints: | ||
# | ||
# config :phoenix, :serve_endpoints, true | ||
# | ||
# Alternatively, you can configure exactly which server to | ||
# start per endpoint: | ||
# | ||
# config :heborn_migration, HEBornMigration.Web.Endpoint, server: true | ||
# | ||
|
||
# Finally import the config/prod.secret.exs | ||
# which should be versioned separately. | ||
import_config "prod.secret.exs" |
Oops, something went wrong.