Quassel: Difference between revisions

imported>Fadenb
Created page with "From the homepage: Quassel IRC is a modern, cross-platform, distributed IRC client, meaning that one (or multiple) client(s) can attach to and detach from a central core -- m..."
 
imported>Fadenb
m Syntax highlighting
Line 15: Line 15:
; based on Qt 5, no KDE integration
; based on Qt 5, no KDE integration


For KDE 4 users, kde4.quasselClient is recommended. For all other users, <code>quasselClient_kf5</code> is recommended. The client may be installed with <code>nix-env</code> or it may be added to the <code>environment.systemPackages</code> NixOS option.
For KDE 4 users, kde4.quasselClient is recommended. For all other users, <code>quasselClient_kf5</code> is recommended. The client may be installed with <code>nix-env</code> or it may be added to the <syntaxhighlight lang="nix" inline>environment.systemPackages</syntaxhighlight> NixOS option.


== Server ==
== Server ==
To enable the Quassel server (variously referred to as the Quassel daemon or Quassel Core), add
To enable the Quassel server (variously referred to as the Quassel daemon or Quassel Core), add
services.quassel.enable = true;
<syntaxhighlight lang="nix">
services.quassel.enable = true;
</syntaxhighlight>
to your NixOS configuration. By default, the server only accepts connections from the local machine; set
to your NixOS configuration. By default, the server only accepts connections from the local machine; set
services.quassel.interface = "0.0.0.0";
<syntaxhighlight lang="nix">
networking.firewall.allowedTCPPorts = [ 4242 ];
services.quassel.interface = "0.0.0.0";
networking.firewall.allowedTCPPorts = [ 4242 ];
</syntaxhighlight>
to accept external connections. {{evaluate}} The first time you connect to the new server, a wizard will guide you through the remaining configuration steps. Before connecting to the new server, you may wish to optionally configure SSL or PostgreSQL.
to accept external connections. {{evaluate}} The first time you connect to the new server, a wizard will guide you through the remaining configuration steps. Before connecting to the new server, you may wish to optionally configure SSL or PostgreSQL.


== SSL ==
== SSL ==
The Quassel server can use SSL if a certificate is provided. Install openssl (using nix-env or by adding it to <code>environment.systemPackages</code>) and run
The Quassel server can use SSL if a certificate is provided. Install openssl (using nix-env or by adding it to <syntaxhighlight lang="nix" inline>environment.systemPackages</syntaxhighlight>) and run
sudo -u quassel mkdir -p /home/quassel/.config/quassel-irc.org
<syntaxhighlight lang="bash">
sudo -u quassel openssl req -x509 -nodes -days 365 -newkey rsa:4096 -keyout /home/quassel/.config/quassel-irc.org/quasselCert.pem -out /home/quassel/.config/quassel-irc.org/quasselCert.pem
sudo -u quassel mkdir -p /home/quassel/.config/quassel-irc.org
sudo -u quassel openssl req -x509 -nodes -days 365 -newkey rsa:4096 -keyout /home/quassel/.config/quassel-irc.org/quasselCert.pem -out /home/quassel/.config/quassel-irc.org/quasselCert.pem
</syntaxhighlight>
You will be prompted for some details about the certificate. If quassel.service was running, restart it by running:
You will be prompted for some details about the certificate. If quassel.service was running, restart it by running:
sudo systemctl restart quassel.service
<syntaxhighlight lang="bash">
sudo systemctl restart quassel.service
</syntaxhighlight>


== PostgreSQL ==  
== PostgreSQL ==  
Line 36: Line 44:


Start by enabling the PostgreSQL service in your NixOS configuration:
Start by enabling the PostgreSQL service in your NixOS configuration:
<syntaxhighlight lang="nix">
  /* Enable the PostgreSQL service */
  /* Enable the PostgreSQL service */
  services.postgresql = {
  services.postgresql = {
Line 47: Line 56:
  /* Make the quasselcore command available in the shell */
  /* Make the quasselcore command available in the shell */
  environment.systemPackages = [ pkgs.quasselDaemon_qt5 ];
  environment.systemPackages = [ pkgs.quasselDaemon_qt5 ];
</syntaxhighlight>


Activate this configuration with nixos-rebuild switch. Create a PostgreSQL role (user) for Quassel:
Activate this configuration with nixos-rebuild switch. Create a PostgreSQL role (user) for Quassel:
sudo createuser -A -D -P -E -W quassel
<syntaxhighlight lang="bash">
sudo createuser -A -D -P -E -W quassel
</syntaxhighlight>
You will be prompted for a password; you will also need to provide the password to Quassel, so don't forget it! Create a PostgreSQL database for Quassel:
You will be prompted for a password; you will also need to provide the password to Quassel, so don't forget it! Create a PostgreSQL database for Quassel:
sudo createdb -O quassel -E UTF8 quassel
<syntaxhighlight lang="bash">
sudo createdb -O quassel -E UTF8 quassel
</syntaxhighlight>
If you have never connected to this Quassel server before, you can connect now and select the PostgreSQL backend when prompted. You will need to provide the PostgreSQL username (quassel) and password you created above.
If you have never connected to this Quassel server before, you can connect now and select the PostgreSQL backend when prompted. You will need to provide the PostgreSQL username (quassel) and password you created above.


If you are switching from the SQLite backend to the PostgreSQL backend, you will need to migrate the existing data. Stop the Quassel server with
If you are switching from the SQLite backend to the PostgreSQL backend, you will need to migrate the existing data. Stop the Quassel server with
sudo systemctl stop quassel.service
<syntaxhighlight lang="bash">
sudo systemctl stop quassel.service
</syntaxhighlight>
Start the migration with
Start the migration with
sudo -u quassel quasselcore --configdir=/home/quassel/.config/quassel-irc.org --select-backend=PostgreSQL
<syntaxhighlight lang="bash">
sudo -u quassel quasselcore --configdir=/home/quassel/.config/quassel-irc.org --select-backend=PostgreSQL
</syntaxhighlight>
You will need to provide the PostgreSQL username (quassel) and password you created above. When this is finished, restart the Quassel server:
You will need to provide the PostgreSQL username (quassel) and password you created above. When this is finished, restart the Quassel server:
sudo systemctl start quassel.service
<syntaxhighlight lang="bash">
sudo systemctl start quassel.service
</syntaxhighlight>