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 luci-app-tailscale to Official OpenWRT Package #2

Closed
animegasan opened this issue Mar 18, 2024 · 2 comments
Closed

Add luci-app-tailscale to Official OpenWRT Package #2

animegasan opened this issue Mar 18, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@animegasan
Copy link

Hello, I am very impressed with this project, because it can add another option to remote OpenWRT with local network like ZeroTier!

There is input from me, why not just add a logs page to read all processes from tailscale?

References can be seen on the following page
https://github.com/openwrt/luci/blob/master/applications/luci-app-cloudflared/htdocs/luci-static/resources/view/cloudflared/log.js

And try making a pull request to Luci OpenWRT to make it an official package. Thank You!

@animegasan animegasan changed the title Amazing!! Add luci-app-tailscale to Official OpenWRT Package Mar 18, 2024
@animegasan
Copy link
Author

image

	load: function () {
		poll.add(function() {
			return fs.exec('/sbin/logread', ['-e', 'tailscale'])
				.then(function (res) {
					if (res.code === 0) {
						var statusMappings = {
							'daemon.err': { status: 'Error', startIndex: 9 },
							'daemon.notice': { status: 'Info', startIndex: 10 }
						};
						var logs = res.stdout.split('\n').map(function(log) {
							var logParts = log.split(' ');
							if (logParts.length >= 6) {
								var formattedTime = logParts[1] + ' ' + logParts[2] + ' - ' + logParts[3];
								var status = logParts[5];
								var mapping = statusMappings[status] || { status: status, startIndex: 9 };
								status = mapping.status;
								var startIndex = mapping.startIndex;
								var message = logParts.slice(startIndex).join(' ');
								return formattedTime + ' [ ' + status + ' ] - ' + message;
							} else {
								return '';
							}
						}).filter(Boolean).join('\n');
						var view = document.getElementById('syslog');
						view.innerHTML = logs;
						return view;
					} else {
						throw new Error(res.stdout + ' ' + res.stderr);
					}
				})
		});
	},

@asvow asvow added the enhancement New feature or request label Mar 28, 2024
@zzduci
Copy link

zzduci commented Apr 18, 2024

Hello, I am very impressed with this project, because it can add another option to remote OpenWRT with local network like ZeroTier!

There is input from me, why not just add a logs page to read all processes from tailscale?

References can be seen on the following page https://github.com/openwrt/luci/blob/master/applications/luci-app-cloudflared/htdocs/luci-static/resources/view/cloudflared/log.js

And try making a pull request to Luci OpenWRT to make it an official package. Thank You!

it is a good idea

@asvow asvow closed this as completed in 1f3bc92 May 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants