461 Commits

Author SHA1 Message Date
Jesse Peterson
42e157aabc website: minimize circular dependency by using stdlib log
The vanity Netlify function was depending on micromdm.io/v2/pkg/log for
logging, creating an unnecessary circular dependency with the main
repository. Replace it with stdlib log.Logger to break this dependency.

Verified:
```shell
$ cd website && go build ./netlify-functions/vanity/
```
2026-03-18 11:47:27 -07:00
Jesse Peterson
0b7fd70d65 add blog post re: micromdm v1 maintenance mode 2025-06-20 15:09:38 -07:00
Jesse Peterson
2fa0a410df bump action versions to try and fix failing test 2025-02-05 22:14:16 -08:00
Jesse Peterson
5b408eec46 blog: add hover anchor links 2025-02-04 13:25:00 -08:00
Jesse Peterson
7d36a200f6 New blog post: SCEPping stone 2024-07-15 09:57:30 -07:00
Jesse Peterson
cf3ab77727 update go version 2024-07-15 09:43:16 -07:00
Jesse Peterson
4329b5e5fa website: update blog preview template to newer hugo syntax 2024-07-12 19:29:01 -07:00
Jesse Peterson
c9d2acfe78 Update rel=me link for Mastodon verified link 2023-01-18 12:51:44 -08:00
Jesse Peterson
f479542965 Add rel=me link to https://fosstodon.org/@micromdm for verified link 2022-12-01 11:30:22 -08:00
Jesse Peterson
dedbdd7c77 Fix Hugo 0.93.0 deprecated/removed items 2022-11-26 15:20:51 -08:00
Jesse Peterson
e96b8d0cf5 New blog post: Tinkering with Declarative Management (#758) 2021-06-10 14:11:47 -07:00
Jesse Peterson
cf64cd5897 Fix links 2021-06-01 13:41:20 -07:00
Jesse Peterson
52f1a401d4 New blog: Introducing NanoMDM 2021-06-01 13:32:34 -07:00
Clayton Burlison
164d2284f2 Add single quote to fix log command (#753) 2021-05-25 21:06:46 -07:00
William Theaker
be70ba8998 Fix twitter URL in v2 blog post (#752) 2021-05-25 21:00:02 -07:00
Victor Vrantchan
b39018f84d Add viewer info to nav. 2021-02-20 22:03:04 -05:00
Victor Vrantchan
2f601dd30d Add FindUser method.
Returns the user by id.
2021-02-20 21:53:58 -05:00
Victor Vrantchan
b69f92e907 redirect to / after login 2021-02-20 21:39:59 -05:00
Victor Vrantchan
5202ca027d Create a simple migrations subcommand. 2021-02-20 21:26:27 -05:00
Victor Vrantchan
7d18671835 remove commented out code 2021-02-20 20:59:14 -05:00
Victor Vrantchan
39ef8166b6 Add siteName to page nav. 2021-02-20 20:52:36 -05:00
Victor Vrantchan
ec514fd70e add form data to context
When calling frontend.Fail pass the form data in the context.
In case of an error, returns the values back so they're not reset on the
page.
2021-02-20 19:02:45 -05:00
Victor Vrantchan
695856b205 Handle unique constraint for user registration.
Returns an error if the same username or email already exists.
2021-02-20 18:24:39 -05:00
Victor Vrantchan
6caa73b637 bump go version in CI 2021-02-20 17:53:38 -05:00
Victor Vrantchan
7fd2c8b33f Return 404 errors for missing resources.
Update login and register forms to return the right errors when the user
info can't be found.
2021-02-20 17:48:04 -05:00
Victor Vrantchan
524f9384f5 update dependencies. 2021-02-20 17:23:58 -05:00
Victor Vrantchan
5e91d2d943 blog big-sur-softwareupdate.md 2020-12-17 22:26:19 -05:00
Victor Vrantchan
bd0ffcb59f Update dependencies. 2020-11-26 14:37:14 -05:00
Victor Vrantchan
7d75f581ec Added users sessions (#696)
Added login/logout pages and respective database methods for handling users sessions.
2020-08-08 17:15:34 -04:00
Victor Vrantchan
49c3a04637 Create viewer package.
The "viewer" is the user/authenticated session browsing the site.
2020-07-25 20:38:59 -04:00
Victor Vrantchan
1d698cd23e Add account management web pages (#694)
Added internal/frontend/account to implement account management code. 
Added user registration templates and handlers.
Set up a sqlite and postgres database in package main.
2020-07-25 20:34:59 -04:00
Victor Vrantchan
cf94d41d9b Add validation error handling to framework 2020-07-25 20:28:46 -04:00
Victor Vrantchan
a8dc606beb Add CSRF middleware to all pages
The frontend server now runs a CSRF middleware on all paths except
/assets/. To enable CSRF the -csrf_key flag must be set. Instead of
enforcing the flag is set, I opted to log that CSRF is disabled. Not
running CSRF means I can test with curl.

In the future I might enforce that the flag must be set in release builds.
2020-07-22 23:22:03 -04:00
Victor Vrantchan
a9900916bf Allow debug level logs at startup.
Added a -debug flag which causes the logger in main to start with debug
level logs.
2020-07-22 22:49:23 -04:00
Victor Vrantchan
68d5c88941 move pidfile to cliFlags 2020-07-22 22:20:19 -04:00
Victor Vrantchan
c71958384e build a simple web framework. (#691)
Added the basics for HTML templates, serving assets and so on.
2020-07-17 12:41:33 -04:00
Victor Vrantchan
7e811b8e56 Added data layer.
Initial structure for database clients. Exposes a user package with
SQLite and PostgreSQL implementations.
2020-07-15 10:17:00 -04:00
Victor Vrantchan
085120973a Moved ffOptions from top level block.
Moved directly into the root command struct. For clarity, since it's not
used anywhere else. Might consider something else if there are
sub-commands with shared options.

Also added `MICROMDM` as the env var prefix.
2020-07-11 22:57:23 -04:00
Victor Vrantchan
ba9d2a9601 Add signal tests for main (#685)
Added tests to validate the process receiving signals:
- SIGTERM and SIGINT exit.
- SIGUSR2 swaps logs

Removed the empty Fprintln in main. Turns out stderr isn't thread safe
to write from multiple locations. The logger, which is otherwise the
only stderr writing goroutine creates a sync writer. But the stderr in
main remains unsafe. This is something to fix later?

There are also races happening with the swap log test, but only when the
test runs in parallel. I'm not sure what's happening there... added a
flag to make this test synchronous for now.

Tests that depend on signals don't run on windows. That's a big todo.
I moved SIGUSR2 behind build tags, so the binary will at least compile.
2020-07-11 14:51:31 -04:00
Victor Vrantchan
dc6fa6fb53 Added command test.
- cmd/micromdm now has a simple test.
- changed flagset defaults to support testing and remove default side
effects. Go flags write to os.Stderr and call os.Exit(2) when parsing
usage.
2020-07-10 08:31:29 -04:00
Victor Vrantchan
b5c0644ff5 add build action 2020-07-10 07:33:51 -04:00
Victor Vrantchan
4dfecb7113 add version package
Added version info to binary.
Added the go version dependency to read executable info.
Original version package from 654e10aaab/version
2020-07-06 07:16:17 -04:00
Victor Vrantchan
a53efd9c37 add cmd/micromdm
Added initial structure for package main.
2020-07-05 18:26:42 -04:00
Victor Vrantchan
d3aadc271d log: add trace id and http request logs.
- Added the concept of a "trace id", a unique ID which gets associated
with every log/request by default. Will eventually use
opentelemetry/opentracing, or perhaps something better... Still very
alpha quality + lots of dependencies/API surface to bring in. For the
purpose of MicroMDM, a unique identifier per request is fine.

- Added HTTP logging middleware.
2020-07-05 15:04:00 -04:00
Victor Vrantchan
324a4ade8b blog wwdc20-what-s-new-in-managing.md 2020-06-30 08:07:28 -04:00
Arjen van Bochoven
693a71b498 Update README.md (#680) 2020-06-29 12:16:51 -04:00
Victor Vrantchan
975b4976e5 blog v2dev-status-update-1.md 2020-06-29 10:31:59 -04:00
Victor Vrantchan
038fd359ae use pkg instead of internal
internal/ is too limiting, and by using pkg/ we can use the libraries in
our own projects elsewhere. The netlify-functions/vanity service uses
pkg/log already.
2020-06-29 08:48:49 -04:00
Victor Vrantchan
3b0e16d116 add importpath link 2020-06-29 08:43:07 -04:00
Victor Vrantchan
0a847bd9ce add netlify config
Added configuration for building and hosting the website/ directory on
netlify.

Added lambda function to support vanity URLs for micromdm.io/v2.
2020-06-28 11:38:47 -04:00