Skip to content

Refactor settings and authentication repositories and routes#9

Closed
ElectroBoy10 wants to merge 0 commit into
defname:mainfrom
ElectroBoy10:main
Closed

Refactor settings and authentication repositories and routes#9
ElectroBoy10 wants to merge 0 commit into
defname:mainfrom
ElectroBoy10:main

Conversation

@ElectroBoy10
Copy link
Copy Markdown

Hallo I have made a rough edit to this app to have password authentication and a attempt on session authentication for if someone tries to connect it shows a green connect button but it seems to be really hard you will be able to see what I've done I have made edits to the workflow as I dont have keys etc so bare that in mind as I can't run this on my side without making a unsigned version. :)

I hope you find these ideas well i don't reccodmend adding my attempt but to rather use your own code and way 👍🏻

@ElectroBoy10
Copy link
Copy Markdown
Author

Hallo I have made a rough edit to this app to have password authentication and a attempt on session authentication for if someone tries to connect it shows a green connect button but it seems to be really hard you will be able to see what I've done I have made edits to the workflow as I dont have keys etc so bare that in mind as I can't run this on my side without making a unsigned version. :)

I hope you find these ideas well i don't reccodmend adding my attempt but to rather use your own code and way 👍🏻

Just a sidenote I did use claud Ai as I'm not good with coding.

@ElectroBoy10
Copy link
Copy Markdown
Author

The workflow i have made has 2 modes debug and normal so meaning people forking your repo can build their own app using actions using debug mode and you can use the normal mode as you have setup keys and that stuff while the average forking user won't setup that and just wants to build a app :)

@defname
Copy link
Copy Markdown
Owner

defname commented May 8, 2026

Hi and thanks for this PR!

I already had a quick look at it and I think I will adapt parts of it (the workflow with debug mode is definitely a great idea!).

I’m not entirely sure I understood the 'green button' feature correctly—could you explain the user flow there? Is it a manual 'Accept' prompt on the phone when a new device tries to connect?

Regarding the implementation: Ktor actually has a built-in sessions plugin that handles tokens, signing, and expiration in a very robust way. I’ll likely use that to manage whitelisted clients. Using session tokens to remember previously approved devices is a much better approach than just relying on the IP address (this is what I do at the moment)!

As for password authentication: I’m still on the fence. Manual approval of new clients seems safer and more user-friendly for a local tool. Since everything runs over plain HTTP, passwords and tokens could be intercepted by anyone sniffing the traffic anyway. Manual 'per-device' approval at least ensures the host has full control. But I will keep it in mind.

Thanks again for the inspiration and your work!

@ElectroBoy10
Copy link
Copy Markdown
Author

The user flow for accept.

So bassicly the implementation is
When a user makes a connection to the sertain ip and port and path it will show a small screen saying waiting for approval if the user is in the application the stop server button will change to a big green button and a small red deny button
Like (-----)(-)
Accept deny
If you are outside the app it will popup a notification with a accept and deny button.

Regarding security do you think its a good idea to support https and http its up to the user to select what they want to use. Even if it requires self sighned keys etc.

Im planning on more edits to the prodject. 😀
Just need to figure out how to implement them

Like one of my ideas are
Custom 404 pages with some info etc
☆ 404 Not Found
☆ 403 Forbidden
410 Gone
☆ 429 Too Many Requests
☆ 500 Internal Server Error
503 Service Unavailable
The 4 nost important pages to my understanding is with a ☆

Another improvement i reccodmend adding
I have this senario i have 50 massive files on this app

The website will struggle to load all at once

So what if you let the backend be SQLite
Any files you add to the app its name and refrence stuff is saved to that file meaning the client website only queries the .db file and adds a loading scheme or pages for that list of files and whats also awsome add a new file or remove a file one query its faster to load stuff and unload stuff ?
@defname

@defname
Copy link
Copy Markdown
Owner

defname commented May 8, 2026

I was thinking about adding some button or popup to the home screen of the app for approving connection requests, but I didn't implement it since I needed the notification anyways (for when the activity is closed) and to prevent myself from messing around with even more ui state.

Implementing https is somehow on my todo list, but not so far on the top of it. I am pretty sure that there is a ktor plugin that will do most of the heavy lifting.

Also for custom error pages. But the template should be reorganized, all the tailwind classes exported to an external css file or something, to make everything a bit more reusable and readable and to ensure a consistent style through the web ui and the error pages.

Are you talking about a backend for the web ui? The size of files should not make any differences. The amount of data the webui needs to work with is a tiny json object per file. I tested it with hundrets of pictures (this is the heaviest part for the app and the webui, since all the previews need to be generated and loaded) and thanks to lazy loading it was never a problem.

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