Blame
Date:
Mon Jan 23 05:00:25 2023
UTC
Message:
Daily backup
11
2023-01-22
text=(:title Pleroma:)%0aPleroma is a microblogging server software that can federate (exchange messages with) other servers that support ActivityPub. What that means is that you can host a server for yourself or your friends and stay in control of your online identity, but still exchange messages with people on larger servers. Pleroma will federate with all servers that implement ActivityPub, like Friendica, GNU Social, Hubzilla, Mastodon, Misskey, Peertube, and Pixelfed.%0a%0aThis guide describes the installation and configuration of Pleroma (and the required software to run it) on a single OpenBSD 7.2 server.%0a%0a!! Installation%0aFirst, We need to install the required dependencies%0a[@%0a# pkg_add elixir gmake git postgresql-server postgresql-contrib cmake ffmpeg ImageMagick p5-Image-ExifTool libmagic erlang-wx%0a@]%0a%0aPick the latest version of @@erlang-wx@@ when asked.%0a%0aCreate @@pleroma@@ user to be run in dedicated user. Before creating it, Edit @@/etc/login.conf@@:%0a[@%0apleroma:\%0a :datasize-max=1536M:\%0a :datasize-cur=1536M:\%0a :openfiles-max=4096%0a@]%0a%0aThis creates a "pleroma" login class and sets higher values than default for datasize and openfiles (see login.conf(5)), this is required to avoid having pleroma crash some time after starting.%0a%0aCreate the @@_pleroma@@ user, assign it the pleroma login class and create its home directory (/home/_pleroma/):%0a[@%0a# useradd -m -L pleroma _pleroma%0a@]%0a%0aEnter a shell as the _pleroma user. As root, run%0a[@%0a# su -l _pleroma%0a@]%0a%0aBecause we're running in a VM, Disable time correction to prevent interruption during compilation, And disable Busy-waiting feature to improve performance a bit. Edit @@~/.vm.args@@, insert:%0a%0a[@%0a+c false%0a+sbwt none%0a+sbwtdcpu none%0a+sbwtdio none%0a@]%0a%0aThen save it.%0a%0aEdit @@~/.profile@@, Then add this to the bottom of file:%0a%0a[@%0aexport LC_ALL=en_US.UTF-8%0aalias mix="elixir --erl \"-args_file $HOME/.vm.args\" -S $(command -v mix)"%0a@]%0a%0aThen save it.%0a%0aThen clone the repository by doing:%0a[@%0a$ git clone https://git.pleroma.social/pleroma/pleroma.git%0a@]%0a%0aPleroma is now installed in @@/home/_pleroma/pleroma/@@, it will be configured and started at the end of this guide.%0a%0a!! Setting up the database: postgresql%0aStart a shell as the _postgresql user. As root, run%0a[@%0a# su -l _postgresql%0a@]%0a%0aThen run the initdb command to initialize postgresql. You will need to specify pgdata directory to the default (@@/var/postgresql/data@@) with the @@-D %3cpath>@@ and set the user to postgres with the @@-U %3cusername>@@ flag. This can be done as follows:%0a%0a[@%0a# initdb -D /var/postgresql/data -U postgres%0a@]%0a%0aIf you are not using the default directory, you will have to update the @@datadir@@ variable in the @@/etc/rc.d/postgresql@@ script.%0a%0a%0aWhen this is done, enable postgresql so that it starts on boot and start it. As root, run:%0a[@%0a$ doas rcctl enable postgresql%0a$ doas rcctl start postgresql%0a@]%0a%0aTo check that it started properly and didn't fail right after starting, you can run @@ps aux | grep postgres@@, there should be multiple lines of output.%0a%0a!! Configuring httpd%0ahttpd will have three fuctions:%0a%0a# Redirect requests trying to reach the instance over http to the https URL%0a# Serve a robots.txt file%0a# Get Let's Encrypt certificates, with acme-client%0a%0aInsert the following config in httpd.conf:%0a%0a[@%0a%0aext_inet="%3cIPv4 address>"%0aext_inet6="%3cIPv6 address>"%0a%0aserver "default" {%0a listen on $ext_inet port 80 # Comment to disable listening on IPv4%0a listen on $ext_inet6 port 80 # Comment to disable listening on IPv6%0a listen on 127.0.0.1 port 80 # Do NOT comment this line%0a%0a log syslog%0a directory no index%0a%0a location "/.well-known/acme-challenge/*" {%0a root "/acme"%0a request strip 2%0a }%0a%0a location "/robots.txt" { root "/htdocs/" }%0a location "/*" { block return 302 "https://$HTTP_HOST$REQUEST_URI" }%0a}%0a@]%0a%0aDo not forget to change @@%3cIPv4/6 address>@@ to your server's address(es). If httpd should only listen on one protocol family, comment one of the two first listen options.%0a%0aWrite the content of your @@robots.txt@@ in @@/var/www/htdocs/robots.txt@@:%0a[@%0aUser-Agent: *%0aDisallow:%0a@]%0a%0aCheck the httpd configuration%0a[@%0a$ doas httpd -n%0a@]%0a%0aIf it's OK, enable and start httpd%0a[@%0a$ doas rcctl enable httpd%0a$ doas rcctl start httpd%0a@]%0a%0a!!! acme-client%0aSee https://wiki.ircnow.org/index.php?n=Acme-client.Configure%0a%0a!!! Configuring relayd%0arelayd will be used as the reverse proxy sitting in front of pleroma. Insert the following configuration in @@/etc/relayd.conf@@:%0a%0a[@%0a%0aext_inet="%3cIPv4 address>"%0aext_inet6="%3cIPv6 address>"%0a%0atable %3cpleroma_server> { 127.0.0.1 }%0atable %3chttpd_server> { 127.0.0.1 }%0a%0ahttp protocol plerup { # Protocol for upstream pleroma server%0a #tcp { nodelay, sack, socket buffer 65536, backlog 128 } # Uncomment and adjust as you see fit%0a tls { keypair fedi.example.com }%0a%0a # Forward some paths to the local server (as pleroma won't respond to them as you might want)%0a pass request quick path "/robots.txt" forward to %3chttpd_server>%0a%0a # Append a bunch of headers%0a match request header append "X-Forwarded-For" value "$REMOTE_ADDR" # This two header and the next one are not strictly required by pleroma but adding them won't hurt%0a match request header append "X-Forwarded-By" value "$SERVER_ADDR:$SERVER_PORT"%0a%0a match request header append "Connection" value "upgrade"%0a}%0a%0arelay www {%0a listen on $ext_inet port https tls # Comment to disable listening on IPv4%0a%0a protocol plerup%0a%0a forward to %3cpleroma_server> port 4000%0a}%0a%0arelay www6 {%0a listen on $ext_inet6 port https tls # Comment to disable listening on IPv6%0a%0a protocol plerup%0a%0a forward to %3cpleroma_server> port 4000%0a}%0a@]%0a%0aChange @@fedi.example.com@@ with your instance domain.%0a%0aAgain, change @@%3cIPv4 address>@@ and @@%3cIPv6 address>@@ to your server's address(es) and comment one of the two listen options if needed.%0a%0aCheck the configuration with @@relayd -n@@, if it is OK enable and start relayd (as root):%0a[@%0a$ doas rcctl enable relayd%0a$ doas rcctl start relayd%0a@]%0a%0a!! Configuring pf%0aEnabling and configuring pf is highly recommended. In @@/etc/pf.conf@@, insert the following configuration:%0a%0a[@%0a# Macros%0aif="%3cnetwork interface>"%0aauthorized_ssh_clients="any"%0a%0a# Skip traffic on loopback interface%0aset skip on lo%0a%0a# Default behavior%0aset block-policy drop%0ablock in log all%0apass out quick%0a%0a# Security features%0amatch in all scrub (no-df random-id)%0ablock in log from urpf-failed%0a%0a# Rules%0apass in quick on $if inet proto icmp to ($if) icmp-type { echoreq unreach paramprob trace } # ICMP%0apass in quick on $if inet6 proto icmp6 to ($if) icmp6-type { echoreq unreach paramprob timex toobig } # ICMPv6%0apass in quick on $if proto tcp to ($if) port { http https } # relayd/httpd%0apass in quick on $if proto tcp from $authorized_ssh_clients to ($if) port ssh%0a@]%0a%0aReplace @@%3cnetwork interface>@@ by your server's network interface name (which you can get with ifconfig). Consider replacing the content of the @@authorized_ssh_clients@@ macro by, for example, your home IP address, to avoid SSH connection attempts from bots.%0a%0aCheck pf's configuration by running @@pfctl -nf /etc/pf.conf@@, load it with @@pfctl -f /etc/pf.conf@@ and enable pf at boot with @@rcctl enable pf@@.%0a%0a%0a!! Configuring and starting Pleroma%0aEnter a shell as _pleroma (as root do @@su -l _pleroma@@) and enter pleroma's installation directory:%0a[@%0a$ cd ~/pleroma%0a@]%0a%0a%0aNow, Run the following command:%0a[@%0a$ mix deps.get%0a@]%0a%0aWhen asked to install Hex dependencies, Press @@Y@@ then @@RETURN@@/Enter.%0a%0aOnce dependencies succesfully retrieved, Run%0a[@%0a$ MIX_PROD=prod mix pleroma.instance gen%0a@]%0a%0aWhen asked to install @@rebar3@@, Press @@Y@@ then @@RETURN@@/Enter, and enter your instance information when asked.%0a%0a%0aCopy @@config/generated_config.exs@@ to @@config/prod.secret.exs@@. The default values should be sufficient but you should edit it and check that everything seems OK.%0a[@%0a$ cp config/generated_config.exs config/prod.secret.exs%0a@]%0a%0aExit your current shell back to root one and run the following command to set up database:%0a[@%0a# psql -U postgres -f /home/_pleroma/pleroma/config/setup_db.psql%0a@]%0a%0aReturn to _pleroma shell into pleroma's installation directory (@@su -l _pleroma;cd ~/pleroma@@) and run%0a[@%0a$ MIX_ENV=prod mix ecto.migrate%0a@]%0a%0a%0aAs @@_pleroma@@ in @@/home/_pleroma/pleroma@@, You can now run the following command to start your instance:%0a[@%0a$ MIX_ENV=prod mix phx.server%0a@]%0a%0aIn another SSH session/tmux window, check that it is working properly by running @@ftp -MVo - http://127.0.0.1:4000/api/v1/instance@@, you should get json output. Double-check that uri's value is your instance's domain name.%0a%0a!! Starting Pleroma at boot%0aAs @@_pleroma@@, Edit crontab by doing this:%0a[@%0a$ crontab -e%0a@]%0a%0aThen insert this:%0a[@%0a@reboot tmux new -d "source ~/.profile; cd ~/pleroma; while true; do LC_ALL=en_US.UTF-8 MIX_ENV=prod mix phx.server; done"%0a@]%0a%0a!! Create administrative user%0aIf your instance is up and running, you can create your first user with administrative rights with the following command as the @@_pleroma@@ user.%0a%0a[@%0a$ MIX_ENV=prod mix pleroma.user new %3cusername> %3cyour@emailaddress> --admin%0a@]
16
2023-01-22
diff:1674241986:1670765677:=2,3c2,3%0a%3c Pleroma is a microblogging server software that can federate (exchange messages with) other servers that support ActivityPub. What that means is that you can host a server for yourself or your friends and stay in control of your online identity, but still exchange messages with people on larger servers. Pleroma will federate with all servers that implement ActivityPub, like Friendica, GNU Social, Hubzilla, Mastodon, Misskey, Peertube, and Pixelfed.%0a%3c %0a---%0a> Pleroma is a microblogging server software that can federate (= exchange messages with) other servers that support ActivityPub. What that means is that you can host a server for yourself or your friends and stay in control of your online identity, but still exchange messages with people on larger servers. Pleroma will federate with all servers that implement ActivityPub, like Friendica, GNU Social, Hubzilla, Mastodon, Misskey, Peertube, and Pixelfed.%0a> %0a78,79c78,79%0a%3c $ doas rcctl enable postgresql%0a%3c $ doas rcctl start postgresql%0a---%0a> # rcctl enable postgresql%0a> # rcctl start postgresql%0a94c94,95%0a%3c %0a---%0a> # $OpenBSD: httpd.conf,v 1.17 2017/04/16 08:50:49 ajacoutot Exp $%0a> %0a126c127%0a%3c $ doas httpd -n%0a---%0a> # httpd -n%0a131,132c132,133%0a%3c $ doas rcctl enable httpd%0a%3c $ doas rcctl start httpd%0a---%0a> # rcctl enable httpd%0a> # rcctl start httpd%0a135c136%0a%3c !!! acme-client%0a---%0a> !! acme-client%0a138c139%0a%3c !!! Configuring relayd%0a---%0a> !! Configuring relayd%0a142c143,144%0a%3c %0a---%0a> # $OpenBSD: relayd.conf,v 1.4 2018/03/23 09:55:06 claudio Exp $%0a> %0a186,187c188,189%0a%3c $ doas rcctl enable relayd%0a%3c $ doas rcctl start relayd%0a---%0a> # rcctl enable relayd%0a> # rcctl start relayd%0a
19
2023-01-22
diff:1670765677:1670765061:=4c4%0a%3c This guide describes the installation and configuration of Pleroma (and the required software to run it) on a single OpenBSD 7.2 server.%0a---%0a> This guide describes the installation and configuration of pleroma (and the required software to run it) on a single OpenBSD 7.2 server.%0a
22
2023-01-22
diff:1670765061:1670197776:=9c9%0a%3c # pkg_add elixir gmake git postgresql-server postgresql-contrib cmake ffmpeg ImageMagick p5-Image-ExifTool libmagic erlang-wx%0a---%0a> # pkg_add elixir gmake git postgresql-server postgresql-contrib cmake ffmpeg ImageMagick p5-Image-ExifTool libmagic erlang-wx-25.0.4%0a12,14c12,17%0a%3c Pick the latest version of @@erlang-wx@@ when asked.%0a%3c %0a%3c Create @@pleroma@@ user to be run in dedicated user. Before creating it, Edit @@/etc/login.conf@@:%0a---%0a> Symlink @@/usr/local/bin/escript25@@ to @@/usr/local/bin/escript@@%0a> [@%0a> # ln -s /usr/local/bin/escript25 /usr/local/bin/escript%0a> @]%0a> %0a> Then create @@pleroma@@ user to be run in dedicated user. Before creating it, Edit @@/etc/login.conf@@:%0a
25
2023-01-22
diff:1670197776:1670000454:=288c288,300%0a%3c @]%0a\ No newline at end of file%0a---%0a> @]%0a> %0a> !! Installing Frontends%0a> Once your backend server is functional, you'll also want to probably install frontends.%0a> %0a> These are no longer bundled with the distribution and need an extra command to install.%0a> %0a> For most installations, the following will suffice:%0a> [@%0a> $ export MIX_ENV=prod%0a> $ mix pleroma.frontend install pleroma-fe --ref stable%0a> $ mix pleroma.frontend install admin-fe --ref stable%0a> @]%0a
28
2023-01-22
diff:1670000454:1670000401:=227c227%0a%3c !! Configuring and starting Pleroma%0a---%0a> !! Configuring and starting pleroma%0a272c272%0a%3c !! Starting Pleroma at boot%0a---%0a> !! Starting pleroma at boot%0a
32
2023-01-22
diff:1670000401:1670000401:=1,300d0%0a%3c (:title Pleroma:)%0a%3c Pleroma is a microblogging server software that can federate (= exchange messages with) other servers that support ActivityPub. What that means is that you can host a server for yourself or your friends and stay in control of your online identity, but still exchange messages with people on larger servers. Pleroma will federate with all servers that implement ActivityPub, like Friendica, GNU Social, Hubzilla, Mastodon, Misskey, Peertube, and Pixelfed.%0a%3c %0a%3c This guide describes the installation and configuration of pleroma (and the required software to run it) on a single OpenBSD 7.2 server.%0a%3c %0a%3c !! Installation%0a%3c First, We need to install the required dependencies%0a%3c [@%0a%3c # pkg_add elixir gmake git postgresql-server postgresql-contrib cmake ffmpeg ImageMagick p5-Image-ExifTool libmagic erlang-wx-25.0.4%0a%3c @]%0a%3c %0a%3c Symlink @@/usr/local/bin/escript25@@ to @@/usr/local/bin/escript@@%0a%3c [@%0a%3c # ln -s /usr/local/bin/escript25 /usr/local/bin/escript%0a%3c @]%0a%3c %0a%3c Then create @@pleroma@@ user to be run in dedicated user. Before creating it, Edit @@/etc/login.conf@@:%0a%3c [@%0a%3c pleroma:\%0a%3c :datasize-max=1536M:\%0a%3c :datasize-cur=1536M:\%0a%3c :openfiles-max=4096%0a%3c @]%0a%3c %0a%3c This creates a "pleroma" login class and sets higher values than default for datasize and openfiles (see login.conf(5)), this is required to avoid having pleroma crash some time after starting.%0a%3c %0a%3c Create the @@_pleroma@@ user, assign it the pleroma login class and create its home directory (/home/_pleroma/):%0a%3c [@%0a%3c # useradd -m -L pleroma _pleroma%0a%3c @]%0a%3c %0a%3c Enter a shell as the _pleroma user. As root, run%0a%3c [@%0a%3c # su -l _pleroma%0a%3c @]%0a%3c %0a%3c Because we're running in a VM, Disable time correction to prevent interruption during compilation, And disable Busy-waiting feature to improve performance a bit. Edit @@~/.vm.args@@, insert:%0a%3c %0a%3c [@%0a%3c +c false%0a%3c +sbwt none%0a%3c +sbwtdcpu none%0a%3c +sbwtdio none%0a%3c @]%0a%3c %0a%3c Then save it.%0a%3c %0a%3c Edit @@~/.profile@@, Then add this to the bottom of file:%0a%3c %0a%3c [@%0a%3c export LC_ALL=en_US.UTF-8%0a%3c alias mix="elixir --erl \"-args_file $HOME/.vm.args\" -S $(command -v mix)"%0a%3c @]%0a%3c %0a%3c Then save it.%0a%3c %0a%3c Then clone the repository by doing:%0a%3c [@%0a%3c $ git clone https://git.pleroma.social/pleroma/pleroma.git%0a%3c @]%0a%3c %0a%3c Pleroma is now installed in @@/home/_pleroma/pleroma/@@, it will be configured and started at the end of this guide.%0a%3c %0a%3c !! Setting up the database: postgresql%0a%3c Start a shell as the _postgresql user. As root, run%0a%3c [@%0a%3c # su -l _postgresql%0a%3c @]%0a%3c %0a%3c Then run the initdb command to initialize postgresql. You will need to specify pgdata directory to the default (@@/var/postgresql/data@@) with the @@-D %3cpath>@@ and set the user to postgres with the @@-U %3cusername>@@ flag. This can be done as follows:%0a%3c %0a%3c [@%0a%3c # initdb -D /var/postgresql/data -U postgres%0a%3c @]%0a%3c %0a%3c If you are not using the default directory, you will have to update the @@datadir@@ variable in the @@/etc/rc.d/postgresql@@ script.%0a%3c %0a%3c %0a%3c When this is done, enable postgresql so that it starts on boot and start it. As root, run:%0a%3c [@%0a%3c # rcctl enable postgresql%0a%3c # rcctl start postgresql%0a%3c @]%0a%3c %0a%3c To check that it started properly and didn't fail right after starting, you can run @@ps aux | grep postgres@@, there should be multiple lines of output.%0a%3c %0a%3c !! Configuring httpd%0a%3c httpd will have three fuctions:%0a%3c %0a%3c # Redirect requests trying to reach the instance over http to the https URL%0a%3c # Serve a robots.txt file%0a%3c # Get Let's Encrypt certificates, with acme-client%0a%3c %0a%3c Insert the following config in httpd.conf:%0a%3c %0a%3c [@%0a%3c # $OpenBSD: httpd.conf,v 1.17 2017/04/16 08:50:49 ajacoutot Exp $%0a%3c %0a%3c ext_inet="%3cIPv4 address>"%0a%3c ext_inet6="%3cIPv6 address>"%0a%3c %0a%3c server "default" {%0a%3c listen on $ext_inet port 80 # Comment to disable listening on IPv4%0a%3c listen on $ext_inet6 port 80 # Comment to disable listening on IPv6%0a%3c listen on 127.0.0.1 port 80 # Do NOT comment this line%0a%3c %0a%3c log syslog%0a%3c directory no index%0a%3c %0a%3c location "/.well-known/acme-challenge/*" {%0a%3c root "/acme"%0a%3c request strip 2%0a%3c }%0a%3c %0a%3c location "/robots.txt" { root "/htdocs/" }%0a%3c location "/*" { block return 302 "https://$HTTP_HOST$REQUEST_URI" }%0a%3c }%0a%3c @]%0a%3c %0a%3c Do not forget to change @@%3cIPv4/6 address>@@ to your server's address(es). If httpd should only listen on one protocol family, comment one of the two first listen options.%0a%3c %0a%3c Write the content of your @@robots.txt@@ in @@/var/www/htdocs/robots.txt@@:%0a%3c [@%0a%3c User-Agent: *%0a%3c Disallow:%0a%3c @]%0a%3c %0a%3c Check the httpd configuration%0a%3c [@%0a%3c # httpd -n%0a%3c @]%0a%3c %0a%3c If it's OK, enable and start httpd%0a%3c [@%0a%3c # rcctl enable httpd%0a%3c # rcctl start httpd%0a%3c @]%0a%3c %0a%3c !! acme-client%0a%3c See https://wiki.ircnow.org/index.php?n=Acme-client.Configure%0a%3c %0a%3c !! Configuring relayd%0a%3c relayd will be used as the reverse proxy sitting in front of pleroma. Insert the following configuration in @@/etc/relayd.conf@@:%0a%3c %0a%3c [@%0a%3c # $OpenBSD: relayd.conf,v 1.4 2018/03/23 09:55:06 claudio Exp $%0a%3c %0a%3c ext_inet="%3cIPv4 address>"%0a%3c ext_inet6="%3cIPv6 address>"%0a%3c %0a%3c table %3cpleroma_server> { 127.0.0.1 }%0a%3c table %3chttpd_server> { 127.0.0.1 }%0a%3c %0a%3c http protocol plerup { # Protocol for upstream pleroma server%0a%3c #tcp { nodelay, sack, socket buffer 65536, backlog 128 } # Uncomment and adjust as you see fit%0a%3c tls { keypair fedi.example.com }%0a%3c %0a%3c # Forward some paths to the local server (as pleroma won't respond to them as you might want)%0a%3c pass request quick path "/robots.txt" forward to %3chttpd_server>%0a%3c %0a%3c # Append a bunch of headers%0a%3c match request header append "X-Forwarded-For" value "$REMOTE_ADDR" # This two header and the next one are not strictly required by pleroma but adding them won't hurt%0a%3c match request header append "X-Forwarded-By" value "$SERVER_ADDR:$SERVER_PORT"%0a%3c %0a%3c match request header append "Connection" value "upgrade"%0a%3c }%0a%3c %0a%3c relay www {%0a%3c listen on $ext_inet port https tls # Comment to disable listening on IPv4%0a%3c %0a%3c protocol plerup%0a%3c %0a%3c forward to %3cpleroma_server> port 4000%0a%3c }%0a%3c %0a%3c relay www6 {%0a%3c listen on $ext_inet6 port https tls # Comment to disable listening on IPv6%0a%3c %0a%3c protocol plerup%0a%3c %0a%3c forward to %3cpleroma_server> port 4000%0a%3c }%0a%3c @]%0a%3c %0a%3c Change @@fedi.example.com@@ with your instance domain.%0a%3c %0a%3c Again, change @@%3cIPv4 address>@@ and @@%3cIPv6 address>@@ to your server's address(es) and comment one of the two listen options if needed.%0a%3c %0a%3c Check the configuration with @@relayd -n@@, if it is OK enable and start relayd (as root):%0a%3c [@%0a%3c # rcctl enable relayd%0a%3c # rcctl start relayd%0a%3c @]%0a%3c %0a%3c !! Configuring pf%0a%3c Enabling and configuring pf is highly recommended. In @@/etc/pf.conf@@, insert the following configuration:%0a%3c %0a%3c [@%0a%3c # Macros%0a%3c if="%3cnetwork interface>"%0a%3c authorized_ssh_clients="any"%0a%3c %0a%3c # Skip traffic on loopback interface%0a%3c set skip on lo%0a%3c %0a%3c # Default behavior%0a%3c set block-policy drop%0a%3c block in log all%0a%3c pass out quick%0a%3c %0a%3c # Security features%0a%3c match in all scrub (no-df random-id)%0a%3c block in log from urpf-failed%0a%3c %0a%3c # Rules%0a%3c pass in quick on $if inet proto icmp to ($if) icmp-type { echoreq unreach paramprob trace } # ICMP%0a%3c pass in quick on $if inet6 proto icmp6 to ($if) icmp6-type { echoreq unreach paramprob timex toobig } # ICMPv6%0a%3c pass in quick on $if proto tcp to ($if) port { http https } # relayd/httpd%0a%3c pass in quick on $if proto tcp from $authorized_ssh_clients to ($if) port ssh%0a%3c @]%0a%3c %0a%3c Replace @@%3cnetwork interface>@@ by your server's network interface name (which you can get with ifconfig). Consider replacing the content of the @@authorized_ssh_clients@@ macro by, for example, your home IP address, to avoid SSH connection attempts from bots.%0a%3c %0a%3c Check pf's configuration by running @@pfctl -nf /etc/pf.conf@@, load it with @@pfctl -f /etc/pf.conf@@ and enable pf at boot with @@rcctl enable pf@@.%0a%3c %0a%3c %0a%3c !! Configuring and starting pleroma%0a%3c Enter a shell as _pleroma (as root do @@su -l _pleroma@@) and enter pleroma's installation directory:%0a%3c [@%0a%3c $ cd ~/pleroma%0a%3c @]%0a%3c %0a%3c %0a%3c Now, Run the following command:%0a%3c [@%0a%3c $ mix deps.get%0a%3c @]%0a%3c %0a%3c When asked to install Hex dependencies, Press @@Y@@ then @@RETURN@@/Enter.%0a%3c %0a%3c Once dependencies succesfully retrieved, Run%0a%3c [@%0a%3c $ MIX_PROD=prod mix pleroma.instance gen%0a%3c @]%0a%3c %0a%3c When asked to install @@rebar3@@, Press @@Y@@ then @@RETURN@@/Enter, and enter your instance information when asked.%0a%3c %0a%3c %0a%3c Copy @@config/generated_config.exs@@ to @@config/prod.secret.exs@@. The default values should be sufficient but you should edit it and check that everything seems OK.%0a%3c [@%0a%3c $ cp config/generated_config.exs config/prod.secret.exs%0a%3c @]%0a%3c %0a%3c Exit your current shell back to root one and run the following command to set up database:%0a%3c [@%0a%3c # psql -U postgres -f /home/_pleroma/pleroma/config/setup_db.psql%0a%3c @]%0a%3c %0a%3c Return to _pleroma shell into pleroma's installation directory (@@su -l _pleroma;cd ~/pleroma@@) and run%0a%3c [@%0a%3c $ MIX_ENV=prod mix ecto.migrate%0a%3c @]%0a%3c %0a%3c %0a%3c As @@_pleroma@@ in @@/home/_pleroma/pleroma@@, You can now run the following command to start your instance:%0a%3c [@%0a%3c $ MIX_ENV=prod mix phx.server%0a%3c @]%0a%3c %0a%3c In another SSH session/tmux window, check that it is working properly by running @@ftp -MVo - http://127.0.0.1:4000/api/v1/instance@@, you should get json output. Double-check that uri's value is your instance's domain name.%0a%3c %0a%3c !! Starting pleroma at boot%0a%3c As @@_pleroma@@, Edit crontab by doing this:%0a%3c [@%0a%3c $ crontab -e%0a%3c @]%0a%3c %0a%3c Then insert this:%0a%3c [@%0a%3c @reboot tmux new -d "source ~/.profile; cd ~/pleroma; while true; do LC_ALL=en_US.UTF-8 MIX_ENV=prod mix phx.server; done"%0a%3c @]%0a%3c %0a%3c !! Create administrative user%0a%3c If your instance is up and running, you can create your first user with administrative rights with the following command as the @@_pleroma@@ user.%0a%3c %0a%3c [@%0a%3c $ MIX_ENV=prod mix pleroma.user new %3cusername> %3cyour@emailaddress> --admin%0a%3c @]%0a%3c %0a%3c !! Installing Frontends%0a%3c Once your backend server is functional, you'll also want to probably install frontends.%0a%3c %0a%3c These are no longer bundled with the distribution and need an extra command to install.%0a%3c %0a%3c For most installations, the following will suffice:%0a%3c [@%0a%3c $ export MIX_ENV=prod%0a%3c $ mix pleroma.frontend install pleroma-fe --ref stable%0a%3c $ mix pleroma.frontend install admin-fe --ref stable%0a%3c @]%0a