diff --git a/code-server.kvp b/code-server.kvp new file mode 100644 index 000000000..fda28bb08 --- /dev/null +++ b/code-server.kvp @@ -0,0 +1,108 @@ +Meta.DisplayName=code-server +Meta.Description=Self-hosted VS Code in the browser +Meta.OS=Linux +Meta.AarchSupport=Native +Meta.Arch=All +Meta.Author=juzigu40-ui +Meta.URL=https://github.com/coder/code-server +Meta.DisplayImageSource=url:https://avatars.githubusercontent.com/u/95932066?s=200&v=4 +Meta.EndpointURIFormat=http://{ip}:{GenericModule.App.Ports.$ServerPort} +Meta.ConfigManifest=code-serverconfig.json +Meta.MetaConfigManifest=code-servermetaconfig.json +Meta.ConfigRoot=code-server.kvp +Meta.MinAMPVersion=2.6.0.0 +Meta.SpecificDockerImage=cubecoders/ampbase:debian +Meta.DockerRequired=False +Meta.DockerBaseReadOnly=False +Meta.ContainerPolicy=Supported +Meta.ContainerPolicyReason= +Meta.ExtraSetupStepsURI= +Meta.Prerequisites=[] +Meta.ExtraContainerPackages=[] +Meta.ConfigReleaseState=NotSpecified +Meta.NoCommercialUsage=False +Meta.ConfigVersion=1 +Meta.ReleaseNotes= +Meta.BreakingReleaseNotes= +Meta.AppConfigId=7d3f9192-9467-4c0d-b003-d0d536ee2534 +Meta.ImportableExtensions=[] +Meta.AppIsMultiIPAware=True +App.DisplayName=code-server +App.RootDir=./code-server/ +App.BaseDirectory=./code-server/server/ +App.SteamWorkshopDownloadLocation= +App.ExecutableWin= +App.ExecutableLinux=server/bin/code-server +App.WorkingDir=server +App.LinuxCommandLineArgs= +App.WindowsCommandLineArgs= +App.CommandLineArgs=--bind-addr {{$ApplicationIPBinding}}:{{$ServerPort}} --auth password --disable-telemetry --disable-update-check --user-data-dir "{{$FullBaseDir}}data" --extensions-dir "{{$FullBaseDir}}extensions" {{CustomArgs}} "{{$FullBaseDir}}workspace" +App.UseLinuxIOREDIR=False +App.AppSettings={} +App.EnvironmentVariables={"PASSWORD":"{{$RemoteAdminPassword}}","HOME":"{{$FullBaseDir}}home"} +App.CommandLineParameterFormat=--{0}={1} +App.CommandLineParameterDelimiter= +App.ExitMethod=OS_CLOSE +App.ExitTimeout=30 +App.ExitString= +App.ExitFile=app_exit.lck +App.HasWriteableConsole=False +App.HasReadableConsole=True +App.UDPLogger=False +App.SupportsLiveSettingsChanges=False +App.LiveSettingChangeCommandFormat= +App.ForceIPBinding=False +App.SupportsIPv6=False +App.ApplicationIPBinding=0.0.0.0 +App.Ports=@IncludeJson[code-serverports.json] +App.AdminPortRef=0 +App.PrimaryApplicationPortRef=ServerPort +App.UniversalSleepApplicationUDPPortRef=0 +App.UniversalSleepSteamQueryPortRef=0 +App.MaxUsers=0 +App.UseRandomAdminPassword=True +App.PersistRandomPassword=True +App.RemoteAdminPassword= +App.AdminMethod=STDIO +App.IgnoreSTDOUTAfterRCON=False +App.AdminLoginTransform=None +App.LoginTransformPrefix= +App.RCONConnectDelaySeconds=5 +App.RCONConnectRetrySeconds=5 +App.RCONHeartbeatMinutes=0 +App.RCONHeartbeatCommand=ping +App.TelnetLoginFormat={0} +App.UpdateSources=@IncludeJson[code-serverupdates.json] +App.PreStartStages=[] +App.UserActions=[] +App.ForceUpdate=False +App.ForceUpdateReason= +App.Compatibility=None +App.SteamUpdateAnonymousLogin=False +App.SteamForceLoginPrompt=False +App.RapidStartup=False +App.SmartExcludeExemptions=["*.json","*.yaml","*.yml","*.toml","*.kvp"] +App.SmartExcludeSupported=True +App.DumpFullChildProcessTree=False +App.MonitorChildProcessName= +App.MonitorDirectChildOnly=False +App.SupportsUniversalSleep=False +App.WakeupMode=Any +App.ApplicationReadyMode=RegexMatch +Console.FilterMatchRegex= +Console.FilterMatchReplacement= +Console.ThrowawayMessageRegex=^$ +Console.AppReadyRegex=^\[[^\]]+\] info\s+HTTP server listening on http://.*$ +Console.UserJoinRegex=^$ +Console.UserLeaveRegex=^$ +Console.UserChatRegex=^$ +Console.UpdateAvailableRegex=^$ +Console.MetricsRegex= +Console.SuppressLogAtStart=False +Console.UserActions={} +Limits.SleepMode=False +Limits.SleepOnStart=False +Limits.SleepDelayMinutes=5 +Limits.DozeDelay=2 +Limits.AutoRetryCount=2 +Limits.SleepStartThresholdSeconds=25 diff --git a/code-serverconfig.json b/code-serverconfig.json new file mode 100644 index 000000000..00970c55b --- /dev/null +++ b/code-serverconfig.json @@ -0,0 +1,50 @@ +[ + { + "DisplayName": "code-server Version", + "Category": "code-server:web", + "Subcategory": "Server:download:1", + "Description": "Sets the code-server release version to install. Empty = latest stable release tag from GitHub.", + "Keywords": "code-server,version,release", + "FieldName": "ServerVersion", + "InputType": "text", + "ParamFieldName": "ServerVersion", + "DefaultValue": "", + "Placeholder": "v4.109.5", + "EnumValues": {} + }, + { + "DisplayName": "Additional code-server Arguments", + "Category": "code-server:web", + "Subcategory": "Server:runtime:2", + "Description": "Optional extra flags appended to the code-server start command.", + "Keywords": "custom,args,flags", + "FieldName": "CustomArgs", + "InputType": "text", + "ParamFieldName": "CustomArgs", + "DefaultValue": "", + "Placeholder": "--disable-workspace-trust", + "EnumValues": {} + }, + { + "DisplayName": "Server Binding", + "Category": "code-server:web", + "Subcategory": "Server:runtime:2", + "Description": "Uses the AMP Application IP Binding for the web listener.", + "Keywords": "binding,ip,address", + "FieldName": "$ApplicationIPBinding", + "InputType": "hidden", + "ParamFieldName": "ApplicationIPBinding", + "EnumValues": {} + }, + { + "DisplayName": "Web UI Password", + "Category": "code-server:web", + "Subcategory": "Access:auth:3", + "Description": "Generated by AMP and passed to code-server as the PASSWORD environment variable.", + "Keywords": "password,auth", + "FieldName": "$RemoteAdminPassword", + "InputType": "hidden", + "ParamFieldName": "RemoteAdminPassword", + "EnumValues": {} + } +] diff --git a/code-servermetaconfig.json b/code-servermetaconfig.json new file mode 100644 index 000000000..fe51488c7 --- /dev/null +++ b/code-servermetaconfig.json @@ -0,0 +1 @@ +[] diff --git a/code-serverports.json b/code-serverports.json new file mode 100644 index 000000000..9b14b4baf --- /dev/null +++ b/code-serverports.json @@ -0,0 +1,9 @@ +[ + { + "Protocol": "TCP", + "Port": 8080, + "Ref": "ServerPort", + "Name": "Web UI", + "Description": "Primary HTTP port used by code-server" + } +] diff --git a/code-serverupdates.json b/code-serverupdates.json new file mode 100644 index 000000000..d8a2322df --- /dev/null +++ b/code-serverupdates.json @@ -0,0 +1,28 @@ +[ + { + "UpdateStageName": "Prepare code-server directories", + "UpdateSourcePlatform": "Linux", + "UpdateSource": "Executable", + "UpdateSourceData": "/bin/bash", + "UpdateSourceArgs": "-c \"cd code-server && mkdir -p server data extensions workspace home\"", + "SkipOnFailure": false + }, + { + "UpdateStageName": "code-server Download", + "UpdateSourcePlatform": "Linux", + "UpdateSourceArch": "x86_64", + "UpdateSource": "Executable", + "UpdateSourceData": "/bin/bash", + "UpdateSourceArgs": "-c \"ServerVersion=\\\"{{ServerVersion}}\\\"; cd code-server; mkdir -p server data extensions workspace home; if [[ -x server/bin/code-server ]]; then InstalledVersion=$(server/bin/code-server --version | head -n1 | tr -d '\\r'); else InstalledVersion=\\\"\\\"; fi; [[ -z \\\"$ServerVersion\\\" ]] && ServerVersion=$(wget -qO- https://api.github.com/repos/coder/code-server/releases/latest | jq -r .tag_name); VersionNoV=\\\"${ServerVersion#v}\\\"; if [[ ! \\\"$ServerVersion\\\" =~ ^v[0-9]+\\.[0-9]+\\.[0-9]+$ ]]; then echo \\\"Invalid code-server version format specified\\\" && exit 1; elif [[ \\\"$InstalledVersion\\\" == \\\"$VersionNoV\\\" ]]; then echo \\\"code-server $ServerVersion already installed. Skipping\\\" && exit 0; else [[ -f code-server.tar.gz ]] && rm -f code-server.tar.gz >/dev/null 2>&1; wget -qO code-server.tar.gz https://github.com/coder/code-server/releases/download/$ServerVersion/code-server-$VersionNoV-linux-amd64.tar.gz || { echo \\\"Download failed from GitHub. Aborting\\\"; exit 1; }; rm -rf server/* >/dev/null 2>&1 && tar -xzf code-server.tar.gz -C server --strip-components=1 >/dev/null 2>&1 && rm -f code-server.tar.gz >/dev/null 2>&1 && chmod +x server/bin/code-server && echo \\\"code-server $ServerVersion downloaded\\\"; fi\"", + "SkipOnFailure": false + }, + { + "UpdateStageName": "code-server Download", + "UpdateSourcePlatform": "Linux", + "UpdateSourceArch": "aarch64", + "UpdateSource": "Executable", + "UpdateSourceData": "/bin/bash", + "UpdateSourceArgs": "-c \"ServerVersion=\\\"{{ServerVersion}}\\\"; cd code-server; mkdir -p server data extensions workspace home; if [[ -x server/bin/code-server ]]; then InstalledVersion=$(server/bin/code-server --version | head -n1 | tr -d '\\r'); else InstalledVersion=\\\"\\\"; fi; [[ -z \\\"$ServerVersion\\\" ]] && ServerVersion=$(wget -qO- https://api.github.com/repos/coder/code-server/releases/latest | jq -r .tag_name); VersionNoV=\\\"${ServerVersion#v}\\\"; if [[ ! \\\"$ServerVersion\\\" =~ ^v[0-9]+\\.[0-9]+\\.[0-9]+$ ]]; then echo \\\"Invalid code-server version format specified\\\" && exit 1; elif [[ \\\"$InstalledVersion\\\" == \\\"$VersionNoV\\\" ]]; then echo \\\"code-server $ServerVersion already installed. Skipping\\\" && exit 0; else [[ -f code-server.tar.gz ]] && rm -f code-server.tar.gz >/dev/null 2>&1; wget -qO code-server.tar.gz https://github.com/coder/code-server/releases/download/$ServerVersion/code-server-$VersionNoV-linux-arm64.tar.gz || { echo \\\"Download failed from GitHub. Aborting\\\"; exit 1; }; rm -rf server/* >/dev/null 2>&1 && tar -xzf code-server.tar.gz -C server --strip-components=1 >/dev/null 2>&1 && rm -f code-server.tar.gz >/dev/null 2>&1 && chmod +x server/bin/code-server && echo \\\"code-server $ServerVersion downloaded\\\"; fi\"", + "SkipOnFailure": false + } +]