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

executable bndrun #16

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

executable bndrun #16

wants to merge 1 commit into from

Conversation

stbischof
Copy link
Contributor

Signed-off-by: Stefan Bischof [email protected]

Copy link
Member

@pkriens pkriens left a comment

Choose a reason for hiding this comment

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

I think I disagree with this change. As I commented, passing the configuration properties to the working class is done explicitly. Look at how you need to introduce a new interface and a conversion method. You introduce complexity for what? It is a prime example of how types can introduce unnecessary complexity.

As I also indicated, I do not have a problem with an initial script that can be used for a banner with 'echo' but I do not think a special banner is a good idea since you will then want to set the prompt, etc. For the console, this initial script can be set by a system property.

Sorry to not accept it, but especially the increased complexity with additional types and methods is one of my pet peeves.

@@ -8,7 +8,7 @@
*/
@ObjectClassDefinition( description = "Configuration for the Gogo SSH interface.")
public @interface SshdConfig {
String PID = "biz.aQute.shell.sshd";
static String PID = "biz.aQute.shell.sshd";
Copy link
Member

Choose a reason for hiding this comment

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

Fields in interfaces are always public static so this is unnecessary

* WelcomeBanner that would be printed after authentication.
*/
@AttributeDefinition(description = "WelcomeBanner that would be printed after authentication.")
String welcomeBanner() default Config.banner;
Copy link
Member

Choose a reason for hiding this comment

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

I am not sure I like this ... I could live with an a script that is run at startup. This can 'echo' a banner of course. However, it could the also set the prompt, etc.

@@ -9,7 +9,7 @@
*/
@ObjectClassDefinition(description = "Configuration for the Gogo SSH interface in an insecure mode.")
public @interface SshdConfigInsecure {
String PID = "biz.aQute.shell.sshd.insecure";
static String PID = "biz.aQute.shell.sshd.insecure";
Copy link
Member

Choose a reason for hiding this comment

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

unnecessary

* WelcomeBanner that would be printed after authentication.
*/
@AttributeDefinition(description = "WelcomeBanner that would be printed after authentication.")
String welcomeBanner() default Config.banner;
Copy link
Member

Choose a reason for hiding this comment

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

See other comment, initial script is ok

@@ -28,18 +29,23 @@

volatile int port;

AbstractGogoSshd(BundleContext context, CommandProcessor processor, String keypath, String host, int port)
AbstractGogoSshd(BundleContext context, CommandProcessor processor, Config config )
Copy link
Member

Choose a reason for hiding this comment

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

I am not fond of this style. I explicitly did not pass the config. The reason is that the config belongs to the OSGi DS component and should not leak to other places. So I tend to provide the details and not the config object, even i fit is convenient. It just decouples the system further. I like simple types.

@stbischof
Copy link
Contributor Author

This was just an result of an test. I looked for a way that helped me to fined out that i am connect to the right server.

I just let the bndrun.

@stbischof stbischof changed the title executable bndrun, welcomeMessage executable bndrun Mar 15, 2021
@pkriens
Copy link
Member

pkriens commented Mar 15, 2021

Makes sense. However, running a script would allow you to set the Gogo prompt.

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