-
-
Notifications
You must be signed in to change notification settings - Fork 5k
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
Report bugs to RouterOS deploy API #2344
Comments
Not really a bug, more a feature request, but only having a single RouterOS installation is probably quite uncommon, any posssibility to deploy to multiple instances of RouterOS? |
I like the idea, but let's flesh it out a bit more. You want a wildcard cert that is deployed to multiple routers? Or one cert per router? The first should be easy to add by passing a list for For the second case it should be doable now; just do another |
Thanks for the quick reply. Well, usually i don't use Wildcard Certificates, but the idea to specify a list of hosts would be definitely interesting. I have to admit, that while i wrote the first post, i only had tried the fritzbox deployhook. That hook saves the host, username and password within the But now, after i loocked into the diffrent deploy script's, i noticed, that the handling of how and if at all such configurations are saved is diffrent from script to script. Since i now know that After i now tried to use the script for the first time i now got the first bug. Yeah ;) I used the command
First of all, clearly i wasn't a success. But since their is no validation of the output of the ssh commands it's not surprising and more a beauty thing and also not that easy to validate. I got it to working by removing the quotation marks arround I hope this can be fixed somehow. If i have a quiet moment in the next time i will try to examine this closer and make a PR, but i can't promise anything. |
I created a pull request (#2413) for the ability to store the env vars inside the domain conf, fixed some errors like the line breaks in the routeros script which weren't working, and made it suitable for my use by making it possible to prevent setting the certificate for the |
@cngarrison For me the deploy hook for routeros still isn't working. I'm trying to deploy a cert from a Raspbian 9 (stretch) to a Mikrotik RouerOS v6.45.6 Is the deployhook working for you with v6.45.6? I'm wondering if only i have that problem or if i'm the only one trying/reporting? |
@herbetom I was able to get this working, I edited the
There's probably a cleaner way to do it, but that's how it's working for me right now. |
Thanks for your response @Nickmman! I will try it. |
@herbetom I upgraded to 6.45 and can confirm the same problem - fixed using the trailing slash for each line in the deploy script. |
Firstly I can confirm routeros deployment hook still works on 6.49.2 and 7.1.1, but I don't see the required environment variables are saved in conf. When renew by cron happens, the deploy hook won't work, right? I see this related PR #2413, but it's not merged. |
@sjtuross Yeah, I haven't checked if something has changed, but that's how I remember it. Feel free to take whatever you need from my #2413 so that you can implement a solution. But I don't know it that's any help 😅 As for the new syntax: since the old syntax still works on both (new and old) Router OS Versions it should probably stay in the old format for now since Routers with Version 6 are probably still the vast majority. |
I encountered some issues when trying to use the routeros deploy hook with my fresh RB5009 (still running 7.0.5). My setup is dockerized acme.sh and therefore I have an unusual path for ssh identity, so I had to hack it to be able to pass Second thing is the RouterOS script. I'm not familiar with routeros scripting but had problems in the first place. I now have working adoption for my setup including user derived from Third is that Please see and comment #3947 |
Just saw another change in dev by @mac-zhou. He introduced ROUTER_OS_PORT which was not in my base ... and came without mention in this thread ... We should discuss, whether to have different parameters for identity, ssh options (think of jump hosts ...) and the existing ROUTER_OS_PORT or just to have the command configurable (as the ssh deploy hook does). |
@abiessmann you can map a folder or volume with id_rsa and known_hosts to "/root/.ssh" in the container. |
@abiessmann there is a bug introduced in this PR #3947 that breaks deployment. I traced down to the below line today. I think the variable name should be $ROUTER_OS_USERNAME instead of $ROUTER_OS_USER. Currently the generated DEPLOY_SCRIPT_CMD is broken due to missing owner value. Line 133 in 9ebb2ac
P.S. It would be good to add |
Thanks. Not sure what you mean about ssh error. Below is what I got. After certs were pushed to ros, the next deploy command failed and then script run/delete command returned "no such item".
|
@sjtuross as you can see in your response the overall result is 'Success' ... Please see abiessmann@0fdb5ef for a possible solution ... feedback welcome ;) |
It's because it simply returns 0 as the return code. Ideally it should check the command result and return non-zero return code. |
I'm having the same issue. I tried a brand new install of acme.sh and got the above error (unexpected end of command) but on line 1 column 83. I'm using RouterOS 6.49.2 |
@bjmgeek could you please verify latest fix in #3986 (merged to https://github.com/acmesh-official/acme.sh/tree/dev) fixes your issue? |
@sjtuross you are completely right! Could you please check my branch https://github.com/abiessmann/acme.sh/tree/deploy_routeros_handle_remote_errors and check if this works for you and will detect those erroneous situations? |
@abiessmann I tried your branch. The error handling works as expected with the original bug. I think you could update the wording like
|
|
@abiessmann That branch worked.
|
I'm having a new routeros deploy issue now:
I'm guessing it's because of the wildcard certificate. Indeed, I tested the same configuration, with the only difference being I've set the ROUTER_OS_HOST, ROUTER_OS_PORT, and ROUTER_OS_USERNAME variables, and I have an ssh key set up for the router. |
#4637 is a pull request for this issue. |
The deploy hook doesn't work with the latest version of RouterOS (v7.13). Apparently, the issue is that RouterOS doesn't allow whitespaces in script names. This pull request #4940 should fix the issue. |
RouterOS v7.13 and later accepts whitespaces in script names just fine, but the deploy script now creates a script on MIkrotik device with underscores in the script name, but then tries to execute script with whitespaces in the name... This looks wrong. |
I agree, this is not a consistent behavior for RouterOS, and it might be reported to MikroTik as a bug. If you manually create a script, the console complains with the message:
This can be interpreted as "RouterOS does not support whitespaces", and it "helps" you by adding automatically underscores. But this "autocorrect" feature is not present in the script execution... IMHO, I still think that the best option is removing all whitespaces. |
What are you seeing that indicates it's executing script with whitespaces? |
So I understand correctly that the RouterOS deployhook is broken with acme.sh 3.0.8 and ROS 7.13.5?
|
There is an issue where certificate import removes certificate file, so there is no need for manual removal within ROS script. Running acme.sh 3.0.8 and ROS 7.15. My edit of ROS script:
|
I just added a PR that should address some of the issues people are seeing with newer routerOS versions, and should be backwards compatible. This should address the issue @kolegacik mentions, as well as the one @schumi4 mentions. |
This is the place to report bugs in the RouterOS deploy API.
If you experience a bug, please report it in this issue.
Thanks!
The text was updated successfully, but these errors were encountered: