mirror of
https://github.com/soup-bowl/opensim-sandbox.git
synced 2026-08-14 08:52:12 +00:00
Add WordPress-assisted Standalone (#1)
This commit is contained in:
@@ -7,9 +7,13 @@ For accessing the OpenSimulator metaverse, I recommend [Firestorm Viewer](https:
|
||||
|
||||
Each folder contains a docker-compose file that will setup the OpenSimulator prototype.
|
||||
|
||||
Folder | Purpose
|
||||
--------------------------|--------
|
||||
[standalone](/standalone) | Sets up an OpenSimulator instance in standalone mode, using MySQL (mariadb 10.5) as the storage engine.
|
||||
Folder | Purpose
|
||||
------------------------------|--------
|
||||
[standalone][os-s] | Sets up an OpenSimulator instance in standalone mode, using MySQL (mariadb 10.5) as the storage engine.
|
||||
[standalone-wordpress][os-wp] | Same as Standalone, but has a WordPress instance prepped to control the userbase.
|
||||
|
||||
[os-s]: standalone
|
||||
[os-wp]: standalone-wordpress
|
||||
|
||||
## Using Docker Compose / Cheat Sheet
|
||||
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
version: '3.6'
|
||||
services:
|
||||
db:
|
||||
image: docker.io/library/mariadb:10.5
|
||||
volumes:
|
||||
- "database_store:/var/lib/mysql"
|
||||
environment:
|
||||
MYSQL_DATABASE: metaverse
|
||||
MYSQL_ROOT_PASSWORD: password
|
||||
db_pma:
|
||||
image: docker.io/phpmyadmin/phpmyadmin:latest
|
||||
depends_on:
|
||||
- db
|
||||
ports:
|
||||
- 8081:80
|
||||
environment:
|
||||
MYSQL_ROOT_PASSWORD: password
|
||||
PMA_USER: root
|
||||
PMA_PASSWORD: password
|
||||
metaverse:
|
||||
depends_on:
|
||||
- db
|
||||
build:
|
||||
context: ./docker
|
||||
dockerfile: OS.Dockerfile
|
||||
ports:
|
||||
- "9000:9000"
|
||||
- "9000:9000/udp"
|
||||
wordpress:
|
||||
depends_on:
|
||||
- db
|
||||
build:
|
||||
context: ./docker
|
||||
dockerfile: WP.Dockerfile
|
||||
volumes:
|
||||
- "website_store:/var/www/html"
|
||||
ports:
|
||||
- 8082:80
|
||||
environment:
|
||||
WORDPRESS_DB_HOST: db
|
||||
WORDPRESS_DB_NAME: metaverse
|
||||
WORDPRESS_DB_USER: root
|
||||
WORDPRESS_DB_PASSWORD: password
|
||||
www:
|
||||
image: nginx:latest
|
||||
volumes:
|
||||
- "./www:/usr/share/nginx/html:ro"
|
||||
ports:
|
||||
- 8080:80
|
||||
|
||||
volumes:
|
||||
website_store:
|
||||
database_store:
|
||||
@@ -0,0 +1,19 @@
|
||||
FROM docker.io/library/mono:latest
|
||||
|
||||
RUN curl -o /bin/wait-for-it https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh \
|
||||
&& chmod +x /bin/wait-for-it
|
||||
|
||||
RUN apt-get update && apt-get install -y screen
|
||||
|
||||
RUN mkdir /opt/opensim-tmp && curl http://opensimulator.org/dist/opensim-0.9.2.0.tar.gz | tar xzf - -C /opt/opensim-tmp
|
||||
RUN mkdir /opt/opensim && mv /opt/opensim-tmp/opensim*/* /opt/opensim
|
||||
|
||||
COPY Regions.ini /opt/opensim/bin/Regions/Regions.ini
|
||||
COPY OpenSim.ini /opt/opensim/bin/OpenSim.ini
|
||||
COPY StandaloneCommon.ini /opt/opensim/bin/config-include/StandaloneCommon.ini
|
||||
|
||||
EXPOSE 9000
|
||||
|
||||
WORKDIR /opt/opensim/bin
|
||||
|
||||
ENTRYPOINT [ "wait-for-it", "db:3306", "--", "mono", "./OpenSim.exe" ]
|
||||
@@ -0,0 +1,55 @@
|
||||
|
||||
[Const]
|
||||
BaseHostname = "localhost"
|
||||
BaseURL = http://${Const|BaseHostname}
|
||||
PublicPort = "9000"
|
||||
PrivURL = ${Const|BaseURL}
|
||||
PrivatePort = "8003"
|
||||
|
||||
[Permissions]
|
||||
automatic_gods = false
|
||||
implicit_gods = false
|
||||
allow_grid_gods = true
|
||||
|
||||
[Estates]
|
||||
DefaultEstateName = OpenSim Standalone
|
||||
DefaultEstateOwnerName = Governor Linden
|
||||
DefaultEstateOwnerUUID = 00000000-0000-0000-0000-000000000000
|
||||
DefaultEstateOwnerEMail = foobar@example.com
|
||||
DefaultEstateOwnerPassword = password
|
||||
|
||||
[Network]
|
||||
http_listener_port = 9000
|
||||
ExternalHostNameForLSL = ${Const|BaseHostname}
|
||||
shard = "OpenSim"
|
||||
|
||||
[ClientStack.LindenCaps]
|
||||
Cap_GetTexture = "localhost"
|
||||
Cap_GetMesh = "localhost"
|
||||
Cap_AvatarPickerSearch = "localhost"
|
||||
Cap_GetDisplayNames = "localhost"
|
||||
|
||||
[Messaging]
|
||||
StorageProvider = OpenSim.Data.MySQL.dll
|
||||
ConectionString = "Data Source=db;Database=metaverse;User ID=root;Password=password;Old Guids=true;"
|
||||
|
||||
[BulletSim]
|
||||
AvatarToAvatarCollisionsByDefault = true
|
||||
|
||||
[RemoteAdmin]
|
||||
enabled = true
|
||||
access_password = "password"
|
||||
enabled_methods = all
|
||||
|
||||
[XEngine]
|
||||
AppDomainLoading = false
|
||||
DeleteScriptsOnStartup = false
|
||||
|
||||
[OSSL]
|
||||
Include-osslDefaultEnable = "config-include/osslDefaultEnable.ini"
|
||||
|
||||
[Architecture]
|
||||
Include-Architecture = "config-include/Standalone.ini"
|
||||
|
||||
[WebStats]
|
||||
enabled = true
|
||||
@@ -0,0 +1,7 @@
|
||||
[Foobar]
|
||||
RegionUUID = 92f0c4a2-e7b4-11ea-adc1-0242ac120002
|
||||
Location = 1000,1000
|
||||
InternalAddress = 0.0.0.0
|
||||
InternalPort = 9000
|
||||
AllowAlternatePorts = False
|
||||
ExternalHostName = localhost
|
||||
@@ -0,0 +1,52 @@
|
||||
; This is the main configuration file for an instance of OpenSim running in standalone mode
|
||||
|
||||
[DatabaseService]
|
||||
StorageProvider = "OpenSim.Data.MySQL.dll"
|
||||
ConnectionString = "Data Source=db;Database=metaverse;User ID=root;Password=password;Old Guids=true;"
|
||||
|
||||
[Hypergrid]
|
||||
HomeURI = "${Const|BaseURL}:${Const|PublicPort}"
|
||||
|
||||
[Modules]
|
||||
AssetCaching = "FlotsamAssetCache"
|
||||
Include-FlotsamCache = "config-include/FlotsamCache.ini"
|
||||
|
||||
[AssetService]
|
||||
DefaultAssetLoader = "OpenSim.Framework.AssetLoader.Filesystem.dll"
|
||||
AssetLoaderArgs = "assets/AssetSets.xml"
|
||||
|
||||
[GridService]
|
||||
StorageProvider = "OpenSim.Data.Null.dll:NullRegionData"
|
||||
Region_Welcome_Area = "DefaultRegion, FallbackRegion"
|
||||
ExportSupported = true
|
||||
|
||||
[LibraryModule]
|
||||
LibraryName = "Library"
|
||||
|
||||
[LoginService]
|
||||
WelcomeMessage = "Running OpenSimulator in Standalone Grid mode."
|
||||
SRV_HomeURI = "${Hypergrid|HomeURI}"
|
||||
SRV_InventoryServerURI = "${Const|BaseURL}:${Const|PublicPort}"
|
||||
SRV_AssetServerURI = "${Const|BaseURL}:${Const|PublicPort}"
|
||||
SRV_ProfileServerURI = "${Const|BaseURL}:${Const|PublicPort}"
|
||||
SRV_FriendsServerURI = "${Const|BaseURL}:${Const|PublicPort}"
|
||||
SRV_IMServerURI = "${Const|BaseURL}:${Const|PublicPort}"
|
||||
MapTileURL = "${Const|BaseURL}:${Const|PublicPort}/"
|
||||
|
||||
[GridInfoService]
|
||||
login = ${Const|BaseURL}:${Const|PublicPort}/
|
||||
gridname = "OpenSimulator Sandbox Standalone"
|
||||
gridnick = "osss"
|
||||
welcome = ${Const|BaseURL}:8080
|
||||
|
||||
[GatekeeperService]
|
||||
AllowTeleportsToAnyRegion = true
|
||||
|
||||
[EntityTransfer]
|
||||
AccountForAppearance = "Test User, Astronaut Smith"
|
||||
|
||||
[UserProfilesService]
|
||||
Enabled = false
|
||||
LocalServiceModule = "OpenSim.Services.UserProfilesService.dll:UserProfilesService"
|
||||
UserAccountService = OpenSim.Services.UserAccountService.dll:UserAccountService
|
||||
AuthenticationServiceModule = "OpenSim.Services.AuthenticationService.dll:PasswordAuthenticationService"
|
||||
@@ -0,0 +1,11 @@
|
||||
FROM docker.io/library/wordpress:latest
|
||||
|
||||
ADD wp-config.sh /opt/wp-init.sh
|
||||
|
||||
RUN curl https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar --output /usr/bin/wp \
|
||||
&& chmod +X /usr/bin/wp \
|
||||
&& chmod 766 /usr/bin/wp
|
||||
|
||||
RUN mv /opt/wp-init.sh /usr/bin/wp-init \
|
||||
&& chmod +X /usr/bin/wp-init \
|
||||
&& chmod 766 /usr/bin/wp-init
|
||||
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
wp core install --url="localhost:8082" --title="OpenSimulator" --admin_user="admin" --admin_password="password" --admin_email="code@example.com" --skip-email --allow-root
|
||||
wp plugin install opensimulator-bridge --allow-root
|
||||
wp plugin activate opensimulator-bridge --allow-root
|
||||
wp option add wpos --format=json '{"address":"http:\/\/metaverse:9000","secret":"password","allowedlastnames":""}' --allow-root
|
||||
@@ -0,0 +1,41 @@
|
||||
# OpenSimulator - Standalone + WordPress
|
||||
|
||||
This runs the same expertiment as the [Standalone instance](../standalone), but couples with an instance of WordPress that can manage the userbase via XMLRPC.
|
||||
|
||||
**Check the repository root readme for answers to most questions.**
|
||||
|
||||
## What this will do
|
||||
|
||||
### Architecture
|
||||
|
||||
The compose script will do the following:
|
||||
|
||||
* Builds a container, based on the [Mono image](https://hub.docker.com/_/mono/), to run OpenSimulator.
|
||||
* Wait for It is added so that our container checks the database has started up before it begins starting up OpenSim.
|
||||
* The build process picks up the **3 configuration files** and adds them to a directory within the container, so OpenSim can use them.
|
||||
* Starts up a copy of **[MariaDB Server 10.5](https://mariadb.org/)**.
|
||||
* You can swap to [MySQL](https://hub.docker.com/_/mysql/) if you prefer - they're largely compatible with each other.
|
||||
* Be aware of a [modern charset database limitation](http://opensimulator.org/mantis/view.php?id=8919) - this is why 10.5 is used.
|
||||
* Starts up an instance of **[WordPress](https://wordpress.org/)**.
|
||||
* Starts up an **[NGINX](https://nginx.org/en/) web server** - this is to show the grid welcome screen, and more details.
|
||||
* **OpenSimulator** begins when the database instance reports it has finished initialising. It will create a db, populate it, then advertise that it is ready to accept connections.
|
||||
|
||||
**Once the initalisation finishes** (give it an extra minute), run `docker-compose exec wordpress wp-init` to automatically setup the WordPress instance for OpenSimulator usage.
|
||||
|
||||
Once the `docker-compose up` command is reporting all instances as done, you can visit the grid info page at [localhost:8080](http://localhost:8080).
|
||||
|
||||
### WordPress
|
||||
|
||||
Log in with the administration account (admin/password), and go to either edit an existing user, or create a new one. You should have the option to specify an avatar first and last name. **If you are editing a user, click to generate a new password**, and the OpenSimulator plugin will pass the avatar name and password configuration to the [XMLRPC RemoteAdmin](http://opensimulator.org/wiki/RemoteAdmin) endpoint. This should then create a user for you on the grid.
|
||||
|
||||
### OpenSimulator
|
||||
|
||||
*For more information, see the [Standalone instance](../standalone#opensimulator).*
|
||||
|
||||
## Changing configurations
|
||||
|
||||
The configuration files are **built into the image**, so if you change the configuration files found in `.docker`, then you will need to run the following commands to rebuild the image (will not lose any data).
|
||||
|
||||
```bash
|
||||
docker-compose up --build -d
|
||||
```
|
||||
@@ -0,0 +1,80 @@
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
|
||||
</head>
|
||||
<body>
|
||||
<main role="main" class="container-sm mt-5 text-center">
|
||||
<h1>OpenSimulator Sandbox Instance</h1>
|
||||
<p><span class="badge bg-primary">Standalone</span> <span class="badge bg-warning">WordPress Login</span> <span class="badge bg-secondary">MySQL</span></p>
|
||||
<p>To add this grid to <a href="https://www.firestormviewer.org/os-operating-system/" target="_blank">Firestorm</a>, on the login screen open <strong>preferences</strong>, <strong>opensim</strong>, and under 'Add new grid' type <strong>localhost:9000</strong> and click <strong>Apply</strong>.</p>
|
||||
<h2>Credentials</h2>
|
||||
<div class="table-responsive" style="margin-left: 25%; margin-right: 25%;">
|
||||
<table class="table table-sm">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Tool</th>
|
||||
<th>Username</th>
|
||||
<th>Password</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th scope="row">OpenSimulator</th>
|
||||
<td>Governor Linden</td>
|
||||
<td>password</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">WordPress</th>
|
||||
<td>admin</td>
|
||||
<td>password</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<h2>Services</h2>
|
||||
<div class="table-responsive" style="margin-left: 20%; margin-right: 20%;">
|
||||
<table class="table table-striped table-sm">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Service</th>
|
||||
<th>Port</th>
|
||||
<th>Usage</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="text-start">
|
||||
<tr>
|
||||
<td>Web Instance</td>
|
||||
<td><a href="http://localhost:8080" target="_blank">8080</a></td>
|
||||
<td>This page.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>phpMyAdmin</td>
|
||||
<td><a href="http://localhost:8081" target="_blank">8081</a></td>
|
||||
<td>Administer the OpenSimulator database.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>WordPress</td>
|
||||
<td><a href="http://localhost:8082/wp-admin" target="_blank">8082</a></td>
|
||||
<td>Comes with the <a href="https://wordpress.org/plugins/opensimulator-bridge/">OpenSim plugin</a> to allow remote control via XMLRPC.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>OpenSimulator</td>
|
||||
<td><a href="http://localhost:9000/SStats/" target="_blank">9000</a></td>
|
||||
<td>The port used by OpenSimulator in Standalone mode.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</main>
|
||||
<footer class="footer text-center">
|
||||
<div class="container">
|
||||
<span class="text-muted">
|
||||
<a href="https://github.com/soup-bowl/opensim-sandbox" class="text-muted">Project GitHub</a>
|
||||
<a href="http://opensimulator.org/wiki/Main_Page" class="text-muted">OpenSimuator</a>
|
||||
</span>
|
||||
</div>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user