Skip to content
This repository has been archived by the owner on May 14, 2024. It is now read-only.

Add ntfy egg #2582

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Add ntfy egg #2582

wants to merge 4 commits into from

Conversation

ThnksCJ
Copy link

@ThnksCJ ThnksCJ commented Dec 1, 2023

Description

Ntfy is a simple HTTP-based pub-sub notification service. It allows you to send notifications to your phone or desktop via scripts from any computer, and/or using a REST API.

Closed issue requesting ntfy: #2471

Checklist for all submissions

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?
  • Have you tested and reviewed your changes with confidence that everything works?
  • Did you branch your changes and PR from that branch and not from your master branch?
    • If not, why?:
  • You verify that the start command applied does not use a shell script
    • If some script is needed then it is part of a current yolk or a PR to add one
  • The egg was exported from the panel

New egg Submissions

  1. Does your submission pass tests (server is connectable)?
  2. Does your egg use a custom docker image?
    • Have you tried to use a generic image?
    • Did you PR the necessary changes to make it work?
  3. Have you added the egg to the main README.md and any other README files in subdirectories of the egg (e.g /game_eggs) according to the alphabetical order?
  4. Have you added a unique README.md for the egg you are adding according to the alphabetical order?
  5. You verify that the start command applied does not use a shell script
    • If some script is needed then it is part of a current yolk or a PR to add one
  6. The egg was exported from the panel

software/ntfy/egg-ntfy.json Show resolved Hide resolved
software/ntfy/egg-ntfy.json Outdated Show resolved Hide resolved
@ThnksCJ
Copy link
Author

ThnksCJ commented Dec 1, 2023

@QuintenQVD0 Ive added the changes you suggested could you look over it again?

@QuintenQVD0
Copy link
Collaborator

looks fine to me, just have to test it.

@QuintenQVD0
Copy link
Collaborator

@ThnksCJ How to we use this as the issue was closed because you like need to change the startup off the egg. so how does this egg handle this as I do not know this aplication

@ThnksCJ
Copy link
Author

ThnksCJ commented Dec 3, 2023

You can configure the server.yml file that gets created and it's already pre-configured with a working config on the default allocation host and port. You can configure it to add a proxy host and such but you would need to look through the docs for that. If you span up an instance and visited it on http then it would all be working as a basic thing

@ThnksCJ
Copy link
Author

ThnksCJ commented Dec 8, 2023

@QuintenQVD0 I changed the way the config is made to make it hopefully a bit more user friendly, could you look over it? Thanks 👍🏻

@@ -15,14 +15,14 @@
"file_denylist": [],
"startup": ".\/ntfy serve --config server\/server.yml",
"config": {
"files": "{\r\n \"server\/server.yml\": {\r\n \"parser\": \"yaml\",\r\n \"find\": {\r\n \"listen-http\": \":{{server.build.default.port}}\",\r\n \"cache-file\": \".\/cache.db\"\r\n }\r\n }\r\n}",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Wy did you remove this?

Copy link
Author

Choose a reason for hiding this comment

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

I removed this because this would only show when the server was started for the first time which I don't think is the best so I moved the server.yml creation into the init script.

Copy link
Collaborator

Choose a reason for hiding this comment

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

The files run on every startup and should be there as you must force the port it uses, and hard setting the cache db in it is also a good idea. The config just has to be in that place before the server starts for the first time.

Copy link
Author

Choose a reason for hiding this comment

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

Even though I create the file in the init script should I still keep it in the files? I just assumed it would be better as when the user installs the server they don't have to start it to see the configuration file

Copy link
Collaborator

Choose a reason for hiding this comment

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

End users do not see this configuration logic. it is expected that all ports an application uses are locked and users can not change it so they copy a config from somewhere, and it has another port set that it reverts that line back. else host will get flooded with support tickets.

@Stef-00012
Copy link

how do you manage users if the startup command is hard coded?
(to manage users and permissions it's ntfy user ... and ntfy access ...

@gOOvER
Copy link
Contributor

gOOvER commented Jan 2, 2024

how do you manage users if the startup command is hard coded? (to manage users and permissions it's ntfy user ... and ntfy access ...

change the startup in the egg or server, when you are admin?

@Stef-00012
Copy link

how do you manage users if the startup command is hard coded? (to manage users and permissions it's ntfy user ... and ntfy access ...

change the startup in the egg or server, when you are admin?

why? it would be enough to make the startup like ntfy {{ARGS}}
and make an env variable where the user can type user add xxx etc.

@ThnksCJ
Copy link
Author

ThnksCJ commented Jan 2, 2024

I thought users could be added using the web UI and it work the same as using a cmd to do it

@QuintenQVD0
Copy link
Collaborator

it should indeed, as the user will never be allowed to change the startup themselves in offical eggs.

@Stef-00012
Copy link

I thought users could be added using the web UI and it work the same as using a cmd to do it

how? in the web UI the add user button is only a way to log into users made with ntfy user add ..., and in the web UI there's no way to manage permissions (ntfy access ...)

@QuintenQVD0
Copy link
Collaborator

if that is true, this egg likely will be closed as uses are not allowed to self edit the startup

@ThnksCJ
Copy link
Author

ThnksCJ commented Jan 3, 2024

I thought users could be added using the web UI and it work the same as using a cmd to do it

how? in the web UI the add user button is only a way to log into users made with ntfy user add ..., and in the web UI there's no way to manage permissions (ntfy access ...)

I must have overlooked this fact, mabye ntfy won't work as an egg after all

@Stef-00012
Copy link

Stef-00012 commented Jan 4, 2024

if that is true, this egg likely will be closed as uses are not allowed to self edit the startup

can't it be done like so?
like ntfy ${OPTIONS}
where OPTIONS is a user_editable variable

@QuintenQVD0
Copy link
Collaborator

if that is true, this egg likely will be closed as uses are not allowed to self edit the startup

can't it be done like so? like ntfy ${OPTIONS} where OPTIONS is a user_editable variable

That would be better but is almost the same as just giving the user direct startup asses as you put a ; and the command and the panel will run it.

@ThnksCJ
Copy link
Author

ThnksCJ commented Jan 4, 2024

Doesn't the nodejs egg do something like that to start the main file? Wouldn't you be able to put a ; and it escape too

@QuintenQVD0
Copy link
Collaborator

Doesn't the nodejs egg do something like that to start the main file? Wouldn't you be able to put a ; and it escape too

yes technically yes, but that variable is locked to a max of 64 char and should (it is not) be locked with alpha_dash rule what as it sas only allows letters and _ and not symbols.

@ThnksCJ
Copy link
Author

ThnksCJ commented Jan 4, 2024

Then could you not do the same on this egg? Or would that raise password security issues

@QuintenQVD0
Copy link
Collaborator

Then could you not do the same on this egg? Or would that raise password security issues

Problem is it does not allow for - so many things (that's wy for node it is not set) will not work.
Even uppercase char are not allowed in alpha_dash. so I guess then indeed just lock it to 64 length and do it that way.

@QuintenQVD0
Copy link
Collaborator

QuintenQVD0 commented Jan 4, 2024

@ThnksCJ Can an admin used create other users on the web interface or is it all command line interface, else we just create 1 stock user.

seems like larvel 10 allowed - so alpha_dashshould be the way to go

@ThnksCJ
Copy link
Author

ThnksCJ commented Jan 4, 2024

From what i have read it all has to be done using the cli which is an issue, that is to create specific channels locked behind authentication. Not sure how we could overcome this issue without making a custom image that has a shell to accept commands or somehting

@QuintenQVD0
Copy link
Collaborator

From what i have read it all has to be done using the cli which is an issue, that is to create specific channels locked behind authentication. Not sure how we could overcome this issue without making a custom image that has a shell to accept commands or somehting

That wont be happening.

@Stef-00012
Copy link

Stef-00012 commented Jan 5, 2024

found out in the server.yml file you can add these 3 settings

enable-signup: true # anyone can create an account through the web ui
enable-login: true # anyone can login into accounts through the web ui using user and pass
enable-reservations: true # anyone can reserve topics for themselves

only limit is you can't choose who can make accounts and who can't, or who can reserve and who can't

however technically you can if you enable these settings only when you want to create an account or manage reserved topics and disable when you don't need to

@QuintenQVD0
Copy link
Collaborator

found out in the server.yml file you can add these 3 settings

enable-signup: true # anyone can create an account through the web ui
enable-login: true # anyone can login into accounts through the web ui using user and pass
enable-reservations: true # anyone can reserve topics for themselves

only limit is you can't choose who can make accounts and who can't, or who can reserve and who can't

however technically you can if you enable these settings only when you want to create an account or manage reserved topics and disable when you don't need to

its even yaml so you could add variable for those nad let the config parser turn them on and off

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

Successfully merging this pull request may close these issues.

None yet

4 participants