From 5e6f1640dcb8e30a44f8ff07572874850b12cc2e Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sat, 16 May 2020 14:30:07 -0400 Subject: simplify single-instance deployment and make MongoDB server optional --- docs/technical/web.md | 44 ++++++++++++++++++++++++++++++++++---------- 1 file changed, 34 insertions(+), 10 deletions(-) (limited to 'docs/technical') diff --git a/docs/technical/web.md b/docs/technical/web.md index 67e86c8b..ef591aee 100644 --- a/docs/technical/web.md +++ b/docs/technical/web.md @@ -340,9 +340,20 @@ short url | → | target page A local environment lets you run a complete copy of the web project (including cache database) on your machine, with no external dependencies aside from the actual mod sites. -1. Enter the Nexus credentials in `appsettings.Development.json` . You can leave the other - credentials empty to default to fetching data anonymously, and storing data in-memory and - on disk. +1. Edit `appsettings.Development.json` and set these options: + + property name | description + ------------- | ----------- + `NexusApiKey` | [Your Nexus API key](https://www.nexusmods.com/users/myaccount?tab=api#personal_key). + + Optional settings: + + property name | description + --------------------------- | ----------- + `AzureBlobConnectionString` | The connection string for the Azure Blob storage account. Defaults to using the system's temporary file folder if not specified. + `GitHubUsername`
`GitHubPassword` | The GitHub credentials with which to query GitHub release info. Defaults to anonymous requests if not specified. + `Storage` | How to storage cached wiki/mod data. `InMemory` is recommended in most cases, or `MongoInMemory` to test the MongoDB storage code. See [production environment](#production-environment) for more info on `Mongo`. + 2. Launch `SMAPI.Web` from Visual Studio to run a local version of the site. ### Production environment @@ -355,19 +366,15 @@ accordingly. Initial setup: -1. Launch an empty MongoDB server (e.g. using [MongoDB Atlas](https://www.mongodb.com/cloud/atlas)) - for mod data. -2. Create an Azure Blob storage account for uploaded files. -3. Create an Azure App Services environment running the latest .NET Core on Linux or Windows. -4. Add these application settings in the new App Services environment: +1. Create an Azure Blob storage account for uploaded files. +2. Create an Azure App Services environment running the latest .NET Core on Linux or Windows. +3. Add these application settings in the new App Services environment: property name | description ------------------------------- | ----------------- `ApiClients.AzureBlobConnectionString` | The connection string for the Azure Blob storage account created in step 2. `ApiClients.GitHubUsername`
`ApiClients.GitHubPassword` | The login credentials for the GitHub account with which to fetch release info. If these are omitted, GitHub will impose much stricter rate limits. `ApiClients:NexusApiKey` | The [Nexus API authentication key](https://github.com/Pathoschild/FluentNexus#init-a-client). - `MongoDB:ConnectionString` | The connection string for the MongoDB instance. - `MongoDB:Database` | The MongoDB database name (e.g. `smapi` in production or `smapi-edge` in testing environments). Optional settings: @@ -378,6 +385,23 @@ Initial setup: `Site:BetaBlurb` | If `Site:BetaEnabled` is true and there's a beta version of SMAPI in its GitHub releases, this is shown on the beta download button as explanatory subtext. `Site:SupporterList` | A list of Patreon supports to credit on the download page. +To enable distributed servers: + +1. Launch an empty MongoDB server (e.g. using [MongoDB Atlas](https://www.mongodb.com/cloud/atlas)) + for mod data. +2. Add these application settings in the App Services environment: + + property name | description + ------------------------------- | ----------------- + `Storage:Mode` | Set to `Mongo`. + `Storage:ConnectionString` | Set to the connection string for the MongoDB instance. + + Optional settings: + + property name | description + ------------------------------- | ----------------- + `Storage:Database` | Set to the MongoDB database name (defaults to `smapi`). + To deploy updates: 1. [Deploy the web project from Visual Studio](https://docs.microsoft.com/en-us/visualstudio/deployment/quickstart-deploy-to-azure). 2. If the MongoDB schema changed, delete the MongoDB database. (It'll be recreated automatically.) -- cgit From d7add894419543667e60569bfeb439e8e797a4d1 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sat, 23 May 2020 19:25:34 -0400 Subject: drop MongoDB code MongoDB support unnecessarily complicated the code and there's no need to run distributed servers in the foreseeable future. This keeps the abstract storage interface so we can wrap a distributed cache in the future. --- docs/technical/web.md | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) (limited to 'docs/technical') diff --git a/docs/technical/web.md b/docs/technical/web.md index ef591aee..d21b87ac 100644 --- a/docs/technical/web.md +++ b/docs/technical/web.md @@ -352,7 +352,6 @@ your machine, with no external dependencies aside from the actual mod sites. --------------------------- | ----------- `AzureBlobConnectionString` | The connection string for the Azure Blob storage account. Defaults to using the system's temporary file folder if not specified. `GitHubUsername`
`GitHubPassword` | The GitHub credentials with which to query GitHub release info. Defaults to anonymous requests if not specified. - `Storage` | How to storage cached wiki/mod data. `InMemory` is recommended in most cases, or `MongoInMemory` to test the MongoDB storage code. See [production environment](#production-environment) for more info on `Mongo`. 2. Launch `SMAPI.Web` from Visual Studio to run a local version of the site. @@ -385,23 +384,4 @@ Initial setup: `Site:BetaBlurb` | If `Site:BetaEnabled` is true and there's a beta version of SMAPI in its GitHub releases, this is shown on the beta download button as explanatory subtext. `Site:SupporterList` | A list of Patreon supports to credit on the download page. -To enable distributed servers: - -1. Launch an empty MongoDB server (e.g. using [MongoDB Atlas](https://www.mongodb.com/cloud/atlas)) - for mod data. -2. Add these application settings in the App Services environment: - - property name | description - ------------------------------- | ----------------- - `Storage:Mode` | Set to `Mongo`. - `Storage:ConnectionString` | Set to the connection string for the MongoDB instance. - - Optional settings: - - property name | description - ------------------------------- | ----------------- - `Storage:Database` | Set to the MongoDB database name (defaults to `smapi`). - -To deploy updates: -1. [Deploy the web project from Visual Studio](https://docs.microsoft.com/en-us/visualstudio/deployment/quickstart-deploy-to-azure). -2. If the MongoDB schema changed, delete the MongoDB database. (It'll be recreated automatically.) +To deploy updates, just [redeploy the web project from Visual Studio](https://docs.microsoft.com/en-us/visualstudio/deployment/quickstart-deploy-to-azure). -- cgit From 2d19095169019a1cb07da5802dd83fb13550a051 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sun, 14 Jun 2020 11:29:07 -0400 Subject: add support for using a custom Harmony build (#711) --- docs/technical/smapi.md | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) (limited to 'docs/technical') diff --git a/docs/technical/smapi.md b/docs/technical/smapi.md index c9d5c07e..ca8a9c70 100644 --- a/docs/technical/smapi.md +++ b/docs/technical/smapi.md @@ -15,6 +15,7 @@ This document is about SMAPI itself; see also [mod build package](mod-package.md * [Compiling from source](#compiling-from-source) * [Debugging a local build](#debugging-a-local-build) * [Preparing a release](#preparing-a-release) + * [Using a custom Harmony build](#using-a-custom-harmony-build) * [Release notes](#release-notes) ## Customisation @@ -60,21 +61,18 @@ flag | purpose ## For SMAPI developers ### Compiling from source -Using an official SMAPI release is recommended for most users. +Using an official SMAPI release is recommended for most users, but you can compile from source +directly if needed. There are no special steps (just open the project and compile), but SMAPI often +uses the latest C# syntax. You may need the latest version of your IDE to compile it. -SMAPI often uses the latest C# syntax. You may need the latest version of -[Visual Studio](https://www.visualstudio.com/vs/community/) on Windows, -[MonoDevelop](https://www.monodevelop.com/) on Linux, -[Visual Studio for Mac](https://www.visualstudio.com/vs/visual-studio-mac/), or an equivalent IDE -to compile it. It uses build configuration derived from the -[crossplatform mod config](https://smapi.io/package/readme) to detect your current OS automatically -and load the correct references. Compile output will be placed in a `bin` folder at the root of the -git repository. +SMAPI uses build configuration derived from the [crossplatform mod config](https://smapi.io/package/readme) +to detect your current OS automatically and load the correct references. Compile output will be +placed in a `bin` folder at the root of the Git repository. ### Debugging a local build Rebuilding the solution in debug mode will copy the SMAPI files into your game folder. Starting the `SMAPI` project with debugging from Visual Studio (on Mac or Windows) will launch SMAPI with -the debugger attached, so you can intercept errors and step through the code being executed. This +the debugger attached, so you can intercept errors and step through the code being executed. That doesn't work in MonoDevelop on Linux, unfortunately. ### Preparing a release @@ -87,9 +85,9 @@ on the wiki for the first-time setup. build type | format | example :--------- | :----------------------- | :------ - dev build | `-alpha.` | `3.0-alpha.20171230` - prerelease | `-beta.` | `3.0-beta.2` - release | `` | `3.0` + dev build | `-alpha.` | `3.0.0-alpha.20171230` + prerelease | `-beta.` | `3.0.0-beta.2` + release | `` | `3.0.0` 2. In Windows: 1. Rebuild the solution in Release mode. @@ -103,5 +101,14 @@ on the wiki for the first-time setup. 3. Rename the folders to `SMAPI installer` and `SMAPI installer for developers`. 4. Zip the two folders. +### Using a custom Harmony build +The official SMAPI releases include [a custom build of Harmony](https://github.com/Pathoschild/Harmony), +but compiling from source will use the official build. To use a custom build, put `0Harmony.dll` in +the `build` folder and it'll be referenced automatically. + +Note that Harmony merges its dependencies into `0Harmony.dll` when compiled in release mode. To use +a debug build of Harmony, you'll need to manually copy those dependencies into your game's +`smapi-internal` folder. + ## Release notes See [release notes](../release-notes.md). -- cgit From dcd2c647a2abd836e8ee20f8ddad6568c9b4fbf2 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Mon, 15 Jun 2020 22:17:32 -0400 Subject: temporarily restore Harmony 1.x support with compile flag (#711) --- docs/technical/smapi.md | 1 + 1 file changed, 1 insertion(+) (limited to 'docs/technical') diff --git a/docs/technical/smapi.md b/docs/technical/smapi.md index ca8a9c70..3b2d6e56 100644 --- a/docs/technical/smapi.md +++ b/docs/technical/smapi.md @@ -58,6 +58,7 @@ SMAPI uses a small number of conditional compilation constants, which you can se flag | purpose ---- | ------- `SMAPI_FOR_WINDOWS` | Whether SMAPI is being compiled on Windows for players on Windows. Set automatically in `crossplatform.targets`. +`HARMONY_2` | Whether to enable experimental Harmony 2.0 support. Existing Harmony 1._x_ mods will be rewritten automatically for compatibility. ## For SMAPI developers ### Compiling from source -- cgit From a7cf886b7145e94dbcb1157f73aa0f2922fa183f Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sat, 20 Jun 2020 00:13:23 -0400 Subject: switch to custom build of Harmony 1.2.0.1 --- docs/technical/smapi.md | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'docs/technical') diff --git a/docs/technical/smapi.md b/docs/technical/smapi.md index 3b2d6e56..5d550cfc 100644 --- a/docs/technical/smapi.md +++ b/docs/technical/smapi.md @@ -58,7 +58,7 @@ SMAPI uses a small number of conditional compilation constants, which you can se flag | purpose ---- | ------- `SMAPI_FOR_WINDOWS` | Whether SMAPI is being compiled on Windows for players on Windows. Set automatically in `crossplatform.targets`. -`HARMONY_2` | Whether to enable experimental Harmony 2.0 support. Existing Harmony 1._x_ mods will be rewritten automatically for compatibility. +`HARMONY_2` | Whether to enable experimental Harmony 2.0 support and rewrite existing Harmony 1._x_ mods for compatibility. Note that you need to replace `build/0Harmony.dll` with a Harmony 2.0 build (or switch to a package reference) to use this flag. ## For SMAPI developers ### Compiling from source @@ -102,14 +102,10 @@ on the wiki for the first-time setup. 3. Rename the folders to `SMAPI installer` and `SMAPI installer for developers`. 4. Zip the two folders. -### Using a custom Harmony build -The official SMAPI releases include [a custom build of Harmony](https://github.com/Pathoschild/Harmony), -but compiling from source will use the official build. To use a custom build, put `0Harmony.dll` in -the `build` folder and it'll be referenced automatically. - -Note that Harmony merges its dependencies into `0Harmony.dll` when compiled in release mode. To use -a debug build of Harmony, you'll need to manually copy those dependencies into your game's -`smapi-internal` folder. +### Custom Harmony build +SMAPI uses [a custom build of Harmony](https://github.com/Pathoschild/Harmony#readme), which is +included in the `build` folder. To use a different build, just replace `0Harmony.dll` in that +folder. ## Release notes See [release notes](../release-notes.md). -- cgit From b32cad4046916344665c67923482db09cacb366f Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sat, 20 Jun 2020 11:13:23 -0400 Subject: add i18n schema to JSON validator --- docs/technical/web.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'docs/technical') diff --git a/docs/technical/web.md b/docs/technical/web.md index d21b87ac..50237bfe 100644 --- a/docs/technical/web.md +++ b/docs/technical/web.md @@ -110,8 +110,9 @@ Available schemas: format | schema URL ------ | ---------- -[SMAPI `manifest.json`](https://stardewvalleywiki.com/Modding:Modder_Guide/APIs/Manifest) | https://smapi.io/schemas/manifest.json -[Content Patcher `content.json`](https://github.com/Pathoschild/StardewMods/tree/develop/ContentPatcher#readme) | https://smapi.io/schemas/content-patcher.json +[SMAPI: `manifest.json`](https://stardewvalleywiki.com/Modding:Modder_Guide/APIs/Manifest) | https://smapi.io/schemas/manifest.json +[SMAPI: translations (`i18n` folder)](https://stardewvalleywiki.com/Modding:Modder_Guide/APIs/Translation) | https://smapi.io/schemas/i18n.json +[Content Patcher: `content.json`](https://github.com/Pathoschild/StardewMods/tree/develop/ContentPatcher#readme) | https://smapi.io/schemas/content-patcher.json ## Web API ### Overview -- cgit From cb9ff7019995eff92104703f097856d2523e02ce Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sat, 20 Jun 2020 12:42:31 -0400 Subject: prepare for release --- docs/technical/smapi.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs/technical') diff --git a/docs/technical/smapi.md b/docs/technical/smapi.md index 5d550cfc..3cb450ae 100644 --- a/docs/technical/smapi.md +++ b/docs/technical/smapi.md @@ -81,8 +81,8 @@ To prepare a crossplatform SMAPI release, you'll need to compile it on two platf [crossplatforming info](https://stardewvalleywiki.com/Modding:Modder_Guide/Test_and_Troubleshoot#Testing_on_all_platforms) on the wiki for the first-time setup. -1. Update the version number in `.root/build/common.targets` and `Constants::Version`. Make sure - you use a [semantic version](https://semver.org). Recommended format: +1. Update the version numbers in `build/common.targets`, `Constants`, and the `manifest.json` for + bundled mods. Make sure you use a [semantic version](https://semver.org). Recommended format: build type | format | example :--------- | :----------------------- | :------ -- cgit