Erudika / scoold

A Stack Overflow clone for teams (self-hosted or hosted)
https://scoold.com
Apache License 2.0
865 stars 238 forks source link

Scoold GitHub Authentication #99

Closed jmakanjuola closed 6 years ago

jmakanjuola commented 6 years ago

Hello @albogdano I don't think that Java is the issue here. Java is obviously running. There could be a bug in your codebase or the documents is totally off. This issue has not been resolved.


    1 scoold    0:17 java -Dconfig.file=/etc/scoold/application.conf -Djava.security.egd=file:/dev/./urandom -jar scoold-1.31.0.jar
   38 scoold    0:00 grep java```

_Originally posted by @jmakanjuola in https://github.com/Erudika/scoold/issues/98
albogdano commented 6 years ago

I'm pretty sure it's not a bug. Make sure you config is loaded. Change the para.env value in your config to development and then restart Scoold. Do you see the change? Do it again with para.env = "production" and restart. Do you see the change reflected in the logs? If the answer is "no" than the configuration is not loaded properly.

jmakanjuola commented 6 years ago

@albogdano thanks for your response. Yes, below are the output of the changes within the container. But there are no changes within the log.

 ▶ kubectl exec -it scoold-66df744d46-2lvzt /bin/sh -n infra
/scoold $ cd /etc/scoold
/etc/scoold $ ls
application.conf
/etc/scoold $ more application.conf 
para.app_name: scoold
para.port: 8000
para.env: production
para.mail.tls: true
para.gh_app_id: <xxxxxxxx>
para.gh_secret: <xxxxxxxx>
para.host_url: http://scoold.care:8000
para.endpoint: https://paraio.com
para.admins: <xxxxxxxx>

Java is running, and data within scold/application.conf are updating.

▶ kubectl exec -it scoold-66df744d46-2lvzt /bin/sh -n infra
/scoold $ ps aux | grep java
    1 scoold    0:13 java -Dconfig.file=/etc/scoold/application.conf -Djava.security.egd=file:/dev/./urandom -jar scoold-1.31.0.jar
   44 scoold    0:00 grep java

What could potentially be the issue here?

Error message within the container logs states the following

Secret key appears to be invalid. Make sure you call 'signIn()' first. No connection to Para backend - make sure that your keys are valid

I: What part of the signIn() is the error log reffering to her?

If signIn() is referring to https://paraio.com, I've already signed into the app and created the following.

para.access_key: app:myapp {App identifier within https://paraio.com } para.secret_key: { Keys generated within https://paraio.com }

or are you referring to your any of this below?

Simple Authentication ? GitHub Support ? The actual scoold application running locally?

II: No connection to Para backend - make sure that your keys are valid

If this is referring to the Para backend in the example below,

In your example, ref link; https://github.com/Erudika/scoold

access key for your Para app

para.access_key = "app:scoold"

secret key for your Para app

para.secret_key = "*****"

Then I've already completed the procress.

para.access_key: app:myapp {App identifier within https://paraio.com } para.secret_key: { key generated within https://paraio.com }

albogdano commented 6 years ago

I told you what the issue is. It's up to you to resolve it. I can't help you with your container setup. If you can't solve it, perhaps it's better to start fresh without a container - just run java -jar scoold.jar and try things out.

jmakanjuola commented 6 years ago

The latest para.log updates indicates that Para configuration file 'application.(conf|json|properties)' is missing from classpath.

jmakanjuola commented 6 years ago

I have docker-compose files locally that I've ready converted to run in my Kuberternes cluster. I'll keep you posted on any new updates.

jmakanjuola commented 6 years ago

Hello @albogdano,

Well, below is the new Scoold log from the cluster. i've generated a new para.secret_key = "*****************" as suggested in your documentation, but the issue still persist.

Note that the classpath issue regarding the application.conf file is resolved. Could this be a bug within your codebase? This issue is no longer about the application.conf loading based on the log below.

New Scoold log from Cluster

  / ___/ ___/ __ \/ __ \/ / __  /
 (__  ) /__/ /_/ / /_/ / / /_/ /
/____/\___/\____/\____/_/\__,_/     (v1.31.0)

2018-11-08 16:55:18 [INFO ] Starting ScooldServer v1.31.0 on scoold-84c5bdf487-q79qx with PID 1 (/scoold/scoold-1.31.0.jar started by scoold in /scoold)
2018-11-08 16:55:18 [INFO ] The following profiles are active: embedded
2018-11-08 16:55:20 [INFO ] Listening on port 8000...
2018-11-08 16:55:20 [WARN ] Secret key appears to be invalid. Make sure you call 'signIn()' first.
2018-11-08 16:55:22 [ERROR] No connection to Para backend - make sure that your keys are valid.
2018-11-08 16:55:22 [INFO ] Default language map not set, loading English.
2018-11-08 16:55:22 [INFO ] SpringResourceLoader for Velocity: using resource loader [org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@1554909b: startup date [Thu Nov 08 16:55:19 GMT 2018]; root of context hierarchy] and resource loader paths [classpath:templates/]
2018-11-08 16:55:23 [INFO ] Started ScooldServer in 5.251 seconds (JVM running for 6.28)

docker-compose Scoold log

i've generated a new para.access_key & para.secret_key = "*****************" in plain text inside my application.conf file and the issue still persist.

Creating network "scoold-app_default" with the default driver
Creating scoold-app_para_1 ... done
Creating scoold-app_scoold_1 ... done
Attaching to scoold-app_para_1, scoold-app_scoold_1
scoold_1  |                           __    __
scoold_1  |    ______________  ____  / /___/ /
scoold_1  |   / ___/ ___/ __ \/ __ \/ / __  /
scoold_1  |  (__  ) /__/ /_/ / /_/ / / /_/ /
scoold_1  | /____/\___/\____/\____/_/\__,_/     (v1.30.4)
scoold_1  | 
para_1    | 
para_1    |       ____  ___ _ ____ ___ _ 
para_1    |      / __ \/ __` / ___/ __` /
para_1    |     / /_/ / /_/ / /  / /_/ / 
para_1    |    / .___/\__,_/_/   \__,_/  v1.31.0
para_1    |   /_/                        
para_1    | 
para_1    | 2018-11-08 17:57:31 [INFO ] --- Para.initialize() [production] ---
para_1    | 2018-11-08 17:57:31 [INFO ] Loaded new DAO, Search and Cache implementations - H2DAO, LuceneSearch and CaffeineCache.
scoold_1  | 2018-11-08 17:57:31 [INFO ] Starting ScooldServer v1.30.4 on 798f2046a29e with PID 1 (/scoold/scoold-1.30.4.jar started by scoold in /scoold)
scoold_1  | 2018-11-08 17:57:31 [INFO ] The following profiles are active: embedded
para_1    | 2018-11-08 17:57:32 [WARN ] Server is unhealthy - root app not found. Open /v1/_setup in the browser to initialize Para.
para_1    | 2018-11-08 17:57:32 [INFO ] Instance #1 initialized.
para_1    | 2018-11-08 17:57:33 [INFO ] Starting ParaServer on e85132b6ddfb with PID 1 (/para/para-jar-1.31.0.jar started by para in /para)
para_1    | 2018-11-08 17:57:33 [INFO ] The following profiles are active: production
scoold_1  | 2018-11-08 17:57:34 [INFO ] Listening on port 8000...
para_1    | 2018-11-08 17:57:34 [INFO ] Listening on port 8080...
scoold_1  | 2018-11-08 17:57:35 [WARN ] Secret key appears to be invalid. Make sure you call 'signIn()' first.
para_1    | 2018-11-08 17:57:37 [INFO ] Started ParaServer in 5.014 seconds (JVM running for 9.09)
scoold_1  | 2018-11-08 17:57:37 [ERROR] No connection to Para backend - make sure that your keys are valid.
scoold_1  | 2018-11-08 17:57:37 [INFO ] Default language map not set, loading English.
scoold_1  | 2018-11-08 17:57:37 [INFO ] SpringResourceLoader for Velocity: using resource loader [org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@3796751b: startup date [Thu Nov 08 17:57:32 GMT 2018]; root of context hierarchy] and resource loader paths [classpath:templates/]
scoold_1  | 2018-11-08 17:57:39 [INFO ] Started ScooldServer in 8.363 seconds (JVM running for 10.263)
albogdano commented 6 years ago

I thought you were trying to connect Scoold to ParaIO.com?! If that is still the case then why are you starting Para locally? Please, read the README again very carefully.

jmakanjuola commented 6 years ago

@albogdano Yes, I've also built Scoold image separately and the issue still persists

                          __    __
   ______________  ____  / /___/ /
  / ___/ ___/ __ \/ __ \/ / __  /
 (__  ) /__/ /_/ / /_/ / / /_/ /
/____/\___/\____/\____/_/\__,_/     (v1.31.0)

2018-11-08 23:36:12 [INFO ] Starting ScooldServer v1.31.0 on 5bd314c6c9ba with PID 1 (/scoold/scoold-1.31.0.jar started by scoold in /scoold)
2018-11-08 23:36:12 [INFO ] The following profiles are active: embedded
2018-11-08 23:36:14 [INFO ] Listening on port 8000...
2018-11-08 23:36:14 [WARN ] Secret key appears to be invalid. Make sure you call 'signIn()' first.
2018-11-08 23:36:16 [ERROR] No connection to Para backend - make sure that your keys are valid.
2018-11-08 23:36:16 [INFO ] Default language map not set, loading English.
2018-11-08 23:36:17 [INFO ] SpringResourceLoader for Velocity: using resource loader [org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@6be46e8f: startup date [Thu Nov 08 23:36:12 GMT 2018]; root of context hierarchy] and resource loader paths [classpath:templates/]
2018-11-08 23:36:18 [INFO ] Started ScooldServer in 5.87 seconds (JVM running for 7.083)
albogdano commented 6 years ago

Well, double check your Para keys, para.access_key, para.secret_key. Make sure they are in application.conf and make sure that that file is loaded by Scoold.

i've generated a new para.access_key & para.secret_key = "*****" in plain text inside my scoold.env file and the issue still persist.

This is wrong! Don't follow the docker-compose instructions because they don't apply to you if you are connecting to ParaIO.com. The keys must be in application.conf.

jmakanjuola commented 6 years ago

@albogdano, I used docker-compose as an example. According to your documentation,

"The most important settings are para. Endpoint - the URL of the Para server, as well as, para.access_key and para.secret_key. Connection to a Para server is required for Scoold to run."

"This is an example of what your application.conf should look like:"

# the port for Scoold
para.port = 8000
# change this to "production" later
para.env = "development"
# the URL where Scoold is hosted, or http://localhost:8000
para.host_url = "https://your-scoold-domain.com"
# the URL of Para - could also be "http://localhost:8080"
para.endpoint = "https://paraio.com"
# access key for your Para app
para.access_key = "app:scoold"
# secret key for your Para app
para.secret_key = "*****************```

Even when you define Scoold access and secret key in a separate file called, { application.conf } even then, Scoold still complains about connecting to https://paraio.com.

jmakanjuola commented 6 years ago

Well, double check your Para keys, para.access_key para.secret_key. Make sure they are in application.conf and make sure that Scoold loads that file.

I've generated a new para.access_key & para.secret_key = "*****" in plain text inside my scoold.env file and the issue still persist.

This is wrong! Don't follow the docker-compose instructions because they don't apply to you if you are connecting to ParaIO.com. The keys must be in application.conf. I meant application.confwithin my Scoold ENV. Even then, connecting Scoold to https://paraio.com is still an issue.

albogdano commented 6 years ago

Look, I really don't know what else to say... You are probably making a trivial mistake somewhere. Maybe it's a networking problem - I don't know. Install and use para-cli - does that work with the same keys? Just try out a few things..

jmakanjuola commented 6 years ago

Hi @albogdano,

Thanks a lot! This exactly concludes my point :-) Goodluck with Scoold.