2025-01-08 22:46:44 +05:00
|
|
|
# deadjournal
|
|
|
|
|
|
|
|
Simple Web 2.0 blog engine
|
|
|
|
|
|
|
|
## How to deploy
|
|
|
|
- Create a database in mysql/mariadb
|
|
|
|
- Create tables using the file `sql/schema.sql`:
|
|
|
|
```
|
|
|
|
mysql -u other_user -p some_empty_database < sql/schema.sql
|
|
|
|
```
|
|
|
|
- Rename `config.example.php` to `config.php`
|
|
|
|
- Specify the DB connection details in the config.php file
|
2025-01-25 23:43:20 +05:00
|
|
|
|
|
|
|
## How to create an admin account
|
|
|
|
Let's assume that your desired password is "adminpass123" and login is "admin". First, we should generate a hash for your password:
|
2025-01-25 23:45:23 +05:00
|
|
|
```
|
|
|
|
php -r "echo password_hash('adminpass123', PASSWORD_BCRYPT) . PHP_EOL;"
|
|
|
|
```
|
2025-01-25 23:43:20 +05:00
|
|
|
Copy the hash and put it to the `users` table in DB:
|
2025-01-25 23:45:23 +05:00
|
|
|
```
|
|
|
|
mysql -u other_user -p some_empty_database
|
|
|
|
```
|
2025-01-25 23:44:41 +05:00
|
|
|
```sql
|
2025-01-25 23:43:20 +05:00
|
|
|
INSERT INTO users (username, password_hash)
|
|
|
|
VALUES ('admin', 'hash_value');
|
|
|
|
```
|