diff --git a/conf/config.conf.template b/conf/config.conf.template new file mode 100644 index 0000000..b17c807 --- /dev/null +++ b/conf/config.conf.template @@ -0,0 +1,32 @@ +# This is an example configuration file. It can be either +# /etc/simplytranslate/web.conf or /etc/simplytranslate/shared.conf (this one +# is also used by other frontends, like the Gemini frontend). In case of +# duplicate keys between files, the key in `gemini.conf` takes precedence. + +[libre] +# LibreTranslate is disabled by default. If it is enabled, `Instance` is required. +Enabled = __LIBRETRANSLATE_ENABLE__ +Instance = __LIBRETRANSLATE_INSTANCE__ +# Not all instances need an API key; if the one you use don't, remove this +# line. +ApiKey = __LIBRETRANSLATE_API__ + +[google] +# Google translate is enabled by default. +Enabled = __GOOGLE_ENABLE__ + +[deepl] +# Deepl Translate does not support async as of right now, it will block all other requests +# while it's processing a Deepl Requests, please enable this with caution! +Enabled = __DEEPL_ENABLE__ + +[iciba] +# ICIBA Translate (a.k.a. PowerWord) is disabled by default. +Enabled = __ICIBA_ENABLE__ + +[reverso] +Enabled = __REVERSO_ENABLE__ + +[network] +port = __PORT__ +host = 0.0.0.0 diff --git a/conf/nginx.conf b/conf/nginx.conf new file mode 100644 index 0000000..f884327 --- /dev/null +++ b/conf/nginx.conf @@ -0,0 +1,14 @@ +#root_path_only location / { +#sub_path_only location __PATH__ { + # Standard nginx configuration + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + proxy_set_header Host $http_host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + + proxy_pass http://localhost:__PORT____PATH__; + + # Include SSOWAT user panel. + include conf.d/yunohost_panel.conf.inc; +} diff --git a/conf/systemd.service b/conf/systemd.service new file mode 100644 index 0000000..695dca6 --- /dev/null +++ b/conf/systemd.service @@ -0,0 +1,46 @@ +[Unit] +Description=Small description of the service +After=network.target + +[Service] +Type=simple +User=__APP__ +Group=__APP__ +ExecStart=__INSTALL_DIR__/venv/bin/python3 __INSTALL_DIR__/simplytranslate/main.py -c __INSTALL_DIR__/simplytranslate/config.conf + +# 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 AF_NETLINK +RestrictNamespaces=yes +RestrictRealtime=yes +DevicePolicy=closed +ProtectClock=yes +ProtectHostname=yes +ProtectProc=invisible +ProtectSystem=full +ProtectControlGroups=yes +ProtectKernelModules=yes +ProtectKernelTunables=yes +LockPersonality=yes +SystemCallArchitectures=native +SystemCallFilter=~@clock @debug @module @mount @obsolete @reboot @setuid @swap @cpu-emulation @privileged + +# 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 diff --git a/doc/DESCRIPTION_id.md b/doc/DESCRIPTION_id.md new file mode 100644 index 0000000..af6ef4f --- /dev/null +++ b/doc/DESCRIPTION_id.md @@ -0,0 +1 @@ +Antarmuka penerjemahan untuk berbagai mesin penerjemahan, ada DeepL, Reverso, ICIBA, Google Translate, dan LibreTranslate (bisa diubah peladen LibreTranslate mana yang mau dipakai). diff --git a/doc/screenshots/.gitkeep b/doc/screenshots/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/doc/screenshots/st_id-en.png b/doc/screenshots/st_id-en.png new file mode 100644 index 0000000..dbbb4d9 Binary files /dev/null and b/doc/screenshots/st_id-en.png differ