boot: guard VMARGS_PATH and SYSCONFIG_PATH from recursive calls

... or confused users setting them to the same location where
we expect to write the transient copy.

#!/bin/sh

set -e

# Set VERBOSE to enable verbose logging of the boot script
#VERBOSE=true
if [ ! -z $DEBUG_BOOT ]; then
    set -x
fi;

my_readlink_f() {
    TARGET_FILE="$1"
    cd $(dirname "$TARGET_FILE")
    TARGET_FILE=$(basename "$TARGET_FILE")

    # Iterate down a (possible) chain of symlinks
    while [ -L "$TARGET_FILE" ]
    do
        TARGET_FILE=$(readlink "$TARGET_FILE")
        cd $(dirname "$TARGET_FILE")
        TARGET_FILE=$(basename "$TARGET_FILE")
    done
    # Compute the canonicalized name by finding the physical path
    # for the directory we're in and appending the target file.
    PHYS_DIR=$(pwd -P)
    RESULT="$PHYS_DIR/$TARGET_FILE"
    echo "$RESULT"
}

# Path to this script
if uname | grep -q 'Darwin'; then
  # on OSX, best to install coreutils from homebrew or similar
  # to get greadlink
  if command -v greadlink >/dev/null 2>&1; then
    SCRIPT=$(greadlink -f "$0")
  else
    SCRIPT=$(my_readlink_f "$0" )
  fi
else
  SCRIPT=$(readlink -f "$0" )
fi

# Parent directory of this script
SCRIPT_DIR=$(dirname "${SCRIPT}")
# Root directory of all releases
RELEASE_ROOT_DIR=$(dirname $(dirname ${SCRIPT_DIR}))

# Disable flow control for run_erl
# Flow control can cause several problems. On Linux, if you
# accidentally hit Ctrl-S (instead of Ctrl-D to detach) and
# then some other key, the entire beam process will hang when
# attempting to write to stdout. On Solaris, the beam process
# will hang on writing if ScrollLock is on.
RUN_ERL_DISABLE_FLOWCNTRL="${RUN_ERL_DISABLE_FLOWCNTRL:-true}"
# Name of the release
REL_NAME="<%= release_name %>"
# Current version of the release
REL_VSN="<%= release_version %>"
# Current version of ERTS being used
# If this is not present/unset, it will be detected
<%= unless is_nil(erts_vsn) do %>ERTS_VSN="<%= erts_vsn %>"<% end %>
# VM code loading mode, embedded by default, can also be interactive
# See http://erlang.org/doc/man/code.html
CODE_LOADING_MODE="${CODE_LOADING_MODE:-embedded}"
# Path to start_erl.data
START_ERL_DATA="$RELEASE_ROOT_DIR/releases/start_erl.data"
# Directory containing the current version of this release
REL_DIR="$RELEASE_ROOT_DIR/releases/$REL_VSN"
# The lib directory for this release
REL_LIB_DIR="$RELEASE_ROOT_DIR/lib"
# Options passed to erl
ERL_OPTS="<%= release.profile.erl_opts %>"
# When stdout is piped to a file, this is the directory those files will
# be stored in. defaults to /log in the release root directory

# RELEASE_MUTABLE_DIR
RELEASE_MUTABLE_DIR="${RELEASE_MUTABLE_DIR:-$RELEASE_ROOT_DIR/var}"

RUNNER_LOG_DIR="${RUNNER_LOG_DIR:-$RELEASE_MUTABLE_DIR/log}"
# A string of extra options to pass to erl, here for plugins
EXTRA_OPTS=""

# Pre-start/stop event hook paths
PRE_START_HOOK="$REL_DIR/hooks/pre_start"
POST_START_HOOK="$REL_DIR/hooks/post_start"
PRE_STOP_HOOK="$REL_DIR/hooks/pre_stop"
POST_STOP_HOOK="$REL_DIR/hooks/post_stop"

# Get node pid
get_pid() {
    if output="$(nodetool rpcterms os getpid)"
    then
        echo "$output" | sed -e 's/"//g'
        return 0
    else
        echo "$output"
        return 1
    fi
}

# Generate a unique nodename
gen_nodename() {
    id="longname$(gen_id)-${NAME}"
    "$BINDIR/erl" -boot start_clean -eval '[Host] = tl(string:tokens(atom_to_list(node()),"@")), io:format("~s~n", [Host]), halt()' -noshell ${NAME_TYPE} $id
}

# Generate a random id
gen_id() {
    od -t x -N 4 /dev/urandom | head -n1 | awk '{print $2}'
}

# Control a node
# Use like `nodetool "ping"`
nodetool() {
    command="$1"; shift

    "$ERTS_DIR/bin/escript" "$ROOTDIR/bin/nodetool" "$NAME_TYPE" "$NAME" \
                            -setcookie "$COOKIE" "$command" $@
}

# Run an escript in the node's environment
# Use like `escript "path/to/escript"`
escript() {
    shift; scriptpath="$1"; shift
    export RELEASE_ROOT_DIR

    "$ERTS_DIR/bin/escript" "$ROOTDIR/$scriptpath" $@
}

# Private. For determining the version of ERTS available to the release
_detect_erts_vsn() {
    "$BINDIR/erl" -boot start_clean -eval 'Ver = erlang:system_info(version), io:format("~s~n", [Ver]), halt()' -noshell
}

# Private. Gets a list of code paths for this release
_get_code_paths() {
    "$ERTS_DIR/bin/escript" "$ROOTDIR/bin/release_utils.escript" "get_code_paths" "$ROOTDIR" "$ERTS_DIR" "$REL_DIR" "$REL_NAME"
}

# Private. For setting ERTS_DIR and ROOTDIR
_find_erts_dir() {
    __erts_dir="$RELEASE_ROOT_DIR/erts-$ERTS_VSN"
    if [ -d "$__erts_dir" ]; then
        ERTS_DIR="$__erts_dir";
        ROOTDIR="$RELEASE_ROOT_DIR"
    else
        __erl="$(which erl)"
        code="io:format(\"~s\", [code:root_dir()]), halt()."
        __erl_root="$("$__erl" -noshell -eval "$code")"
        ERTS_DIR="$__erl_root/erts-$ERTS_VSN"
        ROOTDIR="$__erl_root"
    fi
}

# Private. Open a shell on a remote node
_rem_sh() {
    # Generate a unique id used to allow multiple remsh to the same node
    # transparently
    id="remsh$(gen_id)-${NAME}"

    # Get the node's ticktime so that we use the same thing.
    TICKTIME="$(nodetool rpcterms net_kernel get_net_ticktime)"

    # Setup remote shell command to control node
    if [ ! -z "$USE_ERL_SHELL" ]; then
        exec "$BINDIR/erl" \
            -hidden \
            -boot start_clean -boot_var ERTS_LIB_DIR "$ERTS_LIB_DIR" \
            -kernel net_ticktime $TICKTIME \
            "$NAME_TYPE" "$id" -remsh "$NAME" -setcookie "$COOKIE"
    else
        __code_paths=$(_get_code_paths)
        exec "$BINDIR/erl" \
            -pa "$CONSOLIDATED_DIR" \
            ${__code_paths} \
            -hidden -noshell \
            -boot start_clean -boot_var ERTS_LIB_DIR "$ERTS_LIB_DIR" \
            -kernel net_ticktime $TICKTIME \
            -user Elixir.IEx.CLI "$NAME_TYPE" "$id" -setcookie "$COOKIE" \
            -extra --no-halt +iex -"$NAME_TYPE" "$id" --cookie "$COOKIE" --remsh "$NAME"
    fi
}

# Output a start command for the last argument of run_erl
_start_command() {
    printf "exec \"%s\" \"%s\" -- %s %s" "$RELEASE_ROOT_DIR/bin/$REL_NAME" \
           "$START_OPTION" "${ARGS}" "${EXTRA_OPTS}"
}

# Do a textual replacement of ${VAR} occurances in $1 and pipe to $2
_replace_os_vars() {
    awk '
        function escape(s) {
            gsub(/'\&'/, "\\\\&", s);
            return s;
        }
        {
            while(match($0,"[$]{[^}]*}")) {
                var=substr($0,RSTART+2,RLENGTH-3);
                gsub("[$]{"var"}", escape(ENVIRON[var]))
            }
        }1' < "$1" > "$2"
}

# If ERTS_VSN is not set, detect it
if [ -z "$ERTS_VSN" ]; then
    ERTS_VSN="$(_detect_erts_vsn)"
    echo "$ERTS_VSN $REL_VSN" > "$START_ERL_DATA"
fi

# Allow override of where to read configuration from
# By default it's RELEASE_ROOT_DIR
if [ -z "$RELEASE_CONFIG_DIR" ]; then
    RELEASE_CONFIG_DIR="$RELEASE_ROOT_DIR"
fi

# Make sure directories exist
mkdir -p "$RELEASE_MUTABLE_DIR"
echo "Files in this directory are regenerated frequently, edits will be lost" \
    > "$RELEASE_MUTABLE_DIR/WARNING_README"
mkdir -p "$RUNNER_LOG_DIR"

# Set VMARGS_PATH, the path to the vm.args file to use
# Use $RELEASE_CONFIG_DIR/vm.args if exists, otherwise releases/VSN/vm.args
if [ -z "$VMARGS_PATH" ]; then
    if [ -f "$RELEASE_CONFIG_DIR/vm.args" ]; then
        VMARGS_PATH="$RELEASE_CONFIG_DIR/vm.args"
    else
        VMARGS_PATH="$REL_DIR/vm.args"
    fi
fi
if [ "$VMARGS_PATH" != "$RELEASE_MUTABLE_DIR/vm.args" ]; then
    echo "#### Generated - edit/create $RELEASE_CONFIG_DIR/vm.args instead." \
        >  "$RELEASE_MUTABLE_DIR/vm.args"
    cat  "$VMARGS_PATH"                              \
        >> "$RELEASE_MUTABLE_DIR/vm.args"
    VMARGS_PATH=$RELEASE_MUTABLE_DIR/vm.args
fi
if [ $REPLACE_OS_VARS ]; then
    _replace_os_vars "$orig_vmargs_path" "$VMARGS_PATH"
fi

# Set SYS_CONFIG_PATH, the path to the sys.config file to use
# Use $RELEASE_CONFIG_DIR/sys.config if exists, otherwise releases/VSN/sys.config
if [ -z "$SYS_CONFIG_PATH" ]; then
    if [ -f "$RELEASE_CONFIG_DIR/sys.config" ]; then
        SYS_CONFIG_PATH="$RELEASE_CONFIG_DIR/sys.config"
    else
        SYS_CONFIG_PATH="$REL_DIR/sys.config"
    fi
fi
if [ "$SYS_CONFIG_PATH" != "$RELEASE_MUTABLE_DIR/sys.config" ]; then
    echo "%% Generated - edit/create $RELEASE_CONFIG_DIR/sys.config instead." \
        >  "$RELEASE_MUTABLE_DIR/sys.config"
    cat  "$SYS_CONFIG_PATH"                              \
        >> "$RELEASE_MUTABLE_DIR/sys.config"
    SYS_CONFIG_PATH=$RELEASE_MUTABLE_DIR/sys.config
fi
if [ $REPLACE_OS_VARS ]; then
    _replace_os_vars "$orig_sys_config_path" "$SYS_CONFIG_PATH"
fi

# Extract the target node name from node.args
# Should be `-sname somename` or `-name somename@somehost`
NAME_ARG=$(egrep '^-s?name' "$VMARGS_PATH" || true)
if [ -z "$NAME_ARG" ]; then
    echo "vm.args needs to have either -name or -sname parameter."
    exit 1
fi

# Extract the name type and name from the NAME_ARG for REMSH
# NAME_TYPE should be -name or -sname
NAME_TYPE="$(echo "$NAME_ARG" | awk '{print $1}')"
# NAME will be either `somename` or `somename@somehost`
NAME="$(echo "$NAME_ARG" | awk '{print $2}')"

# Where the pipe will be stored when using `start`
# This is used so you can attach the running application to the current
# shell using `attach`
PIPE_DIR="${PIPE_DIR:-$RELEASE_MUTABLE_DIR/erl_pipes/$NAME/}"

# Extract the target cookie
COOKIE_ARG="$(grep '^-setcookie' "$VMARGS_PATH" || true)"
DEFAULT_COOKIE_FILE="$HOME/.erlang.cookie"
if [ -z "$COOKIE_ARG" ]; then
    if [ -f "$DEFAULT_COOKIE_FILE" ]; then
        COOKIE="$(cat "$DEFAULT_COOKIE_FILE")"
    else
        printf "a secret cookie must be provided in one of the following ways:\n  - with vm.args using the -setcookie parameter,\n  or\n  by writing the cookie to '$DEFAULT_COOKIE_FILE', with permissions set to 0400"
        exit 1
    fi
else
    # Extract cookie name from COOKIE_ARG
    COOKIE="$(echo "$COOKIE_ARG" | awk '{print $2}')"
fi

_find_erts_dir
export ROOTDIR="$RELEASE_ROOT_DIR"
export BINDIR="$ERTS_DIR/bin"
export EMU="beam"
export PROGNAME="erl"
export LD_LIBRARY_PATH="$ERTS_DIR/lib:$LD_LIBRARY_PATH"
ERTS_LIB_DIR="$ERTS_DIR/../lib"
CONSOLIDATED_DIR="$ROOTDIR/lib/${REL_NAME}-${REL_VSN}/consolidated"

cd "$ROOTDIR"

# User can specify an sname without @hostname
# This will fail when creating remote shell
# So here we check for @ and add @hostname if missing
case $NAME in
    *@*)
        # Nothing to do
        ;;
    *)
        NAME=$NAME@$(gen_nodename)
        ;;
esac

# Check the first argument for instructions
case "$1" in
    start|start_boot)

        # Make sure there is not already a node running
        #RES=`$NODETOOL ping`
        #if [ "$RES" = "pong" ]; then
        #    echo "Node is already running!"
        #    exit 1
        #fi
        # Save this for later.
        CMD=$1
        case "$1" in
            start)
                shift
                START_OPTION="console"
                HEART_OPTION="start"
                ;;
            start_boot)
                shift
                START_OPTION="console_boot"
                HEART_OPTION="start_boot"
                ;;
        esac
        ARGS="$@"
        RUN_PARAM="$@"

        [ -f "$PRE_START_HOOK" ] && . "$PRE_START_HOOK"

        # Set arguments for the heart command
        set -- "$SCRIPT_DIR/$REL_NAME" "$HEART_OPTION"
        [ "$RUN_PARAM" ] && set -- "$@" "$RUN_PARAM"

        # Export the HEART_COMMAND
        HEART_COMMAND="$RELEASE_ROOT_DIR/bin/$REL_NAME $CMD"
        export HEART_COMMAND

        mkdir -p "$PIPE_DIR"

        "$BINDIR/run_erl" -daemon "$PIPE_DIR" "$RUNNER_LOG_DIR" \
                          "$(_start_command)"

        [ -f "$POST_START_HOOK" ] && . "$POST_START_HOOK"
        ;;

    stop)
        [ -f "$PRE_STOP_HOOK" ] && . "$PRE_STOP_HOOK"
        # Wait for the node to completely stop...
        PID="$(get_pid)"
        if ! nodetool "stop"; then
            exit 1
        fi
        while $(kill -s 0 "$PID" 2>/dev/null);
        do
            sleep 1
        done
        [ -f "$POST_STOP_HOOK" ] && . "$POST_STOP_HOOK"
        ;;

    restart)
        [ -f "$PRE_START_HOOK" ] && . "$PRE_START_HOOK"
        ## Restart the VM without exiting the process
        if ! nodetool "restart"; then
            exit 1
        fi
        ;;

    reboot)
        [ -f "$PRE_START_HOOK" ] && . "$PRE_START_HOOK"
        ## Restart the VM completely (uses heart to restart it)
        if ! nodetool "reboot"; then
            exit 1
        fi
        ;;

    pid)
        ## Get the VM's pid
        if ! get_pid; then
            exit 1
        fi
        ;;

    ping)
        ## See if the VM is alive
        if ! nodetool "ping"; then
            exit 1
        fi
        ;;

    escript)
        ## Run an escript under the node's environment
        if ! escript $@; then
            exit 1
        fi
        ;;

    attach)
        # Make sure a node IS running
        if ! nodetool "ping" > /dev/null; then
            echo "Node is not running!"
            exit 1
        fi

        shift
        exec "$BINDIR/to_erl" "$PIPE_DIR"
        ;;

    remote_console)
        # Make sure a node IS running
        if ! nodetool "ping" > /dev/null; then
            echo "Node is not running!"
            exit 1
        fi

        shift
        _rem_sh
        ;;

    upgrade|downgrade|install)
        if [ -z "$2" ]; then
            echo "Missing package argument"
            echo "Usage: $REL_NAME $1 {package base name}"
            echo "NOTE {package base name} MUST NOT include the .tar.gz suffix"
            exit 1
        fi

        # Make sure a node IS running
        if ! nodetool "ping" > /dev/null; then
            echo "Node is not running!"
            exit 1
        fi

        exec "$BINDIR/escript" "$ROOTDIR/bin/install_upgrade.escript" \
             "install" "$REL_NAME" "$NAME_TYPE" "$NAME" "$COOKIE" "$2"
        ;;

    unpack)
        if [ -z "$2" ]; then
            echo "Missing package argument"
            echo "Usage: $REL_NAME $1 {package base name}"
            echo "NOTE {package base name} MUST NOT include the .tar.gz suffix"
            exit 1
        fi

        # Make sure a node IS running
        if ! nodetool "ping" > /dev/null; then
            echo "Node is not running!"
            exit 1
        fi

        exec "$BINDIR/escript" "$ROOTDIR/bin/install_upgrade.escript" \
             "unpack" "$REL_NAME" "$NAME_TYPE" "$NAME" "$COOKIE" "$2"
        ;;

    console|console_clean|console_boot)
        # .boot file typically just $REL_NAME (ie, the app name)
        # however, for debugging, sometimes start_clean.boot is useful.
        # For e.g. 'setup', one may even want to name another boot script.
        case "$1" in
            console)
                if [ -f "$REL_DIR/$REL_NAME.boot" ]; then
                  BOOTFILE="$REL_DIR/$REL_NAME"
                else
                  BOOTFILE="$REL_DIR/start"
                fi
                ;;
            console_clean)
                BOOTFILE="$ROOTDIR/bin/start_clean"
                ;;
            console_boot)
                shift
                BOOTFILE="$1"
                shift
                ;;
        esac
        # Setup beam-required vars
        EMU="beam"
        PROGNAME="${0#*/}"

        export EMU
        export PROGNAME

        # Store passed arguments since they will be erased by `set`
        ARGS="$@"

        # Start the VM, executing pre_start hook along
        # the way. We can't run the post_start hook because
        # the console will crash with no TTY attached
        [ -f "$PRE_START_HOOK" ] && . "$PRE_START_HOOK"

        __code_paths=$(_get_code_paths)
        # Build an array of arguments to pass to exec later on
        # Build it here because this command will be used for logging.
        set -- "$BINDIR/erlexec" \
            -boot "$BOOTFILE" \
            -boot_var ERTS_LIB_DIR "$ERTS_LIB_DIR" \
            -env ERL_LIBS "$REL_LIB_DIR" \
            -pa "$CONSOLIDATED_DIR" \
            ${__code_paths} \
            -args_file "$VMARGS_PATH" \
            -config "$SYS_CONFIG_PATH" \
            -mode "$CODE_LOADING_MODE" \
            ${ERL_OPTS} \
            -user Elixir.IEx.CLI \
            -extra --no-halt +iex

        # Dump environment info for logging purposes
        if [ ! -z $VERBOSE ]; then
            echo "Exec: $@" -- ${1+$ARGS} ${EXTRA_OPTS}
            echo "Root: $ROOTDIR"

            # Log the startup
            echo "$RELEASE_ROOT_DIR"
        fi;

        logger -t "$REL_NAME[$$]" "Starting up"

        exec "$@" -- ${1+$ARGS} ${EXTRA_OPTS}
        ;;

    foreground)
        # start up the release in the foreground for use by runit
        # or other supervision services

        [ -f "$REL_DIR/$REL_NAME.boot" ] && BOOTFILE="$REL_NAME" || BOOTFILE=start
        FOREGROUNDOPTIONS="-noshell -noinput +Bd"

        # Setup beam-required vars
        EMU=beam
        PROGNAME="${0#*/}"

        export EMU
        export PROGNAME

        # Store passed arguments since they will be erased by `set`
        ARGS="$@"

        # Start the VM, executing pre and post start hooks
        [ -f "$PRE_START_HOOK" ] && . "$PRE_START_HOOK"

        # Build an array of arguments to pass to exec later on
        # Build it here because this command will be used for logging.
        set -- "$BINDIR/erlexec" $FOREGROUNDOPTIONS \
            -boot "$REL_DIR/$BOOTFILE" \
            -boot_var ERTS_LIB_DIR "$ERTS_LIB_DIR" \
            -env ERL_LIBS "$REL_LIB_DIR" \
            -pa "$CONSOLIDATED_DIR" \
            -args_file "$VMARGS_PATH" \
            -config "$SYS_CONFIG_PATH" \
            -mode "$CODE_LOADING_MODE" \
            ${ERL_OPTS} \
            -extra ${EXTRA_OPTS}

        # Dump environment info for logging purposes
        if [ ! -z $VERBOSE ]; then
            echo "Exec: $@" -- ${1+$ARGS}
            echo "Root: $ROOTDIR"
        fi;

        "$@" -- ${1+$ARGS} &
        __bg_pid=$!
        [ -f "$POST_START_HOOK" ] && . "$POST_START_HOOK"
        wait $__bg_pid
        ;;
    rpc)
        # Make sure a node IS running
        if ! nodetool "ping" > /dev/null; then
            echo "Node is not running!"
            exit 1
        fi

        shift

        nodetool rpc $@
        ;;
    rpcterms)
        # Make sure a node IS running
        if ! nodetool "ping" > /dev/null; then
            echo "Node is not running!"
            exit 1
        fi

        shift

        nodetool rpcterms $@
        ;;
    eval)
        # Make sure a node IS running
        if ! nodetool "ping" > /dev/null; then
            echo "Node is not running!"
            exit 1
        fi

        shift
        nodetool "eval" $@
        ;;
    command)
        # Execute as command-line utility
        #
        # Like the escript command, this does not start the OTP application.
        # If your command depends on a running OTP application,
        # use
        #
        #     {:ok, _} = Application.ensure_all_started(:your_app)

        shift
        MODULE="$1"; shift
        FUNCTION="$1"; shift

        # Save extra arguments
        ARGS="$@"

        # Build arguments for erlexec
        set -- "$ERL_OPTS"
        [ "$SYS_CONFIG_PATH" ] && set -- "$@" -config "$SYS_CONFIG_PATH"
        set -- "$@" -boot_var ERTS_LIB_DIR "$ERTS_LIB_DIR"
        set -- "$@" -noshell
        set -- "$@" -boot start_clean
        set -- "$@" -s "$MODULE" "$FUNCTION"

        $BINDIR/erlexec $@ -extra $ARGS
        exit "$?"
        ;;
    *)
        __command_path="$REL_DIR/commands/$1"
        if [ -f "$__command_path" ]; then
            . "$__command_path"
        else
            echo "Usage: $REL_NAME {start|start_boot <file>|foreground|stop|restart|reboot|pid|ping|console|console_clean|console_boot <file>|attach|remote_console|upgrade|downgrade|install|escript|rpc|rpcterms|eval|command <module> <function> <args>}"
            exit 1
        fi
        ;;
esac

exit 0

#!/bin/sh

set -e

# Set VERBOSE to enable verbose logging of the boot script
#VERBOSE=true
if [ ! -z $DEBUG_BOOT ]; then
    set -x
fi;

my_readlink_f() {
    TARGET_FILE="$1"
    cd $(dirname "$TARGET_FILE")
    TARGET_FILE=$(basename "$TARGET_FILE")

    # Iterate down a (possible) chain of symlinks
    while [ -L "$TARGET_FILE" ]
    do
        TARGET_FILE=$(readlink "$TARGET_FILE")
        cd $(dirname "$TARGET_FILE")
        TARGET_FILE=$(basename "$TARGET_FILE")
    done
    # Compute the canonicalized name by finding the physical path
    # for the directory we're in and appending the target file.
    PHYS_DIR=$(pwd -P)
    RESULT="$PHYS_DIR/$TARGET_FILE"
    echo "$RESULT"
}

# Path to this script
if uname | grep -q 'Darwin'; then
  # on OSX, best to install coreutils from homebrew or similar
  # to get greadlink
  if command -v greadlink >/dev/null 2>&1; then
    SCRIPT=$(greadlink -f "$0")
  else
    SCRIPT=$(my_readlink_f "$0" )
  fi
else
  SCRIPT=$(readlink -f "$0" )
fi

# Parent directory of this script
SCRIPT_DIR=$(dirname "${SCRIPT}")
# Root directory of all releases
RELEASE_ROOT_DIR=$(dirname $(dirname ${SCRIPT_DIR}))

# Disable flow control for run_erl
# Flow control can cause several problems. On Linux, if you
# accidentally hit Ctrl-S (instead of Ctrl-D to detach) and
# then some other key, the entire beam process will hang when
# attempting to write to stdout. On Solaris, the beam process
# will hang on writing if ScrollLock is on.
RUN_ERL_DISABLE_FLOWCNTRL="${RUN_ERL_DISABLE_FLOWCNTRL:-true}"
# Name of the release
REL_NAME="<%= release_name %>"
# Current version of the release
REL_VSN="<%= release_version %>"
# Current version of ERTS being used
# If this is not present/unset, it will be detected
<%= unless is_nil(erts_vsn) do %>ERTS_VSN="<%= erts_vsn %>"<% end %>
# VM code loading mode, embedded by default, can also be interactive
# See http://erlang.org/doc/man/code.html
CODE_LOADING_MODE="${CODE_LOADING_MODE:-embedded}"
# Path to start_erl.data
START_ERL_DATA="$RELEASE_ROOT_DIR/releases/start_erl.data"
# Directory containing the current version of this release
REL_DIR="$RELEASE_ROOT_DIR/releases/$REL_VSN"
# The lib directory for this release
REL_LIB_DIR="$RELEASE_ROOT_DIR/lib"
# Options passed to erl
ERL_OPTS="<%= release.profile.erl_opts %>"
# When stdout is piped to a file, this is the directory those files will
# be stored in. defaults to /log in the release root directory

# RELEASE_MUTABLE_DIR
RELEASE_MUTABLE_DIR="${RELEASE_MUTABLE_DIR:-$RELEASE_ROOT_DIR/var}"

RUNNER_LOG_DIR="${RUNNER_LOG_DIR:-$RELEASE_MUTABLE_DIR/log}"
# A string of extra options to pass to erl, here for plugins
EXTRA_OPTS=""

# Pre-start/stop event hook paths
PRE_START_HOOK="$REL_DIR/hooks/pre_start"
POST_START_HOOK="$REL_DIR/hooks/post_start"
PRE_STOP_HOOK="$REL_DIR/hooks/pre_stop"
POST_STOP_HOOK="$REL_DIR/hooks/post_stop"

# Get node pid
get_pid() {
    if output="$(nodetool rpcterms os getpid)"
    then
        echo "$output" | sed -e 's/"//g'
        return 0
    else
        echo "$output"
        return 1
    fi
}

# Generate a unique nodename
gen_nodename() {
    id="longname$(gen_id)-${NAME}"
    "$BINDIR/erl" -boot start_clean -eval '[Host] = tl(string:tokens(atom_to_list(node()),"@")), io:format("~s~n", [Host]), halt()' -noshell ${NAME_TYPE} $id
}

# Generate a random id
gen_id() {
    od -t x -N 4 /dev/urandom | head -n1 | awk '{print $2}'
}

# Control a node
# Use like `nodetool "ping"`
nodetool() {
    command="$1"; shift

    "$ERTS_DIR/bin/escript" "$ROOTDIR/bin/nodetool" "$NAME_TYPE" "$NAME" \
                            -setcookie "$COOKIE" "$command" $@
}

# Run an escript in the node's environment
# Use like `escript "path/to/escript"`
escript() {
    shift; scriptpath="$1"; shift
    export RELEASE_ROOT_DIR

    "$ERTS_DIR/bin/escript" "$ROOTDIR/$scriptpath" $@
}

# Private. For determining the version of ERTS available to the release
_detect_erts_vsn() {
    "$BINDIR/erl" -boot start_clean -eval 'Ver = erlang:system_info(version), io:format("~s~n", [Ver]), halt()' -noshell
}

# Private. Gets a list of code paths for this release
_get_code_paths() {
    "$ERTS_DIR/bin/escript" "$ROOTDIR/bin/release_utils.escript" "get_code_paths" "$ROOTDIR" "$ERTS_DIR" "$REL_DIR" "$REL_NAME"
}

# Private. For setting ERTS_DIR and ROOTDIR
_find_erts_dir() {
    __erts_dir="$RELEASE_ROOT_DIR/erts-$ERTS_VSN"
    if [ -d "$__erts_dir" ]; then
        ERTS_DIR="$__erts_dir";
        ROOTDIR="$RELEASE_ROOT_DIR"
    else
        __erl="$(which erl)"
        code="io:format(\"~s\", [code:root_dir()]), halt()."
        __erl_root="$("$__erl" -noshell -eval "$code")"
        ERTS_DIR="$__erl_root/erts-$ERTS_VSN"
        ROOTDIR="$__erl_root"
    fi
}

# Private. Open a shell on a remote node
_rem_sh() {
    # Generate a unique id used to allow multiple remsh to the same node
    # transparently
    id="remsh$(gen_id)-${NAME}"

    # Get the node's ticktime so that we use the same thing.
    TICKTIME="$(nodetool rpcterms net_kernel get_net_ticktime)"

    # Setup remote shell command to control node
    if [ ! -z "$USE_ERL_SHELL" ]; then
        exec "$BINDIR/erl" \
            -hidden \
            -boot start_clean -boot_var ERTS_LIB_DIR "$ERTS_LIB_DIR" \
            -kernel net_ticktime $TICKTIME \
            "$NAME_TYPE" "$id" -remsh "$NAME" -setcookie "$COOKIE"
    else
        __code_paths=$(_get_code_paths)
        exec "$BINDIR/erl" \
            -pa "$CONSOLIDATED_DIR" \
            ${__code_paths} \
            -hidden -noshell \
            -boot start_clean -boot_var ERTS_LIB_DIR "$ERTS_LIB_DIR" \
            -kernel net_ticktime $TICKTIME \
            -user Elixir.IEx.CLI "$NAME_TYPE" "$id" -setcookie "$COOKIE" \
            -extra --no-halt +iex -"$NAME_TYPE" "$id" --cookie "$COOKIE" --remsh "$NAME"
    fi
}

# Output a start command for the last argument of run_erl
_start_command() {
    printf "exec \"%s\" \"%s\" -- %s %s" "$RELEASE_ROOT_DIR/bin/$REL_NAME" \
           "$START_OPTION" "${ARGS}" "${EXTRA_OPTS}"
}

# Do a textual replacement of ${VAR} occurances in $1 and pipe to $2
_replace_os_vars() {
    awk '
        function escape(s) {
            gsub(/'\&'/, "\\\\&", s);
            return s;
        }
        {
            while(match($0,"[$]{[^}]*}")) {
                var=substr($0,RSTART+2,RLENGTH-3);
                gsub("[$]{"var"}", escape(ENVIRON[var]))
            }
        }1' < "$1" > "$2"
}

# If ERTS_VSN is not set, detect it
if [ -z "$ERTS_VSN" ]; then
    ERTS_VSN="$(_detect_erts_vsn)"
    echo "$ERTS_VSN $REL_VSN" > "$START_ERL_DATA"
fi

# Allow override of where to read configuration from
# By default it's RELEASE_ROOT_DIR
if [ -z "$RELEASE_CONFIG_DIR" ]; then
    RELEASE_CONFIG_DIR="$RELEASE_ROOT_DIR"
fi

# Make sure directories exist
mkdir -p "$RELEASE_MUTABLE_DIR"
echo "Files in this directory are regenerated frequently, edits will be lost" \
    > "$RELEASE_MUTABLE_DIR/WARNING_README"
mkdir -p "$RUNNER_LOG_DIR"

# Set VMARGS_PATH, the path to the vm.args file to use
# Use $RELEASE_CONFIG_DIR/vm.args if exists, otherwise releases/VSN/vm.args
if [ -z "$VMARGS_PATH" ]; then
    if [ -f "$RELEASE_CONFIG_DIR/vm.args" ]; then
        VMARGS_PATH="$RELEASE_CONFIG_DIR/vm.args"
    else
        VMARGS_PATH="$REL_DIR/vm.args"
    fi
fi
echo "#### Generated - edit/create $RELEASE_CONFIG_DIR/vm.args instead." \
    >  "$RELEASE_MUTABLE_DIR/vm.args"
cat  "$VMARGS_PATH"                              \
    >> "$RELEASE_MUTABLE_DIR/vm.args"
VMARGS_PATH=$RELEASE_MUTABLE_DIR/vm.args

if [ $REPLACE_OS_VARS ]; then
    _replace_os_vars "$orig_vmargs_path" "$VMARGS_PATH"
fi

# Set SYS_CONFIG_PATH, the path to the sys.config file to use
# Use $RELEASE_CONFIG_DIR/sys.config if exists, otherwise releases/VSN/sys.config
if [ -z "$SYS_CONFIG_PATH" ]; then
    if [ -f "$RELEASE_CONFIG_DIR/sys.config" ]; then
        SYS_CONFIG_PATH="$RELEASE_CONFIG_DIR/sys.config"
    else
        SYS_CONFIG_PATH="$REL_DIR/sys.config"
    fi
fi
echo "%% Generated - edit/create $RELEASE_CONFIG_DIR/sys.config instead." \
    >  "$RELEASE_MUTABLE_DIR/sys.config"
cat  "$SYS_CONFIG_PATH"                              \
    >> "$RELEASE_MUTABLE_DIR/sys.config"
SYS_CONFIG_PATH=$RELEASE_MUTABLE_DIR/sys.config

if [ $REPLACE_OS_VARS ]; then
    _replace_os_vars "$orig_sys_config_path" "$SYS_CONFIG_PATH"
fi

# Extract the target node name from node.args
# Should be `-sname somename` or `-name somename@somehost`
NAME_ARG=$(egrep '^-s?name' "$VMARGS_PATH" || true)
if [ -z "$NAME_ARG" ]; then
    echo "vm.args needs to have either -name or -sname parameter."
    exit 1
fi

# Extract the name type and name from the NAME_ARG for REMSH
# NAME_TYPE should be -name or -sname
NAME_TYPE="$(echo "$NAME_ARG" | awk '{print $1}')"
# NAME will be either `somename` or `somename@somehost`
NAME="$(echo "$NAME_ARG" | awk '{print $2}')"

# Where the pipe will be stored when using `start`
# This is used so you can attach the running application to the current
# shell using `attach`
PIPE_DIR="${PIPE_DIR:-$RELEASE_MUTABLE_DIR/erl_pipes/$NAME/}"

# Extract the target cookie
COOKIE_ARG="$(grep '^-setcookie' "$VMARGS_PATH" || true)"
DEFAULT_COOKIE_FILE="$HOME/.erlang.cookie"
if [ -z "$COOKIE_ARG" ]; then
    if [ -f "$DEFAULT_COOKIE_FILE" ]; then
        COOKIE="$(cat "$DEFAULT_COOKIE_FILE")"
    else
        printf "a secret cookie must be provided in one of the following ways:\n  - with vm.args using the -setcookie parameter,\n  or\n  by writing the cookie to '$DEFAULT_COOKIE_FILE', with permissions set to 0400"
        exit 1
    fi
else
    # Extract cookie name from COOKIE_ARG
    COOKIE="$(echo "$COOKIE_ARG" | awk '{print $2}')"
fi

_find_erts_dir
export ROOTDIR="$RELEASE_ROOT_DIR"
export BINDIR="$ERTS_DIR/bin"
export EMU="beam"
export PROGNAME="erl"
export LD_LIBRARY_PATH="$ERTS_DIR/lib:$LD_LIBRARY_PATH"
ERTS_LIB_DIR="$ERTS_DIR/../lib"
CONSOLIDATED_DIR="$ROOTDIR/lib/${REL_NAME}-${REL_VSN}/consolidated"

cd "$ROOTDIR"

# User can specify an sname without @hostname
# This will fail when creating remote shell
# So here we check for @ and add @hostname if missing
case $NAME in
    *@*)
        # Nothing to do
        ;;
    *)
        NAME=$NAME@$(gen_nodename)
        ;;
esac

# Check the first argument for instructions
case "$1" in
    start|start_boot)

        # Make sure there is not already a node running
        #RES=`$NODETOOL ping`
        #if [ "$RES" = "pong" ]; then
        #    echo "Node is already running!"
        #    exit 1
        #fi
        # Save this for later.
        CMD=$1
        case "$1" in
            start)
                shift
                START_OPTION="console"
                HEART_OPTION="start"
                ;;
            start_boot)
                shift
                START_OPTION="console_boot"
                HEART_OPTION="start_boot"
                ;;
        esac
        ARGS="$@"
        RUN_PARAM="$@"

        [ -f "$PRE_START_HOOK" ] && . "$PRE_START_HOOK"

        # Set arguments for the heart command
        set -- "$SCRIPT_DIR/$REL_NAME" "$HEART_OPTION"
        [ "$RUN_PARAM" ] && set -- "$@" "$RUN_PARAM"

        # Export the HEART_COMMAND
        HEART_COMMAND="$RELEASE_ROOT_DIR/bin/$REL_NAME $CMD"
        export HEART_COMMAND

        mkdir -p "$PIPE_DIR"

        "$BINDIR/run_erl" -daemon "$PIPE_DIR" "$RUNNER_LOG_DIR" \
                          "$(_start_command)"

        [ -f "$POST_START_HOOK" ] && . "$POST_START_HOOK"
        ;;

    stop)
        [ -f "$PRE_STOP_HOOK" ] && . "$PRE_STOP_HOOK"
        # Wait for the node to completely stop...
        PID="$(get_pid)"
        if ! nodetool "stop"; then
            exit 1
        fi
        while $(kill -s 0 "$PID" 2>/dev/null);
        do
            sleep 1
        done
        [ -f "$POST_STOP_HOOK" ] && . "$POST_STOP_HOOK"
        ;;

    restart)
        [ -f "$PRE_START_HOOK" ] && . "$PRE_START_HOOK"
        ## Restart the VM without exiting the process
        if ! nodetool "restart"; then
            exit 1
        fi
        ;;

    reboot)
        [ -f "$PRE_START_HOOK" ] && . "$PRE_START_HOOK"
        ## Restart the VM completely (uses heart to restart it)
        if ! nodetool "reboot"; then
            exit 1
        fi
        ;;

    pid)
        ## Get the VM's pid
        if ! get_pid; then
            exit 1
        fi
        ;;

    ping)
        ## See if the VM is alive
        if ! nodetool "ping"; then
            exit 1
        fi
        ;;

    escript)
        ## Run an escript under the node's environment
        if ! escript $@; then
            exit 1
        fi
        ;;

    attach)
        # Make sure a node IS running
        if ! nodetool "ping" > /dev/null; then
            echo "Node is not running!"
            exit 1
        fi

        shift
        exec "$BINDIR/to_erl" "$PIPE_DIR"
        ;;

    remote_console)
        # Make sure a node IS running
        if ! nodetool "ping" > /dev/null; then
            echo "Node is not running!"
            exit 1
        fi

        shift
        _rem_sh
        ;;

    upgrade|downgrade|install)
        if [ -z "$2" ]; then
            echo "Missing package argument"
            echo "Usage: $REL_NAME $1 {package base name}"
            echo "NOTE {package base name} MUST NOT include the .tar.gz suffix"
            exit 1
        fi

        # Make sure a node IS running
        if ! nodetool "ping" > /dev/null; then
            echo "Node is not running!"
            exit 1
        fi

        exec "$BINDIR/escript" "$ROOTDIR/bin/install_upgrade.escript" \
             "install" "$REL_NAME" "$NAME_TYPE" "$NAME" "$COOKIE" "$2"
        ;;

    unpack)
        if [ -z "$2" ]; then
            echo "Missing package argument"
            echo "Usage: $REL_NAME $1 {package base name}"
            echo "NOTE {package base name} MUST NOT include the .tar.gz suffix"
            exit 1
        fi

        # Make sure a node IS running
        if ! nodetool "ping" > /dev/null; then
            echo "Node is not running!"
            exit 1
        fi

        exec "$BINDIR/escript" "$ROOTDIR/bin/install_upgrade.escript" \
             "unpack" "$REL_NAME" "$NAME_TYPE" "$NAME" "$COOKIE" "$2"
        ;;

    console|console_clean|console_boot)
        # .boot file typically just $REL_NAME (ie, the app name)
        # however, for debugging, sometimes start_clean.boot is useful.
        # For e.g. 'setup', one may even want to name another boot script.
        case "$1" in
            console)
                if [ -f "$REL_DIR/$REL_NAME.boot" ]; then
                  BOOTFILE="$REL_DIR/$REL_NAME"
                else
                  BOOTFILE="$REL_DIR/start"
                fi
                ;;
            console_clean)
                BOOTFILE="$ROOTDIR/bin/start_clean"
                ;;
            console_boot)
                shift
                BOOTFILE="$1"
                shift
                ;;
        esac
        # Setup beam-required vars
        EMU="beam"
        PROGNAME="${0#*/}"

        export EMU
        export PROGNAME

        # Store passed arguments since they will be erased by `set`
        ARGS="$@"

        # Start the VM, executing pre_start hook along
        # the way. We can't run the post_start hook because
        # the console will crash with no TTY attached
        [ -f "$PRE_START_HOOK" ] && . "$PRE_START_HOOK"

        __code_paths=$(_get_code_paths)
        # Build an array of arguments to pass to exec later on
        # Build it here because this command will be used for logging.
        set -- "$BINDIR/erlexec" \
            -boot "$BOOTFILE" \
            -boot_var ERTS_LIB_DIR "$ERTS_LIB_DIR" \
            -env ERL_LIBS "$REL_LIB_DIR" \
            -pa "$CONSOLIDATED_DIR" \
            ${__code_paths} \
            -args_file "$VMARGS_PATH" \
            -config "$SYS_CONFIG_PATH" \
            -mode "$CODE_LOADING_MODE" \
            ${ERL_OPTS} \
            -user Elixir.IEx.CLI \
            -extra --no-halt +iex

        # Dump environment info for logging purposes
        if [ ! -z $VERBOSE ]; then
            echo "Exec: $@" -- ${1+$ARGS} ${EXTRA_OPTS}
            echo "Root: $ROOTDIR"

            # Log the startup
            echo "$RELEASE_ROOT_DIR"
        fi;

        logger -t "$REL_NAME[$$]" "Starting up"

        exec "$@" -- ${1+$ARGS} ${EXTRA_OPTS}
        ;;

    foreground)
        # start up the release in the foreground for use by runit
        # or other supervision services

        [ -f "$REL_DIR/$REL_NAME.boot" ] && BOOTFILE="$REL_NAME" || BOOTFILE=start
        FOREGROUNDOPTIONS="-noshell -noinput +Bd"

        # Setup beam-required vars
        EMU=beam
        PROGNAME="${0#*/}"

        export EMU
        export PROGNAME

        # Store passed arguments since they will be erased by `set`
        ARGS="$@"

        # Start the VM, executing pre and post start hooks
        [ -f "$PRE_START_HOOK" ] && . "$PRE_START_HOOK"

        # Build an array of arguments to pass to exec later on
        # Build it here because this command will be used for logging.
        set -- "$BINDIR/erlexec" $FOREGROUNDOPTIONS \
            -boot "$REL_DIR/$BOOTFILE" \
            -boot_var ERTS_LIB_DIR "$ERTS_LIB_DIR" \
            -env ERL_LIBS "$REL_LIB_DIR" \
            -pa "$CONSOLIDATED_DIR" \
            -args_file "$VMARGS_PATH" \
            -config "$SYS_CONFIG_PATH" \
            -mode "$CODE_LOADING_MODE" \
            ${ERL_OPTS} \
            -extra ${EXTRA_OPTS}

        # Dump environment info for logging purposes
        if [ ! -z $VERBOSE ]; then
            echo "Exec: $@" -- ${1+$ARGS}
            echo "Root: $ROOTDIR"
        fi;

        "$@" -- ${1+$ARGS} &
        __bg_pid=$!
        [ -f "$POST_START_HOOK" ] && . "$POST_START_HOOK"
        wait $__bg_pid
        ;;
    rpc)
        # Make sure a node IS running
        if ! nodetool "ping" > /dev/null; then
            echo "Node is not running!"
            exit 1
        fi

        shift

        nodetool rpc $@
        ;;
    rpcterms)
        # Make sure a node IS running
        if ! nodetool "ping" > /dev/null; then
            echo "Node is not running!"
            exit 1
        fi

        shift

        nodetool rpcterms $@
        ;;
    eval)
        # Make sure a node IS running
        if ! nodetool "ping" > /dev/null; then
            echo "Node is not running!"
            exit 1
        fi

        shift
        nodetool "eval" $@
        ;;
    command)
        # Execute as command-line utility
        #
        # Like the escript command, this does not start the OTP application.
        # If your command depends on a running OTP application,
        # use
        #
        #     {:ok, _} = Application.ensure_all_started(:your_app)

        shift
        MODULE="$1"; shift
        FUNCTION="$1"; shift

        # Save extra arguments
        ARGS="$@"

        # Build arguments for erlexec
        set -- "$ERL_OPTS"
        [ "$SYS_CONFIG_PATH" ] && set -- "$@" -config "$SYS_CONFIG_PATH"
        set -- "$@" -boot_var ERTS_LIB_DIR "$ERTS_LIB_DIR"
        set -- "$@" -noshell
        set -- "$@" -boot start_clean
        set -- "$@" -s "$MODULE" "$FUNCTION"

        $BINDIR/erlexec $@ -extra $ARGS
        exit "$?"
        ;;
    *)
        __command_path="$REL_DIR/commands/$1"
        if [ -f "$__command_path" ]; then
            . "$__command_path"
        else
            echo "Usage: $REL_NAME {start|start_boot <file>|foreground|stop|restart|reboot|pid|ping|console|console_clean|console_boot <file>|attach|remote_console|upgrade|downgrade|install|escript|rpc|rpcterms|eval|command <module> <function> <args>}"
            exit 1
        fi
        ;;
esac

exit 0


Updated session/new.html.eex

Updated session/new.html.eex

Changed it to not rely on changeset

Login

<%= form_for @conn, session_path(@conn, :create), [as: :session], fn f -> %>
  <%= if @changeset.action do %>

Oops, something went wrong! Please check the errors below.

  <% end %>

    <%= label f, :email, class: "control-label" %>
    <%= text_input f, :email, class: "form-control" %>
    <%= error_tag f, :email %>

    <%= label f, :password, class: "control-label" %>
    <%= password_input f, :password, class: "form-control" %>
    <%= error_tag f, :password %>

    <%= submit "Login", class: "btn btn-primary" %>

<% end %>

Login

<%= form_for @changeset, session_path(@conn, :create), fn f -> %>
  <%= if @changeset.action do %>

Oops, something went wrong! Please check the errors below.

  <% end %>

    <%= label f, :email, class: "control-label" %>
    <%= text_input f, :email, class: "form-control" %>
    <%= error_tag f, :email %>

    <%= label f, :password, class: "control-label" %>
    <%= password_input f, :password, class: "form-control" %>
    <%= error_tag f, :password %>

    <%= submit "Login", class: "btn btn-primary" %>

<% end %>


footer

footer

Panoptikum.io

META

Code of Conduct

Complaints

Community

Imprint

ABOUT

Blog

Rationale

Talks

FAQ

DEMO

Random

Podcasters

The huge podcast list

Podcast Buttons

SUPPORTED BY

Stefan a.k.a. Informatom

Community Manager Sonja

Mittenin.at

Vienna Beamers

      Hosted by Informatom EDV-Dienstleistungen e.U.


reduced search bar size to fit button in the line

  <%= render SignDict.SharedView, "navigation.html", conn: @conn, current_user: @current_user %>
  <%= render SignDict.SharedView, "alerts.html", conn: @conn %>

            <%= {:safe, gettext("SignDict is an open dictionary for sign language. Everyone is invited to join in.")} %>

            <%= gettext("Currenty %{humans} humans have added %{signs} signs", humans: @human_count, signs: @sign_count) %>

    <form action="/search">

          <input class="so-landing--search--input" type="text" name="q" autofocus="true" aria-label="<%= gettext("Enter word to search") %>"/>

          <input class="so-landing--search--submit" type="submit" value="<%= gettext("Search") %> ›" />

    </form>

            <%= gettext("Language barrier") %>

          <%= text_to_html(gettext("SignDict believes...")) %>

              <%= gettext("Our mission: to help understanding each other.") %>

            <%= gettext("Curious?") %>

            <%= gettext("Want to stay up to date?") %>

            <%= gettext("This page is still under construction and..") %>

            <%= gettext("Newsletter sign up") %> ›

      <%= gettext("Supporter") %>

      <img class="so-footer--sponsorlogo so-footer--bmbf" src="images/logo-bmbf.svg" alt="<%= gettext("Logo Bundesministerium für Bildung und Forschung") %>"/>
      <img class="so-footer--sponsorlogo so-footer--prototype" src="images/logo-prototype.svg" alt="<%= gettext("Logo Prototype Fund") %>"/>
      <img class="so-footer--sponsorlogo so-footer--rrbone" src="images/logo-rrbone.svg" alt="<%= gettext("Logo rrone") %>"/>
      <img class="so-footer--sponsorlogo so-footer--zweitag" src="images/logo-zweitag.png" alt="<%= gettext("Logo zweitag") %>"/>

          <%= gettext("SignDict is a sign language dictionary where everyone can participate") %>

<%= gettext("Blog") %>

<%= gettext("Imprint") %>

<%= gettext("Contact") %>

          <a href="//twitter.com/signdict" aria-label="<%= gettext("SignDict on Twitter") %>">
          <a href="//github.com/signdict" aria-label="<%= gettext("SignDict on Github") %>">


add button for user deletion

add button for user deletion

All users

<%= render "pager.html", conn: @conn, page: @page %>

  <%= for user <- @users do %>

        <%= tag :img, src: gravatar_url(user, 50) %>
        <%= link user.name, to: user_path(@conn, :show, user) %>

      <%= if @current_user.admin && @current_user.id != user.id do %>
        <%= link "delete", to: user_path(@conn, :delete, user),
          method: :delete, data: [confirm: "You sure?"], class: "text-danger pull-right" %>
      <% end %>

  <% end %>

<%= render "pager.html", conn: @conn, page: @page %>

All users

<%= render "pager.html", conn: @conn, page: @page %>

  <%= for user <- @users do %>

      <%= tag :img, src: gravatar_url(user, 50) %>
      <%= link user.name, to: user_path(@conn, :show, user) %>

  <% end %>

<%= render "pager.html", conn: @conn, page: @page %>


votes fix/polish

votes fix/polish

	<%= if Enum.empty?(@groups) and Enum.empty?(@is_human_votes) do %>

There are no votes here.

	<% else %>
		<%= for group <- @groups do %>

				<%= for poll <- group do %>
					<div style="margin-bottom: 12px; margin-left: <%= to_string(poll.level * 25) %>px;">
						<%= if poll.reference != nil do %>
							<%= for_choice_format(poll.reference.for_choice, poll.reference.poll.choice_type) %>
						<% end %>
						<a href="/polls/<%= poll.id %>"><%= poll.title %>
						<%= if poll.score != nil do %>
							—
							<%= score_format(poll.score, poll.choice_type) %>
						<% end %>
						<%= if poll.reference != nil and poll.approval_score != nil do %>
							—
							<a href="/polls/<%= poll.reference.poll.id %>/references/<%= poll.id %>?for_choice=<%= poll.reference.for_choice %>" style="font-size: 12px; margin-left: 0px;">
								<%= score_format(poll.approval_score) %> on reference

						<% end %>

				<% end %>

		<% end %>

		<%= for vote <- @is_human_votes do %>

				<a href="/identities/<%= vote.identity.id %>">Trust to <%= vote.identity.username %>
				—
				<%= score_format(vote.poll.score) %>

		<% end %>
	<% end %>

	<%= if Enum.empty?(@groups) and Enum.empty?(@is_human_votes) do %>

There are no votes here.

	<% else %>
		<%= for group <- @groups do %>

				<%= for poll <- group do %>
					<div style="margin-bottom: 12px; margin-left: <%= to_string(poll.level * 25) %>px;">
						<%= if poll.reference != nil do %>
							<%= for_choice_format(poll.reference.for_choice, poll.reference.poll.choice_type) %>
						<% end %>
						<a href="/polls/<%= poll.id %>"><%= poll.title %>
						<%= if poll.score != nil or poll.approval_score != nil do %>
							 -
						<% end %>
						<%= if poll.score do %>
							<%= score_format(poll.score, poll.choice_type) %>
						<% end %>
						<%= if poll.score != nil and poll.approval_score != nil do %>
							  |
						<% end %>
						<%= if poll.reference != nil and poll.approval_score != nil do %>
							<a href="/polls/<%= poll.reference.poll.id %>/references/<%= poll.id %>?for_choice=<%= poll.reference.for_choice %>" style="font-size: 12px; margin-left: 0px;">
								<%= score_format(poll.approval_score) %> on reference

						<% end %>

				<% end %>

		<% end %>

		<%= for vote <- @is_human_votes do %>

				<a href="/identities/<%= vote.identity.id %>">Trust to <%= vote.identity.username %>
				  |
				<%= score_format(vote.poll.score) %>

		<% end %>
	<% end %>


Add initial parameters for TOC template

Add initial parameters for TOC template

<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE ncx PUBLIC "-//NISO//DTD ncx 2005-1//EN"
                 "http://www.daisy.org/z3986/2005/ncx-2005-1.dtd">
<ncx xmlns="http://www.daisy.org/z3986/2005/ncx/" version="2005-1">
  <head>
    <meta name="dtb:uid" content="urn:uuid:0cc33cbd-94e2-49c1-909a-72ae16bc2658"/>
    <meta name="dtb:depth" content="1"/>
    <meta name="dtb:totalPageCount" content="0"/>
    <meta name="dtb:maxPageNumber" content="0"/>
  </head>
  <docTitle>
    <text><%= config.project %> - <%= config.version %></text>
  </docTitle>
  <navMap>
    <navPoint id="navpoint-1" playOrder="1">
      <navLabel>
        <text>Book cover</text>
      </navLabel>
      <content src="title.html"/>
    </navPoint>
    <navPoint id="navpoint-2" playOrder="2">
      <navLabel>
        <text>Contents</text>
      </navLabel>
      <content src="module.html"/>
    </navPoint>
  </navMap>
</ncx>

<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE ncx PUBLIC "-//NISO//DTD ncx 2005-1//EN"
                 "http://www.daisy.org/z3986/2005/ncx-2005-1.dtd">
<ncx xmlns="http://www.daisy.org/z3986/2005/ncx/" version="2005-1">
  <head>
    <meta name="dtb:uid"
content="urn:uuid:0cc33cbd-94e2-49c1-909a-72ae16bc2658"/>
    <meta name="dtb:depth" content="1"/>
    <meta name="dtb:totalPageCount" content="0"/>
    <meta name="dtb:maxPageNumber" content="0"/>
  </head>
  <docTitle>
    <text>Hello World: My First EPUB</text>
  </docTitle>
  <navMap>
    <navPoint id="navpoint-1" playOrder="1">
      <navLabel>
        <text>Book cover</text>
      </navLabel>
      <content src="title.html"/>
    </navPoint>
    <navPoint id="navpoint-2" playOrder="2">
      <navLabel>
        <text>Contents</text>
      </navLabel>
      <content src="module.html"/>
    </navPoint>
  </navMap>
</ncx>


Update landing page copy

Update landing page copy

  <iframe scrolling="no" frameborder="0" allowtransparency="true" class="twitter-share-button twitter-share-button-rendered twitter-tweet-button" style="position: static; visibility: visible; width: 61px; height: 20px;" title="Twitter Tweet Button" src="https://platform.twitter.com/widgets/tweet_button.2e798283373a8137c24e277b9b9620d6.en.html#dnt=false&id=twitter-widget-0&lang=en&original_referer=https%3A%2F%2Fsemantic-ui.com%2F&size=m&text=I%20%E2%9D%A4%20RemoteRetro!%20Like,%20big%20time.&time=1519956156939&type=share&url=http%3A%2F%2Fremoteretro.org&via=StrideDev&hashtags=myelixirstatus,opensource" data-url="http://remoteretro.org">

    Remote

    Retro

    Free. World-class. Retrospectives.

RemoteRetro helps teams turn painpoints into progress.

    Sign in with Google to Get Started

            Free

Save money by not spending any.

            Collaborative

Interact with teammates in real time.

            Focused

Save time with automated setup and teardown.

            Completely Open Source

            GitHub

          RemoteRetro provides a framework for the entire retrospective process, from idea generation to discussion to identification of action items, and it does so no matter what the limitations of the physical space may be. It's a great equalizer, and a major step forward for retro organizers and participants.’

          David A. Black

          author, The Well-Grounded Rubyist

        Sign in with Google to Get Started

        F.A.Q.

<link rel="prefetch" href="<%= static_path(@conn, "/js/jquery.min.js") %>">
<link rel="prefetch" href="<%= static_path(@conn, "/js/semantic.min.js") %>">

  <iframe scrolling="no" frameborder="0" allowtransparency="true" class="twitter-share-button twitter-share-button-rendered twitter-tweet-button" style="position: static; visibility: visible; width: 61px; height: 20px;" title="Twitter Tweet Button" src="https://platform.twitter.com/widgets/tweet_button.2e798283373a8137c24e277b9b9620d6.en.html#dnt=false&id=twitter-widget-0&lang=en&original_referer=https%3A%2F%2Fsemantic-ui.com%2F&size=m&text=I%20%E2%9D%A4%20RemoteRetro!%20Like,%20big%20time.&time=1519956156939&type=share&url=http%3A%2F%2Fremoteretro.org&via=StrideDev&hashtags=myelixirstatus,opensource" data-url="http://remoteretro.org">

    Remote

    Retro

    Free. World-class. Retrospectives.

RemoteRetro takes teams full of cats and molds them into Agile sled dogs.

    Sign in with Google to Get Started

            Free

            Constructive

            Focused

            Completely Open Source

            GitHub

          RemoteRetro provides a framework for the entire retrospective process, from idea generation to discussion to identification of action items, and it does so no matter what the limitations of the physical space may be. It's a great equalizer, and a major step forward for retro organizers and participants.’

          David A. Black

          author, The Well-Grounded Rubyist

        Sign in with Google to Get Started

        F.A.Q.

<link rel="prefetch" href="<%= static_path(@conn, "/js/jquery.min.js") %>">
<link rel="prefetch" href="<%= static_path(@conn, "/js/semantic.min.js") %>">


Add html5 form validations.

Add html5 form validations.

<% alias BattleSnake.SnakeForm %>

<% initial_empty_snakes = 4 %>
<% n = max((initial_empty_snakes - length(@form.data.snakes)) - 1, 0) + 1 %>
<% snakes = List.duplicate(%SnakeForm{}, n)%>

<fieldset>

    <%= label :f, :width, "Board Width" %>
    <%= number_input @form, :width, required: true %>

    <%= label @form, :height %>
    <%= number_input @form, :height, required: true %>

    <%= label @form, :delay, "Turn delay (ms)" %>
    <%= number_input @form, :delay, required: true %>

    <%= label @form, :recv_timeout, "API timeout (ms)" %>
    <%= number_input @form, :recv_timeout, required: true %>

    <%= label @form, :max_food %>
    <%= number_input @form, :max_food, required: true %>

    <%= label @form, :game_mode %>
    <%= select @form, :game_mode, BattleSnake.GameForm.game_modes(), required: true %>

</fieldset>

<fieldset>

Snakes

        url
        delete

      <%= inputs_for @form, :snakes, [append: snakes], fn g -> %>

          <%= url_input g, :url,
              title: "Please enter a valid url (e.g. http://localhost:4000)",
              pattern: "https?://.+" %>
          <%= checkbox g, :delete %>

      <% end %>

</fieldset>

<% alias BattleSnake.SnakeForm %>

<% initial_empty_snakes = 4 %>
<% n = max((initial_empty_snakes - length(@form.data.snakes)) - 1, 0) + 1 %>
<% snakes = List.duplicate(%SnakeForm{}, n)%>

<fieldset>

    <%= label :f, :width %>
    <%= number_input @form, :width %>

    <%= label @form, :height %>
    <%= number_input @form, :height %>

    <%= label @form, :delay %>
    <%= number_input @form, :delay %>

    <%= label @form, :max_food %>
    <%= number_input @form, :max_food %>

    <%= label @form, :game_mode %>
    <%= select @form, :game_mode, BattleSnake.GameForm.game_modes() %>

</fieldset>

<fieldset>

Snakes

        url
        delete

      <%= inputs_for @form, :snakes, [append: snakes], fn g -> %>

          <%= url_input g, :url %>
          <%= checkbox g, :delete %>

      <% end %>

</fieldset>


added sign in path

added sign in path

<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>ResuGen</title>
    <link rel="stylesheet" href="<%= static_path(@conn, "/css/app.css") %>">

          <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
            Toggle navigation

          </button>
          ResuGen

Sign In

Sign Up

        <%= render @view_module, @view_template, assigns %>

<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>ResuGen</title>
    <link rel="stylesheet" href="<%= static_path(@conn, "/css/app.css") %>">

          <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
            Toggle navigation

          </button>
          ResuGen

Log In

Sign Up

        <%= render @view_module, @view_template, assigns %>


Fix deprecated links. Closes ##2463

Fix deprecated links. Closes ##2463

<%%= gettext "Welcome to %{name}!", name: "Phoenix" %>

A productive web framework that
does not compromise speed and maintainability.

Resources

        Guides and Docs

        Source

Help

        Forum

        #elixir-lang on freenode IRC

        @elixirphoenix

<%%= gettext "Welcome to %{name}!", name: "Phoenix" %>

A productive web framework that
does not compromise speed and maintainability.

Resources

        Guides

        Docs

        Source

Help

        Mailing list

        #elixir-lang on freenode IRC

        @elixirphoenix


fix: @exif might be blank as well

fix: @exif might be blank as well

<%
p_type = if assigns[:type], do: assigns[:type], else: :thumbnail
%><article class="picture<%= if assigns[:home] do %> home<% end %><%= if not @picture.show_in_index and logged_in?(@conn) do %> unpublished<% end %> h-entry">
  <%= unless assigns[:atom] do %>

<%= @picture.title %>

        <%= link to: page_path(@conn, :about), rel: "me" do %><img src="<%= static_path(@conn, "/images/" <> @picture.author.avatar) %>" class="avatar u-photo"> <%= @picture.author.name %><% end %>,
        <time class="dt-published" datetime="<%= @picture |> Wwwtech.Picture.created_at_timex |> DateFormat.format!("%FT%T%:z", :strftime) %>"><%= link Wwwtech.LayoutView.time_ago_in_words(@picture |> Wwwtech.Picture.created_at_timex), to: picture_path(@conn, :show, @picture), class: "u-url" %></time>

  <% end %>

  <%= if @picture.in_reply_to != "" and @picture.in_reply_to != nil do %>

      In reply to <%= link @picture.in_reply_to, to: @picture.in_reply_to, class: "u-in-reply-to" %>

  <% end %>

  <div class="e-content <%= p_type %>">
    <%= link(to: (if p_type == :thumbnail, do: picture_path(@conn, :show, @picture), else: picture_path(@conn, :show, @picture) <> ".png")) do %><img src="<%= picture_path(@conn, :show, @picture) %>.png?type=<%= p_type %>" alt="" title="<%= @picture.title %>" class="image u-photo"><% end %>

    <%= if p_type != :thumbnail || assigns[:home] do %>
      <%= {:safe, Wwwtech.Picture.to_html(@picture)} %>
    <% end %>

  <%= if assigns[:index] == nil and assigns[:exif] != nil and assigns[:exif] != %{} do %>

Meta

Camera

<%= @exif[:model] %>

Taken

<%= DateFormat.parse!(@exif[:date_time], "%Y:%m:%d %H:%M:%S", :strftime) |> DateFormat.format!("%A, %d. %B %Y %H:%M", :strftime) %>

Resolution

<%= @exif[:pixel_x_dimension] %>×<%= @exif[:pixel_y_dimension] %>

        <%= if @exif[:gps_latitude] != nil and @exif[:gps_longitude] != nil do %>

GPS position
<% [la_h,la_m,la_s] = @exif[:gps_latitude]
                               [lo_h, lo_m, lo_s] = @exif[:gps_longitude]%>

            <a href="http://www.openstreetmap.org/?lat=<%= to_degrees(@exif[:gps_latitude], @exif[:gps_latitude_ref]) %>&lon=<%= to_degrees(@exif[:gps_longitude], @exif[:gps_longitude_ref]) %>&mlat=<%= to_degrees(@exif[:gps_latitude], @exif[:gps_latitude_ref]) %>&mlon=<%= to_degrees(@exif[:gps_longitude], @exif[:gps_longitude_ref]) %>&zoom=16">
              <%= la_h %>° <%= la_m %>′ <%= la_s %>″ <%= @exif[:gps_latitude_ref] %> /
              <%= lo_h %>° <%= lo_m %>′ <%= lo_s %>″ <%= @exif[:gps_longitude_ref] %>

        <% end %>

      <%= if @exif[:gps_latitude] != nil and @exif[:gps_longitude] != nil do %>
        <a class="osm" href="http://www.openstreetmap.org/?lat=<%= to_degrees(@exif[:gps_latitude], @exif[:gps_latitude_ref]) %>&lon=<%= to_degrees(@exif[:gps_longitude], @exif[:gps_longitude_ref]) %>&mlat=<%= to_degrees(@exif[:gps_latitude], @exif[:gps_latitude_ref]) %>&mlon=<%= to_degrees(@exif[:gps_longitude], @exif[:gps_longitude_ref]) %>&zoom=16"><img src="<%= cache_path(@conn, :show, url: "http://staticmap.openstreetmap.de/staticmap.php?center=#{to_degrees(@exif[:gps_latitude], @exif[:gps_latitude_ref])},#{to_degrees(@exif[:gps_longitude], @exif[:gps_longitude_ref])}&markers=#{to_degrees(@exif[:gps_latitude], @exif[:gps_latitude_ref])},#{to_degrees(@exif[:gps_longitude], @exif[:gps_longitude_ref])}&zoom=16&size=640x480") %>">
      <% end %>

  <% end %>

  <%= if assigns[:index] == nil and @picture.posse do %>

      <%= link "Twitter POSSE", to: "https://brid.gy/publish/twitter" %>

  <% end %>

<%
p_type = if assigns[:type], do: assigns[:type], else: :thumbnail
%><article class="picture<%= if assigns[:home] do %> home<% end %><%= if not @picture.show_in_index and logged_in?(@conn) do %> unpublished<% end %> h-entry">
  <%= unless assigns[:atom] do %>

<%= @picture.title %>

        <%= link to: page_path(@conn, :about), rel: "me" do %><img src="<%= static_path(@conn, "/images/" <> @picture.author.avatar) %>" class="avatar u-photo"> <%= @picture.author.name %><% end %>,
        <time class="dt-published" datetime="<%= @picture |> Wwwtech.Picture.created_at_timex |> DateFormat.format!("%FT%T%:z", :strftime) %>"><%= link Wwwtech.LayoutView.time_ago_in_words(@picture |> Wwwtech.Picture.created_at_timex), to: picture_path(@conn, :show, @picture), class: "u-url" %></time>

  <% end %>

  <%= if @picture.in_reply_to != "" and @picture.in_reply_to != nil do %>

      In reply to <%= link @picture.in_reply_to, to: @picture.in_reply_to, class: "u-in-reply-to" %>

  <% end %>

  <div class="e-content <%= p_type %>">
    <%= link(to: (if p_type == :thumbnail, do: picture_path(@conn, :show, @picture), else: picture_path(@conn, :show, @picture) <> ".png")) do %><img src="<%= picture_path(@conn, :show, @picture) %>.png?type=<%= p_type %>" alt="" title="<%= @picture.title %>" class="image u-photo"><% end %>

    <%= if p_type != :thumbnail || assigns[:home] do %>
      <%= {:safe, Wwwtech.Picture.to_html(@picture)} %>
    <% end %>

  <%= if assigns[:index] == nil and assigns[:exif] != nil do %>

Meta

Camera

<%= @exif[:model] %>

Taken

<%= DateFormat.parse!(@exif[:date_time], "%Y:%m:%d %H:%M:%S", :strftime) |> DateFormat.format!("%A, %d. %B %Y %H:%M", :strftime) %>

Resolution

<%= @exif[:pixel_x_dimension] %>×<%= @exif[:pixel_y_dimension] %>

        <%= if @exif[:gps_latitude] != nil and @exif[:gps_longitude] != nil do %>

GPS position
<% [la_h,la_m,la_s] = @exif[:gps_latitude]
                               [lo_h, lo_m, lo_s] = @exif[:gps_longitude]%>

            <a href="http://www.openstreetmap.org/?lat=<%= to_degrees(@exif[:gps_latitude], @exif[:gps_latitude_ref]) %>&lon=<%= to_degrees(@exif[:gps_longitude], @exif[:gps_longitude_ref]) %>&mlat=<%= to_degrees(@exif[:gps_latitude], @exif[:gps_latitude_ref]) %>&mlon=<%= to_degrees(@exif[:gps_longitude], @exif[:gps_longitude_ref]) %>&zoom=16">
              <%= la_h %>° <%= la_m %>′ <%= la_s %>″ <%= @exif[:gps_latitude_ref] %> /
              <%= lo_h %>° <%= lo_m %>′ <%= lo_s %>″ <%= @exif[:gps_longitude_ref] %>

        <% end %>

      <%= if @exif[:gps_latitude] != nil and @exif[:gps_longitude] != nil do %>
        <a class="osm" href="http://www.openstreetmap.org/?lat=<%= to_degrees(@exif[:gps_latitude], @exif[:gps_latitude_ref]) %>&lon=<%= to_degrees(@exif[:gps_longitude], @exif[:gps_longitude_ref]) %>&mlat=<%= to_degrees(@exif[:gps_latitude], @exif[:gps_latitude_ref]) %>&mlon=<%= to_degrees(@exif[:gps_longitude], @exif[:gps_longitude_ref]) %>&zoom=16"><img src="<%= cache_path(@conn, :show, url: "http://staticmap.openstreetmap.de/staticmap.php?center=#{to_degrees(@exif[:gps_latitude], @exif[:gps_latitude_ref])},#{to_degrees(@exif[:gps_longitude], @exif[:gps_longitude_ref])}&markers=#{to_degrees(@exif[:gps_latitude], @exif[:gps_latitude_ref])},#{to_degrees(@exif[:gps_longitude], @exif[:gps_longitude_ref])}&zoom=16&size=640x480") %>">
      <% end %>

  <% end %>

  <%= if assigns[:index] == nil and @picture.posse do %>

      <%= link "Twitter POSSE", to: "https://brid.gy/publish/twitter" %>

  <% end %>


web builder - Rubin

web builder - Rubin

            Projects >
            Virb

virb.com

Virb emerged as a trending social network, into innovated streams of media, into web builder.

9 years of development over 3 business pivots

Systems Design

Framework Architecture and Development

Research and Development of new technologies across the full stack

Vagrant for local development

Jenkins for rapid deployment

            <img src="<%= static_path(@conn, "/images/projects/virb1.jpg") %>">

            Projects >
            Virb

virb.com

Virb emerged as a trending social network, into innovated streams of media, into Web Builder.

9 years of development over 3 business pivots

Systems Design

Framework Architecture and Development

Research and Development of new technologies across the full stack

Vagrant for local development

Jenkins for rapid deployment

            <img src="<%= static_path(@conn, "/images/projects/virb1.jpg") %>">


fix: „Imprint“ was a mistranslation

fix: „Imprint“ was a mistranslation

<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

    <link rel="alternate" type="application/atom+xml" title="WWWTech / Articles" href="<%= article_url(@conn, :index) %>.atom">
    <link rel="alternate" type="application/atom+xml" title="WWWTech / Notes" href="<%= note_url(@conn, :index) %>.atom">
    <link rel="alternate" type="application/atom+xml" title="WWWTech / Pictures" href="<%= picture_url(@conn, :index) %>.atom">
    <link rel="alternate" type="application/atom+xml" title="WWWTech / What’s new? (Combined feed)" href="<%= page_url(@conn, :index) %>whatsnew.atom">

    <link rel="pgpkey" type="application/pgp-keys" href="/A99A9D73.asc">

    <link rel="apple-touch-icon" href="<%= static_path(@conn, "/images/christian-kruse.jpg") %>">
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">

    <link rel="author" href="<%= page_path(@conn, :index) %>humans.txt" type="text/plain">

    <link rel="webmention" href="<%= page_url(@conn, :index) %>webmentions">

    <meta name="description" content="<%= description(@conn, assigns) %>">
    <meta name="author" content="Christian Kruse">

    <title><%= page_title(@conn, assigns) %></title>

    <meta property="og:title" content="<%= page_title(@conn, assigns) %>">
    <meta property="og:type" content="website">
    <meta property="og:image" content="<%= static_path(@conn, "/images/christian-kruse.jpg") %>">

    <link rel="stylesheet" href="<%= static_path(@conn, "/css/app.css") %>">

<%= link "WWWTech", to: page_url(@conn, :index) %>

Free/Libre Open Source Software by <%= link "Christian Kruse", to: page_path(@conn, :about) %>

        <%= if get_flash(@conn, :info) do %>
<%= get_flash(@conn, :info) %>
<% end %>
        <%= if get_flash(@conn, :error) do %>
<%= get_flash(@conn, :error) %>
<% end %>

        <%= render @view_module, @view_template, assigns %>

<%= link "Main", to: page_path(@conn, :index) %>

<%= link "Software", to: page_path(@conn, :software) %>

<%= link "Articles", to: article_path(@conn, :index) %>

<%= link "Notes", to: note_path(@conn, :index) %>

<%= link "Pictures", to: picture_path(@conn, :index) %>

<%= link "More", to: page_path(@conn, :more) %>

          <%= if logged_in?(@conn) do %>

<%= button "Logout", to: session_path(@conn, :delete), method: :delete %>

          <% end %>

<%= link "Legal Notice", to: page_path(@conn, :about), rel: "me" %>

<%= link "cjk@defunct.ch", to: "xmpp:cjk@defunct.ch", rel: "me" %> via Jabber

<%= link "cjk@defunct.ch", to: "mailto:cjk@defunct.ch", rel: "me" %> via Email

    <%= if Mix.env == :dev do %>

    <% end %>

<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

    <link rel="alternate" type="application/atom+xml" title="WWWTech / Articles" href="<%= article_url(@conn, :index) %>.atom">
    <link rel="alternate" type="application/atom+xml" title="WWWTech / Notes" href="<%= note_url(@conn, :index) %>.atom">
    <link rel="alternate" type="application/atom+xml" title="WWWTech / Pictures" href="<%= picture_url(@conn, :index) %>.atom">
    <link rel="alternate" type="application/atom+xml" title="WWWTech / What’s new? (Combined feed)" href="<%= page_url(@conn, :index) %>whatsnew.atom">

    <link rel="pgpkey" type="application/pgp-keys" href="/A99A9D73.asc">

    <link rel="apple-touch-icon" href="<%= static_path(@conn, "/images/christian-kruse.jpg") %>">
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">

    <link rel="author" href="<%= page_path(@conn, :index) %>humans.txt" type="text/plain">

    <link rel="webmention" href="<%= page_url(@conn, :index) %>webmentions">

    <meta name="description" content="<%= description(@conn, assigns) %>">
    <meta name="author" content="Christian Kruse">

    <title><%= page_title(@conn, assigns) %></title>

    <meta property="og:title" content="<%= page_title(@conn, assigns) %>">
    <meta property="og:type" content="website">
    <meta property="og:image" content="<%= static_path(@conn, "/images/christian-kruse.jpg") %>">

    <link rel="stylesheet" href="<%= static_path(@conn, "/css/app.css") %>">

<%= link "WWWTech", to: page_url(@conn, :index) %>

Free/Libre Open Source Software by <%= link "Christian Kruse", to: page_path(@conn, :about) %>

        <%= if get_flash(@conn, :info) do %>
<%= get_flash(@conn, :info) %>
<% end %>
        <%= if get_flash(@conn, :error) do %>
<%= get_flash(@conn, :error) %>
<% end %>

        <%= render @view_module, @view_template, assigns %>

<%= link "Main", to: page_path(@conn, :index) %>

<%= link "Software", to: page_path(@conn, :software) %>

<%= link "Articles", to: article_path(@conn, :index) %>

<%= link "Notes", to: note_path(@conn, :index) %>

<%= link "Pictures", to: picture_path(@conn, :index) %>

<%= link "More", to: page_path(@conn, :more) %>

          <%= if logged_in?(@conn) do %>

<%= button "Logout", to: session_path(@conn, :delete), method: :delete %>

          <% end %>

<%= link "Imprint", to: page_path(@conn, :about), rel: "me" %>

<%= link "cjk@defunct.ch", to: "xmpp:cjk@defunct.ch", rel: "me" %> via Jabber

<%= link "cjk@defunct.ch", to: "mailto:cjk@defunct.ch", rel: "me" %> via Email

    <%= if Mix.env == :dev do %>

    <% end %>


fix minor typo and size while im at it

fix minor typo and size while im at it

<input type="color" id="html5colorpicker" onchange="clickColor(0, -1, -1, 5)" value="#ff0000" style="width:100%">

<input type="color" id="html5colorpicker" onchange="clickColor(0, -1, -1, 5)" value="#ff0000" style="width:85%;heigh:25%">


Fix header

Fix header

Band Indigo — instrumental rock from Siberia

Get our music on iTunes, Google play.

Band Indigo — instrumental rock from Siberia

Get our music on iTunes, Google play or Amazon.


Start changing the account show action

Start changing the account show action

<%= @account.name %> (<%= if @account.contra, do: "-" %><%= @account.type %>)

<%= link "Edit", to: account_path(@conn, :edit, @account) %>
<%= link "Back", to: account_path(@conn, :index) %>

Show Account

    Name:
    <%= @account.name %>

    Type:
    <%= @account.type %>

    Contra:
    <%= @account.contra %>

<%= link "Edit", to: account_path(@conn, :edit, @account) %>
<%= link "Back", to: account_path(@conn, :index) %>


Fix credo warning:

Fix credo warning:

- Pipechain should start with a raw value
- Use sigils for a list of string

# Import all plugins from `rel/plugins`
# They can then be used by adding `plugin MyPlugin` to
# either an environment, or release definition, where
# `MyPlugin` is the name of the plugin module.
~w(rel plugins *.exs)
|> Path.join()
|> Path.wildcard()
|> Enum.map(&Code.eval_file(&1))

use Mix.Releases.Config,
    # This sets the default release built by `mix release`
    default_release: :default,
    # This sets the default environment used by `mix release`
    default_environment: Mix.env()
<%= unless no_docs do %>
# For a full list of config options for both releases
# and environments, visit https://hexdocs.pm/distillery/configuration.html
<% end %>
<%= unless no_docs do %>
# You may define one or more environments in this file,
# an environment's settings will override those of a release
# when building in that environment, this combination of release
# and environment configuration is called a profile
<% end %>
environment :dev do
  # If you are running Phoenix, you should make sure that
  # server: true is set and the code reloader is disabled,
  # even in dev mode.
  # It is recommended that you build with MIX_ENV=prod and pass
  # the --env flag to Distillery explicitly if you want to use
  # dev mode.
  set dev_mode: true
  set include_erts: false
  set cookie: <%= inspect(get_cookie.()) %>
end

environment :prod do
  set include_erts: true
  set include_src: false
  set cookie: <%= inspect(get_cookie.()) %>
end
<%= unless no_docs do %>
# You may define one or more releases in this file.
# If you have not set a default release, or selected one
# when running `mix release`, the first release in the file
# will be used by default<% end %>
<%= for release <- releases do %><%= if Keyword.get(release, :is_umbrella) do %>
release :<%= Keyword.get(release, :release_name) %> do
  set version: "0.1.0"
  set applications: [
    :runtime_tools,
<%= Enum.map(Keyword.get(release, :release_applications), fn {app, start_type} ->
    "    #{app}: :#{start_type}"
    end) |> Enum.join(",\n") %>
  ]
end<% else %>
release :<%= Keyword.get(release, :release_name) %> do
  set version: current_version(:<%= Keyword.get(release, :release_name)%>)
  set applications: [
    :runtime_tools
  ]
end<% end %>
<% end %>

# Import all plugins from `rel/plugins`
# They can then be used by adding `plugin MyPlugin` to
# either an environment, or release definition, where
# `MyPlugin` is the name of the plugin module.
Path.join(["rel", "plugins", "*.exs"])
|> Path.wildcard()
|> Enum.map(&Code.eval_file(&1))

use Mix.Releases.Config,
    # This sets the default release built by `mix release`
    default_release: :default,
    # This sets the default environment used by `mix release`
    default_environment: Mix.env()
<%= unless no_docs do %>
# For a full list of config options for both releases
# and environments, visit https://hexdocs.pm/distillery/configuration.html
<% end %>
<%= unless no_docs do %>
# You may define one or more environments in this file,
# an environment's settings will override those of a release
# when building in that environment, this combination of release
# and environment configuration is called a profile
<% end %>
environment :dev do
  # If you are running Phoenix, you should make sure that
  # server: true is set and the code reloader is disabled,
  # even in dev mode.
  # It is recommended that you build with MIX_ENV=prod and pass
  # the --env flag to Distillery explicitly if you want to use
  # dev mode.
  set dev_mode: true
  set include_erts: false
  set cookie: <%= inspect(get_cookie.()) %>
end

environment :prod do
  set include_erts: true
  set include_src: false
  set cookie: <%= inspect(get_cookie.()) %>
end
<%= unless no_docs do %>
# You may define one or more releases in this file.
# If you have not set a default release, or selected one
# when running `mix release`, the first release in the file
# will be used by default<% end %>
<%= for release <- releases do %><%= if Keyword.get(release, :is_umbrella) do %>
release :<%= Keyword.get(release, :release_name) %> do
  set version: "0.1.0"
  set applications: [
    :runtime_tools,
<%= Enum.map(Keyword.get(release, :release_applications), fn {app, start_type} ->
    "    #{app}: :#{start_type}"
    end) |> Enum.join(",\n") %>
  ]
end<% else %>
release :<%= Keyword.get(release, :release_name) %> do
  set version: current_version(:<%= Keyword.get(release, :release_name)%>)
  set applications: [
    :runtime_tools
  ]
end<% end %>
<% end %>


Add app details to app privacy policy

Add app details to app privacy policy

Datenschutzerklärung für App “Jumu weltweit”

Dieses Dokument legt offen, welche Daten von der mobilen App “Jumu weltweit” erhoben und verarbeitet werden. Sie richtet sich nach der <%= link "Europäischen Datenschutz-Grundverordnung (DSGVO)", to: "https://dsgvo-gesetz.de" %>.

      Name der App: Jumu weltweit

      Entwickler: Martin Richter

      Links: <%= link "Android", to: app_url(:android) %>, <%= link "iOS", to: app_url(:ios) %>

1. Verantwortliche

    Verantwortlich im Sinne des <%= link "Art. 4 Abs. 7", to: "https://dsgvo-gesetz.de/art-4-dsgvo/" %> der DSGVO ist der Landesausschuss “Jugend musiziert” des DSA-Verbunds 2. Ein Formular zur Kontaktaufnahme findest du auf der Seite <%= link "\"Kontakt\"", to: Routes.page_path(@conn, :contact) %>.

2. Welche Daten werden erhoben?

    Die Jumu-App zeigt lediglich öffentlich zugängliche Wettbewerbsdaten wie Zeitpläne und Ergebnislisten an. Diese wurden bereits zu einem früheren Zeitpunkt über die Website “Jumu weltweit” erhoben und unterliegen somit einer gesonderten <%= link "Datenschutzerklärung", to: Routes.page_path(@conn, :privacy) %>. Von der App selbst werden keinerlei persönliche Daten erhoben.

Logdateien

Beim Laden der Wettbewerbsdaten durch die App werden bestimmte Informationen wie z.B. URL und IP-Adresse in die Logdateien des Website-Servers eingetragen. Diese Daten werden nur als Nachweis bei möglichem Missbrauch sowie zur Fehlerbehebung erhoben. Sie werden weder zu anderen Zwecken genutzt noch mit Dritten geteilt.

3. Änderungen

Sollten wir Änderungen an dieser Datenschutzerklärung vornehmen, die eine Verarbeitung deiner Daten außerhalb obengenannter Zwecke vorsieht, so werden wir dich hierüber informieren und deine Einwilligung einholen, falls dies rechtlich erforderlich ist.

Stand: 28. September 2021

Datenschutzerklärung für App “Jumu weltweit”

Dieses Dokument legt offen, welche Daten von der Jumu-App für <%= link "Android", to: app_url(:android) %> und <%= link "iOS", to: app_url(:ios) %> erhoben und verarbeitet werden. Sie richtet sich nach der <%= link "Europäischen Datenschutz-Grundverordnung (DSGVO)", to: "https://dsgvo-gesetz.de" %>.

1. Verantwortliche

    Verantwortlich im Sinne des <%= link "Art. 4 Abs. 7", to: "https://dsgvo-gesetz.de/art-4-dsgvo/" %> der DSGVO ist der Landesausschuss “Jugend musiziert” des DSA-Verbunds 2. Ein Formular zur Kontaktaufnahme findest du auf der Seite <%= link "\"Kontakt\"", to: Routes.page_path(@conn, :contact) %>.

2. Welche Daten werden erhoben?

    Die Jumu-App zeigt lediglich öffentlich zugängliche Wettbewerbsdaten wie Zeitpläne und Ergebnislisten an. Diese wurden bereits zu einem früheren Zeitpunkt über die Website “Jumu weltweit” erhoben und unterliegen somit einer gesonderten <%= link "Datenschutzerklärung", to: Routes.page_path(@conn, :privacy) %>. Von der App selbst werden keinerlei persönliche Daten erhoben.

Logdateien

Beim Laden der Wettbewerbsdaten durch die App werden bestimmte Informationen wie z.B. URL und IP-Adresse in die Logdateien des Website-Servers eingetragen. Diese Daten werden nur als Nachweis bei möglichem Missbrauch sowie zur Fehlerbehebung erhoben. Sie werden weder zu anderen Zwecken genutzt noch mit Dritten geteilt.

3. Änderungen

Sollten wir Änderungen an dieser Datenschutzerklärung vornehmen, die eine Verarbeitung deiner Daten außerhalb obengenannter Zwecke vorsieht, so werden wir dich hierüber informieren und deine Einwilligung einholen, falls dies rechtlich erforderlich ist.

Stand: 28. September 2021


fixes wrapping in textarea by setting it off

<%= form_for @changeset, @action, fn f -> %>
  <%= if @changeset.action do %>

Oops, something went wrong! Please check the errors below.

  <% end %>

    <%= label f, :title, class: "control-label" %>
    <%= text_input f, :title, class: "form-control" %>
    <%= error_tag f, :title %>

    <%= label f, :is_private, class: "control-label" %>
    <%= checkbox f, :is_private, class: "form-control" %>
    <%= error_tag f, :is_private %>

  <%= inputs_for f, :snippets, fn sn -> %>

      <%= label sn, :filename, class: "control-label" %>
      <%= text_input sn, :filename, class: "form-control" %>
      <%= error_tag sn, :filename %>

      <%= label sn, :body, class: "control-label" %>
      <%= textarea sn, :body, class: "form-control", rows: 6, wrap: "off", cols: 90 %>
      <%= error_tag sn, :body %>

  <% end %>

    <%= submit "Submit", class: "btn btn-primary" %>

<% end %>

<%= form_for @changeset, @action, fn f -> %>
  <%= if @changeset.action do %>

Oops, something went wrong! Please check the errors below.

  <% end %>

    <%= label f, :title, class: "control-label" %>
    <%= text_input f, :title, class: "form-control" %>
    <%= error_tag f, :title %>

    <%= label f, :visibility, class: "control-label" %>
    <%= number_input f, :visibility, class: "form-control" %>
    <%= error_tag f, :visibility %>

    <%= submit "Submit", class: "btn btn-primary" %>

<% end %>


:nail_care: Links of the page

:nail_care: Links of the page

<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>Ikki - A Web Chat written in Elixir using Phoenix</title>
    <link rel="stylesheet" href="<%= static_path(@conn, "/css/app.css") %>">

          <%= link to: "/" do %>
            <img class='header-logo' src="<%= static_path(@conn, "/images/logo.png") %>" alt="Ikki logo" />
          <% end %>

            Ikki
            A Web Chat written in Elixir using Phoenix

        <%= if current_user = current_user(@conn) do %>

            <%= current_user %>

            <%= link 'Sair', to: session_path(@conn, :signout), method: :delete %>

        <% end %>

<%= get_flash(@conn, :info) %>

<%= get_flash(@conn, :error) %>

      <%= @inner %>

<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>Ikki - A Web Chat written in Elixir using Phoenix</title>
    <link rel="stylesheet" href="<%= static_path(@conn, "/css/app.css") %>">

          <img class='header-logo' src="<%= static_path(@conn, "/images/logo.png") %>" alt="Ikki logo" />

            Ikki
            A Web Chat written in Elixir using Phoenix

        <%= if current_user = current_user(@conn) do %>

            <%= current_user %>

            <%= link 'Sair', to: session_path(@conn, :signout), method: :delete %>

        <% end %>

<%= get_flash(@conn, :info) %>

<%= get_flash(@conn, :error) %>

      <%= @inner %>


add facebook pixel to petitions

add facebook pixel to petitions

<meta name="description" content="<%=@title%>" />
<meta name="keywords" content="<%=@title <> "" <> copyright(@brand)%>" />
<meta name="author" content="copyright(@brand)%>" />
<meta name="copyright" content="copyright(@brand)%>" />

<meta property="og:url" content="<%= core_deployment(@brand) <> "/petition/" <> @slug%>" />
<meta property="og:title" content="<%=@title%>" />
<meta property="og:type" content="article" />
<meta property="og:image" content="<%=@share_image%>" />
<meta property="og:description" content="<%=@content%>" />

<meta name="twitter:card" content="summary" />
<meta name="twitter:title" content="<%=@title%>" />
<meta name="twitter:description" content="<%=@content%>" />
<meta name="twitter:image" content="<%=@share_image%>" />

    <%= if not @signed do %>

        <%= raw(@content) %>

      <%= if @count do %>

          <div class="count-bar" style="width: <%= @progress %>%;">

           <%= @count %> people have signed. Help us get to <%= @target %>!

      <% end %>

      <%= form_tag("/petition/#{@slug}", method: :post) %>

          <input type="hidden" name="_csrf_token" value="<%= csrf_token() %>" />

          <fieldset style="margin-top: 20px;">
            <legend style="color:white;">Your Info</legend>

              Name
              <input type="text" name="name" required="required"/>

              Email
              <input type="email" name="email" required="required"/>

              Mobile Phone Number
              <input type="tel" name="phone" />

              Zip
              <input type="text" name="zip" maxlength="5" required="required" />

              <button type="submit" class="button-block"><%=@sign_button_text%></button>

          </fieldset>

            By signing this petition, I consent to receiving emails from
            <%= if @slug == "jd-stop-war" do %>
              <a target="_blank" href="<%=homepage(@brand)%>"><%=copyright(@brand)%> and
              Ro Khanna.
            <% else %>
              <a target="_blank" href="<%=homepage(@brand)%>"><%=copyright(@brand)%>.
            <% end %>

      </form>

    <% else %>

        <%= raw(@post_sign_text) %>

 Next Steps

      <fieldset style="margin-top: 20px; color: white;">
        <legend style="color:white;">Help us get to <%= @target %> signatures by sharing on social media</legend>

        <a class="twitter-share-button" href="<%=@twitter_href%>" data-size="large">
          Tweet

        <div class="fb-share-button" data-href="<%=@url%>" data-layout="button_count" data-size="large" style="float:right;">
          <a class="fb-xfbml-parse-ignore" target="_blank"
            style="background-color: #3b5998; color: white; padding: 5px; text-decoration: none; margin-top: 5px;"
            href="<%=@fb_href%>"
          >
            Share on Facebook

      </fieldset>

      <%= if @call_power_campaign_id do %>

        <fieldset style="color:white;">
          <legend> <%= @call_power_header %> </legend>

            <%= raw(@call_power_prompt) %>

          <form id="call_form">
            <input id="phone_id" type="hidden" value="<%= @submitted_phone %>"/>
            <input id="location_id" type="hidden" value="<%= @submitted_zip %>" />
            <button type="submit" style="width: 100%; margin-top: 10px;" id="call-power-go"> Call Me At <%= @submitted_phone %> </button>
          </form>

          <%= form_tag("/petition/#{@slug}", method: :post, id: "number-replace-form", style: "margin-top: 10px;") %>
            <input name="name" value="<%= @submitted_name %>" type="hidden" />
            <input name="email" value="<%= @submitted_email %>" type="hidden" />
            <input name="zip" value="<%= @submitted_zip %>" type="hidden" />

              Different Number
              <input type="tel" name="phone" />

              <button id="number-replace-button" class="button-block">Call Me at a Different Number</button>

          </form>
        </fieldset>
      <% end %>

    <% end %>

<%= if @brand == "jd" do %>

<% end %>

<%= if @brand == "jd" and @signed do %>

<% end %>