Configuration - Serena1432/NobihazaVietnamCollection GitHub Wiki
Create a database using phpMyAdmin
If you're installing on a local server, you need to create a new database first. In case if you're using a public domain server, refer to your hosting/server provider for the database login credentials.
- Go to
http://127.0.0.1/phpmyadmin
on your browser.
- Press
New
in the left pane to create a new database. Type your desired database name and clickCreate
.
- A new database has been created. Use this database name for the
DB_DATABASE
environment variable, as described below.
Editing environment variables
- Open the
htdocs
folder, and rename the.env.sample
file to.env
.Note: On macOS and Linux, the operating system will hide files begin with.
by default. You can useCommand + Shift + .
on macOS orCtrl + H
on Linux to show hidden files.
- Open that renamed
.env
file using any text editor you want.
Database information
Edit the DB_*
environment variables to fit with your MySQL database settings.
Property | Description | XAMPP default values |
---|---|---|
DB_HOST |
Database host address | localhost |
DB_USERNAME |
Database username | root |
DB_PASSWORD |
Database password | (empty) |
DB_DATABASE |
Database name |
Encryption password
Type any desired password ENCRYPTION_PASSWORD
variable to specify the password for encrypting the user information. Make sure to specify a strong password to avoid cracking.
Displaying errors
(This variable may not work on some setups.)
Use DISPLAY_ERRORS=1
to display PHP errors, and 0
if you want to hide all errors.
Email settings
This is crucial for sending verification messages to users. I will use the example from Hostinger to demonstrate.
Property | Description | Example |
---|---|---|
EMAIL_HOST |
SMTP email provider address | smtp.hostinger.com |
EMAIL_USERNAME |
SMTP email username | [email protected] |
EMAIL_PASSWORD |
SMTP email password | someemailpassword |
EMAIL_FROM |
Email from address, useful for emails that the username isn't the same with the email address |
[email protected] |
EMAIL_NAME |
The sender name to be assigned with your email that will be seen by the receiver. Use any name that you want. | Nobihaza Vietnam Community Collection |
Discord OAuth2
Leave everything empty if you don't want to use Discord OAuth2 integration, however the "Login using Discord" button will not work.
Property | Description | Example |
---|---|---|
DISCORD_CLIENT_ID |
Application client ID, written at OAuth2 -> Client ID or the number in the address bar when viewing the application info. |
1314797199795949638 |
DISCORD_CLIENT_SECRET |
Application client secret, written at OAuth2 -> Client Secret . You have to press Reset Secret each time you want to view the client secret code, and the code will be renewed. |
eOs45YtJ-I0bEohecm9rhR5nbWkimwy2 (not a real code btw) |
Discord webhook integration
If you don't want to use a specific webhook, you can leave that variable empty.
Listing new games
The target Discord channel can be a forum channel, or a normal text one.
- Go to the target channel's settings, and go to the
Integrations
tab. SelectWebhooks
and click theNew Webhook
/Create Webhook
button.
- Select the avatar and type your desired webhook username, then click
Copy Webhook URL
.
- Your Webhook URL will look like this:
https://discord.com/api/webhooks/1357677870247317694/PxkcIx6QKobi51mpXvhDsSHMOBenJVmdTSoY8TNgT_buNFAtEYneGVr3yMisRSHOh_zu
- Copy it to the
DISCORD_NEW_GAME_WEBHOOK
variable and you're done.
Moderation notification
The website will send a notification to the desired channel if a new game is uploaded and is waiting for approval.
Unlike the last webhook, this one won't support forum channel. Only normal text channel is supported.
Just create a new webhook as described above, and paste the URL to DISCORD_MODERATION_WEBHOOK
variable.
Administrator account
These variables will only be used once to create the administrator account for the website. Changing these is recommended to prevent other users logging in to the administrator account.
Property | Description |
---|---|
ADMIN_USERNAME |
Account username |
ADMIN_PASSWORD |
Account password |
ADMIN_EMAIL |
Account email. This account will not require verification. |
This account will be created automatically with the ID 1
upon the first-time setup. After that, those three variables will be unused and you can safely delete them.
Download type
Currently this website provides two download types:
1
: Read the file data upon requesting to the download URL, and provide them to the user as a file. This way you can spoof the file name to whatever you want, but will consume more server memory.2
: Redirect the download URL to the original file URL. This will consume less memory, but the downloaded file name will be a bunch of meaningless text representing the file ID.
The default type is 2
, but you can set the DOWNLOAD_TYPE
variable to one of these two download types. This can be changed in the future.
Configuring webhooks
If you don't use any of the webhooks listed above, you can create an empty webhook_config.php
file instead.
-
Rename
webhook_config.sample.php
towebhook_config.php
. -
Open that renamed
webhook_config.php
using your preferred text editor.
new_game
webhook
Property | Type | Description |
---|---|---|
threads |
boolean |
Is the target a forum channel? |
allowed_mentions |
array(string => array) |
List of roles/members the webhook will mention for each message. See this page for more information. |
tags |
array(string => array) |
List of Discord tag IDs to be assigned for each category. |
tags.engine |
array(int => string) |
Discord tag IDs to be assigned for each game engine.ENGINE_RM2K : RPG Maker 2000ENGINE_RGSS : RPG Maker XP/VX/VX AceENGINE_RPGMV : RPG Maker MVENGINE_OTHER : Other game engines |
tags.language |
array(int => string) |
Discord tag IDs to be assigned for each language.LANGUAGE_VIETNAMESE : VietnameseLANGUAGE_ENGLISH : EnglishLANGUAGE_JAPANESE : JapaneseLANGUAGE_CHINESE : ChineseLANGUAGE_OTHER : Other languagesLANGUAGE_MULTIPLE : Multiple languages |
tags.os |
array(string => string) |
Discord tag IDs to be assigned for each supported OS."pc" : Support PC devices"mobile" : Support mobile devices |
tags.tags |
array(string => string) |
Discord tag IDs to be assigned for each custom tag.You need to assign them yourself, which each respective tag ID for each custom game tag. |
moderation
webhook
Property | Type | Description |
---|---|---|
allowed_mentions |
array(string => array) |
List of roles/members the webhook will mention for each message. See this page for more information. |
Visiting the website
After completing the configuration, go to http://127.0.0.1
(or your domain if you're using a public domain server). If you can see the website with no games like the image below, that means the configuration is successful.