Skip to content

Commit

Permalink
Merge branch 'main' into cache-responses
Browse files Browse the repository at this point in the history
  • Loading branch information
Nutomic committed Jun 30, 2023
2 parents a3a8d19 + 7e00bac commit c440773
Show file tree
Hide file tree
Showing 13 changed files with 376 additions and 276 deletions.
3 changes: 3 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/lemmy-ansible.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions .woodpecker.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
pipeline:
prettier_markdown_check:
image: tmknom/prettier
commands:
- prettier -c "*.md" "*.yml"
check_ansible_format:
image: alpine:3
commands:
Expand Down
56 changes: 29 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,61 +6,63 @@ This provides an easy way to install [Lemmy](https://github.com/LemmyNet/lemmy)

To run this ansible playbook, you need to:

- Have a server / VPS where lemmy will run.
- Have a Debian-based server / VPS where lemmy will run.
- Configure a DNS `A` Record to point at your server's IP address.
- Make sure you can ssh to it, with a sudo user: `ssh <your-user>@<your-domain>`
- Install [Ansible](https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html) on your **local** machine (do not install it on your destination server).

## Install

Clone this repo:
1. Clone this repo:

```
git clone https://github.com/LemmyNet/lemmy-ansible.git
cd lemmy-ansible
```
```
git clone https://github.com/LemmyNet/lemmy-ansible.git
cd lemmy-ansible
```

Make a directory to hold your config:
2. Make a directory to hold your config:

`mkdir -p inventory/host_vars/<your-domain>`
`mkdir -p inventory/host_vars/<your-domain>`

Copy the sample configuration file:
3. Copy the sample configuration file:

`cp examples/config.hjson inventory/host_vars/<your-domain>/config.hjson`
`cp examples/config.hjson inventory/host_vars/<your-domain>/config.hjson`

Edit that file and change the config to your liking. Note: **Do not edit anything inside the {{ }} braces.**
Edit that file and change the config to your liking. Note: **Do not edit anything inside the {{ }} braces.**

[Here are all the config options.](https://join-lemmy.org/docs/en/administration/configuration.html#full-config-with-default-values)
[Here are all the config options.](https://join-lemmy.org/docs/en/administration/configuration.html#full-config-with-default-values)

Copy the sample inventory hosts file:
4. Copy the sample inventory hosts file:

`cp examples/hosts inventory/hosts`
`cp examples/hosts inventory/hosts`

Edit the inventory hosts file (inventory/hosts) to your liking.
Edit the inventory hosts file (inventory/hosts) to your liking.

Copy the sample postgresql.conf
5. Copy the sample postgresql.conf

`cp examples/customPostgresql.conf inventory/host_vars/<your-domain>/customPostgresql.conf`
`cp examples/customPostgresql.conf inventory/host_vars/<your-domain>/customPostgresql.conf`

You can use [the PGTune tool](https://pgtune.leopard.in.ua) to tune your postgres to meet your server memory and CPU.
You can use [the PGTune tool](https://pgtune.leopard.in.ua) to tune your postgres to meet your server memory and CPU.

Run the playbook:
6. Run the playbook:

`ansible-playbook -i inventory/hosts lemmy.yml`
`ansible-playbook -i inventory/hosts lemmy.yml`

_Note_: if you are not the root user or don't have password-less sudo, use this command:
_Note_: if you are not the root user or don't have password-less sudo, use this command:

`ansible-playbook -i inventory/hosts lemmy.yml --become --ask-become-pass`
`ansible-playbook -i inventory/hosts lemmy.yml --become --ask-become-pass`

_Note_: if you haven't set up ssh keys, and ssh using a password, use the command:
_Note_: if you haven't set up ssh keys[^1], and ssh using a password, use the command:

`ansible-playbook -i inventory/hosts lemmy.yml --become --ask-pass --ask-become-pass`
`ansible-playbook -i inventory/hosts lemmy.yml --become --ask-pass --ask-become-pass`

[Full ansible command-line docs](https://docs.ansible.com/ansible/latest/cli/ansible-playbook.html)
[Full ansible command-line docs](https://docs.ansible.com/ansible/latest/cli/ansible-playbook.html)

If the command above fails, you may need to comment out this line In the ansible.cfg file:
If the command above fails, you may need to comment out this line In the ansible.cfg file:

`interpreter_python=/usr/bin/python3`
`interpreter_python=/usr/bin/python3`

[^1]: To create an ssh key pair with your host environment, you can follow the [instructions here](https://www.ssh.com/academy/ssh/keygen#copying-the-public-key-to-the-server), and then copy the key to your host server.

## Upgrading

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.17.3
0.18.0
Loading

0 comments on commit c440773

Please sign in to comment.