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

Add OpenBSD rc.d script. #736

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

skarekrow
Copy link
Contributor

This has a few prerequisites:

  • Creating a _cloudflare_ddns user
  • Add a cloudflare_ddns section to your /etc/login.conf (for env variables, this is noted in the accompanying README commit

Relies on #733

@skarekrow
Copy link
Contributor Author

@favonia I tried to keep the style of your README, feel free to edit if you want it laid out differently. I also named the directory in the repo as rc.d, but it could just as easily be init, I'll leave that up to you. I think most non-systemd init systems use rc.d as the naming, but I'm not 100%

Copy link

codecov bot commented Apr 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.67%. Comparing base (dbde79b) to head (50c053c).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #736   +/-   ##
=======================================
  Coverage   95.67%   95.67%           
=======================================
  Files          58       58           
  Lines        2635     2635           
=======================================
  Hits         2521     2521           
  Misses        104      104           
  Partials       10       10           
Flag Coverage Δ
unittests 95.67% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

This has a few prerequisites:
- Creating a `_cloudflare_ddns` user
- Add a `cloudflare_ddns` section to your `/etc/login.conf` (for env variables, this is noted in the accompanying `README` commit

Relies on favonia#733
@favonia
Copy link
Owner

favonia commented Apr 25, 2024

@skarekrow Thank you! Could you put the files under contrib/ because, sadly, I will not be able to personally maintain these files? Feel free to update the README and/or rearrange files there.

@skarekrow
Copy link
Contributor Author

@favonia Whoops didn't even see the contrib directory! I moved the systemd services to have a similar structure and updated the README's for both.

_(contributed by [Brandon @skarekrow](https://github.com/skarekrow))_

To use:
- Simply copy the [rc.d](./openbsd/cloudflare_ddns) script located in the repo
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Simply copy the [rc.d](./openbsd/cloudflare_ddns) script located in the repo
- Copy the shipped [rc.d script](./openbsd/cloudflare_ddns) into `/etc/rc.d/`


```sh
cloudflare_ddns:\
:setenv=CF_API_TOKEN=YOUR_TOKEN,DOMAINS=THE_DOMAINS_YOU_WISH_TO_USE,EMOJI=false:\
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
:setenv=CF_API_TOKEN=YOUR_TOKEN,DOMAINS=THE_DOMAINS_YOU_WISH_TO_USE,EMOJI=false:\
:setenv=EMOJI=false,CF_API_TOKEN=YOUR-CLOUDFLARE-API-TOKEN,DOMAINS=YOUR-DOMAINS:\

@skarekrow I tweaked this line because

  1. It looks easy to accidentally change EMOJI=false when editing the domains if it goes to the end.
  2. The updater will print better error messages for the special value "YOUR-CLOUDFLARE-API-TOKEN".

However I have one question---the domains are comma-separated, but it seems setenv is also comma-separated. Wouldn't that be an issue? 🤔

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.

2 participants