[MAGNOLIA-4068] Activation keypair file is generated in "current" directory Created: 13/Mar/12  Updated: 30/Mar/12  Resolved: 29/Mar/12

Status: Closed
Project: Magnolia
Component/s: activation, core
Affects Version/s: 4.5.1
Fix Version/s: 4.5.2

Type: Bug Priority: Critical
Reporter: Magnolia International Assignee: Federico Grilli
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
duplicate
is duplicated by MAGNOLIA-4071 Activation: keypair.properties gets c... Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:

 Description   

If you start Tomcat from the bin/ directory, the result is that you'll have <tomcat-home>/bin/WEB-INF/config/default/keypair.properties. Fun story, if the next time around, you start the same instance from a different location, the key won't be found.

Two issues, probably:

  • the default value for magnolia.author.key.location is a relative path (WEB-INF/config/default/keypair.properties. Prefixing it with ${magnolia.home} would be a quick and simple solution.
  • the value is used with new File(..path..); use one of the many methods we have lying around to make sure we use an absolute path, or that a relative path is relative to the webapp's root and not the current directory.


 Comments   
Comment by Christian Ringele [ 14/Mar/12 ]

Setting the value in magnolia.properties to:
magnolia.author.key.location=${magnolia.home}/WEB-INF/config/default/keypair.properties

helps only partially:

  • The directory and file is only created on fresh deployment of the repo.
    So a later change to the config doesn't help, cause the new configuration value is ignored.
  • After fresh deployment of the repo, the file was created as expected (only on author, not on public). Activation works locally, bot not on demo.
Comment by Philipp Bärfuss [ 15/Mar/12 ]

I confirm that the value ${magnolia.home}/WEB-INF/config/default/keypair.properties works as a workaround.

Comment by Magnolia International [ 28/Mar/12 ]

I'd suggest we also renamed the default file to magnolia-activation-keypair.properties (as opposed to keypair.properties); that'd be a little more explicit (for someone who'd stumble upon the file on his server, for example)

I don't think about the implications if we changed the default value for this property; let's just make sure it appears in the release notes. (in fact that value is already used in the example from the 4.5.1 release notes

Generated at Mon Feb 12 03:52:21 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.