2
0

10 Commits

Author SHA1 Message Date
Sergio Padrino
31bc7170f6 Bump version to 0.9.3 2021-02-18 10:07:10 +01:00
Sergio Padrino
9cc5d4f9ee Document the release process 2021-02-18 10:07:02 +01:00
Sergio Padrino
731c53d97f Merge pull request #2 from philipturnbull/buffer-off-by-one
Reserve space for the NUL terminator
2021-02-18 00:07:25 -08:00
Phil Turnbull
6669833e3d Reserve space for the NUL terminator
If we read exactly `BUFFER_LENGTH` characters then we will overflow the buffer
when writing the NUL terminator. We need to reserve one extra character for the
NUL terminator.
2021-02-17 18:09:31 -05:00
Sergio Padrino
ca8d10fddb Merge pull request #1 from desktop/releases/0.9.2 2021-02-17 02:50:24 -08:00
Sergio Padrino
c77487f645 Bump package version to 0.9.2 2021-02-17 11:27:56 +01:00
Sergio Padrino
88065c4f2a Use specific OS versions in CI scripts 2021-02-17 11:09:05 +01:00
Sergio Padrino
6ac5a9240d Add more compilation flags to improve security 2021-02-17 11:03:00 +01:00
Sergio Padrino
ca0c849738 Bump package version to 0.9.1 2021-02-02 14:57:28 +01:00
Sergio Padrino
8c44f4b5ea Remove DESKTOP_PORT from the valid env vars
DESKTOP_PORT is only for internal usage, no need to forward it.
2021-02-02 14:57:02 +01:00
6 changed files with 52 additions and 14 deletions

View File

@@ -17,13 +17,13 @@ jobs:
fail-fast: false
matrix:
node: [12.14.1]
os: [macos-latest, windows-latest, ubuntu-latest]
os: [macos-10.14, windows-2019, ubuntu-18.04]
include:
- os: macos-latest
- os: macos-10.14
friendlyName: macOS
- os: windows-latest
- os: windows-2019
friendlyName: Windows
- os: ubuntu-latest
- os: ubuntu-18.04
friendlyName: Linux
steps:
- uses: actions/checkout@v2

View File

@@ -13,12 +13,25 @@
'xcode_settings': {
'OTHER_CFLAGS': [
'-Wall',
'-Werror'
],
'-Werror',
'-Werror=format-security',
'-fPIC',
'-D_FORTIFY_SOURCE=1',
'-fstack-protector-strong'
]
},
'cflags!': [
'-Wall',
'-Werror',
'-fPIC',
'-pie',
'-D_FORTIFY_SOURCE=1',
'-fstack-protector-strong',
'-Werror=format-security'
],
'ldflags!': [
'-z relro',
'-z now'
],
'conditions': [
['OS=="win"', {

24
docs/releases.md Normal file
View File

@@ -0,0 +1,24 @@
# Releases
All releases are published using GitHub releases. Anyone with push access to the
repository can create a new release.
### Release Process
1. Create a branch named `releases/X.Y.Z`, where `X.Y.Z` is the version you want
to release.
1. Update the `version` field in the `package.json` with the new version you're
about to release.
1. Open a Pull Request for that branch.
1. Once the branch is approved, `git tag vX.Y.Z` the version you wish to
publish. **Important:** the version in the tag name must be preceeded by a
`v`.
1. `git push --follow-tags` to ensure all new commits (and the tag) are pushed
to the remote. Pushing the tag will start the release process.
1. Wait a few minutes for the build to finish (look for the build in
https://github.com/desktop/desktop-trampoline/actions)
1. Once the build is complete it will create a new release with all of the
assets and suggested release notes.
1. Update the changelog to whatever makes sense for this release. It should be
focused on user-facing changes.
1. Confirm all assets are uploaded for all the supported platforms.

View File

@@ -1,6 +1,6 @@
{
"name": "desktop-trampoline",
"version": "0.9.0",
"version": "0.9.3",
"main": "index.js",
"keywords": [],
"author": "",

View File

@@ -17,10 +17,9 @@ if (writeSocket(socket, dataString, strlen(dataString) + 1) != 0) { \
// This is a list of valid environment variables that GitHub Desktop might
// send or expect to receive.
#define NUMBER_OF_VALID_ENV_VARS 5
#define NUMBER_OF_VALID_ENV_VARS 4
static const char *sValidEnvVars[NUMBER_OF_VALID_ENV_VARS] = {
"DESKTOP_TRAMPOLINE_IDENTIFIER",
"DESKTOP_PORT",
"DESKTOP_TRAMPOLINE_TOKEN",
"DESKTOP_USERNAME",
"DESKTOP_ENDPOINT",
@@ -33,8 +32,8 @@ int isValidEnvVar(char *env) {
// Make sure that not only the passed env var string starts with the
// candidate contesnts, but also that there is a '=' character right after:
// Valid: "DESKTOP_PORT=50"
// Not valid: "DESKTOP_PORT_SOMETHING=50"
// Valid: "DESKTOP_USERNAME=sergiou87"
// Not valid: "DESKTOP_USERNAME_SOMETHING=sergiou87"
if (strncmp(env, candidate, strlen(candidate)) == 0
&& strlen(env) > strlen(candidate)
&& env[strlen(candidate)] == '=') {
@@ -103,7 +102,7 @@ int runTrampolineClient(SOCKET *outSocket, int argc, char **argv, char **envp) {
// TODO: send stdin stuff?
char buffer[BUFFER_LENGTH];
char buffer[BUFFER_LENGTH + 1];
size_t totalBytesRead = 0;
ssize_t bytesRead = 0;

View File

@@ -30,6 +30,7 @@ describe('desktop-trampoline', () => {
// done forwarding data.
socket.end()
})
server.unref()
const startTrampolineServer = async () => {
return new Promise((resolve, reject) => {
@@ -42,9 +43,10 @@ describe('desktop-trampoline', () => {
const port = await startTrampolineServer()
const env = {
DESKTOP_PORT_FAKE: 32123,
DESKTOP_TRAMPOLINE_IDENTIFIER: '123456',
DESKTOP_PORT: port,
DESKTOP_USERNAME: 'sergiou87',
DESKTOP_USERNAME_FAKE: 'fake-user',
INVALID_VARIABLE: 'foo bar',
}
const opts = { env }
@@ -57,7 +59,7 @@ describe('desktop-trampoline', () => {
const outputEnv = output.slice(3)
expect(outputEnv).toHaveLength(2)
expect(outputEnv).toContain('DESKTOP_TRAMPOLINE_IDENTIFIER=123456')
expect(outputEnv).toContain(`DESKTOP_PORT=${port}`)
expect(outputEnv).toContain(`DESKTOP_USERNAME=sergiou87`)
server.close()
})