Skip to content
This repository has been archived by the owner on Nov 9, 2022. It is now read-only.

Allow tx.config file to be located in GitHub #65

Open
oliverlockwood opened this issue Oct 27, 2016 · 3 comments
Open

Allow tx.config file to be located in GitHub #65

oliverlockwood opened this issue Oct 27, 2016 · 3 comments

Comments

@oliverlockwood
Copy link

The file containing details of your translatable resources (i.e. the one along these lines: http://docs.transifex.com/client/config/) currently has to be located along with the TXGH deployment.

In my opinion, intuitively this file belongs with the resources themselves - i.e. in GitHub. In fact, it took me some time staring at the following stacktrace in TXGH before I realised that it wasn't looking in GitHub!

2016-10-27T09:04:00.175359+00:00 app[web.1]: /app/vendor/bundle/ruby/2.2.0/gems/parseconfig-1.0.8/lib/parseconfig.rb:47:in `validate_config'
2016-10-27T09:04:00.175362+00:00 app[web.1]: /app/lib/txgh/parse_config.rb:20:in `new'
2016-10-27T09:04:00.175359+00:00 app[web.1]: #<Errno::EACCES: Permission denied - .tx/config is not readable>
2016-10-27T09:04:00.175360+00:00 app[web.1]: /app/vendor/bundle/ruby/2.2.0/gems/parseconfig-1.0.8/lib/parseconfig.rb:39:in `initialize'
2016-10-27T09:04:00.175363+00:00 app[web.1]: /app/lib/txgh/parse_config.rb:20:in `load_file'
2016-10-27T09:04:00.175363+00:00 app[web.1]: /app/lib/txgh/tx_config.rb:5:in `load_file'
2016-10-27T09:04:00.175365+00:00 app[web.1]: /app/lib/txgh/key_manager.rb:19:in `config_from_repo'
2016-10-27T09:04:00.175365+00:00 app[web.1]: /app/lib/txgh/app.rb:95:in `block in <class:Hooks>'

I wonder if it might be possible to make an enhancement such that (optionally) TXGH gets this config from a file in the project's GitHub repository?

If this proposal is acceptable, I'd be happy to look into implementing this (probably by starting with looking at the KeyManager.config_from_repo() method.

Please let me know your thoughts.

@matthewjackowski
Copy link
Contributor

@oliverlockwood So I think the behavior you are seeing is because the Txgh code 'defaults' to looking in its own tree.

However you should be able to override this by altering the path contained in the configuration in the txgh.yml. Specifically the key you are looking for is: `transifex -> projects -> [My project name] -> tx_config

Also for maximum flexibility these config values can be set by an actual YAML file or a set of ENV variables

@oliverlockwood
Copy link
Author

Hi @matthewjackowski, thanks for getting back to me.

In my txgh.yml file, I have already set the config value you describe to .tx/config, which is the location of the tx config file within my repo on Github. However, I got the EACCESS described above until I took a copy of the .tx/config file and included it alongside my TXGH deployment.

Should I be setting the config value to a fully-qualified http path to the file in Github? Or is there some other way to indicate to TXGH to look for that path within the Github repo, rather than in the filesystem local to its own deployment?

@matthewjackowski
Copy link
Contributor

Yes, I would give a try using the fully qualified pathname.

Basically my thinking is that you are going to setup the .tx directory into your source repo. You can see here for an example: https://github.com/matthewjackowski/txgh-test-resources
But then you will need to pull this file into your Txgh server somewhere and setup the Txgh config to refer to that full path.

While this does lead to a somewhat complex initial setup, it means you can use Txgh and the Tx client interchangeably.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants