socioboard / Socioboard-5.0

Socioboard is world's first and open source Social Technology Enabler. Socioboard Core is our flagship product.
http://www.socioboard.org
Other
1.16k stars 364 forks source link

docker support #102

Open ghost opened 5 years ago

ghost commented 5 years ago

Did you have a docker-compose for deploy ?

vaughngx4 commented 2 years ago

At this rate, @vaughngx4 will squash all of the issue by next week. lol

Haha! Issues? What issues? :P

tiritibambix commented 2 years ago

@vaughngx4 Thank you so much for everything ❤️

vaughngx4 commented 2 years ago

@tiritibambix You're welcome :)

kenjibailly commented 2 years ago

@vaughngx4 Thanks for making this happen.

I installed Socioboard and got access to the web interface. Although I seem to stumble upon a few problems.

  1. How do I login (which credentials) / Create an account? (doesn't seem to be working)

  2. Portforwarding using nginx isn't working as expected:

    server {
    listen 443 ssl;
    listen [::]:443 ssl;
    
    server_name socioboard.mydomain.com;
    include /config/nginx/ssl.conf;
    client_max_body_size 0;
    
    location / {
        include /config/nginx/proxy.conf;
        resolver 127.0.0.11 valid=30s;
        set $upstream_app socioboard;
        set $upstream_port 8000;
        set $upstream_proto http;
        proxy_pass $upstream_proto://$upstream_app:$upstream_port;
    }
    }
  3. Would be nice for a documentation about the .env as well, but I see you're already working on that, thanks for that!

vaughngx4 commented 2 years ago

@kenjibailly I'm actually just fixing it as I try it out. There seems to be an issue with proxying currently, I'll check it out soon.

See Docker.README.md about creating an account (my fork, waiting for PR to merge). PR has been merged.

vaughngx4 commented 2 years ago

@kenjibailly See my latest PR. You can modify the nginx config if you'd like or simply put another nginx in front of the stack.

kenjibailly commented 2 years ago

@kenjibailly I'm actually just fixing it as I try it out. There seems to be an issue with proxying currently, I'll check it out soon.

See Docker.README.md about creating an account ~(my fork, waiting for PR to merge).~ PR has been merged.

@vaughngx4

I started with a clean install using the git clone today. I added the Twilio info to the .env, sendgrid info added to env, changed domain name in env. I didn't change the rest. Unfortunately I can't seem to make an account. I don't get the desired notification, but rather get this one and takes forever to show up: image

So naturally I don't get any records in adminbro: image

Note: I made 1 small modification to the docker-compose as it gives me an error when executing being this one:

ERROR: Network scb-net declared as external but specifies additional attributes (driver, ipam).

To get rid of this I just commented the last 5 lines out like this:

    # driver: bridge
    # ipam:
    #   config:
    #     - subnet: 172.16.32.0/16
    #       gateway: 172.16.32.1

The network seems to be created with the desired preferences when looking in portainer (not 100% sure) image image

Let me know if I'm doing something wrong here.

Btw I'll have to try nginx later.

vaughngx4 commented 2 years ago

@kenjibailly So the undefined error is due to api services not running, could you check the output of docker exec -it socioboard su-exec socioboard pm2 logs. The command to create the docker network is in docker-build.sh sorry about that. Once the network is created the containers should start up fine.

kenjibailly commented 2 years ago

docker exec -it socioboard su-exec socioboard pm2 logs

@vaughngx4

So that means I can comment out the last 5 lines, correct? It seems to connect with the desired containers, so I think that part is good.

So about the error logs, I couldn't find any that were triggered from the registration submit button. I could however find these logs, but they are triggered when accessing the adminbro web page.

5|admin.se | Wed, 13 Jul 2022 15:07:34 GMT express-session deprecated undefined saveUninitialized option; provide saveUninitialized option at node_modules/admin-bro-expressjs/plugin.js:176:14
5|admin.se | Wed, 13 Jul 2022 15:08:11 GMT express-session deprecated undefined resave option; provide resave option at node_modules/admin-bro-expressjs/plugin.js:176:14
5|admin.se | Wed, 13 Jul 2022 15:08:11 GMT express-session deprecated undefined saveUninitialized option; provide saveUninitialized option at node_modules/admin-bro-expressjs/plugin.js:176:14
5|admin.se | @rollup/plugin-replace: 'preventAssignment' currently defaults to false. It is recommended to set this option to `true`, as the next major version will default this option to `true`.
5|admin.se | @rollup/plugin-replace: 'preventAssignment' currently defaults to false. It is recommended to set this option to `true`, as the next major version will default this option to `true`.
5|admin.se | @rollup/plugin-replace: 'preventAssignment' currently defaults to false. It is recommended to set this option to `true`, as the next major version will default this option to `true`.
5|admin.se | @rollup/plugin-replace: 'preventAssignment' currently defaults to false. It is recommended to set this option to `true`, as the next major version will default this option to `true`.
5|admin.se | Wed, 13 Jul 2022 15:17:40 GMT express-session deprecated undefined resave option; provide resave option at node_modules/admin-bro-expressjs/plugin.js:176:14
5|admin.se | Wed, 13 Jul 2022 15:17:40 GMT express-session deprecated undefined saveUninitialized option; provide saveUninitialized option at node_modules/admin-bro-expressjs/plugin.js:176:14
5|admin.se | @rollup/plugin-replace: 'preventAssignment' currently defaults to false. It is recommended to set this option to `true`, as the next major version will default this option to `true`.
5|admin.se | @rollup/plugin-replace: 'preventAssignment' currently defaults to false. It is recommended to set this option to `true`, as the next major version will default this option to `true`.
5|admin.se | @rollup/plugin-replace: 'preventAssignment' currently defaults to false. It is recommended to set this option to `true`, as the next major version will default this option to `true`.
5|admin.se | @rollup/plugin-replace: 'preventAssignment' currently defaults to false. It is recommended to set this option to `true`, as the next major version will default this option to `true`.
5|admin.se | Wed, 13 Jul 2022 16:49:59 GMT express-session deprecated undefined resave option; provide resave option at node_modules/admin-bro-expressjs/plugin.js:176:14
5|admin.se | Wed, 13 Jul 2022 16:49:59 GMT express-session deprecated undefined saveUninitialized option; provide saveUninitialized option at node_modules/admin-bro-expressjs/plugin.js:176:14

I get a bunch of things info logs as well (green) that seem to say that everything is ready.

Thank you for helping out mate :)

Edit: A thing worth mentioning is that when clicking the submit button on the registration page and even waiting when the "undefined" notification passes, makes the web page not load anymore. So basically something gets stuck.

vaughngx4 commented 2 years ago

@kenjibailly Even though I added IPs they are not relevant, I'll look into changing how the network works but I'm not sure it will work without the last 5 lines. Try running the docker network create command from the build see script and uncommenting the 5 lines. The undefined error means the frontend can't reach the API. Are you using my fork with the latest updates? There were some domain issues I fixed, it could only run on localhost prior to the nginx update.

Edit: The frontend breaking could mean the container crashed, are the socioboard container logs fine?

kenjibailly commented 2 years ago

@kenjibailly Even though I added IPs they are not relevant, I'll look into changing how the network works but I'm not sure it will work without the last 5 lines. Try running the docker network create command from the build see script and uncommenting the 5 lines. The undefined error means the frontend can't reach the API. Are you using my fork with the latest updates? There were some domain issues I fixed, it could only run on localhost prior to the nginx update.

Edit: The frontend breaking could mean the container crashed, are the socioboard container logs fine?

@vaughngx4

Testing Socioboard Repo

I tried what you said with the current version on this github repo, but unfortunately I still keep getting the same error when docker-composing with the last 5 lines uncommented.

ERROR: Network scb-net declared as external but specifies additional attributes (driver, ipam).

With the 5 last lines in comments the containers, as said before, fire up. When these are fired up using the 5 last commented lines I don't see any errors in the container logs of all 3 containers. Pretty weird, Everything says "connected" and similar stuff.

When I look into the network in portainer it shows that all 3 containers are in the network as desired. image

I unfortunately can't find much on the error, and I'm assuming everything is connected and that this might not be the problem. But that's just an assumption.


Testing vaughngx4 fork repo

Now I tried with your current fork ( https://github.com/vaughngx4/Socioboard-5.0 ) and this has a different outcome. Same problem with the same last 5 lines in the docker-compose giving error:

ERROR: Network scb-net declared as external but specifies additional attributes (driver, ipam).

Going further with last 5 lines commented: I tried to get the nginx working in my current nginx environment and it seems to be working with the files you provided. However I seem to notice 2 things.

  1. When I try to create an account and hit "submit" the page just refreshes. No more notifications. Checked the admin panel, but as guessed the account hasn't been created.
  2. When the page refreshes / goes to another page the css doesn't get loaded for a few seconds. (not really a functionality problem here)

Damn, how hard can it be to create an account :p

Edit: I'll add the log files, maybe you can find something that is wrong here? I can't seem to spot an error according to these issues.

_socioboard-mysql_logs.txt pm2_logs.txt _socioboard_logs.txt _socioboard-mongo_logs.txt

Edit: Got it to work on the fork, but the nginx is failing me in swag as discussed on Discord.

vaughngx4 commented 2 years ago

mixed content errors fixed. Thanks @kenjibailly for finding the fix!

CountOlaf87 commented 2 years ago

I'm trying to run this behind my Traefik reverse proxy with letsencrypt ssl certs, everything starts up fine, but I'm getting some mixed content errors when loading css. How can I fix this?

vaughngx4 commented 2 years ago

@CountOlaf87 You have to force https. If the browser attempts to connect via http first, you will get mixed content errors. In nginx we managed to get it working using add_header 'Content-Security-Policy' 'upgrade-insecure-requests';

CountOlaf87 commented 2 years ago

Did I mention I run it in docker? Could you guide me how to solve it?

vaughngx4 commented 2 years ago

@CountOlaf87 I think this should work in Traefik:

labels:
  - "traefik.http.middlewares.testheader.headers.contentSecurityPolicy=upgrade-insecure-requests"

Reference: https://doc.traefik.io/traefik/middlewares/http/headers/

CountOlaf87 commented 2 years ago

Thanks, but that doesn't seem to work, I'll have a look later to see if I can pass it on in the traefik config

CountOlaf87 commented 2 years ago

Thanks @vaughngx4, Your comment did do the trick!

lmoellendorf commented 2 years ago

I read this thread, especially https://github.com/socioboard/Socioboard-5.0/issues/102#issuecomment-1184424973. So I tried with vaughngx4 fork repo. I added the URLs mentioned in https://github.com/vaughngx4/Socioboard-5.0/blob/development/docker/nginx/ssl/SSL.README.md with my base domain to my router's DNS server and confirmed that they all point to the docker host.

I try to sign up at https://socio.my-base-domain/register. If I submit I get "Registration failed!!". Then I check https://socio.my-base-domain/admin/resources/user_activations, but there are no records.

vaughngx4 commented 2 years ago

I read this thread, especially #102 (comment). So I tried with vaughngx4 fork repo. I added the URLs mentioned in https://github.com/vaughngx4/Socioboard-5.0/blob/development/docker/nginx/ssl/SSL.README.md with my base domain to my router's DNS server and confirmed that they all point to the docker host.

I try to sign up at https://socio.my-base-domain/register. If I submit I get "Registration failed!!". Then I check https://socio.my-base-domain/admin/resources/user_activations, but there are no records.

This is probably a result of missing API info (Twilio is required).

However, I've since abandoned the project to lack of response from the developers and nothing working. See #399 .

lmoellendorf commented 2 years ago

Thank you. I added Twilio account information, but maybe not the expected IDs and Key. However, as you are the second one here who says that Socioboard does not work, I should better save my time and look for another solution - maybe yours.

vaughngx4 commented 2 years ago

@lmoellendorf OpenSMM is a work in progress. However you can use the version on the main branch to post to Twitter. :)