Direkt zum Hauptinhalt

Systemadministration

Installieren und Konfigurieren von MongoDB

Befehlszeile für Debian:

apt update

apt-get install curl gnupg2 wget -y

curl -fsSL https://pgp.mongodb.com/server-7.0.asc | gpg -o /usr/share/keyrings/mongodb-server-7.0.gpg --dearmor

echo "deb [ signed-by=/usr/share/keyrings/mongodb-server-7.0.gpg ] http://repo.mongodb.org/apt/debian bullseye/mongodb-org/7.0 main" | tee /etc/apt/sources.list.d/mongodb-org-7.0.list

apt update

apt install mongodb-org -y

mongod --version

systemctl start mongod

systemctl enable mongod

# create admin user
mongosh
    use admin
    db.createUser( {user: "admin", pwd: "xxxxxxxx", roles: [ { role: "userAdminAnyDatabase", db: "admin" } ] });
    exit;

# switch on authentication
vi /etc/mongod.conf

    security:
    authorization: enabled

    net:
    bindIp:192.168.xxx.xxx (or leave as 127.0.0.1 or hostname as required)

systemctl restart mongod
systemctl status mongod

# Optional: if Status is not running (error 14) it may be that you need to remove socket lock (permissions are now incorrect)
cd /tmp
rm -rf mongodb*.sock

# log in and create database user
mongosh "mongodb://admin:xxxxxxxx@192.168.xxx.xxx:27017/ddok" --authenticationDatabase admin
    db.createUser( {user: "ddok", pwd: "xxxxxxxx", roles: [ { role: "readWrite", db: "ddok" } ] })

Unpack mongodb

Dies ist erforderlich, wenn wir Ihnen einen MongoDB-Dump gesendet haben.

mongorestore --host=192.168.xxx.xxx --port=27017 --username=ddok --password=xxxxxxxx --db=ddok --archive=mongodump

node server config.js

module.

module.exports =


{

   
/////////////////////////////////////

   
//  Configuration for D-DOK server

   
//  All of these values may be overridden by setting environment variables

   
/////////////////////////////////////


 

    // NODE_ENV: 'development' | 'production' (default)


   
NODE_ENV:NODE_ENV: 'production',

   
// PORT: web server port (default 80)

   
PORT:PORT: 3000,
3000,
   
// PROXY: trust reverse proxy when setting secure cookies (via the "X-Forwarded-Proto" header) (default false)

   
PROXY:PROXY: false,
false,


 

    /////////////////////////////////////


   
// Logging

   
/////////////////////////////////////


 

    // LOG_ENABLED: true (default) | false


   
LOG_ENABLED:LOG_ENABLED: true,
true,
   
// LOG_LEVEL: 'error' | 'warn' | 'info' (default) | 'verbose' | 'debug' | 'silly'

   
LOG_LEVEL:LOG_LEVEL: 'verbose',


 

    /////////////////////////////////////


   
// D-DOK Database

   
/////////////////////////////////////


 

    // DESS_LINK_ENABLED: flag if D-DOK uses D-ESS database

database.
this should ALWAYS be set to true. false is not yet supported.
   
DESS_LINK_ENABLED:DESS_LINK_ENABLED: true,
true,


 

    // DATABASE_TYPE: 'mysql' (required)


   
DATABASE_TYPE:DATABASE_TYPE: 'mysql',

   
// DATABASE_USERNAME: (required)

   
DATABASE_USERNAME:DATABASE_USERNAME: 'root'xxxxx',

   
// DATABASE_PASSWORD: (required)

   
DATABASE_PASSWORD:DATABASE_PASSWORD: 'xxxxxxxx'xxxxx',

   
// DATABASE_HOST: hostname or IP address of the database server (required)

   
DATABASE_HOST:DATABASE_HOST: 'localhost',

   
// DATABASE_PORT: port to which the database server is bound (required)

   
DATABASE_PORT:DATABASE_PORT: 3306,
3306,
   
// DATABASE_NAME: name of the database (required)

   
DATABASE_NAME:DATABASE_NAME: 'xxxxxxxx'xxxxx',


 

    /////////////////////////////////////


   
// Mongo Database

   
/////////////////////////////////////


 

    // MONGO_DATABASE_USERNAME: (required)


   
MONGO_DATABASE_USERNAME:MONGO_DATABASE_USERNAME: 'ddok'xxxxx'

   
// MONGO_DATABASE_PASSWORD: (required)

   
MONGO_DATABASE_PASSWORD:MONGO_DATABASE_PASSWORD: 'xxxxxxxx'xxxxx',

   
// MONGO_DATABASE_HOST hostname or IP address of the database server (required)

   
MONGO_DATABASE_HOST:MONGO_DATABASE_HOST: '127.0.0.1',

   
// MONGO_DATABASE_PORT: port to which the database server is bound (required)

   
MONGO_DATABASE_PORT:MONGO_DATABASE_PORT: 27017,
27017,
   
// MONGO_DATABASE_NAME: name of the database (required)

   
MONGO_DATABASE_NAME:MONGO_DATABASE_NAME: 'ddok'xxxxx',


 

    /////////////////////////////////////


   
// Active Directory (LDAP) Authentication

   
/////////////////////////////////////


 

    // AD_ENABLED: Active Directory auth enabled


   
AD_ENABLED:AD_ENABLED: true,
false,
   
// AD_URL: URL of the ldap server (required)

   
AD_URL:AD_URL: 'ldaps://DC1.xxxxxxxx.xxxxx.network',

   
// AD_BIND_DN: username that will be used to do the searching and request (required)

   
AD_BIND_DN:AD_BIND_DN: 'DC=bab,DC=network',

   
// AD_BIND_USER: username for LDAP bind (required)

   
AD_BIND_USER:AD_BIND_USER: 'noreply@xxxxxxxx.xxxxx@xxxxx.network',

   
// AD_BIND_PASSWORD: password for LDAP bind (required)

   
AD_BIND_PASSWORD:AD_BIND_PASSWORD: 'xxxxxxxx'xxxxx',

   
// AD_USERNAME_ATTRIBUTE: Username attribute

   
AD_USERNAME_ATTRIBUTE:AD_USERNAME_ATTRIBUTE: 'sAMAccountName',

   
// AD_SEARCH_FILTER: search filter for user nodes. {{username}} is posted to LDAP (required)

   
AD_SEARCH_FILTER:AD_SEARCH_FILTER: '(sAMAccountName={{username}})'

   
// AD_GROUP_FILTER: search filter for group nodes.

   
AD_GROUP_FILTER:AD_GROUP_FILTER: 'OU=Guest,DC=xxxxxxxx,bab,DC=network',


 

    /////////////////////////////////////


   
// OpenID Connect (OIDC) Authentication

   
/////////////////////////////////////


 

    // OIDC_ENABLED: OIDC auth enabled


   
OIDC_ENABLED:OIDC_ENABLED: true,
false,
   
// OIDC_BUTTON_SHOW: Show button on login page

   
OIDC_BUTTON_SHOW:OIDC_BUTTON_SHOW: true,
false,
   
// OIDC_BUTTON_TEXT: Text to show on login page button

   
OIDC_BUTTON_TEXT:OIDC_BUTTON_TEXT: 'Mit Keycloak Anmelden',

   
// OIDC_CLIENT_SECRET: secret application password in OIDC server

   
OIDC_CLIENT_SECRET:OIDC_CLIENT_SECRET: 'xxxxxxxx'xxxxx',

   
// OIDC_CLIENT_ID: public client id in OIDC server

   
OIDC_CLIENT_ID:OIDC_CLIENT_ID: 'dess'xxxxx',

   
// OIDC_ISSUER: OIDC Issuer URL

   
OIDC_ISSUER:OIDC_ISSUER: 'https://sso.xxxxxxxx.xxxxx.at/realms/xxxxxxxx'xxxxx',


 

    /////////////////////////////////////


   
// SMTP Email server (optional)

   
/////////////////////////////////////


 

    // EMAIL_ENABLED: Email enabled


   
EMAIL_ENABLED:EMAIL_ENABLED: false, // true,

   
// EMAIL_USERNAME: SMTP server username

   
EMAIL_USERNAME:EMAIL_USERNAME: 'noreply@xxx.xxxxx@xxxxx.network',

   
// EMAIL_PASSWORD: SMTP server password

   
EMAIL_PASSWORD:EMAIL_PASSWORD: 'xxxxxxxx'xxxxx',

   
// EMAIL_FROM: Email address

   
EMAIL_FROM:EMAIL_FROM: 'noreply@xxx.noreply@xxxxx.network',

   
// EMAIL_HOST: hostname or IP address of the SMTP server

   
EMAIL_HOST:EMAIL_HOST: 'mail.xxx.xxxxx.network',

   
// EMAIL_PORT: port to which the SMTP server is bound 

   
EMAIL_PORT:EMAIL_PORT: 587,
587,
   
// EMAIL_SECURE: if true the connection will use TLS when connecting to server.

   
// If false (the default) then TLS is used if server supports the STARTTLS extension.

   
// In most cases set this value to true if you are connecting to port 465.

   
// For port 587 or 25 keep it false

   
EMAIL_SECURE:EMAIL_SECURE: false,
false,


    // TEXT and HTML templates for email notifications


   
// {administrator} - substituted with name of user who has triggered the notification "Surname, Firstname"

   
// {dateTime} - substituted with formatted datetime of the event "DD.MM.YYYY HH:mm:ss"

   
// {projectName} - substituted with name of the project

   
// {publicationName} - substituted with name of the publication

   
// {fileNames} - substituted with comma separated list of added file names

    

   
EMAIL_ADD_PUBLICATION_NOTIFICATION_SUBJECT:EMAIL_ADD_PUBLICATION_NOTIFICATION_SUBJECT: 'D-DOK Notifikation: Neue Publikation',

   
EMAIL_ADD_PUBLICATION_NOTIFICATION_TEXT:EMAIL_ADD_PUBLICATION_NOTIFICATION_TEXT: 'Eine neue Publikation wurde von {administrator} am {dateTime} erstellt.',

   
EMAIL_ADD_PUBLICATION_NOTIFICATION_HTML:EMAIL_ADD_PUBLICATION_NOTIFICATION_HTML: '{projectName}<br>Eine neue Publikation wurde von <b>{administrator}</b> am <b>{dateTime}</b> erstellt.<br>{publicationName}',


    EMAIL_ADD_PUBLICATION_PDF_NOTIFICATION_SUBJECT:EMAIL_ADD_PUBLICATION_PDF_NOTIFICATION_SUBJECT: 'D-DOK Notifikation: Neue Publikation PDF',


   
EMAIL_ADD_PUBLICATION_PDF_NOTIFICATION_TEXT:EMAIL_ADD_PUBLICATION_PDF_NOTIFICATION_TEXT: 'Eine neue Publikation PDF wurde von {administrator} am {dateTime} hochgeladen.',

   
EMAIL_ADD_PUBLICATION_PDF_NOTIFICATION_HTML:EMAIL_ADD_PUBLICATION_PDF_NOTIFICATION_HTML: '{projectName}<br>Eine neue Publikation PDF wurde von <b>{administrator}</b> am <b>{dateTime}</b> hochgeladen.<br>{publicationName}',


    EMAIL_USER_ADD_PROJECT_ADMIN_NOTIFICATION_SUBJECT:EMAIL_USER_ADD_PROJECT_ADMIN_NOTIFICATION_SUBJECT: 'D-DOK Notifikation: Ihnen wurde die Berechtigung eines Projektadministrators erteilt',


   
EMAIL_USER_ADD_PROJECT_ADMIN_NOTIFICATION_TEXT:EMAIL_USER_ADD_PROJECT_ADMIN_NOTIFICATION_TEXT: 'Sie wurden von {administrator} am {dateTime} zum Projektadministrator für das Projekt {projectName} ernannt.',

   
EMAIL_USER_ADD_PROJECT_ADMIN_NOTIFICATION_HTML:EMAIL_USER_ADD_PROJECT_ADMIN_NOTIFICATION_HTML: '{projectName}<br>Sie wurden von <b>{administrator}</b> am <b>{dateTime}</b> zum Projektadministrator ernannt.',

 


    /////////////////////////////////////


   
// SystemWEB settings
Database
(for Website database export)
   
/////////////////////////////////////


 

    // WEB_DATABASE_USERNAME: (required)
    WEB_DATABASE_USERNAME: 'xxxxx',
    // WEB_DATABASE_PASSWORD: (required)
    WEB_DATABASE_PASSWORD: 'xxxxx',
    // WEB_DATABASE_HOST: hostname or IP address of the database server (required)
    WEB_DATABASE_HOST: 'localhost',
    // WEB_DATABASE_PORT: port to which the database server is bound (required)
    WEB_DATABASE_PORT: 3306,
    // WEB_DATABASE_NAME: name of the database (required)
    WEB_DATABASE_NAME: 'xxxxx',

 

    // WEB_MONGO_DATABASE_USERNAME: (required)
    WEB_MONGO_DATABASE_USERNAME: 'xxxxx', 
    // WEB_MONGO_DATABASE_PASSWORD: (required)
    WEB_MONGO_DATABASE_PASSWORD: 'xxxxx',
    // WEB_MONGO_DATABASE_HOST hostname or IP address of the database server (required)
    WEB_MONGO_DATABASE_HOST: '127.0.0.1',
    // WEB_MONGO_DATABASE_PORT: port to which the database server is bound (required)
    WEB_MONGO_DATABASE_PORT: 27017,
    // WEB_MONGO_DATABASE_NAME: name of the database (required)
    WEB_MONGO_DATABASE_NAME: 'xxxxx',

 

    /////////////////////////////////////
    // System settings
    /////////////////////////////////////

 

    // SYSTEM_PUBLICATION_TYPE_SHOW_AUTHOR_POINTS: show author points on publication type page


   
SYSTEM_PUBLICATION_TYPE_SHOW_AUTHOR_POINTS : false,
false,


    // SYSTEM_WIJMO_LICENSE_KEY: wijmo license


    SYSTEM_WIJMO_LICENSE_KEY: 'xxxxx'
};

 

    SYSTEM_WIJMO_LICENSE_KEY: 'xxxxxxxx'
};