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

feat: allow admin to set default channel #19

Merged
merged 18 commits into from
Mar 1, 2024
Merged

feat: allow admin to set default channel #19

merged 18 commits into from
Mar 1, 2024

Conversation

hickey
Copy link
Owner

@hickey hickey commented Nov 21, 2023

A MeshChat administrator now has the ability to define the default channel that a newly logged in user is placed into. This requires that the administrator set the value default_channel in the configuration file. Setting default_channel to an empty string ('') will continue using the legacy setting of 'Everything'.

Signed-off-by: Gerard Hickey hickey@kinetic-compute.com

Closes #5

@hickey hickey added this to the v2.10 milestone Nov 21, 2023
@hickey hickey added the enhancement New feature or request label Nov 21, 2023
@hickey hickey self-assigned this Nov 21, 2023
@hickey hickey marked this pull request as draft November 21, 2023 01:42
@hickey hickey requested a review from gerner November 21, 2023 01:43
@hickey
Copy link
Owner Author

hickey commented Nov 21, 2023

Ideally I should be testing this tonight. Changes should be available on http://wt0f-1.local.mesh:8080/meshchat this evening.

@hickey
Copy link
Owner Author

hickey commented Nov 21, 2023

Found an issue with the refactoring of the config API call. Fixed and redeployed the package to WT0F-1. Current version is v20231121-default-channel-acd2e7c.

Copy link
Collaborator

@gerner gerner left a comment

Choose a reason for hiding this comment

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

Broadly this seems fine. I have some questions that mostly come down to documentation/release notes.


local settings = {
version = app_version,
protocol_verison = protocol_version,
Copy link
Collaborator

Choose a reason for hiding this comment

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

if this wasn't already in the config before, how was it used?

Copy link
Owner Author

Choose a reason for hiding this comment

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

protocol_version is not used today. It is in the config file, but not in use. Never has been used from what I can tell.

The config API was only really giving the MeshChat version, node name and zone name to the front end code. I am adding more config values so that more features can be enabled on the front end code without having to hard code values into the front end. This will provide a single source of configuration for all of MeshChat.

In the relatively near future (next version or two), I expect that protocol_version will be used to insure that an old API (either an old API package or cgi-bin scripts that did not get updated correctly) is not being used and/or adapt to the older API. This will probably come into to play as the message DB synchronization is improved.

node = node_name(),
zone = zone_name(),
default_channel = default_channel,
debug = debug,
Copy link
Collaborator

Choose a reason for hiding this comment

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

looks like this doesn't come up (at least not in this PR). what do you plan to do with this?

I love the idea of useful config flags to help development and support. I just want to be explicit about the purpose for these kinds of features.

Copy link
Owner Author

Choose a reason for hiding this comment

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

I am not sure what you mean by it did not come up. I have been using this code for a bit and it has been working for me. I did have a problem on the Javascript side where I was defining a function and a variable with the same name that was causing problems. That has been resolved, but I have not pushed code yet as I am debugging another issue.

The debug variable in the configuration file is used to turn on debugging in the backend code (not really there) and the debugging in the Javascript console in the front end. At some point it will probably be good to also turn the front end debugging on through a parameter on the URL line so that one does not have to modify the config file (or maybe does not have access to the file). This would allow debug logs to be created and submitted with bug reports to get a little more visibility into what a MeshChat instance is doing.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I just meant what's the debug flag for. I didn't see that flag get used elsewhere in this PR. Thanks for the info.

I agree about turning it on without changing config. One scenario I find myself running into again and again is supporting other people's installation. In these cases I need deep info about system state, but I don't have ssh access or the admin password. It would be very nice if I could just flip a query param flag and suddenly see things.

I guess we still need to build those things to show :)

Copy link
Owner Author

Choose a reason for hiding this comment

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

I think the debug function is in the commits that I have not yet pushed. I am trying to resolve a problem where the value of a Javascript variable is not being copied to another context correctly.

meshchat Outdated Show resolved Hide resolved
www/shared.js Outdated Show resolved Hide resolved
meshchatconfig.lua Show resolved Hide resolved
Reorginanization of the repository so that it is code focused vs. being
focused on how the packages are built. Packaging will be moved to
GitHub Actions so that every commit will create new packages that can
be used for testing. Releases will be created and produce packages
when a tag is committed to the repository.

Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>
Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>
Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>
* refactor: add comments to clarify flow

Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>

* feat: add messages class to front end

Update the handling of messages on the front end code to better control
the update of messages and coordinateion with the rest of the UI.

Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>

* add more config support

Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>

* feat: message ID can be specified in send_message API

Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>

* add md5 module to front-end

Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>

* integrate message class into front-end code

Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>

---------

Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>
Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>
A MeshChat administrator now has the ability to define the default
channel that a newly logged in user is placed into. This requires that
the administrator set the value `default_channel` in the configuration
file. Setting `default_channel` to an empty string ('') will continue
using the legacy setting of 'Everything'.

Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>
Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>
Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>
Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>
Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>
Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>
Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>
Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>
Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>
@hickey hickey force-pushed the default-channel branch 5 times, most recently from 2a7b5b1 to fca03a1 Compare February 20, 2024 01:15
Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>
Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>
@hickey hickey marked this pull request as ready for review March 1, 2024 05:15
@hickey hickey merged commit 8d97089 into master Mar 1, 2024
3 checks passed
hickey added a commit that referenced this pull request Mar 1, 2024
* fix: fix missing tab for file sharing

* Initial pass at reorganization

Reorginanization of the repository so that it is code focused vs. being
focused on how the packages are built. Packaging will be moved to
GitHub Actions so that every commit will create new packages that can
be used for testing. Releases will be created and produce packages
when a tag is committed to the repository.

Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>

* Added beginnings of package building code

Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>

* Now making directories during package build

Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>

* Minor fixes to populate-meshchat-api-fs.sh

Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>

* Fixed testing tag for version number

Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>

* Updated GitHub workflow

Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>

* Fixed incorrect param order for tar in ipk-build.sh

Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>

* Storing generated package as an artifact

Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>

* Refactored build API workflow

Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>

* Added build MeshChat package job

Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>

* Removed build file as no longer needed

* Updating version info in meshchatconfig.lua

Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>

* More reorganization of files

* Fixed installation of cgi-bin after reorg

Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>

* Fixed the installation of web files

Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>

* Added branch name and commit ref to testing builds

Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>

* Moved MeshChat source to top level

Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>

* feat: Set send channel when channel filter changed

Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>

* docs: Updated README with history of MeshChat

Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>

* chore: Added Bug Report issue template

* chore: Added feature request issue template

* build: Updates to better name packages

Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>

* Update Bug Report.yml

* fix: set epoch in send_message API even if not specified

Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>

* feat: add message class abstracting message handling (#23)

* refactor: add comments to clarify flow

Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>

* feat: add messages class to front end

Update the handling of messages on the front end code to better control
the update of messages and coordinateion with the rest of the UI.

Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>

* add more config support

Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>

* feat: message ID can be specified in send_message API

Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>

* add md5 module to front-end

Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>

* integrate message class into front-end code

Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>

---------

Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>

* add more fields to bug issue template

Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>

* chore: remove packages from repo

Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>

* chore: add release-it config file for automated releases

Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>

* fix: discover zone name from /etc/config.mesh (#36)

The zone name has traditionally been discovered by interogating
/etc/config/services. The AREDN firmware is removing this file
in favor of /etc/config.mesh/_setup.services.{dmz|nat}. This
fix updates the location where the zone name is discovered.

Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>
Co-authored-by: Tim Wilkinson <tim.j.wilkinson@gmail.com>

* Add GitHub Actions workflow to automate releases (#40)

* Added beginnings of package building code
* chore: create release CI job
* chore: add documentation section to changelog
* chore: make build-meshchat-package a reusable workflow
* chore: add build packages to release
* fix: update-version.sh can now be told version to set
* chore(ci): convert meshchat-api build to reusable workflow
* chore(ci): set release to only work on release branch

Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>

* feat: Add documentation  (#44)

* add API docs as comments
* add luadox configuation
* add parameter table to API calls
* create documentation to be published
* add github pages artifact code
* remove unused README
* make publish-docs workflow reusable for releases
* add troubleshooting documentation

---------

Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>

* chore(ci): update release pipeline

Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>

* feat: allow admin to set default channel (#19)

A MeshChat administrator now has the ability to define the default
channel that a newly logged in user is placed into. This requires that
the administrator set the value `default_channel` in the configuration
file. Setting `default_channel` to an empty string ('') will continue
using the legacy setting of 'Everything'.

Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>

* add LICENSE file

Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>

---------

Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>
Co-authored-by: Tim Wilkinson <tim.j.wilkinson@gmail.com>
hickey added a commit that referenced this pull request Mar 1, 2024
A MeshChat administrator now has the ability to define the default
channel that a newly logged in user is placed into. This requires that
the administrator set the value `default_channel` in the configuration
file. Setting `default_channel` to an empty string ('') will continue
using the legacy setting of 'Everything'.

Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>
hickey added a commit that referenced this pull request Mar 2, 2024
A MeshChat administrator now has the ability to define the default
channel that a newly logged in user is placed into. This requires that
the administrator set the value `default_channel` in the configuration
file. Setting `default_channel` to an empty string ('') will continue
using the legacy setting of 'Everything'.

Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>
hickey added a commit that referenced this pull request Mar 2, 2024
A MeshChat administrator now has the ability to define the default
channel that a newly logged in user is placed into. This requires that
the administrator set the value `default_channel` in the configuration
file. Setting `default_channel` to an empty string ('') will continue
using the legacy setting of 'Everything'.

Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>
hickey added a commit that referenced this pull request Mar 2, 2024
Initial pass at reorganization

Reorginanization of the repository so that it is code focused vs. being
focused on how the packages are built. Packaging will be moved to
GitHub Actions so that every commit will create new packages that can
be used for testing. Releases will be created and produce packages
when a tag is committed to the repository.

Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>

Added beginnings of package building code

Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>

Updated GitHub workflow

Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>

Storing generated package as an artifact

Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>

Refactored build API workflow

Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>

More reorganization of files

Moved MeshChat source to top level

Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>

feat: Set send channel when channel filter changed

Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>

docs: Updated README with history of MeshChat

Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>

fix: set epoch in send_message API even if not specified

Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>

feat: add message class abstracting message handling (#23)

* refactor: add comments to clarify flow

Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>

* feat: add messages class to front end

Update the handling of messages on the front end code to better control
the update of messages and coordinateion with the rest of the UI.

Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>

* add more config support

Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>

* feat: message ID can be specified in send_message API

Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>

* add md5 module to front-end

Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>

* integrate message class into front-end code

Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>

---------

Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>

Add GitHub Actions workflow to automate releases (#40)

* Added beginnings of package building code
* chore: create release CI job
* chore: add documentation section to changelog
* chore: make build-meshchat-package a reusable workflow
* chore: add build packages to release
* fix: update-version.sh can now be told version to set
* chore(ci): convert meshchat-api build to reusable workflow
* chore(ci): set release to only work on release branch

Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>

chore(ci): update release pipeline

Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>

feat: allow admin to set default channel (#19)

A MeshChat administrator now has the ability to define the default
channel that a newly logged in user is placed into. This requires that
the administrator set the value `default_channel` in the configuration
file. Setting `default_channel` to an empty string ('') will continue
using the legacy setting of 'Everything'.

Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>
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

Successfully merging this pull request may close these issues.

[Feature]: Allow the default channel to be set by the administrator
2 participants