Mike 1 год назад
Родитель
Сommit
44c696df65
11 измененных файлов с 76 добавлено и 138 удалено
  1. 1 1
      cmd/config_generator/main.go
  2. 1 1
      cmd/server/main.go
  3. 1 1
      config/ras.service
  4. 6 30
      docs/BUILD.md
  5. 2 3
      docs/CLIENT.md
  6. 3 5
      docs/CLIENT_ICQ.md
  7. 1 1
      docs/LINUX.md
  8. 6 6
      docs/MACOS.md
  9. 20 36
      docs/RELEASE.md
  10. 15 13
      docs/SYSTEMD.md
  11. 20 41
      docs/WINDOWS.md

+ 1 - 1
cmd/config_generator/main.go

@@ -1,7 +1,7 @@
 // This program generates env config scripts from config.Config struct tags for
 // unix and windows platforms.
 // Usage: go run ./cmd/config_generator [platform] [filename]
-// Example: go run ./cmd/config_generator windows settings.bat
+// Example: go run ./cmd/config_generator unix settings.env
 package main
 
 import (

+ 1 - 1
cmd/server/main.go

@@ -47,7 +47,7 @@ func init() {
 
 	// Optionally populate environment variables with config file
 	if err := godotenv.Load(*cfgFile); err != nil {
-		fmt.Printf("Config file not found (%s). Moving on...\n", *cfgFile)
+		fmt.Printf("Config file (%s) not found, defaulting to env vars for app config...\n", *cfgFile)
 	} else {
 		fmt.Printf("Successfully loaded config file (%s)\n", *cfgFile)
 	}

+ 1 - 1
config/ras.service

@@ -17,7 +17,7 @@ Environment="DISABLE_AUTH=true"
 Environment="FAIL_FAST=false"
 Environment="LOG_LEVEL=info"
 Environment="OSCAR_HOST=127.0.0.1"
-ExecStart=/opt/ras/bin/retro_aim_server
+ExecStart=/opt/ras/retro_aim_server
 Restart=on-failure
 
 [Install]

+ 6 - 30
docs/BUILD.md

@@ -11,30 +11,8 @@ Before you can run Retro AIM Server, set up the following software dependencies.
 
 Since Retro AIM Server is written in go, install the latest version of [golang](https://go.dev/).
 
-If you're new to go, try [Visual Studio Code](https://code.visualstudio.com) wth the
-[go plugin](https://code.visualstudio.com/docs/languages/go) as your first IDE.
-
-### C Compiler
-
-A C compiler is required in order to build the sqlite dependency.
-
-#### macOS
-
-> If you have git, this is likely already set up on your machine.
-
-```shell
-xcode-select --install
-```
-
-#### Linux (Ubuntu)
-
-```shell
-sudo apt install build-essential
-```
-
-#### Windows
-
-Install the [tdm-gcc compiler](https://jmeubank.github.io/tdm-gcc/).
+If you're new to go, try [Visual Studio Code](https://code.visualstudio.com) wth the [go plugin](https://code.visualstudio.com/docs/languages/go)
+as your first IDE.
 
 ### Mockery (optional)
 
@@ -71,8 +49,7 @@ go build -o retro_aim_server ./cmd/server
 To run the binary with the settings file:
 
 ```shell
-source config/settings.env
-./retro_aim_server
+./retro_aim_server -config config/settings.env
 ```
 
 ## Testing
@@ -86,7 +63,6 @@ go test -race ./...
 
 ## Config File Generation
 
-The config files `config/settings.bat` and `config/settings.env` are generated programmatically from the
-[Config](../config/config.go) struct using `go generate`. If you want to add or remove application configuration
-options, first edit the Config struct and then generate the configuration files by running `make config` from the
-project root. Do not edit the config files by hand.
+The config file `config/settings.env` is generated programmatically from the [Config](../config/config.go) struct using
+`go generate`. If you want to add or remove application configuration options, first edit the Config struct and then
+generate the configuration files by running `make config` from the project root. Do not edit the config files by hand.

+ 2 - 3
docs/CLIENT.md

@@ -20,8 +20,7 @@ Windows AIM versions 5.0-5.1.3036 run perfectly well on [Wine](https://www.wineh
 
 Windows AIM can run on modern macOS without a VM, including the Apple Silicon platform!
 
-Get started with the
-[AIM for macOS project](https://github.com/mk6i/aim-for-macos).
+Get started with the [AIM for macOS project](https://github.com/mk6i/aim-for-macos).
 
 ### Windows 10/11
 
@@ -44,7 +43,7 @@ Once installed, configure AIM to connect to Retro AIM Server.
       <img width="662" alt="screenshot of AIM preferences window" src="https://github.com/mk6i/mkdb/assets/2894330/c7cfcaa4-8132-4b57-b5c9-7643c99cbda2">
    </p>
 3. In the `Host` field, enter the value of `OSCAR_HOST` found in `config/settings`. In the `Port` field, enter the
-   value of `AUTH_PORT` found in `config/settings`.
+   value of `AUTH_PORT` found in `config/settings.env`.
    <p>
       <img width="618" alt="Screen Shot 2024-03-29 at 11 22 19 PM" src="https://github.com/mk6i/mkdb/assets/2894330/da17c457-a773-4b82-b4ba-cb81f9a2e085">
    </p>

+ 3 - 5
docs/CLIENT_ICQ.md

@@ -117,7 +117,7 @@ using [WineskinServer](https://github.com/Gcenx/WineskinServer), a wrapper for W
 ## Post-install Configuration
 
 In this step, we'll replace ICQ's default server hostname with your Retro AIM
-Server's hostname in the Windows Registry. 
+Server's hostname in the Windows Registry.
 
 > Do not attempt to set the ICQ hostname via the registration Window. If you do
 > this, a bug will surface that prevents the client from "remembering" settings
@@ -149,7 +149,7 @@ Server's hostname in the Windows Registry.
 
     - Double-click the `Default Server Host` registry entry.
     - Set `Value data` to the value of `OSCAR_HOST` found in Retro AIM Server
-      configuration `config/settings.env` (Linux/macOS) or `config/settings.bat` (Windows).
+      configuration `config/settings.env`.
     - Click OK.
 
    <p align="center">
@@ -163,9 +163,7 @@ Server's hostname in the Windows Registry.
 
     - Double-click the `Default Server Port` registry entry.
     - Tick the `Decimal` radio button.
-    - Set `Value data` to the value of `AUTH_PORT` found in Retro AIM Server
-      configuration `config/settings.env` (Linux/macOS) or `config/settings.bat`
-      (Windows).
+    - Set `Value data` to the value of `AUTH_PORT` found in Retro AIM Server configuration `config/settings.env`.
     - Click OK.
 
    <p align="center">

+ 1 - 1
docs/LINUX.md

@@ -20,7 +20,7 @@ This guide explains how to download, configure and run Retro AIM Server on Linux
    Run the following command to launch Retro AIM Server:
 
    ```shell
-   ./run.sh
+   ./retro_aim_server
    ```
 
    Retro AIM Server will run in the terminal, ready to accept AIM client connections.

+ 6 - 6
docs/MACOS.md

@@ -7,7 +7,7 @@ This guide explains how to download, configure and run Retro AIM Server on macOS
    Grab the latest macOS release from the [Releases page](https://github.com/mk6i/retro-aim-server/releases) for your
    platform (Intel or Apple Silicon).
 
-   Because the Retro AIM Server `.app` has not been blessed by Apple, browsers such as Chrome may think it's a
+   Because the Retro AIM Server binary has not been blessed by Apple, browsers such as Chrome may think it's a
    "suspicious" file and block the download, in which case you need to explicitly opt in to downloading the untrusted
    file.
 
@@ -25,16 +25,16 @@ This guide explains how to download, configure and run Retro AIM Server on macOS
    Open a terminal and navigate to the extracted directory. This terminal will be used for the remaining steps.
 
    ```shell
-   cd ~/Downloads/retro_aim_server.0.1.0.macos.intel_x86_64/
+   cd ~/Downloads/retro_aim_server.0.11.0.macos.intel_x86_64/
    ```
 
 3. **Remove Quarantine**
 
-   Because the Retro AIM Server `.app` has not been blessed by Apple, macOS will quarantine the application. To proceed,
-   remove the quarantine flag from the `.app`. In the same terminal, run following command:
+   macOS will quarantine the Retro AIM Server binary because it has not been blessed by Apple. To remove the quarantine
+   flag from the binary, run following command in the same terminal,
 
    ```shell
-   sudo xattr -d com.apple.quarantine ./bin/retro_aim_server
+   sudo xattr -d com.apple.quarantine ./retro_aim_server
    ```
 
    > While the binaries are 100% safe, you can avoid the security concern by [building the application yourself](./BUILD.md).
@@ -57,7 +57,7 @@ This guide explains how to download, configure and run Retro AIM Server on macOS
    Run the following command to launch Retro AIM Server:
 
    ```shell
-   ./run.sh
+   ./retro_aim_server
    ```
 
    Retro AIM Server will run in the terminal, ready to accept AIM client connections.

+ 20 - 36
docs/RELEASE.md

@@ -5,47 +5,23 @@ This document explains how the Retro AIM Server release process works.
 ## Overview
 
 Retro AIM Server is built and released to Github using [GoReleaser](https://goreleaser.com/). The release process, which
-runs from a local computer (and not a CI/CD process) creates pre-built binaries for several platforms (Windows, MacOS,
+runs from a local computer (and not a CI/CD process) creates pre-built binaries for several platforms (Windows, macOS,
 Linux).
 
-GoReleaser runs in a Docker container for two important reasons:
-
-- Docker provides a hermetic environment that prevents build contamination from the host environment.
-- The Docker image [goreleaser-cross](https://github.com/goreleaser/goreleaser-cross) consolidates all the libraries
-  needed for cross-compilation in one place.
-    - Given that the application uses cgo, it's much easier to use a pre-built container to build the sqlite library
-      than to manually set up a C compiler on Mac/Windows/Linux etc.
+GoReleaser runs in a Docker container, which provides a hermetic environment that prevents build contamination from the
+host environment.
 
 ### Code Signing Policy
 
-Given the cost and complexity of code signing, this project only distributes unsigned binaries. This means that
-MacOS distrusts Retro AIM Server by default and quarantines the application when you open it.
+This project offers signed Windows binaries and does not currently offer signed macOS binaries. This means that macOS
+distrusts Retro AIM Server by default and quarantines the application when you open it.
 > If you don't want to bypass this security mechanism, you can [build the project yourself](./building) instead.
 
-### Windows Build Obfuscation
-
-Due to cost and complexity, none of the release artifacts are signed. One consequence of this is that Windows Defender
-falsely detects [the `.exe` as a virus](https://go.dev/doc/faq#virus) and auto-quarantines the file upon execution.
-
-We get around this by obfuscating the go binary at built time using [garble](https://github.com/burrowers/garble). In
-order to accomplish this, the project wraps GoReleaser and garble in a custom Dockerfile `Dockerfile.goreleaser`.
-
-The GoRelease-garble image must be built locally before running the release process.
-
 ## Release Procedure
 
 The following is the procedure that builds Retro AIM Server and uploads the build artifacts to a Github release.
 
-1. **Build Custom Docker Image**
-
-   Build the custom GoReleaser Docker image. Ensure that the latest version is set under `GO_RELEASER_CROSS_VERSION` in
-   the project Makefile.
-
-    ```sh
-    make goreleaser-docker
-    ```
-
-2. **Export Github Personal Access Token (PAT)**
+1. **Export Github Personal Access Token (PAT)**
 
    Export a Github Personal Access Token that has `write:packages` permissions for the Retro AIM Server repo.
 
@@ -53,7 +29,7 @@ The following is the procedure that builds Retro AIM Server and uploads the buil
     export GITHUB_TOKEN=...
     ```
 
-3. **Tag The Build**
+2. **Tag The Build**
 
    Tag the build using [semantic versioning](https://semver.org/).
     ```shell
@@ -61,7 +37,7 @@ The following is the procedure that builds Retro AIM Server and uploads the buil
     git push --tags
     ```
 
-4. **Dry-Run Release**
+3. **Dry-Run Release**
 
    Execute a dry-run build to make sure all the moving parts work together. Fix any problems that crop up before
    continuing.
@@ -70,11 +46,19 @@ The following is the procedure that builds Retro AIM Server and uploads the buil
    make release-dry-run
     ```
 
-5. **Release It!**
+4. **Release It!**
 
-   Now run the release process. Once its complete, a new [release](https://github.com/mk6i/retro-aim-server/releases)
-   should appear in Github with download artifacts attached.
+   Now run the release process. Once its complete, a private draft [release](https://github.com/mk6i/retro-aim-server/releases)
+   should appear with attached build artifacts.
 
     ```shell
    make release
-    ```
+    ```
+
+5. **Sign It!**
+
+   Download the Windows release, sign it, and re-upload the `.zip` to the draft release created in the previous step.
+
+6. **Publish It**
+
+   Publish the draft release.

+ 15 - 13
docs/SYSTEMD.md

@@ -1,12 +1,13 @@
 # Configuring Retro AIM Server With systemd
 
-This document details the configuration of Retro AIM Server to run as an unprivileged user with `systemd` managing it as a production service.
+This document details the configuration of Retro AIM Server to run as an unprivileged user with `systemd` managing it as
+a production service.
 
-1. ** Download Retro AIM Server**
+1. **Download Retro AIM Server**
 
    Grab the latest Linux release from the [releases page](https://github.com/mk6i/retro-aim-server/releases)
 
-2. ** Create the ras user and group **
+2. **Create the ras user and group**
 
    Run the following commands:
 
@@ -16,38 +17,39 @@ This document details the configuration of Retro AIM Server to run as an unprivi
    $ sudo mkdir -p /var/ras
    ```
 
-3. ** Extract the archive **
+3. **Extract the archive**
 
    Extract the archive using the usual `tar` invocation, and move the extracted contents into `/opt/ras`
 
-4. ** Set Ownership and Permissions **
+4. **Set Ownership and Permissions**
 
    ```shell
    $ sudo chown -R ras:ras /opt/ras
    $ sudo chmod -R o-rx /opt/ras
    ```
 
-5. ** Copy the systemd service **
+5. **Copy the systemd service**
 
    Place the `ras.service` file in `/etc/systemd/system`
 
-6. ** Reload systemd **
+6. **Reload systemd**
 
    ```shell
    $ sudo systemctl daemon-reload
    ```
 
-7. ** Enable and start the service **
+7. **Enable and start the service**
 
-  ```shell
-  $ sudo systemctl enable --now ras.service
-  ```
+   ```shell
+   $ sudo systemctl enable --now ras.service
+   ```
 
-8. ** Make sure the service is running **
+8. **Make sure the service is running**
 
    ```shell
    $ sudo systemctl status ras.service
    $ sudo journalctl -xeu ras.service
    ```
 
-Note that the `systemd` service defines the configuration for Retro AIM Server directly, bypassing the usual `run.sh` script and `settings.env`. Customizations may be performed in `/etc/systemd/system/ras.service`.
+Note that the `systemd` service defines the configuration for Retro AIM Server directly, bypassing the `settings.env`
+config. Customizations may be performed in `/etc/systemd/system/ras.service`.

+ 20 - 41
docs/WINDOWS.md

@@ -4,65 +4,44 @@ This guide explains how to download, configure and run Retro AIM Server on Windo
 
 1. **Download Retro AIM Server**
 
-   Grab the latest Windows release from the [Releases page](https://github.com/mk6i/retro-aim-server/releases).
+   Download the latest Windows release from the [Releases page](https://github.com/mk6i/retro-aim-server/releases) and
+   extract the `.zip` archive, which contains the application and a configuration file `settings.env`.
 
-   Because the Retro AIM Server `.exe` has not been blessed by Microsoft, browsers such as Chrome may think it's a
-   "suspicious" file and block the download, in which case you need to explicitly opt in to downloading the untrusted
-   file.
+2. **Configure Server Address**
 
-    <p align="center">
-      <img alt="screenshot of a chrome prompt showing a blocked download" src="https://github.com/mk6i/retro-aim-server/assets/2894330/6bf2fd79-0a42-48b2-a695-d777259a3603">
-    </p>
-
-   In some cases, Chrome may outright block the download. 
-   
-   <p align="center">
-     <img alt="screenshot of a chrome blocking multiple download attempts" src="https://github.com/ukozi/retro-aim-server/assets/3391773/b3a9f5fc-bc5e-4b00-bc73-f71083af816a">
-   </p>
-
-   > While the binaries are 100% safe, you can avoid the security concern by [building the application yourself](./BUILD.md).
-   We do not provide signed binaries because of the undue cost and complexity.
-
-   You can alternatively download the file using a Powershell command:
-   ```powershell
-   Invoke-WebRequest -Uri "<insert link to version you wish to download here>" -OutFile "retro_aim_server.zip"
-   ```
-   and exclude the file or directory from Defender.
-   
-   Once downloaded, extract the `.zip` archive, which contains the application and a configuration file `settings.bat`.
-
-3. **Configure Server Address**
-
-   Open `settings.bat` (right-click, `edit in notepad`) and set `OSCAR_HOST` to a hostname that AIM clients can connect
+   Open `settings.env` (right-click, `edit in notepad`) and set `OSCAR_HOST` to a hostname that AIM clients can connect
    to. The default setting is `127.0.0.1`, which is enough to connect clients on the same PC.
 
    In order to connect AIM clients on your LAN (including VMs with bridged networking), you can find the appropriate IP
    address by running `ipconfig` from the Command Prompt.
 
-4. **Start the Application**
+3. **Start the Application**
 
-   Open `run.cmd` to launch Retro AIM Server.
+   Launch `retro-aim-server.exe` to start Retro AIM Server.
 
-   Because Retro AIM Server has not been blessed by Microsoft, Windows will flag the application as a security risk the
-   first time you run it. You'll be presented with a `Microsoft Defender SmartScreen` warning prompt that gives you the
-   option to run the blocked application.
+   Because Retro AIM Server has not built up enough reputation with Microsoft, Windows will flag the application as a
+   security risk the first time you run it. You'll be presented with a `Microsoft Defender SmartScreen` warning prompt
+   that gives you the option to run the blocked application.
 
    To proceed, click `More Options`, then `Run anyway`.
 
     <p align="center">
-      <img alt="of screenshot microsoft defender smartscreen prompt" src="https://github.com/mk6i/retro-aim-server/assets/2894330/9ab0966b-d5dd-4b70-ba16-483e5c458f89">
-      <img alt="of screenshot microsoft defender smartscreen prompt" src="https://github.com/mk6i/retro-aim-server/assets/2894330/5d4106c6-0ce6-4d4f-9260-e9bbb777c770">
+      <img alt="screenshot of microsoft defender smartscreen prompt" src="https://github.com/mk6i/retro-aim-server/assets/2894330/9ab0966b-d5dd-4b70-ba16-483e5c458f89">
+      <img alt="screenshot of microsoft defender smartscreen prompt" src="https://github.com/mk6i/retro-aim-server/assets/2894330/5d4106c6-0ce6-4d4f-9260-e9bbb777c770">
     </p>
 
-   > While the binaries are 100% safe, you can avoid the security concern by [building the application yourself](./BUILD.md).
-   We do not provide signed binaries because of the undue cost and complexity.
+   Click `Allow` if you get a Windows Defender Firewall alert.
+
+    <p align="center">
+      <img alt="screenshot of microsoft defender firewall alert" src="https://github.com/user-attachments/assets/9ec6cbc4-5445-43bd-a64e-512fd15f8f0b">
+    </p>
 
-   Retro AIM Server will open in a Command Prompt, ready to accept AIM client connections.
+   Retro AIM Server will open in a terminal, ready to accept AIM client connections.
 
-5. **Test**
+4. **Test**
 
    To do a quick sanity check, start an AIM client, sign in to the server, and send yourself an instant message.
-   Configure the AIM client to connect to the host set in `OSCAR_HOST` in `settings.bat`. (If you didn't change the
+   Configure the AIM client to connect to the host set in `OSCAR_HOST` in `settings.env`. (If you didn't change the
    config, the address is `127.0.0.1`.)
 
    See the [Client Configuration Guide](./CLIENT.md) for more detail on setting up the AIM client.
@@ -70,5 +49,5 @@ This guide explains how to download, configure and run Retro AIM Server on Windo
    By default, you can enter *any* screen name and password at the AIM sign-in screen to auto-create an account.
 
    > Account auto-creation is meant to be a convenience feature for local development. In a production deployment, you
-   should set `DISABLE_AUTH=false` in `settings.bat` to enforce account authentication. User accounts can be created via
+   should set `DISABLE_AUTH=false` in `settings.env` to enforce account authentication. User accounts can be created via
    the [Management API](../README.md#-management-api).