Skip to content

Commit

Permalink
📝 Improve mkdocs (#698)
Browse files Browse the repository at this point in the history
  • Loading branch information
0x46616c6b authored Dec 18, 2024
1 parent 2251474 commit 5416b71
Show file tree
Hide file tree
Showing 12 changed files with 204 additions and 159 deletions.
4 changes: 3 additions & 1 deletion docs/development/coding_style.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@ We use the default Symfony coding style.

Check and adjust coding style by running `php-cs-fixer`:

make cs-fixer
```shell
make cs-fixer
```
10 changes: 7 additions & 3 deletions docs/development/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,16 @@ Release tarballs are the preferred way to install Userli. This page explains how
<!--more-->

First, you'll need a [Github API token](https://github.com/settings/tokens).
The token needs the following priviledges:
The token needs the following privileges:

public_repo, repo:status, repo_deployment
```text
public_repo, repo:status, repo_deployment
```

Now, execute the following script. It will create a version tag, release and
copy the info from `CHANGELOG.md` to the release info.

$ GITHUB_API_TOKEN=<token> GPG_SIGN_KEY="<key_id>" ./bin/github-release.sh <version>
```shell
GITHUB_API_TOKEN=<token> GPG_SIGN_KEY="<key_id>" ./bin/github-release.sh <version>
```

32 changes: 18 additions & 14 deletions docs/development/tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,24 @@

## Linting, unit tests and functional tests

vagrant up && vagrant ssh
make test
make integration
```shell
vagrant up && vagrant ssh
make test
make integration
```

## Test checkpassword script

# Start vagrant box and login
vagrant up && vagrant ssh
# Create DB schema and load fixtures
bin/console doctrine:schema:create
bin/console doctrine:fixture:load
# Run `app:users:checkpassword` locally. First should return `0`, second `1`
echo -en '[email protected]\0password' | ./bin/console app:users:checkpassword /bin/true; echo $?
echo -en '[email protected]\0wrong' | ./bin/console app:users:checkpassword /bin/true; echo $?
# Logout from vagrant and test via IMAP login
exit
./tests/test_checkpassword_login.sh
```shell
# Start vagrant box and login
vagrant up && vagrant ssh
# Create DB schema and load fixtures
bin/console doctrine:schema:create
bin/console doctrine:fixture:load
# Run `app:users:checkpassword` locally. First should return `0`, second `1`
echo -en '[email protected]\0password' | ./bin/console app:users:checkpassword /bin/true; echo $?
echo -en '[email protected]\0wrong' | ./bin/console app:users:checkpassword /bin/true; echo $?
# Logout from vagrant and test via IMAP login
exit
./tests/test_checkpassword_login.sh
```
29 changes: 17 additions & 12 deletions docs/installation/checkpassword.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,22 @@ Example configuration for using checkpassword in Dovecot:

`/etc/dovecot/conf.d/auth-checkpassword.conf.ext`:

passdb {
driver = checkpassword
args = /path/to/userli/bin/console app:users:checkpassword
}
```text
passdb {
driver = checkpassword
args = /path/to/userli/bin/console app:users:checkpassword
}
userdb {
driver = prefetch
}
userdb {
driver = prefetch
}
userdb {
driver = checkpassword
args = /path/to/userli/bin/console app:users:checkpassword
}
```

userdb {
driver = checkpassword
args = /path/to/userli/bin/console app:users:checkpassword
}

## Required permissions and sudo

Expand All @@ -35,4 +38,6 @@ read access to the userli application.
In order to grant the required permissions, add the Dovecot system user to the
userli system group:

adduser dovecot userli
```shell
adduser dovecot userli
```
10 changes: 6 additions & 4 deletions docs/installation/code.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ Install the [latest release](https://github.com/systemli/userli/releases/latest)

Download and unpack the actual source code.

mkdir userli && cd userli
wget https://github.com/systemli/userli/releases/download/x.x.x/userli-x.x.x.tar.gz
# Check signature and hash sum, if you know how to
tar -xvzf userli-x.x.x.tar.gz
```shell
mkdir userli && cd userli
wget https://github.com/systemli/userli/releases/download/x.x.x/userli-x.x.x.tar.gz
# Check signature and hash sum, if you know how to
tar -xvzf userli-x.x.x.tar.gz
```
8 changes: 5 additions & 3 deletions docs/installation/database.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ Create Userli database and database user.
<!--more-->
For simplicity, the user has full access to `userli` database.

mysql -e 'CREATE DATABASE userli'
mysql -e 'CREATE USER `userli`@`localhost` IDENTIFIED BY "<password>"'
mysql -e 'GRANT ALL PRIVILEGES ON userli.* TO `userli`@`localhost`'
```shell
mysql -e 'CREATE DATABASE userli'
mysql -e 'CREATE USER `userli`@`localhost` IDENTIFIED BY "<password>"'
mysql -e 'GRANT ALL PRIVILEGES ON userli.* TO `userli`@`localhost`'
```
36 changes: 21 additions & 15 deletions docs/installation/finalize.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,25 @@ Last steps to make Userli work properly.

## Create database scheme

# Create default database schema
bin/console doctrine:schema:create
```shell
# Create default database schema
bin/console doctrine:schema:create

# Load default reserved names into database
bin/console app:reservednames:import
# Load default reserved names into database
bin/console app:reservednames:import

# Warm up cache
bin/console cache:warmup
# Warm up cache
bin/console cache:warmup
```

## Configure Dovecot

Configure Dovecot to use separate directories per domain and user. Change
the `mail_location` in `10-mail.conf` to something like this:

mail_location = maildir:~/%d/%n
```text
mail_location = maildir:~/%d/%n
```

## Cronjobs

Expand All @@ -27,14 +31,16 @@ have write permissions at Dovecot's maildir (usually this directory belongs
to the system user `vmail`) you have to use a [script](https://github.com/systemli/ansible-role-userli/blob/master/templates/userli-maildirs-remove.sh.j2)
to delete a maildir from a removed Userli account:

# Daily create lists of removed mail accounts
@daily userli cd /path/to/userli && bin/console app:users:remove --list --env=prod >/usr/local/share/userli/maildirs-remove.txt
```text
# Daily create lists of removed mail accounts
@daily userli cd /path/to/userli && bin/console app:users:remove --list --env=prod >/usr/local/share/userli/maildirs-remove.txt
# Daily delete maildirs of removed accounts
@daily /usr/local/bin/userli-maildirs-remove.sh
# Daily delete maildirs of removed accounts
@daily /usr/local/bin/userli-maildirs-remove.sh
# Daily unlink old redeemed vouchers
@daily userli cd /path/to/userli && bin/console app:voucher:unlink
# Daily unlink old redeemed vouchers
@daily userli cd /path/to/userli && bin/console app:voucher:unlink
# Send weekly report to admins
12 13 * * 1 userli cd /path/to/userli && bin/console app:report:weekly
# Send weekly report to admins
12 13 * * 1 userli cd /path/to/userli && bin/console app:report:weekly
```
Loading

0 comments on commit 5416b71

Please sign in to comment.