Maintaining the Database
Current uses a local SQLite database to store data, divided into two database files:
/backend/orion.db
- users: Stores user data
- sessions: Stores active sessions of currently logged-in users
- permissions: Stores user permissions
- configuration: Stores system configuration (e.g., announcements)
- auditlog: Stores operation logs
/backend/current.db
- issues: Stores journal data
- entries: Stores manuscript data
- sudo: Specifically stores active sessions of super administrators in the management panel
Since Current is still under development, the management panel functionalities are not fully implemented yet. Therefore, some management operations require you to directly operate on the SQLite database.
You will need a SQLite database editor software (such as Navicat, JetBrains DataGrip, DB Browser for SQLite) to manipulate the database.
Managing Users
User data is stored in the users table of orion.db.
| Column Name | Type | Description |
|---|---|---|
| id | INTEGER | User ID |
| name | TEXT | Username |
| passwd | TEXT | Password (SHA-256 encrypted) |
| grade | TEXT | User Grade |
| classnum | TEXT | User Class |
| active | TEXT | Active Status (true or false) |
You can add, delete user data, or reset passwords by directly editing the users table.
The SHA-256 encrypted value for the password 123456 is 8d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92. You can use this value to reset passwords for other users.
How to calculate SHA-256? Visit SHA-256 Calculator.
Managing User Permissions
User permissions are stored in the permissions table of orion.db.
| Column Name | Type | Description |
|---|---|---|
| target | TEXT | Permission Target |
| node | TEXT | Permission Node Name |
Permissions are stored in the form of permission nodes, and nodes starting with group. have inheritable properties.
For regular users, it is necessary to grant the group.default permission (which includes basic permissions such as client.login and client.changepass), otherwise, the user cannot log in (this mechanism can also be used to ban accounts).
For administrators, you can directly grant the * permission, which includes all permissions.
Managing Journals
Journal data is stored in the issues table of current.db.
| Column Name | Type | Description |
|---|---|---|
| id | INTEGER | Journal ID |
| date | INTEGER | Journal Deadline Date (Unix Timestamp) |
| subject2 | TEXT | Title of the 2nd Edition |
| subject3 | TEXT | Title of the 3rd Edition |
| subject4 | TEXT | Title of the 4th Edition |
| leader | TEXT | Chief Editor (currently unused) |
| editors | TEXT | Journal Editors stored as a [...] list (currently unused) |
| respeditor | TEXT | Responsible Editor (currently unused) |
| ispublished | INTEGER | Whether the Journal is Published (0 for unpublished, 1 for published) |
You can create new journals directly on the front end at /newissue.
Managing Manuscripts
Manuscript data is stored in the entries table of current.db.
| Column Name | Type | Description |
|---|---|---|
| uuid | TEXT | Manuscript UUID |
| issue_id | INTEGER | Journal ID |
| filename | TEXT | Original File Name of the Manuscript |
| page | INTEGER | Page Number of the Manuscript |
| title | TEXT | Title of the Manuscript |
| origin | TEXT | Origin of the Manuscript |
| wordcount | INTEGER | Word Count of the Manuscript |
| description | TEXT | Description of the Manuscript |
| selector | TEXT | Manuscript Selector |
| reviewer | TEXT | Manuscript Reviewer |
| status | TEXT | Status of the Manuscript |
Most manuscript data can be managed on the front end at /issue/[issue_id], but data like reviewers and selectors need to be manually edited in the database.
To ensure server safety, uploaded files do not retain their original names but are renamed to the manuscript UUID, and they can be found in the /backend/uploads directory.
The general manuscript statuses are: created for created manuscripts, reviewed for reviewed manuscripts, and selected for selected manuscripts.
Manuscripts with a status of pending might have encountered issues like connection loss during upload. In most cases, these can be ignored or deleted.