ser 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/LICENSE.txt +21 -0
- data/README.md +127 -0
- data/exe/ser +11 -0
- data/lib/ser/version.rb +5 -0
- data/lib/ser.rb +6 -0
- metadata +58 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: c5345e11f6ed095517bc354c22cf36159bef1ffcaa14c4a5f1f679c3aacbaf56
|
|
4
|
+
data.tar.gz: a926ba1d4f811fd81b4d55ccac291658e2f5632b0e37fee78036e5a006a984d0
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 979c901457369e1534acd00cadd99544c50d12a2c6a24a1e8457a67bb308b5532d51e33e0031f3976ba54b509ab8e9d6c01e55c4eb7bff7288c4ec3ff77e3830
|
|
7
|
+
data.tar.gz: f72b539bc8550b10017dd1b71eb778c9a57e898b1fcb9558d50e6932586e1c8555de22949636880fcda96ce2d4032f91360a643983cba4293ef9e08672e46b0a
|
data/LICENSE.txt
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 3v0k4
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
# Ser
|
|
2
|
+
|
|
3
|
+
<div align="center">
|
|
4
|
+
<img width="250" width="250" src=".github/images/ser.png" />
|
|
5
|
+
</div>
|
|
6
|
+
|
|
7
|
+
<br />
|
|
8
|
+
|
|
9
|
+
Ser(ve) your web app with HTTPS to any device on your network (mDNS):
|
|
10
|
+
- Use convenient domain names without ports (`https://app.local` vs `http://127.0.0.1:3000`)
|
|
11
|
+
- Use mDNS for `.local` domains, so you can visit them from your phone or any other device connected to the same network
|
|
12
|
+
- Locally-trusted development certificates (read on [filosottile/mkcert](https://github.com/filosottile/mkcert) how to trust certificates on mobile devices)
|
|
13
|
+
|
|
14
|
+
Use-cases:
|
|
15
|
+
- Simulate production-like subdomains (e.g., `blog.example.com`, `api.example.com`)
|
|
16
|
+
- Test cookies scoped to specific domains
|
|
17
|
+
- Preview multi-tenant routing (e.g., `tenant1.example.com`, `tenant2.example.com`)
|
|
18
|
+
- Use third-party APIs that need HTTPS
|
|
19
|
+
|
|
20
|
+
## Installation
|
|
21
|
+
|
|
22
|
+
You can install ser with Go:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
go install github.com/3v0k4/ser
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Ser is also distributed as a Ruby gem. Because Ser is written in Go, several pre-built platform-specific binaries are available. Installing the gem will automatically fetch the appropriate binary for your platform.
|
|
29
|
+
|
|
30
|
+
To install it, add it to your application's Gemfile:
|
|
31
|
+
|
|
32
|
+
```ruby
|
|
33
|
+
gem 'ser'
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Or install it globally:
|
|
37
|
+
|
|
38
|
+
```sh
|
|
39
|
+
$ gem install ser
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Usage
|
|
43
|
+
|
|
44
|
+
If your app server listens on `http://localhost:3000`, you can just run `ser [APP-SERVER]` and visit `https://ser.local` on any device connected to the same network.
|
|
45
|
+
|
|
46
|
+
Otherwise, you can customise the addresses with ENVs:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
Usage: ser CMD
|
|
50
|
+
|
|
51
|
+
Ser(ve) your web app with HTTPS to any device on your network (mDNS):
|
|
52
|
+
Provisions HTTPS certificates for FROM
|
|
53
|
+
Executes CMD
|
|
54
|
+
Proxies requests from FROM to TO
|
|
55
|
+
Starts a mDNS server to announce FROM (if .local)
|
|
56
|
+
|
|
57
|
+
Arguments:
|
|
58
|
+
CMD the command that launches the app server (it must expect requests at TO)
|
|
59
|
+
|
|
60
|
+
ENVs:
|
|
61
|
+
FROM (default: https://ser.local) comma-separated HTTPS domains you want to access
|
|
62
|
+
SER_FROM same as above but takes precedence
|
|
63
|
+
TO (default: http://localhost:3000) address where CMD expects requests
|
|
64
|
+
SER_TO same as above but takes precedence
|
|
65
|
+
|
|
66
|
+
Examples:
|
|
67
|
+
ser bundle exec rails server
|
|
68
|
+
# Access the Rails app at https://ser.local (from your phone)
|
|
69
|
+
|
|
70
|
+
FROM=https://app.local TO=http://127.0.0.1:8080 ser npm run start
|
|
71
|
+
# Access the Node app at https://app.local (from your phone)
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Development
|
|
75
|
+
|
|
76
|
+
### Testing
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
make test
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Running || Building
|
|
83
|
+
|
|
84
|
+
You can run the application using `go run`:
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
go run ./cmd/ser
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
You can also build for the current environment (`bin/`) using the Makefile:
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
make build
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
To build binaries for all supported architectures and operating systems (`dist/`), use:
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
make dist
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### Releasing
|
|
103
|
+
|
|
104
|
+
In order to ship the platform-specific binary inside a gem, multiple gems are released, one for each platform. The `rake release` task builds all the necessary gems.
|
|
105
|
+
|
|
106
|
+
Checklist:
|
|
107
|
+
|
|
108
|
+
- Update version & changelog:
|
|
109
|
+
- [ ] Update `lib/ser/version.rb`
|
|
110
|
+
- [ ] Update `CHANGELOG.md`
|
|
111
|
+
- [ ] Commit and `git tag vX.Y.Z`
|
|
112
|
+
|
|
113
|
+
- Build native gems:
|
|
114
|
+
- [ ] `rake clobber` (to clean up any old packages)
|
|
115
|
+
- [ ] `rake package`
|
|
116
|
+
|
|
117
|
+
- Push gems:
|
|
118
|
+
- [ ] `for g in pkg/*.gem ; do gem push $g ; done`
|
|
119
|
+
- [ ] `git push`
|
|
120
|
+
|
|
121
|
+
## Contributing
|
|
122
|
+
|
|
123
|
+
Bug reports and pull requests are welcome on [GitHub](https://github.com/3v0k4/ser).
|
|
124
|
+
|
|
125
|
+
## License
|
|
126
|
+
|
|
127
|
+
The module is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
data/exe/ser
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
|
|
3
|
+
PLATFORM = [ :cpu, :os ].map { |m| Gem::Platform.local.send(m) }.join("-")
|
|
4
|
+
EXECUTABLE = File.expand_path(File.join(__dir__, PLATFORM, "ser"))
|
|
5
|
+
|
|
6
|
+
if File.exist?(EXECUTABLE)
|
|
7
|
+
exec(EXECUTABLE, *ARGV)
|
|
8
|
+
else
|
|
9
|
+
STDERR.puts("ERROR: Unsupported platform: #{PLATFORM}")
|
|
10
|
+
exit 1
|
|
11
|
+
end
|
data/lib/ser/version.rb
ADDED
data/lib/ser.rb
ADDED
metadata
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: ser
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.1.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- 3v0k4
|
|
8
|
+
bindir: exe
|
|
9
|
+
cert_chain: []
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
|
+
dependencies: []
|
|
12
|
+
description: |
|
|
13
|
+
Ser(ve) your web app with HTTPS to any device on your network (mDNS):
|
|
14
|
+
1. Use convenient domain names without ports (https://app.local vs http://127.0.0.1:3000);
|
|
15
|
+
2. Use mDNS for .local domains, so you can visit them from your phone or any other device connected to the same network;
|
|
16
|
+
3. Locally-trusted development certificates (read on filosottile/mkcert how to trust certificates on mobile devices).
|
|
17
|
+
|
|
18
|
+
Use-cases:
|
|
19
|
+
1. Simulate production-like subdomains (e.g., blog.example.com, api.example.com);
|
|
20
|
+
2. Test cookies scoped to specific domains;
|
|
21
|
+
3. Preview multi-tenant routing (e.g., tenant1.example.com, tenant2.example.com);
|
|
22
|
+
4. Use third-party APIs that need HTTPS.
|
|
23
|
+
email:
|
|
24
|
+
- riccardo.odone@gmail.com
|
|
25
|
+
executables:
|
|
26
|
+
- ser
|
|
27
|
+
extensions: []
|
|
28
|
+
extra_rdoc_files: []
|
|
29
|
+
files:
|
|
30
|
+
- LICENSE.txt
|
|
31
|
+
- README.md
|
|
32
|
+
- exe/ser
|
|
33
|
+
- lib/ser.rb
|
|
34
|
+
- lib/ser/version.rb
|
|
35
|
+
homepage: https://github.com/3v0k4/ser
|
|
36
|
+
licenses:
|
|
37
|
+
- MIT
|
|
38
|
+
metadata:
|
|
39
|
+
homepage_uri: https://github.com/3v0k4/ser
|
|
40
|
+
rubygems_mfa_required: 'true'
|
|
41
|
+
rdoc_options: []
|
|
42
|
+
require_paths:
|
|
43
|
+
- lib
|
|
44
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
45
|
+
requirements:
|
|
46
|
+
- - ">="
|
|
47
|
+
- !ruby/object:Gem::Version
|
|
48
|
+
version: 2.3.0
|
|
49
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
50
|
+
requirements:
|
|
51
|
+
- - ">="
|
|
52
|
+
- !ruby/object:Gem::Version
|
|
53
|
+
version: '0'
|
|
54
|
+
requirements: []
|
|
55
|
+
rubygems_version: 3.6.9
|
|
56
|
+
specification_version: 4
|
|
57
|
+
summary: Ser(ve) your web app with HTTPS to any device on your network (mDNS)
|
|
58
|
+
test_files: []
|