-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #76 from Gildas-GH/pictrs
Bugfix and reimplement Pictrs
- Loading branch information
Showing
14 changed files
with
754 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,18 +66,26 @@ | |
# Can be easy, medium, or hard | ||
difficulty: "medium" | ||
} | ||
# Settings related to activitypub federation | ||
# Pictrs image server configuration. | ||
pictrs: { | ||
# Address where pictrs is available (for image hosting) | ||
url: "http://127.0.0.1:__PORT_PICTRS__/" | ||
# Set a custom pictrs API key. ( Required for deleting images ) | ||
#api_key: "string" | ||
} | ||
# Email sending configuration. All options except login/password are mandatory | ||
email: { | ||
# Hostname and port of the smtp server | ||
smtp_server: "127.0.0.1:25" | ||
smtp_server: "__MAIN_DOMAIN__:587" | ||
# Login name for smtp server | ||
smtp_login: "" | ||
smtp_login: "__APP__" | ||
# Password to login to the smtp server | ||
smtp_password: "" | ||
smtp_password: "__MAIL_PWD__" | ||
# Address to send emails from, eg [email protected] | ||
smtp_from_address: "lemmy@__DOMAIN__" | ||
smtp_from_address: "__APP__@__DOMAIN__" | ||
# Whether or not smtp connections should use tls. Can be none, tls, or starttls | ||
tls_type: "none" | ||
tls_type: "starttls" | ||
} | ||
# the domain name of your instance (mandatory) | ||
hostname: "__DOMAIN__" | ||
|
@@ -87,9 +95,6 @@ | |
port: __PORT__ | ||
# 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://127.0.0.1:" | ||
slur_filter: "(\bThis\b)|(\bis\b)|(\bsample\b)" | ||
# Maximum length of local community and user names | ||
actor_name_max_length: 20 | ||
# Maximum number of HTTP requests allowed to handle a single incoming activity (or a single object fetch through the search). | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
[Unit] | ||
Description=Pict-RS: A simple image hosting service for __APP__ | ||
After=network.target | ||
|
||
[Service] | ||
Type=simple | ||
User=__APP__ | ||
Group=__APP__ | ||
WorkingDirectory=__INSTALL_DIR__/pict-rs/ | ||
Environment=PATH=__PICTRS_PATH__ | ||
ExecStart=__INSTALL_DIR__/pict-rs/pict-rs -c __INSTALL_DIR__/pict-rs/pict-rs.toml run | ||
StandardOutput=append:/var/log/__APP__/__APP__-pict-rs.log | ||
StandardError=inherit | ||
|
||
# Sandboxing options to harden security | ||
# Depending on specificities of your service/app, you may need to tweak these | ||
# .. but this should be a good baseline | ||
# Details for these options: https://www.freedesktop.org/software/systemd/man/systemd.exec.html | ||
NoNewPrivileges=yes | ||
PrivateTmp=yes | ||
PrivateDevices=yes | ||
RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6 | ||
RestrictNamespaces=yes | ||
RestrictRealtime=yes | ||
DevicePolicy=closed | ||
ProtectSystem=full | ||
ProtectControlGroups=yes | ||
ProtectKernelModules=yes | ||
ProtectKernelTunables=yes | ||
LockPersonality=yes | ||
SystemCallFilter=~@clock @debug @module @mount @obsolete @reboot @setuid @swap | ||
|
||
# Denying access to capabilities that should not be relevant for webapps | ||
# Doc: https://man7.org/linux/man-pages/man7/capabilities.7.html | ||
CapabilityBoundingSet=~CAP_RAWIO CAP_MKNOD | ||
CapabilityBoundingSet=~CAP_AUDIT_CONTROL CAP_AUDIT_READ CAP_AUDIT_WRITE | ||
CapabilityBoundingSet=~CAP_SYS_BOOT CAP_SYS_TIME CAP_SYS_MODULE CAP_SYS_PACCT | ||
CapabilityBoundingSet=~CAP_LEASE CAP_LINUX_IMMUTABLE CAP_IPC_LOCK | ||
CapabilityBoundingSet=~CAP_BLOCK_SUSPEND CAP_WAKE_ALARM | ||
CapabilityBoundingSet=~CAP_SYS_TTY_CONFIG | ||
CapabilityBoundingSet=~CAP_MAC_ADMIN CAP_MAC_OVERRIDE | ||
CapabilityBoundingSet=~CAP_NET_ADMIN CAP_NET_BROADCAST CAP_NET_RAW | ||
CapabilityBoundingSet=~CAP_SYS_ADMIN CAP_SYS_PTRACE CAP_SYSLOG | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
Oops, something went wrong.