Skip to content

Add ability to build the server for Windows and run it as a service#1328

Closed
wtf911 wants to merge 3 commits into
binwiederhier:mainfrom
wtf911:main
Closed

Add ability to build the server for Windows and run it as a service#1328
wtf911 wants to merge 3 commits into
binwiederhier:mainfrom
wtf911:main

Conversation

@wtf911
Copy link
Copy Markdown

@wtf911 wtf911 commented May 5, 2025

No description provided.

@wtf911
Copy link
Copy Markdown
Author

wtf911 commented May 5, 2025

Closes #1104

Example service creation command:

sc.exe create ntfy start= auto binPath= "YOURPATH\ntfy.exe serve"

To use a server.yml file you would create the service like this:

sc.exe create ntfy start= auto binPath= "YOURPATH\ntfy.exe serve --config YOURPATH\server.yml"
@wtf911 wtf911 changed the title Added the ability to build the server for Windows Add ability to build the server for Windows and run it as a service May 7, 2025
@wtf911
Copy link
Copy Markdown
Author

wtf911 commented May 7, 2025

Example service creation command:

sc.exe create ntfy start= auto binPath= "YOURPATH\ntfy.exe serve"

To use a server.yml file you would create the service like this:

sc.exe create ntfy start= auto binPath= "YOURPATH\ntfy.exe serve --config YOURPATH\server.yml"

@binwiederhier
Copy link
Copy Markdown
Owner

I really don't want to support ntfy server on Windows. It may build, but it will likely not work for all the things. And I have no time to test it. So while this is pretty cool that it works, I must respectfully decline the PR.

@wtf911
Copy link
Copy Markdown
Author

wtf911 commented May 22, 2025

Does it make a difference that I've been successfully running it 24/7 as a Windows service using a lot of the features without any issue? I'm using a reverse-proxy so it has HTTPS and I have webpush working great to the PWA on Android. Here's my active server.yml so we know that at least these settings are functional:

base-url: "https://ntfy.xxx.ddnsfree.com"
cache-file: "C:/Users/user/Downloads/ntfy/cache.db"
attachment-cache-dir: "C:/Users/user/Downloads/ntfy/attachments"
behind-proxy: true
listen-http: :82
attachment-expiry-duration: 24h
auth-file: "C:/Users/user/Downloads/ntfy/user.db"
auth-default-access: "deny-all"
web-push-public-key: BL4ZP2O2P7aYvwGODu8Hxxxxxxxxx1PpuDdvqYxtuW0vOw_NBPGdz-6qqTG1kpwNhnQkcJxxxxxxxxDKDB9oNeASezkWN0
web-push-private-key: w7_W1r2-DQOmmxxxxxxxx3MmNWl3HDs1_Ve7lq2E
web-push-file: "C:/Users/user/Downloads/ntfy/webpush.db"
web-push-email-address: user@gmail.com
visitor-attachment-total-size-limit: 500M
visitor-attachment-daily-bandwidth-limit: 1000M

It created all the needed files no problem and runs no problem. I point to the server.yml file by using the --config option. I made the pull request so that the build code mirrors your current code and just the resulting ntfy.exe would include the added server functionality so it wouldn't be any additional work on your end to include it in releases.

@binwiederhier binwiederhier reopened this May 24, 2025
@binwiederhier
Copy link
Copy Markdown
Owner

I think that does make a difference;-)

I'll just add a disclaimer saying that idk if it's gonna work, and redirect all issues to you hehe

@binwiederhier
Copy link
Copy Markdown
Owner

Can you try to add the Windows CI pipelines, and add it to the docs? That'd help

@wtf911
Copy link
Copy Markdown
Author

wtf911 commented May 27, 2025

Can you try to add the Windows CI pipelines, and add it to the docs? That'd help

I'm sorry, my coding isn't at the level of even knowing where to begin to add that I don't think, but if there's anything else I can do to help this get approved and open up people on Windows being able to run the server please let me know. :)

From a build perspective, the only other thing that needs to be installed on Linux for compiling it is: apt install gcc-mingw-w64-x86-64

That's the only difference. I compiled it from Linux using your standard Linux build environment that you build all of the other versions from.

@binwiederhier
Copy link
Copy Markdown
Owner

I'm sorry, my coding isn't at the level of even knowing where to begin to add that I don't think, but if there's anything else I can do to help this get approved and open up people on Windows being able to run the server please let me know. :)

Honestly, I don't think I want to support Windows at this time. Thank you for your contribution, but if there is nobody that can maintain things or even help out, I'd rather not open that box.

@amir1376irani
Copy link
Copy Markdown

Nice work here! Even though I’m not much of a Windows fan myself, I’ve looked through this PR and @wtf911 contributions, and I think their effort deserves to be preserved rather than lost.

If the main issue preventing progress is getting the Windows build to work properly in CI, I’m willing to dedicate some time to help make that happen. I understand that @binwiederhier isn’t keen on maintaining Windows support directly, but if @wtf911 is open to taking responsibility of that part, I’d be happy to contribute on the CI and build setup side — just not ongoing maintenance of the Windows-specific components.

In short, I’d like to help recover and build upon @wtf911 work so that Windows users can benefit from it without adding extra maintenance burden to the core team.

@wtf911
Copy link
Copy Markdown
Author

wtf911 commented Oct 18, 2025

@amir1376irani that's very kind of you. Getting ntfy to work for Windows when I'm not a soft developer was a passion project for myself and I too hoped it would open up ntfy to the many people that aren't going to run any software if there isn't a Windows option available.

I'm still here and still using my Windows version of ntfy that's been running 24/7 without issue.

alexlebens pushed a commit to alexlebens/infrastructure that referenced this pull request Jan 20, 2026
This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [binwiederhier/ntfy](https://ntfy.sh/) ([source](https://github.com/binwiederhier/ntfy)) | minor | `v2.15.0` → `v2.16.0` |

---

> ⚠️ **Warning**
>
> Some dependencies could not be looked up. Check the Dependency Dashboard for more information.

---

### Release Notes

<details>
<summary>binwiederhier/ntfy (binwiederhier/ntfy)</summary>

### [`v2.16.0`](https://github.com/binwiederhier/ntfy/releases/tag/v2.16.0)

[Compare Source](binwiederhier/ntfy@v2.15.0...v2.16.0)

This release adds support for  [updating and deleting notifications](https://docs.ntfy.sh/publish/#updating-deleting-notifications), [heartbeat-style / dead man's switch notifications](https://docs.ntfy.sh/publish/#scheduled-delivery), [custom Twilio call format](https://docs.ntfy.sh/config/#phone-calls), and makes `ntfy serve` work on Windows. It also adds a "New version available" banner to the web app.

This one is very exciting, as it brings a lot of highly requested features to ntfy.

**Features:**

- Support for [updating and deleting notifications](https://docs.ntfy.sh/publish/#updating-deleting-notifications) ([#&#8203;303](binwiederhier/ntfy#303), [#&#8203;1536](binwiederhier/ntfy#1536), [ntfy-android#151](binwiederhier/ntfy-android#151), thanks to [@&#8203;wunter8](https://github.com/wunter8) for the initial implementation)
- Support for heartbeat-style / [dead man's switch](https://en.wikipedia.org/wiki/Dead_man%27s_switch) notifications aka
  [updating and deleting scheduled notifications](https://docs.ntfy.sh/publish/#scheduled-delivery) ([#&#8203;1556](binwiederhier/ntfy#1556), [#&#8203;1142](binwiederhier/ntfy#1142), [#&#8203;954](binwiederhier/ntfy#954), thanks to [@&#8203;GamerGirlandCo](https://github.com/GamerGirlandCo) for the initial implementation)
- Configure [custom Twilio call format](https://docs.ntfy.sh/config/#phone-calls) for phone calls ([#&#8203;1289](binwiederhier/ntfy#1289), thanks to [@&#8203;mmichaa](https://github.com/mmichaa) for the initial implementation)
- `ntfy serve` now works on Windows, including support for running it as a Windows service ([#&#8203;1104](binwiederhier/ntfy#1104),  [#&#8203;1552](binwiederhier/ntfy#1552), originally [#&#8203;1328](binwiederhier/ntfy#1328),  thanks to [@&#8203;wtf911](https://github.com/wtf911))
- Web app: "New version available" banner ([#&#8203;1554](binwiederhier/ntfy#1554))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0Mi42OS4yIiwidXBkYXRlZEluVmVyIjoiNDIuNjkuMiIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiaW1hZ2UiXX0=-->

Reviewed-on: https://gitea.alexlebens.dev/alexlebens/infrastructure/pulls/3334
Co-authored-by: Renovate Bot <renovate-bot@alexlebens.net>
Co-committed-by: Renovate Bot <renovate-bot@alexlebens.net>
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

Successfully merging this pull request may close these issues.

3 participants