lemmynet / lemmy-ansible Goto Github PK
View Code? Open in Web Editor NEWA docker deploy for ansible
License: GNU Affero General Public License v3.0
A docker deploy for ansible
License: GNU Affero General Public License v3.0
Looks like I'm getting a python error from certbot, running Ubuntu Linux (ubuntu 20.04), fresh install of Linux, have only ran the stuff from this repository.
Removed domain and email for privacy
TASK [request initial letsencrypt certificate] ***************************************************************************************************
fatal: [lemmy.ristl.org]: FAILED! => {"changed": true, "cmd": ["certbot", "certonly", "--nginx", "--agree-tos", "--cert-name", "", "-d", """, "-m", ""], "delta": "0:00:00.353763", "end": "2023-06-21 14:18:18.269786", "msg": "non-zero return code", "rc": 1, "start": "2023-06-21 14:18:17.916023", "stderr": "Traceback (most recent call last):\n File "/usr/lib/python3/dist-packages/requests_toolbelt/_compat.py", line 49, in \n from requests.packages.urllib3.contrib import appengine as gaecontrib\nImportError: cannot import name 'appengine' from 'requests.packages.urllib3.contrib' (/usr/local/lib/python3.8/dist-packages/urllib3/contrib/init.py)\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n File "/usr/bin/certbot", line 11, in \n load_entry_point('certbot==0.40.0', 'console_scripts', 'certbot')()\n File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 490, in load_entry_point\n return get_distribution(dist).load_entry_point(group, name)\n File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 2854, in load_entry_point\n return ep.load()\n File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 2445, in load\n return self.resolve()\n File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 2451, in resolve\n module = import(self.module_name, fromlist=['name'], level=0)\n File "/usr/lib/python3/dist-packages/certbot/main.py", line 20, in \n from certbot import client\n File "/usr/lib/python3/dist-packages/certbot/client.py", line 14, in \n from acme import client as acme_client\n File "/usr/lib/python3/dist-packages/acme/client.py", line 16, in \n from requests_toolbelt.adapters.source import SourceAddressAdapter\n File "/usr/lib/python3/dist-packages/requests_toolbelt/init.py", line 12, in \n from .adapters import SSLAdapter, SourceAddressAdapter\n File "/usr/lib/python3/dist-packages/requests_toolbelt/adapters/init.py", line 12, in \n from .ssl import SSLAdapter\n File "/usr/lib/python3/dist-packages/requests_toolbelt/adapters/ssl.py", line 16, in \n from .._compat import poolmanager\n File "/usr/lib/python3/dist-packages/requests_toolbelt/_compat.py", line 51, in \n from urllib3.contrib import appengine as gaecontrib\nImportError: cannot import name 'appengine' from 'urllib3.contrib' (/usr/local/lib/python3.8/dist-packages/urllib3/contrib/init.py)", "stderr_lines": ["Traceback (most recent call last):", " File "/usr/lib/python3/dist-packages/requests_toolbelt/_compat.py", line 49, in ", " from requests.packages.urllib3.contrib import appengine as gaecontrib", "ImportError: cannot import name 'appengine' from 'requests.packages.urllib3.contrib' (/usr/local/lib/python3.8/dist-packages/urllib3/contrib/init.py)", "", "During handling of the above exception, another exception occurred:", "", "Traceback (most recent call last):", " File "/usr/bin/certbot", line 11, in ", " load_entry_point('certbot==0.40.0', 'console_scripts', 'certbot')()", " File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 490, in load_entry_point", " return get_distribution(dist).load_entry_point(group, name)", " File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 2854, in load_entry_point", " return ep.load()", " File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 2445, in load", " return self.resolve()", " File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 2451, in resolve", " module = import(self.module_name, fromlist=['name'], level=0)", " File "/usr/lib/python3/dist-packages/certbot/main.py", line 20, in ", " from certbot import client", " File "/usr/lib/python3/dist-packages/certbot/client.py", line 14, in ", " from acme import client as acme_client", " File "/usr/lib/python3/dist-packages/acme/client.py", line 16, in ", " from requests_toolbelt.adapters.source import SourceAddressAdapter", " File "/usr/lib/python3/dist-packages/requests_toolbelt/init.py", line 12, in ", " from .adapters import SSLAdapter, SourceAddressAdapter", " File "/usr/lib/python3/dist-packages/requests_toolbelt/adapters/init.py", line 12, in ", " from .ssl import SSLAdapter", " File "/usr/lib/python3/dist-packages/requests_toolbelt/adapters/ssl.py", line 16, in ", " from .._compat import poolmanager", " File "/usr/lib/python3/dist-packages/requests_toolbelt/_compat.py", line 51, in ", " from urllib3.contrib import appengine as gaecontrib", "ImportError: cannot import name 'appengine' from 'urllib3.contrib' (/usr/local/lib/python3.8/dist-packages/urllib3/contrib/init.py)"], "stdout": "", "stdout_lines": []}
I'm trying to setup a Lemmy installation at using Ansible
https://kaogeek.zymple.biz/
and I'm getting an error at 404: FetchError: request to http://lemmy:8536/api/v3/site? failed, reason: getaddrinfo EAI_AGAIN lemmy
What could be causing this?
Thank you
Best regards,
Mishari
The playbook currently checks the server distro and version to install python-certbot-nginx
on Ubuntu versions before 20.04, and python3-certbot-nginx
on Ubuntu 20.04 and later. I tested this at some point and it worked. The problem is that this check will make the playbook fail completely on Debian and derivatives.
https://github.com/LemmyNet/lemmy-ansible/blob/main/lemmy.yml#L33
To avoid this issue, i'm thinking to simply remove that check, and always install python3-certbot-nginx
. Goal being to make the playbook compatible with as many distros (and distro versions) as possible. So my question to anyone who is familiar with the Python situation on Debian-based distros, does that sound like a good idea?
An alternative solution could be to create separate playbooks for each distro (if we find people to maintain them).
I am doing this on a clean Ubuntu VPS install for the 20th time, I have not had any luck.
I am doing this on a Ubuntu install within Windows.
I have also tried setting the VPS to Debian and CentOS with the same errors.
I have also tried installing this from Linux Mint and MX Linux
I created a DNS A record from my domain (big.com.ge) to my server ip (198.252.108.135)
I followed all the steps:
Ran: git clone https://github.com/LemmyNet/lemmy-ansible.git
Made a directory for my config, copied the config file and configured it
Copied the hosts file and configured it.
Ran the playbook "ansible-playbook -i inventory/hosts lemmy.yml"
My website only displays "Welcome to nginx!"
This was my server log:
PLAY [all] *********************************************************************************************************************
TASK [check lemmy_base_dir] ****************************************************************************************************skipping: [[email protected]]
TASK [install python for Ansible] **********************************************************************************************changed: [[email protected]]
TASK [setup] *******************************************************************************************************************ok: [[email protected]]
TASK [install dependencies] ****************************************************************************************************changed: [[email protected]]
TASK [request initial letsencrypt certificate] *********************************************************************************changed: [[email protected]]
TASK [create lemmy folder] *****************************************************************************************************changed: [[email protected]] => (item={'path': '/srv/lemmy/big.com.ge/', 'owner': 'root'})
changed: [[email protected]] => (item={'path': '/srv/lemmy/big.com.ge/volumes/', 'owner': 'root'})
changed: [[email protected]] => (item={'path': '/srv/lemmy/big.com.ge/volumes/pictrs/', 'owner': '991'})
TASK [set_fact] ****************************************************************************************************************ok: [[email protected]]
TASK [add template files] ******************************************************************************************************changed: [[email protected]] => (item={'src': 'templates/docker-compose.yml', 'dest': '/srv/lemmy/big.com.ge/docker-compose.yml', 'mode': '0600'})
changed: [[email protected]] => (item={'src': 'templates/nginx.conf', 'dest': '/etc/nginx/sites-enabled/big.com.ge.conf', 'mode': '0644'})
TASK [add the config.hjson] ****************************************************************************************************changed: [[email protected]]
TASK [enable and start docker service] *****************************************************************************************ok: [[email protected]]
TASK [start docker-compose] ****************************************************************************************************changed: [[email protected]]
TASK [reload nginx with new config] ********************************************************************************************changed: [[email protected]]
TASK [certbot renewal cronjob] *************************************************************************************************changed: [[email protected]]
PLAY RECAP *********************************************************************************************************************[email protected] : ok=12 changed=9 unreachable=0 failed=0 skipped=1 rescued=0 ignored=0`
This is my hosts file:
[email protected] domain=big.com.ge [email protected] lemmy_base_dir=/srv/lemmy
[all:vars]
ansible_connection=ssh
This is my config file:
{
# settings related to the postgresql database
database: {
# Username to connect to postgres
user: "lemmy"
# Password to connect to postgres
password: "(REMOVED)"
# Host where postgres is running
host: "postgres"
# Port where postgres can be accessed
port: 5432
# Name of the postgres database for lemmy
database: "lemmy"
# Maximum number of active sql connections
pool_size: 5
}
# rate limits for various user actions, by user ip
rate_limit: {
# Maximum number of messages created in interval
message: 180
# Interval length for message limit, in seconds
message_per_second: 60
# Maximum number of posts created in interval
post: 6
# Interval length for post limit, in seconds
post_per_second: 600
# Maximum number of registrations in interval
register: 3
# Interval length for registration limit, in seconds
register_per_second: 3600
# Maximum number of image uploads in interval
image: 6
# Interval length for image uploads, in seconds
image_per_second: 3600
}
# Settings related to activitypub federation
# federation: {
# Whether to enable activitypub federation.
enabled: false
# Allows and blocks are described here:
# https://join-lemmy.org/docs/en/federation/administration.html///instance-allowlist-and-blocklist
#
# list of instances with which federation is allowed
# allowed_instances: [
# instance1.tld
# instance2.tld
# /* ... */
#]
# Instances which we never federate anything with (but previously federated objects are unaffected)
#blocked_instances: [
# string
# /* ... */
#]
# If true, only federate with instances on the allowlist and block everything else. If false
# use allowlist only for remote communities, and posts/comments in local communities
# (meaning remote communities will show content from arbitrary instances).
# strict_allowlist: true
#}
captcha: { enabled: false
# Can be easy, medium, or hard
difficulty: "medium"
}
# Email sending configuration. All options except login/password are mandatory
email: {
# Hostname and port of the smtp server
smtp_server: "localhost:25"
# Login name for smtp server
smtp_login: "admin"
# Password to login to the smtp server
smtp_password: "REMOVED"
# Address to send emails from, eg [email protected]
smtp_from_address: "[email protected]"
# Whether or not smtp connections should use tls
use_tls: true
}
# Parameters for automatic configuration of new instance (only used at first start)
setup: {
# Username for the admin user
admin_username: "admin"
# Password for the admin user
admin_password: "REMOVED"
# Name of the site (can be changed later)
site_name: "My Lemmy Instance"
# Email for the admin user (optional, can be omitted and set later through the website)
#admin_email: "string"
#sidebar: "string"
#description: "string"
#icon: "string"
#banner: "string"
#enable_downvotes: true
#open_registration: true
#enable_nsfw: true
#community_creation_admin_only: true
}
# the domain name of your instance (mandatory)
hostname: "big.com.ge"
# Address where lemmy should listen for incoming requests
bind: "0.0.0.0"
# Port where lemmy should listen for incoming requests
port: 8536
# Whether the site is available over TLS. Needs to be true for federation to work.
tls_enabled: true
# Address where pictrs is available (for image hosting)
pictrs_url: "http:#localhost:8080"
slur_filter: "(\bThis\b)|(\bis\b)|(\bsample\b)"
# Maximum length of local community and user names
actor_name_max_length: 20
}
The backups section of the wiki seems to only be for docker installs and doesn't have information about how to do periodic backups after installing with Ansible
lemmy-ansible/templates/nginx.conf
Lines 103 to 111 in c24e8a7
this was originally in the initial commit in this repo intended to be anonymizing nginx logs, by cutting off the last bits of ips:
80690af#diff-8f9a7a73ce9c7de4398aaf3ca2224c97dfa796ef199ee4321e7f0b36d9f75162R106-R117
this was however never implemented properly in the first place, as discovered in #5, which changed the log format to combined
.
the proper implementation, which would have used the custom log format, would have been access_log /var/log/nginx/access.log lemmy_main;
instead of the originally committed access_log /var/log/nginx/access.log main;
, or alternatively changing the custom log format name to main
by using the following line:
log_format main '$remote_addr_anon - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" "$http_user_agent"';
in addition, if the intention is to actually anonymize ips, you should consider whether you want to forward non-anonymized ips to lemmy services, as they're currently receiving non-anonymized ips through X-Real-IP $remote_addr
and X-Forwarded-For $proxy_add_x_forwarded_for
.
if there is no intention to anonymize ips, you should remove the map from the config to avoid confusion.
Hello,
On a fresh lemmy install on ubuntu server 22.04 (arm64 for raspberry pi and x64), I got this error (each time):
TASK [start docker-compose] ************************************************************************************************************************************************************
fatal: [user@IP_ADDRESS]: FAILED! => {"changed": false, "msg": "Unable to load docker-compose. Try `pip install docker-compose`. Error: Traceback (most recent call last):\n File \"/tmp/ansible_docker_compose_payload_ixgojrhn/ansible_docker_compose_payload.zip/ansible_collections/community/docker/plugins/modules/docker_compose.py\", line 506, in <module>\nModuleNotFoundError: No module named 'compose'\n"}
For information, I also got this warning:
TASK [Add Docker GPG apt Key] ******************************************************************************************************************
[WARNING]: Module remote_tmp /root/.ansible/tmp did not exist and was created with a mode of 0700, this may cause issues when running as
another user. To avoid this, create the remote_tmp dir with the correct permissions manually
changed: [user@IP_ADDRESS]
Any idea how to run this playbook without error ?
Thanks :)
For one thing, we can run ansible-playbook lemmy.yml --syntax-check
One thing I didn't test with this setup: site icons.
We're getting this error on lemmygrad, with a site icon set:
lemmy-ui_1 | FetchError: request to https://lemmygrad.ml/pictrs/image/fb9bc50e-58d5-434b-9b34-c08f6b7ae23d.png failed, reason: getaddrinfo EAI_AGAIN lemmygrad.ml
I think this is because the internal node server doesn't have an external DNS, and can't access any external domains.
A temp fix was to do update site set icon = null where id = 1;
Hi, when using:
ansible-playbook -i inventory/hosts lemmy.yml --ask-become-pass
I get an error (the typical error on Debian when a user without privileges try to do an apt update:
TASK [install python for Ansible] ****************************************************************************************************
fatal: [[email protected]]: FAILED! => {"changed": true, "msg": "non-zero return code", "rc": 100, "stderr": "Shared connection to collapse.cat closed.\r\n", "stderr_lines": ["Shared connection to collapse.cat closed."], "stdout": "\rS'està llegint la llista de paquets… 0%\r\rS'està llegint la llista de paquets… 100%\r\rS'està llegint la llista de paquets… Fet \r\r\n\u001b[1;31mE: \u001b[0mNo s'ha pogut obrir el fitxer de blocat /var/lib/apt/lists/lock - open (13: S’ha denegat el permís)\u001b[0m\r\n\u001b[1;31mE: \u001b[0mNo es pot blocar el directori /var/lib/apt/lists/\u001b[0m\r\n\u001b[1;33mW: \u001b[0mHi ha hagut un problema en desenllaçar el fitxer /var/cache/apt/pkgcache.bin - RemoveCaches (13: S’ha denegat el permís)\u001b[0m\r\n\u001b[1;33mW: \u001b[0mHi ha hagut un problema en desenllaçar el fitxer /var/cache/apt/srcpkgcache.bin - RemoveCaches (13: S’ha denegat el permís)\u001b[0m\r\n", "stdout_lines": ["", "S'està llegint la llista de paquets… 0%", "", "S'està llegint la llista de paquets… 100%", "", "S'està llegint la llista de paquets… Fet ", "", "\u001b[1;31mE: \u001b[0mNo s'ha pogut obrir el fitxer de blocat /var/lib/apt/lists/lock - open (13: S’ha denegat el permís)\u001b[0m", "\u001b[1;31mE: \u001b[0mNo es pot blocar el directori /var/lib/apt/lists/\u001b[0m", "\u001b[1;33mW: \u001b[0mHi ha hagut un problema en desenllaçar el fitxer /var/cache/apt/pkgcache.bin - RemoveCaches (13: S’ha denegat el permís)\u001b[0m", "\u001b[1;33mW: \u001b[0mHi ha hagut un problema en desenllaçar el fitxer /var/cache/apt/srcpkgcache.bin - RemoveCaches (13: S’ha denegat el permís)\u001b[0m"]}
But the error is gone when using:
ansible-playbook -i inventory/hosts lemmy.yml --become -K
fatal: [[email protected]]: FAILED! => {"changed": true, "cmd": "nginx -s reload", "delta": "0:00:00.021904", "end": "2021-10-30 08:15:57.700702", "msg": "non-zero return code", "rc": 1, "start": "2021-10-30 08:15:57.678798", "stderr": "nginx: [emerg] unknown log format \"main\" in /etc/nginx/sites-enabled/feddit.de.conf:117", "stderr_lines": ["nginx: [emerg] unknown log format \"main\" in /etc/nginx/sites-enabled/feddit.de.conf:117"], "stdout": "", "stdout_lines": []}
so i guess it should be
access_log /var/log/nginx/access.log lemmy_main;
after that it throws:
fatal: [[email protected]]: FAILED! => {"changed": true, "cmd": "nginx -s reload", "delta": "0:00:00.020002", "end": "2021-10-30 08:19:06.509913", "msg": "non-zero return code", "rc": 1, "start": "2021-10-30 08:19:06.489911", "stderr": "nginx: [emerg] limit_req_zone \"lemmy_ratelimit\" is already bound to key \"$binary_remote_addr\" in /etc/nginx/sites-enabled/lemmy.conf:1", "stderr_lines": ["nginx: [emerg] limit_req_zone \"lemmy_ratelimit\" is already bound to key \"$binary_remote_addr\" in /etc/nginx/sites-enabled/lemmy.conf:1"], "stdout": "", "stdout_lines": []}
Continuing discussion from #3.
It would be good to have a better way of avoiding port conflicts when running multiple instances of lemmy
. Current approach (randomizing ports on every deploy) has several downsides.
Quick brainstorm about options here:
include nginx
in the docker-compose.yml
, allowing us to proxy_pass
directly to specific containers; name relevant containers using the {{domain}}
: lemmy-{{domain}}
, lemmy-ui-{{domain}}
, pictrs-{{domain}}
, etc. Host-installed nginx
would be unnecessary, or if already present would only need to hit a single port: the one exposed by the nginx
container.
Have some faith in the admins running instances, and make it possible to explicitly set ports per deployment, such that and admin deploying 3 different Lemmy instances would just explicitly define three sets of ports. A version of this would be to have a "starting port" configurable per instance, and each actual service port just offset by a well-defined value (say, lemmy_port
would be starting_port
; lemmy_ui_port
would be starting_port
+ 1, etc).
Option 1. is the cleanest, keeps all Lemmy deploys in a "package" within the docker-compose.yml
, all managed from a single lemmy-ansible
checkout with minimal side-effects on the host system. From a perspective of a sysadmin this might be the most preferable, and also is the most in-line with the "docker way of doing things" so to speak.
I have no idea what ansible is (sounds like the latest trendiest modern phone app for zoomers), and I'm trying to follow the instructions here, but they don't work. There seems to be critical information missing.
<your-domain>
appears, but it doesn't say anywhere what it should be.lemmy.mydomain.com
; is <your-domain>
to be lemmy.mydomain.com
or mydomain.com
?config.hjson
is pretty minimal, there's no instructions to tell me what to change/add.database
: host: postgres
there's no machine with that hostname... why is that default? Not localhost
?hosts
- Same question as above [email protected] domain=example.com
; should domain
be lemmy.mydomain.com
or mydomain.com
?error while creating mount source path '/srv/lemmy/lemmy.mydomain.com/volumes/postgres': mkdir /srv/lemmy: read-only file system
. I guess the script doesn't create a database... or it's trying to, but something's wrong and it's trying to act on a read-only filesystem?So, am I supposed to create a database somewhere else? There's no words about this anywhere, and I can't find anybody else complaining about this either by google searching, so I'm obviously completely incompetent, or something went wrong in my config and database creation is failing with unhelpful messages?
I've just started trying random stuff; I've tried to install a database server instance, and set host: localhost
, but it doesn't work, outputs the same error shown above. Messing with database users and stuff basically at random... no idea!
I'd suggest to update the install guide to clarify all these points.
Cheers.
EDIT:
For reference:
TASK [start docker-compose] ****************************************************************************************************************************************
fatal: [[email protected]]: FAILED! => {"changed": false, "errors": ["ERROR: for lemmydomaincom_postgres_1 Cannot start service postgres: error while creating mount source path '/srv/lemmy/lemmy.domain.com/volumes/postgres': mkdir /srv/lemmy: read-only file system"], "module_stderr": "Starting lemmydomaincom_postgres_1 ... \nRecreating b308f746aab3_lemmydomaincom_pictrs_1 ... \nStarting lemmydomaincom_postgres_1 ... error\n\nERROR: for lemmydomaincom_postgres_1 Cannot start service postgres: error while creating mount source path '/srv/lemmy/lemmy.domain.com/volumes/postgres': mkdir /srv/lemmy: read-only file system\nRecreating b308f746aab3_lemmydomaincom_pictrs_1 ... error\n", "module_stdout": "", "msg": "Error starting project Encountered errors while bringing up the project."}
Checking disk usage and can see pictrs log ("containerid"-json.log) is using 7.6gb of space in about 5 days.
Is anyone else able to check their log size to see this? Or is this unique to me?
If this isnt just me, can a log size cap and log rotation be added to the docker compose file to prevent this? Or the default logging level be lowered in the script?
I tried running it for a CentOS vps but I receive this error:
TASK [Install aptitude] ************************************************************************************************
[WARNING]: Updating cache and auto-installing missing dependency: python3-apt
fatal: [racknerd]: FAILED! => {"changed": false, "cmd": "apt-get update", "msg": "[Errno 2] No such file or directory: b'apt-get': b'apt-get'", "rc": 2}
PLAY RECAP *************************************************************************************************************
racknerd : ok=2 changed=1 unreachable=0 failed=1 skipped=1 rescued=0 ignored=0
I am using default configuration. Is there a playbook catered for CentOS?
Hello,
I see in the config file from Ansible this line:
lemmy-ansible/templates/nginx.conf
Line 54 in d4c1cd0
# Upload limit for pictrs
client_max_body_size 20M;
From what I can understand there is set that users can upload up to 20MB files, is that correct?
Since this seems excessive I wanted to lower the limit to 2MB. Having used Ansible as a method, can I manually edit the nginx configuration file on my server without having any conflicts whatsoever during the next release updates?
Thanks
I followed the instruction on this git repo, but ansible throws an error.
After executing the following command:
ansible-playbook -i inventory/hosts lemmy.yml
the following error is shown:
ERROR! no action detected in task. This often indicates a misspelled module name, or incorrect module path.
The error appears to have been in '/home/maxmoon/git_repos/lemmy-ansible/lemmy.yml': line 118, column 5, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
- name: start docker-compose
^ here
The task on line 118 only shows the following:
- name: start docker-compose
docker_compose:
project_src: '{{lemmy_base_dir}}/{{domain}}'
state: present
pull: yes
remove_orphans: yes
I can't figure out what the problem is, but could it be a problem that I use keys for ssh (instead of passwords) and don't use the default ssh port?
Thank you for your help in advance.
Hello,
I want to host my own lemmy instance but instead of using Nginx as a reverse proxy I want to use Caddy as a reverse proxy since it is easier. Is it possible to just reverse proxy localhost:1235 to my domain and be done with it or I have to do something else?
Thanks in advance!
It's common to have a server blocks regarding forwarding like this :)
server {
listen 80;
server_name www.example.com;
return 301 http://example.com$request_uri;
}server {
listen 80;
server_name example.com;
...
}
Would be amazing if this could be added to Ansible in order to configure this in nginx automatically.
Same applies to HTTPS, right? Also, is it possible to enter subdomains in the Ansible script for gettings certificates via certbot for both,
www.example.com
as well as example.com
itself.
Currently when opening browsing the www. version nginx default page appears. :)
Necessary to make admin purge of images work. Needs to be set as pictrs env var in docker-compose.yml, and in lemmy config.
Btw. this also needs to be added to instructions for manual installation.
Not sure if this is a lemmy issue or a setup. playbook runs fine. set everything up. logout and cannot log back in. It just hangs, any ideas?
Add a way to push a custom themes folder to volumes
TASK [start docker-compose] *************************************************************************************************** fatal: [[email protected]]: FAILED! => {"changed": false, "errors": [], "module_stderr": "Recreating 33ed084a4353_domaincom_pictrs_1 ... \nRecreating 12eff598f1bf_domaincom_postgres_1 ... \nStarting domaincom_postfix_1 ... \n", "module_stdout": "", "msg": "Error starting project a bytes-like object is required, not 'str'"}
replaced my real domain with placeholder "domain.com" for the sake of privacy
Debian 11 x64 updated install
This playbook assumes you're running on a Debian based linux distro. The readme only calls out "A VPS" as a requirement without specifying that it won't work in distros that don't use aptitude.
Brand new Lemmy install. Fresh VPS.
Hosting provider blocks outbound SMTP so I have to use a smarthost.
No emails are being sent.
Here are the logs:
lemmy_1 | 2022-05-06T21:31:12.413554Z ERROR Websocket Request{trace_id=00000000000000000000000000000000}: lemmy_websocket::handlers: Error during message handling email_send_failed: network error: Resource temporarily unavailable (os error 11)
lemmy_1 | 0: lemmy_api::local_user::perform
lemmy_1 | at crates/api/src/local_user.rs:772
lemmy_1 | 1: lemmy_websocket::handlers::Websocket Request
lemmy_1 | with trace_id=00000000000000000000000000000000
lemmy_1 | at crates/websocket/src/handlers.rs:68
lemmy_1 | 2022-05-06T21:32:13.853246Z ERROR Websocket Request{trace_id=00000000000000000000000000000000}: lemmy_websocket::handlers: Error during message handling email_send_failed: network error: Resource temporarily unavailable (os error 11)
lemmy_1 | 0: lemmy_api::local_user::perform
lemmy_1 | at crates/api/src/local_user.rs:772
lemmy_1 | 1: lemmy_websocket::handlers::Websocket Request
lemmy_1 | with trace_id=00000000000000000000000000000000
lemmy_1 | at crates/websocket/src/handlers.rs:68
lemmy_1 | 2022-05-06T21:32:13.853769Z INFO lemmy_websocket::handlers: 70.240.239.254 joined
lemmy_1 | 2022-05-06T21:32:14.358259Z INFO lemmy_websocket::handlers: 70.240.239.254 joined
lemmy_1 | 2022-05-06T21:33:52.157299Z ERROR Websocket Request{trace_id=00000000000000000000000000000000}: lemmy_websocket::handlers: Error during message handling email_send_failed: network error: Resource temporarily unavailable (os error 11)
lemmy_1 | 0: lemmy_api::local_user::perform
lemmy_1 | at crates/api/src/local_user.rs:772
lemmy_1 | 1: lemmy_websocket::handlers::Websocket Request
lemmy_1 | with trace_id=00000000000000000000000000000000
lemmy_1 | at crates/websocket/src/handlers.rs:68
root@liewrap05:/opt/lemmy/federated.community#
Here's the config:
email: {
smtp_server: "linycmx01.bofhllc.net:465"
smtp_login: "REDACTED"
smtp_password: "REDACTED"
smtp_from_address: "[email protected]"
tls_type: "none"
}
I have tried:
smtp_server: "linycmx01.bofhllc.net:465"
smtp_server: "linycmx01.bofhllc.net:587"
smtp_server: "linycmx01.bofhllc.net"
And each time I have done a docker-compose restart
after making changes and saving out the config.
No dice.
Lemmy isn't even generating any traffic to send to my smarthost relay.
Thoughts?
I uninstalled and installed lemmy from scratch copying the ansible instructions exactly but still get this error 404: FetchError: request to http://lemmy:8536/api/v3/site? failed, reason: connect ECONNREFUSED
docker-compose.yml:
version: '2'
services:
lemmy:
image: dessalines/lemmy:0.16.7
ports:
- "127.0.0.1:26430:8536"
restart: always
environment:
- RUST_LOG="warn,lemmy_server=info,lemmy_api=info,lemmy_api_common=info,lemmy_api_crud=info,lemmy_apub=info,lemmy_db_queries=info,lemmy_db_schema=info,lemmy_db_views=info,lemmy_db_views_actor=info,lemmy_db_views_moderator=info,lemmy_routes=info,lemmy_utils=info,lemmy_websocket=info"
volumes:
- ./lemmy.hjson:/config/config.hjson
depends_on:
- postgres
- pictrs
lemmy-ui:
image: dessalines/lemmy-ui:0.16.7
ports:
- "127.0.0.1:24415:1234"
restart: always
environment:
- LEMMY_INTERNAL_HOST=lemmy:8536
- LEMMY_EXTERNAL_HOST=(redacted)
- LEMMY_HTTPS=true
volumes:
- ./volumes/lemmy-ui/extra_themes:/app/extra_themes
depends_on:
- lemmy
postgres:
image: postgres:12-alpine
environment:
- POSTGRES_USER=lemmy
- POSTGRES_PASSWORD=(redacted)
- POSTGRES_DB=lemmy
volumes:
- ./volumes/postgres:/var/lib/postgresql/data
restart: always
pictrs:
image: asonix/pictrs:0.3.1
user: 991:991
ports:
- "127.0.0.1:22450:8080"
volumes:
- ./volumes/pictrs:/mnt
restart: always
mem_limit: 200m
postfix:
image: mwader/postfix-relay
environment:
- POSTFIX_myhostname=(redacted)
restart: "always"
lemmy.hjson:
{
# for more info about the config, check out the documentation
# https://join-lemmy.org/docs/en/administration/configuration.html
database: {
host: postgres
password: "(redacted)"
}
hostname: "(redacted)"
pictrs_url: "http://pictrs:8080"
federation: {
enabled: true
}
email: {
smtp_server: "postfix:25"
smtp_from_address: "noreply@(redacted)"
tls_type: "none"
}
}
I currently access my server via SSH and a password. Using ansible-playbook -i inventory/hosts lemmy.yml --become --ask-become-pass
as written in the documentation results in:
BECOME password:
PLAY [all] ******************************************************************************************************************************************************************************************
TASK [check lemmy_base_dir] *************************************************************************************************************************************************************************
skipping: [[email protected]] => {"changed": false, "skip_reason": "Conditional result was False"}
TASK [install python for Ansible] *******************************************************************************************************************************************************************
fatal: [[email protected]]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: [email protected]: Permission denied (publickey,password).", "unreachable": true}
PLAY RECAP ******************************************************************************************************************************************************************************************
[email protected] : ok=0 changed=0 unreachable=1 failed=0 skipped=1 rescued=0 ignored=0
but adding --ask-pass
to the command makes it work successfully.
Hi guys! Trying to get Lemmy installed on a fresh VPS (Debian 11) and receiving the following error when attempting to go to the site:
404: FetchError: request to http://lemmy:8536/api/v3/site? failed, reason: connect ECONNREFUSED 172.18.0.2:8536
Here's the results of the ansible playbook:
gme@DESKTOP-R7ILMJV:~/lemmy-ansible$ ansible-playbook -i inventory/hosts lemmy.yml
PLAY [all] *************************************************************************************************************
TASK [check lemmy_base_dir] ********************************************************************************************
skipping: [[email protected]]
TASK [install python for Ansible] **************************************************************************************
changed: [[email protected]]
TASK [setup] ***********************************************************************************************************
ok: [[email protected]]
TASK [install dependencies] ********************************************************************************************
changed: [[email protected]]
TASK [request initial letsencrypt certificate] *************************************************************************
changed: [[email protected]]
TASK [create lemmy folder] *********************************************************************************************
changed: [[email protected]] => (item={'path': '/opt/lemmy/federated.community/', 'owner': 'root'})
changed: [[email protected]] => (item={'path': '/opt/lemmy/federated.community/volumes/', 'owner': 'root'})
changed: [[email protected]] => (item={'path': '/opt/lemmy/federated.community/volumes/pictrs/', 'owner': '991'})
TASK [set_fact] ********************************************************************************************************
ok: [[email protected]]
TASK [add template files] **********************************************************************************************
changed: [[email protected]] => (item={'src': 'templates/docker-compose.yml', 'dest': '/opt/lemmy/federated.community/docker-compose.yml', 'mode': '0600'})
changed: [[email protected]] => (item={'src': 'templates/nginx.conf', 'dest': '/etc/nginx/sites-available/federated.community.conf', 'mode': '0644'})
TASK [gather stats on site enabled config] *****************************************************************************
ok: [[email protected]]
TASK [remove if regular file (legacy) instead of symlink] **************************************************************
skipping: [[email protected]]
TASK [enable nginx site] ***********************************************************************************************
changed: [[email protected]]
TASK [add the config.hjson] ********************************************************************************************
changed: [[email protected]]
TASK [enable and start docker service] *********************************************************************************
ok: [[email protected]]
TASK [start docker-compose] ********************************************************************************************
changed: [[email protected]]
TASK [reload nginx with new config] ************************************************************************************
changed: [[email protected]]
TASK [certbot renewal cronjob] *****************************************************************************************
changed: [[email protected]]
PLAY RECAP *************************************************************************************************************
[email protected] : ok=14 changed=10 unreachable=0 failed=0 skipped=2 rescued=0 ignored=0
gme@DESKTOP-R7ILMJV:~/lemmy-ansible$
Here's the contents of config.hjson
:
{
# for more info about the config, check out the documentation
# https://join-lemmy.org/docs/en/administration/configuration.html
database: {
host: postgres
password: "REDACTED"
}
hostname: "federated.community"
pictrs_url: "http://pictrs:8080"
federation: {
enabled: true
}
email: {
smtp_server: "REDACTED"
smtp_from_address: "noreply@{{ domain }}"
tls_type: "starttls"
smtp_login: "REDACTED"
smtp_password: "REDACTED"
}
}
Any ideas?
cp examples/customPostgresql.conf inventory/customPostgresql.conf
should be
cp examples/customPostgresql.conf inventory/host_vars/{domain}/customPostgresql.conf
Or at least doing this fixed my problem
Tried getting this up and running on a brand new VPS running 23.04
It failed during the "Install Docker Module and docker-compose for Python" step - pip3 install -U docker docker-compose
gave a scary warning about mixing system-managed packages with pip and refused to continue. I worked around this by removing this whole part in the playbook: It seems to be merely required for the playbook itself, to run a single docker compose command.
docker-compose
< 2.x instead of the > 2.x docker compose
)I changed the lemmy.yml with the following diff to make things work:
diff --git a/lemmy.yml b/lemmy.yml
index 2c6a7aa..41fa786 100644
--- a/lemmy.yml
+++ b/lemmy.yml
@@ -59,13 +59,6 @@
state: latest
update_cache: true
- - name: Install Docker Module and docker-compose for Python
- pip:
- name:
- - docker
- - docker-compose
- state: latest
-
- name: copy docker config
copy: src='../files/docker-daemon.json' dest='/etc/docker/daemon.json' mode='0644'
@@ -160,11 +153,9 @@
# - debug: var=shell_output
- name: start docker-compose
- docker_compose:
- project_src: "{{lemmy_base_dir}}/{{domain}}"
- state: present
- pull: yes
- remove_orphans: yes
+ shell:
+ cmd: docker compose up -d
+ chdir: "{{lemmy_base_dir}}/{{domain}}"
- name: reload nginx with new config
shell: nginx -s reload
After this I now get warnings running apt update:
W: https://download.docker.com/linux/ubuntu/dists/focal/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
Arguably that's yet another outdated plugin that's doing something it shouldn't.
From the link above / in the Ansible docs:
The apt-key command has been deprecated and suggests to ‘manage keyring files in trusted.gpg.d instead’. See the Debian wiki for details. This module is kept for backwards compatibility for systems that still use apt-key as the main way to manage apt repository keys.
I'm setting up https://lemmy.studio/ following this playbook.
I tried uploading an icon and it seems to work:
But then the image is broken:
Trying to access it gives:
{"msg":"Error interacting with filesystem, Command failed with bad status"}
Logs from Docker:
pictrs_1 | http.status_code=500 otel.status_code="ERROR"}:Serving processed image{range=None query=Query([("src", "9ef7fc80-6abc-43c7-a619-cbe2a5f6b554.png"), ("thumbnail", "96")]) ext=Path("webp") store=Data(FileStore { path_gen: "generator", root_dir: "/mnt" })}: pict_rs: close time.busy=8.77ms time.idle=223ms
pictrs_1 | 2023-06-05T19:09:13.613826Z INFO HTTP request{http.method=GET http.route=/image/process.{ext} http.flavor=1.1 http.scheme=http http.host=pictrs:8080 http.client_ip=143.198.100.27 http.user_agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 Firefox/113.0 http.target=/image/process.webp?src=9ef7fc80-6abc-43c7-a619-cbe2a5f6b554.png&thumbnail=96 otel.name=HTTP GET /image/process.{ext} otel.kind="server" request_id=93e3ea46-1a85-4771-842b-13b42fcbe006 trace_id=00000000000000000000000000000000 exception.message=Error interacting with filesystem, Command failed with bad status
pictrs_1 | 0: pict_rs::concurrent_processor::Processing image
pictrs_1 | with path="thumbnail/96/99240128-eeda-483f-a555-21c8c651d0db.png.webp" completed=true
pictrs_1 | at src/concurrent_processor.rs:48
pictrs_1 | 1: pict_rs::Serving processed image
pictrs_1 | with range=None query=Query([("src", "9ef7fc80-6abc-43c7-a619-cbe2a5f6b554.png"), ("thumbnail", "96")]) ext=Path("webp") store=Data(FileStore { path_gen: "generator", root_dir: "/mnt" })
pictrs_1 | at src/main.rs:342
pictrs_1 | 2: tracing_actix_web::root_span_builder::HTTP request
pictrs_1 | with http.method=GET http.route=/image/process.{ext} http.flavor=1.1 http.scheme=http http.host=pictrs:8080 http.client_ip=143.198.100.27 http.user_agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 Firefox/113.0 http.target=/image/process.webp?src=9ef7fc80-6abc-43c7-a619-cbe2a5f6b554.png&thumbnail=96 otel.name=HTTP GET /image/process.{ext} otel.kind="server" request_id=93e3ea46-1a85-4771-842b-13b42fcbe006 trace_id=00000000000000000000000000000000
pictrs_1 | at /opt/build/.cargo/registry/src/github.com-1ecc6299db9ec823/tracing-actix-web-0.5.1/src/root_span_builder.rs:40
pictrs_1 | 3: tokio::task::runtime.spawn
pictrs_1 | with kind=local task.name= loc.file="/opt/build/.cargo/registry/src/github.com-1ecc6299db9ec823/actix-rt-2.7.0/src/lib.rs" loc.line=207 loc.col=5
pictrs_1 | at /opt/build/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.17.0/src/util/trace.rs:16
pictrs_1 | 4: tokio::task::runtime.spawn
pictrs_1 | with kind=local task.name= loc.file="/opt/build/.cargo/registry/src/github.com-1ecc6299db9ec823/actix-rt-2.7.0/src/lib.rs" loc.line=207 loc.col=5
pictrs_1 | at /opt/build/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.17.0/src/util/trace.rs:16
pictrs_1 | 5: tokio::task::runtime.spawn
pictrs_1 | with kind=local task.name= loc.file="/opt/build/.cargo/registry/src/github.com-1ecc6299db9ec823/actix-rt-2.7.0/src/lib.rs" loc.line=207 loc.col=5
pictrs_1 | at /opt/build/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.17.0/src/util/trace.rs:16
pictrs_1 | 6: tokio::task::runtime.spawn
pictrs_1 | with kind=local task.name= loc.file="/opt/build/.cargo/registry/src/github.com-1ecc6299db9ec823/actix-rt-2.7.0/src/arbiter.rs" loc.line=314 loc.col=25
pictrs_1 | at /opt/build/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.17.0/src/util/trace.rs:16
pictrs_1 | 7: tokio::task::runtime.spawn
pictrs_1 | with kind=block_on task.name= loc.file="/opt/build/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.17.0/src/task/local.rs" loc.line=468 loc.col=12
pictrs_1 | at /opt/build/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.17.0/src/util/trace.rs:16 exception.details=Error interacting with filesystem, Command failed with bad status
pictrs_1 | http.status_code=500 otel.status_code="ERROR"}: tracing_actix_web::root_span_builder: close time.busy=11.6ms time.idle=222ms
Otherwise multiple lemmy's can't run on the same machine.
After trying a clean installation several times, according to the available documentation, I ran into a problem that after the installation was completed, when the server was contacted, an error 502 bade gate way appeared. Maybe I missed something, or the installation documentation is incomplete?
Hello,
I tried updating using the ansible script. I synced the repo. and ran the command ansible-playbook -i inventory/hosts lemmy.yml --become -K
after that I entered my passwords. Everything ran fine untill
@arcolinux ➜ lemmy-ansible git:(main) ansible-playbook -i inventory/hosts lemmy.yml --become -K
BECOME password:
PLAY [all] ********************************************************************************************************************************************************************************************************
TASK [check lemmy_base_dir] ***************************************************************************************************************************************************************************************
skipping: [server]
TASK [install python for Ansible] *********************************************************************************************************************************************************************************
changed: [server]
TASK [setup] ******************************************************************************************************************************************************************************************************
ok: [server]
TASK [Install aptitude] *******************************************************************************************************************************************************************************************
ok: [server]
TASK [install dependencies] ***************************************************************************************************************************************************************************************
ok: [server]
TASK [Add Docker GPG apt Key] *************************************************************************************************************************************************************************************
ok: [server]
TASK [Add Docker Repository] **************************************************************************************************************************************************************************************
ok: [server]
TASK [Update apt and install docker-ce] ***************************************************************************************************************************************************************************
ok: [server]
TASK [Install Docker Module and docker-compose for Python] ********************************************************************************************************************************************************
ok: [server]
TASK [copy docker config] *****************************************************************************************************************************************************************************************
ok: [server]
TASK [request initial letsencrypt certificate] ********************************************************************************************************************************************************************
ok: [server]
TASK [create lemmy folder] ****************************************************************************************************************************************************************************************
ok: [server] => (item={'path': '/home/server/lemmy/domain/', 'owner': 'root'})
ok: [server] => (item={'path': '/home/server/lemmy/domain/volumes/', 'owner': 'root'})
ok: [server] => (item={'path': '/home/server/lemmy/domain/volumes/pictrs/', 'owner': '991'})
TASK [set_fact] ***************************************************************************************************************************************************************************************************
ok: [server]
TASK [add template files] *****************************************************************************************************************************************************************************************
changed: [server] => (item={'src': 'templates/docker-compose.yml', 'dest': '/home/server/lemmy/domain/docker-compose.yml', 'mode': '0600'})
ok: [server] => (item={'src': 'templates/nginx_internal.conf', 'dest': '/home/server/lemmy/domain/nginx_internal.conf', 'mode': '0644'})
changed: [server] => (item={'src': 'templates/nginx.conf', 'dest': '/etc/nginx/sites-available/domain.conf', 'mode': '0644'})
TASK [gather stats on site enabled config] ************************************************************************************************************************************************************************
ok: [server]
TASK [remove if regular file (legacy) instead of symlink] *********************************************************************************************************************************************************
skipping: [server]
TASK [enable nginx site] ******************************************************************************************************************************************************************************************
ok: [server]
TASK [add the config.hjson] ***************************************************************************************************************************************************************************************
ok: [server]
TASK [add the customPostgresql.conf] ******************************************************************************************************************************************************************************
ok: [server]
TASK [enable and start docker service] ****************************************************************************************************************************************************************************
ok: [server]
TASK [start docker-compose] ***************************************************************************************************************************************************************************************
fatal: [server]: FAILED! => {"changed": false, "errors": [], "module_stderr": "", "module_stdout": "", "msg": "Error: pull failed with 404 Client Error for http+docker://localhost/v1.43/images/create?tag=0.18.0&fromImage=dessalines%2Flemmy: Not Found (\"manifest for dessalines/lemmy:0.18.0 not found: manifest unknown: manifest unknown\")"}
PLAY RECAP ********************************************************************************************************************************************************************************************************
server : ok=18 changed=2 unreachable=0 failed=1 skipped=2 rescued=0 ignored=0
I have redacted some things for privacy like my domain name.
lemmy_docker_image
and lemmy_docker_ui_image
vars in lemmy.yml should use an arm64 image if the target server is an arm64 based system.
Currently it's defaulted to amd64 which causes exec format error
in the lemmy
and lemmy-ui
images.
It looks like the default is pulled from VERSION
I'm not familiar with Ansible but it looks like using docker_image_module could simplify this and remove the need for updating a version file.
Was setting up a new instance and ran into this after running the ansible playbook.
fatal: [[email protected]]: FAILED! => {
"msg": "The conditional check 'reg_enabled['stat isreg']' failed. The error was: error while evaluating conditional (reg_enabled['stat isreg']): 'dict object' has no attribute 'stat isreg'\n\nThe error appears to be in '/home/ubuntu/lemmy-ansible/lemmy.yml': line 80, column 9, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n - name: remove if regular file (legacy) instead of symlink\n ^ here\n"
}
The issue is exactly where it says it is and changing when: reg_enabled.stat.isreg
to when: reg_enabled
in lemmy.yml
fixes the problem and let's the install finish. Doesn't appear to be any issues with changing......so far.
Hello,
seems that the recent split of nginx files broke something linked to the webservices used to send emails.
Now when trying to register with restricted registration, the following error happens in the main lemmy container:
2023-06-23T11:04:12.445148Z ERROR lemmy_server::api_routes_websocket: email_send_failed: Connection error: failed to lookup address information: Try again
0: lemmy_api_crud::user::create::perform
at crates/api_crud/src/user/create.rs:45
1: lemmy_server::root_span_builder::HTTP request
with http.method=GET http.scheme="http" http.host=0.0.0.0 http.target=/api/v3/ws otel.kind="server" request_id=36c786fe-de62-4202-9bf3-0b6718a2b9fa
at src/root_span_builder.rs:16
Seems that it's indeed the email sent to notify of a new registration requests that is broken.
As a side note, this breaks the request creation and no request appears in the admin validation panel.
It worked when I setup the instance yesterday, a few moments before the change of nginx configuration went live, and broke when I updated using the ansible recommended way, so this change is the likely culprit.
Would it be possible to have version tagging in this repository too? It would make it substantially easier to manage upgrades, especially if lagging a few versions behind.
On the installation instructions of the README.md you have a useful note:
Note: if you haven't set up ssh keys, and ssh using a password, use the command:
ansible-playbook -i inventory/hosts lemmy.yml --become --ask-pass --ask-become-pass
I should be added in the Update instructions, because users updating are not reading the installation steps. Or, maybe, just make a reference to it.
In fact, for me, the right command is:
ansible-playbook -i inventory/hosts lemmy.yml --become -K
When I try to update using the steps mentioned in the README I get the error
fatal: [redacted@redacted]: FAILED! => {"changed": false, "cmd": "apt-get install --no-install-recommends python-apt -y -q", "msg": "E: Package 'python-apt' has no installation candidate", "rc": 100, "stderr": "E: Package 'python-apt' has no installation candidate\n", "stderr_lines": ["E: Package 'python-apt' has no installation candidate"], "stdout": "Reading package lists...\nBuilding dependency tree...\nReading state information...\nPackage python-apt is not available, but is referred to by another package.\nThis may mean that the package is missing, has been obsoleted, or\nis only available from another source\nHowever the following packages replace it:\n python3-apt-dbg python3-apt python-apt-doc python-apt-common\n\n", "stdout_lines": ["Reading package lists...", "Building dependency tree...", "Reading state information...", "Package python-apt is not available, but is referred to by another package.", "This may mean that the package is missing, has been obsoleted, or", "is only available from another source", "However the following packages replace it:", " python3-apt-dbg python3-apt python-apt-doc python-apt-common", ""]}
Looking at it I can see that there are other packages that are suggested instead of 'python-apt'. Should this be changed somewhere in the config?
Some minimal images don't have cron installed and I needed to manually install it.
Basically:
lemmy_version
in the hosts file, if not, use a VERSION
file lookup.This will allow ppl to easily update to the current version, but also allow dev setups for alternate ones.
Using default ansible config, email isn't working (tested with forget password button, just gets stuck) and also trying to upload a picture givers error: SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data
Config file:
{
database: {
host: postgres
password: "{{ postgres_password }}"
}
hostname: "{{ domain }}"
pictrs: {
url: "http://pictrs:8686/"
api_key: "{{ postgres_password }}"
}
email: {
smtp_server: "postfix:25"
smtp_from_address: "noreply@{{ domain }}"
tls_type: "none"
}
}
Hi folks, I am new to Lemmy/Ansible and was hoping to host my own instance.
I tried following the guide in the readme and ran into some trouble.
I pointed my A record to a new hetzner VPS, copied the example files locally, changed the hosts file to instead have my domain and ssh user and ran the playbook.
The playbook completed successfully. Next, I tried going to my domain and get a 502 Bad Gateway nginx
error page.
Similar if I go to the ip address of my server, I see the default "Welcome to nginx!
If you see this page, the nginx web server is successfully installed and working. Further configuration is required."
Is there a step I missed? Is there some other required changes to the config files besides the host variables? Can I pull logs somehow? Thank you for your help
Add the LEMMY_UI_CUSTOM_SCRIPT to setup.
Hello,
I've tried to update from 0.16.3 to 0.16.5 with ansible.
It is on my test instance, i use this:
git pull
and
ansible-playbook -vvv -u MYUSERNAME -k -K -i inventory/hosts lemmy.yml --become
It does everything with no error but when I try to visit the website i receive:
404: FetchError: request to http://lemmy:8536/api/v3/site? failed, reason: getaddrinfo EAI_AGAIN lemmy
It's just my problem? What could have gone wrong?
The title says it all. AWS lightsail servers use .pem authentication for SSH.
TASK [Add Docker GPG apt Key] ***************************************************************
fatal: [admin@<IP>]: FAILED! => {"changed": false, "cmd": "/usr/bin/apt-key add -", "msg": "Unable to add a key from binary data", "rc": 2, "stderr": "Warning: apt-key output should not be parsed (stdout is not a terminal)\ngpg: failed to start agent '/usr/bin/gpg-agent': No such file or directory\ngpg: can't connect to the agent: No such file or directory\n", "stderr_lines": ["Warning: apt-key output should not be parsed (stdout is not a terminal)", "gpg: failed to start agent '/usr/bin/gpg-agent': No such file or directory", "gpg: can't connect to the agent: No such file or directory"], "stdout": "", "stdout_lines": []}
Hello!
I found this repository from https://join-lemmy.org/docs/en/administration/install_ansible.html
Could you please add information about the license of this repository — is it allowed to copy, change and use the Ansible code in any purpose?
It would be great to see any popular open source license.
Ansible needs a sudo password to avoid this error:
TASK [install python for Ansible] ******************************************************************************************
fatal: [my_user@my_server]: FAILED! => {"changed": true, "msg": "non-zero return code", "rc": 1, "stderr": "Shared connection to my_server closed.\r\n", "stderr_lines": ["Shared connection to my_server closed."], "stdout": "sudo: es requereix una contrasenya\r\r\n", "stdout_lines": ["sudo: es requereix una contrasenya", ""]}
It can be managed with -K parameter:
ansible-playbook -i inventory/hosts lemmy.yml --become -K
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.