Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove certificate migration code #3894

Closed
mholt opened this issue Nov 30, 2020 · 7 comments
Closed

Remove certificate migration code #3894

mholt opened this issue Nov 30, 2020 · 7 comments
Assignees
Milestone

Comments

@mholt
Copy link
Member

mholt commented Nov 30, 2020

Caddy and CertMagic contain code that converts certificates from older formats and folder structures to newer ones. It only needed to be run one time, if upgrading from (really) old versions. Most of this code has been in place for years already, and most of it caters to v1-and-v2-beta-era Caddy and its contemporary CertMagic, which has not been in use for quite some time, and the v2 beta versions were never realeased (stable) in the first place. So I think pretty much everyone who needs it has used it already.

This extra code can be removed to simplify the code base, and it'll be easy enough to put up the source code for a simple CLI tool that can do the conversion manually if anyone else still needs it. I've already created such a tool for a customer's deployment so I just need to polish it a little and post the code when I remove it from Caddy and CertMagic.

@mholt mholt added this to the v2.4.0 milestone Nov 30, 2020
@mholt mholt self-assigned this Nov 30, 2020
@tobya
Copy link
Collaborator

tobya commented Dec 6, 2020

I'm still on 1.04x if I upgrade to v2 will this removal affect my migration.

I presume the worst that happens is that LE needs to issue new certs all in one go?

@mholt
Copy link
Member Author

mholt commented Dec 6, 2020

Don't miss the part where I said I'll post the migration code in a main() so you can run it as a CLI tool, so it will still be possible to migrate quickly. You'll want to double-check that everything worked properly. But yeah, if you don't move the certs over, Caddy will just get new certificates. If you have in the range of, say, 10-100 certs, this won't be a problem.

You should upgrade to v2 ASAP anyway though.

@tobya
Copy link
Collaborator

tobya commented Dec 7, 2020

You should upgrade to v2 ASAP anyway though.

Yes I know. I was waiting for the on directive to be migrated, but I dont think it is going to be, so I'll take another look at it.

@mholt
Copy link
Member Author

mholt commented Dec 8, 2020

@tobya Ah yes, that's right. I just need to make some time and sit down and figure out a design for the eventing system. That's kind of related to #2344.

@francislavoie
Copy link
Member

Reminder about this @mholt, still want to do it in v2.4.0?

@mholt
Copy link
Member Author

mholt commented Feb 22, 2021

Yeah. I'm still extracting the code into a separate main(). Maybe I'll just finish that now.

mholt added a commit to caddyserver/certmagic that referenced this issue Feb 22, 2021
@mholt mholt closed this as completed in f6bb02b Feb 22, 2021
@mholt
Copy link
Member Author

mholt commented Feb 22, 2021

Ad-hoc migration program can be found here: https://gist.github.com/mholt/f3a7277e54b26938401638d5786cd0d6

Tested it a couple times, seemed to work alright. Be sure to back up your files before using it!! Also, I don't have a ton of time to support it, so you're on your own (unless you're sponsoring, I guess) -- but for anyone finding this later, it's probably OK for the vast majority of you to just let Caddy regenerate needed assets the one time. If you find and fix a bug in the program, feel free to comment on the gist. Otherwise, you can get help in our forums: https://caddy.community

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

No branches or pull requests

4 participants
@tobya @mholt @francislavoie and others