-
-
Notifications
You must be signed in to change notification settings - Fork 71
Initializing the site
With an empty database, QPixel cannot be used. There needs to be some initial data in order to create a site and have the ability to configure it (admin account).
Open a rails console with bundle exec rails c -e production. This will open an interactive shell (think Python shell) linked to your server process. Here you can directly execute code as if it would be executed by the server.
QPixel was designed with the idea of running multiple different sites (called communities) from a single server process. Everything in QPixel requires the existance of a community, and relates to a specific community. Thus, you need to create one. In the rails console, enter the following (after changing the name and host accordingly).
Community.create(name: 'Community Name', host: 'mydomain.mysite.com')
Rails.cache.clearIt is important that the community host matches with the domain under which you host the site. Otherwise you will get error 422.
Next we want to seed our database with the necessary data to get started. For this initial run, we also want to generate the help articles and privacy policy. See https://github.com/codidact/qpixel/blob/develop/INSTALLATION.md#optional-help-topics if you want to alter the help articles, privacy policy or other elements. Then run the following command:
UPDATE_POSTS=true RAILS_ENV=production bundle exec rails db:seedNow that everything is set up, the remainder should be configurable from the site itself. At this moment it should be possible to use bundle exec rails s -e production to start our site without errors, but we can probably not reach it yet. The next step is to put it behind a NGINX or apache proxy to actually make it reachable.