From 83a4d91736584768c05264f4177076aff945039d Mon Sep 17 00:00:00 2001 From: soup-bowl Date: Tue, 31 Jan 2023 20:50:16 +0000 Subject: [PATCH] OSGrid version started. --- beta/osgrid-beta/Dockerfile | 29 ++++++ beta/osgrid-beta/defaults/GridCommon.ini | 75 +++++++++++++++ beta/osgrid-beta/defaults/OpenSim.ini | 93 +++++++++++++++++++ .../osgrid-beta/defaults/SQLiteStandalone.ini | 39 ++++++++ beta/osgrid-beta/docker-entrypoint.sh | 67 +++++++++++++ 5 files changed, 303 insertions(+) create mode 100644 beta/osgrid-beta/Dockerfile create mode 100644 beta/osgrid-beta/defaults/GridCommon.ini create mode 100644 beta/osgrid-beta/defaults/OpenSim.ini create mode 100644 beta/osgrid-beta/defaults/SQLiteStandalone.ini create mode 100755 beta/osgrid-beta/docker-entrypoint.sh diff --git a/beta/osgrid-beta/Dockerfile b/beta/osgrid-beta/Dockerfile new file mode 100644 index 0000000..e6ca674 --- /dev/null +++ b/beta/osgrid-beta/Dockerfile @@ -0,0 +1,29 @@ +FROM docker.io/library/mono:latest + +LABEL org.opencontainers.image.title="OpenSimulator (unofficial)" +LABEL org.opencontainers.image.authors="code@soupbowl.io" +LABEL org.opencontainers.image.source="https://github.com/soup-bowl/opensimulator-docker" +LABEL org.opencontainers.image.licenses="MIT" + +ENV OPENSIM_VERSION 12272022.v0.9.2.3422ae3 + +RUN apt-get update && apt-get install -y screen uuid-runtime + +RUN mkdir /opt/opensim-tmp \ + && curl "https://danbanner.onikenkon.com/osgrid/osgrid-opensim-${OPENSIM_VERSION}.zip" | unzip - -d /opt/opensim-tmp \ + && rm /opt/opensim-tmp/bin/OpenSim.ini \ + && rm /opt/opensim-tmp/bin/config-include/GridCommon.ini \ + && rm /opt/opensim-tmp/bin/config-include/storage/SQLiteStandalone.ini \ + && mkdir /opt/opensim \ + && mv /opt/opensim-tmp/opensim*/* /opt/opensim + +COPY defaults /opt/opensim/bin/defaults + +EXPOSE 9000 + +WORKDIR /opt/opensim/bin + +COPY docker-entrypoint.sh /usr/local/bin/ + +ENTRYPOINT ["docker-entrypoint.sh"] +CMD [ "mono", "./OpenSim.exe" ] diff --git a/beta/osgrid-beta/defaults/GridCommon.ini b/beta/osgrid-beta/defaults/GridCommon.ini new file mode 100644 index 0000000..c3edc31 --- /dev/null +++ b/beta/osgrid-beta/defaults/GridCommon.ini @@ -0,0 +1,75 @@ +; This is the main configuration file for an instance of OpenSim running in grid mode + +[DatabaseService] + Include-Storage = "config-include/storage/SQLiteStandalone.ini"; + +[Hypergrid] + HomeURI = "http://hg.osgrid.org:80" + GatekeeperURI = "http://hg.osgrid.org:80" + GatekeeperURIAlias = "login.osgrid.org , users.osgrid.org" + +[Modules] + AssetCaching = "FlotsamAssetCache" + Include-FlotsamCache = "config-include/FlotsamCache.ini" + + ;;OpenSimSearch module + SearchModule = "BasicSearchModule" + +[AssetService] + DefaultAssetLoader = "OpenSim.Framework.AssetLoader.Filesystem.dll" + AssetLoaderArgs = "assets/AssetSets.xml" + + AssetServerURI = "http://assets.osgrid.org" + +[InventoryService] + InventoryServerURI = "http://inventory.osgrid.org" + +[GridInfo] + GridInfoURI = "http://hg.osgrid.org:80" + +[GridService] + GridServerURI = "http://grid.osgrid.org" + AllowHypergridMapSearch = true + + MapTileDirectory = "./maptiles" + + Gatekeeper="http://hg.osgrid.org:80" + +[Messaging] + Gatekeeper = "http://hg.osgrid.org:80" + +[AvatarService] + AvatarServerURI = "http://avatar.osgrid.org" + +[AgentPreferencesService] + AgentPreferencesServerURI = "http://presence.osgrid.org" + +[PresenceService] + PresenceServerURI = "http://presence.osgrid.org" + +[UserAccountService] + UserAccountServerURI = "http://users.osgrid.org" + +[GridUserService] + GridUserServerURI = "http://users.osgrid.org" + +[AuthenticationService] + AuthenticationServerURI = "http://login.osgrid.org" + +[FriendsService] + FriendsServerURI = "http://friends.osgrid.org" + +[HGInventoryAccessModule] + HomeURI = "http://hg.osgrid.org:80" + Gatekeeper = "http://hg.osgrid.org:80" + RestrictInventoryAccessAbroad = false + + +[HGAssetService] + HomeURI = "http://hg.osgrid.org:80" + +[UserAgentService] + UserAgentServerURI = "http://hg.osgrid.org:80" + +[MapImageService] + MapImageServerURI = "http://maptiles.osgrid.org:80" diff --git a/beta/osgrid-beta/defaults/OpenSim.ini b/beta/osgrid-beta/defaults/OpenSim.ini new file mode 100644 index 0000000..c22b762 --- /dev/null +++ b/beta/osgrid-beta/defaults/OpenSim.ini @@ -0,0 +1,93 @@ + +[Startup] + async_call_method = SmartThreadPool + + + MaxPoolThreads = 300 + MinPoolThreads = 32 + + CacheSculptMaps = false + + DefaultScriptEngine = "YEngine" + +[Permissions] + automatic_gods = false + implicit_gods = false + allow_grid_gods = true + +[Network] + shard = "OpenSim" + +[ClientStack.LindenCaps] + Cap_GetTexture = "localhost" + Cap_GetMesh = "localhost" + Cap_AvatarPickerSearch = "localhost" + Cap_GetDisplayNames = "localhost" + + +[SimulatorFeatures] + MapTileURL = "http://maptiles.osgrid.org:80" + +[Messaging] + OfflineMessageModule = OfflineMessageModule + OfflineMessageURL = http://im.osgrid.org/offline + MuteListModule = OpenSimMuteList + MuteListURL = http://im.osgrid.org/mute/index.php + ForwardOfflineGroupMessages = false + +[BulletSim] + AvatarToAvatarCollisionsByDefault = true + UseSeparatePhysicsThread = true + TerrainImplementation=0 + +[DataSnapshot] + index_sims = true + data_exposure = minimum + gridname = "OSGrid" + data_services="http://search.osgrid.org/register.php" + +[Search] + Module = "OpenSimSearch" + SearchURL = http://search.osgrid.org/query.php + +[Economy] + AllowFreeTestUpload = true + MeshModelAllowTextureToInventory = true + economy = http://helper.osgrid.org/ + +[YEngine] + Enabled = true + ScriptStackSize = 256 + ScriptHeapSize = 256 + UseSourceHashCode = true + MinTimerInterval = 0.1 + ScriptEnginesPath="ScriptEngines" + +[XEngine] + Enabled = false + AppDomainLoading = false + +[OSSL] + Include-osslDefaultEnable = "config-include/osslDefaultEnable.ini" + +[Groups] + Enabled = true + Module = GroupsModule + ServicesConnectorModule = XmlRpcGroupsServicesConnector + GroupsServerURI = "http://groups.osgrid.org/xmlrpc.php" + NoticesEnabled = true + MessagingModule = GroupsMessagingModule + MessagingEnabled = true + MessageOnlineUsersOnly = true + +[NPC] + Enabled = true + +[UserProfiles] + ProfileServiceURL = http://services.osgrid.org + +[XBakes] + URL = http://xbakes.osgrid.org + +[Architecture] + Include-Architecture = "config-include/GridHypergrid.ini" diff --git a/beta/osgrid-beta/defaults/SQLiteStandalone.ini b/beta/osgrid-beta/defaults/SQLiteStandalone.ini new file mode 100644 index 0000000..200a9c9 --- /dev/null +++ b/beta/osgrid-beta/defaults/SQLiteStandalone.ini @@ -0,0 +1,39 @@ +; These are the initialization settings for running OpenSim Standalone with an SQLite database + +[DatabaseService] + StorageProvider = "OpenSim.Data.SQLite.dll" + ConnectionString = "URI=file:sqlite-database/OpenSim.db,version=3,UseUTF16Encoding=True" + +[AssetService] + ConnectionString = "URI=file:sqlite-database/Asset.db,version=3" + +; The HGAssetService section controls the connection given to the AssetService in a Hypergrid configuration. +; This has to be separate from [AssetService] because the Hypergrid facing connector uses [HGAssetService] for its config data instead. +; However, the internal asset service will still use the [AssetService] section. +; Therefore, you will almost certainly want the ConnectionString in [HGAssetService] to be the same as in [AssetService] +; so that they both access the same database. +; This issue does not apply to normal MySQL/MSSQL configurations, since by default they use the settings in [DatabaseService] and +; do not have separate connection strings for different services. +[HGAssetService] + ConnectionString = "URI=file:sqlite-database/Asset.db,version=3" + +[InventoryService] + ;ConnectionString = "URI=file:inventory.db,version=3" + ; if you have a legacy inventory store use the connection string below + ConnectionString = "URI=file:sqlite-database/inventory.db,version=3,UseUTF16Encoding=True" + +[AvatarService] + ConnectionString = "URI=file:sqlite-database/avatars.db,version=3" + +[AuthenticationService] + ConnectionString = "URI=file:sqlite-database/auth.db,version=3" + +[UserAccountService] + ConnectionString = "URI=file:sqlite-database/userprofiles.db,version=3" + +[GridUserService] + ConnectionString = "URI=file:sqlite-database/griduser.db,version=3" + +[FriendsService] + ConnectionString = "URI=file:sqlite-database/friends.db,version=3" + diff --git a/beta/osgrid-beta/docker-entrypoint.sh b/beta/osgrid-beta/docker-entrypoint.sh new file mode 100755 index 0000000..8202db4 --- /dev/null +++ b/beta/osgrid-beta/docker-entrypoint.sh @@ -0,0 +1,67 @@ +#!/usr/bin/env bash +set -Eeo pipefail + +chown -R $(id -u):$(id -g) defaults + +if [ ! -e OpenSim.ini ]; then + echo >&2 "INFO: No OpenSim configuration found, pulling one together." + cp defaults/OpenSim.ini OpenSim.ini + + echo -e "\n[Estates] + DefaultEstateName = ${ESTATE_NAME:-Default Estate} + DefaultEstateOwnerName = ${ESTATE_OWNER_NAME:-Foo Bar} + DefaultEstateOwnerUUID = ${ESTATE_OWNER_UUID:-00000000-0000-0000-0000-000000000000} + DefaultEstateOwnerEMail = ${ESTATE_OWNER_EMAIL:-user@example.com} + DefaultEstateOwnerPassword = ${ESTATE_OWNER_PASSWORD:-password}" >> OpenSim.ini + + if [[ "${DATABASE_ENGINE}" == "mysql" ]]; then + echo -e "\n[Messaging] + StorageProvider = \"OpenSim.Data.MySQL.dll\" + ConectionString = \"Data Source=${MYSQL_SERVER:-db};Database=${MYSQL_DATABASE:-opensim};User ID=${MYSQL_USER:-root};Password=${MYSQL_PASSWORD};Old Guids=true;\"" >> OpenSim.ini + fi +fi + +if [ ! -e config-include/GridCommon.ini ]; then + echo >&2 "INFO: No Grid Common configuration found, pulling one together." + cp defaults/GridCommon.ini config-include/GridCommon.ini + + echo "[DatabaseService]" >> config-include/GridCommon.ini + if [[ "${DATABASE_ENGINE}" == "mysql" ]]; then + echo " StorageProvider = \"OpenSim.Data.MySQL.dll\"" >> config-include/GridCommon.ini + echo " ConnectionString = \"Data Source=${MYSQL_SERVER:-db};Database=${MYSQL_DATABASE:-opensim};User ID=${MYSQL_USER:-root};Password=${MYSQL_PASSWORD};Old Guids=true;\"" >> config-include/GridCommon.ini + else + echo " Include-Storage = \"config-include/storage/SQLiteStandalone.ini\"" >> config-include/GridCommon.ini + fi + + echo "[GridService] + StorageProvider = \"OpenSim.Data.Null.dll:NullRegionData\" + Region_${REGION_NAME:-Region} = \"DefaultRegion, FallbackRegion\" + ExportSupported = true" >> config-include/GridCommon.ini + + if [ -n "${GRID_WELCOME}" ]; then + sed -i -e "s/OpenSimulator is running!/${GRID_WELCOME}/g" config-include/GridCommon.ini + fi + + if [ -n "${GRID_NAME}" ]; then + sed -i -e "s/OpenSimulator Instance/${GRID_NAME}/g" config-include/GridCommon.ini + fi +fi + +if [ `find Regions -maxdepth 1 -name '*.ini' | wc -l` -eq 0 ]; then + echo >&2 "INFO: No region details found, pulling one together." + + echo "[${REGION_NAME:-Region}] + RegionUUID = $(uuidgen) + Location = ${REGION_LOCATION} + InternalAddress = 0.0.0.0 + InternalPort = 9000 + AllowAlternatePorts = False + ExternalHostName = ${REGION_HOSTNAME}" >> Regions/Regions.ini +fi + +if [ ! -e config-include/storage/SQLiteStandalone.ini ]; then + cp defaults/SQLiteStandalone.ini config-include/storage/SQLiteStandalone.ini + mkdir -p sqlite-database +fi + +exec "$@"