Asterune Documentation

website·Indexed 29 days ago

https://wiki.solarius.me

Guides and technical documentation for Asterune, covering self-hosting setup, environment configuration via .env files, process management with PM2, and game development using the Studio and API.

Tokens
1.7K
Snippets
13
Records
19
Agent score
49%

What's inside Asterune

  1. Overview of Asterune Studio and API

    Asterune provides a game development environment called Studio for creating, editing, and managing games. It also offers an open platform via a Game API and OAuth2 system for application integration.
  2. Run Asterune application using PM2

    PM2 is a process manager for Node.js that allows the Asterune application to run in the background and persist after server logout. To set up Asterune with PM2, install PM2 globally, navigate to the application root directory, and start the process using Yarn.
    # Install PM2 globally
    npm install -g pm2
    
    # Start the Asterune application
    # The --name flag is optional
    pm2 start yarn --name "framework" -- run start
  3. Configure Asterune environment variables

    Asterune is configured using environment variables stored in a .env file located in the root directory of the instance. To set up your configuration, copy the .env.example file to a new file named .env and edit the values to match your environment.
  4. Migrate from HappyKit feature flags

    Asterune is no longer dependent on external feature flag services like HappyKit. The NEXT_PUBLIC_FLAGS_KEY, NEXT_PUBLIC_FLAGS_PRODUCTION, NEXT_PUBLIC_FLAGS_PREVIEW, and NEXT_PUBLIC_FLAGS_DEVELOPMENT variables are deprecated and will be removed. Use the built-in feature flag system, which requires no configuration.
  5. Create an Asterune admin account

    After setting up the database, you must set a password for the default admin account. The default admin username is always "Asterune".
    yarn run ctl --set-pwd your_admin_password
  6. Install and set up a self-hosted Asterune instance

    To set up a self-hosted Asterune instance, you need Node.js (recommended v16.x), the Yarn package manager, and a PostgreSQL database. The process involves cloning the repository, installing dependencies, configuring the database connection via environment variables, running migrations, and building the project.
    # 1. Clone the repository
    git clone https://invent.solarius.me/Soodam.re/framework.git
    cd framework/
    
    # 2. Install dependencies
    yarn
    
    # 3. Set up the database (after configuring .env)
    yarn run migrate
    yarn run seed
    
    # 4. Initialize sub-projects
    yarn run setup-projects
    
    # 5. Build and start
    yarn run build
    yarn run start
  7. Access the Asterune web interface

    Once the instance is built and started via yarn run start, the platform is accessible in a web browser at http://localhost:3000. Log in using the username "Asterune" and the password configured during the admin account setup.
  8. Configure the PostgreSQL database connection

    Use the DATABASE_URL environment variable to specify the connection string for your PostgreSQL database.
    DATABASE_URL="postgresql://postgres:password@localhost:5432/mydatabase"
  9. Configure SMTP mail delivery

    Enable and configure email delivery by setting the following environment variables:

    • MAIL_ENABLED: Set to true to enable email delivery.
    • SMTP_HOST: The hostname of your SMTP server.
    • SMTP_PASSWORD: The password for SMTP authentication.
    • SMTP_USERNAME: The username for SMTP authentication.
    • MAIL_DOMAIN: The domain name used in the From field of emails.
    MAIL_ENABLED=true
    SMTP_HOST=smtp.gmail.com
    SMTP_PASSWORD=mypassword
    SMTP_USERNAME=myusername@gmail.com
    MAIL_DOMAIN=mydomain.com
  10. Configure persistent file storage

    Set the NEXT_PUBLIC_PERSISTENT_FILE_STORAGE_BASE environment variable to define the base URL for persistent storage of files in the database.
    NEXT_PUBLIC_PERSISTENT_FILE_STORAGE_BASE="https://media.example.com"
  11. Configure Asterune instance via framework.yml

    Asterune instances are configured using a framework.yml file located in the root directory of the instance.

    Critical Constraints:

    • Rebuild Required: Changes to framework.yml are not applied until the instance is rebuilt.
    • Security Warning: The framework.yml file is included in the build and shipped to the client. Never store sensitive information (secrets, API keys) in this file.
  12. Configure support contact email

    Set the email addresses used for the built-in contact page:

    • SUPPORT_EMAIL: The email address to use for support.
    • NEXT_PUBLIC_SUPPORT_EMAIL: The public-facing email address for support.
    SUPPORT_EMAIL=support@example.com
    NEXT_PUBLIC_SUPPORT_EMAIL=support@example.com