Self-hosting
Configuration
The important settings: the portal, mail, storage, the client address, ORCID, legal texts, running offline and secrets from files.
Last updated:
Required settings
The application checks its settings on start and does not start with a missing or wrong one. The required settings are JOURNALOS_REGION, CELL_DATABASE_URL, JOURNAL_SERVER_URL, PLATFORM_APEX, an AUTH_SECRET of at least 32 characters, SMTP_URL and MAIL_FROM; for an institution's installation also INSTITUTION_NAME. The install script writes them.
Portal and network
- DEFAULT_LOCALE: the portal's language (tr, en or de).
- PUBLIC_PROTOCOL: https (the default) or http.
- TRUSTED_IP_HEADERS: the header the visitor's address is read from. In the Caddy setups the script writes x-real-ip; behind the institution's own proxy, give the header that proxy writes. Without it, usage counting and address-based limits do not work.
- INSTITUTION_NAME_EN and INSTITUTION_URL: the portal's English name and the institution's address.
Mail, SMS and storage
SMTP_URL starts with smtp:// or smtps://. For SMS give SMS_URL, SMS_TOKEN and an SMS_SENDER of at most 11 characters. Files are written to the bundled SeaweedFS (the S3_ settings), file backups to a separate store in the backup directory (the BACKUP_S3_ settings).
For bounces that arrive later, give BOUNCE_DOMAIN, for example bounces.university.edu. It is empty by default, and then everything stays as before. When it is set, each journal notification leaves with its own return address (envelope sender): an address starting with bounce+, signed with a key derived from AUTH_SECRET. The From line and the DKIM signature do not change. The domain's MX record must point to a server that receives mail. That server hands each message for an address starting with bounce+ to the command node packages/jobs/src/ops/bounce-intake-cli.ts, run where the worker runs, with the recipient address as its one argument, and refuses the domain's other addresses. The command reads at most 1 MB of the message. It writes the bounce next to that delivery in the delivery report, with its reason, and silently drops mail for an address it does not recognise and any message that is not a bounce. On JournalOS's own server postfix is set up for this by deploy/sunucu/posta-donus.sh, which can also serve as an example for another postfix.
Mail to the platform's published addresses is read in the operators' console, on the Mail page: contact@, privacy@, security@ and doi@, and postmaster@ and abuse@, which every mail domain keeps. For this the mail server hands each message for these addresses on the platform's domain to the command node packages/jobs/src/ops/inbox-intake-cli.ts, run where the worker runs, with the recipient address as its one argument; node packages/jobs/src/ops/inbox-cli.ts adresler prints the list. The command reads at most 10 MB of the message and keeps only text: the plain text, or the text of the HTML without its tags, and the attachments' names, types and sizes, never their contents. It sorts each message as important, other (auto-replies, lists, delivery reports) or junk (on rspamd's verdict), and shows the KVKK answer date on mail to privacy@. When it cannot reach the database it exits with 75 and the mail server tries again later. Junk is deleted after 30 days, handled mail two years after it was handled. On JournalOS's own server postfix is set up for this by deploy/sunucu/posta-gelen.sh.
Added by hand
The install script does not write these; add them to prod.env if needed:
- Optionally ORCID_CLIENT_ID and ORCID_CLIENT_SECRET: the installation's ORCID public client (Public API). Signing in with ORCID on the platform host and linking an iD to an account go through it, and so do sign-in and iD verification in journals that enter no client of their own. Its redirect URI is /api/orcid/callback on the platform host. ORCID_ENV is sandbox by default and must be production for real ORCID. These are not required: each journal enters its own public and member clients on the ORCID page of its management panel, and ORCID then sends that journal's people back to the journal's own address. A journal's clients connect only to orcid.org or sandbox.orcid.org; the server must be able to reach both over HTTPS.
- Optionally ORCID_MEMBER_CLIENT_ID, ORCID_MEMBER_CLIENT_SECRET and ORCID_MEMBER_ENV: an ORCID member client offered to every journal (Member API, writing to ORCID records). Its redirect URI is /api/orcid/member/callback on the platform host. Each journal still turns writing on itself, or enters its own client. This flow has been tested against recorded responses only, not against ORCID's live member API.
- The CONTROLLER_ settings and LEGAL_EFFECTIVE_DATE: without them the privacy notice and terms are not published.
- CONTACT_EMAIL, SECURITY_EMAIL and PRIVACY_EMAIL.
- HEALTH_CERTIFICATES=true: adds certificate expiry to the health checks.
Running without internet
On an installation without outbound access, set OPENALEX_SYNC=off, PASSWORD_BREACH_CHECK=off, ROR_LOOKUP=off and HEALTH_INTEGRATIONS=none; authors then type the institution and its ROR ID by hand. Virus signatures are then not updated; signatures older than two days raise a health warning.
The browser check (a proof of work) on the sign-up, sign-in and password reset forms makes no outside connection and is on by default. CAPTCHA_MAX_NUMBER sets how hard it is (100000 by default; the browser tries half of it on average); CAPTCHA=off is only for tests that call the endpoints directly.
Secrets from files
Any setting can also be read from a file by adding _FILE to its name (for example AUTH_SECRET_FILE); giving the same setting both ways is refused. The package has a compose extension for this (compose.secrets.yml). The install script does not use it; secrets stay in prod.env with mode 0600.