Skip to content

Commit

Permalink
Update "GET SERVERPREFS" command to get the https tunneling setting f…
Browse files Browse the repository at this point in the history
…or FileMaker Pro and FileMaker Go (#46)
  • Loading branch information
matsuo committed Nov 16, 2024
1 parent dbec9ae commit 4f27950
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ Features
- FileMaker Admin API PKI Authentication
- View and change the settings for the persistent cache (for FileMaker Server 2024)
- View and change the setting for blocking new users (for FileMaker Server 2024)
- View the HTTPS tunneling setting for FileMaker Pro and FileMaker Go (for FileMaker Server 2024 (21.1))
- View and change the "Only open last opened databases" setting (for FileMaker Server 2024 (21.1))

Supported Servers
Expand Down
16 changes: 15 additions & 1 deletion fmcsadmin.go
Original file line number Diff line number Diff line change
Expand Up @@ -1085,6 +1085,7 @@ func (c *cli) Run(args []string) int {
case "authenticatedstream", "parallelbackupenabled":
case "persistcacheenabled", "syncpersistcache", "databaseserverautorestart":
case "blocknewusersenabled":
case "enablehttpprotocolnetwork":
case "onlyopenlastopeneddatabases":
default:
exitStatus = 10001
Expand Down Expand Up @@ -1140,6 +1141,8 @@ func (c *cli) Run(args []string) int {
printOptions = append(printOptions, "databaseserverautorestart")
case "blocknewusersenabled":
printOptions = append(printOptions, "blocknewusersenabled")
case "enablehttpprotocolnetwork":
printOptions = append(printOptions, "enablehttpprotocolnetwork")
case "onlyopenlastopeneddatabases":
printOptions = append(printOptions, "onlyopenlastopeneddatabases")
default:
Expand Down Expand Up @@ -1171,6 +1174,7 @@ func (c *cli) Run(args []string) int {
printOptions = append(printOptions, "blocknewusersenabled")
}
if !usingCloud && version >= 21.1 {
printOptions = append(printOptions, "enablehttpprotocolnetwork")
printOptions = append(printOptions, "onlyopenlastopeneddatabases")
}
}
Expand Down Expand Up @@ -1236,7 +1240,7 @@ func (c *cli) Run(args []string) int {
}
}

if option == "onlyopenlastopeneddatabases" {
if option == "enablehttpprotocolnetwork" || option == "onlyopenlastopeneddatabases" {
if usingCloud {
// for Claris FileMaker Cloud
exitStatus = 3
Expand Down Expand Up @@ -4111,6 +4115,12 @@ func getServerGeneralConfigurations(urlString string, token string, printOptions
}
}

if option == "enablehttpprotocolnetwork" {
if version >= 21.1 {
getServerSettingAsBool(strings.Replace(urlString, "/server/config/general", "/fmclients/httpstunneling", 1), token, []string{option})
}
}

if option == "onlyopenlastopeneddatabases" {
if version >= 21.1 {
if onlyOpenLastOpenedDatabases {
Expand Down Expand Up @@ -4195,6 +4205,8 @@ func getServerSettingAsBool(urlString string, token string, printOptions []strin
err = scan.ScanTree(v, "/response/parallelBackupEnabled", &enabled)
} else if u.Path == path.Join(getAPIBasePath(), "server", "config", "blocknewusers") {
err = scan.ScanTree(v, "/response/blockNewUsers", &enabled)
} else if u.Path == path.Join(getAPIBasePath(), "fmclients", "httpstunneling") {
err = scan.ScanTree(v, "/response/enableHTTPSTunneling", &enabled)
}

enabledStr = "false"
Expand All @@ -4214,6 +4226,8 @@ func getServerSettingAsBool(urlString string, token string, printOptions []strin
fmt.Println("ParallelBackupEnabled = " + enabledStr + " [default: false] ")
case "blocknewusersenabled":
fmt.Println("BlockNewUsersEnabled = " + enabledStr + " [default: false] ")
case "enablehttpprotocolnetwork":
fmt.Println("EnableHttpProtocolNetwork = " + enabledStr + " [default: false] ")
case "onlyopenlastopeneddatabases":
fmt.Println("OnlyOpenLastOpenedDatabases = " + enabledStr + " [default: false] ")
default:
Expand Down
1 change: 1 addition & 0 deletions fmcsadmin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1164,6 +1164,7 @@ func TestGetFlags(t *testing.T) {
* fmcsadmin get serverprefs SyncPersistCache
* fmcsadmin get serverprefs DatabaseServerAutoRestart
* fmcsadmin get serverprefs BlockNewUsersEnabled
* fmcsadmin get serverprefs EnableHttpProtocolNetwork
* fmcsadmin get serverprefs OnlyOpenLastOpenedDatabases
* fmcsadmin --fqdn example.jp get backuptime
* fmcsadmin --fqdn example.jp -u USERNAME get backuptime
Expand Down
5 changes: 3 additions & 2 deletions release-notes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ This software is distributed under the Apache License, Version 2.0, see LICENSE.
Version: 2.3.0-dev (in development)
- Add support for Claris FileMaker Server 2024 (21.1).
- Add support for macOS Sequoia 15.
- Update "GET SERVERPREFS" command to view the "Only open last opened databases" setting for Claris FileMaker Server 2024 (21.1). (Usage: "fmcsadmin get serverprefs OnlyOpenLastOpenedDatabases")
- Update "SET SERVERPREFS" command to open only the databases that were opened when the database server was last shut down for Claris FileMaker Server 2024 (21.1). (Usage: "fmcsadmin set serverprefs OnlyOpenLastOpenedDatabases=true")
- Update "GET SERVERPREFS" command to view the "Only open last opened databases" setting. (Usage: "fmcsadmin get serverprefs OnlyOpenLastOpenedDatabases")
- Update "SET SERVERPREFS" command to open only the databases that were opened when the database server was last shut down. (Usage: "fmcsadmin set serverprefs OnlyOpenLastOpenedDatabases=true")
- Update "GET SERVERPREFS" command to get the https tunneling setting for FileMaker Pro and FileMaker Go. (Usage: "fmcsadmin get serverprefs EnableHttpProtocolNetwork")
- Built with Go 1.23.
- [INFO] Drop support for Claris FileMaker Server 19.6.
- [INFO] Drop support for macOS Monterey 12.
Expand Down

0 comments on commit 4f27950

Please sign in to comment.