seafile module with mysql #4

Open
opened 2021-01-24 17:34:46 +01:00 by schmittlauch · 2 comments
Owner

initialise db and config

also write some nixos tests at the end

initialise db and config also write some nixos tests at the end
Author
Owner

init

  • proper way: run setup-seafile-mysql.py
  • issue about that: this fails if the data directory already exists, even if it's empty
    • that's obviously a stupid restriction
    • options: patch that check out or do all initialising manually

what the init script does

## init - proper way: run [`setup-seafile-mysql.py`](https://github.com/haiwen/seafile-server/blob/v8.0.2-server/scripts/setup-seafile-mysql.py) - issue about that: this fails if the data directory already exists, even if it's empty - that's obviously a stupid restriction - options: patch that check out or do all initialising manually ### what the init script does - generate DB config - create users - create DBs (ccnet, seafile, seahub) - generate ccnet config - ccnet.conf - `SERVICE_URL` - database stuff (`ENGINE`, `HOST`, `PORT`, `USER`, `PASSWD`, `DB`, `CONNECTION_CHARSET=utf8`) - generate seafile config - db config - generate seafdav config - seafdav.conf, see https://github.com/haiwen/seafile-server/blob/v8.0.2-server/scripts/setup-seafile-mysql.py#L1206 - generate gunicorn config - gunicorn.conf.py, see https://github.com/haiwen/seafile-server/blob/v8.0.2-server/scripts/setup-seafile-mysql.py#L1227 - generate seahub config - seahub_settings.py - generate a secret key - `SECRET_KEY =` - using `seahub/tools/secret_key_generator.py` - db config as a python dictionary, see https://github.com/haiwen/seafile-server/blob/v8.0.2-server/scripts/setup-seafile-mysql.py#L1071 - ccnet syncdb - execute `sql/mysql/ccnet.sql` on ccnet db - seafile syncdb - execute `sql/mysql/seafile.sql` on seafile db - seahub syncdb - execute `seahub/sql/mysql.sql` on seahub db - admin account data: `'''REPLACE INTO EmailUser(email, passwd, is_staff, is_active, ctime) VALUES ('%s', '%s', 1, 1, 0)''' \ % (seahub_config.admin_email, seahub_config.hashed_admin_password())` - seahub `prepare_avatar_dir` - mkdir `seahub-data/avatars` - create seafile server symlink - seafile-server-latest
Author
Owner
  • make sure to set permissions fo sensitive config files (seahub settings, ccnet dir, seafile dir) to 600/700
- make sure to set permissions fo sensitive config files (seahub settings, ccnet dir, seafile dir) to 600/700
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: schmittlauch/nixos-seafile-overlay#4
No description provided.