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.exports = { ///////////////////////////////////// // Configuration for D-DOK server // All of these values may be overridden by setting environment variables /////////////////////////////////////
// NODE_ENV: 'development' | 'production' (default) // PORT: web server port (default 80) 3000, // PROXY: trust reverse proxy when setting secure cookies (via the "X-Forwarded-Proto" header) (default false)
///////////////////////////////////// // Logging /////////////////////////////////////
// LOG_ENABLED: true (default) | false true, // LOG_LEVEL: 'error' | 'warn' | 'info' (default) | 'verbose' | 'debug' | 'silly'
///////////////////////////////////// // D-DOK Database /////////////////////////////////////
// DESS_LINK_ENABLED: flag if D-DOK uses D-ESS this should ALWAYS be set to true. false is not yet supported. true,
// DATABASE_TYPE: 'mysql' (required) // DATABASE_USERNAME: (required) // DATABASE_PASSWORD: (required) // DATABASE_HOST: hostname or IP address of the database server (required) // DATABASE_PORT: port to which the database server is bound (required) 3306, // DATABASE_NAME: name of the database (required)
///////////////////////////////////// // Mongo Database /////////////////////////////////////
// MONGO_DATABASE_USERNAME: (required) // MONGO_DATABASE_PASSWORD: (required) // MONGO_DATABASE_HOST hostname or IP address of the database server (required) // MONGO_DATABASE_PORT: port to which the database server is bound (required) 27017, // MONGO_DATABASE_NAME: name of the database (required)
///////////////////////////////////// // Active Directory (LDAP) Authentication /////////////////////////////////////
// AD_ENABLED: Active Directory auth enabled false, // AD_URL: URL of the ldap server (required) // AD_BIND_DN: username that will be used to do the searching and request (required) // AD_BIND_USER: username for LDAP bind (required) // AD_BIND_PASSWORD: password for LDAP bind (required) // AD_USERNAME_ATTRIBUTE: Username attribute // AD_SEARCH_FILTER: search filter for user nodes. {{username}} is posted to LDAP (required) // AD_GROUP_FILTER: search filter for group nodes.
///////////////////////////////////// // OpenID Connect (OIDC) Authentication /////////////////////////////////////
// OIDC_ENABLED: OIDC auth enabled false, // OIDC_BUTTON_SHOW: Show button on login page false, // OIDC_BUTTON_TEXT: Text to show on login page button // OIDC_CLIENT_SECRET: secret application password in OIDC server // OIDC_CLIENT_ID: public client id in OIDC server // OIDC_ISSUER: OIDC Issuer URL
///////////////////////////////////// // SMTP Email server (optional) /////////////////////////////////////
// EMAIL_ENABLED: Email enabled // EMAIL_USERNAME: SMTP server username // EMAIL_PASSWORD: SMTP server password // EMAIL_FROM: Email address // EMAIL_HOST: hostname or IP address of the SMTP server // EMAIL_PORT: port to which the SMTP server is bound 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 // 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
///////////////////////////////////// // (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)
/////////////////////////////////////
// SYSTEM_PUBLICATION_TYPE_SHOW_AUTHOR_POINTS: show author points on publication type page SYSTEM_PUBLICATION_TYPE_SHOW_AUTHOR_POINTS : // SYSTEM_WIJMO_LICENSE_KEY: wijmo license SYSTEM_WIJMO_LICENSE_KEY: 'xxxxx' }; |