Browse files

Big bang no. 2 💥

  • Loading branch information...
rrrene committed May 20, 2016
1 parent 546485c commit 242308620312a6ca17b9f35c66ad5e99a631d9cb
Showing 303 changed files with 13,900 additions and 3 deletions.
@@ -0,0 +1,27 @@
# App artifacts
# Generate on crash by the VM
# Static artifacts
# Since we are building assets from web/static,
# we ignore priv/static. You may want to comment
# this depending on your deployment strategy.
# The config/prod.secret.exs file by default contains sensitive
# data and you should not commit it into version control.
# Alternatively, you may comment the line below and commit the
# secrets file as long as you replace its contents by environment
# variables.
@@ -1,5 +1,5 @@
# HexFaktor
# HexFaktor Website
This will become the open sourced repo of the webservice.
This is the Phoenix app that runs
**FOR NOW** this serves as [Issue Tracker for the Beta](
Please report any issue, so we can improve this service together.
@@ -0,0 +1,69 @@
exports.config = {
// See for docs.
files: {
javascripts: {
joinTo: "js/app.js"
// To use a separate vendor.js bundle, specify two files path
// joinTo: {
// "js/app.js": /^(web\/static\/js)/,
// "js/vendor.js": /^(web\/static\/vendor)|(deps)/
// }
// To change the order of concatenation of files, explicitly mention here
// order: {
// before: [
// "web/static/vendor/js/jquery-2.1.1.js",
// "web/static/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 "/web/static/assets". Files in this directory
// will be copied to `paths.public`, which is "priv/static" by default.
assets: /^(web\/static\/assets)/
// Phoenix paths configuration
paths: {
// Dependencies and current project directories to watch
watched: [
// Where to compile files to
public: "priv/static"
// Configure your plugins
plugins: {
babel: {
// Do not use ES6 compiler in vendor code
ignore: [/web\/static\/vendor/]
modules: {
autoRequire: {
"js/app.js": ["web/static/js/app"],
"js\\app.js": ["web/static/js/app"]
npm: {
enabled: true,
whitelist: ["phoenix", "phoenix_html"]
@@ -0,0 +1,42 @@
# 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
config :hex_faktor, tool_dir: Path.join([System.cwd!, "dockertools"])
config :hex_faktor, code_dirname: "code"
config :hex_faktor, eval_dirname: "eval"
config :hex_faktor, git_hub_auth_module: GitHubAuth
config :hex_faktor, git_hub_api_module: GitHubAPI
# Configures the endpoint
config :hex_faktor, HexFaktor.Endpoint,
url: [host: "localhost"],
root: Path.dirname(__DIR__),
secret_key_base: "k9cPX7yvi0NGHhGiAqcjGeg6hkZaxuzhU/bMFsVspW/GiPI8kkz5tfdZJOzGpILw",
render_errors: [accepts: ~w(html json)],
pubsub: [name: HexFaktor.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"
# Configure phoenix generators
config :phoenix, :generators,
migration: true,
binary_id: false
config :hex_faktor, mailgun_domain: "",
mailgun_key: "key-##############"
config :hex_faktor, :hex_faktor_repo_url, ""
@@ -0,0 +1,62 @@
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 to recompile .js and .css sources.
config :hex_faktor, HexFaktor.Endpoint,
http: [port: 4000],
debug_errors: true,
code_reloader: true,
cache_static_lookup: false,
check_origin: false,
watchers: [node: ["node_modules/brunch/bin/brunch", "watch", "--stdin"]]
# Watch static and templates for browser reloading.
config :hex_faktor, HexFaktor.Endpoint,
live_reload: [
patterns: [
# Do not include metadata nor timestamps in development logs
config :logger, :console, format: "[$level] $message\n"
# Set a higher stacktrace during development.
# Do not configure such in production as keeping
# and calculating stacktraces is usually expensive.
config :phoenix, :stacktrace_depth, 20
# Configure your database
config :hex_faktor, HexFaktor.Repo,
adapter: Ecto.Adapters.Postgres,
username: "postgres",
password: "postgres",
database: "hex_faktor_dev",
hostname: "localhost",
pool_size: 10
config :hex_faktor, userid_inside_docker: 1000
config :hex_faktor, work_dir: Path.join([System.cwd!, "..", "hex_faktor-workdir"])
config :hex_faktor, :base_url, "http://localhost:4000"
config :hex_faktor, :salt_user_socket, "salt goes here"
config :hex_faktor, :salt_email_token, "salt goes here"
config :hex_faktor, :worker_pool_size, 100
config :hex_faktor, :worker_pool_overflow, 100
config :hex_faktor, :mailgun,
domain: "",
key: "something",
mode: :test,
test_file_path: "/tmp/mailgun.json"
import_config "dev.secret.exs"
@@ -0,0 +1,65 @@
use Mix.Config
# For production, we configure the host to read the PORT
# from the system environment. Therefore, you will need
# to set PORT=80 before running your server.
# You should also configure the url host to something
# meaningful, we use this information when generating URLs.
# Finally, we also include the path to a 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 :hex_faktor, HexFaktor.Endpoint,
http: [port: {:system, "PORT"}],
url: [host: "", port: 80],
cache_static_manifest: "priv/static/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 :hex_faktor, HexFaktor.Endpoint,
# ...
# url: [host: "", port: 443],
# https: [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 :hex_faktor, HexFaktor.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 :hex_faktor, HexFaktor.Endpoint, server: true
# You will also need to set the application root to `.` in order
# for the new static assets to be served after a hot upgrade:
# config :hex_faktor, HexFaktor.Endpoint, root: "."
# Finally import the config/prod.secret.exs
# which should be versioned separately.
import_config "prod.secret.exs"
@@ -0,0 +1,39 @@
use Mix.Config
# We don't run a server during test. If one is required,
# you can enable the server option below.
config :hex_faktor, HexFaktor.Endpoint,
http: [port: 4001],
server: false
# Print only warnings and errors during test
config :logger, level: :warn
config :hex_faktor, userid_inside_docker: 1000
config :hex_faktor, work_dir: Path.join([System.cwd!, "..", "hex_faktor-workdir"])
config :hex_faktor, git_hub_auth_module: GitHubAuthMock
config :hex_faktor, git_hub_api_module: GitHubAPIMock
# Configure your database
config :hex_faktor, HexFaktor.Repo,
adapter: Ecto.Adapters.Postgres,
username: "postgres",
password: "postgres",
database: "hex_faktor_test",
hostname: "localhost",
pool: Ecto.Adapters.SQL.Sandbox
config :hex_faktor, :base_url, ""
config :hex_faktor, :salt_user_socket, "salt goes here"
config :hex_faktor, :salt_email_token, "salt goes here"
config :hex_faktor, :worker_pool_size, 2
config :hex_faktor, :worker_pool_overflow, 1
config :hex_faktor, :mailgun,
domain: "",
key: "something",
mode: :test,
test_file_path: "/tmp/mailgun.json"
@@ -0,0 +1,25 @@
FROM otp-18.0-ex-1.1.0
# =========
# refaktor/dockertools/bin will be mounted here
ENV PATH /tools/bin:$PATH
# ADD faktor USER
# ==============
RUN mkdir -p /home/faktor
RUN groupadd -r faktor -g 1000 && useradd -u 1000 -r -g faktor -d /home/faktor -s /sbin/nologin -c "Docker image user" faktor && chown -R faktor:faktor /home/faktor
ENV HOME /home/faktor
USER faktor
RUN mix local.hex --force
RUN mix local.rebar --force
RUN mix
# Goto mounted code directory
# ===========================
WORKDIR /job/code
@@ -0,0 +1,30 @@
FROM phusion/baseimage:0.9.16
RUN echo /root > /etc/container_environment/HOME
# Use baseimage-docker's init system.
CMD ["/sbin/my_init"]
# Set the locale
RUN locale-gen en_US.UTF-8
# See :
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
# update and install some software requirements
RUN apt-get update && apt-get upgrade -y && apt-get install -y curl wget git make
# ADD faktor USER
# ==============
RUN mkdir -p /home/faktor
RUN groupadd -r faktor -g 1000 && useradd -u 1000 -r -g faktor -d /home/faktor -s /sbin/nologin -c "Docker image user" faktor && chown -R faktor:faktor /home/faktor
#USER faktor
Oops, something went wrong.

0 comments on commit 2423086

Please sign in to comment.