Fix foreground mode on Windows

Fix foreground mode on Windows

:: This batch file handles managing an Erlang node as a Windows service.
::
:: Check the :usage section for information about what this script provides

@echo off

:: Set variables that describe the release
set rel_name=<%= release_name %>
set rel_vsn=<%= release_version %>
set erts_vsn=<%= if ((is_binary(include_erts) or include_erts) and not is_nil(erts_vsn)) do %><%= erts_vsn %><% end %>
set erl_opts=<%= erl_opts %>

:: Discover the release root directory from the directory
:: of this script
set script_dir=%~dp0
for %%A in ("%script_dir%\..\..") do (
  set release_root_dir=%%~fA
)
set rel_dir=%release_root_dir%\releases\%rel_vsn%
set libexec_dir=%rel_dir%\libexec\win

set ROOT=%release_root_dir%
set EMU=beam

if "%RELEASE_MUTABLE_DIR%"=="" (
  set mutable_dir=%release_root_dir%\var
) else (
  set mutable_dir=%RELEASE_MUTABLE_DIR%
)

if "%RELEASE_CONFIG_DIR%"=="" (
  set config_dir=%release_root_dir%
) else (
  set config_dir=%RELEASE_CONFIG_DIR%
)

set log_dir=%mutable_dir%\log

:: Create directories which don't exist
if not exist %mutable_dir% mkdir %mutable_dir%
if not exist %config_dir% mkdir %config_dir%
if not exist %log_dir% mkdir %log_dir%

call :find_erts_dir
call :find_sys_config
call :find_vm_args
call :set_boot_script_var

set service_name=%rel_name%_%rel_vsn%
set bindir=%erts_dir%\bin
set progname=erl.exe
set clean_boot_script=%release_root_dir%\bin\start_clean
set none_boot_script=%release_root_dir%\bin\start_none
set erlsrv="%bindir%\erlsrv.exe"
set epmd="%bindir%\epmd.exe"
set escript="%bindir%\escript.exe"
set werl="%bindir%\werl.exe"
set consolidated_dir=%rootdir%\lib\%rel_name%-%rel_vsn%\consolidated
set hook_dir=%rel_dir%\hooks
set command_dir=%rel_dir%\commands

:: Extract node type and name from vm.args
for /f "usebackq tokens=1-2" %%I in (`findstr /b "\-name \-sname" "%vm_args%"`) do (
  set node_type=%%I
  set node_name=%%J
)

:: Extract cookie from vm.args
for /f "usebackq tokens=1-2" %%I in (`findstr /b \-setcookie "%vm_args%"`) do (
  set cookie=%%J
)

:: Write the erl.ini file to set up paths relative to this script
call :write_ini

:: If a start.boot file is not present, copy one from the named .boot file
if not exist "%rel_dir%\start.boot" (
  copy "%rel_dir%\%rel_name%.boot" "%rel_dir%\start.boot" >nul
)

:: Get the first argument as the task name, shift the remaining arguments
set taskname="%1"
shift /1

set args=
setlocal EnableDelayedExpansion
:parse_args
:: Get next arg
set param=%~1

:: Escape parens in parameter
set param=%param:(=^^(%
set param=%param:)=^^)%

:: If there is no value for this argument, we're done
if "%~1"=="" goto :args_parsed

:: If we have arguments, append to them, start them otherwise
:: Also, when expanding the argument, escape quotes
if "!largs!"=="" (
  set largs=%param:"=\"%
) else (
  set largs=%largs% %param:"=\"%
)

:: Set space as the argument delimiter
set "delim= "

:: Shift to the next argument and loop
shift /1
goto :parse_args

:args_parsed
endlocal & set args=%largs%

if %taskname%=="install" goto install
if %taskname%=="uninstall" goto uninstall
if %taskname%=="start" goto start
if %taskname%=="foreground" goto foreground
if %taskname%=="console" goto console
if %taskname%=="stop" goto stop
if %taskname%=="restart" call :stop && goto start
if %taskname%=="reboot" call :stop && goto start
if %taskname%=="reload_config" goto reload_config
if %taskname%=="upgrade" goto upgrade
if %taskname%=="downgrade" goto upgrade
if %taskname%=="attach" goto remote_console
if %taskname%=="remote_console" goto remote_console
if %taskname%=="pid" goto pid
if %taskname%=="ping" goto ping
if %taskname%=="pingpeer" goto pingpeer
if %taskname%=="escript" goto escript
if %taskname%=="rpc" goto rpc
if %taskname%=="eval" goto eval
if %taskname%=="command" goto command
if %taskname%=="describe" goto describe
if %taskname%=="" goto usage
if exist "%command_dir%\%taskname%.bat" (
  "%command_dir%\%taskname%.bat" %*
) else (
  echo Unknown command: %taskname%
)
goto :eof

:: Find the ERTS dir
:find_erts_dir
if "%erts_vsn%"=="" (
  call :use_system_erts
) else (
  call :use_bundled_erts
)
goto :eof

:: Load system ERTS info
:use_system_erts
for /f "delims=" %%i in ('where erl') do set system_erl="%%i"
if %system_erl%=="" (
  echo failed to locate the Erlang Runtime System!
  exit /b 1
)
set system_root_dir_cmd=%system_erl% -noshell -eval "io:format(\"~s\", [filename:nativename(code:root_dir())])." -s init stop
for /f "delims=" %%i in ('%%system_root_dir_cmd%%') do set system_root=%%i
set system_erts_vsn_cmd=%system_erl% -noshell -eval "Ver=erlang:system_info(version),io:format(\"~s\", [Ver])" -s init stop
for /f "delims=" %%i in ('%%system_erts_vsn_cmd%%') do set system_erts_vsn=%%i
set erl=%system_erl%
set erts_vsn=%system_erts_vsn%
set ROOTDIR=%system_root%
set erts_dir=%rootdir%\erts-%erts_vsn%
set ERTS_LIB_DIR=%ROOTDIR%\lib
goto :eof

:: Load bundled ERTS info
:use_bundled_erts
set erts_dir=%release_root_dir%\erts-%erts_vsn%
set erl=%erts_dir%\bin\erl
set ROOTDIR=%release_root_dir%
set ERTS_LIB_DIR=%release_root_dir%\lib
goto :eof

:: Find the sys.config file
:find_sys_config
set possible_sys=%release_config_dir%\sys.config
if exist %possible_sys% (
  set sys_config_src=%possible_sys%
) else (
  set sys_config_src=%rel_dir%\sys.config
)
set sys_config_target=%config_dir%\sys.config
:: Replace environment variables
powershell -command "$content = get-content %sys_config_src%; [regex]::matches($content, '\${[\w\d_-]+}') | foreach { $content = $content.Replace($_.value, [System.Environment]::GetEnvironmentVariable($_.value)) }; out-file -filepath %sys_config_target% -inputobject $content -encoding ascii"
set sys_config=%sys_config_target%
goto :eof

:find_vm_args
set possible_vmargs=%release_config_dir%\vm.args
if exist %possible_vmargs% (
  set vmargs_src=%possible_vmargs%
) else (
  set vmargs_src=%rel_dir%\vm.args
)
set vmargs_target=%config_dir%\vm.args
:: Replace environment variables
powershell -command "$content = get-content %vmargs_src%; [regex]::matches($content, '\${[\w\d_-]+}') | foreach { $content = $content.Replace($_.value, [System.Environment]::GetEnvironmentVariable($_.value)) }; out-file -filepath %vmargs_target% -inputobject $content -encoding ascii"
set vm_args=%vmargs_target%
goto :eof

:: set boot_script variable
:set_boot_script_var
if exist %rel_dir%\%rel_name%.boot (
  set boot_script=%rel_dir%\%rel_name%
) else (
  set boot_script=%rel_dir%\start
)
goto :eof

:: Write the erl.ini file
:write_ini
if not "%system_erl%"=="" goto :eof
set erl_ini=%erts_dir%\bin\erl.ini
set converted_bindir=%bindir:\=\\%
set converted_rootdir=%rootdir:\=\\%
echo [erlang] > "%erl_ini%"
echo Bindir=%converted_bindir% >> "%erl_ini%"
echo Progname=%progname% >> "%erl_ini%"
echo Rootdir=%converted_rootdir% >> "%erl_ini%"
goto :eof

:: Display usage information
:usage
echo Usage: %~n0 ^<task^>
echo.
echo Service Control
echo =====================
echo install                             # installs the release as a service
echo uninstall                           # uninstalls the release service
echo start                               # starts the service
echo start_boot                          # not implemented
echo foreground                          # start the release in the foreground
echo console                             # run the release in a local shell
echo console_clean                       # not implemented
echo stop                                # stops the service
echo restart                             # restarts the release service
echo reboot                              # alias for restart on Windows
echo reload_config                       # reload the current system's configuration from disk
echo.
echo Upgrades
echo =====================
echo upgrade ^<version^>                   # upgrade the current release service
echo downgrade ^<version^>                 # downgrade the current release service
echo.
echo Utilities
echo =====================
echo attach                              # alias for remote_console on Windows
echo remote_console                      # open a remote console connected to the release
echo pid                                 # get the process id of the running release
echo ping                                # ping the current release service, pong is returned if ok
echo pingpeer ^<peer^>                     # check if a peer node is running, pong is returned if ok
echo escript ^<file^>                      # execute an escript
echo rpc ^<mod^> ^<fun^> ^[^<args..^>^]          # execute an RPC call using the given MFA
echo rpcterms ^<mod^> ^<fun^> ^[^<expr^>^]       # execute an RPC call using the given Erlang expr for args
echo eval ^<expr^>                         # execute the given Erlang expr on the running node
echo command ^<mod^> ^<fun^> ^[^<args..^>^]      # execute the given module/function in a clean VM
echo describe                            # list details about the release
echo.
echo Custom Commands
echo ======================
for %%i in (%command_dir%\*.bat) do (
  echo %%~ni
)
goto :eof

:: Install the release as a Windows service
:: or install the specified version passed as argument
:install
setlocal EnableDelayedExpansion
set service_args=%erl_opts% -setcookie "!cookie!" ^
       -pa "%consolidated_dir%" ++ ^
       -rootdir "%rootdir%" ^
       -reldir "%release_root_dir%\releases"
set start_erl=%erts_dir%\bin\start_erl.exe
set description=Erlang node %node_name% in %rootdir%
if "" == "%args%" (
  :: Install the service
  %erlsrv% add %service_name% ^
            -c "%description%" ^
            %node_type% "%node_name%" ^
            -w "%mutable_dir%" ^
            -m "%start_erl%" ^
            -args "!service_args!" ^
            -debugtype new ^
            -stopaction "init:stop()."
  endlocal
) else (
  :: relup and reldown
  endlocal
  goto upgrade
)
goto :eof

:: Uninstall the Windows service
:uninstall
%erlsrv% remove %service_name%
%epmd% -kill
goto :eof

:: Start the Windows service
:start
call :pre_configure_hooks
call :post_configure_hooks
call :pre_start_hooks
%erlsrv% start %service_name%
call :post_start_hooks
goto :eof

:: Stop the Windows service
:stop
call :pre_stop_hooks
%erlsrv% stop %service_name%
call :post_stop_hooks
goto :eof

:: Upgrade this release
:upgrade
setlocal EnableDelayedExpansion
if "" == "%args%" (
  echo Missing version argument
  echo Usage: %rel_name% %taskname% {version}
  set ERRORLEVEL=1
  exit /b %ERRORLEVEL%
)
set source_version=%rel_vsn%
set target_version=%args%
:: Unpack
%escript% "%release_root_dir%\bin\release_utils.escript" ^
    unpack_release %rel_name% "%node_type%" "%node_name%" "!cookie!" "%target_version%"
if %ERRORLEVEL% GEQ 1 exit /b %ERRORLEVEL%
:: Update env
set rel_vsn=%target_version%
set rel_dir=%release_root_dir\releases\%target_version%
:: TODO: init_configs
if exist "%rel_dir%\sys.config.bak" do (
  move /Y "%rel_dir%\sys.config.bak" "%rel_dir%\sys.config"
)
if exist "%rel_dir%\vm.args.bak" do (
  move /Y "%rel_dir%\vm.args.bak" "%rel_dir%\vm.args"
)
copy /B /Y "%rel_dir%/sys.config" "%rel_dir%\sys.config.bak"
copy /B /Y "%rel_dir%/vm.args" "%rel_dir%\vm.args.bak"
copy /B /Y "%sys_config" "%rel_dir%/sys.config"
copy /B /Y "%vm_args%" "%rel_dir%/vm.args"
:: Run pre hooks
call :pre_configure_hooks
call :post_configure_hooks
call :pre_upgrade_hooks
:: Perform upgrade
%escript% "%rootdir%/bin/release_utils.escript" ^
    install_release "%rel_name%" "%node_type%" "%node_name%" "!cookie!" "%target_version%"
if %ERRORLEVEL% GEQ 1 exit /b %ERRORLEVEL%
:: Cleanup
move /Y "%rel_dir%\sys.config.bak" "%rel_dir%\sys.config"
move /Y "%rel_dir%\vm.args.bak" "%rel_dir%\vm.args"
:: Run post hooks
call :post_upgrade_hooks
endlocal
goto :eof

:: Start a console
:console
call :pre_configure_hooks
call :post_configure_hooks
call :pre_start_hooks
start "%rel_name% console" %werl% -boot "%boot_script%" ^
       -config "%sys_config%"  ^
       -args_file "%vm_args%" ^
       -user Elixir.IEx.CLI ^
       -extra --no-halt +iex
goto :eof

:: Start the release in the foreground
:foreground
call :pre_configure_hooks
call :post_configure_hooks
call :pre_start_hooks
set EMU=beam
set PROGNAME=%~n0
start "" /B "%erl%" -noshell -noinput +Bd ^
       -boot "%boot_script%" ^
       -boot_var ERTS_LIB_DIR %ERTS_LIB_DIR% ^
       -boot_var ROOT %ROOT% ^
       -env ERL_LIBS "%release_root_dir%\lib%" ^
       -pa "%consolidated_dir%" ^
       -args_file "%vm_args%" ^
       -config "%sys_config%" ^
       %erl_opts% ^
       -extra %extra_opts%
call :set_pid
call :post_start_hooks
call :wait_for_exit
goto :eof

:wait_for_exit
tasklist /FI "PID eq %pid%" | find /I "erl.exe" > nul
if %ERRORLEVEL% geq 1 (
  :: Process has shutdown
  call :post_stop_hooks
) else (
  timeout /T 5 /nobreak > nul
  goto :wait_for_exit
)
goto :eof

:ping
call %libexec_dir%\ping.bat
goto :eof

:pingpeer
call %libexec_dir%\pingpeer.bat %args%
goto :eof

:: Execute an escript
:escript
%escript% %args%
goto :eof

:: Execute an RPC command
:rpc
call :ping>NUL
if %ERRORLEVEL% NEQ 0 exit /b %ERRORLEVEL%
setlocal EnableDelayedExpansion
call %libexec_dir%\release_remote_ctl.bat rpc !args!
endlocal
goto :eof

:: Eval an expression locally
:eval
setlocal EnableDelayedExpansion
call %libexec_dir%\release_ctl.bat eval !args!
endlocal
goto :eof

:: Execute a command in a clean Erlang VM
:command
setlocal EnableDelayedExpansion
for /f "tokens=1-2*" %%a in ("%args%") do (
  set module=%%a
  set function=%%b
  set command_args=%%c
)
%erl% -boot_var ERTS_LIB_DIR %ERTS_LIB_DIR%^
      -config %sys_config% ^
      -hidden ^
      -noshell ^
      -boot %clean_boot_script% ^
      -pa "%consolidated_dir%" ^
      -s %module% %function% ^
      -s init stop ^
      -extra %command_args%
endlocal
goto :eof

:: Get the process id of the running node
:pid
call %libexec_dir%\pid.bat
goto :eof

:set_pid
call :ping>NUL
if %ERRORLEVEL% NEQ 0 exit /b %ERRORLEVEL%
setlocal EnableDelayedExpansion
set get_pid_cmd=%libexec_dir%\pid.bat
for /f "usebackq delims=" %%i in (`%get_pid_cmd%`) do set pid=%%i
endlocal & set pid=%pid%
if %pid% equ +%pid% (
  goto :eof
) else (
  echo "Invalid PID: %pid%"
  echo "Node must be down, or pid detection returned non-numeric value"
  exit /b 1
)
exit /b 1

:: Reload the running configuration
:reload_config
call :ping>NUL
if %ERRORLEVEL% NEQ 0 exit /b %ERRORLEVEL%
call :pre_configure_hooks
call :post_configure_hooks
call %libexec_dir%\release_remote_ctl.bat reload_config --sysconfig="%sys_config%"
goto :eof

:: Describe this release
:describe
setlocal EnableDelayedExpansion
echo Service Information
echo =====================
%erlsrv% list %service_name%
echo.
echo Release Metadata
echo =====================
echo ERTS                %erts_vsn%
echo Release Directory   %rel_dir%
echo Config File         %sys_config%
echo Args File           %vm_args%
echo Name Type           %node_type%
echo Node Name           %node_name%
echo Node Cookie         !cookie!
echo Extra Opts          %erl_opts%
echo.
echo Hooks:
for %%i in (%hook_dir%\*.d\*.bat) do (
  echo %%i
)
echo.
echo Commands:
for %%i in (%command_dir%\*.bat) do (
  echo %%i
)
endlocal
goto :eof

:: Remote shell to a running node
:remote_console
call :ping
if %ERRORLEVEL% NEQ 0 exit /b %ERRORLEVEL%
setlocal EnableDelayedExpansion
set id=remsh%RANDOM%-%node_name%
start "%node_name% attach" %werl% -hidden -noshell -boot "%clean_boot_script%" ^
       -user Elixir.IEx.CLI %node_type% %id% -setcookie "!cookie!" ^
       -extra --no-halt +iex -%node_type% %id% --cookie "!cookie!" --remsh %node_name%
endlocal
goto :eof

:: Hook helpers
:execute_hooks
for /r "%hook_dir%\%1.d" %%f in (*.bat) do (
  echo Running %1 hook: %%f
  %%f
  if %ERRORLEVEL% GEQ 1 exit /b %ERRORLEVEL%
)
goto :eof

:pre_configure_hooks
call :execute_hooks pre_configure
goto :eof

:post_configure_hooks
call :execute_hooks post_configure
goto :eof

:pre_start_hooks
call :execute_hooks pre_start
goto :eof

:post_start_hooks
call :execute_hooks post_start
goto :eof

:pre_stop_hooks
call :execute_hooks pre_stop
goto :eof

:post_stop_hooks
call :execute_hooks post_stop
goto :eof

:pre_upgrade_hooks
call :execute_hooks pre_upgrade
goto :eof

:post_upgrade_hooks
call :execute_hooks post_upgrade
goto :eof

:: This batch file handles managing an Erlang node as a Windows service.
::
:: Check the :usage section for information about what this script provides

@echo off

:: Set variables that describe the release
set rel_name=<%= release_name %>
set rel_vsn=<%= release_version %>
set erts_vsn=<%= if ((is_binary(include_erts) or include_erts) and not is_nil(erts_vsn)) do %><%= erts_vsn %><% end %>
set erl_opts=<%= erl_opts %>

:: Discover the release root directory from the directory
:: of this script
set script_dir=%~dp0
for %%A in ("%script_dir%\..\..") do (
  set release_root_dir=%%~fA
)
set rel_dir=%release_root_dir%\releases\%rel_vsn%
set libexec_dir=%rel_dir%\libexec\win

set ROOT=%release_root_dir%
set EMU=beam

if "%RELEASE_MUTABLE_DIR%"=="" (
  set mutable_dir=%release_root_dir%\var
) else (
  set mutable_dir=%RELEASE_MUTABLE_DIR%
)

if "%RELEASE_CONFIG_DIR%"=="" (
  set config_dir=%release_root_dir%
) else (
  set config_dir=%RELEASE_CONFIG_DIR%
)

set log_dir=%mutable_dir%\log

:: Create directories which don't exist
if not exist %mutable_dir% mkdir %mutable_dir%
if not exist %config_dir% mkdir %config_dir%
if not exist %log_dir% mkdir %log_dir%

call :find_erts_dir
call :find_sys_config
call :find_vm_args
call :set_boot_script_var

set service_name=%rel_name%_%rel_vsn%
set bindir=%erts_dir%\bin
set progname=erl.exe
set clean_boot_script=%release_root_dir%\bin\start_clean
set erlsrv="%bindir%\erlsrv.exe"
set epmd="%bindir%\epmd.exe"
set escript="%bindir%\escript.exe"
set werl="%bindir%\werl.exe"
set consolidated_dir=%rootdir%\lib\%rel_name%-%rel_vsn%\consolidated
set hook_dir=%rel_dir%\hooks
set command_dir=%rel_dir%\commands

:: Extract node type and name from vm.args
for /f "usebackq tokens=1-2" %%I in (`findstr /b "\-name \-sname" "%vm_args%"`) do (
  set node_type=%%I
  set node_name=%%J
)

:: Extract cookie from vm.args
for /f "usebackq tokens=1-2" %%I in (`findstr /b \-setcookie "%vm_args%"`) do (
  set cookie=%%J
)

:: Write the erl.ini file to set up paths relative to this script
call :write_ini

:: If a start.boot file is not present, copy one from the named .boot file
if not exist "%rel_dir%\start.boot" (
  copy "%rel_dir%\%rel_name%.boot" "%rel_dir%\start.boot" >nul
)

:: Get the first argument as the task name, shift the remaining arguments
set taskname="%1"
shift /1

set args=
setlocal EnableDelayedExpansion
:parse_args
:: Get next arg
set param=%~1

:: Escape parens in parameter
set param=%param:(=^^(%
set param=%param:)=^^)%

:: If there is no value for this argument, we're done
if "%~1"=="" goto :args_parsed

:: If we have arguments, append to them, start them otherwise
:: Also, when expanding the argument, escape quotes
if "!largs!"=="" (
  set largs=%param:"=\"%
) else (
  set largs=%largs% %param:"=\"%
)

:: Set space as the argument delimiter
set "delim= "

:: Shift to the next argument and loop
shift /1
goto :parse_args

:args_parsed
endlocal & set args=%largs%

if %taskname%=="install" goto install
if %taskname%=="uninstall" goto uninstall
if %taskname%=="start" goto start
if %taskname%=="foreground" goto foreground
if %taskname%=="console" goto console
if %taskname%=="stop" goto stop
if %taskname%=="restart" call :stop && goto start
if %taskname%=="reboot" call :stop && goto start
if %taskname%=="reload_config" goto reload_config
if %taskname%=="upgrade" goto upgrade
if %taskname%=="downgrade" goto upgrade
if %taskname%=="attach" goto remote_console
if %taskname%=="remote_console" goto remote_console
if %taskname%=="pid" goto pid
if %taskname%=="ping" goto ping
if %taskname%=="pingpeer" goto pingpeer
if %taskname%=="escript" goto escript
if %taskname%=="rpc" goto rpc
if %taskname%=="eval" goto eval
if %taskname%=="command" goto command
if %taskname%=="describe" goto describe
if %taskname%=="" goto usage
if exist "%command_dir%\%taskname%.bat" (
  "%command_dir%\%taskname%.bat" %*
) else (
  echo Unknown command: %taskname%
)
goto :eof

:: Find the ERTS dir
:find_erts_dir
if "%erts_vsn%"=="" (
  call :use_system_erts
) else (
  call :use_bundled_erts
)
goto :eof

:: Load system ERTS info
:use_system_erts
for /f "delims=" %%i in ('where erl') do set system_erl="%%i"
if %system_erl%=="" (
  echo failed to locate the Erlang Runtime System!
  exit /b 1
)
set system_root_dir_cmd=%system_erl% -noshell -eval "io:format(\"~s\", [filename:nativename(code:root_dir())])." -s init stop
for /f "delims=" %%i in ('%%system_root_dir_cmd%%') do set system_root=%%i
set system_erts_vsn_cmd=%system_erl% -noshell -eval "Ver=erlang:system_info(version),io:format(\"~s\", [Ver])" -s init stop
for /f "delims=" %%i in ('%%system_erts_vsn_cmd%%') do set system_erts_vsn=%%i
set erl=%system_erl%
set erts_vsn=%system_erts_vsn%
set ROOTDIR=%system_root%
set erts_dir=%rootdir%\erts-%erts_vsn%
set ERTS_LIB_DIR=%ROOTDIR%\lib
goto :eof

:: Load bundled ERTS info
:use_bundled_erts
set erts_dir=%release_root_dir%\erts-%erts_vsn%
set erl=%erts_dir%\bin\erl
set ROOTDIR=%release_root_dir%
set ERTS_LIB_DIR=%release_root_dir%\lib
goto :eof

:: Find the sys.config file
:find_sys_config
set possible_sys=%release_config_dir%\sys.config
if exist %possible_sys% (
  set sys_config_src=%possible_sys%
) else (
  set sys_config_src=%rel_dir%\sys.config
)
set sys_config_target=%config_dir%\sys.config
:: Replace environment variables
powershell -command "$content = get-content %sys_config_src%; [regex]::matches($content, '\${[\w\d_-]+}') | foreach { $content = $content.Replace($_.value, [System.Environment]::GetEnvironmentVariable($_.value)) }; out-file -filepath %sys_config_target% -inputobject $content -encoding ascii"
set sys_config=%sys_config_target%
goto :eof

:find_vm_args
set possible_vmargs=%release_config_dir%\vm.args
if exist %possible_vmargs% (
  set vmargs_src=%possible_vmargs%
) else (
  set vmargs_src=%rel_dir%\vm.args
)
set vmargs_target=%config_dir%\vm.args
:: Replace environment variables
powershell -command "$content = get-content %vmargs_src%; [regex]::matches($content, '\${[\w\d_-]+}') | foreach { $content = $content.Replace($_.value, [System.Environment]::GetEnvironmentVariable($_.value)) }; out-file -filepath %vmargs_target% -inputobject $content -encoding ascii"
set vm_args=%vmargs_target%
goto :eof

:: set boot_script variable
:set_boot_script_var
if exist %rel_dir%\%rel_name%.boot (
  set boot_script=%rel_dir%\%rel_name%
) else (
  set boot_script=%rel_dir%\start
)
goto :eof

:: Write the erl.ini file
:write_ini
if not "%system_erl%"=="" goto :eof
set erl_ini=%erts_dir%\bin\erl.ini
set converted_bindir=%bindir:\=\\%
set converted_rootdir=%rootdir:\=\\%
echo [erlang] > "%erl_ini%"
echo Bindir=%converted_bindir% >> "%erl_ini%"
echo Progname=%progname% >> "%erl_ini%"
echo Rootdir=%converted_rootdir% >> "%erl_ini%"
goto :eof

:: Display usage information
:usage
echo Usage: %~n0 ^<task^>
echo.
echo Service Control
echo =====================
echo install                             # installs the release as a service
echo uninstall                           # uninstalls the release service
echo start                               # starts the service
echo start_boot                          # not implemented
echo foreground                          # start the release in the foreground
echo console                             # run the release in a local shell
echo console_clean                       # not implemented
echo stop                                # stops the service
echo restart                             # restarts the release service
echo reboot                              # alias for restart on Windows
echo reload_config                       # reload the current system's configuration from disk
echo.
echo Upgrades
echo =====================
echo upgrade ^<version^>                   # upgrade the current release service
echo downgrade ^<version^>                 # downgrade the current release service
echo.
echo Utilities
echo =====================
echo attach                              # alias for remote_console on Windows
echo remote_console                      # open a remote console connected to the release
echo pid                                 # get the process id of the running release
echo ping                                # ping the current release service, pong is returned if ok
echo pingpeer ^<peer^>                     # check if a peer node is running, pong is returned if ok
echo escript ^<file^>                      # execute an escript
echo rpc ^<mod^> ^<fun^> ^[^<args..^>^]          # execute an RPC call using the given MFA
echo rpcterms ^<mod^> ^<fun^> ^[^<expr^>^]       # execute an RPC call using the given Erlang expr for args
echo eval ^<expr^>                         # execute the given Erlang expr on the running node
echo command ^<mod^> ^<fun^> ^[^<args..^>^]      # execute the given module/function in a clean VM
echo describe                            # list details about the release
echo.
echo Custom Commands
echo ======================
for %%i in (%command_dir%\*.bat) do (
  echo %%~ni
)
goto :eof

:: Install the release as a Windows service
:: or install the specified version passed as argument
:install
setlocal EnableDelayedExpansion
set service_args=%erl_opts% -setcookie "!cookie!" ^
       -pa "%consolidated_dir%" ++ ^
       -rootdir "%rootdir%" ^
       -reldir "%release_root_dir%\releases"
set start_erl=%erts_dir%\bin\start_erl.exe
set description=Erlang node %node_name% in %rootdir%
if "" == "%args%" (
  :: Install the service
  %erlsrv% add %service_name% ^
            -c "%description%" ^
            %node_type% "%node_name%" ^
            -w "%mutable_dir%" ^
            -m "%start_erl%" ^
            -args "!service_args!" ^
            -debugtype new ^
            -stopaction "init:stop()."
  endlocal
) else (
  :: relup and reldown
  endlocal
  goto upgrade
)
goto :eof

:: Uninstall the Windows service
:uninstall
%erlsrv% remove %service_name%
%epmd% -kill
goto :eof

:: Start the Windows service
:start
call :pre_configure_hooks
call :post_configure_hooks
call :pre_start_hooks
%erlsrv% start %service_name%
call :post_start_hooks
goto :eof

:: Stop the Windows service
:stop
call :pre_stop_hooks
%erlsrv% stop %service_name%
call :post_stop_hooks
goto :eof

:: Upgrade this release
:upgrade
setlocal EnableDelayedExpansion
if "" == "%args%" (
  echo Missing version argument
  echo Usage: %rel_name% %taskname% {version}
  set ERRORLEVEL=1
  exit /b %ERRORLEVEL%
)
set source_version=%rel_vsn%
set target_version=%args%
:: Unpack
%escript% "%release_root_dir%\bin\release_utils.escript" ^
    unpack_release %rel_name% "%node_type%" "%node_name%" "!cookie!" "%target_version%"
if %ERRORLEVEL% GEQ 1 exit /b %ERRORLEVEL%
:: Update env
set rel_vsn=%target_version%
set rel_dir=%release_root_dir\releases\%target_version%
:: TODO: init_configs
if exist "%rel_dir%\sys.config.bak" do (
  move /Y "%rel_dir%\sys.config.bak" "%rel_dir%\sys.config"
)
if exist "%rel_dir%\vm.args.bak" do (
  move /Y "%rel_dir%\vm.args.bak" "%rel_dir%\vm.args"
)
copy /B /Y "%rel_dir%/sys.config" "%rel_dir%\sys.config.bak"
copy /B /Y "%rel_dir%/vm.args" "%rel_dir%\vm.args.bak"
copy /B /Y "%sys_config" "%rel_dir%/sys.config"
copy /B /Y "%vm_args%" "%rel_dir%/vm.args"
:: Run pre hooks
call :pre_configure_hooks
call :post_configure_hooks
call :pre_upgrade_hooks
:: Perform upgrade
%escript% "%rootdir%/bin/release_utils.escript" ^
    install_release "%rel_name%" "%node_type%" "%node_name%" "!cookie!" "%target_version%"
if %ERRORLEVEL% GEQ 1 exit /b %ERRORLEVEL%
:: Cleanup
move /Y "%rel_dir%\sys.config.bak" "%rel_dir%\sys.config"
move /Y "%rel_dir%\vm.args.bak" "%rel_dir%\vm.args"
:: Run post hooks
call :post_upgrade_hooks
endlocal
goto :eof

:: Start a console
:console
call :pre_configure_hooks
call :post_configure_hooks
call :pre_start_hooks
start "%rel_name% console" %werl% -boot "%boot_script%" ^
       -config "%sys_config%"  ^
       -args_file "%vm_args%" ^
       -user Elixir.IEx.CLI ^
       -extra --no-halt +iex
goto :eof

:: Start the release in the foreground
:foreground
call :pre_configure_hooks
call :post_configure_hooks
call :pre_start_hooks
set EMU=beam
set PROGNAME=%~n0
start "" /B "%erl%" -noshell -noinput +Bd ^
       -boot "%boot_script%" ^
       -boot_var ERTS_LIB_DIR %ERTS_LIB_DIR% ^
       -boot_var ROOT %ROOT% ^
       -env ERL_LIBS "%release_root_dir%\lib%" ^
       -pa "%consolidated_dir%" ^
       -args_file "%vm_args%" ^
       -config "%sys_config%" ^
       %erl_opts% ^
       -extra %extra_opts%
call :set_pid
call :post_start_hooks

:wait_for_exit
tasklist /FI "PID eq %pid%" | find /I "erl.exe" > nul
if %ERRORLEVEL% geq 1 (
  :: Process has shutdown
  call :post_stop_hooks
) else (
  timeout /T 5 /nobreak > nul
  goto :wait_for_exit
)
goto :eof

:: Ping the running node
:ping
setlocal EnableDelayedExpansion
call %libexec_dir%\release_ctl.bat ping --peer="%node_name%" --cookie="!cookie!"
endlocal
goto :eof

:: Ping a peer node
:: Ping a peer node
:pingpeer
setlocal EnableDelayedExpansion
if "%args"=="" (
  echo "Peer name is required!"
  exit /b 1
) else (
  call %libexec_dir%\release_ctl.bat ping --peer="%args%" --cookie="!cookie!"
)
endlocal
goto :eof

:: Execute an escript
:escript
%escript% %args%
goto :eof

:: Execute an RPC command
:rpc
call :ping>NUL
if %ERRORLEVEL% NEQ 0 exit /b %ERRORLEVEL%
setlocal EnableDelayedExpansion
call %libexec_dir%\release_remote_ctl.bat rpc !args!
endlocal
goto :eof

:: Eval an expression locally
:eval
setlocal EnableDelayedExpansion
call %libexec_dir%\release_ctl.bat eval !args!
endlocal
goto :eof

:: Execute a command in a clean Erlang VM
:command
setlocal EnableDelayedExpansion
for /f "tokens=1-2*" %%a in ("%args%") do (
  set module=%%a
  set function=%%b
  set command_args=%%c
)
%erl% -boot_var ERTS_LIB_DIR %ERTS_LIB_DIR%^
      -config %sys_config% ^
      -hidden ^
      -noshell ^
      -boot %clean_boot_script% ^
      -pa "%consolidated_dir%" ^
      -s %module% %function% ^
      -s init stop ^
      -extra %command_args%
endlocal
goto :eof

:: Get the process id of the running node
:pid
call :ping>NUL
if %ERRORLEVEL% NEQ 0 exit /b %ERRORLEVEL%
setlocal EnableDelayedExpansion
call %libexec_dir%\release_remote_ctl.bat rpc "IO.inspect(:erlang.list_to_integer(:os.getpid()))"
endlocal
goto :eof

:set_pid
call :ping>NUL
if %ERRORLEVEL% NEQ 0 exit /b %ERRORLEVEL%
setlocal EnableDelayedExpansion
set get_pid_cmd=call :pid
for /f "usebackq delims=" %%i in ('%%get_pid_cmd%%') do set pid=%%i
endlocal & set pid=%pid%
goto :eof

:: Reload the running configuration
:reload_config
call :ping>NUL
if %ERRORLEVEL% NEQ 0 exit /b %ERRORLEVEL%
call :pre_configure_hooks
call :post_configure_hooks
call %libexec_dir%\release_remote_ctl.bat reload_config --sysconfig="%sys_config%"
goto :eof

:: Describe this release
:describe
setlocal EnableDelayedExpansion
echo Service Information
echo =====================
%erlsrv% list %service_name%
echo.
echo Release Metadata
echo =====================
echo ERTS                %erts_vsn%
echo Release Directory   %rel_dir%
echo Config File         %sys_config%
echo Args File           %vm_args%
echo Name Type           %node_type%
echo Node Name           %node_name%
echo Node Cookie         !cookie!
echo Extra Opts          %erl_opts%
echo.
echo Hooks:
for %%i in (%hook_dir%\*.d\*.bat) do (
  echo %%i
)
echo.
echo Commands:
for %%i in (%command_dir%\*.bat) do (
  echo %%i
)
endlocal
goto :eof

:: Remote shell to a running node
:remote_console
call :ping
if %ERRORLEVEL% NEQ 0 exit /b %ERRORLEVEL%
setlocal EnableDelayedExpansion
set id=remsh%RANDOM%-%node_name%
start "%node_name% attach" %werl% -hidden -noshell -boot "%clean_boot_script%" ^
       -user Elixir.IEx.CLI %node_type% %id% -setcookie "!cookie!" ^
       -extra --no-halt +iex -%node_type% %id% --cookie "!cookie!" --remsh %node_name%
endlocal
goto :eof

:: Hook helpers
:execute_hooks
for /r "%hook_dir%\%1.d" %%f in (*.bat) do (
  echo Running %1 hook: %%f
  %%f
  if %ERRORLEVEL% GEQ 1 exit /b %ERRORLEVEL%
)
goto :eof

:pre_configure_hooks
call :execute_hooks pre_configure
goto :eof

:post_configure_hooks
call :execute_hooks post_configure
goto :eof

:pre_start_hooks
call :execute_hooks pre_start
goto :eof

:post_start_hooks
call :execute_hooks post_start
goto :eof

:pre_stop_hooks
call :execute_hooks pre_stop
goto :eof

:post_stop_hooks
call :execute_hooks post_stop
goto :eof

:pre_upgrade_hooks
call :execute_hooks pre_upgrade
goto :eof

:post_upgrade_hooks
call :execute_hooks post_upgrade
goto :eof


Change page header to icta

Change page header to icta

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/Bionexo/icta.git/'


Add missed file: web/template/contribution/form.html.eex

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

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

  <% end %>

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

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

<% end %>

error: pathspec 'web/templates/contribution/form.html.eex' did not match any file(s) known to git


changing labels

changing labels

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/thluiz/ddd21.git/'


Removed OPAM link.

Removed OPAM link.

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/inchingforward/monument.git/'


Add last snapshot (thumbnail) to offline email if available

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/evercam/evercam-media.git/'


Adding freestanding SIG selector

Adding freestanding SIG selector

  <%= form_for @conn, user_path(@conn, :select_sig_submit), [name: :search], fn _ -> %>
  <%= raw ParamSession.form_session @conn %>

      <fieldset>

Choose a Special Interest Group (SIG) *

        <%= if @sig do %>
          You are currently a member of <%= @sig %>, if you would like to change SIGs, please choose another one below. Note that when you change SIGs, you will be put in a different discussion forum cohort, see different design groups, have access to different resources, etc. Updating the forum settings might take up to a day.
        <% else %>

Before you can continue with any of the interactive activities, you first need to select a SIG.  These SIGs were designed based on responses from the early students in this course. Most of the collaborative work in this MOOC will happen within your SIG, and some of the discussion forums will only be for your SIG (it might take a day for you to gain access to these).

      <% end %>

              <select name='f[sig_id]'>
                <option value=noselection>Please select from this list</option>
                <%= for sig <- sigs do %>
                <option value=<%= sig.id %>><%= sig.name %></option>
                <% end %>
              </select>
            </fieldset>

Submit

            <% end %>

error: pathspec 'web/templates/user/select_sig_freestanding.html.eex' did not match any file(s) known to git


Updated copy.

Updated copy.


Added requestor email to Timelapse extractor complete email.


Added equal sign to global variable in email template.


feat(admin): sql sidebar

feat(admin): sql sidebar

error: pathspec 'web/templates/admin/sidebar/sql.html.eex' did not match any file(s) known to git


Add the suggestions text under the search bar

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/DoSomethingToHelp/howtohelp.git/'


pilot adjustments

pilot adjustments


fixes dummy page layout

fixes dummy page layout

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/lookuppm/package_finder.git/'


Add templates/token/index

Add templates/token/index

Tokens

      JTI
      AUD
      SUB
      EXP
      CLAIMS

    <%= for token <- @tokens do %>
      <tr class='<%= if @current_jti == token.jti, do: "alert alert-warning", else: ""%>'>
        <%= token.jti %>
        <%= token.aud %>
        <%= token.sub %>
        <%= token.exp %>

<%= inspect(token.claims, pretty: true) %>

          <%= form_tag token_path(@conn, :delete, token.jti), method: :delete do %>
            <button class='btn btn-danger'>Revoke</button>
          <% end %>

    <% end %>

error: pathspec 'web/templates/token/index.html.eex' did not match any file(s) known to git


Update static/vendors/ace-builds/demo/kitchen-sink/docs/html_elixir.eex

Signed-off-by: Bernard Ojengwa <fccb4cc00c1ba7e51bf5c2b5f77130b9fe8d917e@gmail.com>

Listing Books

    Title
    Summary

<%= for book <- @books do %>

    <%# comment %>
    <%= book.title %>
    <%= book.content %>
    <%= link "Show", to: book_path(@conn, :show, book) %>
    <%= link "Edit", to: book_path(@conn, :edit, book) %>
    <%= link "Delete", to: book_path(@conn, :delete, book), method: :delete, data: [confirm: "Are you sure?"] %>

<% end %>

<%= link "New book", to: book_path(@conn, :new) %>

error: pathspec 'static/vendors/ace-builds/demo/kitchen-sink/docs/html_elixir.eex' did not match any file(s) known to git


Update title

Update title

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/pgolm/noise.git/'


Properly generate authentication path in header

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/Mantrum/cocobot.git/'


Added InfoWindows.

Added InfoWindows.


update post link to the new author/permlink route

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/grctest/glasnost.git/'


downloads adjusts

downloads adjusts


Add template

Add template

Academic Papers

This is where we consolidate academic papers for all
                      BEAM languages and the BEAM itself.

List of papers

                        <%= for ap <- @academic_papers do %>

                            <a href="<%= ap.link %>"><%= ap.name %>

                        <% end %>

error: pathspec 'lib/erlef_web/templates/page/academic_papers.html.eex' did not match any file(s) known to git


Update copy in user/show template

Update copy in user/show template

How to talk to us

You can ask us any parenting or family question, but so that we can help you please provide as much context as you are comfortable with.

For example, if you need advice around your child's sleeping, let us know their age and bedtime routine. This means we can give you really tailored advice.

You can use the online chat to the right and one of our experts will get back to you as soon as possible. If no one is available straight away you can fill in your email address and you'll be notified when someone is available to talk to you.

Speak to us on the phone

If you'd rather speak to one of our experts on the phone, you can arrange a time for us to call you.

    <%= link to: user_callback_path(@conn, :show, @user)  do %>
      <button class="<%= red_button() %>">Arrange a call</button>
    <% end %>

Speak to us again

To speak to the same parenting expert again and carry on your conversation, make a note of the 8 digit code below.

You can use the code for online chat or on the phone.

Your Code: <%= @user.uuid %>

Speak to us on the phone

If you'd rather speak to one of our experts on the phone, you can arrange a time for us to call you.

    <%= link to: user_callback_path(@conn, :show, @user)  do %>
      <button class="<%= red_button() %>">Arrange a call</button>
    <% end %>

Speak to us again

To speak to the same parenting expert again and carry on your conversations, make a note of this code. You can use the code for online chat or on the phone.

Your Code: <%= @user.uuid %>


polish

polish

A liquid democracy where anyone can vote on anything.

How it works

    Trust metrics, moderation free

    Delegations, useful for objective polls

    Topics, references

    Prevents cherry picking of facts and voters

    Liquio Link

error: pathspec 'web/templates/landing/learn.html.eex' did not match any file(s) known to git


cp template

cp template

Политика конфиденциальности для пользователей приложения "Wise Rider"

error: pathspec 'web/templates/page/cp.html.eex' did not match any file(s) known to git


add education page

add education page

Education Working Group

Mission Statement

Facilitate, evolve education and training and consolidate educational material(s)
                                        for all BEAM languages and the BEAM itself.

Benefits to the community

Be a resource to find information on how to educate on the BEAM technologies

Be a resource that you could use to encourage your company to adopt the BEAM
                                            technologies

Facilitate education and training on the BEAM languages

Short term deliverables

Make an analysis of the gaps in the current state of the field so we can
                                            identify how to best help the community

Create a plan and present it to the board so they can allocate resources
                                            whenever necessary

Long term deliverables

Help grow the community by providing ramp-up materials and training to fill
                                            the gaps that have been identified

Coordination work with different organizations both commercial and
                                            non-profit to foster support for BEAM technologies. Some examples are
                                            bridges, conferences, meetups & user groups

Provide educational resources for corporate decision-makers who are
                                            researching Ecosystem technologies

Why does this group require the Foundation

A point of organization, resources, influence, and provision of funds for
                                            training and educational purposes

A trusted and canonical source of educational materials and guidance

Companies that are considering investing in this Ecosystem want to see a
                                            robust community, which includes active Foundation involvement

Initial list of volunteers

Brujo Benavides

Desmond Bowe

Francesco Cesarini

Fred Hebert

Ben Marx

Anna Neyzberg

Bryan Paxton

Miriam Pena

Todd Resudek

Peer Stritzinger

Mrinal Wadhwa

Alistair Woodman

error: pathspec 'lib/erlef_web/templates/page/education.html.eex' did not match any file(s) known to git


adjusts

adjusts


Add footer partial

Add footer partial

benchee version: <%= dependencies.benchee %>

benchee_html version: <%= dependencies.benchee_html %>

error: pathspec 'priv/templates/partials/footer.html.eex' did not match any file(s) known to git


Fix alignment issue with categories

Fix alignment issue with categories

<% use Glayu.EEx %>
  <% parents = parents(@page.category.keys) |> Enum.drop(1) %>
  <%= if length(parents) > 0 do %>

        <%= for parent <- parents do %>

<a href="<%= parent.path %>"><%= parent.name %>

        <% end %>

<%= @page.category.name %>

  <% end %>

      <%= if length(parents) > 0 do %>

<%= @page.category.name %>

      <% end %>
      <% latest_category_posts = category_posts(@page.category.keys, [limit: 10]) %>
      <%= for post <- latest_category_posts do %>

<a href="<%= post.path %>"><%= post.title %>

              <%= Date.format(post.date, "%e %b %Y") %>
              <%= if length(post.categories) > 1 do %>
                on <%= (for category <- post.categories |> Enum.drop(1), do: "#{category.name}") |> Enum.join(", ") %>
              <% end %>

          <%= if post[:featured_image] do %>
            <img src="<%= post.featured_image %>" alt="Featured image" class="thumbnail img-responsive">
          <% end %>

            <%= post.summary %>

          <%= if post[:author] do %>

By <%= post[:author] %>

          <% end %>

Continue reading <a href="<%= post.path %>"><%= post.title %>

      <% end %>

          <%= for subcategory <- subcategories(@page.category.keys) do %>

<%= subcategory.keys |> category_posts |> length %><a href="<%= subcategory.path %>"><%= subcategory.name %>

          <% end %>

      <%= for post <- category_posts(@page.category.keys, [limit: 10, sort_fn: &(&1.score > &2.score)]), post.score > 10 do %>

<a href="<%= post.path %>"><%= post.title %>

              <%= post.summary %>
              <a href="<%= post.path %>" class="pull-right">Read more

      <% end %>

<% use Glayu.EEx %>
  <% parents = parents(@page.category.keys) |> Enum.drop(1) %>
  <%= if length(parents) > 0 do %>

        <%= for parent <- parents do %>

<a href="<%= parent.path %>"><%= parent.name %>

        <% end %>

<%= @page.category.name %>

<%= @page.category.name %>

  <% end %>

      <% latest_category_posts = category_posts(@page.category.keys, [limit: 10]) %>
      <%= for post <- latest_category_posts do %>

<a href="<%= post.path %>"><%= post.title %>

              <%= Date.format(post.date, "%e %b %Y") %>
              <%= if length(post.categories) > 1 do %>
                on <%= (for category <- post.categories |> Enum.drop(1), do: "#{category.name}") |> Enum.join(", ") %>
              <% end %>

          <%= if post[:featured_image] do %>
            <img src="<%= post.featured_image %>" alt="Featured image" class="thumbnail img-responsive">
          <% end %>

            <%= post.summary %>

          <%= if post[:author] do %>

By <%= post[:author] %>

          <% end %>

Continue reading <a href="<%= post.path %>"><%= post.title %>

      <% end %>

          <%= for subcategory <- subcategories(@page.category.keys) do %>

<%= subcategory.keys |> category_posts |> length %><a href="<%= subcategory.path %>"><%= subcategory.name %>

          <% end %>

      <%= for post <- category_posts(@page.category.keys, [limit: 10, sort_fn: &(&1.score > &2.score)]), post.score > 10 do %>

<a href="<%= post.path %>"><%= post.title %>

              <%= post.summary %>
              <a href="<%= post.path %>" class="pull-right">Read more

      <% end %>


Move new log link to the top of page

Move new log link to the top of page

Scrolling to the bottom is painful on mobile!

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/alex-handley/climbing_training_app.git/'


Frontend: Add '+' signs in krihelimeter calculation in about page

This project proposes an alternative to <%= link "github's trending page", to: "https://www.github.com/trending" %>, by exposing projects with high contribution rate, instead of daily stars (similarly to github's pulse page).
The krihelimeter of each repository is calculated using the number of authors, commits, pull requests, and issues of that project, from the past week.

    Krihelimeter =
    20
     * authors +

    8
     * merged and proposed pull requests +

    8
     * new and closed issues +

    1
     * commits

During the development of this project I found out that people use github as a backup service, automating hundreds of commits per week.
Therefor, to filter these projects out, only projects with more than one author enters the Krihelinator DB.

Want to know more?

The Krihelinator is an <%= link "open source project", to: "https://www.github.com/Nagasaki45/krihelinator" %> written in <%= link "elixir", to: "http://elixir-lang.org/" %>.
Contributions, of any kind, are more than welcome and highly appreciated :-).

This project proposes an alternative to <%= link "github's trending page", to: "https://www.github.com/trending" %>, by exposing projects with high contribution rate, instead of daily stars (similarly to github's pulse page).
The krihelimeter of each repository is calculated using the number of authors, commits, pull requests, and issues of that project, from the past week.

    Krihelimeter =
    20
     * authors

    8
     * merged and proposed pull requests

    8
     * new and closed issues

    1
     * commits

During the development of this project I found out that people use github as a backup service, automating hundreds of commits per week.
Therefor, to filter these projects out, only projects with more than one author enters the Krihelinator DB.

Want to know more?

The Krihelinator is an <%= link "open source project", to: "https://www.github.com/Nagasaki45/krihelinator" %> written in <%= link "elixir", to: "http://elixir-lang.org/" %>.
Contributions, of any kind, are more than welcome and highly appreciated :-).


Add new _share.html template with share buttons

error: pathspec 'lib/elixir_jobs_web/templates/shared/_share.html.eex' did not match any file(s) known to git


add journal template

add journal template

#!/bin/bash
# Fleet Journal Retrieval Script
#

echo "Prepping SSH keys..."
eval `ssh-agent -s`
if [ -f /root/.ssh/id_rsa ]; then
  chmod 0600 /root/.ssh/id_rsa > /dev/null
  if [ $? -ne 0 ]; then
    echo "ERROR: adding key for OpenAperture to ssh agent." 1>&2
  fi

  ssh-add /root/.ssh/id_rsa 1> /dev/null 2> /dev/null
fi

echo "Current running image is:"
yes | fleetctl --tunnel=<%= host_ip %> cat <%= unit_name %> | grep ExecStart= | awk '{print $NF}'

# Done setting up SSH keys
echo "Executing journal command:  yes | fleetctl --tunnel=<%= host_ip %> journal <%= unit_name %>"
yes | fleetctl --tunnel=<%= host_ip %> journal <%= unit_name %>

if [ $? -ne 0 ]; then
	if [ <%= verify_result %> = true ] ; then
	  echo "Journal command has failed!!"
	  ssh-agent -k
	  exit 1
	fi
fi

ssh-agent -k
echo "Journal command finished successfully!"

error: pathspec 'templates/fleetctl-journal.sh.eex' did not match any file(s) known to git


Added again index template removed accidentally

error: pathspec 'web/templates/page/index.html.eex' did not match any file(s) known to git


Add License info to the website itself

Add License info to the website itself

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/LTheGreats/Your_name_is_this.git/'


Fixed the size of the image for desktop and make it full for mobile devices.

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/evercam/evercam-media.git/'


Include bootstrap

Include bootstrap

<!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>Hello Phoenix!</title>

    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css">

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

Get Started

<%= 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>Hello Phoenix!</title>
    <link rel="stylesheet" href="<%= static_path(@conn, "/css/app.css") %>">

Get Started

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

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

      <%= @inner %>


Add sign-in link

Add sign-in link

Welcome to Phoenix!

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

Sign In with Fitbit

Resources

        Guides

        Docs

        Source

Help

        Mailing list

        #elixir-lang on freenode IRC

        @elixirphoenix

Welcome to 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


Replaced volunteer url with full name in task index list

      Tasks

      <%= link "New task", to: task_path(@conn, :new), class: "mdl-button mdl-js-button mdl-button--raised" %>

        Name
        Start time
        Finish time
        Assignee

      <%= for task <- @tasks do %>

            <%= task.name %>

            <%= task.start_time %>

            <%= task.finish_time %>

            <%= if task.user_id do %>
              <%= task.user.name %> <%= task.user.family_name %>
              <%= if String.length(to_string task.user.nickname) > 0 do %>
                (<%= task.user.nickname %>)
              <% end %>
            <% else %>
              No one
            <% end %>

            <button id="tr_menu_<%= task.id %>"
                    class="mdl-button mdl-js-button mdl-button--icon"
            >
              more_vert
            </button>
            <ul class="mdl-menu mdl-menu--bottom-right mdl-js-menu"
                for="tr_menu_<%= task.id %>"
            >

                <%= link "Show", to: task_path(@conn, :show, task) %>

                <%= link "Edit", to: task_path(@conn, :edit, task) %>

                <%= link "Delete", to: task_path(@conn, :delete, task), method: :delete, data: [confirm: "Are you sure?"] %>

      <% end %>

      Tasks

      <%= link "New task", to: task_path(@conn, :new), class: "mdl-button mdl-js-button mdl-button--raised" %>

        Name
        Start time
        Finish time
        Assignee

      <%= for task <- @tasks do %>

            <%= task.name %>

            <%= task.start_time %>

            <%= task.finish_time %>

            <%= task_user(@conn, task) %>

            <button id="tr_menu_<%= task.id %>"
                    class="mdl-button mdl-js-button mdl-button--icon"
            >
              more_vert
            </button>
            <ul class="mdl-menu mdl-menu--bottom-right mdl-js-menu"
                for="tr_menu_<%= task.id %>"
            >

                <%= link "Show", to: task_path(@conn, :show, task) %>

                <%= link "Edit", to: task_path(@conn, :edit, task) %>

                <%= link "Delete", to: task_path(@conn, :delete, task), method: :delete, data: [confirm: "Are you sure?"] %>

      <% end %>


Remove duplicate render view on Admin Layout

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/jonathansoifer/dotcom-backend.git/'


Remove Description META Tag from App Layout


Add new training types

Add new training types

add fun and outside training types.


link for contact form

link for contact form

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/thluiz/ddd21.git/'


Remove gtcode from repo

Remove gtcode from repo

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/gtcode/phoenix_chat.git/'


added a div with an id elm ought to be able to see, so elm can build of it

error: pathspec 'web/templates/pdf/new.html.eex' did not match any file(s) known to git


Edits the about page copy.

Edits the about page copy.

Here are some suggestions to tidy up the copy on the About page, as per issue #23. What do you think?

What is ElixirStatus?

ElixirStatus is a site built by the community to provide an outlet where we can post stuff we have created.

It is not so much a link sharing platform where you post stuff you find, but more of a creator-hub where you can post when you have something new to announce, like:

a project

a blog post

a version update

an episode of your podcast

or if you are organizing a meetup/conference

Your announcement will then appear on this website, in RSS, on Twitter and /r/elixir.

The idea is to have something akin to what RubyFlow is for Ruby, but bringing the Elixir community's ideas to the table.

Last but not least, ElixirStatus is a web app written in Elixir+Phoenix running in production.

Together with sites like Elixir Jobs it is intended to serve as a case study for the community, so you can point your boss to these sites if he or she wants to see "proof" that this "Elixir thing" is actually a viable alternative to Ruby/Python/Node when building the next web project.

What is ElixirStatus?

ElixirStatus is a site built by the community to create an outlet where we can post stuff we created.

It is not so much a link sharing platform where you post stuff you find, but more of a creator-hub where you can post when you have something new to announce, like

a project,

blog post,

version update,

episode of your podcast or

if you are organizing a meetup/conference.

Your annoucement will then appear on this website, in RSS, on Twitter and /r/elixir.

The idea is to have something akin to what RubyFlow is for Ruby, but bringing the Elixir community's ideas to the table.

Last but not least, ElixirStatus is a web app written in Elixir+Phoenix running in production.

Together with sites like Elixir Jobs, it is intended to serve as a case study for the community, so you can point your boss to these sites if he or she wants to see "proof" that this "Elixir thing" is actually a viable alternative to Ruby/Python/Node when building the next web project.


added whiteboard template

added whiteboard template

<!DOCTYPE html>

  <title>Whiteboard</title>

  <link rel="stylesheet" type="text/css" href="/static/whiteboard.css" />

  <canvas id="whiteboard" width="500" height="500">
    no support
  </canvas>

    <button id="hideshow">></button>
    <form id="form" style="display:none">

        Color:
        <input type="text" id="pen-color-input" name="penColor" value="#FF0000" size="6" />

        Width:
        <input type="text" id="pen-width-input" name="penWidth" value="4" size="6" />

Users

    </form>

error: pathspec 'web/templates/whiteboard.html.eex' did not match any file(s) known to git


Fixed broken button in camera shared email (#593)


Updated new user template

Updated new user template

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/riverrun/openmaize-phoenix.git/'


Fix typo: seeher -> seeder

Fix typo: seeher -> seeder

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/tchoutri/magnetissimo.git/'


Removed Interval from Timelapse start email.


director of art

director of art


Re-display ow2 link and logo

Re-display ow2 link and logo


Change description to textarea

Change description to textarea

Description are painful to enter on mobile as a text_input.


Remove sumome and ga from template

Remove sumome and ga from template

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/gtcode/phoenix-trello.git/'


Forgot a file

Forgot a file

error: pathspec 'web/templates/login/unauthorized.html.eex' did not match any file(s) known to git


Fixes the space between two term table

Fixes the space between two term table

      Courses

    <%= if @conn.assigns.current_user.role == "Coordinator" do %>

        <%= link "New course", to: offered_course_path(@conn, :new), class: "mdl-button mdl-js-button mdl-button--raised" %>

    <% end %>

  <%= for term <- @terms do %>

            <%= term.name %>

            Course type
            Number of sessions

          <%= Enum.with_index(term.offered_courses) |> Enum.map(fn {offered_course,index} -> %>

                <%= offered_course.course.name %>

                <%= offered_course.number_of_sessions %>

                <button id="tr_menu_<%= offered_course.id %>"
                        class="mdl-button mdl-js-button mdl-button--icon"
                >
                  more_vert
                </button>
                <ul
                  class="
                    mdl-menu mdl-js-menu
                    <%=
                      if index > 10 and index > length(@offered_courses)-4 do
                        'mdl-menu--top-right'
                      else
                        'mdl-menu--bottom-right'
                      end
                    %>
                  "
                  for="tr_menu_<%= offered_course.id %>"
                >

                    <%= link "Show", to: offered_course_path(@conn, :show, offered_course) %>

                  <%= if @conn.assigns.current_user.role == "Coordinator" do %>

                      <%= link "Edit", to: offered_course_path(@conn, :edit, offered_course) %>

                      <%= link "Delete", to: offered_course_path(@conn, :delete, offered_course), method: :delete,
                      data: [confirm: """
                      Are you sure?
                      All of its attached classes and relevant attendances will be removed.
                      """] %>

                  <% end %>
                  <%= if @conn.assigns.current_user.role == "Teacher" do %>

                      <%= link "Edit", to: offered_course_path(@conn, :edit, offered_course) %>

                  <% end %>

          <% end) %>

  <% end %>


Implement navigation bar.

Implement navigation bar.

<!DOCTYPE html>

XEE.JP

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

              <%= current_user(@conn).name %>

トップページ

実験管理画面

<%= link "ログアウト", to: session_path(@conn, :delete) %>

        <% else %>

<%= link "新規登録", to: registration_path(@conn, :new) %>

<%= link "ログイン", to: session_path(@conn, :new) %>

        <% end %>

    <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>Hello Phoenix!</title>
    <link rel="stylesheet" href="<%= static_path(@conn, "/css/app.css") %>">
    <link rel="stylesheet" href="<%= static_path(@conn, "/css/vendor.css") %>">

<%= 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>Hello Phoenix!</title>
    <link rel="stylesheet" href="<%= static_path(@conn, "/css/app.css") %>">
    <link rel="stylesheet" href="<%= static_path(@conn, "/css/vendor.css") %>">

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

                <%= current_user(@conn).name %>

トップページ

実験管理画面

<%= link "ログアウト", to: session_path(@conn, :delete) %>

          <% else %>

<%= link "新規登録", to: registration_path(@conn, :new) %>

<%= link "ログイン", to: session_path(@conn, :new) %>

          <% end %>

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

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

      <%= @inner %>


Template missing from the previous commit.

current_attendance

<label class="checkbox-inline">
  <input type="checkbox" id="inlineCheckbox1" value="option1"> 1
</label>
<label class="checkbox-inline">
  <input type="checkbox" id="inlineCheckbox1" value="option1"> 1
</label>
<label class="checkbox-inline">
  <input type="checkbox" id="inlineCheckbox1" value="option1"> 1
</label>
<label class="checkbox-inline">
  <input type="checkbox" id="inlineCheckbox1" value="option1"> 1
</label>
<label class="checkbox-inline">
  <input type="checkbox" id="inlineCheckbox1" value="option1"> 1
</label>

<br />

<%= for player <- @players do %>
  <label class="btn btn-primary">
    <input type="checkbox"
           id="inlineCheckbox<%= player.id %>"
           value="<%= player.id %>"> <%= player.nickname %>
  </label>
<% end %>
<p />

error: pathspec 'web/templates/game_night/current_attendance.html.eex' did not match any file(s) known to git


Fix assigns

Fix assigns

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/babie/goal-server.git/'


Put a comma after requestor name.

Put a comma after requestor name.


Organize Public Pipeline Layout Structure