Open nelsonic opened 6 years ago
see: https://github.com/dwyl/github-backup#run-a-github-backup-server section,
To load the environment variables we need to run source .env
before running mix deps.get
to allow the application to compile
@SimonLab yeah, that's what I thought ... thanks. 👍
@nelsonic - is there anything from this that you feel could be changed in the readme to make it better or can this issue now be closed?
When attempting to run
mix phx.gen.secret
Got:
code/github-backup $ mix phx.gen.secret
** (Mix.Config.LoadError) could not load config config/config.exs
** (KeyError) key "SECRET_KEY_BASE" not found in: %{"APP_HOST" => "localhost", "Apple_PubSub_Socket_Render" => "/private/tmp/com.apple.launchd.BggU0HEYKV/Render", "BINDIR" => "/usr/local/Cellar/erlang/20.2.2/lib/erlang/erts-9.2/bin", "COLORFGBG" => "15;0", "COLORTERM" => "truecolor", "EMU" => "beam", "HOME" => "/Users/Admin", "ITERM_PROFILE" => "Default", "ITERM_SESSION_ID" => "w0t0p0:695008F9-F3DD-4D60-A3D4-9593BF5BEC00", "LANG" => "en_GB.UTF-8", "LOGNAME" => "Admin", "PATH" => "/usr/local/Cellar/erlang/20.2.2/lib/erlang/erts-9.2/bin:/usr/local/Cellar/erlang/20.2.2/lib/erlang/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin", "PROGNAME" => "erl", "PWD" => "/code/github-backup", "ROOTDIR" => "/usr/local/Cellar/erlang/20.2.2/lib/erlang", "SHELL" => "/bin/bash", "SHLVL" => "1", "SSH_AUTH_SOCK" => "/private/tmp/com.apple.launchd.lTUjUwjj5X/Listeners", "TERM" => "xterm-256color", "TERM_PROGRAM" => "iTerm.app", "TERM_PROGRAM_VERSION" => "3.1.5", "TERM_SESSION_ID" => "w0t0p0:695008F9-F3DD-4D60-A3D4-9593BF5BEC00", "TMPDIR" => "/var/folders/0m/hlrnvx6n5qv001qcm6x9ny440000gn/T/", "USER" => "Admin", "XPC_FLAGS" => "0x0", "XPC_SERVICE_NAME" => "0", "__CF_USER_TEXT_ENCODING" => "0x1F5:0x0:0x2"}
Ironically i'm getting a KeyError
while trying to generate my key ... 🙄
In your terminal just paste the following:
export SECRET_KEY_BASE=WhgLiQCoxn4A/WNY/i5Ll5PxeQc0HOafjb+m1Xxk4ALsrX+cdEvmaTb987654321
obvs if you're running this in "production" you would use a "real" randomly generated key.
I ended up running the
mix phx.gen.secret
in a different project becausegithub-backup
would not let me ... 🐔 v.s 🥚 ... 😕
after setting up the app: https://github.com/apps/gitbu
exporting all the suggested environment variables,
I attempted to run the tests on localhost
with mix test
but sadly the S3 test unhappy:
1) test GET / (AppWeb.PageControllerTest)
test/app_web/controllers/page_controller_test.exs:4
** (UndefinedFunctionError) function AppWeb.AWS.S3.get_files_bucket/0 is undefined or private
I have exported the AWS/S3 specific environment variables in my .env
file:
export AWS_ACCESS_KEY_ID=AKIAI...
export AWS_SECRET_ACCESS_KEY=yKWnRy...
export S3_BUCKET_NAME=dwyl-github-backup
@SimonLab / @Cleop what else
do I need to make this work...? 🤔
I did a git clone
of master
into a separate directory
and using the environment variables defined previously, the tests pass on localhost
:
So I think I'm just going to "replay" my "documentation" changes onto a fresh copy of master
and re-open the PR. 👍
code/github-backup $ git rebase master First, rewinding head to replay your work on top of it... Applying: #31 Broken code with notes in comments Using index info to reconstruct a base tree... M config/config.exs M config/dev.exs M config/prod.exs M lib/app_web/controllers/event_controller.ex M lib/app_web/router.ex M mix.exs M mix.lock Falling back to patching base and 3-way merge... Auto-merging mix.lock CONFLICT (content): Merge conflict in mix.lock Auto-merging mix.exs CONFLICT (content): Merge conflict in mix.exs Auto-merging lib/app_web/router.ex CONFLICT (content): Merge conflict in lib/app_web/router.ex Auto-merging lib/app_web/controllers/event_controller.ex CONFLICT (content): Merge conflict in lib/app_web/controllers/event_controller.ex Auto-merging lib/app_web/controllers/aws/s3.ex CONFLICT (add/add): Merge conflict in lib/app_web/controllers/aws/s3.ex Auto-merging config/prod.exs CONFLICT (content): Merge conflict in config/prod.exs Auto-merging config/dev.exs CONFLICT (content): Merge conflict in config/dev.exs Auto-merging config/config.exs CONFLICT (content): Merge conflict in config/config.exs error: Failed to merge in the changes. Patch failed at 0001 #31 Broken code with notes in comments The copy of the patch that failed is found in: .git/rebase-apply/patch
When you have resolved this problem, run "git rebase --continue". If you prefer to skip this patch, run "git rebase --skip" instead. To check out the original branch and stop rebasing, run "git rebase --abort".
fixed. ✅
@SimonLab - is this branch still needed? Haven't we completed this functionality elsewhere?
@Cleop I have updated the issue title and description to reflect the fact that these issues were present for me regardless of the branch. Meanwhile I have resolved the issue(s) and prepared a PR: #64
I attempted to run
mix deps.get
onlocalhost
and got the following error:I'm re-reading the Docs (README) to see if I "missed a step" ...